This patch should be applied to an un-modified XFree86 version 4.3.0 source tree. It is patch 3 of 4 patches that will will convert the source tree to XFree86 version 4.4.0. To apply this patch, run the following from the directory containing your 'xc' directory: patch -p0 -E < XFree86-4.3.0-4.4.0.diff1 patch -p0 -E < XFree86-4.3.0-4.4.0.diff2 patch -p0 -E < XFree86-4.3.0-4.4.0.diff3 patch -p0 -E < XFree86-4.3.0-4.4.0.diff4 sh XFree86-4.3.0-4.4.0-cleanup.sh gzip -d < XFree86-4.3.0-4.4.0-diff0.tgz | tar vxf - ------------------------------------------------------------------------------- Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile:3.12 xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile:3.12 Wed Jan 17 17:12:20 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile Sat Feb 28 21:41:54 2004 @@ -1,83 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:04 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level1/Imakefile,v 3.12 2001/01/17 22:12:20 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDdpexCDebugFlags -#define PexDdpexCDebugFlags ServerCDebugFlags -#endif - -XCOMM -D defines for ddpex: -XCOMM DDTEST turns on some fprintf(stderr...)s for debugging - - DEFINES = PexDdpexDefines -CDEBUGFLAGS = PexDdpexCDebugFlags - - PEXSERVINC = ../../../include -DDPEXINCLUDE = ../include - -INCLUDES = -I. \ - -I$(DDPEXINCLUDE) \ - -I$(XINCLUDESRC) \ - -I$(PEXSERVINC) \ - -I$(SERVERSRC)/include - -SRCS = miDDCtoGC.c \ - miListUtil.c \ - miLvl1Tab.c \ - miRndFArea.c \ - miRndPLine.c \ - miRndMarkr.c \ - miRndText.c \ - miRndTStrip.c \ - miPck1Prim.c \ - mi52stubs.c - -OBJS = miDDCtoGC.o \ - miListUtil.o \ - miLvl1Tab.o \ - miRndFArea.o \ - miRndPLine.o \ - miRndMarkr.o \ - miRndText.o \ - miRndTStrip.o \ - miPck1Prim.o \ - mi52stubs.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ddpex1,$(OBJS)) - -LintLibraryTarget(dp1, $(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/mi52stubs.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/mi52stubs.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/mi52stubs.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/mi52stubs.c:3.7 Fri Dec 14 14:57:15 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/mi52stubs.c Sat Feb 28 21:41:54 2004 @@ -1,181 +0,0 @@ -/* $Xorg: mi52stubs.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -******************************************************************/ - -#include "X.h" -#include "PEX.h" -#include "pexError.h" -#include "pex_site.h" -#include "pexLookup.h" -#include "ddpex4.h" - -ErrorCode -PutZBuffer(prend, x, y, width, height, normalizedValues, numValues, Zbuffer) - ddRendererStr prend; - int x, y; - unsigned int width, height; - pexSwitch normalizedValues; - unsigned int numValues; - ddPointer *Zbuffer; -{ - return Success; -} - - -ErrorCode -SetStructurePermission(pstr, permission) - diStructHandle pstr; - unsigned int permission; -{ - return Success; -} - - -ErrorCode -CopyPixmapToAlpha(prend, pDrawable) - ddRendererStr prend; - DrawablePtr pDrawable; -{ - return Success; -} - - -ErrorCode -InitMultipass(prend) - ddRendererStr prend; -{ - return Success; -} - - -ErrorCode -GetZBuffer(prend, x, y, width, height, normalizedValues, numValues, - undefinedValues, pPEXBuffer) - ddRendererStr prend; - int x, y; - unsigned int width, height; - pexSwitch normalizedValues; - ddULONG *numValues; - pexSwitch *undefinedValues; - ddBuffer *pPEXBuffer; -{ - return Success; -} - - -ErrorCode -ClearRenderer(prend, clearControl) - ddRendererStr prend; - pexBitmask clearControl; -{ - return Success; -} - - -ErrorCode -NextPassWoutReply(prend, multipass_control) - ddRendererStr prend; - unsigned int multipass_control; -{ - return Success; -} - - -ErrorCode -CopyZBufferToPixmap(prend, pDrawable) - ddRendererStr prend; - DrawablePtr pDrawable; -{ - return Success; -} - - -ErrorCode -CopyPipelineStateToPC(prend, ppc, itemMask) - ddRendererStr prend; - ddPCStr *ppc; - unsigned int itemMask; -{ - return Success; -} - - -ErrorCode -CopyAlphaToPixmap(prend, pDrawable) - ddRendererStr prend; - DrawablePtr pDrawable; -{ - return Success; -} - - -ErrorCode -NextPass(prend, multipass_control, count) - ddRendererStr prend; - unsigned int multipass_control; - ddLONG *count; -{ - return Success; -} - - -ErrorCode -FlushRenderer(prend, flushFlag) - ddRendererStr prend; - pexSwitch flushFlag; -{ - return Success; -} - - -ErrorCode -CopyPixmapToZBuffer(prend, pDrawable) - ddRendererStr prend; - DrawablePtr pDrawable; -{ - return Success; -} - - -ErrorCode -SetElementPointerAtPickID(pstr, pickId, offset) - diStructHandle pstr; - int pickId; - int offset; -{ - return Success; -} - - -ErrorCode -CopyPCToPipelineState(prend, ppc, itemMask) - ddRendererStr *prend; - ddPCStr *ppc; - pexBitmask itemMask; -{ - return Success; -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c:3.8 Fri Dec 14 14:57:16 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c Sat Feb 28 21:41:54 2004 @@ -1,593 +0,0 @@ -/* $Xorg: miDDCtoGC.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level1/miDDCtoGC.c,v 3.8 2001/12/14 19:57:16 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "gcstruct.h" -#include "miLineDash.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miDDC_to_GC_polyline - | - | Function Description: - | Initializes the attributes in a GC in order to correctly - | render a polyline. Currently, therefore, the following - | attributes are set: - | - | line width - | dashing - | - | Note(s): - | This routine currently performs no optimization of this - | process. For example, no effort is made to globally check - | whether this process is even necessary. - | Note that this routine assumes that the proper defaults - | are set for the GC attributes not used by PEX (attributes - | such as line join style or end cap style). - | - --*/ - -ddpex3rtn -miDDC_to_GC_polyline(pRend, pddc, pgc) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* dd Context handle */ -GCPtr pgc; /* X GC handle */ -{ - ddLONG gcmask = 0; - ddUSHORT status; - ddColourSpecifier linecolour; - miColourEntry *plinecolour; - ddULONG colourindex; - ddSHORT linewidth; - - - /* - * Set line colour. - * The colour must be processed according - * to the contents of the current colour approximation table - * entry to compute the proper direct colour. - */ - - /* - * Calculate final color index. - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - linecolour = pddc->Static.attrs->echoColour; - else - linecolour = pddc->Static.attrs->lineColour; - - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &linecolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pgc->fgPixel) { - gcmask |= GCForeground; - pgc->fgPixel = colourindex; - } - - /* - * Set line width. PEX line width is defined as - * the product of the line width scale factor (lineWidth in - * the PC) and the workstation nominal line width (1 for X). - * therefore the linewidth is simply equal to the line width - * scale factor. Note that this code sets lineWidth of 1 - * to ddx linewidth 0. Although this is technically wrong, - * it sure does speed things up! - */ - if (pddc->Static.attrs->lineWidth <= 1.0) linewidth = 0; - else linewidth = (ddSHORT)pddc->Static.attrs->lineWidth; - - /* Only set GC value if necessary */ - if (linewidth != pgc->lineWidth) { - gcmask |= GCLineWidth; - pgc->lineWidth = linewidth; - } - - /* - * Set the line dash. PEX defines three line dash - * types: solid (no dashing), dashed (equally spaced dashes) - * dotted (equally spaced dots) and dash dot (alternating - * dots and dashes). Note that the default dashing is - * defined in miLineDash.h. - */ - /* Only set dashes if necessary */ - switch (pddc->Static.attrs->lineType) { - - case PEXLineTypeSolid: - if (pgc->lineStyle != LineSolid) { - gcmask |= GCLineStyle; - pgc->lineStyle = LineSolid; - } - break; - - case PEXLineTypeDashed: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dashed_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashed, - sizeof(mi_line_dashed)); - - } else if (pgc->dash != mi_line_dashed) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dashed_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashed, - sizeof(mi_line_dashed)); - } - break; - - case PEXLineTypeDotted: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dotted_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dotted, - sizeof(mi_line_dotted)); - - } else if (pgc->dash != mi_line_dotted) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dotted_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dotted, - sizeof(mi_line_dotted)); - } - break; - - case PEXLineTypeDashDot: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dashdot_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashdot, - sizeof(mi_line_dashdot)); - - } else if (pgc->dash != mi_line_dashdot) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dashdot_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashdot, - sizeof(mi_line_dashdot)); - } - break; - } - - /* Register changes with ddx */ - if (gcmask) { - pgc->serialNumber |= GC_CHANGE_SERIAL_BIT; - pgc->stateChanges |= gcmask; - (*pgc->funcs->ChangeGC)(pgc, gcmask); - } - - /* Clear polyline GC change flag */ - pddc->Static.misc.flags &= ~POLYLINEGCFLAG; - - return (Success); -} - -/*++ - | - | Function Name: miDDC_to_GC_edges - | - | Function Description: - | Initializes the attributes in a GC in order to correctly - | render the edges of a fill area. Currently, therefore, - | the following attributes are set: - | - | line width - | dashing - | - | Note(s): - | Note, that no colour initialization is performed - this attribute - | changes too often within the rendering pipeline. - | Lastly, note that this routine assumes that the proper defaults - | are set for the GC attributes not used by PEX (attributes - | such as stipple mask, etc...) - | - --*/ - -ddpex3rtn -miDDC_to_GC_edges(pRend, pddc, pgc) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* dd Context handle */ -GCPtr pgc; /* X GC handle */ -{ - ddLONG gcmask = 0; - ddUSHORT status; - ddColourSpecifier edgecolour; - miColourEntry *pedgecolour; - ddULONG colourindex; - ddSHORT edgewidth; - - - /* - * Set edge colour. - * The colour must be processed according - * to the contents of the current colour approximation table - * entry to compute the proper direct colour. - */ - - /* - * Calculate final color index. - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - edgecolour = pddc->Static.attrs->echoColour; - else - edgecolour = pddc->Static.attrs->edgeColour; - - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &edgecolour, &colourindex); - - - /* Only set GC value if necessary */ - if (colourindex != pgc->fgPixel) { - gcmask |= GCForeground; - pgc->fgPixel = colourindex; - } - - /* - * Set edge width. PEX edge width is defined as - * the product of the edge width scale factor (lineWidth in - * the PC) and the workstation nominal line width (1 for X). - * therefore the edge is simply equal to the edge width - * scale factor. Note that this code sets edgeWidth of 1 - * to ddx linewidth 0. Although this is technically wrong, - * it sure does speed things up! - */ - if (pddc->Static.attrs->edgeWidth <= 1.0) edgewidth = 0; - else edgewidth = (ddSHORT)pddc->Static.attrs->edgeWidth; - - /* Only set GC value if necessary */ - if (edgewidth != pgc->lineWidth) { - gcmask |= GCLineWidth; - pgc->lineWidth = edgewidth; - } - - /* - * Next, set the edge dash. PEX defines three line dash - * types: solid (no dashing), dashed (equally spaced dashes) - * dotted (equally spaced dots) and dash dot (alternating - * dots and dashes). Note that the default dashing is - * defined in miLineDash.h. - */ - switch (pddc->Static.attrs->edgeType) { - - case PEXLineTypeSolid: - if (pgc->lineStyle != LineSolid) { - gcmask |= GCLineStyle; - pgc->lineStyle = LineSolid; - } - break; - - case PEXLineTypeDashed: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dashed_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashed, - sizeof(mi_line_dashed)); - - } else if (pgc->dash != mi_line_dashed) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dashed_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashed, - sizeof(mi_line_dashed)); - } - break; - - case PEXLineTypeDotted: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dotted_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dotted, - sizeof(mi_line_dotted)); - - } else if (pgc->dash != mi_line_dotted) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dotted_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dotted, - sizeof(mi_line_dotted)); - } - break; - - case PEXLineTypeDashDot: - if (pgc->lineStyle != LineOnOffDash) { - gcmask |= (GCLineStyle | GCDashList); - pgc->lineStyle = LineOnOffDash; - pgc->numInDashList = mi_line_dashdot_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashdot, - sizeof(mi_line_dashdot)); - - } else if (pgc->dash != mi_line_dashdot) { - gcmask |= GCDashList; - pgc->numInDashList = mi_line_dashdot_length; - if (pddc->Static.misc.flags & NOLINEDASHFLAG) { - pgc->dash = (unsigned char *)xalloc(MAX_LINE_DASH_LENGTH_SIZE); - pddc->Static.misc.flags &= ~NOLINEDASHFLAG; - } - memcpy( (char *)(pgc->dash), (char *)mi_line_dashdot, - sizeof(mi_line_dashdot)); - } - break; - } - - /* Register changes with ddx */ - if (gcmask) { - pgc->serialNumber |= GC_CHANGE_SERIAL_BIT; - pgc->stateChanges |= gcmask; - (*pgc->funcs->ChangeGC)(pgc, gcmask); - } - - /* Clear polyline GC change flag */ - pddc->Static.misc.flags &= ~EDGEGCFLAG; - - return (Success); -} - -/*++ - | - | Function Name: miDDC_to_GC_fill_area - | - | Function Description: - | Initializes the attributes in a GC in order to correctly - | render a fill area. Currently, therefore, - | the following attributes are set: - | - | interior colour - | - | Note(s): - | Note that this routine assumes that the proper defaults - | are set for the GC attributes not used by PEX (attributes - | such as stipple mask, etc...) - | - --*/ - -ddpex3rtn -miDDC_to_GC_fill_area(pRend, pddc, pgc) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* dd Context handle */ -GCPtr pgc; /* X GC handle */ -{ - ddLONG gcmask = 0; - - -} - -/*++ - | - | Function Name: miDDC_to_GC_marker - | - | Function Description: - | Initializes the attributes in a GC in order to correctly - | render a marker. Currently, therefore, - | the following attributes are set: - | - | colour - | - | Note(s): - | Note that this routine assumes that the proper defaults - | are set for the GC attributes not used by PEX (attributes - | such as stipple mask, etc...) - | - --*/ - -ddpex3rtn -miDDC_to_GC_marker(pRend, pddc, pgc) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* dd Context handle */ -GCPtr pgc; /* X GC handle */ -{ - ddLONG gcmask = 0; - ddUSHORT status; - ddColourSpecifier markercolour; - miColourEntry *pmarkercolour; - ddULONG colourindex; - - - /* - * Set the marker colour. - * The colour must be processed according - * to the contents of the current colour approximation table - * entry to compute the proper direct colour. - */ - - /* - * Calculate final color index. - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - markercolour = pddc->Static.attrs->echoColour; - else - markercolour = pddc->Static.attrs->markerColour; - - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &markercolour, &colourindex); - - - /* Only set GC value if necessary */ - if (colourindex != pgc->fgPixel) { - gcmask |= GCForeground; - pgc->fgPixel = colourindex; - } - - /* Register changes with ddx */ - if (gcmask) { - pgc->serialNumber |= GC_CHANGE_SERIAL_BIT; - pgc->stateChanges |= gcmask; - (*pgc->funcs->ChangeGC)(pgc, gcmask); - } - - /* Clear polyline GC change flag */ - pddc->Static.misc.flags &= ~MARKERGCFLAG; - - return (Success); -} - -/*++ - | - | Function Name: miDDC_to_GC_text - | - | Function Description: - | Initializes the attributes in a GC in order to correctly - | render a text. Currently, therefore, - | the following attributes are set: - | - | colour - | - | Note(s): - | Note that this routine assumes that the proper defaults - | are set for the GC attributes not used by PEX (attributes - | such as stipple mask, etc...) - | - --*/ - -ddpex3rtn -miDDC_to_GC_text(pRend, pddc, pgc) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* dd Context handle */ -GCPtr pgc; /* X GC handle */ -{ - ddLONG gcmask = 0; - ddUSHORT status; - ddColourSpecifier textcolour; - miColourEntry *ptextcolour; - ddULONG colourindex; - - /* - * Set text colour. - * The colour must be processed according - * to the contents of the current colour approximation table - * entry to compute the proper direct colour. - */ - - /* - * Calculate final color index. - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - textcolour = pddc->Static.attrs->echoColour; - else - textcolour = pddc->Static.attrs->textColour; - - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &textcolour, &colourindex); - - - /* Only set GC value if necessary */ - if (colourindex != pgc->fgPixel) { - gcmask |= GCForeground; - pgc->fgPixel = colourindex; - } - - /* Register changes with ddx */ - if (gcmask) { - pgc->serialNumber |= GC_CHANGE_SERIAL_BIT; - pgc->stateChanges |= gcmask; - (*pgc->funcs->ChangeGC)(pgc, gcmask); - } - - /* Clear polyline GC change flag */ - pddc->Static.misc.flags &= ~TEXTGCFLAG; - - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miLevel1.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miLevel1.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level1/miLevel1.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miLevel1.c:1.9 Fri Dec 14 14:57:16 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miLevel1.c Sat Feb 28 21:41:54 2004 @@ -1,131 +0,0 @@ -/* $Xorg: miLevel1.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#include "ddpex.h" - -ddpex1rtn -PexTriangle(pRend, pPt1, pPt2, pPt3, pColour1, pColour2, pColour3) -/* in */ - ddRendererPtr pRend; - ddDeviceCoord *pPt1; - ddDeviceCoord *pPt2; - ddDeviceCoord *pPt3; - ddColourSpecifier *pColour1; - ddColourSpecifier *pColour2; - ddColourSpecifier *pColour3; -/* out */ -{ - return(Success); -} - -ddpex1rtn -PexTrapezoid(pRend, pPt1, pPt2, pPt3, pPt4, pColour1, pColour2, pColour3, pColour4) -/* in */ - ddRendererPtr pRend; - ddDeviceCoord *pPt1; - ddDeviceCoord *pPt2; - ddDeviceCoord *pPt3; - ddDeviceCoord *pPt4; - ddColourSpecifier *pColour1; - ddColourSpecifier *pColour2; - ddColourSpecifier *pColour3; - ddColourSpecifier *pColour4; -/* out */ -{ - return(Success); -} - -ddpex1rtn -PexInterpSpan1(pRend, pPt1, pPt2, startColour, numSteps) -/* in */ - ddRendererPtr pRend; - ddDeviceCoord *pPt1; - ddDeviceCoord *pPt2; - ddTableIndex startColour; - ddUSHORT numSteps; -/* out */ -{ - return(Success); -} - -ddpex1rtn -PexInterpSpan2(pRend, pPt1, pPt2, startColour, endColour) -/* in */ - ddRendererPtr pRend; - ddDeviceCoord *pPt1; - ddDeviceCoord *pPt2; - ddTableIndex startColour; - ddTableIndex endColour; -/* out */ -{ - return(Success); -} - -typedef struct { - ddULONG width; - ddULONG height; - ddULONG depth; - ddULONG numBytes; - ddPointer pBytes; -} ddGlyphStr; - -ddpex1rtn -PexGlyph(pRend, pUpperLeft, pForeground, pBackground, pGlyph) -/* in */ - ddRendererPtr pRend; - ddDeviceCoord *pUpperLeft; - ddColourSpecifier *pForeground; - ddColourSpecifier *pBackground; - ddGlyphStr *pGlyph; -/* out */ -{ - return(Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c:3.7 Fri Dec 14 14:57:16 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c Sat Feb 28 21:41:54 2004 @@ -1,347 +0,0 @@ -/* $Xorg: miListUtil.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level1/miListUtil.c,v 3.7 2001/12/14 19:57:16 dawes Exp $ */ - -#include "miRender.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "gcstruct.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miCopyPath - | - | Function Description: - | Copies the data in a path to a second path. - | - | Note(s): - | - --*/ - -ddpex3rtn -miCopyPath(pddc, vinput, voutput, flags) - miDDContext *pddc; /* dd context handle */ - miListHeader *vinput; - miListHeader **voutput; - int flags; -{ - miListHeader *output; - int j; - listofddPoint *pddilist; - listofddPoint *pddolist; - int point_size; - - /* Use the pre-defined 4D list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = vinput->type; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - DD_VertPointSize(vinput->type, point_size); - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((pddolist->numPoints = pddilist->numPoints) <= 0) continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1),point_size); - if (!pddolist->pts.p4Dpt) return(BadAlloc); - - memcpy( (char *)pddolist->pts.p4Dpt, - (char *)pddilist->pts.p4Dpt, - ((int)(pddilist->numPoints))*point_size); - - pddilist++; - pddolist++; - } - - return(Success); -} - -#define VERTEX_FLAG (1 << 0) -#define COLOR_FLAG (1 << 1) -#define NORMAL_FLAG (1 << 2) -#define EDGE_FLAG (1 << 3) -/*++ - | - | Function Name: miFilterPath - | - | Function Description: - | Copies the supplied input path to the output path, - | but only copying the indicated fields. - | - | Note(s): - | - | fields: (1 << 0) - point data - | (1 << 1) - color data - | (1 << 2) - normal data - | (1 << 3) - edge data - | - | any combination of the above flags are valid. - | if the indicated field doesn not exist, it is ignored. - | - --*/ - -ddpex3rtn -miFilterPath(pddc, vinput, voutput, fields) - miDDContext *pddc; /* dd context handle */ - miListHeader *vinput; - miListHeader **voutput; - int fields; -{ - char *in_pt, *out_pt; - listofddPoint *pddilist; - listofddPoint *pddolist; - miListHeader *output; - int in_point_size, out_point_size; - int color_offset, normal_offset, edge_offset; - int vertex_size, color_size; - int i, j; - - /* Use the pre-defined 4D list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = vinput->type; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - if (fields & VERTEX_FLAG) { - if (DD_IsVertFloat(vinput->type)) { - if (DD_IsVert2D(vinput->type)) vertex_size = sizeof(ddCoord2D); - else if (DD_IsVert3D(vinput->type)) vertex_size = sizeof(ddCoord3D); - else vertex_size = sizeof(ddCoord4D); - } else { - if (DD_IsVert2D(vinput->type)) vertex_size = sizeof(ddCoord2DS); - else vertex_size = sizeof(ddCoord3DS); - } - } else DD_UnSetVertCoord(output->type); - - if (fields & COLOR_FLAG) { - DD_VertOffsetColor(vinput->type, color_offset); - if (color_offset < 0) fields &= ~COLOR_FLAG; - else { - if (DD_IsVertIndexed(vinput->type)) - color_size = sizeof(ddIndexedColour); - else if (DD_IsVertRGB8(vinput->type)) - color_size = sizeof(ddRgb8Colour); - else if (DD_IsVertRGB16(vinput->type)) - color_size = sizeof(ddRgb16Colour); - else color_size = sizeof(ddRgbFloatColour); - } - } else DD_UnSetColour(output->type); - - if (fields & NORMAL_FLAG) { - DD_VertOffsetNormal(vinput->type, normal_offset); - if (normal_offset < 0) fields &= ~NORMAL_FLAG; - } else DD_UnSetVertNormal(output->type); - - if (fields & EDGE_FLAG) { - DD_VertOffsetEdge(vinput->type, edge_offset); - if (edge_offset < 0) fields &= ~EDGE_FLAG; - } else DD_UnSetVertEdge(output->type); - - DD_VertPointSize(vinput->type, in_point_size); - DD_VertPointSize(output->type, out_point_size); - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((pddolist->numPoints = pddilist->numPoints) <= 0) continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1),out_point_size); - if (!pddolist->pts.p4Dpt) return(BadAlloc); - out_pt = (char *)pddolist->pts.p4Dpt; - in_pt = (char *)pddilist->pts.p4Dpt; - - for (i = 0; i < pddilist->numPoints; i++) { - if (fields & VERTEX_FLAG) memcpy( out_pt, in_pt, vertex_size); - if (fields & COLOR_FLAG) memcpy( (out_pt+ color_offset), - (in_pt + color_offset), - color_size); - if (fields & NORMAL_FLAG) memcpy( (out_pt+ color_offset), - (in_pt + normal_offset), - sizeof(ddVector3D)); - if (fields & EDGE_FLAG) memcpy( (out_pt+ color_offset), - (in_pt + edge_offset), - sizeof(ddULONG)); - in_pt += in_point_size; - out_pt += out_point_size; - } - - pddilist++; - pddolist++; - } - - return(Success); -} - -/*++ - | - | Function Name: miComputeListBounds - | - | Function Description: - | Computes the extents of the supplied list. - | - | Note(s): - | - --*/ - -ddpex3rtn -miComputeListBounds(pddc, vinput, bounds) -/* in */ - miDDContext *pddc; - miListHeader *vinput; - ddListBounds *bounds; -{ -/* uses */ - char *in_pt; - listofddPoint *pddilist; - int vert_count; - int point_size; - int j; - char first = 1; - - if (DD_IsVert2D(vinput->type)) { - bounds->zmin = bounds->zmax = 0.0; - bounds->wmin = bounds->wmax = 1.0; - } else if (DD_IsVert3D(vinput->type)) { - bounds->wmin = bounds->wmax = 1.0; - } - - pddilist = vinput->ddList; - DD_VertPointSize(vinput->type, point_size); - - /* Now, clip each list */ - - for (j = 0; j < vinput->numLists; j++) { - - /* Skip list if no points */ - if ((vert_count = pddilist->numPoints) <= 0) { - pddilist++; - continue; - } - - in_pt = pddilist->pts.ptr; - - if (first) { - bounds->xmin = bounds->xmax = ((ddCoord4D *)in_pt)->x; - bounds->ymin = bounds->ymax = ((ddCoord4D *)in_pt)->y; - if (DD_IsVert3D(vinput->type)) - bounds->zmin = bounds->zmax = ((ddCoord4D *)in_pt)->z; - else if (DD_IsVert4D(vinput->type)) - bounds->wmin = bounds->wmax = ((ddCoord4D *)in_pt)->w; - first = 0; - } - - /* For each vertex, clip a polyline segment */ - while (vert_count--) { - - if (((ddCoord4D *)in_pt)->x < bounds->xmin) - bounds->xmin = ((ddCoord4D *)in_pt)->x; - if (((ddCoord4D *)in_pt)->x > bounds->xmax) - bounds->xmax = ((ddCoord4D *)in_pt)->x; - if (((ddCoord4D *)in_pt)->y < bounds->ymin) - bounds->ymin = ((ddCoord4D *)in_pt)->y; - if (((ddCoord4D *)in_pt)->y > bounds->ymax) - bounds->ymax = ((ddCoord4D *)in_pt)->y; - - if (DD_IsVert3D(vinput->type)) { - if (((ddCoord4D *)in_pt)->z < bounds->zmin) - bounds->zmin = ((ddCoord4D *)in_pt)->z; - if (((ddCoord4D *)in_pt)->z > bounds->zmax) - bounds->zmax = ((ddCoord4D *)in_pt)->z; - - } else if (DD_IsVert4D(vinput->type)) { - if (((ddCoord4D *)in_pt)->z < bounds->zmin) - bounds->zmin = ((ddCoord4D *)in_pt)->z; - if (((ddCoord4D *)in_pt)->z > bounds->zmax) - bounds->zmax = ((ddCoord4D *)in_pt)->z; - if (((ddCoord4D *)in_pt)->w < bounds->wmin) - bounds->wmin = ((ddCoord4D *)in_pt)->w; - if (((ddCoord4D *)in_pt)->w > bounds->wmax) - bounds->wmax = ((ddCoord4D *)in_pt)->w; - } - - in_pt += point_size; - } - - /* skip to next list */ - pddilist++; - - } - - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miLvl1Tab.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miLvl1Tab.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level1/miLvl1Tab.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miLvl1Tab.c:1.9 Fri Dec 14 14:57:17 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miLvl1Tab.c Sat Feb 28 21:41:54 2004 @@ -1,84 +0,0 @@ -/* $Xorg: miLvl1Tab.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Sun Microsystems, -and The Open Group, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* Level I Rendering routine tables */ - -#include "mipex.h" -#include "miRender.h" - -/* Rendering procedures for ExecuteOCTable */ -extern ddpex2rtn miRenderPolyLine(), - miRenderFillArea(), - miRenderText(), - miRenderMarker(), - miRenderTriStrip(); - -RendTableType RenderPrimitiveTable[] = { - miRenderPolyLine, /* 0 Polylines */ - miRenderFillArea, /* 1 Fill Areas */ - miRenderText, /* 2 Text */ - miRenderMarker, /* 3 Markers */ - miRenderTriStrip, /* 4 Triangle Strips */ -}; - -/* Picking procedures for ExecuteOCTable */ -extern ddpex2rtn miPick1PolyLine(), - miPick1FillArea(), - miPick1Text(), - miPick1Marker(), - miPick1TriStrip(); - -RendTableType PickPrimitiveTable[] = { - miPick1PolyLine, /* 0 Polylines */ - miPick1FillArea, /* 1 Fill Areas */ - miPick1Text, /* 2 Text */ - miPick1Marker, /* 3 Markers */ - miPick1TriStrip, /* 4 Triangle Strips */ -}; - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miPck1Prim.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miPck1Prim.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miPck1Prim.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miPck1Prim.c:3.7 Fri Dec 14 14:57:17 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miPck1Prim.c Sat Feb 28 21:41:54 2004 @@ -1,407 +0,0 @@ -/* $Xorg: miPck1Prim.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#include "miRender.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "miFont.h" -#include "miWks.h" -#include "miText.h" -#include "miClip.h" - - -/*++ - | - | Function Name: miPick1PolyLine - | - | Function Description: - | Handles the level 1picking of Polyline 3D, Polyline 2D, - | Polyline 3D with data OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPick1PolyLine(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - miListHeader *input_list; -{ -/* calls */ - - /* Check if anything is remaining. If so, the pick volume */ - /* intersects the polyline(s). If not, everything has been */ - /* clipped out. Accordingly, update the global Pick_Flag. */ - - if (input_list->numLists > 0) { - pddc->Static.pick.status = PEXOk; - } - return (Success); -} - - -/*++ - | - | Function Name: miPick1Text - | - | Function Description: - | Handles the level 1 picking of Text OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPick1Text(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - miListHeader *input_list; -/* out */ -{ -/* calls */ - - /* Check if anything is remaining. If so, the pick volume */ - /* intersects the polyline(s). If not, everything has been */ - /* clipped out. Accordingly, update the global Pick_Flag. */ - - if (input_list->numLists > 0) { - pddc->Static.pick.status = PEXOk; - } - return (Success); -} - - -/*++ - | - | Function Name: miPick1Marker - | - | Function Description: - | Handles the level 1 picking of Marker OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPick1Marker(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - miListHeader *input_list; -/* out */ -{ -/* calls */ - - /* Check if anything is remaining. If so, the pick volume */ - /* intersects the polymarker(s). If not, everything has been*/ - /* clipped out. Accordingly, update the global Pick_Flag. */ - - if (input_list->numLists > 0) { - pddc->Static.pick.status = PEXOk; - } - return (Success); -} - - -/* - * Function Name: CheckFillAreaPick - * - * Purpose: Check if the input set of points represents a polygon that - * is INSIDE or OUTSIDE of the pick aperture. - * - * Return: Success if the points represent a polygon that is inside. - * Otherwise, return a negative number indicating NO_PICK. - * - */ -static -ddpex2rtn -CheckFAreaPick1 (in_list) -/* in */ - miListHeader *in_list; -/* out */ -{ -/* calls */ - -/* Local variables */ - - listofddPoint *poly_list; - ddPointUnion pt_list; - int pt_size; - ddCoord2D v1, v2; - ddSHORT x_same, y_same; - int i, j; - int vcount, hcount; - - /*----------------------Picking Algorithm-------------------------*/ - /* */ - /* The first step is to look for trivial acceptance. I.E., the re-*/ - /* maining polygon is partially enclosed by the pick aperture and */ - /* at least one point lies completely within the aperture. */ - /* If not, we have a possible degenerate case wherein, the edges */ - /* of the remaining polygon is coinciding with the faces of the */ - /* pick aperture. This also means that all the edges are either */ - /* horizontal or vertical. There can be no 3D diagonal edges. */ - /* */ - /* The algorithm implemented here uses the odd-even rule. The idea*/ - /* is to treat the input points, a pair at a time as an edge of */ - /* the polygon remaining. The edge is tested to see if it is hor- */ - /* -izontal, or vertical or diagonal. Note that we use the 3D def-*/ - /* inition of horizontal, vertical, and diagonal here. A horizon- */ - /* edge is an edge parallel to X or Z axis, a vertical edge is one*/ - /* being parallel to only Y axis, and a diagonal edge is one which*/ - /* is NOT parallel to any of the three axes of the 3D aperture. */ - /* */ - /* Thus, clearly, any diagonal edge present means that the polygon*/ - /* is intersecting the pick aperture and hence a PICK condition is*/ - /* detected. However, if there are no diagonal edges, then we have*/ - /* a degenerate situation with the vertical or horizontal edges at*/ - /* or on the boundaries of the pick aperture. */ - /* Using the odd-even rule it is clear that if there are an odd */ - /* number of vertical edges either to the left or in front of the */ - /* center of the pick aperture, or to the right or in back of the */ - /* center of the pick aperture, then the pick is sorrounded by the*/ - /* polygon and hence is picked. On the other hand, if the number */ - /* of vertical edges is even, then we have the pick aperture OUT-*/ - /* SIDE of the polygon, and thus is not picked. The horizontal */ - /* edges testing come into picture when there are no vertical ones*/ - /* present. The test once again is to check whether the count of */ - /* horizontal edges either to the left or front, or right or back */ - /* of the center of the aperture, is even or odd. If odd, detect */ - /* a PICK, else, detect a NO_PICK. */ - /* */ - /*----------------------------------------------------------------*/ - - /* Test for trivial pick case. i.e., at least one point is fully */ - /* contained within the converted pick aperture in CC. */ - - poly_list = in_list->ddList; /* Initialize poly list pointer */ - - DD_VertPointSize (in_list->type, pt_size); /* Get point size */ - - for (i=0; inumLists; i++, poly_list++) { - - /* Get the pointer to the next points list */ - - pt_list.ptr = poly_list->pts.ptr; - - for (j=0; jddList->numPoints; j++) { - - /* Update pt_list to point to next point */ - - pt_list.ptr += pt_size; - - /* Test for containment within the pick aperture */ - - if ((pt_list.p2DSpt->x > -1) && - (pt_list.p2DSpt->x < 1) && - (pt_list.p2DSpt->y > -1) && - (pt_list.p2DSpt->y < 1)) - - /* This point is fully within the pick aperture. */ - /* No need to test further. Just detect PICK. */ - - return (Success); - } - } - - /* We have a degenerate polygon. Test further to determine if the */ - /* pick aperture is fully or partially enclosed by the polygon. */ - - /* Initialize the vertical and horizontal edge counters */ - - vcount = hcount = 0; - - /* Set up a loop for testing edges and counting vertical edges */ - /* and horizontal edges. */ - - poly_list = in_list->ddList; /* Initialize poly list pointer */ - - for (i=0; inumLists; i++, poly_list++) { /* Do for all Polys */ - - /* Get the pointer to the next points list */ - - pt_list.ptr = poly_list->pts.ptr; - - for (j=0; jddList->numPoints-1; j++) { /* Do for all edges */ - - /* Get the first vertex of current edge */ - - v1.x = pt_list.p2DSpt->x; - v1.y = pt_list.p2DSpt->y; - - /* Update pt_list to point to next point */ - - pt_list.ptr += pt_size; - - /* Get the next vertex of current edge */ - - v2.x = pt_list.p2DSpt->x; - v2.y = pt_list.p2DSpt->y; - - /* Test the edge type and update the vcount and the hcount */ - - if (MI_NEAR_ZERO(v1.x-v2.x)) - x_same = 1; - else - x_same = 0; - - if (MI_NEAR_ZERO(v1.y-v2.y)) - y_same = 1; - else - y_same = 0; - - if ((x_same)&&(v1.x > 0)) - /* Edge is parallel to Y axis AND is to the right */ - /* of the center of pick aperture; Increment vcount*/ - - vcount++; - - if ((y_same)&&(v1.y > 0)) - /* Edge is parallel to X axis AND is to the top of */ - /* the center of pick aperture; Increment the hcount*/ - - hcount++; - - } /* Loop for all edges of current polygon */ - - /* Test if vcount = odd; if so, detect PICK */ - - if (vcount%2) { - return (Success); - } - else { - - /* Else, if vcount == 0, test if hcount = odd; */ - /* if so, detect PICK. */ - - if ((vcount == 0)&&(hcount%2)) return (Success); - } - - continue; /* Try the next polygon for containment test */ - - } /* Loop for all polygons */ - - return (-1); /* Return negative to indicate NO_PICK */ -} - - -/*++ - | - | Function Name: miPick1FillArea - | - | Function Description: - | Handles the level 1 picking of FillArea OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPick1FillArea(pRend, pddc, input_list, input_facet, shape, noedges) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - miListHeader *input_list; - listofddFacet *input_facet; - ddBitmaskShort shape; - ddUCHAR noedges; -/* out */ -{ -/* calls */ - - /* Check for successful polygon pick */ - - if (CheckFAreaPick1 (input_list) == Success) { - pddc->Static.pick.status = PEXOk; - } - return (Success); -} - - -/*++ - | - | Function Name: miPick1TriStrip - | - | Function Description: - | Handles the level 1 picking of Triangle Strip OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPick1TriStrip(pRend, pddc, input_list, input_facet) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - miListHeader *input_list; - listofddFacet *input_facet; -/* out */ -{ -/* calls */ - - /* Check for successful triangle strip pick. */ - /* Note that clipper for triangle strips will*/ - /* NOT generate dengenerate cases and hence */ - /* any remaining vertices will constitute a */ - /* Pick situation. */ - - if ((input_list->numLists) > 0) { - pddc->Static.pick.status = PEXOk; - } - return (Success); -} - - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndFArea.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndFArea.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndFArea.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndFArea.c:3.7 Fri Dec 14 14:57:17 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndFArea.c Sat Feb 28 21:41:54 2004 @@ -1,530 +0,0 @@ -/* $Xorg: miRndFArea.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#define NEED_EVENTS -#include "miRender.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "ddpex2.h" - - -/*++ - | - | Function Name: miRenderFillArea - | - | Function Description: - | Renders fill areas to the screen - | - | Note(s): - | - --*/ - -ddpex3rtn -miRenderFillArea(pRend, pddc, input_list, input_facet, shape, noedges) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - miListHeader *input_list; /* fill area data */ - listofddFacet *input_facet; /* per facet data */ - ddBitmaskShort shape; /* shape hint */ - ddUCHAR noedges; /*ignore edges flag*/ -/* out */ -{ - -/* calls */ - ddpex3rtn miDDC_to_GC_fill_area(); - ddpex3rtn miCopyPath(); - ddpex3rtn miFilterPath(); - ddpex3rtn miRemoveInvisibleEdges(); - - -/* Local variable definitions */ - ddPointUnion in_pt; - ddFacetUnion out_fct; - listofddPoint *pddlist; - listofddFacet *fct_list; - miListHeader *copy_list; - miListHeader *temp_list; - GCPtr pGC; - int point_size, facet_size; - int num_points; - ddULONG colourindex; - ddColourSpecifier intcolour; - miColourEntry *pintcolour; - int j, k; - ddpex3rtn err = Success; - ddUSHORT status = 0; - - - /* - * ddx trashes the input data by adding window offsets. - * Thus, if the data is going to be re-used for rendering - * of edges, it must be saved :-(. - */ - if ((pddc->Static.attrs->edges != PEXOff) && - (!noedges) && - (pddc->Static.attrs->intStyle != PEXInteriorStyleEmpty)) - miCopyPath(pddc, input_list, ©_list, 0); - else copy_list = input_list; - - /* - * Update the fill area GC to reflect the current - * fill area attributes - */ - pGC = pddc->Static.misc.pFillAreaGC; - if (pddc->Static.misc.flags & FILLAREAGCFLAG) - miDDC_to_GC_fill_area(pRend, pddc, pGC); - - /* - * Render that path. - */ - switch (pddc->Static.attrs->intStyle) { - - case PEXInteriorStyleHollow: - { - /* - * The final fill area color is determined by a hierarchy - * of sources. The first source is the by vertex colors. - * If the data has vertex colors, then the final color - * is an average of the vertex colors. If there are no - * vertex colors, then the fill area is set to the facet - * color for the current facet. IF there are no facet colors, - * then the color is determined by the surface color attribute. - */ - - if ( (DD_IsVertColour(input_list->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - /* - * If vertex colors, simply create a facet list. - */ - DDFacetSIZE(DD_FACET_RGBFLOAT, facet_size); - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = DD_FACET_RGBFLOAT; - MI_ALLOCLISTOFDDFACET(fct_list, 1, facet_size); - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = fct_list->facets; - DD_VertPointSize(input_list->type, point_size); - point_size -= sizeof(ddCoord2DS); - - out_fct.pFacetRgbFloat->red = 0.0; - out_fct.pFacetRgbFloat->green = 0.0; - out_fct.pFacetRgbFloat->blue = 0.0; - num_points = 0; - - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - - in_pt = pddlist->pts; - - /* Compute average facet color. Note that we exclude */ - /* the last point from the average, since it is the */ - /* same as the first point */ - for (k = 1; k < pddlist->numPoints; k++) { - in_pt.p2DSpt++; /* skip coord data */ - out_fct.pFacetRgbFloat->red - += in_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += in_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += in_pt.pRgbFloatClr->blue; - in_pt.ptr += point_size; /* skip color and normal */ - num_points++; - } - } - - /* complete average */ - if (num_points > 0) { - out_fct.pFacetRgbFloat->red /= num_points; - out_fct.pFacetRgbFloat->green /= num_points; - out_fct.pFacetRgbFloat->blue /= num_points; - } - /* clamp on saturation */ - if (out_fct.pFacetRgbFloat->red > 1.0) - out_fct.pFacetRgbFloat->red = 1.0; - if (out_fct.pFacetRgbFloat->green > 1.0) - out_fct.pFacetRgbFloat->green = 1.0; - if (out_fct.pFacetRgbFloat->blue > 1.0) - out_fct.pFacetRgbFloat->blue = 1.0; - - /* new facet colors override input ones */ - fct_list->numFacets = 1; - input_facet = fct_list; - } - - /* Remove all data from vertex data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - if (err = miFilterPath(pddc, input_list, &temp_list, 1)) - return(err); - input_list = temp_list; - } - - if ( (input_facet) && - (input_facet->numFacets > 0) && - (DD_IsFacetColour(input_facet->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - - /* Compute index value for ddx */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour.colourType = PEXRgbFloatColour; - intcolour.colour.rgbFloat = *input_facet->facets.pFacetRgbFloat; - } - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render each bound as a polyline */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - - if (pddlist->numPoints > 0) { - - /* Call ddx to render the polygon */ - (*GetGCValue(pGC, ops->Polylines)) - (pRend->pDrawable, - pGC, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - } - } - - else { - - /* - * If no vertex or facet colors, use surface attributes. - * Surface attributes are set to highlight colour - * if highlighting - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else - intcolour = pddc->Static.attrs->surfaceColour; - - miColourtoIndex( pRend, - pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render each bound as a polyline */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) - if (pddlist->numPoints > 0) - /* Call ddx to render the polygon */ - (*GetGCValue(pGC, ops->Polylines)) - (pRend->pDrawable, - pGC, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - break; - } - - /* Note that patterns and hatching are currently not implemented */ - case PEXInteriorStylePattern: - case PEXInteriorStyleHatch: - case PEXInteriorStyleSolid: - { - /* - * The final fill area color is determined by a hierarchy - * of sources. The first source is the by vertex colors. - * If the data has vertex colors, then the final color - * is an average of the vertex colors. If there are no - * vertex colors, then the fill area is set to the facet - * color for the current facet. IF there are no facet colors, - * then the color is determined by the surface color attribute. - */ - - if ( (DD_IsVertColour(input_list->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - /* - * If vertex colors, simply create a facet list. - */ - DDFacetSIZE(DD_FACET_RGBFLOAT, facet_size); - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = DD_FACET_RGBFLOAT; - MI_ALLOCLISTOFDDFACET(fct_list, 1, facet_size); - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = fct_list->facets; - DD_VertPointSize(input_list->type, point_size); - point_size -= sizeof(ddCoord2DS); - - out_fct.pFacetRgbFloat->red = 0.0; - out_fct.pFacetRgbFloat->green = 0.0; - out_fct.pFacetRgbFloat->blue = 0.0; - num_points = 0; - - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - - in_pt = pddlist->pts; - - /* Compute average facet color. Note that we exclude */ - /* the last point from the average, since it is the */ - /* same as the first point */ - for (k = 1; k < pddlist->numPoints; k++) { - in_pt.p2DSpt++; /* skip coord data */ - out_fct.pFacetRgbFloat->red - += in_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += in_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += in_pt.pRgbFloatClr->blue; - in_pt.ptr += point_size; /* skip color and normal */ - num_points++; - } - } - - /* complete average */ - if (num_points > 0) { - out_fct.pFacetRgbFloat->red /= num_points; - out_fct.pFacetRgbFloat->green /= num_points; - out_fct.pFacetRgbFloat->blue /= num_points; - } - /* clamp on saturation */ - if (out_fct.pFacetRgbFloat->red > 1.0) - out_fct.pFacetRgbFloat->red = 1.0; - if (out_fct.pFacetRgbFloat->green > 1.0) - out_fct.pFacetRgbFloat->green = 1.0; - if (out_fct.pFacetRgbFloat->blue > 1.0) - out_fct.pFacetRgbFloat->blue = 1.0; - - /* new facet colors override input ones */ - fct_list->numFacets = 1; - input_facet = fct_list; - } - - /* Remove all data from vertex data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - if (err = miFilterPath(pddc, input_list, &temp_list, 1)) - return(err); - input_list = temp_list; - } - - if ( (input_facet) && - (input_facet->numFacets > 0) && - (DD_IsFacetColour(input_facet->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - - /* Compute index value for ddx */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour.colourType = PEXRgbFloatColour; - intcolour.colour.rgbFloat = *input_facet->facets.pFacetRgbFloat; - } - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render the polygon. */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - - if (pddlist->numPoints > 0) { - - /* Call ddx to render the polygon */ - (*GetGCValue(pGC, ops->FillPolygon)) - (pRend->pDrawable, - pGC, - shape != PEXUnknownShape ? shape : PEXComplex, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - } - } - - else { - - /* - * If no vertex or facet colors, use surface attributes. - * Surface attributes are set to highlight colour - * if highlighting - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else - intcolour = pddc->Static.attrs->surfaceColour; - - miColourtoIndex( pRend, - pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render each bound as a polyline */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) - if (pddlist->numPoints > 0) - /* Call ddx to render the polygon */ - (*GetGCValue(pGC, ops->FillPolygon)) - (pRend->pDrawable, - pGC, - shape != PEXUnknownShape ? shape : PEXComplex, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - break; - } - - case PEXInteriorStyleEmpty: - break; - } - - /* - * Now check to see if fill area edges are to be drawn - */ - if ((pddc->Static.attrs->edges != PEXOff) && (!noedges)) { - - /* If edge flags, remove invisible edges */ - if (DD_IsVertEdge(copy_list->type)) - miRemoveInvisibleEdges(pddc, copy_list, &input_list); - else input_list = copy_list; - - /* Remove all data from vertex data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - if (err = miFilterPath(pddc, input_list, ©_list, 1)) - return(err); - input_list = copy_list; - } - - /* - * Update the fill area GC to reflect the current - * fill area attributes - */ - if (pddc->Static.misc.flags & EDGEGCFLAG) - miDDC_to_GC_edges(pRend, pddc, pddc->Static.misc.pEdgeGC); - - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pEdgeGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pEdgeGC); - - /* Render each bound as a polyline */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) - if (pddlist->numPoints > 0) - /* Call ddx to render the polygon */ - (*GetGCValue(pddc->Static.misc.pEdgeGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pEdgeGC, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - - return(Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c:3.8 Fri Dec 14 14:57:17 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c Sat Feb 28 21:41:54 2004 @@ -1,280 +0,0 @@ -/* $Xorg: miRndMarkr.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndMarkr.c,v 3.8 2001/12/14 19:57:17 dawes Exp $ */ - -#define NEED_EVENTS -#include "miRender.h" -#include "Xprotostr.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miMarkers.h" -#include "pexos.h" - -#define FULL_CIRCLE 360*64 - - -/*++ - | - | Function Name: miRenderMarker - | - | Function Description: - | Renders Polylines to the screen. - | - | Note(s): - | - --*/ - -ddpex3rtn -miRenderMarker(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - miListHeader *input_list; /* fill area data */ -{ -/* calls */ - ddpex3rtn miTransform(); - ddpex3rtn miClipPointList(); - -/* Local variable definitions */ - miListHeader *temp_list; - miListHeader save_list; - int i, j, k; - miListHeader *input_marker_list, *xformed_marker; - listofddPoint *pddlist1, *pddlist2; - float marker_trans[4][4]; - ddCoord2DS *in_pt; - ddpex3rtn status; - - - /* Remove all data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - status = miFilterPath(pddc, input_list, &temp_list, 0); - if (status) return(status); - input_list = temp_list; - } - - /* - * Update the marker GC to reflect the current - * marker attributes - */ - if (pddc->Static.misc.flags & MARKERGCFLAG) - miDDC_to_GC_marker(pRend, pddc, pddc->Static.misc.pPolyMarkerGC); - - /* - * Now render the appropriate marker - */ - switch (pddc->Static.attrs->markerType) { - - case PEXMarkerDot: - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pPolyMarkerGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolyMarkerGC); - - /* - * Render a pixel at each marker position - */ - for (j = 0, pddlist1 = input_list->ddList; - j < input_list->numLists; j++, pddlist1++) - if (pddlist1->numPoints > 0) - /* Call ddx to render the polylines */ - (*GetGCValue(pddc->Static.misc.pPolyMarkerGC, ops->PolyPoint)) - (pRend->pDrawable, - pddc->Static.misc.pPolyMarkerGC, - CoordModeOrigin, - pddlist1->numPoints, - pddlist1->pts.p2DSpt); - break; - - case PEXMarkerCross: - /* new path contains the default marker description to render */ - input_marker_list = &cross_header; - goto render_marker; - - case PEXMarkerAsterisk: - /* new path contains the default marker description to render */ - input_marker_list = &asterisk_header; - goto render_marker; - - case PEXMarkerCircle: - { - xArc *parcs=0, /* ddx polyarc input structure */ - *pcurarcs; - - /* - * Draw a circle for each position in the PolyMarker list. - */ - for (i = 0, pddlist1 = input_list->ddList; - i < input_list->numLists; i++, pddlist1++) { - /* - * Ensure enough arc structures - */ - if (parcs) - pcurarcs = parcs = - (xArc *)xrealloc(parcs,sizeof(xArc)*pddlist1->numPoints); - else pcurarcs = parcs = - (xArc *)xalloc(sizeof(xArc)*pddlist1->numPoints); - - in_pt = pddlist1->pts.p2DSpt; - - /* Create an arc structure for every PolyMarker point */ - for (j = 0; j < pddlist1->numPoints; j++) { - pcurarcs->x = in_pt->x - - (ddUSHORT)pddc->Static.attrs->markerScale; - pcurarcs->y = (in_pt++)->y - - (ddUSHORT)pddc->Static.attrs->markerScale; - pcurarcs->width = (ddUSHORT)(pddc->Static.attrs->markerScale*2); - pcurarcs->height = pcurarcs->width; - pcurarcs->angle1 = 0; - (pcurarcs++)->angle2 = FULL_CIRCLE; - } - - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pPolyMarkerGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolyMarkerGC); - - /* Call ddx to render a circle */ - (*GetGCValue(pddc->Static.misc.pPolyMarkerGC, ops->PolyArc)) - (pRend->pDrawable, - pddc->Static.misc.pPolyMarkerGC, - pddlist1->numPoints, - parcs); - } - - /* free temporary resources */ - if (parcs) xfree(parcs); - - } - break; - - case PEXMarkerX: - /* new path contains the default marker description to render */ - input_marker_list = &X_header; - -render_marker: - /* - * marker_trans contains the transformation to transform - * the unit marker default specification to the final - * screen size/position. The scale factor used in x and y - * is the PC makerScale, while the translation is provided - * by the (now DC) marker position specified in the input - * vertex list. - */ - memcpy( (char *) marker_trans, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - marker_trans[0][0] = pddc->Static.attrs->markerScale; - marker_trans[1][1] = pddc->Static.attrs->markerScale; - - /* - * the transform routine automatically" selects the - * output data area. In order to not overwrite the - * polymarker data, the list header is copied to - * a temporary area. Note that the maxLists field - * associated with the old list is zeroed so that - * new data will be alloc'ed on the next transform. - */ - save_list = *input_list; - input_list->maxLists = 0; - - /* - * Draw a marker for each position in the PolyMarker list. - */ - for (i = 0, pddlist1 = save_list.ddList; - i < save_list.numLists; i++, pddlist1++) { - - in_pt = pddlist1->pts.p2DSpt; - - /* for every PolyMarker point */ - for (j = 0; j < pddlist1->numPoints; j++) { - - /* Transform marker description into screen coords */ - marker_trans[0][3] = (float)in_pt->x; - marker_trans[1][3] = (float)(in_pt++)->y; - if (status = miTransform(pddc, - input_marker_list, &xformed_marker, - marker_trans, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pPolyMarkerGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolyMarkerGC); - - /* We should have DC paths here; Render them */ - for (k = 0, pddlist2 = xformed_marker->ddList; - k < xformed_marker->numLists; k++, pddlist2++) - if (pddlist2->numPoints > 0) - /* Call ddx to render the polylines */ - (*GetGCValue(pddc->Static.misc.pPolyMarkerGC,ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pPolyMarkerGC, - CoordModeOrigin, - pddlist2->numPoints, - pddlist2->pts.p2DSpt); - } - } - MI_FREELISTHEADER(&save_list); - break; - - default: - break; - } - - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndPLine.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndPLine.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndPLine.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndPLine.c:3.7 Fri Dec 14 14:57:18 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndPLine.c Sat Feb 28 21:41:54 2004 @@ -1,187 +0,0 @@ -/* $Xorg: miRndPLine.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#define NEED_EVENTS -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "ddpex2.h" - - -/*++ - | - | Function Name: miRenderPolyLine - | - | Function Description: - | Renders Polylines to the screen. - | - | Note(s): - | - --*/ - -ddpex3rtn -miRenderPolyLine(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - miListHeader *input_list; /* fill area data */ -{ -/* calls */ - ddpex3rtn miFilterPath(); - ddpex3rtn miClipPolyLines(); - -/* Local variable definitions */ - listofddPoint *pddlist; - ddPointUnion pt; - ddCoord2DS line[2]; - GCPtr pGC; - ddULONG colourindex; - ddColourSpecifier intcolour; - int j; - int count; - - /* - * Update the fill area GC to reflect the current - * polyline attributes - */ - if (pddc->Static.misc.flags & POLYLINEGCFLAG) - miDDC_to_GC_polyline(pRend, pddc, pddc->Static.misc.pPolylineGC); - - /* Polyline with Data ? */ - if (!DD_IsVertColour(input_list->type)) - { - - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pPolylineGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolylineGC); - - /* We should have DC paths here; Render them */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - if (pddlist->numPoints > 0) { - - /* Call ddx to render the polylines */ - (*GetGCValue(pddc->Static.misc.pPolylineGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pPolylineGC, - CoordModeOrigin, - pddlist->numPoints, - pddlist->pts.p2DSpt); - } - } - } - else - { - pGC = pddc->Static.misc.pPolylineGC; - - intcolour.colourType = PEXRgbFloatColour; - - /* Render each bound as a polyline */ - for (j = 0, pddlist = input_list->ddList; - j < input_list->numLists; j++, pddlist++) { - - if ((count = pddlist->numPoints) <= 1) continue; - - pt = pddlist->pts; - - /* Each polyline segment has a (potentially) different color */ - while (--count) { - - /* Compute index value for ddx */ - line[0] = *(pt.p2DSpt++); - /* Use first vertex color for line color if no interpolation - * Use line color attribute if highlighting. - */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) - intcolour.colour.rgbFloat = *(pt.pRgbFloatClr++); - else { - intcolour.colour.rgbFloat = - pddc->Static.attrs->lineColour.colour.rgbFloat; - pt.pRgbFloatClr++; - } - /* Note, can't have any other per-vertex data other than color */ - line[1] = *pt.p2DSpt; - - miColourtoIndex( pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= POLYLINEGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Call ddx to render the polyline */ - (*GetGCValue(pGC, ops->Polylines)) - (pRend->pDrawable, - pGC, - CoordModeOrigin, - 2, - line); - } - } - } - - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndTStrip.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndTStrip.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndTStrip.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndTStrip.c:3.7 Fri Dec 14 14:57:18 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndTStrip.c Sat Feb 28 21:41:54 2004 @@ -1,744 +0,0 @@ -/* $Xorg: miRndTStrip.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#define NEED_EVENTS -#include "miRender.h" -#include "miClip.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "ddpex2.h" - - -/*++ - | - | Function Name: miRenderTriStrip - | - | Function Description: - | Renders a triangle strip to a drawable - | - | Note(s): - | - --*/ - -ddpex3rtn -miRenderTriStrip(pRend, pddc, input_list, input_facet) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - miListHeader *input_list; /* triangle strip vertex data */ - listofddFacet *input_facet; /* per facet data */ -{ - - -/* calls */ - ddpex3rtn miDDC_to_GC_fill_area(); - ddpex3rtn miCopyPath(); - ddpex3rtn miFilterPath(); - ddpex3rtn miCloseFillArea(); - ddpex3rtn miRemoveInvisibleEdges(); - - -/* Local variable definitions */ - ddPointUnion in_pt, tmp_pt; - ddFacetUnion out_fct; - listofddPoint *pddlist; - listofddFacet *fct_list; - miListHeader *edge_copy; - miListHeader *temp_list; - GCPtr pGC; - int point_size, facet_size, num_facets, - color_offset, edge_offset; - ddULONG colourindex; - ddColourSpecifier intcolour; - miColourEntry *pintcolour; - ddCoord2DS output_array[4]; - int i, j, k; - ddpex3rtn err = Success; - ddUSHORT status = 0; - - /* remember that ALL vertex types are of the form: - * - * |---------------------------|---------|----------|---------| - * coords color normal edge - * (opt) (opt) (opt) - */ - - - - if (input_list->numLists == 0) return(1); - - else { - /* - * ddx trashes the input data by adding window offsets. - * Thus, if the data is going to be re-used for rendering - * of edges, it must be saved :-(. - */ - - if (pddc->Static.attrs->edges != PEXOff) - miCopyPath(pddc, input_list, &edge_copy, 0); - - /* - * Update the fill area GC to reflect the current - * fill area attributes - */ - pGC = pddc->Static.misc.pFillAreaGC; - if (pddc->Static.misc.flags & FILLAREAGCFLAG) - miDDC_to_GC_fill_area(pRend, pddc, pddc->Static.misc.pFillAreaGC); - - /* - * Render appropriately. One can assume that facets have been - * pre-computed if we need facet data. - */ - - switch (pddc->Static.attrs->intStyle) { - - case PEXInteriorStyleHollow: - - /* At this point, for a fully implemented level1, there would - * be another "switch" statement here that would select between - * interpolation methods. This switch would exist also exist - * for the "solid" fill styles as well. We have, for now, - * only implemented InterpNone (flat shading) - */ - - { - /* - * The final fill area color is determined by a hierarchy - * of sources. The first source is the vertex colors. - * If the data has vertex colors, then the final color - * is an average of the vertex colors. If there are no - * vertex colors, then the facet is set to the - * color for the current facet. IF there are no facet colors, - * then the color is determined by the surface color attribute. - * If highlighting is on, then the color is determined by - * the surface color attribute which has been set to the - * highlight color - */ - - if ( (DD_IsVertColour(input_list->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - /* - * If vertex colors, simply create a facet list. - */ - DDFacetSIZE(DD_FACET_RGBFLOAT, facet_size); - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = DD_FACET_RGBFLOAT; - - - MI_ALLOCLISTOFDDFACET(fct_list, input_facet->numFacets, facet_size); - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = fct_list->facets; - DD_VertPointSize(input_list->type, point_size); - DD_VertOffsetColor(input_list->type, color_offset); - - for(i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - in_pt = pddlist->pts; - in_pt.ptr += color_offset; /* skip coord data */ - - /* Compute average facet color */ - for (k = 2; k < (pddlist->numPoints); k++) { - out_fct.pFacetRgbFloat->red = 0.0; - out_fct.pFacetRgbFloat->green = 0.0; - out_fct.pFacetRgbFloat->blue = 0.0; - - tmp_pt.ptr = in_pt.ptr + point_size; - - out_fct.pFacetRgbFloat->red - += in_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += in_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += in_pt.pRgbFloatClr->blue; - - out_fct.pFacetRgbFloat->red - += tmp_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += tmp_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += tmp_pt.pRgbFloatClr->blue; - tmp_pt.ptr += point_size; - out_fct.pFacetRgbFloat->red - += tmp_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += tmp_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += tmp_pt.pRgbFloatClr->blue; - - if (pddlist->numPoints > 2) { - out_fct.pFacetRgbFloat->red /= 3; - out_fct.pFacetRgbFloat->green /= 3; - out_fct.pFacetRgbFloat->blue /= 3; - } - /* clamp on saturation */ - if (out_fct.pFacetRgbFloat->red > 1.0) - out_fct.pFacetRgbFloat->red = 1.0; - if (out_fct.pFacetRgbFloat->green > 1.0) - out_fct.pFacetRgbFloat->green = 1.0; - if (out_fct.pFacetRgbFloat->blue > 1.0) - out_fct.pFacetRgbFloat->blue = 1.0; - - - in_pt.ptr += point_size; /* skip to next point */ - out_fct.pFacetRgbFloat++; - fct_list->numFacets++; - } - ++pddlist; - } - /* new facet colors override input ones */ - input_facet = fct_list; - } - - /* Remove all data from vertex data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - if (err = miFilterPath(pddc, input_list, &temp_list, 1)) - return(err); - input_list = temp_list; - } - - if ( (input_facet) && - (input_facet->numFacets > 0) && - (DD_IsFacetColour(input_facet->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - - pGC = pddc->Static.misc.pFillAreaGC; - out_fct = input_facet->facets; - DDFacetSIZE(input_facet->type, facet_size); - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour.colourType = PEXRgbFloatColour; - intcolour.colour.rgbFloat = *out_fct.pFacetRgbFloat; - } - miColourtoIndex( pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - } - - else { - - /* - * If no vertex or facet colors, use surface attributes. - * If highlighting is on, then the color is determined by - * the surface color attribute which has been set to the - * highlight color - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour = pddc->Static.attrs->surfaceColour; - } - - miColourtoIndex( pRend, - pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - } - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render each bound as a polyline. - * Note - Additional functionality should be able - * to distinguesh between "real" and degenerate facets - * (produced by clipping) by some internal mechanism, - * possibly more bits in the edge flags, and NOT - * draw the boundaries for degenerate facets here. - */ - - DD_VertPointSize(input_list->type, point_size); - - for(i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - - for (j = 2, in_pt.ptr = pddlist->pts.ptr; - j < pddlist->numPoints; j++) { - - output_array[0] = *in_pt.p2DSpt; - - tmp_pt.ptr = in_pt.ptr + point_size; - - output_array[1] = *tmp_pt.p2DSpt; - - tmp_pt.ptr += point_size; - - output_array[2] = *tmp_pt.p2DSpt; - - output_array[3] = *in_pt.p2DSpt; - - /* Call ddx to fill polygon */ - (*GetGCValue - (pddc->Static.misc.pFillAreaGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pFillAreaGC, - CoordModeOrigin, - 4, - output_array); - - in_pt.ptr += point_size; - - if ( (input_facet) && - (input_facet->numFacets > 0) && - (DD_IsFacetColour(input_facet->type)) ) { - out_fct.pNoFacet += facet_size; - - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour.colourType = PEXRgbFloatColour; - intcolour.colour.rgbFloat = *out_fct.pFacetRgbFloat; - } - miColourtoIndex( pRend, - pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - } - } - ++pddlist; - } - - } - break; - - case PEXInteriorStylePattern: - case PEXInteriorStyleHatch: - case PEXInteriorStyleSolid: - { - /* - * The final facet color is determined by a hierarchy - * of sources. The first source is the by vertex colors. - * If the data has vertex colors, then the final color - * is an average of the vertex colors. If there are no - * vertex colors, then the fill area is set to the facet - * color for the current facet. IF there are no facet colors, - * then the color is determined by the surface color attribute. - * If highlighting is on, then the color is determined by - * the surface color attribute which has been set to the - * highlight color - */ - - if ( (DD_IsVertColour(input_list->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - /* - * If vertex colors, simply create a facet list. - */ - DDFacetSIZE(DD_FACET_RGBFLOAT, facet_size); - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = DD_FACET_RGBFLOAT; - - /* Determine number of facets */ - for (i = 0, num_facets = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - if (pddlist->numPoints > 2) - num_facets += (pddlist->numPoints - 2); - pddlist++; - } - - MI_ALLOCLISTOFDDFACET(fct_list, num_facets, facet_size); - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = fct_list->facets; - - DD_VertPointSize(input_list->type, point_size); - DD_VertOffsetColor(input_list->type, color_offset); - - for(i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - in_pt = pddlist->pts; - in_pt.ptr += color_offset; /* skip coord data */ - - /* Compute average facet color */ - for (k = 2; k < (pddlist->numPoints); k++) { - out_fct.pFacetRgbFloat->red = 0.0; - out_fct.pFacetRgbFloat->green = 0.0; - out_fct.pFacetRgbFloat->blue = 0.0; - - tmp_pt.ptr = in_pt.ptr + point_size; - - out_fct.pFacetRgbFloat->red - += in_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += in_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += in_pt.pRgbFloatClr->blue; - - out_fct.pFacetRgbFloat->red - += tmp_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += tmp_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += tmp_pt.pRgbFloatClr->blue; - tmp_pt.ptr += point_size; - out_fct.pFacetRgbFloat->red - += tmp_pt.pRgbFloatClr->red; - out_fct.pFacetRgbFloat->green - += tmp_pt.pRgbFloatClr->green; - out_fct.pFacetRgbFloat->blue - += tmp_pt.pRgbFloatClr->blue; - - if (pddlist->numPoints > 2) { - out_fct.pFacetRgbFloat->red /= 3.0; - out_fct.pFacetRgbFloat->green /= 3.0; - out_fct.pFacetRgbFloat->blue /= 3.0; - } - /* clamp on saturation */ - if (out_fct.pFacetRgbFloat->red > 1.0) - out_fct.pFacetRgbFloat->red = 1.0; - if (out_fct.pFacetRgbFloat->green > 1.0) - out_fct.pFacetRgbFloat->green = 1.0; - if (out_fct.pFacetRgbFloat->blue > 1.0) - out_fct.pFacetRgbFloat->blue = 1.0; - - - in_pt.ptr += point_size; /* skip to next point */ - out_fct.pFacetRgbFloat++; - fct_list->numFacets++; - } - ++pddlist; - } - /* new facet colors override input ones */ - input_facet = fct_list; - - } - - /* Remove all data from vertex data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - if (err = miFilterPath(pddc, input_list, &temp_list, 1)) - return(err); - input_list = temp_list; - } - - if ( (input_facet) && - (input_facet->numFacets > 0) && - (DD_IsFacetColour(input_facet->type)) && - (!MI_DDC_IS_HIGHLIGHT(pddc)) ) { - - pGC = pddc->Static.misc.pFillAreaGC; - out_fct = input_facet->facets; - DDFacetSIZE(input_facet->type, facet_size); - - - /* Render each bound as a polygon */ - - DD_VertPointSize(input_list->type, point_size); - - for(i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - - for (j = 2, in_pt.ptr = pddlist->pts.ptr; - j < pddlist->numPoints; j++) { - - output_array[0] = *in_pt.p2DSpt; - - tmp_pt.ptr = in_pt.ptr + point_size; - - output_array[1] = *tmp_pt.p2DSpt; - - tmp_pt.ptr += point_size; - - output_array[2] = *tmp_pt.p2DSpt; - - output_array[3] = *in_pt.p2DSpt; - - - /* Compute index value for ddx */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour.colourType = PEXRgbFloatColour; - intcolour.colour.rgbFloat = *out_fct.pFacetRgbFloat; - } - miColourtoIndex(pRend, pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Call ddx to fill polygon */ - (*GetGCValue(pGC, ops->FillPolygon)) - (pRend->pDrawable, - pGC, - Convex, - CoordModeOrigin, - 4, - output_array); - - - - in_pt.ptr += point_size; - out_fct.pNoFacet += facet_size; - } - pddlist++; - } - } - - else { - - /* - * If no vertex or facet colors, use surface attributes. - * If highlighting is on, then the color is determined by - * the surface color attribute which has been set to the - * highlight color - */ - if (pddc->Static.attrs->echoMode == PEXEcho) - intcolour = pddc->Static.attrs->echoColour; - else { - intcolour = pddc->Static.attrs->surfaceColour; - } - - miColourtoIndex( pRend, - pddc->Dynamic->pPCAttr->colourApproxIndex, - &intcolour, &colourindex); - - /* Only set GC value if necessary */ - if (colourindex != pGC->fgPixel) { - pGC->fgPixel = colourindex; - /* Register changes with ddx */ - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->stateChanges |= GCForeground; - (*pGC->funcs->ChangeGC)(pGC, GCForeground); - /* Insure that the GC is reset to proper color next time */ - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* validate GC prior to start of rendering */ - if (pGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pGC); - - /* Render each bound as a polyline */ - DD_VertPointSize(input_list->type, point_size); - - for(i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - - for (j = 2, in_pt.ptr = pddlist->pts.ptr; - j < pddlist->numPoints; j++) { - - output_array[0] = *in_pt.p2DSpt; - - tmp_pt.ptr = in_pt.ptr + point_size; - - output_array[1] = *tmp_pt.p2DSpt; - - tmp_pt.ptr += point_size; - - output_array[2] = *tmp_pt.p2DSpt; - - output_array[3] = *in_pt.p2DSpt; - - /* Call ddx to fill polygon */ - (*GetGCValue(pGC, ops->FillPolygon)) - (pRend->pDrawable, - pGC, - Convex, - CoordModeOrigin, - 4, - output_array); - - in_pt.ptr += point_size; - } - pddlist++; - } - - - break; - } - } - - case PEXInteriorStyleEmpty: - break; - - } /*End of area rendering */ - - /* - * Now check to see if fill area edges are to be drawn - */ - if (pddc->Static.attrs->edges != PEXOff) { - - input_list = edge_copy; - - DD_VertPointSize(input_list->type, point_size); - DD_VertOffsetEdge(input_list->type, edge_offset); - - /* - * Update the fill area GC to reflect the current - * fill area attributes - */ - if (pddc->Static.misc.flags & EDGEGCFLAG) - miDDC_to_GC_edges(pRend, pddc, pddc->Static.misc.pEdgeGC); - - /* validate GC prior to start of rendering */ - if (pddc->Static.misc.pEdgeGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pEdgeGC); - - - for (i = 0, pddlist = input_list->ddList; - i < input_list->numLists; i++) { - - - /* Render each bound as a polyline */ - - /* - * Within an edge flag, there are two bits determining edge - * visibility. Bit zero determines whether an edge is drawn - * between the current vertex N and vertex N-2, while bit one - * determines if an edge is drawn between edge N and N+1. - * If N-2 < 0 or N+1 > numfacets the edge is not drawn. - * - * 2_________ _4 - * /\ /|\ - * / \ / \ - * / \ / \ - * / \ / \ - * 1<--------+3+---------5 - * - * So, for the third element in the edge list, - * bit 0 indicates presence of an edge from 3 -> 4 - * (forward edge) - * bit 1 indicates presence of an edge from 3 -> 1 - * (backward edge) - * - */ - - - for (j = 0, in_pt.ptr = pddlist->pts.ptr; - j < pddlist->numPoints; j++) { - - if((j+1) < pddlist->numPoints){ - if(FWD_EDGE_FLAG & *(in_pt.ptr + edge_offset)) { - - output_array[0] = *in_pt.p2DSpt; - - tmp_pt.ptr = in_pt.ptr + point_size; - - output_array[1] = *tmp_pt.p2DSpt; - - (*GetGCValue(pddc->Static.misc.pEdgeGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pEdgeGC, - CoordModeOrigin, - 2, - output_array); - } - } - if (j > 1){ - if(BKWD_EDGE_FLAG & *(in_pt.ptr + edge_offset)) { - - output_array[0] = *in_pt.p2DSpt; - - tmp_pt.ptr = in_pt.ptr - (2 * point_size); - - output_array[1] = *tmp_pt.p2DSpt; - - (*GetGCValue(pddc->Static.misc.pEdgeGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pEdgeGC, - CoordModeOrigin, - 2, - output_array); - - } - } - in_pt.ptr += point_size; - } - ++pddlist; - } - } - - return (Success); - } -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c:3.7 Fri Dec 14 14:57:18 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c Sat Feb 28 21:41:54 2004 @@ -1,126 +0,0 @@ -/* $Xorg: miRndText.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level1/miRndText.c,v 3.7 2001/12/14 19:57:18 dawes Exp $ */ - -#define NEED_EVENTS -#include "miRender.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "ddpex2.h" - - -/*++ - | - | Function Name: miRenderText - | - | Function Description: - | Renders Text to the screen. - | - | Note(s): - | - --*/ - -ddpex3rtn -miRenderText(pRend, pddc, input_list) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - miListHeader *input_list; /* fill area data */ -{ -/* calls */ - ddpex3rtn miFilterPath(); - -/* Local variable definitions */ - miListHeader *temp_list; - listofddPoint *sp; - int j; - ddpex3rtn err = Success; - - /* Remove all data but vertex coordinates */ - if ((DD_IsVertNormal(input_list->type)) || - (DD_IsVertEdge(input_list->type)) || - (DD_IsVertColour(input_list->type)) ) { - err = miFilterPath(pddc, input_list, &temp_list, 1); - if (err) return (err); - input_list = temp_list; - } - - /* - * Update the text GC to reflect the current - * text attributes - */ - if (pddc->Static.misc.flags & TEXTGCFLAG) - miDDC_to_GC_text(pRend, pddc, pddc->Static.misc.pTextGC); - - /* Validate GC prior to start of rendering */ - - if (pddc->Static.misc.pTextGC->serialNumber != - pRend->pDrawable->serialNumber) - ValidateGC(pRend->pDrawable, pddc->Static.misc.pTextGC); - - /* We should have DC paths here; Render them */ - - for (j = 0, sp = input_list->ddList; - j < input_list->numLists; j++, sp++) { - if (sp->numPoints > 0) { - - /* Call ddx to render the polylines */ - (*GetGCValue(pddc->Static.misc.pTextGC, ops->Polylines)) - (pRend->pDrawable, - pddc->Static.misc.pTextGC, - CoordModeOrigin, - sp->numPoints, - sp->pts.p2DSpt); - } - } -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile:3.11 xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile:3.11 Wed Jan 17 17:12:22 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile Sat Feb 28 21:41:54 2004 @@ -1,120 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:04 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/Imakefile,v 3.11 2001/01/17 22:12:22 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDdpexCDebugFlags -#define PexDdpexCDebugFlags ServerCDebugFlags -#endif - -XCOMM -D defines for ddpex: -XCOMM DDTEST turns on some fprintf(stderr...)s for debugging - - DEFINES = PexDdpexDefines -CDEBUGFLAGS = PexDdpexCDebugFlags - - PEXSERVINC = ../../../include -DDPEXINCLUDE = ../include - -INCLUDES = -I. \ - -I$(DDPEXINCLUDE) \ - -I$(XINCLUDESRC) \ - -I$(PEXSERVINC) \ - -I$(SERVERSRC)/include - -SRCS = ddContext.c \ - miBldXform.c \ - miClip.c \ - miCellArray.c \ - miConvert.c \ - miDestroy.c \ - miFillArea.c \ - miLight.c \ - miLvl2Tab.c \ - miMarkers.c \ - miNCurve.c \ - miNSurf.c \ - miNSTrim.c \ - miNurbs.c \ - miOCs.c \ - miPolyLine.c \ - miQuadMesh.c \ - miSOFAS.c \ - miTestOCs.c \ - miText.c \ - miTrans.c \ - miTriStrip.c \ - miCopy.c \ - miInquire.c \ - miReplace.c \ - miPickPrim.c \ - miSearch.c \ - pexOCParse.c - -OBJS = ddContext.o \ - miBldXform.o \ - miClip.o \ - miConvert.o \ - miCellArray.o \ - miDestroy.o \ - miFillArea.o \ - miLight.o \ - miLvl2Tab.o \ - miMarkers.o \ - miNCurve.o \ - miNSurf.o \ - miNSTrim.o \ - miNurbs.o \ - miOCs.o \ - miPolyLine.o \ - miQuadMesh.o \ - miSOFAS.o \ - miTestOCs.o \ - miText.o \ - miTrans.o \ - miTriStrip.o \ - miCopy.o \ - miInquire.o \ - miReplace.o \ - miPickPrim.o \ - miSearch.o \ - pexOCParse.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ddpex2,$(OBJS)) - -LintLibraryTarget(dp2, $(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c:3.7 Fri Dec 14 14:57:19 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c Sat Feb 28 21:41:54 2004 @@ -1,1095 +0,0 @@ -/* $Xorg: ddContext.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/ddContext.c,v 3.7 2001/12/14 19:57:19 dawes Exp $ */ - -#include "miWks.h" -#include "miStruct.h" -#include "miRender.h" -#include "PEXErr.h" -#include "pexUtils.h" -#include "pixmap.h" -#include "windowstr.h" -#include "regionstr.h" -#include "miscstruct.h" -#include "pexos.h" - - -static void deleteDynamicDDContext(); - -/* External variables used */ - -extern void miMatMult(); -extern RendTableType RenderPrimitiveTable[]; -extern RendTableType PickPrimitiveTable[]; - -/* pcflag is initialized in ddpexInit() */ -extern ddBOOL pcflag; -extern ddPCAttr defaultPCAttr; -#define MI_GET_DEFAULT_PC(pPC) \ - if (!pcflag) { \ - DefaultPC(pPC); \ - pcflag = MI_TRUE; } - -/*++ - | - | Function Name: CreateDDContext - | - | Function Description: - | Creates and initializes a DDContext structure and - | intializes the Renderer pointer. - | - | Note(s): - | - --*/ - -ddpex3rtn -CreateDDContext(pRend) - ddRendererPtr pRend; /* renderer handle */ -{ - - extern GCPtr CreateScratchGC(); - miDDContext *pddc; - ddPCAttr *ppca; - listofObj *pMC, *pLS; - int i; - - pRend->pDDContext = NULL; - - /* - * Create the dd attribute context: this requires creating both the - * static and Dynamic portions of the DDContext. - */ - pddc = (miDDContext *) xalloc(sizeof(miDDContext)); - if (!pddc) - return (BadAlloc); - pddc->Dynamic = (miDynamicDDContext *) xalloc(sizeof(miDynamicDDContext)); - if (!pddc->Dynamic) { - xfree((char *) pddc); - return (BadAlloc); - } - /* allocate storage for local copy of PC */ - pddc->Dynamic->pPCAttr = (ddPCAttr *) xalloc(sizeof(ddPCAttr)); - if (!pddc->Dynamic->pPCAttr) { - xfree((char *) pddc->Dynamic); - xfree((char *) pddc); - return (BadAlloc); - } - - /* initialize pointers so that panic-caused freeing is clean */ - pddc->Static.misc.ms_MCV = NULL; - pddc->Static.attrs = NULL; - pddc->Dynamic->next = NULL; - pddc->Dynamic->pPCAttr->modelClipVolume = NULL; - pddc->Dynamic->pPCAttr->lightState = NULL; - pddc->Static.misc.pPolylineGC = NULL; - pddc->Static.misc.pFillAreaGC = NULL; - pddc->Static.misc.pEdgeGC = NULL; - pddc->Static.misc.pPolyMarkerGC = NULL; - pddc->Static.misc.pTextGC = NULL; - - - /* don't forget Model Clip and lightState in PC */ - pddc->Dynamic->pPCAttr->modelClipVolume = puCreateList(DD_HALF_SPACE); - if (!pddc->Dynamic->pPCAttr->modelClipVolume) { - DeleteDDContext(pddc); - return (BadAlloc); - } - - pddc->Dynamic->pPCAttr->lightState = puCreateList(DD_INDEX); - if (!pddc->Dynamic->pPCAttr->lightState) { - DeleteDDContext(pddc); - return (BadAlloc); - } - - /* don't forget transformed versions of MCVolume in PC */ - pddc->Static.misc.ms_MCV = puCreateList(DD_HALF_SPACE); - if (!pddc->Static.misc.ms_MCV) { - DeleteDDContext(pddc); - return (BadAlloc); - } - - /* - * Initialize the newly created ddcontext. - */ - ppca = pddc->Dynamic->pPCAttr; - pMC = ppca->modelClipVolume; - pLS = ppca->lightState; - if (pRend->pPC != NULL) { - *ppca = *pRend->pPC->pPCAttr; - - /* - * don't forget the model clip half planes and list of light sources, - * which are only pointed to - */ - if (puCopyList(pRend->pPC->pPCAttr->modelClipVolume, pMC)) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (puCopyList(pRend->pPC->pPCAttr->lightState, pLS)) { - DeleteDDContext(pddc); - return (BadAlloc); - } - } else { /* use default PC values */ - MI_GET_DEFAULT_PC(&defaultPCAttr); - *ppca = defaultPCAttr; - - /* - * don't forget the model clip half planes and list of light sources, - * which are only pointed to - */ - if (puCopyList(defaultPCAttr.modelClipVolume, pMC)) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (puCopyList(defaultPCAttr.lightState, pLS)) { - DeleteDDContext(pddc); - return (BadAlloc); - } - } - ppca->modelClipVolume = pMC; - ppca->lightState = pLS; - - /* copy the current name set from the ns resource to the renderer */ - MINS_EMPTY_NAMESET(pddc->Dynamic->currentNames); - if (ppca->pCurrentNS) { - miNSHeader *pns = (miNSHeader *) ppca->pCurrentNS->deviceData; - - MINS_COPY_NAMESET(pns->names, pddc->Dynamic->currentNames); - } - pddc->Dynamic->filter_flags = 0; - pddc->Dynamic->do_prims = 1; - - /* - * Initialize level 1 rendering procedure jump table - */ - memcpy( (char *) pddc->Static.RenderProcs, - (char *) RenderPrimitiveTable, - sizeof(RendTableType) * RENDER_TABLE_LENGTH); - - /* - * Allocate storage and initialize the DD context rendering attributes. - */ - if (!(pddc->Static.attrs = - (miDDContextRendAttrs *) xalloc(sizeof(miDDContextRendAttrs)))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - - /* - * Intialize the scratch data pointer areas Setting the maxlists or - * maxData fields to 0 insures that headers are allocated the first time - * the lists are used. - */ - pddc->Static.misc.listIndex = 0; - for (i = 0; i < MI_MAXTEMPDATALISTS; i++) - pddc->Static.misc.list4D[i].maxLists = 0; - pddc->Static.misc.list2D.maxLists = 0; - - for (i = 0; i < MI_MAXTEMPFACETLISTS; i++) - pddc->Static.misc.facets[i].maxData = 0; - - /* - * get a GC use the default values for now a scratch gc should be OK, - * it's the same as a regular gc except it doesn't create the tile or - * stipple I don't think we need to express interest in any change to the - * GC, since the ddpex code which uses the gc is the only one who should - * be changing it. But, we may need to express interest in window events - * or something if we can. - * - * a GC is created for each primitive type. THis should reduce the number of - * calls to change GC as otherwise this call would be required for each - * primitive. Note, that the down-side of this approach is that many - * hardware platforms only support a single graphics context, and thus - * will have to be re-loaded at every validate GC anyways.... There is no - * drawable if doing a search (ISS), so don't create the GCs. They aren't - * needed. - */ - - if (pRend->pDrawable) { - pddc->Static.misc.flags |= (POLYLINEGCFLAG | FILLAREAGCFLAG | - EDGEGCFLAG | MARKERGCFLAG | TEXTGCFLAG | - NOLINEDASHFLAG); - - if (!(pddc->Static.misc.pPolylineGC = - CreateScratchGC(pRend->pDrawable->pScreen, pRend->pDrawable->depth))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (!(pddc->Static.misc.pFillAreaGC = - CreateScratchGC(pRend->pDrawable->pScreen, pRend->pDrawable->depth))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (!(pddc->Static.misc.pEdgeGC = - CreateScratchGC(pRend->pDrawable->pScreen, pRend->pDrawable->depth))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (!(pddc->Static.misc.pPolyMarkerGC = - CreateScratchGC(pRend->pDrawable->pScreen, pRend->pDrawable->depth))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - if (!(pddc->Static.misc.pTextGC = - CreateScratchGC(pRend->pDrawable->pScreen, pRend->pDrawable->depth))) { - DeleteDDContext(pddc); - return (BadAlloc); - } - } - /* init pick and search structs */ - pddc->Static.pick.type = 0; - pddc->Static.pick.status = PEXNoPick; - - MINS_EMPTY_NAMESET(pddc->Static.pick.inclusion); - MINS_EMPTY_NAMESET(pddc->Static.pick.exclusion); - - pddc->Static.search.status = PEXNotFound; - - MINS_EMPTY_NAMESET(pddc->Static.search.norm_inclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.norm_exclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.invert_inclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.invert_exclusion); - - /* Indicate all xforms in static are invalid */ - pddc->Static.misc.flags |= ( INVTRCCTODCXFRMFLAG | INVTRWCTOCCXFRMFLAG - | INVTRMCTOCCXFRMFLAG | INVTRMCTOWCXFRMFLAG | INVVIEWXFRMFLAG ); - - /* Mark as invalid any transform dependant fields in ddContext - */ - pddc->Static.misc.flags |= (MCVOLUMEFLAG | CC_DCUEVERSION); - - /* If successfull, initialize Renderer pointer and return */ - pRend->pDDContext = (ddPointer) pddc; - return (Success); -} - -/*++ - | - | Function Name: DeleteDDContext - | - | Function Description: - | Deletes all of the storage used by the ddPEX attribute context. - | - | Note(s): - | - --*/ - -ddpex3rtn -DeleteDDContext(pDDContext) -/* in */ - miDDContext *pDDContext; /* ddPEX attribute structure */ -/* out */ -{ - miDynamicDDContext *pdddc, *pdddc2; - int i; - -#ifdef DDTEST - ErrorF(" DeleteDDContext\n"); -#endif - - if (!pDDContext) return(Success); /* just in case */ - - /* Free the ddcontext attribute store */ - if (pDDContext->Static.attrs) { - xfree((char *) (pDDContext->Static.attrs)); - pDDContext->Static.attrs = 0; - } - - /* - * free the scratch rendering data buffers. - */ - for (i = 0; i < MI_MAXTEMPDATALISTS; i++) { - MI_FREELISTHEADER(&(pDDContext->Static.misc.list4D[i])); - } - MI_FREELISTHEADER(&pDDContext->Static.misc.list2D); - - for (i = 0; i < MI_MAXTEMPFACETLISTS; i++) - if (pDDContext->Static.misc.facets[i].maxData) { - xfree((char *)(pDDContext->Static.misc.facets[i].facets.pNoFacet)); - pDDContext->Static.misc.facets[i].facets.pNoFacet = 0; - } - - if (pDDContext->Static.misc.ms_MCV) { - puDeleteList(pDDContext->Static.misc.ms_MCV); - pDDContext->Static.misc.ms_MCV = 0; - } - - /* - * Free the graphics contexts. - */ - if (pDDContext->Static.misc.pPolylineGC) - FreeScratchGC(pDDContext->Static.misc.pPolylineGC); - - if (pDDContext->Static.misc.pFillAreaGC) - FreeScratchGC(pDDContext->Static.misc.pFillAreaGC); - - if (pDDContext->Static.misc.pEdgeGC) - FreeScratchGC(pDDContext->Static.misc.pEdgeGC); - - if (pDDContext->Static.misc.pPolyMarkerGC) - FreeScratchGC(pDDContext->Static.misc.pPolyMarkerGC); - - if (pDDContext->Static.misc.pTextGC) - FreeScratchGC(pDDContext->Static.misc.pTextGC); - - /* free the Dynamic part(s) */ - pdddc = pDDContext->Dynamic; - while (pdddc) { - pdddc2 = pdddc->next; - deleteDynamicDDContext(pdddc); - pdddc = pdddc2; - } - - /* zero pointers to force illumination of any server bugs */ - pDDContext->Static.misc.ms_MCV = NULL; - pDDContext->Static.attrs = NULL; - pDDContext->Static.misc.pPolylineGC = NULL; - pDDContext->Static.misc.pFillAreaGC = NULL; - pDDContext->Static.misc.pEdgeGC = NULL; - pDDContext->Static.misc.pPolyMarkerGC = NULL; - pDDContext->Static.misc.pTextGC = NULL; - - pDDContext->Dynamic = NULL; - - /* Lastly, free the ddcontext pointer itself.... */ - xfree((char *) (pDDContext)); - - return (Success); -} /* DeleteDDContext */ - -/*++ - | - | Function Name: deleteDynamicDDContext - | - | Function Description: - | Deletes all of the storage used by the DynamicDDContext - | attribute context. - | - | Note(s): - | - --*/ - -static -void -deleteDynamicDDContext(pdddc) -/* in */ - miDynamicDDContext *pdddc; -{ - /* delete the dynamic part of the DDContext */ - - if (!pdddc) return; - - /* delete the pc attributes */ - if (pdddc->pPCAttr) { - /* model clip volume */ - if (pdddc->pPCAttr->modelClipVolume) { - puDeleteList(pdddc->pPCAttr->modelClipVolume); - pdddc->pPCAttr->modelClipVolume = NULL; - } - /* list of light source indices */ - if (pdddc->pPCAttr->lightState) { - puDeleteList(pdddc->pPCAttr->lightState); - pdddc->pPCAttr->lightState = NULL; - } - /* pc attr */ - xfree((char *) pdddc->pPCAttr); - pdddc->pPCAttr = NULL; - } - xfree((char *) pdddc); -} /* deleteDynamicDDContext */ - -/*++ - | - | Function Name: PushddContext - | - | Function Description: - | Pushes an instance of the ddContext on the stack, and creates - | a new "current" copy. - | - | The ddContext is divided into two parts: static and dynamic. - | The static attributes of the ddContext are either invarient - | across CSS hierarchy levels, or must be recomputed when moving - | up a level in the hierarchy. Dybnamic attributes, on the other - | hand, are stored in the stack when decending down the CSS, and - | thus can be restored by a simple "pop" operation when climbing - | back up through the CSS hierarchy. - | - | This routine, therefore, saves the current dynamic ddContext - | attributes on the stack, and initializes a new dynamic ddContext. - | - | Note(s): - | Since some of the dynamic ddContext elements contain and/or - | are pointers to objects, the info cannot be copied directly, - | but new objects must be made to be pointed to and their contents copied. - | So, the sequence that this procedure goes through is this: - | create a new dd context data structure - | copy old context to the new context, but remember - | that pointers to objects will be replaced. - | create a new PCAttr structure and copy old to new - | update the current path and transform matrices - | push the new context onto the stack - | - --*/ - -ddpex3rtn -PushddContext(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - miDDContext *pDDContext = (miDDContext *) (pRend->pDDContext); - miDynamicDDContext *oldDContext = pDDContext->Dynamic; - miDynamicDDContext *newDContext; - -#ifdef DDTEST - ErrorF(" BeginStructure %d\n", sId); -#endif - - /* First, create a new dynamic dd context */ - if (!(newDContext = (miDynamicDDContext *) xalloc(sizeof(miDynamicDDContext)))) { - return (BadAlloc); - } - - /* - * copy the contents of the old Dynamic ddContext to the new one this - * also copies the current name set - */ - *newDContext = *oldDContext; - - /* now, create a new PC for the new dd context */ - if (!(newDContext->pPCAttr = (ddPCAttr *) xalloc(sizeof(ddPCAttr)))) { - xfree((char *) newDContext); - return (BadAlloc); - } - /* Copy static portion of PC attrs */ - *newDContext->pPCAttr = *oldDContext->pPCAttr; - - /* now create new stuff for pointers in new PCAttr to point to */ - /* model clip volume */ - newDContext->pPCAttr->modelClipVolume = puCreateList(DD_HALF_SPACE); - if (!newDContext->pPCAttr->modelClipVolume) { - deleteDynamicDDContext(newDContext); - return (BadAlloc); - } - if (puCopyList(oldDContext->pPCAttr->modelClipVolume, - newDContext->pPCAttr->modelClipVolume)) { - deleteDynamicDDContext(newDContext); - return (BadAlloc); - } - /* light source indices */ - newDContext->pPCAttr->lightState = puCreateList(DD_INDEX); - if (!newDContext->pPCAttr->lightState) { - deleteDynamicDDContext(newDContext); - return (BadAlloc); - } - if (puCopyList(oldDContext->pPCAttr->lightState, - newDContext->pPCAttr->lightState)) { - deleteDynamicDDContext(newDContext); - return (BadAlloc); - } - /** Concatenate the local and global transforms into the new - ** global transform, then identity out the local one **/ - miMatMult(newDContext->pPCAttr->globalMat, - oldDContext->pPCAttr->localMat, - oldDContext->pPCAttr->globalMat); - - memcpy( (char *) newDContext->pPCAttr->localMat, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /** Push the new context onto the renderer DDContext **/ - /* newContext points to the old context */ - newDContext->next = pDDContext->Dynamic; - /* renderer points to the new context */ - pDDContext->Dynamic = newDContext; - - return (Success); -} /* PushddContext */ - -/*++ - | - | Function Name: PopddContext - | - | Function Description: - | Pops an instance of a dynamic ddContext structure off the stack. - | (See description above.) - | - | Note(s): - | - --*/ - -ddpex3rtn -PopddContext(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - miDynamicDDContext *oldDDDContext; - -#ifdef DDTEST - ErrorF(" EndStructure\n"); -#endif - - /** Pop off top of attr context stack **/ - oldDDDContext = pddc->Dynamic; - pddc->Dynamic = oldDDDContext->next; - - /** Free up storage used by oldContext **/ - deleteDynamicDDContext(oldDDDContext); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG | - INVTRMCTOCCXFRMFLAG | INVTRCCTODCXFRMFLAG | - INVVIEWXFRMFLAG); - - /* Mark as invalid any transform dependant fields in ddContext */ - pddc->Static.misc.flags |= (MCVOLUMEFLAG | CC_DCUEVERSION); - - return (Success); - -} /* PopddContext */ - -/*++ - | - | Function Name: ValidateDDContextAttrs - | - | Function Description: - | Updates the rendering attributes to match the - | attributes associated with the current PC. - | - | Note(s): - | - --*/ - -ddpex3rtn -ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* ddPEX attribute structure */ - ddBitmask tables, namesets, attrs; -{ - ddpex3rtn miConvertColor(); - miLineBundleEntry *linebundle = 0; - miTextBundleEntry *textbundle = 0; - miMarkerBundleEntry *markerbundle = 0; - miInteriorBundleEntry *intbundle = 0; - miEdgeBundleEntry *edgebundle = 0; - miViewEntry *view = 0; - ddUSHORT status = 0; - char colors; - - colors = (tables & PEXDynColourTable) || (tables & PEXDynColourTableContents); - - /* - * Marker Attributes - */ - if ((tables & PEXDynMarkerBundle) || - (tables & PEXDynMarkerBundleContents) || - colors) { - if (~(pddc->Dynamic->pPCAttr->asfs - & (PEXMarkerTypeAsf | PEXMarkerScaleAsf | PEXMarkerColourAsf))) { - - if ((InquireLUTEntryAddress(PEXMarkerBundleLUT, - pRend->lut[PEXMarkerBundleLUT], - pddc->Dynamic->pPCAttr->markerIndex, - &status, (ddPointer *) (&markerbundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - } - /* always try to set the color */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerColourAsf) == PEXBundled) { - miConvertColor(pRend, - &markerbundle->real_entry.markerColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->markerColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->markerColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->markerColour); - } - } - /* only set these if it's the bundle that changed */ - if ((tables & PEXDynMarkerBundle) || - (tables & PEXDynMarkerBundleContents)) { - - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerTypeAsf) == PEXBundled) - pddc->Static.attrs->markerType = markerbundle->real_entry.markerType; - else - pddc->Static.attrs->markerType = pddc->Dynamic->pPCAttr->markerType; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerScaleAsf) == PEXBundled) - pddc->Static.attrs->markerScale = - markerbundle->real_entry.markerScale; - else - pddc->Static.attrs->markerScale = - pddc->Dynamic->pPCAttr->markerScale; - - } - pddc->Static.misc.flags |= MARKERGCFLAG; - } - - /* - * Text Attributes - */ - if ((tables & PEXDynTextBundle) || - (tables & PEXDynTextBundleContents) || - colors) { - if (~(pddc->Dynamic->pPCAttr->asfs - & (PEXTextFontIndexAsf | PEXTextPrecAsf | PEXCharExpansionAsf | - PEXCharSpacingAsf | PEXTextColourAsf))) { - - if ((InquireLUTEntryAddress(PEXTextBundleLUT, - pRend->lut[PEXTextBundleLUT], - pddc->Dynamic->pPCAttr->textIndex, - &status, (ddPointer *) (&textbundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - } - /* First, bundled attributes */ - /* always try to set the color */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextColourAsf) == PEXBundled) { - miConvertColor(pRend, - &textbundle->real_entry.textColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->textColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->textColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->textColour); - } - } - /* only set these if it's the bundle that changed */ - if ((tables & PEXDynTextBundle) || - (tables & PEXDynTextBundleContents)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextFontIndexAsf) == PEXBundled) - pddc->Static.attrs->textFont = textbundle->real_entry.textFontIndex; - else - pddc->Static.attrs->textFont = pddc->Dynamic->pPCAttr->textFont; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextPrecAsf) == PEXBundled) - pddc->Static.attrs->textPrecision = - textbundle->real_entry.textPrecision; - else - pddc->Static.attrs->textPrecision = - pddc->Dynamic->pPCAttr->textPrecision; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXCharExpansionAsf) == PEXBundled) - pddc->Static.attrs->charExpansion = - textbundle->real_entry.charExpansion; - else - pddc->Static.attrs->charExpansion = - pddc->Dynamic->pPCAttr->charExpansion; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXCharSpacingAsf) == PEXBundled) - pddc->Static.attrs->charSpacing = textbundle->real_entry.charSpacing; - else - pddc->Static.attrs->charSpacing = pddc->Dynamic->pPCAttr->charSpacing; - } - } - - /* - * Next, unbundled attributes always do these, but there may be some way - * to put some smarts in about this - */ - pddc->Static.attrs->charHeight = pddc->Dynamic->pPCAttr->charHeight; - pddc->Static.attrs->charUp = pddc->Dynamic->pPCAttr->charUp; - pddc->Static.attrs->textPath = pddc->Dynamic->pPCAttr->textPath; - pddc->Static.attrs->textAlignment = pddc->Dynamic->pPCAttr->textAlignment; - pddc->Static.attrs->atextHeight = pddc->Dynamic->pPCAttr->atextHeight; - pddc->Static.attrs->atextUp = pddc->Dynamic->pPCAttr->atextUp; - pddc->Static.attrs->atextPath = pddc->Dynamic->pPCAttr->atextPath; - pddc->Static.attrs->atextAlignment = pddc->Dynamic->pPCAttr->atextAlignment; - pddc->Static.attrs->atextStyle = pddc->Dynamic->pPCAttr->atextStyle; - - pddc->Static.misc.flags |= TEXTGCFLAG; - - /* - * Line Attributes - */ - if ((tables & PEXDynLineBundle) || - (tables & PEXDynLineBundleContents) || - colors) { - if (~(pddc->Dynamic->pPCAttr->asfs - & (PEXLineTypeAsf | PEXLineWidthAsf | PEXLineColourAsf | - PEXCurveApproxAsf | PEXPolylineInterpAsf))) { - if ((InquireLUTEntryAddress(PEXLineBundleLUT, - pRend->lut[PEXLineBundleLUT], - pddc->Dynamic->pPCAttr->lineIndex, - &status, (ddPointer *) (&linebundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - } - /* Update DDC rendering attributes if bundled */ - /* always try to set the color */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineColourAsf) == PEXBundled) { - miConvertColor(pRend, - &linebundle->real_entry.lineColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->lineColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->lineColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->lineColour); - } - } - /* only set these if it's the bundle that changed */ - if ((tables & PEXDynLineBundle) || - (tables & PEXDynLineBundleContents)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineTypeAsf) == PEXBundled) - pddc->Static.attrs->lineType = linebundle->real_entry.lineType; - else - pddc->Static.attrs->lineType = pddc->Dynamic->pPCAttr->lineType; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineWidthAsf) == PEXBundled) - pddc->Static.attrs->lineWidth = linebundle->real_entry.lineWidth; - else - pddc->Static.attrs->lineWidth = pddc->Dynamic->pPCAttr->lineWidth; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXCurveApproxAsf) == PEXBundled) - pddc->Static.attrs->curveApprox = linebundle->real_entry.curveApprox; - else - pddc->Static.attrs->curveApprox = pddc->Dynamic->pPCAttr->curveApprox; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXPolylineInterpAsf) == PEXBundled) - pddc->Static.attrs->lineInterp = linebundle->real_entry.polylineInterp; - else - pddc->Static.attrs->lineInterp = pddc->Dynamic->pPCAttr->lineInterp; - } - pddc->Static.misc.flags |= POLYLINEGCFLAG; - } - - /* - * Surface Attributes - */ - - if ((tables & PEXDynInteriorBundle) || - (tables & PEXDynInteriorBundleContents) || - colors) { - if (~(pddc->Dynamic->pPCAttr->asfs - & (PEXInteriorStyleAsf | PEXInteriorStyleIndexAsf | - PEXSurfaceColourAsf | PEXSurfaceInterpAsf | - PEXReflectionModelAsf | PEXReflectionAttrAsf | - PEXBfInteriorStyleAsf | PEXBfInteriorStyleIndexAsf | - PEXBfSurfaceColourAsf | PEXBfSurfaceInterpAsf | - PEXBfReflectionModelAsf | PEXBfReflectionAttrAsf | - PEXSurfaceApproxAsf))) { - if ((InquireLUTEntryAddress(PEXInteriorBundleLUT, - pRend->lut[PEXInteriorBundleLUT], - pddc->Dynamic->pPCAttr->intIndex, - &status, (ddPointer *) (&intbundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - } - /* Update DDC rendering attributes if bundled */ - /* always try to set the color */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceColourAsf) == PEXBundled) { - miConvertColor(pRend, - &intbundle->real_entry.surfaceColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->surfaceColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->surfaceColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->surfaceColour); - } - if ((pddc->Dynamic->pPCAttr->asfs & PEXBfSurfaceColourAsf) == PEXBundled) { - miConvertColor(pRend, - &intbundle->real_entry.bfSurfaceColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->bfSurfColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->bfSurfColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->bfSurfColour); - } - - } - /* only set these if it's the bundle that changed */ - if ((tables & PEXDynInteriorBundle) || - (tables & PEXDynInteriorBundleContents)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceInterpAsf) - == PEXBundled) - pddc->Static.attrs->surfInterp = - intbundle->real_entry.surfaceInterp; - else - pddc->Static.attrs->surfInterp = - pddc->Dynamic->pPCAttr->surfInterp; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXReflectionModelAsf) - == PEXBundled) - pddc->Static.attrs->reflModel = - intbundle->real_entry.reflectionModel; - else - pddc->Static.attrs->reflModel = - pddc->Dynamic->pPCAttr->reflModel; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXReflectionAttrAsf) - == PEXBundled){ - pddc->Static.attrs->reflAttr = - intbundle->real_entry.reflectionAttr; - miConvertColor(pRend, - &intbundle->real_entry.reflectionAttr.specularColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->reflAttr.specularColour); - } else { - pddc->Static.attrs->reflAttr = pddc->Dynamic->pPCAttr->reflAttr; - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->reflAttr.specularColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->reflAttr.specularColour); - } - - - if ((pddc->Dynamic->pPCAttr->asfs & PEXInteriorStyleAsf) - == PEXBundled) - pddc->Static.attrs->intStyle = - intbundle->real_entry.interiorStyle; - else - pddc->Static.attrs->intStyle = pddc->Dynamic->pPCAttr->intStyle; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXBfSurfaceInterpAsf) - == PEXBundled) - pddc->Static.attrs->bfSurfInterp = - intbundle->real_entry.bfSurfaceInterp; - else - pddc->Static.attrs->bfSurfInterp = - pddc->Dynamic->pPCAttr->bfSurfInterp; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXBfReflectionModelAsf) - == PEXBundled) - pddc->Static.attrs->bfReflModel = - intbundle->real_entry.bfReflectionModel; - else - pddc->Static.attrs->bfReflModel = - pddc->Dynamic->pPCAttr->bfReflModel; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXBfReflectionAttrAsf) - == PEXBundled){ - pddc->Static.attrs->bfReflAttr = - intbundle->real_entry.bfReflectionAttr; - miConvertColor(pRend, - &intbundle->real_entry.bfReflectionAttr.specularColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->bfReflAttr.specularColour); - } else { - pddc->Static.attrs->bfReflAttr = - pddc->Dynamic->pPCAttr->bfReflAttr; - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->bfReflAttr.specularColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->bfReflAttr.specularColour); - } - - - if ((pddc->Dynamic->pPCAttr->asfs & PEXBfInteriorStyleAsf) - == PEXBundled) - pddc->Static.attrs->bfIntStyle = - intbundle->real_entry.bfInteriorStyle; - else - pddc->Static.attrs->bfIntStyle = - pddc->Dynamic->pPCAttr->bfIntStyle; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceApproxAsf) - == PEXBundled) - pddc->Static.attrs->surfApprox = - intbundle->real_entry.surfaceApprox; - else - pddc->Static.attrs->surfApprox = - pddc->Dynamic->pPCAttr->surfApprox; - } - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - - /* - * Surface edge Attributes - */ - if ((tables & PEXDynEdgeBundle) || - (tables & PEXDynEdgeBundleContents) || - colors) { - if (~(pddc->Dynamic->pPCAttr->asfs - & (PEXSurfaceEdgeTypeAsf | PEXSurfaceEdgeWidthAsf | - PEXSurfaceEdgeColourAsf | PEXSurfaceEdgesAsf))) { - if ((InquireLUTEntryAddress(PEXEdgeBundleLUT, - pRend->lut[PEXEdgeBundleLUT], - pddc->Dynamic->pPCAttr->edgeIndex, - &status, (ddPointer *) (&edgebundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - } - /* always try to set the color */ - if (!MI_DDC_IS_HIGHLIGHT(pddc)) { - - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgeColourAsf) == PEXBundled) { - miConvertColor(pRend, - &edgebundle->real_entry.edgeColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->edgeColour); - } else { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->edgeColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->edgeColour); - } - } - /* only set these if it's the bundle that changed */ - if ((tables & PEXDynEdgeBundle) || - (tables & PEXDynEdgeBundleContents)) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgesAsf) == PEXBundled) - pddc->Static.attrs->edges = edgebundle->real_entry.edges; - else - pddc->Static.attrs->edges = pddc->Dynamic->pPCAttr->edges; - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgeTypeAsf) == PEXBundled) - pddc->Static.attrs->edgeType = edgebundle->real_entry.edgeType; - else - pddc->Static.attrs->edgeType = pddc->Dynamic->pPCAttr->edgeType; - - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgeWidthAsf) == PEXBundled) - pddc->Static.attrs->edgeWidth = edgebundle->real_entry.edgeWidth; - else - pddc->Static.attrs->edgeWidth = pddc->Dynamic->pPCAttr->edgeWidth; - } - pddc->Static.misc.flags |= EDGEGCFLAG; - } - - /* - * View table - */ - if ((attrs & PEXDynNpcSubvolume) || (attrs & PEXDynViewport)) { - extern ddpex3rtn miBldViewport_xform(); - - miBldViewport_xform(pRend, pRend->pDrawable, - pddc->Static.misc.viewport_xform, pddc ); - } - if ((tables & PEXDynViewTable) || (tables & PEXDynViewTableContents)) { - extern ddpex3rtn miBldCC_xform(); - - miBldCC_xform(pRend, pddc); - } - - /* the echo colour change always take places */ - pddc->Static.attrs->echoColour = pRend->echoColour; - - /* If the echo mode changes, we have to change all these GCs */ - if( attrs & PEXDynEchoMode ) - { - pddc->Static.attrs->echoMode = pRend->echoMode; - pddc->Static.misc.flags |= POLYLINEGCFLAG; - pddc->Static.misc.flags |= MARKERGCFLAG; - pddc->Static.misc.flags |= FILLAREAGCFLAG; - pddc->Static.misc.flags |= EDGEGCFLAG; - pddc->Static.misc.flags |= TEXTGCFLAG; - } - - /* - * Set the Clip List in each GC if there are any - * all GCs are defined at the same time so check if any one exists - */ - if ((attrs & PEXDynClipList) && pddc->Static.misc.pPolylineGC) - { - - extern int SetClipRects(); - extern void ValidateGC(); - xRectangle *xrects, *p; - ddDeviceRect *ddrects; - ddLONG numrects; - XID gcval; - int i; - - numrects = pRend->clipList->numObj; - if (numrects) { - ddrects = (ddDeviceRect *) pRend->clipList->pList; - xrects = (xRectangle*) xalloc(numrects * sizeof(xRectangle)); - if (!xrects) return BadAlloc; - /* Need to convert to XRectangle format */ - for (i = 0, p = xrects; i < numrects; i++, p++, ddrects++) { - p->x = ddrects->xmin; - p->y = pRend->pDrawable->height - ddrects->ymax; - p->width = ddrects->xmax - ddrects->xmin + 1; - p->height = ddrects->ymax - ddrects->ymin + 1; - } - - SetClipRects(pddc->Static.misc.pPolylineGC, 0, 0, - (int)numrects, xrects, Unsorted); - SetClipRects(pddc->Static.misc.pFillAreaGC, 0, 0, - (int)numrects, xrects, Unsorted); - SetClipRects(pddc->Static.misc.pEdgeGC, 0, 0, - (int)numrects, xrects, Unsorted); - SetClipRects(pddc->Static.misc.pPolyMarkerGC, 0, 0, - (int)numrects, xrects, Unsorted); - SetClipRects(pddc->Static.misc.pTextGC, 0, 0, - (int)numrects, xrects, Unsorted); - xfree((char*)xrects); - } - else { - gcval = None; - ChangeGC(pddc->Static.misc.pPolylineGC, GCClipMask, &gcval); - ChangeGC(pddc->Static.misc.pFillAreaGC, GCClipMask, &gcval); - ChangeGC(pddc->Static.misc.pEdgeGC, GCClipMask, &gcval); - ChangeGC(pddc->Static.misc.pPolyMarkerGC, GCClipMask, &gcval); - ChangeGC(pddc->Static.misc.pTextGC, GCClipMask, &gcval); - } - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolylineGC); - ValidateGC(pRend->pDrawable, pddc->Static.misc.pFillAreaGC); - ValidateGC(pRend->pDrawable, pddc->Static.misc.pEdgeGC); - ValidateGC(pRend->pDrawable, pddc->Static.misc.pPolyMarkerGC); - ValidateGC(pRend->pDrawable, pddc->Static.misc.pTextGC); - } - - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c:3.7 Fri Dec 14 14:57:20 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c Sat Feb 28 21:41:54 2004 @@ -1,713 +0,0 @@ -/* $Xorg: miBldXform.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name Sun Microsystems not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miBldXform.c,v 3.7 2001/12/14 19:57:20 dawes Exp $ */ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "miLUT.h" -#include "PEXErr.h" -#include "pixmap.h" -#include "windowstr.h" -#include "gcstruct.h" -#include "scrnintstr.h" -#include "regionstr.h" -#include "miscstruct.h" -#include "miRender.h" -#include "pexos.h" - -/* External variables and functions */ -extern void miMatMult(); -extern void miMatCopy(); -extern ddpex3rtn InquireLUTEntryAddress(); -extern void SetViewportClip(); - - -/*++ - | - | Function Name: miBldViewport_xform - | - | Function Description: - | Computes the viewport_xform with special handling for the ddc. - | This is used for setting up for drawing, picking, searching, - | and MapDCtoWC/MapWCtoDC - | - | Note(s): - | - --*/ - -ddpex3rtn -miBldViewport_xform(pRend, pDrawable, xform, pddc ) - ddRendererPtr pRend; /* renderer handle */ - DrawablePtr pDrawable; /* pointer to X drawable */ - ddFLOAT xform[4][4]; /* returned transform */ - miDDContext *pddc; /* dd context handle */ -{ - - ddFLOAT Sx, Sy, Sz; - ddFLOAT Sxy; - ddFLOAT Tx, Ty, Tz; - - /* - * Determine the npc -> dc viewport transform. Let's represent - * this transform as follows : - * - * Sx 0 0 0 - * 0 Sy 0 0 - * 0 0 Sz 0 - * Tx Ty Tz 1 - * - * There are two components to this transformation. - * - * NOTE THAT THE TRANSLATION COMPONENTS DETERMINED IN THE BeginRenderi -ng - * CODE ARE DIFFERENT FOR THE PICKING CASE. WE USE THE PHIGS DC SPACE - * TO REPRESENT THE PICK APERTURE AS OPPOSED TO THE X'S SCREEN SPACE. - * - * - * The elements Sx, Sy, Tx, and Ty are computed in two stages as - * follows : - * - * First, the npc subvolume in the renderer determines - * the subvolume that is projected onto the viewport. - * This tranformation is implemented by "magnifying" this - * subvolume to the range (0, 0, 0)-(1,1,1) - * - * NPC space "magnified" space - * - * +-----+(c,d) +--------+(1,1) - * | | | | - * | | <====> | | - * | | | | - * (a,b)+-----+ (0,0)+--------+ - * - * 1/(c-a) 0 0 - * 0 1/(d-b) 0 - * -a/(c-a) -b/(d-b) 0 - * - */ - /* - * Initialize the scaling components Sx, Sy, and Sz. - * - */ - - Sx = 1/(pRend->npcSubvolume.maxval.x - pRend->npcSubvolume.minval.x); - Sy = 1/(pRend->npcSubvolume.maxval.y - pRend->npcSubvolume.minval.y); - Sz = 1/(pRend->npcSubvolume.maxval.z - pRend->npcSubvolume.minval.z); - - /* - * Secondly, if the useDrawable flag in the viewport is set, then - * get the min and max of the drawable from the pDrawable passed - * and store it in the viewport as the default values. Otherwise, - * the values are as available in the viewport slot of renderer - * context already set up. Note that the same aspect ratio limitation - * used above also applies to the viewport transform. - */ - memcpy( (char *) xform, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - if (pRend->viewport.useDrawable) { /* Use the drawable width and height */ - /* FOR RENDERING: - * Note that The origin is always 0,0 since ddx points - * are specified relative to the window origin - * Lastly, note that the screen origin is at the upper left - * corner of the window, the viewing space origin is at the - * lower left corner. To "flip" the coordinates to match - * the screen space, apply the following transform: - * - * 1 0 0 0 - * 0 -1 0 0 - * 0 0 1 0 - * 0 window_y_max 0 0 - * - * - * ie y' = (window_y_max - y) - * - */ - /* FOR PICKING: - * Note that The origin is always 0,0 since DC points - * are specified relative to the window origin. The - * required transform is : - * - * Sx 0 0 0 - * 0 Sy 0 0 - * 0 0 1 0 - * 0 0 0 0 - * - */ - /* - * Modify the scaling components Sx and Sy to include the second - * transform as follows : - */ - - Sx *= (ddFLOAT)pDrawable->width; - Sy *= (ddFLOAT)pDrawable->height; - - /* - * Initialize the translation components Tx, Ty and Tz - * Note the difference for picking and searching from - * drawing. drawing flips the y value. the others don't - */ - - Tx = 0.0; - if ((pRend->render_mode == MI_REND_PICKING) || (!pddc)) - Ty = 0.0; - else if ((pRend->render_mode == MI_REND_DRAWING) && (pddc)) - Ty = pDrawable->height; - Tz = 0.0; - - } else { - - xRectangle viewport; - - /* FOR RENDERING: - * Limit the rendering for each of the GC's to the viewport - * Note that The origin is always 0,0 since ddx points - * are specified relative to the window origin - * Lastly, note that the screen origin is at the upper left - * corner of the window, the viewing space origin is at the - * lower left corner. Furthermore, primitives must also be - * translated from this lower left origin to the viewport origin. - * To "flip" the coordinates to match the screen space, apply - * the following transform: - * - * 1 0 0 0 - * 0 -1 0 0 - * 0 0 1 0 - * viewport_origin_x (window_y_max - viewport_origin_y) 0 0 - * - * - * ie y' = (window_y_max - viewport_origin_y - y) - * - * Lastly, note that the origin of the clipping rectangle for - * ddx is relative to the upper left corner of the rectangle, - * thus this corner must still be further offset by the viewport - * height. - * - */ - /* FOR PICKING: - * Limit the picking for each of the primitives to the viewport - * Note that The origin is always 0,0 since DC points - * are specified relative to the window origin. The required - * transform is : - * - * Sx 0 0 0 - * 0 Sy 0 0 - * 0 0 1 0 - * Tx Ty 0 0 - * - */ - /* FOR SEARCHING: (this is called when initializing the renderer) - * there is no drawable, so work around that. None of what this - * procedure does is needed for searching, so there may be a better - * way to deal with this. - */ - viewport.width = pRend->viewport.maxval.x - pRend->viewport.minval.x; - viewport.height = pRend->viewport.maxval.y - pRend->viewport.minval.y; - - viewport.x = pRend->viewport.minval.x; - if (pDrawable) - viewport.y = pDrawable->height - - pRend->viewport.minval.y - - viewport.height; - else - viewport.y = 0; - - /* - * Modify the scaling components Sx and Sy to include the second - * transform as follows : - */ - - Sx *= (ddFLOAT)viewport.width; - Sy *= (ddFLOAT)viewport.height; - - /* - * Initialize the translation components Tx, Ty and Tz. - */ - - Tx = (ddFLOAT)pRend->viewport.minval.x; - - if ((pRend->render_mode == MI_REND_PICKING) || (!pddc)) - Ty = (ddFLOAT)pRend->viewport.minval.y; - else if ((pRend->render_mode == MI_REND_DRAWING) && (pddc)) - if (pDrawable) - Ty = (ddFLOAT)(pDrawable->height - pRend->viewport.minval.y); - else Ty = 0.0; - Tz = 0.0; - - if ((pRend->render_mode == MI_REND_DRAWING) && pDrawable && pddc) { - /* Set the GC clip mask to clip to the viewport */ - - ddLONG numrects = pRend->clipList->numObj; - - if (numrects > 0) { - xRectangle *xrects, *p; - ddDeviceRect *ddrects; - RegionPtr clipRegion; - RegionRec tempRegion; - GCPtr pGC; - BoxRec box; - int i; - - ddrects = (ddDeviceRect *) pRend->clipList->pList; - xrects = (xRectangle*) xalloc (numrects * sizeof(xRectangle)); - if (!xrects) return BadAlloc; - /* Need to convert to XRectangle format */ - for (i = 0, p = xrects; i < numrects; i++, p++, ddrects++) { - p->x = ddrects->xmin; - p->y = pRend->pDrawable->height - ddrects->ymax; - p->width = ddrects->xmax - ddrects->xmin + 1; - p->height = ddrects->ymax - ddrects->ymin + 1; - } - - /* - * Compute the intersection of the viewport and the GC's - * clip region. Note that there is a GC for each of the - * primitive types, and we only have to compute the - * intersected region for one of them. This computed region - * will be good for all of the GC's. - */ - - pGC = pddc->Static.misc.pPolylineGC; - - clipRegion = RECTS_TO_REGION(pGC->pScreen, numrects, - xrects, Unsorted); - - xfree((char *) xrects); - - box.x1 = viewport.x; - box.y1 = viewport.y; - box.x2 = viewport.x + viewport.width; - box.y2 = viewport.y + viewport.height; - - REGION_INIT(pGC->pScreen, &tempRegion, &box, 1); - REGION_INTERSECT(pGC->pScreen, clipRegion, clipRegion, &tempRegion); - REGION_UNINIT(pGC->pScreen, &tempRegion); - - - /* - * Now set the GC clip regions. - */ - - SetViewportClip (pddc->Static.misc.pPolylineGC, clipRegion); - SetViewportClip (pddc->Static.misc.pFillAreaGC, clipRegion); - SetViewportClip (pddc->Static.misc.pEdgeGC, clipRegion); - SetViewportClip (pddc->Static.misc.pPolyMarkerGC, clipRegion); - SetViewportClip (pddc->Static.misc.pTextGC, clipRegion); - - REGION_DESTROY(pGC->pScreen, clipRegion); - } - else { - SetClipRects(pddc->Static.misc.pPolylineGC, - 0, 0, 1, &viewport,YXBanded); - SetClipRects(pddc->Static.misc.pFillAreaGC, - 0, 0, 1, &viewport,YXBanded); - SetClipRects(pddc->Static.misc.pEdgeGC, - 0, 0, 1, &viewport,YXBanded); - SetClipRects(pddc->Static.misc.pPolyMarkerGC, - 0, 0, 1, &viewport,YXBanded); - SetClipRects(pddc->Static.misc.pTextGC, - 0, 0, 1, &viewport,YXBanded); - } - } - } - - /* - * Note that Phigs requires that aspect ratio be maintained. - * Therefore, choose the minimum X or y ratio to represent the - * x and y view port scaling factor. Note that Z is exempt - * from this aspect ratio restriction. - */ - Sxy = (Sx < Sy) ? Sx : Sy; - - /* - * Finally, set the viewport transform components using Sxy, Sz, - * and the initial Tx, Ty, Tz modified suitably. - */ - - xform[0][0]= Sxy; - /* Negate the value to "flip" the screen (see above), IF WE ARE */ - /* RENDERING. On the other hand, since we are PICKING, we need */ - /* the PHIGS DC, i.e., the lower left is the origin and NO FLIP */ - /* of y is required. */ - /* In case pddc is NULL, this routine is being called from Map- */ - /* DcWc and the situation is similar to PICKING. i.e., No y flip*/ - /* is required. */ - if ((pRend->render_mode == MI_REND_PICKING) || (!pddc)) - xform[1][1]= Sxy; - else if ((pRend->render_mode == MI_REND_DRAWING) && (pddc)) - xform[1][1]= -Sxy; - xform[2][2]= Sz; - - xform[0][3] = Tx - (pRend->npcSubvolume.minval.x * Sxy); - - /* Note, the "+" compensates for negating the [1][1] term above */ - if ((pRend->render_mode == MI_REND_PICKING) || (!pddc)) - xform[1][3]= Ty - (pRend->npcSubvolume.minval.y * Sxy); - else if ((pRend->render_mode == MI_REND_DRAWING) && (pddc)) - xform[1][3]= Ty + (pRend->npcSubvolume.minval.y * Sxy); - - xform[2][3]= Tz - (pRend->npcSubvolume.minval.z * Sz); - - /* Mark as invalid appropriate inverse transforms in dd context */ - if (pddc) - pddc->Static.misc.flags |= ( INVTRCCTODCXFRMFLAG ); - -} - -/*++ - | - | Function Name: miBldCC_xform - | - | Function Description: - | Computes the transformation to go from NPC to the PEX-SI's - | clipping space. - | - | Note(s): - | - --*/ - -ddpex3rtn -miBldCC_xform(pRend, pddc) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd context handle */ - -{ - - ddNpcSubvolume *cliplimits; - miViewEntry *viewbundle; - ddFLOAT cc_to_npc[4][4]; - ddUSHORT status; - - /* - * Check if a view LUT is available and accordingly, get the view - * matrices either from the view LUT or from the defaults. - */ - - if (!(pRend->lut[PEXViewLUT])) { /* Use defaults */ - - memcpy( (char *) pddc->Dynamic->npc_to_cc_xform, - (char *) ident4x4, - 16 * sizeof(ddFLOAT)); - pddc->Dynamic->npc_to_cc_xform[0][0] = 2.0; - pddc->Dynamic->npc_to_cc_xform[1][1] = 2.0; - pddc->Dynamic->npc_to_cc_xform[2][2] = 2.0; - pddc->Dynamic->npc_to_cc_xform[0][3] = -1.0; - pddc->Dynamic->npc_to_cc_xform[1][3] = -1.0; - pddc->Dynamic->npc_to_cc_xform[2][3] = -1.0; - - memcpy( (char *) pddc->Dynamic->wc_to_npc_xform, - (char *) ident4x4, - 16*(sizeof(ddFLOAT))); - - memcpy( (char *) cc_to_npc, - (char *) ident4x4, - 16 * sizeof(ddFLOAT)); - cc_to_npc[0][0] = 0.5; - cc_to_npc[1][1] = 0.5; - cc_to_npc[2][2] = 0.5; - cc_to_npc[0][3] = 0.5; - cc_to_npc[1][3] = 0.5; - cc_to_npc[2][3] = 0.5; - -/* THIS SHOULD GO AWAY EVENTUALLY... */ -pddc->Dynamic->clipFlags = 0; - - } else { - - /* Get the view table entry at current view index first */ - - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - pddc->Dynamic->pPCAttr->viewIndex, - &status, (ddPointer *)(&viewbundle))) - == PEXLookupTableError) - return (PEXLookupTableError); - - miMatCopy(viewbundle->vom, pddc->Dynamic->wc_to_npc_xform); - -/* THIS SHOULD GO AWAY EVENTUALLY... */ -pddc->Dynamic->clipFlags = viewbundle->entry.clipFlags; - - if (viewbundle->entry.clipFlags) - { - /* Use the clip limits as set up in the current view */ - - cliplimits = &viewbundle->entry.clipLimits; - /* - * Compute the npc_to_cc & cc_to_npc - * transformations. - * The Pex view clipper can only clip against a cube with - * corners (-1,-1,-1) (1,1,1). - * It is therefore necessary to append an additional - * transformation to the wc_to_cc_xform transform such - * that the view clip volume is transformed to this cube, - * rather than leave the space untouched and clip against actual - * clip planes specified in the view lut. - * Note that this transformation must be undone by the - * subsequent cc_to_dc_xform, so the inverse of this - * matrix is pre-pended to this transform. - * - * two matrices then (note these extend trivially into 3D): - * - * NPC subvolume SI clipping space - * - * +-----+(c,d) +--------+(1,1) - * | | | | - * | | <====> | | - * | | | | - * (a,b)+-----+ (-1,-1)+--------+ - * - * npc_to_clip: 2/(c-a) 0 0 - * 0 2/(d-b) 0 - * (c+a)/(a-c) (d+b)/b-d) 0 - * - * clip_to_npc: (c-a)/2 0 0 - * 0 (d-b)/2 0 - * (c+a)/2 (d+b)/2 0 - * - * Last, note that the cliplimits from the view table entry are only - * used if enabled by the clip flags. - */ - memcpy( (char *) pddc->Dynamic->npc_to_cc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) cc_to_npc, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /* set up X & Y clip limits */ - - if (viewbundle->entry.clipFlags & PEXClipXY) { - pddc->Dynamic->npc_to_cc_xform[0][0] = - 2.0/(cliplimits->maxval.x - cliplimits->minval.x); - pddc->Dynamic->npc_to_cc_xform[1][1] = - 2.0/(cliplimits->maxval.y - cliplimits->minval.y); - pddc->Dynamic->npc_to_cc_xform[0][3] = - (cliplimits->maxval.x + cliplimits->minval.x) / - (cliplimits->minval.x - cliplimits->maxval.x); - pddc->Dynamic->npc_to_cc_xform[1][3] = - (cliplimits->maxval.y + cliplimits->minval.y) / - (cliplimits->minval.y - cliplimits->maxval.y); - - cc_to_npc[0][0] = - (cliplimits->maxval.x - cliplimits->minval.x)/2.0; - cc_to_npc[1][1] = - (cliplimits->maxval.y - cliplimits->minval.y)/2.0; - cc_to_npc[0][3] = - (cliplimits->maxval.x + cliplimits->minval.x)/2.0; - cc_to_npc[1][3] = - (cliplimits->maxval.y + cliplimits->minval.y)/2.0; - } else { - - /* Use default NPC clip limits (0.0 <-> 1.0) */ - - pddc->Dynamic->npc_to_cc_xform[0][0] = 2.0/(1.0 - 0.0); - pddc->Dynamic->npc_to_cc_xform[1][1] = 2.0/(1.0 - 0.0); - pddc->Dynamic->npc_to_cc_xform[0][3] = (1.0 + 0.0)/(0.0 - 1.0); - pddc->Dynamic->npc_to_cc_xform[1][3] = (1.0 + 0.0)/(0.0 - 1.0); - - cc_to_npc[0][0] = (1.0 - 0.0)/2.0; - cc_to_npc[1][1] = (1.0 - 0.0)/2.0; - cc_to_npc[0][3] = (1.0 + 0.0)/2.0; - cc_to_npc[1][3] = (1.0 + 0.0)/2.0; - } - - /* Now, front & back clip limits */ - - if ( (viewbundle->entry.clipFlags & PEXClipFront) && - (viewbundle->entry.clipFlags & PEXClipBack) ) { - - /* Both front and back clipping on */ - - pddc->Dynamic->npc_to_cc_xform[2][2] = - 2.0/(cliplimits->maxval.z - cliplimits->minval.z); - pddc->Dynamic->npc_to_cc_xform[2][3] = - (cliplimits->maxval.z + cliplimits->minval.z) / - (cliplimits->minval.z - cliplimits->maxval.z); - - cc_to_npc[2][2] = - (cliplimits->maxval.z - cliplimits->minval.z)/2.0; - cc_to_npc[2][3] = - (cliplimits->maxval.z + cliplimits->minval.z)/2.0; - - } else if (viewbundle->entry.clipFlags & PEXClipFront) { - - /* Only front clipping ON; Use default NPC Back value */ - - pddc->Dynamic->npc_to_cc_xform[2][2] = - 2.0/(1.0 - cliplimits->minval.z); - pddc->Dynamic->npc_to_cc_xform[2][3] = - (1.0 + cliplimits->minval.z) / - (cliplimits->minval.z - 1.0); - - cc_to_npc[2][2] = - (1.0 - cliplimits->minval.z)/2.0; - cc_to_npc[2][3] = - (1.0 + cliplimits->minval.z)/2.0; - - } else if (viewbundle->entry.clipFlags & PEXClipBack) { - - /* Only back clipping ON; Use default NPC Front value */ - - pddc->Dynamic->npc_to_cc_xform[2][2] = 2.0/(cliplimits->maxval.z); - pddc->Dynamic->npc_to_cc_xform[2][3] = -1.0; - - cc_to_npc[2][2] = (cliplimits->maxval.z)/2.0; - cc_to_npc[2][3] = (cliplimits->maxval.z)/2.0; - - } else { - - /* Both front and back clipping OFF; Use default NPC space */ - - pddc->Dynamic->npc_to_cc_xform[2][2] = 2.0/(1.0 - 0.0); - pddc->Dynamic->npc_to_cc_xform[2][3] = (1.0 + 0.0) / (0.0 - 1.0); - - cc_to_npc[2][2] = (1.0 - 0.0)/2.0; - cc_to_npc[2][3] = (1.0 + 0.0)/2.0; - } - - } - else /* All clipping OFF; Use the entire NPC space, i.e., (0,0,0) */ - /* to (1,1,1) */ - { - - memcpy( (char *) pddc->Dynamic->npc_to_cc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - pddc->Dynamic->npc_to_cc_xform[0][0] = 2.0; - pddc->Dynamic->npc_to_cc_xform[1][1] = 2.0; - pddc->Dynamic->npc_to_cc_xform[2][2] = 2.0; - pddc->Dynamic->npc_to_cc_xform[0][3] = -1.0; - pddc->Dynamic->npc_to_cc_xform[1][3] = -1.0; - pddc->Dynamic->npc_to_cc_xform[2][3] = -1.0; - - memcpy( (char *) cc_to_npc, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - cc_to_npc[0][0] = 0.5; - cc_to_npc[1][1] = 0.5; - cc_to_npc[2][2] = 0.5; - cc_to_npc[0][3] = 0.5; - cc_to_npc[1][3] = 0.5; - cc_to_npc[2][3] = 0.5; - - } - } - - /* - * Compute the various composites stored in the - * dd context. - */ - /* - * Compute the composite cc -> dc, i.e., Clip to Device. - */ - miMatMult ( pddc->Dynamic->cc_to_dc_xform, - cc_to_npc, - pddc->Static.misc.viewport_xform); - - /* - * Compute the composite wc -> cc, i.e., World to Clip. - */ - miMatMult ( pddc->Dynamic->wc_to_cc_xform, - pddc->Dynamic->wc_to_npc_xform, - pddc->Dynamic->npc_to_cc_xform); - /* - * Compute the composite mc -> wc, i.e. Modelling to World - */ - miMatMult( pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - /* - * Compute the composite mc -> npc, i.em Modelling to NPC - */ - miMatMult ( pddc->Dynamic->mc_to_npc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_npc_xform); - - /* - * Compute the composite [VCM], i.e, Modelling to Clip. - */ - miMatMult ( pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_cc_xform); - /* - * Compute the composite mc -> dc transform, i.e., Modelling to Device. - */ - miMatMult ( pddc->Dynamic->mc_to_dc_xform, - pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->cc_to_dc_xform); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRWCTOCCXFRMFLAG | INVTRMCTOCCXFRMFLAG | - INVVIEWXFRMFLAG | CC_DCUEVERSION); - -} - - -void SetViewportClip(pGC, clipRegion) - GCPtr pGC; - RegionPtr clipRegion; -{ - /* - * When we call the GC's ChangeClip function, it destroys - * the region we pass to it. Since this function is called - * for each of the GC's, we copy clipRegion into tempRegion - * and use tempRegion when calling ChangeClip. - */ - - RegionPtr tempRegion = REGION_CREATE(pGC->pScreen, NullBox, 0); - - REGION_COPY(pGC->pScreen, tempRegion, clipRegion); - - pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; - pGC->clipOrg.x = 0; - pGC->clipOrg.y = 0; - pGC->stateChanges |= GCClipXOrigin|GCClipYOrigin; - (*pGC->funcs->ChangeClip)(pGC, CT_REGION, tempRegion, 0); - if (pGC->funcs->ChangeGC) - (*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin|GCClipYOrigin|GCClipMask); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c:3.8 Fri Dec 14 14:57:20 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c Sat Feb 28 21:41:54 2004 @@ -1,270 +0,0 @@ -/* $Xorg: miCellArray.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miCellArray.c,v 3.8 2001/12/14 19:57:20 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "ddpex2.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miCellArray - | - | Function Description: - | - | Draws the outline of the cell array parallelogram using - | the current polyline attributes. - | - | Note(s): A whole lot-o work needs to be done in order to - | support full color indexing (which is really an - | attempt at texture mapping) - | - | The Parse routine (in pexOCParse) should be enhanced to detect - | whether |dR|, |dQ|, dx or dy are of zero length - | - | - | - --*/ - - -ddpex3rtn -miCellArray(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; - miGenericStr *pExecuteOC; - - { - -/***************************************************************************/ - - /* calls */ - extern ocTableType InitExecuteOCTable[]; - - /* Local variable definitions */ - miGenericStr *pGStr; - miCellArrayStruct *ddCell = (miCellArrayStruct *)(pExecuteOC+1); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *input = &ddCell->point; - miPolylineStruct *output; - listofddPoint *pddolist; - int point_size, nGridLines, i; - ddPointUnion in_pt, out_pt, Ppt, Qpt, Rpt, Spt; - ddpex3rtn status; - ddCoord3D dRpt, dQpt, x_step, y_step, - basept, endpt; - ddCoord2D tempQ, tempR; - - - -/* - * A Cell Array is defined by three points, P, Q, and R-> This - * defines a parallelogram, closed by an implied S - * - * P-----(dR)---->R - * \ \ - * \ \ - * (dQ) \ - * \ \ - * \ \ - * Q--------------S (implied) - * - * S = P + dR + dQ - */ - - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miPolylineStruct))))) - return(BadAlloc); - - pGStr->elementType = PEXOCPolylineSet; - - output = (miPolylineStruct *) (pGStr + 1); - - /* We need to initialize the maxLists to zero since the MI_ALLOCLISTHEADER - macro does reallocs only when necessary, based on this field. The - intent is to use the temp lists of the renderer over & over, but - in this case we are not getting a header from MI_NEXTTEMPDATALIST */ - - output->maxLists = 0; - - nGridLines = (ddCell->dx) + (ddCell->dy) + 2; - MI_ALLOCLISTHEADER(output,MI_ROUND_LISTHEADERCOUNT(nGridLines)); - - point_size = sizeof(ddCoord3DL); - for(i = 0, pddolist = output->ddList; i < nGridLines; i++){ - MI_ALLOCLISTOFDDPOINT(pddolist, 2, point_size); - pddolist++; - } - - /* Initialize output listHeader */ - output->type = DD_3D_POINT; - output->flags = input->flags; - output->numLists = nGridLines; - - /* Get input points */ - if (DD_IsVert3D(input->type)) - { - Ppt.ptr = ddCell->point.ddList->pts.ptr; - Rpt.ptr = Ppt.ptr + sizeof(ddCoord3D); - Qpt.ptr = Rpt.ptr + sizeof(ddCoord3D); - } - else - { - Ppt.ptr = ddCell->point.ddList->pts.ptr; - Spt.ptr = Ppt.ptr + sizeof(ddCoord2D); - - tempR.x = Spt.p2Dpt->x; - tempR.y = Ppt.p2Dpt->y; - tempQ.x = Ppt.p2Dpt->x; - tempQ.y = Spt.p2Dpt->y; - - Rpt.p2Dpt = &tempR; - Qpt.p2Dpt = &tempQ; - } - - /* Calculate DQ and DR */ - dQpt.x = Qpt.p2Dpt->x - Ppt.p2Dpt->x; - dQpt.y = Qpt.p2Dpt->y - Ppt.p2Dpt->y; - dRpt.x = Rpt.p2Dpt->x - Ppt.p2Dpt->x; - dRpt.y = Rpt.p2Dpt->y - Ppt.p2Dpt->y; - - /* Calculate step sizes for grid lines */ - x_step.x = (dRpt.x / ddCell->dx); - x_step.y = (dRpt.y / ddCell->dx); - y_step.x = (dQpt.x / ddCell->dy); - y_step.y = (dQpt.y / ddCell->dy); - - /* Add Z component if necessary */ - if DD_IsVert3D(input->type) { - dQpt.z = Rpt.p3Dpt->z - Ppt.p3Dpt->z; - dRpt.z = Qpt.p3Dpt->z - Ppt.p3Dpt->z; - x_step.z = (dRpt.z / ddCell->dx); - y_step.z = (dRpt.z / ddCell->dy); - } else { - x_step.z = 0.0; - y_step.z = 0.0; - } - - basept.x = Ppt.p2Dpt->x; - basept.y = Ppt.p2Dpt->y; - if DD_IsVert3D(input->type) basept.z = Ppt.p3Dpt->z; - else basept.z = 0.0; - - pddolist = output->ddList; - /* "x" lines */ - for(i = 0, out_pt.ptr = pddolist->pts.ptr; - i <= ddCell->dy; i++){ - - out_pt.ptr = pddolist->pts.ptr; - endpt.x = basept.x + dRpt.x; - endpt.y = basept.y + dRpt.y; - endpt.z = basept.z + dRpt.z; - - memcpy( out_pt.ptr, (char *)&basept, point_size); - out_pt.ptr += point_size; - memcpy( out_pt.ptr, (char *)&endpt, point_size); - out_pt.ptr += point_size; - - basept.x += y_step.x; - basept.y += y_step.y; - basept.z += y_step.z; - - pddolist->numPoints = 2; - pddolist++; - } - - basept.x = Ppt.p2Dpt->x; - basept.y = Ppt.p2Dpt->y; - if DD_IsVert3D(input->type) basept.z = Ppt.p3Dpt->z; - else basept.z = 0.0; - - /* "y" lines */ - for(i = 0; i <= ddCell->dx; i++){ - - out_pt.ptr = pddolist->pts.ptr; - endpt.x = basept.x + dQpt.x; - endpt.y = basept.y + dQpt.y; - endpt.z = basept.z + dQpt.z; - - memcpy( out_pt.ptr, (char *)&basept, point_size); - out_pt.ptr += point_size; - memcpy( out_pt.ptr, (char *)&endpt, point_size); - out_pt.ptr += point_size; - - basept.x += x_step.x; - basept.y += x_step.y; - basept.z += x_step.z; - - pddolist->numPoints = 2; - pddolist++; - } - output->numLists = nGridLines; - - /* Call Polyline routine with output array */ - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - /* clean up memory allocation */ - - for(i = 0, pddolist = output->ddList; i < nGridLines; i++){ - xfree((char *)pddolist->pts.ptr); - pddolist++; - } - xfree((char *)output->ddList); - xfree((char *)pGStr); - - return(status); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c:3.7 Fri Dec 14 14:57:20 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c Sat Feb 28 21:41:54 2004 @@ -1,250 +0,0 @@ -/* $Xorg: miClip.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miClip.c,v 3.7 2001/12/14 19:57:20 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miClip.h" -#include "gcstruct.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miClipPointList - | - | Function Description: - | Clips each point is a listofddPoint. Clipping here means - | that the point is either copied or not copied to the - | output list. - | - | Note(s): - | - --*/ - -ddpex3rtn -miClipPointList(pddc, vinput, voutput, clip_mode) -/* in */ - miDDContext *pddc; - miListHeader *vinput; - miListHeader **voutput; - ddUSHORT clip_mode; -{ - -/* uses */ - char *in_pt; - char *out_pt; - miListHeader *output; - listofddPoint *pddilist; - listofddPoint *pddolist; - int num_lists; - int vert_count; - int num_points; - int point_size, clip_code; - int j,k, num_passes; - float t; - ddUSHORT oc, clipflags; - ddHalfSpace *MC_HSpace; - - /* Vertex data must be homogeneous for clipper */ - if (!(DD_IsVert4D(vinput->type))) return(1); - - /* Reformat clipflags to internal format */ - if (pddc->Dynamic->clipFlags & PEXClipXY) - clipflags=(MI_CLIP_LEFT | MI_CLIP_RIGHT | MI_CLIP_TOP | MI_CLIP_BOTTOM); - else clipflags = 0; - if (pddc->Dynamic->clipFlags & PEXClipFront) clipflags |= MI_CLIP_FRONT; - if (pddc->Dynamic->clipFlags & PEXClipBack) clipflags |= MI_CLIP_BACK; - - /* Use the pre-defined clip list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Allocate an initial number of headers */ - MI_ALLOCLISTHEADER(output, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)) - if (!output->ddList) return(BadAlloc); - - output->type = vinput->type; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - DD_VertPointSize(vinput->type, point_size); - - num_lists = 0; - - /* Now, clip each list */ - for (j = 0; j < vinput->numLists; j++) { - - /* Skip list if no points */ - if ((vert_count = pddilist->numPoints) <= 0) { - pddilist++; - continue; - } - - /* Insure sufficient room for each vertex */ - MI_ALLOCLISTOFDDPOINT(pddolist, vert_count, point_size); - if (!(out_pt = pddolist->pts.ptr)) return(BadAlloc); - - in_pt = pddilist->pts.ptr; - - num_points = 0; - - - /* For each vertex, clip a polyline segment */ - while (vert_count--) { - - /* this is really only used for annotation text, so going */ - /* through all the half-spaces for each point is not */ - /* a big deal */ - - CLIP_POINT4D(in_pt, oc, clip_mode); - - if (!(oc)) { - /* Copy the next point into the clip array */ - memcpy( out_pt, in_pt, point_size); - num_points++; - out_pt += point_size; - } - - /* skip to next point */ - in_pt += point_size; - } - - /* skip to next list */ - pddilist++; - - /* Don't increment list count unless points were added to last list */ - if (num_points > 0) { - pddolist->numPoints = num_points; - num_lists++; - pddolist++; - } - } - - - output->numLists = num_lists; - - return (Success); - -} - - - -/*++ - | - | ComputeMCVolume(pRend, pddc) - | - | Compute a modelling coordinate version of the model clipping - | volume; - | - --*/ -ddpex3rtn -ComputeMCVolume(pRend, pddc) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; -{ - extern void miMatCopy(); - extern void miMatMatInverse(); - - ddHalfSpace *wcHS, /* world coord half spaces */ - mcHS; /* model coord half spaces */ - - int i, count; - float pxform[4][4]; /* point transform */ - float vxform[4][4]; /* vector transform */ - float length; - - - /* check to see if already computed */ - if (pddc->Static.misc.flags & MCVOLUMEFLAG) { - - /* Verify inverse transform */ - VALIDATEINVTRMCTOWCXFRM(pddc); - - /* Don't want transpose of inverse for point xform! */ - miMatCopy(pddc->Static.misc.inv_tr_mc_to_wc_xform, - pxform); - miMatTranspose(pxform); - - /* Want transpose of forward point xform for inverse vector xform */ - miMatCopy(pddc->Dynamic->mc_to_wc_xform, vxform); - miMatTranspose(vxform); - - count = pddc->Dynamic->pPCAttr->modelClipVolume->numObj; - wcHS = (ddHalfSpace *)(pddc->Dynamic->pPCAttr->modelClipVolume->pList); - - pddc->Static.misc.ms_MCV->numObj = 0; - - for(i = 0; i < count; i++) { - - miTransformPoint(&wcHS->point, pxform, - &mcHS.point); - - miTransformVector(&wcHS->vector, vxform, &mcHS.vector); - - NORMALIZE_VECTOR(&mcHS.vector, length); - - DOT_PRODUCT(&mcHS.vector, &mcHS.point, mcHS.dist); - - puAddToList(&mcHS, 1, pddc->Static.misc.ms_MCV); - - ++wcHS; - - } - - /* Clear ddc status flag */ - pddc->Static.misc.flags &= ~MCVOLUMEFLAG; - } - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c:1.9 Fri Dec 14 14:57:20 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c Sat Feb 28 21:41:54 2004 @@ -1,958 +0,0 @@ -/* $Xorg: miConvert.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miConvert.c,v 1.9 2001/12/14 19:57:20 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "pexos.h" - - -typedef void (*ColorConversionTableType)(); -static void PEXIndexedColour_to_PEXRdrColourModelRGB(); -static void PEXRgb8Colour_to_PEXRdrColourModelRGB(); -static void PEXRgb16Colour_to_PEXRdrColourModelRGB(); -static void NoChange(); - -/* - * Color conversion jump table for miConvertVertexColors, - * miConvertFacetColors and miConvertColor. - * - * Note that only conversions supported are - * - * indexed ->rgbFloat - * Rgb8 ->rgbFloat - * Rgb16 ->rgbFloat - * - */ - -static -ColorConversionTableType -ColourConversionRoutine[(PEXRdrColourModelHLS+1)*(PEXMaxColour+1)] = { -/* Convert to Implementation dependant Color Model */ - PEXIndexedColour_to_PEXRdrColourModelRGB, /* Indexed -> ImpDep */ - NoChange, /* RgbFloat -> ImpDep */ - NULL, /* Cie -> ImpDep */ - NULL, /* Hsv -> ImpDep */ - NULL, /* Hls -> ImpDep */ - PEXRgb8Colour_to_PEXRdrColourModelRGB, /* Rgb8 -> ImpDep */ - PEXRgb16Colour_to_PEXRdrColourModelRGB, /* Rgb16 -> ImpDep */ -/* Convert to Rgb Float */ - PEXIndexedColour_to_PEXRdrColourModelRGB, /* Indexed -> RgbFloat */ - NoChange, /* RgbFloat -> RgbFloat */ - NULL, /* Cie -> RgbFloat */ - NULL, /* Hsv -> RgbFloat */ - NULL, /* Hls -> RgbFloat */ - PEXRgb8Colour_to_PEXRdrColourModelRGB, /* Rgb8 -> RgbFloat */ - PEXRgb16Colour_to_PEXRdrColourModelRGB, /* Rgb16 -> RgbFloat */ -/* Convert to Cie Float */ - NULL, /* Indexed -> CieFloat */ - NULL, /* RgbFloat -> CieFloat */ - NULL, /* Cie -> CieFloat */ - NULL, /* Hsv -> CieFloat */ - NULL, /* Hls -> CieFloat */ - NULL, /* Rgb8 -> CieFloat */ - NULL, /* Rgb16 -> CieFloat */ -/* Convert to Hsv Float */ - NULL, /* Indexed -> HsvFloat */ - NULL, /* RgbFloat -> HsvFloat */ - NULL, /* Cie -> HsvFloat */ - NULL, /* Hsv -> HsvFloat */ - NULL, /* Hls -> HsvFloat */ - NULL, /* Rgb8 -> HsvFloat */ - NULL, /* Rgb16 -> HsvFloat */ -/* Convert to Hls Float */ - NULL, /* Indexed -> HlsFloat */ - NULL, /* RgbFloat -> HlsFloat */ - NULL, /* Cie -> HlsFloat */ - NULL, /* Hsv -> HlsFloat */ - NULL, /* Hls -> HlsFloat */ - NULL, /* Rgb8 -> HlsFloat */ - NULL, /* Rgb16 -> HlsFloat */ -}; - -/*++ - | - | Function Name: PEXIndexedColour_to_PEXRdrColourModelRGB - | - | Function Description: - | Convert vertex colors to the specified rendering color model - | - | Note(s): - | - --*/ - -static -void -PEXIndexedColour_to_PEXRdrColourModelRGB(pRend, in_col, out_col) -ddRendererPtr pRend; /* renderer handle */ -ddIndexedColour **in_col; -ddRgbFloatColour **out_col; -{ - miColourEntry *pintcolour; - ddUSHORT status; - - InquireLUTEntryAddress (PEXColourLUT, pRend->lut[PEXColourLUT], - ((*in_col)++)->index, - &status, - (ddPointer *)&pintcolour); - - /* Insure that LUT entry is in correct color model */ - if (pintcolour->entry.colourType != PEXRgbFloatColour) - ColourConversionRoutine[pintcolour->entry.colourType*PEXRdrColourModelRGB] - (pRend, &pintcolour->entry.colour.rgbFloat, out_col); - else *((*out_col)++) = pintcolour->entry.colour.rgbFloat; - -} - -/*++ - | - | Function Name: PEXRgb8Colour_to_PEXRdrColourModelRGB - | - | Function Description: - | Convert vertex colors to the specified rendering color model - | - | Note(s): - | - --*/ - -static -void -PEXRgb8Colour_to_PEXRdrColourModelRGB(pRend, in_col, out_col) -ddRendererPtr pRend; /* renderer handle */ -ddRgb8Colour **in_col; -ddRgbFloatColour **out_col; -{ - (*out_col)->red = (*in_col)->red; - (*out_col)->green = (*in_col)->green; - ((*out_col)++)->blue = ((*in_col)++)->blue; -} - -/*++ - | - | Function Name: PEXRgb16Colour_to_PEXRdrColourModelRGB - | - | Function Description: - | Convert vertex colors to the specified rendering color model - | - | Note(s): - | - --*/ - -static -void -PEXRgb16Colour_to_PEXRdrColourModelRGB(pRend, in_col, out_col) -ddRendererPtr pRend; /* renderer handle */ -ddRgb16Colour **in_col; -ddRgbFloatColour **out_col; -{ - (*out_col)->red = (*in_col)->red; - (*out_col)->green = (*in_col)->green; - ((*out_col)++)->blue = ((*in_col)++)->blue; -} - -/*++ - | - | Function Name: NoChange - | - | Function Description: - | Dummy label to indicate no color change needed. - | - | Note(s): - | - --*/ - -static -void -NoChange(pRend, in_col, out_col) -ddRendererPtr pRend; /* renderer handle */ -ddRgb16Colour **in_col; -ddRgbFloatColour **out_col; -{ -} - -/*++ - | - | Function Name: miConvertColor - | - | Function Description: - | Converts a ddColourSpecifier to the specified rendering color model. - | - | Note(s): - | - --*/ - -ddpex3rtn -miConvertColor(pRend, cinput, rdrColourModel, coutput) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -ddColourSpecifier *cinput; /* input color */ -ddSHORT rdrColourModel; /* output color model */ -/* out */ -ddColourSpecifier *coutput; /* output color */ -{ -/* uses */ - ColorConversionTableType convert; - ddSHORT input_color; - char *icolptr; - char *ocolptr; - - /* find proper conversion routine */ - convert = ColourConversionRoutine[cinput->colourType*rdrColourModel]; - - /* convert is 1 if input and output color model are the same */ - if (convert == NoChange) { - /* no conversion necessary */ - *coutput = *cinput; - return Success; - } - - /* convert is NULL if output color model not supported */ - if (convert == NULL) { - return 1; - } - - /* set output color type */ - switch(rdrColourModel) { - case PEXRdrColourModelImpDep: - coutput->colourType = PEXRgbFloatColour; - break; - case PEXRdrColourModelRGB: - coutput->colourType = PEXRgbFloatColour; - break; - case PEXRdrColourModelHSV: - coutput->colourType = PEXHsvFloatColour; - break; - case PEXRdrColourModelHLS: - coutput->colourType = PEXHlsFloatColour; - break; - case PEXRdrColourModelCIE: - coutput->colourType = PEXCieFloatColour; - break; - } - - /* convert color data */ - icolptr = (char *)&(cinput->colour.indexed); - ocolptr = (char *)&(coutput->colour.indexed); - (*convert)(pRend, &icolptr, &ocolptr); - - return (Success); -} - -/*++ - | - | Function Name: miConvertVertexColors - | - | Function Description: - | Convert vertex colors to the specified rendering color model - | - | Note(s): - | - --*/ - -ddpex3rtn -miConvertVertexColors(pRend, vinput, rdrColourModel, voutput) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -miListHeader *vinput; /* input vertex list */ -ddSHORT rdrColourModel; /* output color model */ -/* out */ -miListHeader **voutput; /* output vertex list */ -{ -/* uses */ - ddPointUnion in_pt, out_pt; - miListHeader *output; - listofddPoint *pddilist; - listofddPoint *pddolist; - miDDContext *pddc = (miDDContext *)pRend->pDDContext; - int list_count = 0; - int vert_count; - int point_size, out_point_size; - int coord_size; - ddPointType type; - int i, j; - ColorConversionTableType convert; - ddSHORT input_color; - - /* if no vertex colors, done! */ - if (!DD_IsVertColour(vinput->type)) { - *voutput = vinput; - return Success; - } - - /* extract vertex color type */ - if (DD_IsVertIndexed(vinput->type)) input_color = PEXIndexedColour; - else if (DD_IsVertRGBFLOAT(vinput->type)) input_color = PEXRgbFloatColour; - else if (DD_IsVertRGB8(vinput->type)) input_color = PEXRgb8Colour; - else if (DD_IsVertRGB16(vinput->type)) input_color = PEXRgb16Colour; - else if (DD_IsVertHSV(vinput->type)) input_color = PEXHsvFloatColour; - else if (DD_IsVertHLS(vinput->type)) input_color = PEXHlsFloatColour; - else if (DD_IsVertCIE(vinput->type)) input_color = PEXCieFloatColour; - - /* find proper conversion routine */ - convert = ColourConversionRoutine[input_color*rdrColourModel]; - - /* convert is 1 if input and output color model are the same */ - if (convert == NoChange) { - /* no conversion necessary */ - *voutput = vinput; - return Success; - } - - /* convert is NULL if output color model not supported */ - if (convert == NULL) { - return 1; - } - - /* Initialize output list */ - output = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(output, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)) - if (!output->ddList) return(BadAlloc); - - type = vinput->type; - DD_VertPointSize( (type & (DDPT_SHORT | DDPT_4D)), coord_size ); - - /* set output color type */ - switch(rdrColourModel) { - case PEXRdrColourModelImpDep: - case PEXRdrColourModelRGB: - DD_SetVertRGBFLOAT(type); - break; - case PEXRdrColourModelHSV: - DD_SetVertHSV(type); - break; - case PEXRdrColourModelHLS: - DD_SetVertHLS(type); - break; - case PEXRdrColourModelCIE: - DD_SetVertCIE(type); - break; - } - output->type = type; - DD_VertPointSize( type, out_point_size ); - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* - * Traverse each list. - */ - for (i = 0; i < vinput->numLists; i++) { - - if ((vert_count = pddolist->numPoints = pddilist->numPoints) <= 1) { - pddilist++; - continue; - } - - /* Insure sufficient room for each vertex */ - MI_ALLOCLISTOFDDPOINT(pddolist, vert_count+1, out_point_size); - if (!pddolist->pts.p2DSpt) return(BadAlloc); - - /* - * Copy each point and initialize the edges. - * Note that the edge flag is always the last - * ddULONG of a vertex. Thus incrementing the - * destination pointer by the size of the input - * point "automatically" places the pointer - * at the start of the edge flag field. - */ - in_pt = pddilist->pts; - out_pt = pddolist->pts; - - for (j = 0; j < vert_count; j++) { - - /* Copy the coordinate data to the output list */ - memcpy( out_pt.ptr, in_pt.ptr, coord_size); - in_pt.ptr += coord_size; - out_pt.ptr += coord_size; - - /* convert the color */ - (*convert)(pRend, &(in_pt.ptr), &(out_pt.ptr)); - - /* Copy the normal data to the output list */ - if (DD_IsVertNormal(vinput->type)) - *(out_pt.pNormal++) = *(in_pt.pNormal++); - - /* Copy the edge flag data to the output list */ - if (DD_IsVertEdge(vinput->type)) - *(out_pt.pEdge++) = *(in_pt.pEdge++); - } - - /* Now, skip to next input list */ - pddilist++; - pddolist++; - list_count++; - } - - output->numLists = list_count; - *voutput = output; - return (Success); -} - -/*++ - | - | Function Name: miConvertFacetColors - | - | Function Description: - | Convert vertex colors to the specified rendering color model - | - | Note(s): - | Currently, this will ONLY convert from indexed -> RGBFLOAT - | - --*/ - -ddpex3rtn -miConvertFacetColors(pRend, finput, rdrColourModel, foutput) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -listofddFacet *finput; /* input facet list */ -ddSHORT rdrColourModel; /* output color model */ -/* out */ -listofddFacet **foutput; /* output facet list */ -{ - listofddFacet *fct_list; - ddFacetUnion in_fct; - ddFacetUnion out_fct; - miDDContext *pddc = (miDDContext *)pRend->pDDContext; - int j; - int facet_size; - ColorConversionTableType convert; - ddSHORT input_color; - - /* if no vertex colors, done! */ - if ((!DD_IsFacetColour(finput->type)) || (finput->type == DD_FACET_NONE)) { - *foutput = finput; - return Success; - } - - /* extract facet color type */ - switch(finput->type) { - case DD_FACET_INDEX: - case DD_FACET_INDEX_NORM: - input_color = PEXIndexedColour; - break; - case DD_FACET_RGB8: - case DD_FACET_RGB8_NORM: - input_color = PEXRgb8Colour; - break; - case DD_FACET_RGB16: - case DD_FACET_RGB16_NORM: - input_color = PEXRgb16Colour; - break; - case DD_FACET_RGBFLOAT: - case DD_FACET_RGBFLOAT_NORM: - input_color = PEXRgbFloatColour; - break; - case DD_FACET_HSV: - case DD_FACET_HSV_NORM: - input_color = PEXHsvFloatColour; - break; - case DD_FACET_HLS: - case DD_FACET_HLS_NORM: - input_color = PEXHlsFloatColour; - break; - case DD_FACET_CIE: - case DD_FACET_CIE_NORM: - input_color = PEXCieFloatColour; - break; - } - - /* find proper conversion routine */ - convert = ColourConversionRoutine[input_color*rdrColourModel]; - - /* convert is 1 if input and output color model are the same */ - if (convert == NoChange) { - /* no conversion necessary */ - *foutput = finput; - return Success; - } - - /* convert is NULL if output color model not supported */ - if (convert == NULL) { - return 1; - } - - /* Get next free facet list header */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - - /* set output color type */ - switch(rdrColourModel) { - case PEXRdrColourModelImpDep: - case PEXRdrColourModelRGB: - if (DD_IsFacetNormal(finput->type)) - fct_list->type = DD_FACET_RGBFLOAT_NORM; - else fct_list->type = DD_FACET_RGBFLOAT; - break; - case PEXRdrColourModelHSV: - if (DD_IsFacetNormal(finput->type)) - fct_list->type = DD_FACET_HSV_NORM; - else fct_list->type = DD_FACET_HSV; - break; - case PEXRdrColourModelHLS: - if (DD_IsFacetNormal(finput->type)) - fct_list->type = DD_FACET_HLS_NORM; - else fct_list->type = DD_FACET_HLS; - break; - case PEXRdrColourModelCIE: - if (DD_IsFacetNormal(finput->type)) - fct_list->type = DD_FACET_CIE_NORM; - else fct_list->type = DD_FACET_CIE; - break; - } - - /* - * Allocate storage for the facet list - */ - DDFacetSIZE(fct_list->type, facet_size); - MI_ALLOCLISTOFDDFACET(fct_list, finput->numFacets, facet_size); - if (!(out_fct.pNoFacet = fct_list->facets.pNoFacet)) return(BadAlloc); - - in_fct = finput->facets; - - /* Remember, facet data is of the form: - * - * |--------------|--------------------------| - * color (opt) normal (opt) - */ - - for (j = 0; j < finput->numFacets; j++) { - - /* convert the color */ - (*convert)(pRend, &(in_fct.pNoFacet), &(out_fct.pNoFacet)); - - /* Copy the input normal */ - if (DD_IsFacetNormal(finput->type)) - *(out_fct.pFacetN++) = *(in_fct.pFacetN++); - - } - - fct_list->numFacets = finput->numFacets; - *foutput = fct_list; - - return(Success); - -} - -/*++ - | - | Function Name: miColourtoIndex - | - | Function Description: - | Convert a direct color to an index using the - | color approximation table. - | - | Note(s): - | Dithering is ignored as there is no screen data with which to dither. - | - --*/ - -ddpex3rtn -miColourtoIndex(pRend, colourApproxIndex, directcolour, colourindex) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -ddTableIndex colourApproxIndex; /* colour approx table index */ -ddColourSpecifier *directcolour; /* Direct colour input */ -/* out */ -ddULONG *colourindex; /* output colour index */ -{ - miColourApproxEntry *pLUT; - ddColourApproxEntry *pentry; - ddUSHORT status; - - /* Fetch current color approximation table entry */ - if ((InquireLUTEntryAddress (PEXColourApproxLUT, - pRend->lut[PEXColourApproxLUT], - colourApproxIndex, - &status, (ddPointer *)&pLUT)) - == PEXLookupTableError) - return (PEXLookupTableError); - - pentry = &pLUT->entry; - - /****************************************** - * Need color mode conversion code here!!! - * for now, do nothing.... - *****************************************/ - if (directcolour->colourType != pentry->approxModel) {} - - /* now perform direct -> index conversion. */ - if (pentry->approxType == PEXColourSpace) { - switch (pentry->approxModel) { - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - { - *colourindex = - ((ddULONG)(directcolour->colour.rgbFloat.red*pentry->max1)) - * pentry->mult1; - - *colourindex += - ((ddULONG)(directcolour->colour.rgbFloat.green*pentry->max2)) - * pentry->mult2; - - *colourindex += - ((ddULONG)(directcolour->colour.rgbFloat.blue*pentry->max3)) - * pentry->mult3; - - *colourindex += pentry->basePixel; - break; - } - - case PEXRgb8Colour: - *colourindex = - ((ddULONG)(directcolour->colour.rgb8.red*pentry->max1)) - * pentry->mult1; - - *colourindex += - ((ddULONG)(directcolour->colour.rgb8.green*pentry->max2)) - * pentry->mult2; - - *colourindex += - ((ddULONG)(directcolour->colour.rgb8.blue*pentry->max3)) - * pentry->mult3; - - *colourindex += pentry->basePixel; - break; - - case PEXRgb16Colour: - *colourindex = - ((ddULONG)(directcolour->colour.rgb16.red*pentry->max1)) - * pentry->mult1; - - *colourindex += - ((ddULONG)(directcolour->colour.rgb16.green*pentry->max2)) - * pentry->mult2; - - *colourindex += - ((ddULONG)(directcolour->colour.rgb16.blue*pentry->max3)) - * pentry->mult3; - - *colourindex += pentry->basePixel; - break; - } - } else /* if (pentry->approxType == PEXColourRange) */ { - ddFLOAT floatindex; - ddFLOAT nw1, nw2, nw3; - - /* use floatindex as temp var */ - floatindex = pentry->weight1 + pentry->weight2 + pentry->weight3; - nw1 = pentry->weight1 / floatindex; - nw2 = pentry->weight2 / floatindex; - nw3 = pentry->weight3 / floatindex; - - switch (pentry->approxModel) { - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - { - floatindex = directcolour->colour.rgbFloat.red * nw1; - floatindex += directcolour->colour.rgbFloat.green * nw2; - floatindex += directcolour->colour.rgbFloat.blue * nw3; - - floatindex *= pentry->max1; - *colourindex = (ddULONG)(floatindex * pentry->mult1) + - (ddULONG)(floatindex * pentry->mult2) + - (ddULONG)(floatindex * pentry->mult3) + - pentry->basePixel; - break; - } - - case PEXRgb8Colour: - floatindex = directcolour->colour.rgb8.red * nw1; - floatindex += directcolour->colour.rgb8.green * nw2; - floatindex += directcolour->colour.rgb8.blue * nw3; - - floatindex *= pentry->max1; - *colourindex = (ddULONG)(floatindex * pentry->mult1) + - (ddULONG)(floatindex * pentry->mult2) + - (ddULONG)(floatindex * pentry->mult3) + - pentry->basePixel; - break; - - case PEXRgb16Colour: - floatindex = directcolour->colour.rgb16.red * nw1; - floatindex += directcolour->colour.rgb16.green * nw2; - floatindex += directcolour->colour.rgb16.blue * nw3; - - floatindex *= pentry->max1; - *colourindex = (ddULONG)(floatindex * pentry->mult1) + - (ddULONG)(floatindex * pentry->mult2) + - (ddULONG)(floatindex * pentry->mult3) + - pentry->basePixel; - break; - } - } - - return (Success); -} - -/*++ - | - | Function Name: miAddEdgeFlag - | - | Function Description: - | Add edge visibility flags to a list of vertices. - | Performs not operation if there already are edge - | flags in the data. Note all edges are set to "visible". - | - | Note(s): - | - --*/ - -ddpex3rtn -miAddEdgeFlag(pddc, vinput, voutput) -/* in */ - miDDContext *pddc; - miListHeader *vinput; - miListHeader **voutput; -{ -/* uses */ - char *in_pt, *out_pt; - ddULONG *edge_ptr; - miListHeader *output; - listofddPoint *pddilist; - listofddPoint *pddolist; - int list_count = 0; - int vert_count; - int point_size, out_point_size; - int i, j; - - /* If already have vertices, then simply return */ - if (DD_IsVertEdge(vinput->type)) { - *voutput = vinput; - return(Success); - } - - /* Initialize output list */ - output = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(output, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)) - if (!output->ddList) return(BadAlloc); - - DD_VertPointSize(vinput->type, point_size); - output->type = vinput->type; - DD_SetVertEdge(output->type); - DD_VertPointSize(output->type, out_point_size); - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* - * Traverse each list. - */ - for (i = 0; i < vinput->numLists; i++) { - - if ((vert_count = pddolist->numPoints = pddilist->numPoints) <= 1) { - pddilist++; - continue; - } - - /* Insure sufficient room for each vertex */ - MI_ALLOCLISTOFDDPOINT(pddolist, vert_count+1, out_point_size); - if (!pddolist->pts.p2DSpt) return(BadAlloc); - - /* - * Copy each point and initialize the edges. - * Note that the edge flag is always the last - * ddULONG of a vertex. Thus incrementing the - * destination pointer by the size of the input - * point "automatically" places the pointer - * at the start of the edge flag field. - */ - in_pt = pddilist->pts.ptr; - out_pt = pddolist->pts.ptr; - - for (j = 0; j < vert_count; j++) { - memcpy( out_pt, in_pt, point_size); - in_pt += point_size; - out_pt += point_size; - edge_ptr = (ddULONG *)out_pt; - *(edge_ptr++) = ~0; - out_pt = (char *)edge_ptr; - } - - /* Now, skip to next input list */ - pddilist++; - pddolist++; - list_count++; - } - - output->numLists = list_count; - *voutput = output; - return (Success); -} - - -/*++ - | - | Function Name: miRemoveInvisibleEdges - | - | Function Description: - | Checks the edge flags of each edge in the input - | vertex list and removes the "invisible" ones. - | - | Note(s): - | - --*/ - -ddpex3rtn -miRemoveInvisibleEdges(pddc, vinput, voutput) -/* in */ - miDDContext *pddc; - miListHeader *vinput; - miListHeader **voutput; -{ -/* uses */ - char *in_pt, *out_pt; - ddULONG *edge_ptr; - miListHeader *output; - listofddPoint *pddilist; - listofddPoint *pddolist; - int list_count = 0; - int vert_count, counter; - int point_size; - int edge_offset; - int i, j; - - /* If already have vertices, then simply return */ - if (!(DD_IsVertEdge(vinput->type))) { - *voutput = vinput; - return(Success); - } - - /* Initialize output list */ - output = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(output, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)) - if (!output->ddList) return(BadAlloc); - - output->type = vinput->type; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - DD_VertPointSize(vinput->type, point_size); - DD_VertOffsetEdge(vinput->type, edge_offset); - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* - * Traverse each list. - */ - for (i = 0; i < vinput->numLists; i++) { - - if ((vert_count = pddilist->numPoints) <= 1) { - pddilist++; - continue; - } - - /* Insure sufficient room for each vertex */ - MI_ALLOCLISTOFDDPOINT(pddolist, vert_count, point_size); - if (!pddolist->pts.p2DSpt) return(BadAlloc); - - /* - * Copy each point and initialize the edges. - * Note that the edge flag is always the last - * ddULONG of a vertex. Thus incrementing the - * destination pointer by the size of the input - * point "automatically" places the pointer - * at the start of the edge flag field. - */ - in_pt = pddilist->pts.ptr; - out_pt = pddolist->pts.ptr; - - for (j = 0, counter = 0; j < vert_count; j++) { - edge_ptr = (ddULONG *)(in_pt + edge_offset); - if (*edge_ptr) { - memcpy( out_pt, in_pt, point_size); - out_pt += point_size; - counter++; - } else if (counter) { - /* if edge is invisible, start new list */ - - /* First, end last edge of previous edge */ - memcpy( out_pt, in_pt, point_size); - pddolist->numPoints = counter + 1; - counter = 0; - - /* Insure enough room for new list header */ - list_count++; - MI_ALLOCLISTHEADER(output, - MI_ROUND_LISTHEADERCOUNT(list_count)); - if (!output->ddList) return(BadAlloc); - pddolist = &output->ddList[list_count]; - - /* Next, insure enough room for vertices in new list */ - MI_ALLOCLISTOFDDPOINT(pddolist, vert_count - j, point_size); - if (!(out_pt = pddolist->pts.ptr)) return(BadAlloc); - } - - in_pt += point_size; - } - - /* Now, skip to next input list */ - pddilist++; - if (counter > 1) { - pddolist->numPoints = counter; - list_count++; - MI_ALLOCLISTHEADER(output, MI_ROUND_LISTHEADERCOUNT(list_count)); - if (!output->ddList) return(BadAlloc); - pddolist = &output->ddList[list_count]; - } - } - - output->numLists = list_count; - *voutput = output; - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c:3.8 Fri Dec 14 14:57:21 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c Sat Feb 28 21:41:54 2004 @@ -1,1101 +0,0 @@ -/* $Xorg: miCopy.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miCopy.c,v 3.8 2001/12/14 19:57:21 dawes Exp $ */ - - -#include "ddpex.h" -#include "ddpex3.h" -#include "PEX.h" -#include "PEXproto.h" -#include "pexExtract.h" -#include "ddpex2.h" -#include "miStruct.h" -#include "pexUtils.h" -#include "pexos.h" - - -/* - bcopy data, fix up pointers - */ -/* - Please note that any routines added to this file may also cause - a corresponding modification to the level function tables (miTables.c) - */ - -/* - Coders must ensure that storage is allocated in the same chunks as for the - corresponding parse function, otherwise unfortunate things may - happen during freeing of storage. - */ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define CAT(a,b) a##b -#else -#define CAT(a,b) a/**/b -#endif - -#define OC_COPY_FUNC_HEADER(suffix) \ - ddpex2rtn CAT(copy,suffix)(pSrc, ppDst) \ - miGenericElementStr *pSrc; \ - miGenericElementStr **ppDst; - -#define DST_STORE_AND_COPY(DD_ST, TYPE, SIZE) \ - *ppDst = (miGenericElementPtr) \ - xalloc((unsigned long)((SIZE) + sizeof(miGenericElementStr))); \ - if (!(*ppDst)) return (BadAlloc); \ - memmove( (char *)(*ppDst), (char *)pSrc, \ - (int)((SIZE) + sizeof(miGenericElementStr))); \ - DD_ST = (TYPE *)((*ppDst)+1); - -#define COPY_DECL(NAME,TYPE) \ - TYPE * CAT(dst,NAME) = 0, * CAT(src,NAME) = (TYPE *)(pSrc + 1); - -#define COPY_MORE(DST, TYPE, NUMBER, SRC) \ - if ((NUMBER) > 0) { \ - DST = (TYPE *)xalloc((unsigned long)((NUMBER) * sizeof(TYPE))); \ - if (!(DST)) err = BadAlloc; \ - else memmove((char *)(DST),(char *)(SRC),(int)((NUMBER)*sizeof(TYPE))); } \ - else DST = 0; - -/* - Returns number of bytes used to store the data - Differs from similar routine in pexOCParse.c because that one counts - from the protocol format; this one counts dd native format instead - */ -static int -CountddFacetOptData(pFacet) -listofddFacet *pFacet; -{ - switch(pFacet->type){ - case DD_FACET_INDEX_NORM: - return (sizeof(ddIndexNormal) * pFacet->numFacets); - - case DD_FACET_RGBFLOAT_NORM: - return (sizeof(ddRgbFloatNormal) * pFacet->numFacets); - - case DD_FACET_CIE_NORM: - return (sizeof(ddCieNormal) * pFacet->numFacets); - - case DD_FACET_HSV_NORM: - return (sizeof(ddHsvNormal) * pFacet->numFacets); - - case DD_FACET_HLS_NORM: - return (sizeof(ddHlsNormal) * pFacet->numFacets); - - case DD_FACET_RGB8_NORM: - return (sizeof(ddRgb8Normal) * pFacet->numFacets); - - case DD_FACET_RGB16_NORM: - return (sizeof(ddRgb16Normal) * pFacet->numFacets); - - case DD_FACET_NORM: - return (sizeof(ddVector3D) * pFacet->numFacets); - - case DD_FACET_INDEX: - return (sizeof(ddIndexedColour) * pFacet->numFacets); - - case DD_FACET_RGBFLOAT: - return (sizeof(ddRgbFloatColour) * pFacet->numFacets); - - case DD_FACET_CIE: - return (sizeof(ddCieColour) * pFacet->numFacets); - - case DD_FACET_HSV: - return (sizeof(ddHsvColour) * pFacet->numFacets); - - case DD_FACET_HLS: - return (sizeof(ddHlsColour) * pFacet->numFacets); - - case DD_FACET_RGB8: - return (sizeof(ddRgb8Colour) * pFacet->numFacets); - - case DD_FACET_NONE: - default: - return (0); - } -} - -static int -CountddVertexData(pPoint, point_type) -listofddPoint *pPoint; -ddPointType point_type; -{ - switch (point_type) { - case DD_INDEX_NORM_EDGE_POINT: - return (sizeof(ddIndexNormEdgePoint) * pPoint->numPoints); - - case DD_RGBFLOAT_NORM_EDGE_POINT: - return (sizeof(ddRgbFloatNormEdgePoint) * pPoint->numPoints); - - case DD_CIE_NORM_EDGE_POINT: - return (sizeof(ddCieNormEdgePoint) * pPoint->numPoints); - - case DD_HSV_NORM_EDGE_POINT: - return (sizeof(ddHsvNormEdgePoint) * pPoint->numPoints); - - case DD_HLS_NORM_EDGE_POINT: - return (sizeof(ddHlsNormEdgePoint) * pPoint->numPoints); - - case DD_RGB8_NORM_EDGE_POINT: - return (sizeof(ddRgb8NormEdgePoint) * pPoint->numPoints); - - case DD_RGB16_NORM_EDGE_POINT: - return (sizeof(ddRgb16NormEdgePoint) * pPoint->numPoints); - - case DD_NORM_EDGE_POINT: - return (sizeof(ddNormEdgePoint) * pPoint->numPoints); - - case DD_INDEX_NORM_POINT: - return (sizeof(ddIndexNormalPoint) * pPoint->numPoints); - - case DD_RGBFLOAT_NORM_POINT: - return (sizeof(ddRgbFloatNormalPoint) * pPoint->numPoints); - - case DD_CIE_NORM_POINT: - return (sizeof(ddCieNormalPoint) * pPoint->numPoints); - - case DD_HSV_NORM_POINT: - return (sizeof(ddHsvNormalPoint) * pPoint->numPoints); - - case DD_HLS_NORM_POINT: - return (sizeof(ddHlsNormalPoint) * pPoint->numPoints); - - case DD_RGB8_NORM_POINT: - return (sizeof(ddRgb8NormalPoint) * pPoint->numPoints); - - case DD_RGB16_NORM_POINT: - return (sizeof(ddRgb16NormalPoint) * pPoint->numPoints); - - case DD_NORM_POINT: - return (sizeof(ddNormalPoint) * pPoint->numPoints); - - case DD_INDEX_EDGE_POINT: - return (sizeof(ddIndexEdgePoint) * pPoint->numPoints); - - case DD_RGBFLOAT_EDGE_POINT: - return (sizeof(ddRgbFloatEdgePoint) * pPoint->numPoints); - - case DD_CIE_EDGE_POINT: - return (sizeof(ddCieEdgePoint) * pPoint->numPoints); - - case DD_HSV_EDGE_POINT: - return (sizeof(ddHsvEdgePoint) * pPoint->numPoints); - - case DD_HLS_EDGE_POINT: - return (sizeof(ddHlsEdgePoint) * pPoint->numPoints); - - case DD_RGB8_EDGE_POINT: - return (sizeof(ddRgb8EdgePoint) * pPoint->numPoints); - - case DD_RGB16_EDGE_POINT: - return (sizeof(ddRgb16EdgePoint) * pPoint->numPoints); - - case DD_INDEX_POINT: - return (sizeof(ddIndexPoint) * pPoint->numPoints); - - case DD_RGBFLOAT_POINT: - return (sizeof(ddRgbFloatPoint) * pPoint->numPoints); - - case DD_CIE_POINT: - return (sizeof(ddCiePoint) * pPoint->numPoints); - - case DD_HSV_POINT: - return (sizeof(ddHsvPoint) * pPoint->numPoints); - - case DD_HLS_POINT: - return (sizeof(ddHlsPoint) * pPoint->numPoints); - - case DD_RGB8_POINT: - return (sizeof(ddRgb8Point) * pPoint->numPoints); - - case DD_RGB16_POINT: - return (sizeof(ddRgb16Point) * pPoint->numPoints); - - case DD_EDGE_POINT: - return (sizeof(ddEdgePoint) * pPoint->numPoints); - - case DD_3D_POINT: - return (sizeof(ddCoord3D) * pPoint->numPoints); - - default: - return(0); - } -} - - -OC_COPY_FUNC_HEADER(ColourOC) -{ - COPY_DECL(Colour,miColourStruct); - - switch (srcColour->colourType) { - case PEXIndexedColour: { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddIndexedColour))); - dstColour->colour.pIndex = (ddIndexedColour *)(dstColour+1); - break; } - - case PEXRgbFloatColour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddRgbFloatColour))); - dstColour->colour.pRgbFloat = (ddRgbFloatColour *)(dstColour+1); - break; } - - case PEXCieFloatColour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddCieColour))); - dstColour->colour.pCie = (ddCieColour *)(dstColour+1); - break; } - - case PEXHsvFloatColour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddHsvColour))); - dstColour->colour.pHsv = (ddHsvColour *)(dstColour+1); - break; } - - case PEXHlsFloatColour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddHlsColour))); - dstColour->colour.pHls = (ddHlsColour *)(dstColour+1); - break; } - - case PEXRgb8Colour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddRgb8Colour))); - dstColour->colour.pRgb8 = (ddRgb8Colour *)(dstColour+1); - break; } - - case PEXRgb16Colour : { - DST_STORE_AND_COPY( dstColour, miColourStruct, - (sizeof(miColourStruct) - + sizeof(ddRgb16Colour))); - dstColour->colour.pRgb16 = (ddRgb16Colour *)(dstColour+1); - break; } - - } - - return(Success); -} - -OC_COPY_FUNC_HEADER(ColourIndexOC) -{ - COPY_DECL(Colour,miColourStruct); - - DST_STORE_AND_COPY( dstColour, miColourStruct, (sizeof(miColourStruct) - + sizeof(ddIndexedColour))); - dstColour->colour.pIndex = (ddIndexedColour *)(dstColour+1); - - return(Success); -} - -OC_COPY_FUNC_HEADER(LightState) -{ - COPY_DECL(LightState,miLightStateStruct); - - DST_STORE_AND_COPY( dstLightState, miLightStateStruct, - sizeof(miLightStateStruct) - + 2 * sizeof(listofObj) - + sizeof(CARD16) * - (srcLightState->enableList->maxObj - + srcLightState->disableList->maxObj)); - - dstLightState->enableList = (listofObj *)(dstLightState + 1); - dstLightState->enableList->pList = (ddPointer)(dstLightState->enableList +1); - dstLightState->disableList = - (listofObj *)((dstLightState->enableList->pList + - sizeof(CARD16) * dstLightState->enableList->maxObj)); - dstLightState->disableList->pList = - (ddPointer)(dstLightState->disableList + 1); - return(Success); -} - -/* can use the same for both 3D and 2D */ -OC_COPY_FUNC_HEADER(MCVolume) -{ - int listSize = 0; - COPY_DECL(MCVolume, miMCVolume_Struct); - listSize = puCountList( DD_HALF_SPACE, srcMCVolume->halfspaces->numObj); - DST_STORE_AND_COPY(dstMCVolume, miMCVolume_Struct, - sizeof(miMCVolume_Struct) + listSize); - dstMCVolume->halfspaces = (listofObj *)(dstMCVolume+1); - return(Success); -} - -OC_COPY_FUNC_HEADER(Marker) -{ - listofddPoint *dstPoint; - COPY_DECL(Marker, miMarkerStruct); - - DST_STORE_AND_COPY( dstMarker, miListHeader, - sizeof(miListHeader) + sizeof(listofddPoint) - + srcMarker->ddList->numPoints * sizeof(pexCoord3D)); - dstPoint = (listofddPoint *)(dstMarker+1); - dstMarker->ddList = dstPoint; - dstPoint->pts.p3Dpt = (ddCoord3D *)(dstPoint + 1); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(Marker2D) -{ - listofddPoint *dstPoint; - COPY_DECL(Marker, miMarkerStruct); - - DST_STORE_AND_COPY( dstMarker, miListHeader, - sizeof(miListHeader) + sizeof(listofddPoint) - + srcMarker->ddList->numPoints * sizeof(pexCoord2D)); - dstPoint = (listofddPoint *)(dstMarker+1); - dstMarker->ddList = dstPoint; - dstPoint->pts.p2Dpt = (ddCoord2D *)(dstPoint + 1); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(Text) -{ - COPY_DECL(Text, miTextStruct); - - DST_STORE_AND_COPY( dstText, miTextStruct, sizeof(miTextStruct) - + 3 * sizeof(ddCoord3D) - + pSrc->element.pexOClength * sizeof(CARD32) - - sizeof(pexText)); - /* this also allocates any trailing pads, but so - much the better */ - dstText->pOrigin = (ddCoord3D *)(dstText + 1); - dstText->pDirections = (dstText->pOrigin) + 1; - dstText->pText = (pexMonoEncoding *)((dstText->pDirections) + 2); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(Text2D) -{ - COPY_DECL(Text, miText2DStruct); - - DST_STORE_AND_COPY( dstText, miText2DStruct, sizeof(miText2DStruct) - + sizeof(ddCoord2D) - + pSrc->element.pexOClength * sizeof(CARD32) - - sizeof(pexText2D)); - /* this also allocates any trailing pads, but so - much the better */ - dstText->pOrigin = (ddCoord2D *)(dstText + 1); - dstText->pText = (pexMonoEncoding *)((dstText->pOrigin) + 1); - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(AnnotationText) -{ - COPY_DECL(Text, miAnnoTextStruct); - - DST_STORE_AND_COPY( dstText, miAnnoTextStruct, sizeof(miAnnoTextStruct) - + 2 * sizeof(ddCoord3D) - + pSrc->element.pexOClength * sizeof(CARD32) - - sizeof(pexAnnotationText)); - /* this also allocates any trailing pads, but so - much the better */ - dstText->pOrigin = (ddCoord3D *)(dstText + 1); - dstText->pOffset = (dstText->pOrigin) + 1; - dstText->pText = (pexMonoEncoding *)((dstText->pOffset) + 1); - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(AnnotationText2D) -{ - COPY_DECL(Text, miAnnoText2DStruct); - - DST_STORE_AND_COPY( dstText, miAnnoText2DStruct, sizeof(miAnnoText2DStruct) - + 2 * sizeof(ddCoord2D) - + pSrc->element.pexOClength * sizeof(CARD32) - - sizeof(pexAnnotationText2D)); - /* this also allocates any trailing pads, but so - much the better */ - dstText->pOrigin = (ddCoord2D *)(dstText + 1); - dstText->pOffset = (dstText->pOrigin) + 1; - dstText->pText = (pexMonoEncoding *)((dstText->pOffset) + 1); - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(Polyline2D) -{ - listofddPoint *dstPoint; - COPY_DECL(Poly, miPolylineStruct); - - DST_STORE_AND_COPY( dstPoly, miListHeader, - sizeof(miListHeader) + sizeof(listofddPoint) - + srcPoly->ddList->numPoints * sizeof(ddCoord2D)); - dstPoint = (listofddPoint *)(dstPoly+1); - dstPoly->ddList = dstPoint; - dstPoint->pts.p2Dpt = (ddCoord2D *)(dstPoint + 1); - - return(Success); - -} - - - -OC_COPY_FUNC_HEADER(Polyline) -{ - listofddPoint *dstPoint; - COPY_DECL(Poly, miPolylineStruct); - - DST_STORE_AND_COPY( dstPoly, miListHeader, - sizeof(miListHeader) + sizeof(listofddPoint) - + srcPoly->ddList->numPoints * sizeof(ddCoord3D)); - dstPoint = (listofddPoint *)(dstPoly+1); - dstPoly->ddList = dstPoint; - dstPoint->pts.p3Dpt = (ddCoord3D *)(dstPoint + 1); - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(PolylineSet) -{ - listofddPoint *pPoint; - ddUSHORT i; - int vertexSize = 0; - ddPointer ddPtr = 0; - ddpex2rtn err = Success; - COPY_DECL(Poly, miPolylineStruct); - - for (i=0, pPoint = srcPoly->ddList; inumLists; i++, pPoint++) - vertexSize += CountddVertexData(pPoint, srcPoly->type); - DST_STORE_AND_COPY( dstPoly, miListHeader, - (sizeof(miListHeader) + vertexSize - + srcPoly->numLists * sizeof(listofddPoint))); - - dstPoly->ddList = (listofddPoint *)(dstPoly+1); - for (i=0, pPoint = dstPoly->ddList, vertexSize = 0, - ddPtr = (ddPointer)(dstPoly->ddList + dstPoly->numLists); - inumLists; - i++, pPoint++) { - vertexSize = CountddVertexData(pPoint, dstPoly->type); - pPoint->pts.ptr = (char *)ddPtr; - ddPtr += vertexSize; - /* could have subtracted pointers, but this is more maintainable */ - } - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(NurbCurve) -{ - ddUSHORT pointSize = 0; - COPY_DECL(Nurb, miNurbStruct); - - pointSize = (srcNurb->points.type == DDPT_4D) - ? sizeof(ddCoord4D) : sizeof(ddCoord3D); - DST_STORE_AND_COPY( dstNurb, miNurbStruct, - sizeof(miNurbStruct) + sizeof(listofddPoint) - + srcNurb->numKnots * sizeof(PEXFLOAT) - + srcNurb->points.ddList->numPoints * pointSize); - dstNurb->pKnots = (ddFLOAT *)(dstNurb+1); - dstNurb->points.ddList = - (listofddPoint *)(dstNurb->pKnots + srcNurb->numKnots); - if (srcNurb->points.type == DDPT_4D) { - dstNurb->points.ddList->pts.p4Dpt = - (ddCoord4D *)((dstNurb->points.ddList)+1); - } else { - dstNurb->points.ddList->pts.p3Dpt = - (ddCoord3D *)((dstNurb->points.ddList)+1); - } - - return(Success); -} - - -OC_COPY_FUNC_HEADER(FillArea2D) -{ - COPY_DECL(Fill, miFillAreaStruct); - - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, (sizeof(miFillAreaStruct) + - sizeof(listofddFacet) + sizeof(listofddPoint) - + srcFill->points.ddList->numPoints *sizeof(ddCoord2D))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - dstFill->points.ddList->pts.p2Dpt = (ddCoord2D *)((dstFill->points.ddList) + 1); - - return(Success); -} - - - - -OC_COPY_FUNC_HEADER(FillArea) -{ - COPY_DECL(Fill, miFillAreaStruct); - - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, (sizeof(miFillAreaStruct) + - sizeof(listofddFacet) + sizeof(listofddPoint) - + srcFill->points.ddList->numPoints *sizeof(ddCoord3D))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - dstFill->points.ddList->pts.p3Dpt = (ddCoord3D *)((dstFill->points.ddList) + 1); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(ExtFillArea) -{ - ddpex2rtn err = Success; - int facetSize = 0, vertexSize = 0; - ddPointer facetPtr = 0, vertexPtr = 0; - COPY_DECL(Fill, miFillAreaStruct); - - facetSize = CountddFacetOptData(srcFill->pFacets); - vertexSize = CountddVertexData(srcFill->points.ddList, srcFill->points.type); - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + facetSize + vertexSize - + sizeof(listofddFacet) + sizeof(listofddPoint))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - - facetPtr = (ddPointer)(dstFill->points.ddList + 1); - if (facetSize == 0) - dstFill->pFacets->facets.pNoFacet = 0; - else - dstFill->pFacets->facets.pNoFacet = facetPtr; - - vertexPtr = facetPtr + facetSize; - if (vertexSize == 0) - dstFill->points.ddList->pts.ptr = 0; - else - dstFill->points.ddList->pts.ptr = (char *)vertexPtr; - - return(Success); -} - - -OC_COPY_FUNC_HEADER(FillAreaSet2D) -{ - listofddPoint *ddPoint; - ddpex2rtn err = Success; - int listSize = 0; - ddUSHORT i; - ddPointer ddPtr = 0; - COPY_DECL(Fill, miFillAreaStruct); - - for ( i=0, ddPoint = srcFill->points.ddList; - i < srcFill->points.numLists; - i++, ddPoint++ ) - listSize += ddPoint->numPoints * sizeof(ddCoord2D); - - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + listSize - + (srcFill->points.numLists * sizeof(listofddPoint)))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - - for ( i=0, ddPoint = dstFill->points.ddList, - ddPtr = (ddPointer)(ddPoint + dstFill->points.numLists); - ipoints.numLists; - i++, ddPoint++ ) { - - ddPoint->pts.p2Dpt = (ddCoord2D *)ddPtr; - ddPtr += ddPoint->numPoints * sizeof(ddCoord2D); - } - - return(Success); -} - - -OC_COPY_FUNC_HEADER(FillAreaSet) -{ - listofddPoint *ddPoint; - ddpex2rtn err = Success; - int listSize = 0; - ddUSHORT i; - ddPointer ddPtr = 0; - COPY_DECL(Fill, miFillAreaStruct); - - for ( i=0, ddPoint = srcFill->points.ddList; - i < srcFill->points.numLists; - i++, ddPoint++ ) - listSize += ddPoint->numPoints * sizeof(ddCoord3D); - - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + listSize - + (srcFill->points.numLists * sizeof(listofddPoint)))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - - for ( i=0, ddPoint = dstFill->points.ddList, - ddPtr = (ddPointer)(ddPoint + dstFill->points.numLists); - ipoints.numLists; - i++, ddPoint++ ) { - - ddPoint->pts.p3Dpt = (ddCoord3D *)ddPtr; - ddPtr += ddPoint->numPoints * sizeof(ddCoord3D); - } - - return(Success); -} - - -OC_COPY_FUNC_HEADER(ExtFillAreaSet) -{ - listofddPoint *dstPoint, *srcPoint; - ddUSHORT i; - int facetSize = 0, vertexSize = 0; - ddPointer facetPtr = 0, vertexPtr = 0; - ddpex2rtn err = Success; - COPY_DECL(Fill, miFillAreaStruct); - - facetSize = CountddFacetOptData(srcFill->pFacets); - for (i=0, srcPoint=srcFill->points.ddList; - ipoints.numLists; - i++, srcPoint++) { - vertexSize += CountddVertexData(srcPoint, srcFill->points.type); } - - DST_STORE_AND_COPY( dstFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + facetSize + vertexSize - + (srcFill->points.numLists * sizeof(listofddPoint)))); - dstFill->pFacets = (listofddFacet *)(dstFill+1); - dstFill->points.ddList = (listofddPoint *)((dstFill->pFacets)+1); - - facetPtr = (ddPointer)(dstFill->points.ddList + dstFill->points.numLists); - if (facetSize == 0) - dstFill->pFacets->facets.pNoFacet = 0; - else - dstFill->pFacets->facets.pNoFacet = facetPtr; - - vertexPtr = facetPtr + facetSize; - - for (i=0, dstPoint=dstFill->points.ddList, vertexSize = 0; - ipoints.numLists; - i++, dstPoint++, srcPoint++) { - - vertexSize = CountddVertexData(dstPoint, dstFill->points.type); - dstPoint->pts.ptr = (char *)vertexPtr; - vertexPtr += vertexSize; - } - - return(Success); -} - - -OC_COPY_FUNC_HEADER(SOFAS) -{ - ddUSHORT i,j, k; - miConnListList *dstCLL, *srcCLL; - miConnList *dstCList, *srcCList; - ddpex2rtn err = Success; - int vertexSize = 0, facetSize = 0, edgeSize = 0; - ddPointer ptr; - extern void destroySOFAS(); - COPY_DECL(Fill, miSOFASStruct); - - facetSize = CountddFacetOptData( &srcFill->pFacets); - vertexSize = CountddVertexData( srcFill->points.ddList, - srcFill->points.type); - if (srcFill->edgeData) { - edgeSize = srcFill->numEdges * sizeof(ddUCHAR); - edgeSize += ((4 - (edgeSize & 3)) & 3); - } - - DST_STORE_AND_COPY( dstFill, miSOFASStruct, - sizeof(miSOFASStruct) + sizeof(listofddPoint) - + srcFill->numEdges * sizeof(ddUCHAR) - + facetSize + vertexSize + edgeSize + - srcFill->connects.numListLists * sizeof(miConnListList)); - - dstFill->points.ddList = (listofddPoint *)(dstFill + 1); - ptr = (ddPointer)(dstFill->points.ddList + 1); - if (facetSize == 0) dstFill->pFacets.facets.pNoFacet = 0; - else dstFill->pFacets.facets.pNoFacet = ptr; - ptr += facetSize; - if (vertexSize == 0) dstFill->points.ddList->pts.ptr = 0; - else dstFill->points.ddList->pts.ptr = (char *)ptr; - ptr += vertexSize; - if (edgeSize == 0) dstFill->edgeData = 0; - else dstFill->edgeData = ptr; - ptr += edgeSize; - dstFill->connects.data = (miConnListList *)ptr; - for ( i=0, dstCLL = dstFill->connects.data, srcCLL = srcFill->connects.data; - inumFAS; - i++, dstCLL++, srcCLL++) { - COPY_MORE( dstCLL->pConnLists, miConnList, - srcCLL->numLists * sizeof(miConnList), - srcCLL->pConnLists); - if (err != Success) { - destroySOFAS(dstFill); - return(BadAlloc); - } - for ( j=0,dstCList = dstCLL->pConnLists, srcCList = srcCLL->pConnLists; - jnumLists; - j++, dstCList++, srcCList++) { - COPY_MORE( dstCList->pConnects, ddUSHORT, - srcCList->numLists * sizeof(ddUSHORT), - srcCList->pConnects); - if (err != Success) { - destroySOFAS(dstFill); - return(BadAlloc); - } - } - } - - return(Success); -} - - - -OC_COPY_FUNC_HEADER(TriangleStrip) -{ - ddpex2rtn err = Success; - int vertexSize = 0, facetSize = 0; - COPY_DECL(Triangle, miTriangleStripStruct); - - facetSize = CountddFacetOptData(srcTriangle->pFacets); - vertexSize = CountddVertexData( srcTriangle->points.ddList, - srcTriangle->points.type); - DST_STORE_AND_COPY( dstTriangle, miTriangleStripStruct, - (sizeof(miTriangleStripStruct) + sizeof(listofddFacet) - + vertexSize + facetSize + sizeof(listofddPoint))); - dstTriangle->pFacets = (listofddFacet *)(dstTriangle+1); - dstTriangle->points.ddList = (listofddPoint *)((dstTriangle->pFacets)+1); - dstTriangle->pFacets->facets.pNoFacet - = (ddPointer)(dstTriangle->points.ddList + 1); - dstTriangle->points.ddList->pts.ptr - = (char *)(dstTriangle->pFacets->facets.pNoFacet + facetSize); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(QuadrilateralMesh) -{ - ddpex2rtn err = Success; - int vertexSize = 0, facetSize = 0; - COPY_DECL(Quad, miQuadMeshStruct); - - facetSize = CountddFacetOptData(srcQuad->pFacets); - vertexSize = CountddVertexData(srcQuad->points.ddList, srcQuad->points.type); - DST_STORE_AND_COPY( dstQuad, miQuadMeshStruct, (sizeof(miQuadMeshStruct) - + vertexSize + facetSize - + sizeof(listofddFacet) + sizeof(listofddPoint))); - dstQuad->pFacets = (listofddFacet *)(dstQuad+1); - dstQuad->points.ddList = (listofddPoint *)((dstQuad->pFacets)+1); - dstQuad->pFacets->facets.pNoFacet - = (ddPointer)(dstQuad->points.ddList + 1); - dstQuad->points.ddList->pts.ptr - = (char *)(dstQuad->pFacets->facets.pNoFacet + facetSize); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(NurbSurface) -{ - ddULONG i, j, k; - listofTrimCurve *dstTrim, *srcTrim; - ddTrimCurve *dstTC, *srcTC; - ddpex2rtn err = Success; - extern void destroyNurbSurface(); - COPY_DECL(Nurb, miNurbSurfaceStruct); - - DST_STORE_AND_COPY(dstNurb, miNurbSurfaceStruct, (sizeof(miNurbSurfaceStruct) - + (srcNurb->numUknots * srcNurb->numVknots) * (sizeof(ddFLOAT)) - + (sizeof(listofddPoint)) - + (srcNurb->mPts * srcNurb->nPts * sizeof(ddCoord4D) - + (sizeof(listofTrimCurve)) - + srcNurb->numTrimCurveLists * sizeof(ddTrimCurve)))); - dstNurb->pUknots = (ddFLOAT *)(dstNurb+1); - dstNurb->pVknots = (ddFLOAT *)((dstNurb->pUknots) + srcNurb->numUknots); - dstNurb->points.ddList = - (listofddPoint *)((dstNurb->pVknots) + srcNurb->numVknots); - dstNurb->points.ddList->pts.ptr = (char *)(dstNurb->points.ddList + 1); - dstNurb->trimCurves = - (listofTrimCurve *)((dstNurb->points.ddList->pts.ptr) - + (srcNurb->mPts * srcNurb->nPts * sizeof(ddCoord4D))); - - for (i=0, dstTrim = dstNurb->trimCurves, srcTrim = srcNurb->trimCurves; - inumTrimCurveLists; - i++, dstTrim++, srcTrim++) { - - dstTrim->pTC = (ddTrimCurve *)xalloc(srcTrim->count*sizeof(ddTrimCurve)); - COPY_MORE(dstTrim->pTC, ddTrimCurve, srcTrim->count, srcTrim->pTC); - if (err) { - destroyNurbSurface(dstNurb); - return(BadAlloc); - } - - for ( k=0, dstTC = dstTrim->pTC, srcTC = srcTrim->pTC; - k < dstTrim->count; - k++, dstTC++, srcTC++) { - COPY_MORE(dstTC->pKnots, ddFLOAT, dstTC->numKnots, srcTC->pKnots ); - if (err) { - dstTC->points.pts.ptr = 0; - destroyNurbSurface(dstNurb); - return(BadAlloc); - } - if (srcTC->pttype == DD_3D_POINT) { - /* Note that this only works because these points are - * never transformed */ - COPY_MORE( dstTC->points.pts.p3Dpt, ddCoord3D, - dstTC->points.numPoints, srcTC->points.pts.p3Dpt ); - } else { - COPY_MORE( dstTC->points.pts.p2Dpt, ddCoord2D, - dstTC->points.numPoints, srcTC->points.pts.p2Dpt ); - } - if (err) { - destroyNurbSurface(dstNurb); - return(BadAlloc); - } - } - } - return(Success); - -} - -OC_COPY_FUNC_HEADER(CellArray2D) -{ - COPY_DECL(Cell, miCellArrayStruct); - - DST_STORE_AND_COPY( dstCell, miCellArrayStruct, - sizeof(miCellArrayStruct) + sizeof(listofddPoint) - + 2 * sizeof(ddCoord2D) - + srcCell->dx * srcCell->dy * sizeof(ddIndexedColour)); - dstCell->point.ddList = (listofddPoint *)(dstCell+1); - dstCell->point.ddList->pts.p2Dpt = - (ddCoord2D *)((dstCell->point.ddList) + 1); - dstCell->colours.colour.pIndex = - (ddIndexedColour *)((dstCell->point.ddList->pts.p2Dpt) + 2); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(CellArray) -{ - COPY_DECL(Cell, miCellArrayStruct); - - DST_STORE_AND_COPY( dstCell, miCellArrayStruct, - sizeof(miCellArrayStruct) + sizeof(listofddPoint) - + 3 * sizeof(ddCoord3D) - + srcCell->dx * srcCell->dy * sizeof(ddIndexedColour)); - dstCell->point.ddList = (listofddPoint *)(dstCell+1); - dstCell->point.ddList->pts.p3Dpt = - (ddCoord3D *)((dstCell->point.ddList) + 1); - dstCell->colours.colour.pIndex = - (ddIndexedColour *)((dstCell->point.ddList->pts.p3Dpt) + 3); - - return(Success); - -} - -OC_COPY_FUNC_HEADER(ExtCellArray) -{ - unsigned long size; - COPY_DECL(Cell, miCellArrayStruct); - - size = (((srcCell->colours.colourType==PEXIndexedColour) - || (srcCell->colours.colourType==PEXRgb8Colour)) ? 4 : - ((srcCell->colours.colourType==PEXRgb16Colour) ? 8 : 12 )); - DST_STORE_AND_COPY( dstCell, miCellArrayStruct, - sizeof(miCellArrayStruct) + sizeof(listofddPoint) - + 3 * sizeof(ddCoord3D) - + srcCell->dx * srcCell->dy * size); - dstCell->point.ddList = (listofddPoint *)(dstCell+1); - - dstCell->point.ddList->pts.p3Dpt = - (ddCoord3D *)((dstCell->point.ddList) + 1); - - switch (srcCell->colours.colourType) { - case PEXIndexedColour: { - dstCell->colours.colour.pIndex = - (ddIndexedColour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXRgbFloatColour : { - dstCell->colours.colour.pRgbFloat = - (ddRgbFloatColour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXCieFloatColour : { - dstCell->colours.colour.pCie = - (ddCieColour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXHsvFloatColour : { - dstCell->colours.colour.pHsv = - (ddHsvColour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXHlsFloatColour : { - dstCell->colours.colour.pHls = - (ddHlsColour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXRgb8Colour : { - dstCell->colours.colour.pRgb8 = - (ddRgb8Colour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - case PEXRgb16Colour : { - dstCell->colours.colour.pRgb16 = - (ddRgb16Colour *)((dstCell->point.ddList->pts.p3Dpt)+3); - break; } - } - - return(Success); - -} - - -OC_COPY_FUNC_HEADER(PSurfaceChars) -{ - COPY_DECL(PSC, miPSurfaceCharsStruct); - - switch (srcPSC->type) { - case PEXPSCNone: - case PEXPSCImpDep: - DST_STORE_AND_COPY( dstPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct)); - break; - - case PEXPSCIsoCurves: { - DST_STORE_AND_COPY( dstPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_IsoparametricCurves)); - dstPSC->data.pIsoCurves = (ddPSC_IsoparametricCurves *)(dstPSC + 1); - break; - } - - case PEXPSCMcLevelCurves: { - DST_STORE_AND_COPY( dstPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_LevelCurves)); - dstPSC->data.pMcLevelCurves = (ddPSC_LevelCurves *)(dstPSC + 1); - break; - } - - case PEXPSCWcLevelCurves: { - DST_STORE_AND_COPY( dstPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_LevelCurves)); - dstPSC->data.pWcLevelCurves = (ddPSC_LevelCurves *)(dstPSC + 1); - break; - } - } - - return(Success); -} - - - - -OC_COPY_FUNC_HEADER(Gdp2D) -{ - COPY_DECL(Gdp, miGdpStruct); - - DST_STORE_AND_COPY( dstGdp, miGdpStruct, (sizeof(miGdpStruct) - + sizeof(listofddPoint) + srcGdp->numBytes - + srcGdp->points.ddList->numPoints * sizeof(ddCoord2D))); - dstGdp->points.ddList = (listofddPoint *)(dstGdp+1); - dstGdp->points.ddList->pts.p2Dpt = (ddCoord2D *)((dstGdp->points.ddList) +1); - dstGdp->pData = ((ddUCHAR *)(dstGdp->points.ddList)) - + srcGdp->points.ddList->numPoints * sizeof(ddCoord2D); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(Gdp) -{ - COPY_DECL(Gdp, miGdpStruct); - - DST_STORE_AND_COPY( dstGdp, miGdpStruct, (sizeof(miGdpStruct) - + sizeof(listofddPoint) + srcGdp->numBytes - + srcGdp->points.ddList->numPoints * sizeof(ddCoord3D))); - dstGdp->points.ddList = (listofddPoint *)(dstGdp+1); - dstGdp->points.ddList->pts.p3Dpt = (ddCoord3D *)((dstGdp->points.ddList) +1); - dstGdp->pData = ((ddUCHAR *)(dstGdp->points.ddList)) - + srcGdp->points.ddList->numPoints * sizeof(ddCoord3D); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(SetAttribute) -{ - COPY_DECL(Attrib, pexElementInfo); - - DST_STORE_AND_COPY( dstAttrib, pexElementInfo, - srcAttrib->length * sizeof(CARD32)); - - return(Success); -} - - -OC_COPY_FUNC_HEADER(PropOC) -{ - COPY_DECL(PropOC, pexElementInfo); - - DST_STORE_AND_COPY( dstPropOC, pexElementInfo, - srcPropOC->length * sizeof(CARD32)); - - return(Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miDestroy.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miDestroy.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miDestroy.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miDestroy.c:3.8 Fri Dec 14 14:57:23 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miDestroy.c Sat Feb 28 21:41:54 2004 @@ -1,145 +0,0 @@ -/* $Xorg: miDestroy.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "X.h" -#include "ddpex.h" -#include "ddpex3.h" -#include "PEX.h" -#include "PEXproto.h" -#include "pexExtract.h" -#include "ddpex2.h" -#include "miStruct.h" -#include "pexUtils.h" - - -/** This file contains the definition for the OC Destroy Functions, - ** each of which takes one parameter: a pointer to the element to be - ** destroyed (in server native internal format). - ****Note that these functions may be replaced by PEX server porters. - **/ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define CAT(a,b) a##b -#else -#define CAT(a,b) a/**/b -#endif /* __STDC__ */ - -#define OC_DESTROY_FUNC_HEADER(suffix) \ - void CAT(destroy,suffix)(pExecuteOC) \ - miGenericElementPtr pExecuteOC; /* internal format */ - - -/* nothing to delete */ -OC_DESTROY_FUNC_HEADER(NoOp) -{ - return; -} - -/* Most OC's are allocated in one hunk */ -OC_DESTROY_FUNC_HEADER(OC_PEX) -{ - xfree(pExecuteOC); /* was allocated in one hunk */ - return; -} - -/* others are more chewy */ -OC_DESTROY_FUNC_HEADER(NurbSurface) -{ - miNurbSurfaceStruct *ddNurb = (miNurbSurfaceStruct *)(pExecuteOC + 1); - listofTrimCurve *ddTrim; - ddTrimCurve *ddTC; - ddULONG i, j; - - if (!pExecuteOC) return; - - for ( i=0, ddTrim = ddNurb->trimCurves; - i < ddNurb->numTrimCurveLists; - i++, ddTrim++ ) { - if (ddTrim->pTC) { - for ( j=0, ddTC = ddTrim->pTC; - j < ddTrim->count; - j++, ddTC++ ) { - if (ddTC->pKnots) xfree(ddTC->pKnots); - if (ddTC->points.pts.ptr) xfree(ddTC->points.pts.ptr); - else break; - } - xfree(ddTrim->pTC); - } else break; - } - - xfree(pExecuteOC); - - return; -} - -/* and sofas have a LOT of stuffing */ -OC_DESTROY_FUNC_HEADER(SOFAS) -{ - ddUSHORT i,j; - miSOFASStruct *ddFill = (miSOFASStruct *)(pExecuteOC + 1); - miConnListList *pCLL; - miConnList *pCList; - - if (!pExecuteOC) return; - - for ( i=0, pCLL = ddFill->connects.data; - iconnects.numListLists; - i++, pCLL++) { - if (pCLL->pConnLists) { - for ( j=0, pCList=(miConnList *)(pCLL->pConnLists); - jnumLists; - j++, pCList++) { - if (pCList->pConnects) xfree(pCList->pConnects); - else break; - } - } else break; - xfree(pCLL->pConnLists); - } - xfree(pExecuteOC); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c:3.7 Fri Dec 14 14:57:23 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c Sat Feb 28 21:41:54 2004 @@ -1,1532 +0,0 @@ -/* $Xorg: miFillArea.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miFillArea.c,v 3.7 2001/12/14 19:57:23 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miLight.h" -#include "miClip.h" -#include "pexos.h" - - -static ddpex3rtn Complete_FillArea_Facetlist(); -static ddpex3rtn Calculate_FillArea_Facet_Normal(); -static ddpex3rtn Calculate_FillArea_Vertex_Color_and_Normal(); - -/*++ - | - | Function Name: miFillArea - | - | Function Description: - | Handles the Fill area 3D, Fill area 2D, Fill area 3D with data, - | Fill are set 2D, Fill are set 3D, Fill are set 3D with data ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miFillArea(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ -/* calls */ - ddpex3rtn miTransform(); - ddpex3rtn miConvertVertexColors(); - ddpex3rtn miConvertFacetColors(); - ddpex3rtn miLightFillArea(); - ddpex3rtn miClipFillArea(); - ddpex3rtn miCullFillArea(); - ddpex3rtn miRenderFillArea(); - -/* Local variable definitions */ - miFillAreaStruct *ddFill = (miFillAreaStruct *)(pExecuteOC+1); - miListHeader *input_list = &ddFill->points; /* Input points */ - ddBitmaskShort shape = ddFill->shape; /* shape hint */ - ddUCHAR noEdges = ddFill->ignoreEdges; /* edge flag*/ - listofddFacet *input_facet = ddFill->pFacets; /* facets */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - - miListHeader *color_list, - *mc_list, - *mc_clist, - *wc_list, - *light_list, - *cc_list, - *clip_list, - *dcue_list, - *cull_list, - *dc_list; - - listofddFacet *color_facet, - *mc_facet, - *wc_facet, - *light_facet, - *cc_facet, - *clip_facet, - *cull_facet, - *dc_facet; - - listofddPoint *sp; - int i, j; - ddUSHORT clip_mode; - ddpex3rtn status; - ddPointType out_type; - - /* - * Convert per-vertex and per-facet colors to rendering color model. - * Note that this implementation only supports rgb float. - */ - - if (DD_IsVertColour(input_list->type)) { - if (status = miConvertVertexColors(pRend, - input_list, PEXRdrColourModelRGB, - &color_list)) - return (status); - } else { - color_list = input_list; - } - - if ((input_facet) && (DD_IsFacetColour(input_facet->type))) { - if (status = miConvertFacetColors(pRend, - input_facet, PEXRdrColourModelRGB, - &color_facet)) - return (status); - } else { - color_facet = input_facet; - } - - /* Check for Model clipping */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - /* Compute modelling coord version of clipping volume */ - ComputeMCVolume(pRend, pddc); - clip_mode = MI_MCLIP; - - /* Tranform points to 4D for clipping */ - out_type = color_list->type; - if (status = miTransform(pddc, - color_list, &mc_clist, - ident4x4, - ident4x4, - DD_SetVert4D(out_type))) - return (status); - - - if (status = miClipFillArea(pddc, mc_clist, color_facet, - &mc_list, &mc_facet, clip_mode)) - return (status); - - /* if nothing left after modeling clip, return early */ - if (mc_list->numLists <= 0) return(Success); - - } else { - mc_list = color_list; - mc_facet = color_facet; - } - - clip_mode = MI_VCLIP; - - /* - * First, check lighting requirements - */ - if (pddc->Static.attrs->reflModel != PEXReflectionNoShading) { - - /* Transform to WC prior to applying lighting */ - out_type = mc_list->type; - if (DD_IsVertNormal(out_type)) VALIDATEINVTRMCTOWCXFRM(pddc); - if (status = miTransform(pddc, mc_list, &wc_list, - pddc->Dynamic->mc_to_wc_xform, - pddc->Static.misc.inv_tr_mc_to_wc_xform, - DD_SetVert4D(out_type))) - return (status); - - /* Transform facet normals if necessary */ - if ((mc_facet) && - (mc_facet->numFacets > 0) && - (DD_IsFacetNormal(mc_facet->type))) { - VALIDATEINVTRMCTOWCXFRM(pddc); - if (status = miFacetTransform(pddc, - mc_facet, &wc_facet, - pddc->Static.misc.inv_tr_mc_to_wc_xform)) - return (status); - } else wc_facet = mc_facet; - - /* Apply lighting */ - if (status = miLightFillArea(pRend, pddc, - wc_list, wc_facet, - &light_list, &light_facet)) - return (status); - - - /* Transform to CC for clipping */ - if (DD_IsVertNormal(light_list->type)) VALIDATEINVTRWCTOCCXFRM(pddc); - if (status = miTransform(pddc, light_list, &cc_list, - pddc->Dynamic->wc_to_cc_xform, - pddc->Static.misc.inv_tr_wc_to_cc_xform, - light_list->type)) - return (status); - - /* Transform facet normals if necessary */ - if ( (light_facet) && - (light_facet->numFacets > 0) && - (DD_IsFacetNormal(light_facet->type)) ) { - VALIDATEINVTRWCTOCCXFRM(pddc); - if (status = miFacetTransform(pddc, - light_facet, &cc_facet, - pddc->Static.misc.inv_tr_wc_to_cc_xform)) - return (status); - } else cc_facet = light_facet; - - } - else { - - out_type = mc_list->type; - if (DD_IsVertNormal(out_type)) VALIDATEINVTRMCTOCCXFRM(pddc); - if (status = miTransform(pddc, mc_list, &cc_list, - pddc->Dynamic->mc_to_cc_xform, - pddc->Static.misc.inv_tr_mc_to_cc_xform, - DD_SetVert4D(out_type))) - return (status); - - - if ((mc_facet) && - (mc_facet->numFacets > 0) && - (DD_IsFacetNormal(mc_facet->type))) { - VALIDATEINVTRMCTOCCXFRM(pddc); - if (status = miFacetTransform(pddc, - mc_facet, &cc_facet, - pddc->Static.misc.inv_tr_mc_to_cc_xform)) - return (status); - } else cc_facet = mc_facet; - } - - /* View clip primitive */ - if (status = miClipFillArea(pddc, cc_list, cc_facet, - &clip_list, &clip_facet, clip_mode)) - return (status); - - /* if nothing left after view clip, return early */ - if (clip_list->numLists <= 0) return(Success); - - /* Now cull according to current culling mode */ - if (pddc->Dynamic->pPCAttr->cullMode) { - if (status = miCullFillArea(pddc, clip_list, clip_facet, - &cull_list, &cull_facet)) - return (status); - - /* if nothing left after culling, return early */ - if (cull_list->numLists <= 0) return(Success); - clip_list = cull_list; - clip_facet = cull_facet; - } else { - cull_list = clip_list; - cull_facet = clip_facet; - } - - /* DEPTH CUEING */ - if (pddc->Dynamic->pPCAttr->depthCueIndex) { - miDepthCueFillArea(pRend, cull_list, cull_facet, &dcue_list); - cull_list = dcue_list; - } - - /* Lastly, transform to DC coordinates */ - out_type = cull_list->type; - DD_SetVert2D(out_type); - DD_SetVertShort(out_type); - if (DD_IsVertNormal(out_type)) VALIDATEINVTRCCTODCXFRM(pddc); - if (status = miTransform(pddc, cull_list, &dc_list, - pddc->Dynamic->cc_to_dc_xform, - pddc->Static.misc.inv_tr_cc_to_dc_xform, - out_type) ) - return (status); - - /* Transform facet normals if necessary */ - if ( (clip_facet) && - (clip_facet->numFacets > 0) && - (DD_IsFacetNormal(clip_facet->type)) ) { - VALIDATEINVTRCCTODCXFRM(pddc); - if (status = miFacetTransform(pddc, - clip_facet, &dc_facet, - pddc->Static.misc.inv_tr_cc_to_dc_xform)) - return (status); - } else dc_facet = clip_facet; - - - return (pddc->Static.RenderProcs[FILLAREA_RENDER_TABLE_INDEX](pRend, - pddc, - dc_list, - dc_facet, - shape, - noEdges)); -} - -/*++ - | - | Function Name: miClipFillArea - | - | Function Description: - | Handles the fill area 3D, fill area 2D, - | and fill area set 3D with data ocs. - | - | Note(s): - | - | This routine uses a Sutherland-Hodgman approach for - | polygon clipping. (See, for example, Rodger's "Procedural - | Elements for Computer Graphics", pp 169-179)). - | Each list is clipped successively against each (enabled) - | clipping boundary. - | - --*/ -ddpex3rtn -miClipFillArea(pddc, input_vert, input_fct, output_vert, output_fct, clip_mode) -/* in */ - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ - ddUSHORT clip_mode; /* view or model clipping */ -{ -/* calls */ - ddpex3rtn miCloseFillArea(); - -/* uses */ - ddPointUnion in_ptP, in_ptQ; - ddPointUnion out_pt; - float t_ptP, t_ptQ; - char *in_fct, *out_fct; - int point_size; - int facet_size; - int num_points; - int extra_point; - int vert_count; - miListHeader *input, *output, *list1, *list2; - listofddPoint *pddilist; - listofddPoint *pddolist; - listofddFacet *finput, *foutput, *fct_list1, *fct_list2; - int num_lists; - int i, j, k, num_planes; - ddUSHORT clipflags; - ddUSHORT current_clip; - int edge_offset, clip_code, pts_inlist; - ddULONG *edge_ptr; - ddHalfSpace *MC_HSpace; - ddpex3rtn status; - char do_edges, - outside; /* flag to indicate current */ - /* point of interest is outside */ - - - - /* Vertex data must be homogeneous for view clipping */ - if ((clip_mode == MI_VCLIP) && !(DD_IsVert4D(input_vert->type))) - return(1); - - /* Insure that the polygon bounds form closed contours */ - if (status = miCloseFillArea(input_vert)) return(status); - - /* PHIGS specifies a single facet for a set of fill areas */ - *output_fct = input_fct; - - /* - * Use the pre-defined clip lists for output - * Note that two buffers are used in "ping-pong" fashion: - * first the first buffer is used for output, then the second. - */ - list1 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list1, MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)); - if (!list1->ddList) return(BadAlloc); - - list2 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list2, MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)); - if (!list2->ddList) return(BadAlloc); - - /* - * Must have edge flags in vertex if edges are to be drawn - - * otherwise, cannot determine wich edges are "original" and - * which edges where added by the clipper. - */ - - if (pddc->Static.attrs->edges != PEXOff) { - do_edges = PEXOn; - if (!(DD_IsVertEdge(input_vert->type))) { - if (status = miAddEdgeFlag(pddc, input_vert, &list1)) - return(status); - input = list1; - } else input = input_vert; - } else { - do_edges = PEXOff; - /* Allocate an initial number of headers */ - input = input_vert; - } - /* Note that adding edges will change the input type */ - list1->type = input->type; - list2->type = input->type; - list1->flags = input->flags; - list2->flags = input->flags; - output = list2; - - - /* Get point size so that this works for all point types */ - DD_VertPointSize(input->type, point_size); - DD_VertOffsetEdge(input->type, edge_offset); - - /* - * Each list is now clipped in turn against each (enabled) boundary. - */ - - - if (clip_mode == MI_MCLIP) { - num_planes = pddc->Static.misc.ms_MCV->numObj; - MC_HSpace = (ddHalfSpace *)(pddc->Static.misc.ms_MCV->pList); - } - else num_planes = 6; /* view clipping to a cube */ - - for (i = 0; i < num_planes; i++) { - current_clip = 1 << i; /* current_clip is new clip bound */ - - num_lists = 0; /* Restart list counter each pass */ - - for (j = 0, pddilist = input->ddList, pddolist = output->ddList, - output->numLists = 0; - j < input->numLists; j++) { - - - /* Don't process if no points */ - if ((vert_count = pddilist->numPoints) <= 0) { - pddilist++; - continue; - } - - /* - * Insure sufficient room for each vertex. - * Note that twice the vertex count is an upper-bound for - * a clipped polygon (although there is probably a "tighter fit"). - */ - MI_ALLOCLISTOFDDPOINT(pddolist, 2*vert_count, point_size); - if (!(out_pt.ptr = (char *)pddolist->pts.ptr)) return(BadAlloc); - pts_inlist = 0; - clip_code = 0; - /* Aquire two points */ - /* and generate clip code */ - in_ptP.ptr = pddilist->pts.ptr; - COMPUTE_CLIP_PARAMS(in_ptP,t_ptP,0,clip_mode, - current_clip,MC_HSpace,clip_code); - - if(!(clip_code)) { - COPY_POINT(in_ptP, out_pt, point_size); - ++pts_inlist; - out_pt.ptr += point_size; - } - - in_ptQ.ptr = in_ptP.ptr + point_size; - - for (k = 1; k < pddilist->numPoints; k++){ - - COMPUTE_CLIP_PARAMS(in_ptQ, t_ptQ, 1, clip_mode, - current_clip,MC_HSpace,clip_code); - - switch(clip_code) { - case 0: /* both P and Q are in bounds */ - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - ++pts_inlist; - outside = PEXOff; - break; - case 1: /* P is out, Q is in */ - CLIP_AND_COPY(input->type, in_ptP, t_ptP, - in_ptQ, t_ptQ, out_pt); - out_pt.ptr += point_size; - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - pts_inlist += 2; - outside = PEXOff; - break; - case 2: /* P is in, Q is out */ - CLIP_AND_COPY(input->type, in_ptQ, t_ptQ, - in_ptP, t_ptP, out_pt); - if (do_edges == PEXOn) { - edge_ptr = (ddULONG *)(out_pt.ptr + edge_offset); - *edge_ptr = 0; - } - out_pt.ptr += point_size; - ++pts_inlist; - outside = PEXOn; - break; - case 3: /* both are out */ - outside = PEXOn; - break; - } - - in_ptP.ptr = in_ptQ.ptr; - t_ptP = t_ptQ; - in_ptQ.ptr += point_size; - clip_code >>= 1; - } - - if (pts_inlist > 1) { - if (outside == PEXOn) { - /* special case where last segment clipped out. Need to - close the fill area */ - COPY_POINT(pddolist->pts, out_pt, point_size); - pts_inlist++; - } - pddolist->numPoints = pts_inlist; - pddolist++; - num_lists++; - - } - - /* Now, skip to next input list */ - pddilist++; - } - - /* Complete initialization of output list header */ - output->numLists = num_lists; - - /* Use result of previous clip for input to next clip */ - input = output; - if (output == list2) - output = list1; - else output = list2; - - if (clip_mode == MI_MCLIP) MC_HSpace++; - } /* end of processing for all planes */ - - /* Current input list is last processed (clipped) list */ - *output_vert = input; - return (Success); - -} - -/*++ - | - | miLightFillArea(pRend, pddc, input_vert, input_fct, output_vert, output_fct) - | - | Perform lighting calculations for the vertex or facet - | data provided according to the current attributes. - | - --*/ -ddpex3rtn -miLightFillArea(pRend, pddc, input_vert, input_fct, output_vert, output_fct) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd Context pointer */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ -{ -/* calls */ - ddpex3rtn miApply_Lighting(); - ddpex3rtn miFilterPath(); - -/* uses */ - listofddFacet *fct_list; - miListHeader *out_vert; - ddRgbFloatNormal *in_fct; - ddRgbFloatColour *out_fct; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddRgbFloatNormalPoint4D *in_pt; - ddRgbFloatPoint4D *out_pt; - int i, j; - ddpex3rtn status; - - /* - * First, Insure that the vertex and/or facet data - * is sufficient for the current Surface Interpolation method. - * Note that this implementation does not support - * PEXSurfaceInterpDotProduct and PEXSurfaceInterpNormal and - * that these surface interpolation types are approximated by - * PEXSurfaceInterpColour. The cases dealt with here, therefore, - * are constant surface color (thus a single color is computed - * per facet) and interpolated surface color (thus a color - * per verted is required). - */ - switch(pddc->Static.attrs->surfInterp) { - - case PEXSurfaceInterpNone: - - /* - * Insure that input facet data is in proper format - * for flat shading. - */ - if ((!input_fct) || - (input_fct->numFacets == 0) || - (!( (DD_IsFacetColour(input_fct->type)) && - (DD_IsFacetNormal(input_fct->type))))) { - Complete_FillArea_Facetlist(pddc, input_vert, input_fct, - output_fct); - input_fct = *output_fct; - } - - /* - * Should have facets with normals and surface colors now. - * Since we are flat shading, there is no further use - * for per-vertex color or normal data (however, leave - * any edge information). Remove it to prevent confusion - * further down the pipeline. - */ - if ( (DD_IsVertNormal(input_vert->type)) || - (DD_IsVertNormal(input_vert->type)) ) { - if (status = miFilterPath(pddc, input_vert, output_vert, - ((1 << 3) | 1) )) - return(status); - } else { - *output_vert = input_vert; - } - - /* - * allocate storage for the facet list - * Note that the output facet list only contains colors. - */ - *output_fct = fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->numFacets = input_fct->numFacets; - fct_list->type = DD_FACET_RGBFLOAT; - MI_ALLOCLISTOFDDFACET(fct_list, input_fct->numFacets, - sizeof(ddRgbFloatColour)); - if (!(out_fct = fct_list->facets.pFacetRgbFloat)) return(BadAlloc); - in_fct = input_fct->facets.pFacetRgbFloatN; - pddilist = input_vert->ddList; - - /* - * Compute lighted facet color for each facet. - * Facet color is simply the sum of the lighting contributions - * from each light source. - */ - for (i= 0; i < input_fct->numFacets; i++) { - if (status = miApply_Lighting(pRend, pddc, - pddilist->pts.p4Dpt, - &(in_fct->colour), - &(in_fct->normal), - out_fct )) - return(status); - - in_fct++; - out_fct++; - pddilist++; - } - break; - - case PEXSurfaceInterpColour: - case PEXSurfaceInterpDotProduct: - case PEXSurfaceInterpNormal: - - if ( (!DD_IsVertColour(input_vert->type)) || - (!DD_IsVertNormal(input_vert->type)) ) { - Calculate_FillArea_Vertex_Color_and_Normal(pddc, input_vert, - input_fct, - output_vert); - input_vert = *output_vert; - } - - /* No further need for per facet data */ - *output_fct = 0; - - /* Perform shading on a per-vertex basis */ - if (pddc->Static.attrs->reflModel != PEXReflectionNoShading) { - - /* Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, input_vert->numLists) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = DD_RGBFLOAT_POINT4D; - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - - for (i = 0; i < input_vert->numLists; i++) { - - pddolist->numPoints = pddilist->numPoints; - - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - sizeof(ddRgbFloatPoint4D)); - if (!(out_pt = pddolist->pts.pRgbFloatpt4D)) return(BadAlloc); - in_pt = pddilist->pts.pRgbFloatNpt4D; - - for (j = 0; j < pddilist->numPoints; j++) - { - out_pt->pt = in_pt->pt; - if (status = miApply_Lighting(pRend, pddc, - &(in_pt->pt), - &(in_pt->colour), - &(in_pt->normal), - &(out_pt->colour))) - return(status); - - in_pt++; - out_pt++; - } - pddilist++; - pddolist++; - } - - } - - break; - - default: - *output_vert = input_vert; - *output_fct = input_fct; - - } - - return(Success); -} - -/*++ - | - | miCullFillArea(pddc, input_vert, input_fct, output_vert, output_fct) - | - | Perform lighting calculations for the vertex or facet - | data provided according to the current attributes. - | - --*/ -ddpex3rtn -miCullFillArea(pddc, input_vert, input_fct, output_vert, output_fct) - miDDContext *pddc; /* dd Context pointer */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ -{ -/* uses */ - miListHeader *out_vert; - listofddPoint *pddilist; - listofddPoint *pddolist; - listofddFacet *fct_list; - ddFacetUnion in_fct; - ddFacetUnion out_fct; - listofddPoint temp; - int i, j; - char accept; - char return_facet_list; - int numLists=0; - int point_size, facet_size; - - /* - * Create facet normals if necessary. These are used to determine - * if the facet is to be culled. Note: only return a facet list - * if a valid facet list is input. - */ - if ( (!input_fct) || (input_fct->numFacets <= 0) ) { - Calculate_FillArea_Facet_Normal(pddc, input_vert, - (listofddFacet *)0, &input_fct); - return_facet_list = 0; - *output_fct = 0; - - } else { - if (!(DD_IsFacetNormal(input_fct->type))) { - Calculate_FillArea_Facet_Normal(pddc, input_vert, - input_fct, output_fct); - input_fct = *output_fct; - } - return_facet_list = 1; - } - - /* - * allocate storage for the output vertex and facet list - */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - out_vert->type = input_vert->type; - out_vert->flags = input_vert->flags; - MI_ALLOCLISTHEADER(out_vert, input_vert->numLists) - if (!out_vert->ddList) return(BadAlloc); - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - DD_VertPointSize(input_vert->type, point_size); - - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = input_fct->type; - DDFacetSIZE(input_fct->type, facet_size); - MI_ALLOCLISTOFDDFACET(fct_list, input_fct->numFacets, facet_size); - out_fct = fct_list->facets; - if (!out_fct.pNoFacet) return(BadAlloc); - in_fct = input_fct->facets; - - - /* - * This test is performed in NPC space. As a result, - * the sign of the z component of the facet normal - * indicates the direction in which the facet is pointing. - * Therefore if the cullmode is PEXBackFaces and the - * z component is negative, reject the facet. Similarily, - * if the z component of the normal is positive, and - * the cullmode is PEXFrontFaces, also reject the face. - * Lastly, note that it is not necessary to copy the vertex - * data - it is sufficient to copy the listofddPoint header. - * To avoid alloc problems, however, the headers - * are interchanged. (As opposed to over-writing the destination - * header) - */ - for (i= 0; i < input_fct->numFacets; i++) { - - accept = 0; - - if (pddc->Dynamic->pPCAttr->cullMode == PEXBackFaces) { - if (DD_IsFacetColour(input_fct->type)) { - if (in_fct.pFacetRgbFloatN->normal.z >= 0) accept = 1; - } else if (in_fct.pFacetN->z >= 0) accept = 1; - } else /* pddc->Dynamic->pPCAttr->cullMode == PEXFrontFaces */ { - if (DD_IsFacetColour(input_fct->type)) { - if (in_fct.pFacetRgbFloatN->normal.z < 0) accept = 1; - } else if (in_fct.pFacetN->z < 0) accept = 1; - } - - - if (accept) { - /* First, swap the listofddPoint headers */ - temp = *pddilist; - *pddilist = *pddolist; - *(pddolist++) = temp; - - /* Now, copy the facet info */ - if (DD_IsFacetColour(input_fct->type)) - *(out_fct.pFacetRgbFloatN++) = *in_fct.pFacetRgbFloatN; - else *(out_fct.pFacetN++) = *in_fct.pFacetN; - - numLists++; - } - - pddilist++; - if (DD_IsFacetColour(input_fct->type)) in_fct.pFacetRgbFloatN++; - else in_fct.pFacetN++; - } - - out_vert->numLists = numLists; - fct_list->numFacets = numLists; - - /* - * Only return facet list if one was passed in. Reduces the - * information that must be processed by the rest of the pipeline. - */ - if (return_facet_list) *output_fct = fct_list; - - return(Success); -} - -/*++ - | - | Function Name: miCloseFillArea - | - | Function Description: - | Close each bound in a list of vertex lists. "Closing" - | a bound means insuring that the last point in the - | bound is the same as the first point. This routine is - | used, for example, to close each bound in a polygon - | prior to "hollow" style rendering. - | - | Note(s): - | Note this routine does its work in place - the input - | list of vertices is (potentially) modified. - | - --*/ - -ddpex3rtn -miCloseFillArea(vinput) -/* in */ - miListHeader *vinput; -{ -/* uses */ - char *first_pt, *last_pt; - listofddPoint *pddlist; - int vert_count; - int point_size; - int i, j; - int close; - - pddlist = vinput->ddList; - DD_VertPointSize(vinput->type, point_size); - - /* - * Close each list. - */ - for (i = 0; i < vinput->numLists; i++) { - - if ((vert_count = pddlist->numPoints) <= 1) { - pddlist++; - continue; - } - - close = 1; - - /* - * Insure that the list forms a closed bound. - * Note that comparison is point type dependant. - */ - first_pt = (char *)pddlist->pts.p4Dpt; - last_pt = ((char *)pddlist->pts.p4Dpt) + (vert_count-1)*point_size; - - if (DD_IsVertFloat(vinput->type)) { - - if ((DD_IsVert2D(vinput->type)) && - (((ddCoord4D *)first_pt)->x == ((ddCoord4D *)last_pt)->x) && - (((ddCoord4D *)first_pt)->y == ((ddCoord4D *)last_pt)->y)) - close = 0; - - else - if ((DD_IsVert3D(vinput->type)) && - (((ddCoord4D *)first_pt)->x == ((ddCoord4D *)last_pt)->x) && - (((ddCoord4D *)first_pt)->y == ((ddCoord4D *)last_pt)->y) && - (((ddCoord4D *)first_pt)->z == ((ddCoord4D *)last_pt)->z)) - close = 0; - - else - if ((((ddCoord4D *)first_pt)->x == ((ddCoord4D *)last_pt)->x) && - (((ddCoord4D *)first_pt)->y == ((ddCoord4D *)last_pt)->y) && - (((ddCoord4D *)first_pt)->z == ((ddCoord4D *)last_pt)->z) && - (((ddCoord4D *)first_pt)->w == ((ddCoord4D *)last_pt)->w)) - close = 0; - - } else { - - if ((DD_IsVert2D(vinput->type)) && - (((ddCoord3DS *)first_pt)->x == ((ddCoord3DS *)last_pt)->x) && - (((ddCoord3DS *)first_pt)->y == ((ddCoord3DS *)last_pt)->y)) - close = 0; - - else - if ((((ddCoord3DS *)first_pt)->x == ((ddCoord3DS *)last_pt)->x) && - (((ddCoord3DS *)first_pt)->y == ((ddCoord3DS *)last_pt)->y) && - (((ddCoord3DS *)first_pt)->z == ((ddCoord3DS *)last_pt)->z)) - close = 0; - - } - - - /* - * if close is set then need to close the bound. - * Copy the first point to one poast the last point - * in the bound. - */ - if (close) { - - /* Insure sufficient room for each vertex */ - MI_ALLOCLISTOFDDPOINT(pddlist, vert_count+1, point_size); - if (!pddlist->pts.p2DSpt) return(BadAlloc); - - /* Insure realloc didn't move array */ - first_pt = (char *)pddlist->pts.p4Dpt; - last_pt = ((char *)pddlist->pts.p4Dpt) - + (vert_count * point_size); - - /* copy first point to end of list */ - /* JSH - assuming copy may overlap */ - memmove( last_pt, first_pt, point_size); - - /* Increment point count */ - pddlist->numPoints += 1; - } - - /* Now, ski to next input list */ - pddlist++; - } - return (Success); -} - -/*++ - | - | Complete_FillArea_Facetlist(pddc, input_vert, input_fct, output_fct) - | - | Create an output facet list with facet color and normal using - | proper precedence rules. - | - --*/ -static -ddpex3rtn -Complete_FillArea_Facetlist(pddc, input_vert, input_fct, output_fct) - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - listofddFacet **output_fct; /* output facet data */ -{ - - listofddFacet *fct_list; - ddRgbFloatNormal *out_fct; - listofddPoint *pddlist; - char *in_pt; - ddFacetUnion in_fct; - int point_size, color_offset, normal_offset; - int numPoints; - ddCoord3D *vert1, *vert2, *vert3; - int i,j; - int point_count; - float length; - char have_colors, have_normals, done; - - have_colors = have_normals = 0; - - /* What data must be added to output facet list ? */ - if ((input_fct) && (input_fct->type != DD_FACET_NONE)) { - in_fct.pNoFacet = input_fct->facets.pNoFacet; - if DD_IsFacetNormal(input_fct->type) have_normals = ~0; - if DD_IsFacetColour(input_fct->type) have_colors = ~0; - } - - if ((have_colors) && (have_normals)) { /* Why are we here? */ - *output_fct = input_fct; - return(Success); - } - - /* - * Allocate storage for the facet list - */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - MI_ALLOCLISTOFDDFACET(fct_list, 1, sizeof(ddRgbFloatNormal)); - if (!fct_list->facets.pFacetRgbFloatN) return(BadAlloc); - out_fct = (ddRgbFloatNormal *)fct_list->facets.pFacetRgbFloatN; - - DD_VertPointSize(input_vert->type, point_size); - - /* - * Compute "intrinsic" color of facet. - * There is a "hierarchy" of sources for a facet's intrinsic - * color: - * vertex_color present? facet_color = vertex_color - * else facet_color present? facet_color = facet_color - * else facet_color = PC_surface_color - * Obviously there is no pre-defined facet color in this routine, - * so either use vertex color or surface color from PC. - */ - - if (DD_IsVertColour(input_vert->type)) { - /* Compute average facet color */ - point_count = 0; - pddlist = input_vert->ddList; - out_fct->colour.red=out_fct->colour.green=out_fct->colour.blue=0.0; - for (i = 0; i < input_vert->numLists; i++, pddlist++) { - in_pt = pddlist->pts.ptr; - for (j = 0; j < input_vert->numLists; - j++, in_pt += point_size, point_count++) { - out_fct->colour.red += ((ddRgbFloatPoint4D *)in_pt)->colour.red; - out_fct->colour.green += ((ddRgbFloatPoint4D *)in_pt)->colour.green; - out_fct->colour.blue += ((ddRgbFloatPoint4D *)in_pt)->colour.blue; - } - } - out_fct->colour.red /= point_count; - out_fct->colour.green /= point_count; - out_fct->colour.blue /= point_count; - - } else if (have_colors) { - out_fct->colour = *in_fct.pFacetRgbFloat; - - } else { - /* use front face colors. This needs to get generalized - to deal with back-facing attributes*/ - out_fct->colour = pddc->Static.attrs->surfaceColour.colour.rgbFloat; - } - - if (!(have_normals)) { - - done = PEXOff; - pddlist = input_vert->ddList; - - for (j = 0; ((j < input_vert->numLists) && !(done)); j++) { - - /* Don't process if insufficient number of points */ - if ((numPoints = pddlist->numPoints) > 2) { - - in_pt = pddlist->pts.ptr; - - /* - * Compute surface normal. - * The Surface normal is the cross product of the first - * three non-colinear points. - */ - - vert1 = ((ddCoord3D *)in_pt); - in_pt += point_size; - vert2 = ((ddCoord3D *)in_pt); - in_pt += point_size; - vert3 = ((ddCoord3D *)in_pt); - in_pt += point_size; - - numPoints -= 3; - - CROSS_PRODUCT(vert1, vert2, vert3, &(out_fct->normal)); - NORMALIZE_VECTOR(&(out_fct->normal), length); - - while (NEAR_ZERO(length) && (numPoints > 0)) { - vert1 = vert2; - vert2 = vert3; - vert3 = ((ddCoord3D *)in_pt); - in_pt += point_size; - CROSS_PRODUCT(vert1, vert2, vert3, &(out_fct->normal)); - NORMALIZE_VECTOR(&(out_fct->normal), length); - numPoints--; - } - if (!(NEAR_ZERO(length))) done = PEXOn; /* :-) */ - - } - pddlist++; - } - - } else { - /* use input facet normals */ - out_fct->normal = *in_fct.pFacetN; - } - - fct_list->type = DD_FACET_RGBFLOAT_NORM; - fct_list->numFacets = 1; - - *output_fct = fct_list; - - return(Success); -} - -/*++ - | - | Calculate_FillArea_Facet_Normal - | - | Add facet normals to a facet list. - | - --*/ -static ddpex3rtn -Calculate_FillArea_Facet_Normal(pddc, input_vert, input_fct, output_fct) - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - listofddFacet **output_fct; /* output facet data */ -{ - - listofddFacet *fct_list; - ddRgbFloatColour *in_fct; - ddFacetUnion out_fct; - listofddPoint *pddlist; - char *in_pt; - ddVector3D normal; - int point_size; - int numPoints; - ddCoord3D *vert1, *vert2, *vert3; - int numfacets; - int i, j; - float length; - char done; - - /* Some quick error checking */ - if ((input_fct) && (DD_IsFacetNormal(input_fct->type))) return(Success); - - /* - * Allocate storage for the output facet list - */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - if ((input_fct) && DD_IsFacetColour(input_fct->type)) { - in_fct = input_fct->facets.pFacetRgbFloat; - fct_list->type = DD_FACET_RGBFLOAT_NORM; - numfacets = 1; - MI_ALLOCLISTOFDDFACET(fct_list, 1, sizeof(ddRgbFloatNormal)); - } else { - in_fct = 0; - fct_list->type = DD_FACET_NORM; - numfacets = 1; - MI_ALLOCLISTOFDDFACET(fct_list, 1, sizeof(ddVector3D)); - } - - fct_list->numFacets = numfacets; - - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = fct_list->facets; - - DD_VertPointSize(input_vert->type, point_size); - - pddlist = input_vert->ddList; - - - /* Copy the input facet color */ - if (in_fct) { - *out_fct.pFacetRgbFloat = *in_fct; - in_fct++; - } - - done = PEXOff; - - for(i = 0; ((i < input_vert->numLists) && (!(done))); i++) { - - - if ((numPoints = pddlist->numPoints) > 2) { - - in_pt = pddlist->pts.ptr; - - /* - * Compute surface normal. - * The Surface normal is the cross product of the first - * three non-colinear points. - */ - numPoints -= 3; - vert1 = ((ddCoord3D *)in_pt); - in_pt += point_size; - vert2 = ((ddCoord3D *)in_pt); - in_pt += point_size; - vert3 = ((ddCoord3D *)in_pt); - in_pt += point_size; - CROSS_PRODUCT(vert1, vert2, vert3, &normal); - NORMALIZE_VECTOR(&normal, length); - - while (NEAR_ZERO(length) && (--numPoints >= 0)) { - vert1 = vert2; - vert2 = vert3; - vert3 = ((ddCoord3D *)in_pt); - in_pt += point_size; - CROSS_PRODUCT(vert1, vert2, vert3, &normal); - NORMALIZE_VECTOR(&normal, length); - } - - /* Initialize to some arbitrary value if degenerate */ - if (!NEAR_ZERO(length)) { - done = PEXOn; - - if (in_fct) (out_fct.pFacetRgbFloatN++)->normal = normal; - else *(out_fct.pFacetN++) = normal; - } - } - - pddlist++; - } - - *output_fct = fct_list; - - return(Success); -} - -/*++ - | - | Calculate_FillArea_Vertex_Color_and_Normal - | - | Add vertex normals and colors to a vertex list. - | - --*/ -static ddpex3rtn -Calculate_FillArea_Vertex_Color_and_Normal(pddc, input_vert, input_fct, - output_vert) - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ -{ - miListHeader *out_vert; - listofddFacet *fct_list; - ddRgbFloatNormal *out_fct; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddRgbFloatNormalPoint4D *out_pt; - ddPointUnion in_pt; - ddFacetUnion in_fct; - int point_size, facet_size; - int numFacets=0; - int numPoints; - int i,j; - char done; - - /* Some quick error checking */ - if ((DD_IsVertNormal(input_vert->type)) && - (DD_IsVertColour(input_vert->type))) - return(Success); - - /* Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, input_vert->numLists) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = DD_RGBFLOAT_NORM_POINT4D; - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - - DD_VertPointSize(input_vert->type, point_size); - - /* Compute facet normals if no per-vertex normals with data */ - if (!(DD_IsVertNormal(input_vert->type))) { - - if (!(input_fct)) { - if (i = Calculate_FillArea_Facet_Normal(pddc, input_vert, - input_fct, &fct_list)) - return(i); - input_fct = fct_list; - - } - - else if (!(DD_IsFacetNormal(input_fct->type))) { - if (i = Calculate_FillArea_Facet_Normal(pddc, input_vert, - input_fct, &fct_list)) - return(i); - input_fct = fct_list; - } - } - - if ((input_fct) && (input_fct->numFacets > 0)) - in_fct = input_fct->facets; - else in_fct.pNoFacet = 0; - - DDFacetSIZE(input_fct->type, facet_size); - - done = PEXOff; - - for (i = 0; i < input_vert->numLists; i++) { - - pddolist->numPoints = pddilist->numPoints; - - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - sizeof(ddRgbFloatNormalPoint4D)); - if (!(out_pt = pddolist->pts.pRgbFloatNpt4D)) return(BadAlloc); - in_pt = pddilist->pts; - - for (j = 0; j < pddilist->numPoints; j++) - { - /* First copy over coordinate data */ - out_pt->pt = *in_pt.p4Dpt; - - /* - * Next color - * Colour is derived first from the vertex, second from the - * facet, and third from the current PC attributes. - */ - if (DD_IsVertColour(input_vert->type)) - out_pt->colour = in_pt.pRgbFloatpt4D->colour; - else if ((in_fct.pNoFacet) && (DD_IsFacetColour(input_fct->type))) - out_pt->colour = *in_fct.pFacetRgbFloat; - else - out_pt->colour = pddc->Static.attrs->surfaceColour.colour.rgbFloat; - - /* - * Next normals - * Colour is derived first from the vertex, second from the - * facet (note that we insured above that there were facet normals). - */ - if (DD_IsVertNormal(input_vert->type)) - out_pt->normal = in_pt.pNpt4D->normal; - else if (DD_IsFacetColour(input_fct->type)) - out_pt->normal = in_fct.pFacetRgbFloatN->normal; - else out_pt->normal = *in_fct.pFacetN; - - out_pt++; - in_pt.ptr += point_size; - } - - pddilist++; - pddolist++; - } - - return(Success); -} - - - -/*++ - | - | DepthCueFillArea(pRend, input_vert, input_fct, output_vert) - | - | Applies depth cueing to the vertex colors in a FillArea data list - | - --*/ -ddpex3rtn -miDepthCueFillArea(pRend, input_vert, input_fct, output_vert) - ddRendererPtr pRend; /* renderer handle */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *out_vert; - listofddFacet *fct_list; - ddRgbFloatNormal *out_fct; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddPointUnion in_pt, out_pt; - ddRgbFloatColour *in_color; - ddFacetUnion in_fct; - int point_size, facet_size; - int numFacets=0; - int numPoints; - int i,j,outpoint_size; - miColourEntry *pintcolour; - ddFLOAT pt_depth; - ddULONG colourindex; - ddColourSpecifier intcolour; - ddUSHORT status; - ddDepthCueEntry *dcue_entry; - - /* look for empty list header */ - if (input_vert->numLists == 0) return(Success); - - /* validate CC version of Depth Cue information */ - if (pddc->Static.misc.flags & CC_DCUEVERSION) - Compute_CC_Dcue(pRend, pddc); - - /* check to make sure depth cuing is enabled */ - if (pddc->Static.misc.cc_dcue_entry.mode == PEXOff) { - *output_vert = input_vert; - return(Success); - } - - /* Else, depth cue! Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, input_vert->numLists) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = input_vert->type; - DD_SetVertRGBFLOAT(out_vert->type); - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - DD_VertPointSize(input_vert->type, point_size); - - if ((input_fct) && (input_fct->numFacets > 0)){ - in_fct = input_fct->facets; - DDFacetSIZE(input_fct->type, facet_size); - } - else in_fct.pNoFacet = 0; - - /* Get current surface color if appropriate */ - if (!(DD_IsVertColour(input_vert->type)) && - (pddc->Static.attrs->surfaceColour.colourType - == PEXIndexedColour)) { - if ((InquireLUTEntryAddress (PEXColourLUT, pRend->lut[PEXColourLUT], - pddc->Static.attrs->surfaceColour.colour.indexed.index, - &status, (ddPointer *)&pintcolour)) == PEXLookupTableError) - return (PEXLookupTableError); - } - - DD_VertPointSize(out_vert->type, outpoint_size); - - for (i = 0; i < input_vert->numLists; i++) { - - pddolist->numPoints = pddilist->numPoints; - - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - outpoint_size); - if (!(out_pt.ptr = pddolist->pts.ptr)) return(BadAlloc); - in_pt = pddilist->pts; - - for (j = 0; j < pddilist->numPoints; j++) { - /* First copy over coordinate data */ - pt_depth = in_pt.p4Dpt->z; - *out_pt.p4Dpt = *in_pt.p4Dpt; - in_pt.p4Dpt++; - out_pt.p4Dpt++; - - /* - * Next color - * Colour is derived first from the vertex, second from the - * facet, and third from the current PC attributes. - */ - - if (DD_IsVertColour(input_vert->type)){ - in_color = in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - } - else { - if ((in_fct.pNoFacet) && (DD_IsFacetColour(input_fct->type))) - in_color = in_fct.pFacetRgbFloat; - else { - if (pddc->Static.attrs->surfaceColour.colourType - == PEXIndexedColour) - in_color = &pintcolour->entry.colour.rgbFloat; - else in_color = - &(pddc->Static.attrs->surfaceColour.colour.rgbFloat); - } - } - - APPLY_DEPTH_CUEING(pddc->Static.misc.cc_dcue_entry, - pt_depth, in_color, out_pt.pRgbFloatClr) - - out_pt.pRgbFloatClr++; - - /* - * Next normals - * Colour is derived first from the vertex, second from the - * facet (note that we insured above that there were facet normals). - */ - - if DD_IsVertNormal(input_vert->type) { - *out_pt.pNormal = *in_pt.pNormal; - in_pt.pNormal++; - out_pt.pNormal++; - } - - /* Next pass along edge info if there is any */ - if (DD_IsVertEdge(out_vert->type)) { - *out_pt.pEdge = *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - - } - - pddilist++; - pddolist++; - } - - return(Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c:3.8 Fri Dec 14 14:57:25 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c Sat Feb 28 21:41:54 2004 @@ -1,1393 +0,0 @@ -/* $Xorg: miInquire.c,v 1.6 2001/02/09 02:04:09 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miInquire.c,v 3.8 2001/12/14 19:57:25 dawes Exp $ */ - - -#include "ddpex.h" -#include "ddpex3.h" -#include "PEX.h" -#include "PEXproto.h" -#include "pexExtract.h" -#include "ddpex2.h" -#include "miStruct.h" -#include "pexUtils.h" -#include "pexos.h" - - -/* - opposites of parse, although since we know in advance (from storing) - the size of the original OC, we only need to one memory allocation - per OC, and since all output is written to the pex buffer, only - checking for sufficient size and reallocing is necessary - */ - -/* - Please note that any routines added to this file may also cause - a corresponding modification to the level function tables (miTables.c) - */ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define CAT(a,b) a##b -#else -#define CAT(a,b) a/**/b -#endif - -#define OC_INQ_FUNC_HEADER(suffix) \ - ddpex2rtn CAT(inquire,suffix)(pExecuteOC, pBuf, ppPEXOC) \ - miGenericElementStr *pExecuteOC; /* internal format */ \ - ddBuffer *pBuf; \ - pexElementInfo **ppPEXOC; /* PEX format */ - -#define COPY_PTR(PTR) ddPointer PTR; - -#define LEN_WO_HEADER(OCtype) (pPEXOC->length * sizeof(CARD32) - sizeof(OCtype)) - -#define GET_INQ_STORAGE(PEX_ST, PEX_TYPE, DD_ST, DD_TYPE) \ - if (PU_BUF_TOO_SMALL( pBuf, (pExecuteOC->element.pexOClength)<<2)) { \ - if ((puBuffRealloc(pBuf, (pExecuteOC->element.pexOClength)<<2)) != Success) {\ - return (BadAlloc); } } \ - *ppPEXOC = (pexElementInfo *)(pBuf->pBuf); \ - (*ppPEXOC)->elementType = pExecuteOC->element.elementType; \ - (*ppPEXOC)->length = pExecuteOC->element.pexOClength; \ - (PEX_ST) = (PEX_TYPE *)(*ppPEXOC); \ - DD_ST = (DD_TYPE *)(pExecuteOC + 1); - -#define GET_MORE_STORAGE(DD_ST, TYPE, SIZE) \ - (DD_ST) = (TYPE *)xalloc((unsigned long)(SIZE)); \ - if (!(DD_ST)) return (BadAlloc); - - - - - -static void -InqFacetOptData(pFacetList, ptr, rcolourType, rfacetMask, rptr) -listofddFacet *pFacetList; -ddPointer ptr; -INT16 *rcolourType; /* out */ -CARD16 *rfacetMask; /* out */ -ddPointer *rptr; /* out */ -{ - switch (pFacetList->type) { - - case DD_FACET_INDEX_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXIndexedColour; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddIndexNormal, - pFacetList->facets.pFacetIndexN, ptr); - break; } - - case DD_FACET_RGBFLOAT_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXRgbFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgbFloatNormal, - pFacetList->facets.pFacetRgbFloatN, ptr); - break; } - - case DD_FACET_CIE_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXCieFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddCieNormal, - pFacetList->facets.pFacetCieN, ptr); - break; } - - case DD_FACET_HSV_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXHsvFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddHsvNormal, - pFacetList->facets.pFacetHsvN, ptr); - break; } - - case DD_FACET_HLS_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXHlsFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddHlsNormal, - pFacetList->facets.pFacetHlsN, ptr); - break; } - - case DD_FACET_RGB8_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXRgb8Colour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgb8Normal, - pFacetList->facets.pFacetRgb8N, ptr); - break; } - - case DD_FACET_RGB16_NORM: { - *rfacetMask = PEXGAColour | PEXGANormal; - *rcolourType = PEXRgb16Colour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgb16Normal, - pFacetList->facets.pFacetRgb16N, ptr); - break; } - - - case DD_FACET_NORM: { - *rfacetMask = PEXGANormal; - /* return an out of range value instead of 0 */ - *rcolourType = 666; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddVector3D, - pFacetList->facets.pFacetN, ptr); - break; } - - case DD_FACET_INDEX: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXIndexedColour; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddIndexedColour, - pFacetList->facets.pFacetIndex, ptr); - - break; } - - case DD_FACET_RGBFLOAT: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXRgbFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgbFloatColour, - pFacetList->facets.pFacetRgbFloat, ptr); - break; } - - case DD_FACET_CIE: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXCieFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddCieColour, - pFacetList->facets.pFacetCie, ptr); - break; } - - case DD_FACET_HSV: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXHsvFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddHsvColour, - pFacetList->facets.pFacetHsv, ptr); - break; } - - case DD_FACET_HLS: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXHlsFloatColour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddHlsColour, - pFacetList->facets.pFacetHls, ptr); - break; } - - case DD_FACET_RGB8: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXRgb8Colour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgb8Colour, - pFacetList->facets.pFacetRgb8, ptr); - break; } - - case DD_FACET_RGB16: { - *rfacetMask = PEXGAColour; - *rcolourType = PEXRgb16Colour ; - PACK_LISTOF_STRUCT( pFacetList->numFacets, ddRgb16Colour, - pFacetList->facets.pFacetRgb16, ptr); - break; } - - case DD_FACET_NONE: { - /* neither Colour nor Normal specified */ - *rfacetMask = 0; - /* return an out of range value instead of 0 */ - *rcolourType = 666; - break; } - } - - *rptr = ptr; -} - - -static void -InqVertexData(pVertexList, point_type, ptr, rcolourType, rvertexMask, rptr) -listofddPoint *pVertexList; -ddPointType point_type; -ddPointer ptr; -INT16 *rcolourType; /* out */ -CARD16 *rvertexMask; /* out */ -ddPointer *rptr; /* out */ -{ - switch (point_type) { - case DD_INDEX_NORM_EDGE_POINT: { - *rcolourType = PEXIndexedColour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddIndexNormEdgePoint, - pVertexList->pts.pIndexNEpt, ptr); - break; } - - case DD_RGBFLOAT_NORM_EDGE_POINT: { - *rcolourType = PEXRgbFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgbFloatNormEdgePoint, - pVertexList->pts.pRgbFloatNEpt, ptr); - break; } - - case DD_CIE_NORM_EDGE_POINT: { - *rcolourType = PEXCieFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddCieNormEdgePoint, - pVertexList->pts.pCieNEpt, ptr); - break; } - - case DD_HSV_NORM_EDGE_POINT: { - *rcolourType = PEXHsvFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHsvNormEdgePoint, - pVertexList->pts.pHsvNEpt, ptr); - break; } - - case DD_HLS_NORM_EDGE_POINT: { - *rcolourType = PEXHlsFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHlsNormEdgePoint, - pVertexList->pts.pHlsNEpt, ptr); - break; } - - case DD_RGB8_NORM_EDGE_POINT: { - *rcolourType = PEXRgb8Colour ; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb8NormEdgePoint, - pVertexList->pts.pRgb8NEpt, ptr); - break; } - - case DD_RGB16_NORM_EDGE_POINT: { - *rcolourType = PEXRgb16Colour; - *rvertexMask = PEXGAColour | PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb16NormEdgePoint, - pVertexList->pts.pRgb16NEpt, ptr); - break; } - - case DD_NORM_EDGE_POINT: { - /* take this out to prevent overwrite of valid facet colortype - *rcolourType = 0; - */ - *rvertexMask = PEXGANormal | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddNormEdgePoint, - pVertexList->pts.pNEpt, ptr); - break; } - - case DD_INDEX_NORM_POINT: { - *rcolourType = PEXIndexedColour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddIndexNormalPoint, - pVertexList->pts.pIndexNpt, ptr); - break; } - - case DD_RGBFLOAT_NORM_POINT: { - *rcolourType = PEXRgbFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgbFloatNormalPoint, - pVertexList->pts.pRgbFloatNpt, ptr); - break; } - - case DD_CIE_NORM_POINT: { - *rcolourType = PEXCieFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddCieNormalPoint, - pVertexList->pts.pCieNpt, ptr); - break; } - - case DD_HSV_NORM_POINT: { - *rcolourType = PEXHsvFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHsvNormalPoint, - pVertexList->pts.pHsvNpt, ptr); - break; } - - case DD_HLS_NORM_POINT: { - *rcolourType = PEXHlsFloatColour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHlsNormalPoint, - pVertexList->pts.pHlsNpt, ptr); - break; } - - case DD_RGB8_NORM_POINT: { - *rcolourType = PEXRgb8Colour ; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb8NormalPoint, - pVertexList->pts.pRgb8Npt, ptr); - break; } - - case DD_RGB16_NORM_POINT: { - *rcolourType = PEXRgb16Colour; - *rvertexMask = PEXGAColour | PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb16NormalPoint, - pVertexList->pts.pRgb16Npt, ptr); - break; } - - case DD_NORM_POINT: { - /* take this out to prevent overwrite of valid facet colortype - *rcolourType = 0; - */ - *rvertexMask = PEXGANormal; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddNormalPoint, - pVertexList->pts.pNpt, ptr); - break; } - - case DD_INDEX_EDGE_POINT: { - *rcolourType = PEXIndexedColour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddIndexEdgePoint, - pVertexList->pts.pIndexEpt, ptr); - break; } - - case DD_RGBFLOAT_EDGE_POINT: { - *rcolourType = PEXRgbFloatColour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgbFloatEdgePoint, - pVertexList->pts.pRgbFloatEpt, ptr); - break; } - - case DD_CIE_EDGE_POINT: { - *rcolourType = PEXCieFloatColour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddCieEdgePoint, - pVertexList->pts.pCieEpt, ptr); - break; } - - case DD_HSV_EDGE_POINT: { - *rcolourType = PEXHsvFloatColour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHsvEdgePoint, - pVertexList->pts.pHsvEpt, ptr); - break; } - - case DD_HLS_EDGE_POINT: { - *rcolourType = PEXHlsFloatColour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHlsEdgePoint, - pVertexList->pts.pHlsEpt, ptr); - break; } - - case DD_RGB8_EDGE_POINT: { - *rcolourType = PEXRgb8Colour ; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb8EdgePoint, - pVertexList->pts.pRgb8Ept, ptr); - break; } - - case DD_RGB16_EDGE_POINT: { - *rcolourType = PEXRgb16Colour; - *rvertexMask = PEXGAColour | PEXGAEdges; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb16EdgePoint, - pVertexList->pts.pRgb16Ept, ptr); - break; } - - case DD_EDGE_POINT: { - /* neither Colour nor Normal specified */ - /* take this out to prevent overwrite of valid facet colortype - *rcolourType = 0; - */ - *rvertexMask = 0; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddEdgePoint, - pVertexList->pts.pEpt, ptr); - break; } - case DD_INDEX_POINT: { - *rcolourType = PEXIndexedColour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddIndexPoint, - pVertexList->pts.pIndexpt, ptr); - break; } - - case DD_RGBFLOAT_POINT: { - *rcolourType = PEXRgbFloatColour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgbFloatPoint, - pVertexList->pts.pRgbFloatpt, ptr); - break; } - - case DD_CIE_POINT: { - *rcolourType = PEXCieFloatColour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddCiePoint, - pVertexList->pts.pCiept, ptr); - break; } - - case DD_HSV_POINT: { - *rcolourType = PEXHsvFloatColour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHsvPoint, - pVertexList->pts.pHsvpt, ptr); - break; } - - case DD_HLS_POINT: { - *rcolourType = PEXHlsFloatColour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddHlsPoint, - pVertexList->pts.pHlspt, ptr); - break; } - - case DD_RGB8_POINT: { - *rcolourType = PEXRgb8Colour ; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb8Point, - pVertexList->pts.pRgb8pt, ptr); - break; } - - case DD_RGB16_POINT: { - *rcolourType = PEXRgb16Colour; - *rvertexMask = PEXGAColour; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddRgb16Point, - pVertexList->pts.pRgb16pt, ptr); - break; } - - case DD_3D_POINT: { - /* neither Colour nor Normal specified */ - /* take this out to prevent overwrite of valid facet colortype - *rcolourType = 0; - */ - *rvertexMask = 0; - PACK_LISTOF_STRUCT( pVertexList->numPoints, ddCoord3D, - pVertexList->pts.p3Dpt, ptr); - break; } - } - - *rptr = ptr; - if (DD_IsVertEdge(point_type)) *rvertexMask |= PEXGAEdges; -} - - -OC_INQ_FUNC_HEADER(ColourOC) -{ - pexMarkerColour *pColour; - miColourStruct *ddColour; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pColour, pexMarkerColour, ddColour, miColourStruct); - ptr = (ddPointer)&(pColour->colourSpec); - PACK_CARD16(ddColour->colourType, ptr); - SKIP_PADDING(ptr,2); - - switch (ddColour->colourType) { - case PEXIndexedColour: { - PACK_STRUCT(pexIndexedColour, ddColour->colour.pIndex, ptr); - break; } - case PEXRgbFloatColour : { - PACK_STRUCT(pexRgbFloatColour, ddColour->colour.pRgbFloat, ptr); - break; } - case PEXCieFloatColour : { - PACK_STRUCT(pexCieColour, ddColour->colour.pCie, ptr); - break; } - case PEXHsvFloatColour : { - PACK_STRUCT(pexHsvColour, ddColour->colour.pHsv, ptr); - break; } - case PEXHlsFloatColour : { - PACK_STRUCT(pexHlsColour, ddColour->colour.pHls, ptr); - break; } - case PEXRgb8Colour : { - PACK_STRUCT(pexRgb8Colour, ddColour->colour.pRgb8, ptr); - break; } - case PEXRgb16Colour : { - PACK_STRUCT(pexRgb16Colour, ddColour->colour.pRgb16, ptr); - break; } - } - - return(Success); -} - -OC_INQ_FUNC_HEADER(ColourIndexOC) -{ - miColourStruct *ddColour; - pexMarkerColourIndex *pColour; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pColour, pexMarkerColourIndex, ddColour, miColourStruct); - ptr = (ddPointer)&(pColour->index); - PACK_CARD16(ddColour->colour.pIndex->index,ptr); - - return(Success); -} - -OC_INQ_FUNC_HEADER(LightState) -{ - miLightStateStruct *ddLightState; - pexLightState *pLightState; - ddUSHORT i, *pi; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pLightState, pexLightState, ddLightState, - miLightStateStruct); - ptr = (ddPointer)(((pexElementInfo *)pLightState)+1); - PACK_CARD16(ddLightState->enableList->numObj, ptr); - PACK_CARD16(ddLightState->disableList->numObj, ptr); - - for ( i=0, pi=(ddUSHORT *)(ddLightState->enableList->pList); - ienableList->numObj; - i++, pi++ ) { - PACK_CARD16(*pi, ptr); - } - - SKIP_PADDING(ptr, ((ddLightState->enableList->numObj) %2)*sizeof(CARD16)); - - for ( i=0, pi=(ddUSHORT *)(ddLightState->disableList->pList); - idisableList->numObj; - i++, pi++ ) { - PACK_CARD16(*pi, ptr); - } - - return(Success); -} - -OC_INQ_FUNC_HEADER(MCVolume) -{ - - miMCVolume_Struct *ddMCVolume; - pexModelClipVolume *pMCVolume; - - ddHalfSpace *ddHS; - pexHalfSpace *pHS; - ddUSHORT i; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pMCVolume, pexModelClipVolume, - ddMCVolume, miMCVolume_Struct); - ptr = (ddPointer)(((pexElementInfo *)pMCVolume)+1); - PACK_CARD16(ddMCVolume->operator, ptr); - PACK_CARD16(ddMCVolume->halfspaces->numObj, ptr); - - for ( i=0, ddHS=(ddHalfSpace *)(ddMCVolume->halfspaces->pList); - i < ddMCVolume->halfspaces->numObj; i++) { - - PACK_COORD3D(&ddHS->orig_point, ptr); - PACK_VECTOR3D(&ddHS->orig_vector, ptr); - ddHS++; - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(MCVolume2D) -{ - - miMCVolume_Struct *ddMCVolume2D; - pexModelClipVolume2D *pMCVolume2D; - - ddHalfSpace *ddHS; - pexHalfSpace2D *pHS; - int i; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pMCVolume2D, pexModelClipVolume2D, - ddMCVolume2D, miMCVolume_Struct) - ptr = (ddPointer)(((pexElementInfo *)pMCVolume2D)+1); - PACK_CARD16(ddMCVolume2D->operator, ptr); - PACK_CARD16(ddMCVolume2D->halfspaces->numObj, ptr); - - for (i=0, ddHS=(ddHalfSpace *)(ddMCVolume2D->halfspaces->pList), - pHS = (pexHalfSpace2D *)(ptr); - i < ddMCVolume2D->halfspaces->numObj; i++) { - - PACK_COORD2D(&(ddHS->orig_point), ptr); - PACK_VECTOR2D(&(ddHS->orig_vector), ptr); - ddHS++; - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Marker) -{ - miMarkerStruct *ddMarker; - pexMarker *pMarker; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pMarker, pexMarker, ddMarker, miListHeader); - ptr = (ddPointer)(pMarker + 1); - PACK_LISTOF_COORD3D( ddMarker->ddList->numPoints, - ddMarker->ddList->pts.p3Dpt, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Marker2D) -{ - miMarkerStruct *ddMarker; - pexMarker2D *pMarker; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pMarker, pexMarker2D, ddMarker, miListHeader); - ptr = (ddPointer)(pMarker + 1); - PACK_LISTOF_COORD2D( ddMarker->ddList->numPoints, - ddMarker->ddList->pts.p2Dpt, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Text) -{ - miTextStruct *ddText; - pexText *pText; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pText, pexText, ddText, miTextStruct); - ptr = (ddPointer)(((pexElementInfo *)pText)+1); - PACK_COORD3D( ddText->pOrigin, ptr); - PACK_COORD3D( ddText->pDirections, ptr); - PACK_COORD3D( (ddText->pDirections) + 1, ptr); - PACK_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - memcpy( (char *)ptr, (char *)(ddText->pText), - (int)( sizeof(CARD32) * pText->head.length - - sizeof(pexText))); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Text2D) -{ - miText2DStruct *ddText; - pexText2D *pText; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pText, pexText2D, ddText, miText2DStruct); - ptr = (ddPointer)(((pexElementInfo *)pText)+1); - PACK_COORD2D( ddText->pOrigin, ptr); - PACK_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - memcpy( (char *)ptr, (char *)(ddText->pText), - (int)( sizeof(CARD32) * pText->head.length - - sizeof(pexText2D))); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(AnnotationText) -{ - miAnnoTextStruct *ddText; - pexAnnotationText *pText; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pText, pexAnnotationText, ddText, miAnnoTextStruct); - ptr = (ddPointer)(((pexElementInfo *)pText)+1); - PACK_COORD3D( ddText->pOrigin, ptr); - PACK_COORD3D( ddText->pOffset, ptr); - PACK_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - memcpy( (char *)ptr, (char *)(ddText->pText), - (int)( sizeof(CARD32) * pText->head.length - - sizeof(pexAnnotationText))); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(AnnotationText2D) -{ - miAnnoText2DStruct *ddText; - pexAnnotationText2D *pText; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pText, pexAnnotationText2D, ddText, miAnnoText2DStruct); - ptr = (ddPointer)(((pexElementInfo *)pText)+1); - PACK_COORD2D( ddText->pOrigin, ptr); - PACK_COORD2D( ddText->pOffset, ptr); - PACK_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - memcpy( (char *)ptr, (char *)(ddText->pText), - (int)( sizeof(CARD32) * pText->head.length - - sizeof(pexAnnotationText2D))); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Polyline2D) -{ - miPolylineStruct *ddPoly; - pexPolyline2D *pPoly; - listofddPoint *ddPoint; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pPoly, pexPolyline2D, ddPoly, miListHeader); - ptr = (ddPointer)(pPoly + 1); - ddPoint = (listofddPoint *)(ddPoly+1); - PACK_LISTOF_COORD2D(ddPoint->numPoints,ddPoint->pts.p2Dpt,ptr); - - return(Success); -} - - - -OC_INQ_FUNC_HEADER(Polyline) -{ - miPolylineStruct *ddPoly; - pexPolyline *pPoly; - listofddPoint *ddPoint; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pPoly, pexPolyline, ddPoly, miListHeader); - ptr = (ddPointer)(pPoly + 1); - ddPoint = (listofddPoint *)(ddPoly+1); - PACK_LISTOF_COORD3D(ddPoint->numPoints,ddPoint->pts.p3Dpt,ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(PolylineSet) -{ - miPolylineStruct *ddPoly; - pexPolylineSet *pPoly; - listofddPoint *ddPoint; - ddUSHORT i; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pPoly, pexPolylineSet, ddPoly, miListHeader); - ptr = (ddPointer)(pPoly + 1); - - for (i=0, ddPoint = (listofddPoint *)(ddPoly+1); - inumLists; - i++, ddPoint++) { - - PACK_CARD32(ddPoint->numPoints, ptr); - InqVertexData( ddPoint, ddPoly->type, ptr, &(pPoly->colourType), - &(pPoly->vertexAttribs), &rptr); - ptr = rptr; - } - - pPoly->numLists = ddPoly->numLists; - return(Success); -} - - -OC_INQ_FUNC_HEADER(NurbCurve) -{ - miNurbStruct *ddNurb; - pexNurbCurve *pNurb; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pNurb, pexNurbCurve, ddNurb, miNurbStruct); - ptr = (ddPointer)(((pexElementInfo *)pNurb)+1); - PACK_CARD16(ddNurb->order, ptr); - SKIP_PADDING(ptr, 2); /* type place holder (see below) */ - PACK_FLOAT(ddNurb->uMin, ptr); - PACK_FLOAT(ddNurb->uMax, ptr); - PACK_CARD32(ddNurb->numKnots, ptr); - PACK_CARD32(ddNurb->points.ddList->numPoints, ptr); - - PACK_LISTOF_STRUCT( ddNurb->numKnots, PEXFLOAT, ddNurb->pKnots, ptr); - - if (ddNurb->points.type == DDPT_4D) { - pNurb->coordType = PEXRational; - PACK_LISTOF_STRUCT( ddNurb->points.ddList->numPoints, ddCoord4D, - ddNurb->points.ddList->pts.p4Dpt, ptr); - } else { - pNurb->coordType = PEXNonRational; - PACK_LISTOF_STRUCT( ddNurb->points.ddList->numPoints, ddCoord3D, - ddNurb->points.ddList->pts.p3Dpt, ptr); - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(FillArea2D) -{ - miFillAreaStruct *ddFill; - pexFillArea2D *pFill; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexFillArea2D, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - SKIP_PADDING(ptr, 1); - - PACK_LISTOF_COORD2D( ddFill->points.ddList->numPoints, - ddFill->points.ddList->pts.p2Dpt,ptr); - - return(Success); -} - - - - -OC_INQ_FUNC_HEADER(FillArea) -{ - miFillAreaStruct *ddFill; - pexFillArea *pFill; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexFillArea, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - SKIP_PADDING(ptr, 1); - - PACK_LISTOF_COORD3D( ddFill->points.ddList->numPoints, - ddFill->points.ddList->pts.p3Dpt, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(ExtFillArea) -{ - miFillAreaStruct *ddFill; - pexExtFillArea *pFill; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexExtFillArea, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - - ptr = (ddPointer)(pFill+1); - PACK_CARD32(ddFill->points.ddList->numPoints, ptr); - InqFacetOptData( ddFill->pFacets, ptr, &(pFill->colourType), - &(pFill->facetAttribs), &rptr); - ptr = rptr; - - InqVertexData( ddFill->points.ddList, ddFill->points.type, ptr, - &(pFill->colourType), &(pFill->vertexAttribs), &rptr); - ptr = rptr; - - return(Success); -} - - -OC_INQ_FUNC_HEADER(FillAreaSet2D) -{ - miFillAreaStruct *ddFill; - pexFillAreaSet2D *pFill; - ddULONG i; - listofddPoint *ddPoint; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexFillAreaSet2D, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - PACK_CARD8(ddFill->contourHint, ptr); - - PACK_CARD32(ddFill->points.numLists, ptr); - - for (i=0, ddPoint = ddFill->points.ddList; - ipoints.numLists; - i++, ddPoint++) { - - PACK_CARD32(ddPoint->numPoints, ptr); - PACK_LISTOF_STRUCT( ddPoint->numPoints, ddCoord2D, - ddPoint->pts.p2Dpt, ptr); - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(FillAreaSet) -{ - miFillAreaStruct *ddFill; - pexFillAreaSet *pFill; - ddULONG i; - listofddPoint *ddPoint; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexFillAreaSet, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - PACK_CARD8(ddFill->contourHint, ptr); - - PACK_CARD32(ddFill->points.numLists, ptr); - - for (i=0, ddPoint = ddFill->points.ddList; - ipoints.numLists; - i++, ddPoint++) { - - PACK_CARD32( ddPoint->numPoints, ptr); - PACK_LISTOF_STRUCT( ddPoint->numPoints, ddCoord3D, - ddPoint->pts.p3Dpt, ptr); - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(ExtFillAreaSet) -{ - miFillAreaStruct *ddFill; - pexExtFillAreaSet *pFill; - ddULONG i; - listofddPoint *ddPoint; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pFill, pexExtFillAreaSet, ddFill, miFillAreaStruct); - ptr = (ddPointer)(((pexElementInfo *)pFill)+1); - PACK_CARD16(ddFill->shape, ptr); - PACK_CARD8(ddFill->ignoreEdges, ptr); - PACK_CARD8(ddFill->contourHint, ptr); - pFill->numLists = ddFill->points.numLists; - ptr = (ddPointer)(pFill+1); - - InqFacetOptData( ddFill->pFacets, ptr, &(pFill->colourType), - &(pFill->facetAttribs), &rptr); - ptr = rptr; - - for (i=0, ddPoint = ddFill->points.ddList; - ipoints.numLists; - i++, ddPoint++) { - - PACK_CARD32( ddPoint->numPoints, ptr); - InqVertexData( ddPoint, ddFill->points.type, ptr, &(pFill->colourType), - &(pFill->vertexAttribs), &rptr); - ptr = rptr; - } - - return(Success); -} - - -OC_INQ_FUNC_HEADER(SOFAS) -{ - miSOFASStruct *ddFill; - pexSOFAS *pFill; - CARD16 i,j; - miConnListList *pCLL; - miConnList *pCList; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pFill, pexSOFAS, ddFill, miSOFASStruct); - pFill->shape = ddFill->shape; - pFill->edgeAttributes = ddFill->edgeAttribs; - pFill->contourHint = ddFill->contourHint; - pFill->contourCountsFlag = ddFill->contourCountsFlag; - pFill->numFAS = ddFill->numFAS; - pFill->numVertices = ddFill->points.ddList->numPoints; - pFill->numEdges = ddFill->numEdges; - pFill->numContours = ddFill->connects.numListLists; - - ptr = (ddPointer)(pFill+1); - InqFacetOptData( &(ddFill->pFacets), ptr, &(pFill->colourType), - &(pFill->FAS_Attributes), &rptr); - ptr = rptr; - - InqVertexData( ddFill->points.ddList, ddFill->points.type, ptr, - &(pFill->colourType), &(pFill->vertexAttributes), &rptr); - ptr = rptr; - - if (pFill->edgeAttributes) { - PACK_LISTOF_STRUCT(ddFill->numEdges, ddUCHAR, ddFill->edgeData, ptr); - SKIP_PADDING(ptr,((((int)((pFill->numEdges + 3)/4))*4))); - } - - for (i=0, pCLL = ddFill->connects.data; inumContours; i++, pCLL++) { - PACK_CARD16(pCLL->numLists,ptr); - for (j=0, pCList=pCLL->pConnLists; jnumLists; j++, pCList++) { - PACK_CARD16(pCList->numLists,ptr); - PACK_LISTOF_STRUCT( pCList->numLists, ddUSHORT, - pCList->pConnects, ptr); - } - } - - return(Success); -} - - - -OC_INQ_FUNC_HEADER(TriangleStrip) -{ - miTriangleStripStruct *ddTriangle; - pexTriangleStrip *pTriangle; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pTriangle, pexTriangleStrip, ddTriangle, - miTriangleStripStruct); - pTriangle->numVertices = ddTriangle->points.ddList->numPoints; - ptr = (ddPointer)(pTriangle +1); - - InqFacetOptData( ddTriangle->pFacets, ptr, &(pTriangle->colourType), - &(pTriangle->facetAttribs), &rptr); - ptr = rptr; - - InqVertexData( ddTriangle->points.ddList, ddTriangle->points.type, ptr, - &(pTriangle->colourType), &(pTriangle->vertexAttribs), - &rptr); - ptr = rptr; - - return(Success); -} - - -OC_INQ_FUNC_HEADER(QuadrilateralMesh) -{ - miQuadMeshStruct *ddQuad; - pexQuadrilateralMesh *pQuad; - ddPointer rptr = 0; - COPY_PTR(ptr); - - GET_INQ_STORAGE(pQuad, pexQuadrilateralMesh, ddQuad, miQuadMeshStruct); - pQuad->mPts = ddQuad->mPts; - pQuad->nPts = ddQuad->nPts; - pQuad->shape = ddQuad->shape; - ptr = (ddPointer)(pQuad+1); - - InqFacetOptData( ddQuad->pFacets, ptr, &(pQuad->colourType), - &(pQuad->facetAttribs), &rptr); - ptr = rptr; - - InqVertexData( ddQuad->points.ddList, ddQuad->points.type, ptr, - &(pQuad->colourType), &(pQuad->vertexAttribs), &rptr); - ptr = rptr; - - return(Success); -} - - -OC_INQ_FUNC_HEADER(NurbSurface) -{ - miNurbSurfaceStruct *ddNurb; - pexNurbSurface *pNurb; - ddULONG i, j; - listofTrimCurve *ddTrim; - ddTrimCurve *ddTC; - ddUSHORT type; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pNurb, pexNurbSurface, ddNurb, miNurbSurfaceStruct); - ptr = (ddPointer)(((pexElementInfo *)pNurb)+1); - - SKIP_PADDING(ptr, 2); /* type place holder (see below) */ - PACK_CARD16(ddNurb->uOrder, ptr); - PACK_CARD16(ddNurb->vOrder, ptr); - SKIP_PADDING(ptr, 2); - PACK_CARD32(ddNurb->numUknots, ptr); - PACK_CARD32(ddNurb->numVknots, ptr); - PACK_CARD16(ddNurb->mPts, ptr); - PACK_CARD16(ddNurb->nPts, ptr); - PACK_CARD32(ddNurb->numTrimCurveLists, ptr); - - PACK_LISTOF_STRUCT(ddNurb->numUknots, PEXFLOAT, ddNurb->pUknots, ptr); - PACK_LISTOF_STRUCT(ddNurb->numVknots, PEXFLOAT, ddNurb->pVknots, ptr); - - i = ddNurb->mPts * ddNurb->nPts; - if (ddNurb->points.type == DD_HOMOGENOUS_POINT) { - pNurb->type = PEXRational; - PACK_LISTOF_STRUCT(i, ddCoord4D, ddNurb->points.ddList->pts.p4Dpt, ptr); - } else { - pNurb->type = PEXNonRational; - PACK_LISTOF_STRUCT(i, ddCoord3D, ddNurb->points.ddList->pts.p3Dpt, ptr); - } - - for (i=0, ddTrim = ddNurb->trimCurves; - inumTrimCurveLists; - i++, ddTrim++) { - - PACK_CARD32(ddTrim->count, ptr); - for (j=0, ddTC=ddTrim->pTC; jcount; j++, ddTC++) { - PACK_CARD8(ddTC->visibility, ptr); - SKIP_PADDING(ptr, 1); - PACK_CARD16(ddTC->order, ptr); - type = (ddTC->pttype = DD_3D_POINT) ? PEXRational : PEXNonRational; - PACK_CARD16(type, ptr); - PACK_INT16(ddTC->curveApprox.approxMethod, ptr); - PACK_FLOAT(ddTC->curveApprox.tolerance, ptr); - PACK_FLOAT(ddTC->uMin, ptr); - PACK_FLOAT(ddTC->uMax, ptr); - PACK_CARD32(ddTC->numKnots, ptr); - PACK_CARD32(ddTC->points.numPoints, ptr); - PACK_LISTOF_STRUCT(ddTC->numKnots,PEXFLOAT,ddTC->pKnots, ptr); - if (ddTC->pttype == DD_3D_POINT) { - PACK_LISTOF_STRUCT( ddTC->points.numPoints, ddCoord4D, - ddTC->points.pts.p4Dpt, ptr); - } else { - PACK_LISTOF_STRUCT( ddTC->points.numPoints, ddCoord3D, - ddTC->points.pts.p3Dpt, ptr); - } - - } - } - - return(Success); - -} - - -OC_INQ_FUNC_HEADER(CellArray2D) -{ - miCellArrayStruct *ddCell; - pexCellArray2D *pCell; - int i=2; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pCell, pexCellArray2D, ddCell, miCellArrayStruct); - ptr = (ddPointer)&(pCell->point1); - - PACK_LISTOF_COORD2D(i, ddCell->point.ddList->pts.p2Dpt, ptr); - - PACK_CARD32(ddCell->dx, ptr); - PACK_CARD32(ddCell->dy, ptr); - i = ddCell->dx * ddCell->dy; - PACK_LISTOF_STRUCT(i, ddIndexedColour, ddCell->colours.colour.pIndex, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(CellArray) -{ - miCellArrayStruct *ddCell; - pexCellArray *pCell; - int i=3; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pCell, pexCellArray, ddCell, miCellArrayStruct); - ptr = (ddPointer)&(pCell->point1); - - PACK_LISTOF_COORD3D(i, ddCell->point.ddList->pts.p3Dpt, ptr); - - PACK_CARD32(ddCell->dx, ptr); - PACK_CARD32(ddCell->dy, ptr); - i = ddCell->dx * ddCell->dy; - PACK_LISTOF_STRUCT(i, ddIndexedColour, ddCell->colours.colour.pIndex, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(ExtCellArray) -{ - miCellArrayStruct *ddCell; - pexExtCellArray *pCell; - int i=3; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pCell, pexExtCellArray, ddCell, miCellArrayStruct); - ptr = (ddPointer)&(pCell->colourType); - - PACK_CARD16(ddCell->colours.colourType, ptr); - SKIP_PADDING(ptr, 2); - - PACK_LISTOF_COORD3D(i, ddCell->point.ddList->pts.p3Dpt, ptr); - PACK_CARD32(ddCell->dx, ptr); - PACK_CARD32(ddCell->dy, ptr); - i = ddCell->dx * ddCell->dy; - - switch (pCell->colourType) { - case PEXIndexedColour: { - PACK_LISTOF_STRUCT( i, ddIndexedColour, - ddCell->colours.colour.pIndex, ptr); - break; } - case PEXRgbFloatColour : { - PACK_LISTOF_STRUCT( i, ddRgbFloatColour, - ddCell->colours.colour.pRgbFloat, ptr); - break; } - case PEXCieFloatColour : { - PACK_LISTOF_STRUCT( i, ddCieColour, - ddCell->colours.colour.pCie, ptr); - break; } - case PEXHsvFloatColour : { - PACK_LISTOF_STRUCT( i, ddHsvColour, - ddCell->colours.colour.pHsv, ptr); - break; } - case PEXHlsFloatColour : { - PACK_LISTOF_STRUCT( i, ddHlsColour, - ddCell->colours.colour.pHls, ptr); - break; } - case PEXRgb8Colour : { - PACK_LISTOF_STRUCT( i, ddRgb8Colour, - ddCell->colours.colour.pRgb8, ptr); - break; } - case PEXRgb16Colour : { - PACK_LISTOF_STRUCT( i, ddRgb16Colour, - ddCell->colours.colour.pRgb16, ptr); - break; } - } - - return(Success); - -} - - -OC_INQ_FUNC_HEADER(PSurfaceChars) -{ - miPSurfaceCharsStruct *ddPSC = (miPSurfaceCharsStruct *)(pExecuteOC+1); - pexParaSurfCharacteristics *pPSC; - COPY_PTR(ptr); - - switch (ddPSC->type) { - case PEXPSCNone: - case PEXPSCImpDep: - GET_INQ_STORAGE( pPSC, pexParaSurfCharacteristics, ddPSC, - miPSurfaceCharsStruct); - ptr = (ddPointer)(pPSC+1); - break; - - case PEXPSCIsoCurves: { - GET_INQ_STORAGE( pPSC, pexParaSurfCharacteristics, ddPSC, - miPSurfaceCharsStruct); - pPSC->characteristics = ddPSC->type; - pPSC->length = 4 * sizeof(CARD16); - ptr = (ddPointer)(pPSC+1); - PACK_CARD16(ddPSC->data.pIsoCurves->placementType, ptr); - SKIP_PADDING(ptr,2); - PACK_CARD16(ddPSC->data.pIsoCurves->numUcurves, ptr); - PACK_CARD16(ddPSC->data.pIsoCurves->numVcurves, ptr); - break; - } - - case PEXPSCMcLevelCurves: { - GET_INQ_STORAGE( pPSC, pexParaSurfCharacteristics, ddPSC, - miPSurfaceCharsStruct); - pPSC->characteristics = ddPSC->type; - pPSC->length = sizeof(pexCoord3D) + sizeof(pexVector3D) + - (2 *sizeof(CARD16)) + (sizeof(PEXFLOAT)* - ddPSC->data.pMcLevelCurves->numberIntersections); - ptr = (ddPointer)(pPSC+1); - PACK_STRUCT(pexCoord3D, &(ddPSC->data.pMcLevelCurves->origin),ptr); - PACK_STRUCT(pexVector3D, &(ddPSC->data.pMcLevelCurves->direction),ptr); - PACK_CARD16(ddPSC->data.pMcLevelCurves->numberIntersections, ptr); - SKIP_PADDING(ptr,2); - PACK_LISTOF_STRUCT(ddPSC->data.pMcLevelCurves->numberIntersections, - PEXFLOAT, ddPSC->data.pMcLevelCurves->pPoints, - ptr); - break; - } - - case PEXPSCWcLevelCurves: { - GET_INQ_STORAGE( pPSC, pexParaSurfCharacteristics, ddPSC, - miPSurfaceCharsStruct); - pPSC->characteristics = ddPSC->type; - pPSC->length = sizeof(pexCoord3D) + sizeof(pexVector3D) + - (2 *sizeof(CARD16)) + (sizeof(PEXFLOAT)* - ddPSC->data.pWcLevelCurves->numberIntersections); - ptr = (ddPointer)(pPSC+1); - PACK_STRUCT(pexCoord3D, &(ddPSC->data.pWcLevelCurves->origin),ptr); - PACK_STRUCT(pexVector3D, &(ddPSC->data.pWcLevelCurves->direction),ptr); - PACK_CARD16(ddPSC->data.pWcLevelCurves->numberIntersections, ptr); - SKIP_PADDING(ptr,2); - PACK_LISTOF_STRUCT(ddPSC->data.pWcLevelCurves->numberIntersections, - PEXFLOAT, ddPSC->data.pWcLevelCurves->pPoints, - ptr); - break; - } - } - - pPSC->characteristics = ddPSC->type; - pPSC->length=(CARD16)((*ppPEXOC)->length-sizeof(pexParaSurfCharacteristics)); - return(Success); -} - - - - -OC_INQ_FUNC_HEADER(Gdp2D) -{ - miGdpStruct *ddGdp; - pexGdp2D *pGdp; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pGdp, pexGdp2D, ddGdp, miGdpStruct); - pGdp->gdpId = ddGdp->GDPid; - pGdp->numPoints = ddGdp->points.ddList->numPoints; - pGdp->numBytes = ddGdp->numBytes; - ptr = (ddPointer)(pGdp + 1); - PACK_LISTOF_COORD2D( ddGdp->points.ddList->numPoints, - ddGdp->points.ddList->pts.p2Dpt, ptr); - PACK_LISTOF_STRUCT( ddGdp->numBytes, ddUCHAR, ddGdp->pData, ptr); - - return(Success); -} - - -OC_INQ_FUNC_HEADER(Gdp) -{ - miGdpStruct *ddGdp; - pexGdp *pGdp; - COPY_PTR(ptr); - - GET_INQ_STORAGE( pGdp, pexGdp, ddGdp, miGdpStruct); - pGdp->gdpId = ddGdp->GDPid; - pGdp->numPoints = ddGdp->points.ddList->numPoints; - pGdp->numBytes = ddGdp->numBytes; - ptr = (ddPointer)(pGdp + 1); - PACK_LISTOF_COORD3D( ddGdp->points.ddList->numPoints, - ddGdp->points.ddList->pts.p3Dpt, ptr); - PACK_LISTOF_STRUCT( ddGdp->numBytes, ddUCHAR, ddGdp->pData, ptr); - - return(Success); - -} - - - -OC_INQ_FUNC_HEADER(SetAttribute) -{ - /** The function vector should be set up to have this - ** SetAttribute function as the entry for all of the OC entries other - ** than those listed above or those NULL'd out - **/ - - ddElementInfo *dstAttrib, *srcAttrib; - - GET_INQ_STORAGE( dstAttrib, ddElementInfo, srcAttrib, ddElementInfo); - - memcpy( (char *)dstAttrib, (char *)srcAttrib, - (int)(srcAttrib->length * sizeof(CARD32))); - - return(Success); -} - -OC_INQ_FUNC_HEADER(PropOC) -{ - /** The function Handles Proprietary Vendor OCs - **/ - - ddElementInfo *dstPropOC, *srcPropOC; - - GET_INQ_STORAGE( dstPropOC, ddElementInfo, srcPropOC, ddElementInfo); - - memcpy( (char *)dstPropOC, (char *)srcPropOC, - (int)(srcPropOC->length * sizeof(CARD32))); - - return(Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c:1.9 Fri Dec 14 14:57:28 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c Sat Feb 28 21:41:54 2004 @@ -1,609 +0,0 @@ -/* $Xorg: miLight.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miLight.c,v 1.9 2001/12/14 19:57:28 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miLight.h" -#include "pexos.h" - - -extern ddpex3rtn InquireLUTEntryAddress(); -ddpex3rtn ComputeWCEyePosition(); - -/*++ - | - | Apply_Lighting(pRend, pddc, input_vert, output_fct) - | - | Create a facet list for the fill area defined by the - | specified vertex list. - | - | NOTE: This routine does not use back-facing lighting parameters. - | Furthermore, it assumes that the input lights are - | specified in rgb. - | - --*/ -ddpex3rtn -miApply_Lighting(pRend, pddc, point, mat_color, normal, out_color) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; - ddCoord4D *point; - ddRgbFloatColour *mat_color; - ddVector3D *normal; - ddRgbFloatColour *out_color; -{ -/* calls */ -#ifndef XFree86LOADER - double pow(); -#endif - -/* uses */ - listofObj *light_sources = pddc->Dynamic->pPCAttr->lightState; - ddUSHORT *index = (ddUSHORT *)light_sources->pList; - miLightEntry *pLUT; - ddLightEntry *lightentry; - ddUSHORT status; - ddFLOAT n_dot_l, v_dot_r, d_dot_l; - ddFLOAT distance; - ddFLOAT atten; - ddVector3D view_vec, refl_vec, light_vec; - int j; - - - /* some quick bounds checking */ - if (light_sources->numObj <= 0) { - *out_color = *mat_color; - return(Success); - } - - out_color->red = out_color->green = out_color->blue = 0.0; - - for (j = 0; j < light_sources->numObj; j++) { - /* Fetch light source data from LUT */ - if ((InquireLUTEntryAddress (PEXLightLUT, - pRend->lut[PEXLightLUT], *index, - &status, (ddPointer *)(&pLUT))) - == PEXLookupTableError) - return (PEXLookupTableError); - - lightentry = &pLUT->entry; - - /* - * Insure that light color is same model as the current - * rendering model. - */ - if (lightentry->lightColour.colourType) {} - - /* The shading equations are different for each light type */ - switch(lightentry->lightType) { - - case PEXLightAmbient: - /* - * An ambient light simply adds a constant background - * color term to all the facets in a scene. - */ - out_color->red += - pddc->Static.attrs->reflAttr.ambient * - (lightentry->lightColour.colour.rgbFloat.red * - mat_color->red); - out_color->green += - pddc->Static.attrs->reflAttr.ambient * - (lightentry->lightColour.colour.rgbFloat.green* - mat_color->green); - out_color->blue += - pddc->Static.attrs->reflAttr.ambient * - (lightentry->lightColour.colour.rgbFloat.blue * - mat_color->blue); - break; - - case PEXLightWcsVector: - /* - * A directional light source is located at an - * infinite distance from the object along - * the specified direction. - */ - n_dot_l = 0.0; - - /* compute reflect view vector */ - DOT_PRODUCT(&lightentry->direction, normal, n_dot_l); - /* negate because light vector should point towards light */ - n_dot_l = -n_dot_l; - if (n_dot_l <= 0.0) break; - - switch(pddc->Static.attrs->reflModel) { - /* - * Note that the total light source contribution - * is the sum of the specular, diffuse and ambient - * contributions. - */ - case PEXReflectionSpecular: - - CALCULATE_REFLECTION_VECTOR(&refl_vec, -n_dot_l, - normal, - &lightentry->direction); - refl_vec.x *= -1.0; - refl_vec.y *= -1.0; - refl_vec.z *= -1.0; - NORMALIZE_VECTOR (&refl_vec, v_dot_r); - - /* - * Insure eye point is correct for view vector - * calculation. As eye_point is computed from - * the inverse view matrix, this matrix must - * be valid for eye point to be correct. - */ - if (pddc->Static.misc.flags & INVVIEWXFRMFLAG) - ComputeWCEyePosition(pRend, pddc); - - if (NEAR_ZERO(pddc->Static.misc.eye_pt.w)) { - /* - * if the homogeneous component of the eye - * position is near zero after the inverse - * transform from NPC space, it indicates that - * the view transform is an orthographic, as oppposed - * to perspective transformation and that the eye - * point thus represents a vector rather than a point - */ - view_vec.x = pddc->Static.misc.eye_pt.x; - view_vec.y = pddc->Static.misc.eye_pt.y; - view_vec.z = pddc->Static.misc.eye_pt.z; - } else { - /* - * Compute the view vector. - */ - CALCULATE_DIRECTION_VECTOR(&pddc->Static.misc.eye_pt, - point, - &view_vec); - NORMALIZE_VECTOR (&view_vec, v_dot_r); - } - - DOT_PRODUCT(&refl_vec, &view_vec, v_dot_r); - if (v_dot_r > 0.0) - { - v_dot_r = pow(v_dot_r, - pddc->Static.attrs->reflAttr.specularConc); - out_color->red += - v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.red * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.red); - out_color->green += - v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.green * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.green); - out_color->blue += - v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.blue * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.blue); - } - - case PEXReflectionDiffuse: - - out_color->red += n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.red * - mat_color->red); - out_color->green += n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.green * - mat_color->green); - out_color->blue += n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.blue * - mat_color->blue); - - case PEXReflectionAmbient: - /* No ambient contribution except from ambient lights */ - - break; - } - break; - - case PEXLightWcsPoint: - /* - * A point light source is a radiating point source - * located at the specified position. - */ - n_dot_l = 0.0; - /* - * Note that the total light source contribution - * is the sum if the specular, diffuse and ambient - * contributions. - */ - - CALCULATE_DIRECTION_VECTOR(&lightentry->point, - point, - &light_vec); - NORMALIZE_VECTOR (&light_vec, distance); - - /* compute reflect view vector */ - DOT_PRODUCT(&light_vec, normal, n_dot_l); - if (n_dot_l <= 0.0) break; - - /* Compute light attenuation */ - atten = 1.0/(lightentry->attenuation1 + - (lightentry->attenuation2 * distance)); - - switch(pddc->Static.attrs->reflModel) { - - case PEXReflectionSpecular: - - CALCULATE_REFLECTION_VECTOR(&refl_vec, n_dot_l, - normal, - &light_vec); - NORMALIZE_VECTOR (&refl_vec, v_dot_r); - - /* - * Insure eye point is correct for view vector - * calculation. As eye_point is computed from - * the inverse view matrix, this matrix must - * be valid for eye point to be correct. - */ - if (pddc->Static.misc.flags & INVVIEWXFRMFLAG) - ComputeWCEyePosition(pRend, pddc); - - if (NEAR_ZERO(pddc->Static.misc.eye_pt.w)) { - /* - * if the homogeneous component of the eye - * position is near zero after the inverse - * transform from NPC space, it indicates that - * the view transform is an orthographic, as oppposed - * to perspective transformation and that the eye - * point thus represents a vector rather than a point - */ - view_vec.x = pddc->Static.misc.eye_pt.x; - view_vec.y = pddc->Static.misc.eye_pt.y; - view_vec.z = pddc->Static.misc.eye_pt.z; - } else { - /* - * Compute the view vector. - */ - CALCULATE_DIRECTION_VECTOR(&pddc->Static.misc.eye_pt, - point, - &view_vec); - NORMALIZE_VECTOR (&view_vec, v_dot_r); - } - - DOT_PRODUCT(&refl_vec, &view_vec, v_dot_r); - if (v_dot_r > 0.0) - { - v_dot_r = pow(v_dot_r, - pddc->Static.attrs->reflAttr.specularConc); - out_color->red += - atten * v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.red * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.red); - out_color->green += - atten * v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.green * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.green); - out_color->blue += - atten * v_dot_r * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.blue * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.blue); - } - - case PEXReflectionDiffuse: - - out_color->red += atten * n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.red * - mat_color->red); - out_color->green += atten * n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.green * - mat_color->green); - out_color->blue += atten * n_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.blue * - mat_color->blue); - - case PEXReflectionAmbient: - /* No ambient contribution except from ambient lights */ - break; - } - break; - - case PEXLightWcsSpot: - /* - * A spot light source is a radiating point source - * output whose output is limited by a cone of specified - * direction and angle. - */ - n_dot_l = 0.0; - /* - * Note that the total light source contribution - * is the sum if the specular, diffuse and ambient - * contributions. - */ - - CALCULATE_DIRECTION_VECTOR(&lightentry->point, - point, - &light_vec); - NORMALIZE_VECTOR (&light_vec, distance); - - /* Check that object is within spot angle. */ - DOT_PRODUCT(&lightentry->direction, &light_vec, d_dot_l); - /* Negate because light vec should point other way for this test */ - d_dot_l = -d_dot_l; - if (d_dot_l <= pLUT->cosSpreadAngle) break; - d_dot_l = pow(d_dot_l, lightentry->concentration); - - /* compute reflect view vector */ - DOT_PRODUCT(&light_vec, normal, n_dot_l); - if (n_dot_l <= 0.0) break; - - /* Compute light attenuation */ - atten = 1.0/(lightentry->attenuation1 + - (lightentry->attenuation2 * distance)); - - switch(pddc->Static.attrs->reflModel) { - - case PEXReflectionSpecular: - - CALCULATE_REFLECTION_VECTOR(&refl_vec, n_dot_l, - normal, - &light_vec); - NORMALIZE_VECTOR (&refl_vec, v_dot_r); - - /* - * Insure eye point is correct for view vector - * calculation. As eye_point is computed from - * the inverse view matrix, this matrix must - * be valid for eye point to be correct. - */ - if (pddc->Static.misc.flags & INVVIEWXFRMFLAG) - ComputeWCEyePosition(pRend, pddc); - - if (NEAR_ZERO(pddc->Static.misc.eye_pt.w)) { - /* - * if the homogeneous component of the eye - * position is near zero after the inverse - * transform from NPC space, it indicates that - * the view transform is an orthographic, as oppposed - * to perspective transformation and that the eye - * point thus represents a vector rather than a point - */ - view_vec.x = pddc->Static.misc.eye_pt.x; - view_vec.y = pddc->Static.misc.eye_pt.y; - view_vec.z = pddc->Static.misc.eye_pt.z; - } else { - /* - * Compute the view vector. - */ - CALCULATE_DIRECTION_VECTOR(&pddc->Static.misc.eye_pt, - point, - &view_vec); - NORMALIZE_VECTOR (&view_vec, v_dot_r); - } - - DOT_PRODUCT(&refl_vec, &view_vec, v_dot_r); - if (v_dot_r > 0.0) - { - v_dot_r = pow(v_dot_r, - pddc->Static.attrs->reflAttr.specularConc); - out_color->red += - atten * v_dot_r * d_dot_l * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.red * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.red); - out_color->green += - atten * v_dot_r * d_dot_l * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.green * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.green); - out_color->blue += - atten * v_dot_r * d_dot_l * - pddc->Static.attrs->reflAttr.specular * - (lightentry->lightColour.colour.rgbFloat.blue * - pddc->Static.attrs->reflAttr.specularColour.colour.rgbFloat.blue); - } - - case PEXReflectionDiffuse: - - out_color->red += atten * n_dot_l * d_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.red * - mat_color->red); - out_color->green += atten * n_dot_l * d_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.green * - mat_color->green); - out_color->blue += atten * n_dot_l * d_dot_l * - pddc->Static.attrs->reflAttr.diffuse * - (lightentry->lightColour.colour.rgbFloat.blue * - mat_color->blue); - - case PEXReflectionAmbient: - /* No ambient contribution except from ambient lights */ - break; - } - } - index++; /* skip to next light source index in list */ - - } - - return(Success); -} - -/*++ - | - | ComputeWCEyePosition(pRend, pddc) - | - | Compute a WC eye position from the inverse view transform. - | - --*/ -ddpex3rtn ComputeWCEyePosition(pRend, pddc) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; -{ - extern void miMatCopy(); - - /* First, update inverse view matrix */ - miViewEntry *pLUT; - ddUSHORT status; - ddCoord4D NPCEye; - ddFLOAT mag; - - /* Get the view table entry at current view index first */ - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - pddc->Dynamic->pPCAttr->viewIndex, - &status, (ddPointer *)&pLUT)) - == PEXLookupTableError) - return (PEXLookupTableError); - - - /* Compute the composite [VOM] next */ -/* - ddViewEntry *viewbundle; - viewbundle = &pLUT->entry; - miMatMult (pddc->Static.misc.inv_view_xform, - viewbundle->orientation, - viewbundle->mapping ); -*/ - - if (!pLUT->inv_flag) - { - /* compute the inverse */ - miMatCopy(pLUT->vom, pddc->Static.misc.inv_view_xform); - miMatInverse(pddc->Static.misc.inv_view_xform); - miMatCopy(pddc->Static.misc.inv_view_xform, pLUT->vom_inv); - pLUT->inv_flag = MI_TRUE; - } - else - miMatCopy(pLUT->vom_inv, pddc->Static.misc.inv_view_xform); - - /* Clear ddc status flag */ - pddc->Static.misc.flags &= ~INVVIEWXFRMFLAG; - - /* - * Multiply NPC eye point by inverse view matrix - * NPC eye point is defined as (0.0, 0.0, 1.0, 0.0) in NPC space - */ - NPCEye.x = 0.0; - NPCEye.y = 0.0; - NPCEye.z = 1.0; - NPCEye.w = 0.0; - miTransformPoint(&NPCEye, pddc->Static.misc.inv_view_xform, - &pddc->Static.misc.eye_pt); - - /* normalize the result if a eye pint is a vector in WC */ - if (NEAR_ZERO(pddc->Static.misc.eye_pt.w)) { - NORMALIZE_VECTOR (&(pddc->Static.misc.eye_pt), mag); - } -} - - -/*++ - | - | Compute_CC_Dcue(pRend, pddc) - | - | Compute a CC version of the current depth cue bundle entry - | - --*/ -ddpex3rtn Compute_CC_Dcue(pRend, pddc) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; -{ - ddpex3rtn miConvertColor(); - - ddUSHORT status; - miDepthCueEntry *dcue_entry; - ddFLOAT *matrix, cc_frontplane, cc_backplane; - - /* Check valid flag */ - if (!(pddc->Static.misc.flags & CC_DCUEVERSION)) return(Success); - - /* Get current depth cueing information */ - if ((InquireLUTEntryAddress (PEXDepthCueLUT, pRend->lut[PEXDepthCueLUT], - pddc->Dynamic->pPCAttr->depthCueIndex, - &status, (ddPointer *)&dcue_entry)) == PEXLookupTableError) - return (PEXLookupTableError); - - /* Compute cc versions of front and back planes - We assume that the transformation matrix from npc to cc is - diagonal, and only tranform the "z" portion */ - - matrix = (ddFLOAT *)(pddc->Dynamic->npc_to_cc_xform); - - /* skip to Z translate and scale terms */ - matrix += 10; - - cc_frontplane = (*matrix * dcue_entry->entry.frontPlane) + *(matrix + 1); - cc_backplane = (*matrix * dcue_entry->entry.backPlane) + *(matrix + 1); - - /* copy over relevant info */ - pddc->Static.misc.cc_dcue_entry.mode = dcue_entry->entry.mode; - pddc->Static.misc.cc_dcue_entry.frontScaling = - dcue_entry->entry.frontScaling; - pddc->Static.misc.cc_dcue_entry.backScaling = - dcue_entry->entry.backScaling; - - pddc->Static.misc.cc_dcue_entry.frontPlane = cc_frontplane; - pddc->Static.misc.cc_dcue_entry.backPlane = cc_backplane; - - /* Convert depth cue color to proper rendering model during copy */ - miConvertColor(pRend, - &dcue_entry->entry.depthCueColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.misc.cc_dcue_entry.depthCueColour); - - /* validate flag */ - pddc->Static.misc.flags &= ~CC_DCUEVERSION; - -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miLvl2Tab.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miLvl2Tab.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miLvl2Tab.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miLvl2Tab.c:1.9 Fri Dec 14 14:57:28 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miLvl2Tab.c Sat Feb 28 21:41:54 2004 @@ -1,1147 +0,0 @@ -/* $Xorg: miLvl2Tab.c,v 1.4 2001/02/09 02:04:09 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -/* Level II output command handling tables */ - -#include "mipex.h" - - -/* procedures for PickExecuteOCTable and SearchExecuteOCTable */ - -extern ddpex2rtn miTestPickGdp3d(), - miTestPickGdp2d(), - miPickAnnoText3D(), - miPickAnnoText2D(), - miPickPrimitives(), - miTestSearchGdp3d(), - miTestSearchGdp2d(), - miSearchPrimitives(); - -/* procedures for ExecuteOCTable */ - -extern ddpex2rtn miMarkerType(), - miMarkerScale(), - miMarkerColourOC(), - miMarkerBundleIndex(), - miTextFontIndex(), - miTextPrecision(), - miCharExpansion(), - miCharSpacing(), - miTextColourOC(), - miCharHeight(), - miCharUpVector(), - miTextPath(), - miTextAlignment(), - miAtextHeight(), - miAtextUpVector(), - miAtextPath(), - miAtextAlignment(), - miAtextStyle(), - miTextBundleIndex(), - miLineType(), - miLineWidth(), - miLineColourOC(), - miCurveApproximation(), - miTestSetAttribute(), - miLineBundleIndex(), - miInteriorStyle(), - miTestSetAttribute(), - miSurfaceColourOC(), - miSurfaceReflAttr(), - miSurfaceReflModel(), - miSurfaceInterp(), - miSurfaceApproximation(), - miTestSetAttribute(), - miTestColourOC(), - miCullingMode(), - miInteriorBundleIndex(), - miSurfaceEdgeFlag(), - miSurfaceEdgeType(), - miSurfaceEdgeWidth(), - miEdgeColourOC(), - miEdgeBundleIndex(), - miSetAsfValues(), - miLocalTransform(), - miLocalTransform2D(), - miGlobalTransform(), - miGlobalTransform2D(), - miModelClip(), - miSetMCVolume(), - miSetMCVolume(), - miRestoreMCV(), - miViewIndex(), - miLightStateOC(), - miPickId(), - miColourApproxIndex(), - miRenderingColourModel(), - miParaSurfCharacteristics(), - miAddToNameSet(), - miExecuteStructure(), - miNoop(), - miPolyMarker(), - miText3D(), - miText2D(), - miAnnoText3D(), - miAnnoText2D(), - miPolyLines(), - miNurbsCurve(), - miFillArea(), - miTriangleStrip(), - miQuadMesh(), - miSOFAS(), - miNurbsSurface(), - miCellArray(), - miTestExtCellArray(), - miTestGDP(), - miDepthCueIndex() ; - - -/* for now, use the old parse routines from dipex. These use the - * ocs in PEX format and convert them to the original level III - * calls and these call the execute procedure directly - */ - -extern ddpex2rtn - parseColourOC(), - parseLightState(), - parseColourIndexOC(), - parseApplicationData(), - parseGse(), - parseMarker(), - parseMarker2D(), - parseText(), - parseText2D(), - parseAnnotationText(), - parseAnnotationText2D(), - parsePolyline(), - parsePolyline2D(), - parsePolylineSet(), - parseNurbCurve(), - parseFillArea(), - parseFillArea2D(), - parseExtFillArea(), - parseFillAreaSet(), - parseFillAreaSet2D(), - parseExtFillAreaSet(), - parseTriangleStrip(), - parseQuadrilateralMesh(), - parseNurbSurface(), - parseCellArray(), - parseCellArray2D(), - parseExtCellArray(), - parseGdp(), - parseGdp2D(), - parseSetAttribute(), - parsePropOC(), - parseSOFAS(), - parsePSurfaceChars(), - parseSetMCVolume(), - parseSetMCVolume2D(); - -ocTableType ParseOCTable[] = { - parsePropOC, /* 0 dummy entry */ - parseSetAttribute, /* 1 marker type */ - parseSetAttribute, /* 2 marker scale */ - parseColourIndexOC, /* 3 marker colour index */ - parseColourOC, /* 4 marker colour */ - parseSetAttribute, /* 5 marker bundle index */ - parseSetAttribute, /* 6 text font index */ - parseSetAttribute, /* 7 text precision */ - parseSetAttribute, /* 8 character expansion */ - parseSetAttribute, /* 9 character spacing */ - parseColourIndexOC, /* 10 text colour index */ - parseColourOC, /* 11 text colour */ - parseSetAttribute, /* 12 character height */ - parseSetAttribute, /* 13 character up vector */ - parseSetAttribute, /* 14 text path */ - parseSetAttribute, /* 15 text alignment */ - parseSetAttribute, /* 16 annotation text height */ - parseSetAttribute, /* 17 annotation text up vector */ - parseSetAttribute, /* 18 annotation text path */ - parseSetAttribute, /* 19 annotation text alignment */ - parseSetAttribute, /* 20 annotation text style */ - parseSetAttribute, /* 21 text bundle index */ - parseSetAttribute, /* 22 line type */ - parseSetAttribute, /* 23 line width */ - parseColourIndexOC, /* 24 line colour index */ - parseColourOC, /* 25 line colour */ - parseSetAttribute, /* 26 curve approximation method */ - parseSetAttribute, /* 27 polyline interpolation method */ - parseSetAttribute, /* 28 line bundle index */ - parseSetAttribute, /* 29 surface interior style */ - parseSetAttribute, /* 30 surface interior style index */ - parseColourIndexOC, /* 31 surface colour index */ - parseColourOC, /* 32 surface colour */ - parseSetAttribute, /* 33 surface reflection attributes */ - parseSetAttribute, /* 34 surface reflection model */ - parseSetAttribute, /* 35 surface interpolation method */ - parseSetAttribute, /* 36 backface surface interior style */ - parseSetAttribute, /* 37 backface surface interior style index */ - parseColourIndexOC, /* 38 backface surface colour index */ - parseColourOC, /* 39 backface surface colour */ - parseSetAttribute, /* 40 backface surface reflection - * attributes */ - parseSetAttribute, /* 41 backface surface reflection model */ - parseSetAttribute, /* 42 backface surface interpolation method */ - parseSetAttribute, /* 43 surface approximation */ - parseSetAttribute, /* 44 facet culling mode */ - parseSetAttribute, /* 45 facet distinguish flag */ - parseSetAttribute, /* 46 pattern size */ - parseSetAttribute, /* 47 pattern reference point */ - parseSetAttribute, /* 48 pattern reference point and vectors */ - parseSetAttribute, /* 49 interior bundle index */ - parseSetAttribute, /* 50 surface edge flag */ - parseSetAttribute, /* 51 surface edge type */ - parseSetAttribute, /* 52 surface edge width */ - parseColourIndexOC, /* 53 surface edge colour index */ - parseColourOC, /* 54 surface edge colour */ - parseSetAttribute, /* 55 edge bundle index */ - parseSetAttribute, /* 56 set individual asf */ - parseSetAttribute, /* 57 local transform 3d */ - parseSetAttribute, /* 58 local transform 2d */ - parseSetAttribute, /* 59 global transform 3d */ - parseSetAttribute, /* 60 global transform 2d */ - parseSetAttribute, /* 61 model clip */ - parseSetMCVolume, /* 62 set model clip volume 3d */ - parseSetMCVolume2D, /* 63 set model clip volume 2d */ - parseSetAttribute, /* 64 restore model clip volume */ - parseSetAttribute, /* 65 view index */ - parseLightState, /* 66 light source state */ - parseSetAttribute, /* 67 depth cue index */ - parseSetAttribute, /* 68 pick id */ - parseSetAttribute, /* 69 hlhsr identifier */ - parseSetAttribute, /* 70 colour approx index */ - parseSetAttribute, /* 71 rendering colour model */ - parsePSurfaceChars, /* 72 parametric surface attributes */ - parseSetAttribute, /* 73 add names to name set */ - parseSetAttribute, /* 74 remove names from name set */ - parseSetAttribute, /* 75 execute structure */ - parseSetAttribute, /* 76 label */ - parseSetAttribute, /* 77 application data */ - parseSetAttribute, /* 78 gse */ - parseMarker, /* 79 marker 3d */ - parseMarker2D, /* 80 marker 2d */ - parseText, /* 81 text3d */ - parseText2D, /* 82 text2d */ - parseAnnotationText, /* 83 annotation text3d */ - parseAnnotationText2D, /* 84 annotation text2d */ - parsePolyline, /* 85 polyline3d */ - parsePolyline2D, /* 86 polyline2d */ - parsePolylineSet, /* 87 polyline set 3d with data */ - parseNurbCurve, /* 88 non-uniform b spline curve */ - parseFillArea, /* 89 fill area 3d */ - parseFillArea2D, /* 90 fill area 2d */ - parseExtFillArea, /* 91 fill area 3d with data */ - parseFillAreaSet, /* 92 fill area set 3d */ - parseFillAreaSet2D, /* 93 fill area set 2d */ - parseExtFillAreaSet, /* 94 fill area set 3d with data */ - parseTriangleStrip, /* 95 triangle strip */ - parseQuadrilateralMesh, /* 96 quadrilateral mesh */ - parseSOFAS, /* 97 set of fill area sets */ - parseNurbSurface, /* 98 non-uniform b spline surface */ - parseCellArray, /* 99 cell array 3d */ - parseCellArray2D, /* 100 cell array 2d */ - parseExtCellArray, /* 101 extended cell array 3d */ - parseGdp, /* 102 gdp 3d */ - parseGdp2D, /* 103 gdp 2d */ - parseSetAttribute /* 104 Noop */ -}; - -extern void destroyOC_PEX(), - destroyNoOp(), - destroySOFAS(), - destroyNurbSurface(); - -destroyTableType DestroyOCTable[] = { - destroyOC_PEX, /* 0 entry for proprietary OCs */ - destroyOC_PEX, /* 1 marker type */ - destroyOC_PEX, /* 2 marker scale */ - destroyOC_PEX, /* 3 marker colour index */ - destroyOC_PEX, /* 4 marker colour */ - destroyOC_PEX, /* 5 marker bundle index */ - destroyOC_PEX, /* 6 text font index */ - destroyOC_PEX, /* 7 text precision */ - destroyOC_PEX, /* 8 character expansion */ - destroyOC_PEX, /* 9 character spacing */ - destroyOC_PEX, /* 10 text colour index */ - destroyOC_PEX, /* 11 text colour */ - destroyOC_PEX, /* 12 character height */ - destroyOC_PEX, /* 13 character up vector */ - destroyOC_PEX, /* 14 text path */ - destroyOC_PEX, /* 15 text alignment */ - destroyOC_PEX, /* 16 annotation text height */ - destroyOC_PEX, /* 17 annotation text up vector */ - destroyOC_PEX, /* 18 annotation text path */ - destroyOC_PEX, /* 19 annotation text alignment */ - destroyOC_PEX, /* 20 annotation text style */ - destroyOC_PEX, /* 21 text bundle index */ - destroyOC_PEX, /* 22 line type */ - destroyOC_PEX, /* 23 line width */ - destroyOC_PEX, /* 24 line colour index */ - destroyOC_PEX, /* 25 line colour */ - destroyOC_PEX, /* 26 curve approximation method */ - destroyOC_PEX, /* 27 polyline interpolation method */ - destroyOC_PEX, /* 28 line bundle index */ - destroyOC_PEX, /* 29 surface interior style */ - destroyOC_PEX, /* 30 surface interior style index */ - destroyOC_PEX, /* 31 surface colour index */ - destroyOC_PEX, /* 32 surface colour */ - destroyOC_PEX, /* 33 surface reflection attributes */ - destroyOC_PEX, /* 34 surface reflection model */ - destroyOC_PEX, /* 35 surface interpolation method */ - destroyOC_PEX, /* 36 backface surface interior style */ - destroyOC_PEX, /* 37 backface surface interior style index */ - destroyOC_PEX, /* 38 backface surface colour index */ - destroyOC_PEX, /* 39 backface surface colour */ - destroyOC_PEX, /* 40 backface surface reflection */ - destroyOC_PEX, /* 41 backface surface reflection model */ - destroyOC_PEX, /* 42 backface surface interpolation method */ - destroyOC_PEX, /* 43 surface approximation */ - destroyOC_PEX, /* 44 facet culling mode */ - destroyOC_PEX, /* 45 facet distinguish flag */ - destroyOC_PEX, /* 46 pattern size */ - destroyOC_PEX, /* 47 pattern reference point */ - destroyOC_PEX, /* 48 pattern reference point and vectors */ - destroyOC_PEX, /* 49 interior bundle index */ - destroyOC_PEX, /* 50 surface edge flag */ - destroyOC_PEX, /* 51 surface edge type */ - destroyOC_PEX, /* 52 surface edge width */ - destroyOC_PEX, /* 53 surface edge colour index */ - destroyOC_PEX, /* 54 surface edge colour */ - destroyOC_PEX, /* 55 edge bundle index */ - destroyOC_PEX, /* 56 set individual asf */ - destroyOC_PEX, /* 57 local transform 3d */ - destroyOC_PEX, /* 58 local transform 2d */ - destroyOC_PEX, /* 59 global transform 3d */ - destroyOC_PEX, /* 60 global transform 2d */ - destroyOC_PEX, /* 61 model clip */ - destroyOC_PEX, /* 62 destroy model clip volume 3d */ - destroyOC_PEX, /* 63 destroy model clip volume 2d */ - destroyOC_PEX, /* 64 restore model clip volume */ - destroyOC_PEX, /* 65 view index */ - destroyOC_PEX, /* 66 light source state */ - destroyOC_PEX, /* 67 depth cue index */ - destroyOC_PEX, /* 68 pick id */ - destroyOC_PEX, /* 69 hlhsr identifier */ - destroyOC_PEX, /* 70 colour approx index */ - destroyOC_PEX, /* 71 rendering colour model */ - destroyOC_PEX, /* 72 parametric surface characteristics */ - destroyOC_PEX, /* 73 add names to name set */ - destroyOC_PEX, /* 74 remove names from name set */ - destroyOC_PEX, /* 75 execute structure */ - destroyOC_PEX, /* 76 label */ - destroyOC_PEX, /* 77 application data */ - destroyOC_PEX, /* 78 gse */ - destroyOC_PEX, /* 79 marker 3d */ - destroyOC_PEX, /* 80 marker 2d */ - destroyOC_PEX, /* 81 text3d */ - destroyOC_PEX, /* 82 text2d */ - destroyOC_PEX, /* 83 annotation text3d */ - destroyOC_PEX, /* 84 annotation text2d */ - destroyOC_PEX, /* 85 polyline3d */ - destroyOC_PEX, /* 86 polyline2d */ - destroyOC_PEX, /* 87 polyline set 3d with data */ - destroyOC_PEX, /* 88 non-uniform b spline curve */ - destroyOC_PEX, /* 89 fill area 3d */ - destroyOC_PEX, /* 90 fill area 2d */ - destroyOC_PEX, /* 91 fill area 3d with data */ - destroyOC_PEX, /* 92 fill area set 3d */ - destroyOC_PEX, /* 93 fill area set 2d */ - destroyOC_PEX, /* 94 fill area set 3d with data */ - destroyOC_PEX, /* 95 triangle strip */ - destroyOC_PEX, /* 96 quadrilateral mesh */ - destroySOFAS, /* 97 set of fill area sets */ - destroyNurbSurface, /* 98 non-uniform b spline surface */ - destroyOC_PEX, /* 99 cell array 3d */ - destroyOC_PEX, /* 100 cell array 2d */ - destroyOC_PEX, /* 101 extended cell array 3d */ - destroyOC_PEX, /* 102 gdp 3d */ - destroyOC_PEX, /* 103 gdp 2d */ - destroyOC_PEX /* 104 Noop */ -}; - -/* initial setup for output command table in renderers */ - -ocTableType InitExecuteOCTable[] = { - miNoop, /* 0 dummy entry */ - miMarkerType, /* 1 marker type */ - miMarkerScale, /* 2 marker scale */ - miMarkerColourOC, /* 3 marker colour index */ - miMarkerColourOC, /* 4 marker colour */ - miMarkerBundleIndex, /* 5 marker bundle index */ - miTextFontIndex, /* 6 text font index */ - miTextPrecision, /* 7 text precision */ - miCharExpansion, /* 8 character expansion */ - miCharSpacing, /* 9 character spacing */ - miTextColourOC, /* 10 text colour index */ - miTextColourOC, /* 11 text colour */ - miCharHeight, /* 12 character height */ - miCharUpVector, /* 13 character up vector */ - miTextPath, /* 14 text path */ - miTextAlignment, /* 15 text alignment */ - miAtextHeight, /* 16 annotation text height */ - miAtextUpVector, /* 17 annotation text up vector */ - miAtextPath, /* 18 annotation text path */ - miAtextAlignment, /* 19 annotation text alignment */ - miAtextStyle, /* 20 annotation text style */ - miTextBundleIndex, /* 21 text bundle index */ - miLineType, /* 22 line type */ - miLineWidth, /* 23 line width */ - miLineColourOC, /* 24 line colour index */ - miLineColourOC, /* 25 line colour */ - miCurveApproximation, /* 26 curve approximation method */ - miTestSetAttribute, /* 27 polyline interpolation method */ - miLineBundleIndex, /* 28 line bundle index */ - miInteriorStyle, /* 29 surface interior style */ - miTestSetAttribute, /* 30 surface interior style index */ - miSurfaceColourOC, /* 31 surface colour index */ - miSurfaceColourOC, /* 32 surface colour */ - miSurfaceReflAttr, /* 33 surface reflection attributes */ - miSurfaceReflModel, /* 34 surface reflection model */ - miSurfaceInterp, /* 35 surface interpolation method */ - miTestSetAttribute, /* 36 backface surface interior style */ - miTestSetAttribute, /* 37 backface surface interior style index */ - miTestColourOC, /* 38 backface surface colour index */ - miTestColourOC, /* 39 backface surface colour */ - miTestSetAttribute, /* 40 backface surface reflection attributes */ - miTestSetAttribute, /* 41 backface surface reflection model */ - miTestSetAttribute, /* 42 backface surface interpolation method */ - miSurfaceApproximation, /* 43 surface approximation */ - miCullingMode, /* 44 facet culling mode */ - miTestSetAttribute, /* 45 facet distinguish flag */ - miTestSetAttribute, /* 46 pattern size */ - miTestSetAttribute, /* 47 pattern reference point */ - miTestSetAttribute, /* 48 pattern reference point and vectors */ - miInteriorBundleIndex, /* 49 interior bundle index */ - miSurfaceEdgeFlag, /* 50 surface edge flag */ - miSurfaceEdgeType, /* 51 surface edge type */ - miSurfaceEdgeWidth, /* 52 surface edge width */ - miEdgeColourOC, /* 53 surface edge colour index */ - miEdgeColourOC, /* 54 surface edge colour */ - miEdgeBundleIndex, /* 55 edge bundle index */ - miSetAsfValues, /* 56 set individual asf */ - miLocalTransform, /* 57 local transform 3d */ - miLocalTransform2D, /* 58 local transform 2d */ - miGlobalTransform, /* 59 global transform 3d */ - miGlobalTransform2D, /* 60 global transform 2d */ - miModelClip, /* 61 model clip */ - miSetMCVolume, /* 62 set model clip volume 3d */ - miSetMCVolume, /* 63 set model clip volume 2d */ - miRestoreMCV, /* 64 restore model clip volume */ - miViewIndex, /* 65 view index */ - miLightStateOC, /* 66 light source state */ - miDepthCueIndex, /* 67 depth cue index */ - miPickId, /* 68 pick id */ - miTestSetAttribute, /* 69 hlhsr identifier */ - miColourApproxIndex, /* 70 colour approx index */ - miRenderingColourModel, /* 71 rendering colour model */ - miParaSurfCharacteristics, /* 72 parametric surface characteristics */ - miAddToNameSet, /* 73 add names to name set */ - miAddToNameSet, /* 74 remove names from name set */ - miExecuteStructure, /* 75 execute structure */ - miNoop, /* 76 label */ - miNoop, /* 77 application data */ - miNoop, /* 78 gse */ - miPolyMarker, /* 79 marker 3d */ - miPolyMarker, /* 80 marker 2d */ - miText3D, /* 81 text3d */ - miText2D, /* 82 text2d */ - miAnnoText3D, /* 83 annotation text3d */ - miAnnoText2D, /* 84 annotation text2d */ - miPolyLines, /* 85 polyline3d */ - miPolyLines, /* 86 polyline2d */ - miPolyLines, /* 87 polyline set 3d with data */ - miNurbsCurve, /* 88 non-uniform b spline curve */ - miFillArea, /* 89 fill area 3d */ - miFillArea, /* 90 fill area 2d */ - miFillArea, /* 91 fill area 3d with data */ - miFillArea, /* 92 fill area set 3d */ - miFillArea, /* 93 fill area set 2d */ - miFillArea, /* 94 fill area set 3d with data */ - miTriangleStrip, /* 95 triangle strip */ - miQuadMesh, /* 96 quadrilateral mesh */ - miSOFAS, /* 97 set of fill area sets */ - miNurbsSurface, /* 98 non-uniform b spline surface */ - miCellArray, /* 99 cell array 3d */ - miCellArray, /* 100 cell array 2d */ - miCellArray, /* 101 extended cell array 3d */ - miTestGDP, /* 102 gdp 3d */ - miTestGDP, /* 103 gdp 2d */ - miNoop /* 104 Noop */ -}; - -/* initial setup for output command table for picking */ - -ocTableType PickExecuteOCTable[] = { - miNoop, /* 0 dummy entry */ - miMarkerType, /* 1 marker type */ - miMarkerScale, /* 2 marker scale */ - miMarkerColourOC, /* 3 marker colour index */ - miMarkerColourOC, /* 4 marker colour */ - miMarkerBundleIndex, /* 5 marker bundle index */ - miTextFontIndex, /* 6 text font index */ - miTextPrecision, /* 7 text precision */ - miCharExpansion, /* 8 character expansion */ - miCharSpacing, /* 9 character spacing */ - miTextColourOC, /* 10 text colour index */ - miTextColourOC, /* 11 text colour */ - miCharHeight, /* 12 character height */ - miCharUpVector, /* 13 character up vector */ - miTextPath, /* 14 text path */ - miTextAlignment, /* 15 text alignment */ - miAtextHeight, /* 16 annotation text height */ - miAtextUpVector, /* 17 annotation text up vector */ - miAtextPath, /* 18 annotation text path */ - miAtextAlignment, /* 19 annotation text alignment */ - miAtextStyle, /* 20 annotation text style */ - miTextBundleIndex, /* 21 text bundle index */ - miLineType, /* 22 line type */ - miLineWidth, /* 23 line width */ - miLineColourOC, /* 24 line colour index */ - miLineColourOC, /* 25 line colour */ - miCurveApproximation, /* 26 curve approximation method */ - miTestSetAttribute, /* 27 polyline interpolation method */ - miLineBundleIndex, /* 28 line bundle index */ - miInteriorStyle, /* 29 surface interior style */ - miTestSetAttribute, /* 30 surface interior style index */ - miSurfaceColourOC, /* 31 surface colour index */ - miSurfaceColourOC, /* 32 surface colour */ - miSurfaceReflAttr, /* 33 surface reflection attributes */ - miSurfaceReflModel, /* 34 surface reflection model */ - miSurfaceInterp, /* 35 surface interpolation method */ - miTestSetAttribute, /* 36 backface surface interior style */ - miTestSetAttribute, /* 37 backface surface interior style index */ - miTestColourOC, /* 38 backface surface colour index */ - miTestColourOC, /* 39 backface surface colour */ - miTestSetAttribute, /* 40 backface surface reflection attributes */ - miTestSetAttribute, /* 41 backface surface reflection model */ - miTestSetAttribute, /* 42 backface surface interpolation method */ - miSurfaceApproximation, /* 43 surface approximation */ - miCullingMode, /* 44 facet culling mode */ - miTestSetAttribute, /* 45 facet distinguish flag */ - miTestSetAttribute, /* 46 pattern size */ - miTestSetAttribute, /* 47 pattern reference point */ - miTestSetAttribute, /* 48 pattern reference point and vectors */ - miInteriorBundleIndex, /* 49 interior bundle index */ - miSurfaceEdgeFlag, /* 50 surface edge flag */ - miSurfaceEdgeType, /* 51 surface edge type */ - miSurfaceEdgeWidth, /* 52 surface edge width */ - miEdgeColourOC, /* 53 surface edge colour index */ - miEdgeColourOC, /* 54 surface edge colour */ - miEdgeBundleIndex, /* 55 edge bundle index */ - miSetAsfValues, /* 56 set individual asf */ - miLocalTransform, /* 57 local transform 3d */ - miLocalTransform2D, /* 58 local transform 2d */ - miGlobalTransform, /* 59 global transform 3d */ - miGlobalTransform2D, /* 60 global transform 2d */ - miModelClip, /* 61 model clip */ - miSetMCVolume, /* 62 set model clip volume 3d */ - miSetMCVolume, /* 63 set model clip volume 2d */ - miRestoreMCV, /* 64 restore model clip volume */ - miViewIndex, /* 65 view index */ - miLightStateOC, /* 66 light source state */ - miDepthCueIndex, /* 67 depth cue index */ - miPickId, /* 68 pick id */ - miTestSetAttribute, /* 69 hlhsr identifier */ - miColourApproxIndex, /* 70 colour approx index */ - miRenderingColourModel, /* 71 rendering colour model */ - miParaSurfCharacteristics, /* 72 parametric surface characteristics */ - miAddToNameSet, /* 73 add names to name set */ - miAddToNameSet, /* 74 remove names from name set */ - miExecuteStructure, /* 75 execute structure */ - miNoop, /* 76 label */ - miNoop, /* 77 application data */ - miNoop, /* 78 gse */ - miPickPrimitives, /* 79 marker 3d */ - miPickPrimitives, /* 80 marker 2d */ - miPickPrimitives, /* 81 text3d */ - miPickPrimitives, /* 82 text2d */ - miPickAnnoText3D, /* 83 annotation text3d */ - miPickAnnoText2D, /* 84 annotation text2d */ - miPickPrimitives, /* 85 polyline3d */ - miPickPrimitives, /* 86 polyline2d */ - miPickPrimitives, /* 87 polyline set 3d with data */ - miPickPrimitives, /* 88 non-uniform b spline curve */ - miPickPrimitives, /* 89 fill area 3d */ - miPickPrimitives, /* 90 fill area 2d */ - miPickPrimitives, /* 91 fill area 3d with data */ - miPickPrimitives, /* 92 fill area set 3d */ - miPickPrimitives, /* 93 fill area set 2d */ - miPickPrimitives, /* 94 fill area set 3d with data */ - miPickPrimitives, /* 95 triangle strip */ - miPickPrimitives, /* 96 quadrilateral mesh */ - miPickPrimitives, /* 97 set of fill area sets */ - miPickPrimitives, /* 98 non-uniform b spline surface */ - miPickPrimitives, /* 99 cell array 3d */ - miPickPrimitives, /* 100 cell array 2d */ - miPickPrimitives, /* 101 extended cell array 3d */ - miTestPickGdp3d, /* 102 gdp 3d */ - miTestPickGdp2d, /* 103 gdp 2d */ - miNoop /* 104 Noop */ -}; - - -/* initial setup for output command table for searching */ - -ocTableType SearchExecuteOCTable[] = { - miNoop, /* 0 dummy entry */ - miMarkerType, /* 1 marker type */ - miMarkerScale, /* 2 marker scale */ - miMarkerColourOC, /* 3 marker colour index */ - miMarkerColourOC, /* 4 marker colour */ - miMarkerBundleIndex, /* 5 marker bundle index */ - miTextFontIndex, /* 6 text font index */ - miTextPrecision, /* 7 text precision */ - miCharExpansion, /* 8 character expansion */ - miCharSpacing, /* 9 character spacing */ - miTextColourOC, /* 10 text colour index */ - miTextColourOC, /* 11 text colour */ - miCharHeight, /* 12 character height */ - miCharUpVector, /* 13 character up vector */ - miTextPath, /* 14 text path */ - miTextAlignment, /* 15 text alignment */ - miAtextHeight, /* 16 annotation text height */ - miAtextUpVector, /* 17 annotation text up vector */ - miAtextPath, /* 18 annotation text path */ - miAtextAlignment, /* 19 annotation text alignment */ - miAtextStyle, /* 20 annotation text style */ - miTextBundleIndex, /* 21 text bundle index */ - miLineType, /* 22 line type */ - miLineWidth, /* 23 line width */ - miLineColourOC, /* 24 line colour index */ - miLineColourOC, /* 25 line colour */ - miCurveApproximation, /* 26 curve approximation method */ - miTestSetAttribute, /* 27 polyline interpolation method */ - miLineBundleIndex, /* 28 line bundle index */ - miInteriorStyle, /* 29 surface interior style */ - miTestSetAttribute, /* 30 surface interior style index */ - miSurfaceColourOC, /* 31 surface colour index */ - miSurfaceColourOC, /* 32 surface colour */ - miSurfaceReflAttr, /* 33 surface reflection attributes */ - miSurfaceReflModel, /* 34 surface reflection model */ - miSurfaceInterp, /* 35 surface interpolation method */ - miTestSetAttribute, /* 36 backface surface interior style */ - miTestSetAttribute, /* 37 backface surface interior style index */ - miTestColourOC, /* 38 backface surface colour index */ - miTestColourOC, /* 39 backface surface colour */ - miTestSetAttribute, /* 40 backface surface reflection attributes */ - miTestSetAttribute, /* 41 backface surface reflection model */ - miTestSetAttribute, /* 42 backface surface interpolation method */ - miSurfaceApproximation, /* 43 surface approximation */ - miCullingMode, /* 44 facet culling mode */ - miTestSetAttribute, /* 45 facet distinguish flag */ - miTestSetAttribute, /* 46 pattern size */ - miTestSetAttribute, /* 47 pattern reference point */ - miTestSetAttribute, /* 48 pattern reference point and vectors */ - miInteriorBundleIndex, /* 49 interior bundle index */ - miSurfaceEdgeFlag, /* 50 surface edge flag */ - miSurfaceEdgeType, /* 51 surface edge type */ - miSurfaceEdgeWidth, /* 52 surface edge width */ - miEdgeColourOC, /* 53 surface edge colour index */ - miEdgeColourOC, /* 54 surface edge colour */ - miEdgeBundleIndex, /* 55 edge bundle index */ - miSetAsfValues, /* 56 set individual asf */ - miLocalTransform, /* 57 local transform 3d */ - miLocalTransform2D, /* 58 local transform 2d */ - miGlobalTransform, /* 59 global transform 3d */ - miGlobalTransform2D, /* 60 global transform 2d */ - miModelClip, /* 61 model clip */ - miSetMCVolume, /* 62 set model clip volume 3d */ - miSetMCVolume, /* 63 set model clip volume 2d */ - miRestoreMCV, /* 64 restore model clip volume */ - miViewIndex, /* 65 view index */ - miLightStateOC, /* 66 light source state */ - miDepthCueIndex, /* 67 depth cue index */ - miPickId, /* 68 pick id */ - miTestSetAttribute, /* 69 hlhsr identifier */ - miColourApproxIndex, /* 70 colour approx index */ - miRenderingColourModel, /* 71 rendering colour model */ - miParaSurfCharacteristics, /* 72 parametric surface characteristics */ - miAddToNameSet, /* 73 add names to name set */ - miAddToNameSet, /* 74 remove names from name set */ - miExecuteStructure, /* 75 execute structure */ - miNoop, /* 76 label */ - miNoop, /* 77 application data */ - miNoop, /* 78 gse */ - miSearchPrimitives, /* 79 marker 3d */ - miSearchPrimitives, /* 80 marker 2d */ - miSearchPrimitives, /* 81 text3d */ - miSearchPrimitives, /* 82 text2d */ - miSearchPrimitives, /* 83 annotation text3d */ - miSearchPrimitives, /* 84 annotation text2d */ - miSearchPrimitives, /* 85 polyline3d */ - miSearchPrimitives, /* 86 polyline2d */ - miSearchPrimitives, /* 87 polyline set 3d with data */ - miSearchPrimitives, /* 88 non-uniform b spline curve */ - miSearchPrimitives, /* 89 fill area 3d */ - miSearchPrimitives, /* 90 fill area 2d */ - miSearchPrimitives, /* 91 fill area 3d with data */ - miSearchPrimitives, /* 92 fill area set 3d */ - miSearchPrimitives, /* 93 fill area set 2d */ - miSearchPrimitives, /* 94 fill area set 3d with data */ - miSearchPrimitives, /* 95 triangle strip */ - miSearchPrimitives, /* 96 quadrilateral mesh */ - miSearchPrimitives, /* 97 set of fill area sets */ - miSearchPrimitives, /* 98 non-uniform b spline surface */ - miSearchPrimitives, /* 99 cell array 3d */ - miSearchPrimitives, /* 100 cell array 2d */ - miSearchPrimitives, /* 101 extended cell array 3d */ - miTestSearchGdp3d, /* 102 gdp 3d */ - miTestSearchGdp2d, /* 103 gdp 2d */ - miNoop /* 104 Noop */ -}; - - -extern ddpex2rtn - copyAnnotationText(), - copyAnnotationText2D(), - copyCellArray(), - copyCellArray2D(), - copyColourIndexOC(), - copyColourOC(), - copyExtCellArray(), - copyExtFillArea(), - copyExtFillAreaSet(), - copyFillArea(), - copyFillArea2D(), - copyFillAreaSet(), - copyFillAreaSet2D(), - copyGdp(), - copyGdp2D(), - copyLightState(), - copyMarker(), - copyMarker2D(), - copyNurbCurve(), - copyNurbSurface(), - copyPolyline(), - copyPolyline2D(), - copyPolylineSet(), - copyPSurfaceChars(), - copyMCVolume(), - copyQuadrilateralMesh(), - copySetAttribute(), - copyPropOC(), - copySOFAS(), - copyText(), - copyText2D(), - copyTriangleStrip(); - - - -ocTableType CopyOCTable[] = { - copyPropOC, /* 0 dummy entry */ - copySetAttribute, /* 1 marker type */ - copySetAttribute, /* 2 marker scale */ - copyColourIndexOC, /* 3 marker colour index */ - copyColourOC, /* 4 marker colour */ - copySetAttribute, /* 5 marker bundle index */ - copySetAttribute, /* 6 text font index */ - copySetAttribute, /* 7 text precision */ - copySetAttribute, /* 8 character expansion */ - copySetAttribute, /* 9 character spacing */ - copyColourIndexOC, /* 10 text colour index */ - copyColourOC, /* 11 text colour */ - copySetAttribute, /* 12 character height */ - copySetAttribute, /* 13 character up vector */ - copySetAttribute, /* 14 text path */ - copySetAttribute, /* 15 text alignment */ - copySetAttribute, /* 16 annotation text height */ - copySetAttribute, /* 17 annotation text up vector */ - copySetAttribute, /* 18 annotation text path */ - copySetAttribute, /* 19 annotation text alignment */ - copySetAttribute, /* 20 annotation text style */ - copySetAttribute, /* 21 text bundle index */ - copySetAttribute, /* 22 line type */ - copySetAttribute, /* 23 line width */ - copyColourIndexOC, /* 24 line colour index */ - copyColourOC, /* 25 line colour */ - copySetAttribute, /* 26 curve approximation method */ - copySetAttribute, /* 27 polyline interpolation method */ - copySetAttribute, /* 28 line bundle index */ - copySetAttribute, /* 29 surface interior style */ - copySetAttribute, /* 30 surface interior style index */ - copyColourIndexOC, /* 31 surface colour index */ - copyColourOC, /* 32 surface colour */ - copySetAttribute, /* 33 surface reflection attributes */ - copySetAttribute, /* 34 surface reflection model */ - copySetAttribute, /* 35 surface interpolation method */ - copySetAttribute, /* 36 backface surface interior style */ - copySetAttribute, /* 37 backface surface interior style index */ - copyColourIndexOC, /* 38 backface surface colour index */ - copyColourOC, /* 39 backface surface colour */ - copySetAttribute, /* 40 backface surface reflection - * attributes */ - copySetAttribute, /* 41 backface surface reflection model */ - copySetAttribute, /* 42 backface surface interpolation method */ - copySetAttribute, /* 43 surface approximation */ - copySetAttribute, /* 44 facet culling mode */ - copySetAttribute, /* 45 facet distinguish flag */ - copySetAttribute, /* 46 pattern size */ - copySetAttribute, /* 47 pattern reference point */ - copySetAttribute, /* 48 pattern reference point and vectors */ - copySetAttribute, /* 49 interior bundle index */ - copySetAttribute, /* 50 surface edge flag */ - copySetAttribute, /* 51 surface edge type */ - copySetAttribute, /* 52 surface edge width */ - copyColourIndexOC, /* 53 surface edge colour index */ - copyColourOC, /* 54 surface edge colour */ - copySetAttribute, /* 55 edge bundle index */ - copySetAttribute, /* 56 set individual asf */ - copySetAttribute, /* 57 local transform 3d */ - copySetAttribute, /* 58 local transform 2d */ - copySetAttribute, /* 59 global transform 3d */ - copySetAttribute, /* 60 global transform 2d */ - copySetAttribute, /* 61 model clip */ - copyMCVolume, /* 62 copy model clip volume 3d */ - copyMCVolume, /* 63 copy model clip volume 2d */ - copySetAttribute, /* 64 restore model clip volume */ - copySetAttribute, /* 65 view index */ - copyLightState, /* 66 light source state */ - copySetAttribute, /* 67 depth cue index */ - copySetAttribute, /* 68 pick id */ - copySetAttribute, /* 69 hlhsr identifier */ - copySetAttribute, /* 70 colour approx index */ - copySetAttribute, /* 71 rendering colour model */ - copyPSurfaceChars, /* 72 parametric surface attributes */ - copySetAttribute, /* 73 add names to name set */ - copySetAttribute, /* 74 remove names from name set */ - copySetAttribute, /* 75 execute structure */ - copySetAttribute, /* 76 label */ - copySetAttribute, /* 77 application data */ - copySetAttribute, /* 78 gse */ - copyMarker, /* 79 marker 3d */ - copyMarker2D, /* 80 marker 2d */ - copyText, /* 81 text3d */ - copyText2D, /* 82 text2d */ - copyAnnotationText, /* 83 annotation text3d */ - copyAnnotationText2D, /* 84 annotation text2d */ - copyPolyline, /* 85 polyline3d */ - copyPolyline2D, /* 86 polyline2d */ - copyPolylineSet, /* 87 polyline set 3d with data */ - copyNurbCurve, /* 88 non-uniform b spline curve */ - copyFillArea, /* 89 fill area 3d */ - copyFillArea2D, /* 90 fill area 2d */ - copyExtFillArea, /* 91 fill area 3d with data */ - copyFillAreaSet, /* 92 fill area set 3d */ - copyFillAreaSet2D, /* 93 fill area set 2d */ - copyExtFillAreaSet, /* 94 fill area set 3d with data */ - copyTriangleStrip, /* 95 triangle strip */ - copyQuadrilateralMesh, /* 96 quadrilateral mesh */ - copySOFAS, /* 97 set of fill area sets */ - copyNurbSurface, /* 98 non-uniform b spline surface */ - copyCellArray, /* 99 cell array 3d */ - copyCellArray2D, /* 100 cell array 2d */ - copyExtCellArray, /* 101 extended cell array 3d */ - copyGdp, /* 102 gdp 3d */ - copyGdp2D, /* 103 gdp 2d */ - copySetAttribute /* 104 Noop */ -}; - - -extern ddpex2rtn - inquireAnnotationText(), - inquireAnnotationText2D(), - inquireCellArray(), - inquireCellArray2D(), - inquireColourIndexOC(), - inquireColourOC(), - inquireExtCellArray(), - inquireExtFillArea(), - inquireExtFillAreaSet(), - inquireFillArea(), - inquireFillArea2D(), - inquireFillAreaSet(), - inquireFillAreaSet2D(), - inquireGdp(), - inquireGdp2D(), - inquireLightState(), - inquireMarker(), - inquireMarker2D(), - inquireMCVolume(), - inquireMCVolume2D(), - inquireNurbCurve(), - inquireNurbSurface(), - inquirePolyline(), - inquirePolyline2D(), - inquirePolylineSet(), - inquirePSurfaceChars(), - inquireQuadrilateralMesh(), - inquireSetAttribute(), - inquirePropOC(), - inquireSOFAS(), - inquireText(), - inquireText2D(), - inquireTriangleStrip(), - inquireMCVolume(), - inquireMCVolume2D(); - - -ocTableType InquireOCTable[] = { - inquirePropOC, /* 0 dummy entry */ - inquireSetAttribute, /* 1 marker type */ - inquireSetAttribute, /* 2 marker scale */ - inquireColourIndexOC, /* 3 marker colour index */ - inquireColourOC, /* 4 marker colour */ - inquireSetAttribute, /* 5 marker bundle index */ - inquireSetAttribute, /* 6 text font index */ - inquireSetAttribute, /* 7 text precision */ - inquireSetAttribute, /* 8 character expansion */ - inquireSetAttribute, /* 9 character spacing */ - inquireColourIndexOC, /* 10 text colour index */ - inquireColourOC, /* 11 text colour */ - inquireSetAttribute, /* 12 character height */ - inquireSetAttribute, /* 13 character up vector */ - inquireSetAttribute, /* 14 text path */ - inquireSetAttribute, /* 15 text alignment */ - inquireSetAttribute, /* 16 annotation text height */ - inquireSetAttribute, /* 17 annotation text up vector */ - inquireSetAttribute, /* 18 annotation text path */ - inquireSetAttribute, /* 19 annotation text alignment */ - inquireSetAttribute, /* 20 annotation text style */ - inquireSetAttribute, /* 21 text bundle index */ - inquireSetAttribute, /* 22 line type */ - inquireSetAttribute, /* 23 line width */ - inquireColourIndexOC, /* 24 line colour index */ - inquireColourOC, /* 25 line colour */ - inquireSetAttribute, /* 26 curve approximation method */ - inquireSetAttribute, /* 27 polyline interpolation method */ - inquireSetAttribute, /* 28 line bundle index */ - inquireSetAttribute, /* 29 surface interior style */ - inquireSetAttribute, /* 30 surface interior style index */ - inquireColourIndexOC, /* 31 surface colour index */ - inquireColourOC, /* 32 surface colour */ - inquireSetAttribute, /* 33 surface reflection attributes */ - inquireSetAttribute, /* 34 surface reflection model */ - inquireSetAttribute, /* 35 surface interpolation method */ - inquireSetAttribute, /* 36 backface surface interior style */ - inquireSetAttribute, /* 37 backface surface interior style index */ - inquireColourIndexOC, /* 38 backface surface colour index */ - inquireColourOC, /* 39 backface surface colour */ - inquireSetAttribute, /* 40 backface surface reflection attributes */ - inquireSetAttribute, /* 41 backface surface reflection model */ - inquireSetAttribute, /* 42 backface surface interpolation method */ - inquireSetAttribute, /* 43 surface approximation */ - inquireSetAttribute, /* 44 facet culling mode */ - inquireSetAttribute, /* 45 facet distinguish flag */ - inquireSetAttribute, /* 46 pattern size */ - inquireSetAttribute, /* 47 pattern reference point */ - inquireSetAttribute, /* 48 pattern reference point and vectors */ - inquireSetAttribute, /* 49 interior bundle index */ - inquireSetAttribute, /* 50 surface edge flag */ - inquireSetAttribute, /* 51 surface edge type */ - inquireSetAttribute, /* 52 surface edge width */ - inquireColourIndexOC, /* 53 surface edge colour index */ - inquireColourOC, /* 54 surface edge colour */ - inquireSetAttribute, /* 55 edge bundle index */ - inquireSetAttribute, /* 56 set individual asf */ - inquireSetAttribute, /* 57 local transform 3d */ - inquireSetAttribute, /* 58 local transform 2d */ - inquireSetAttribute, /* 59 global transform 3d */ - inquireSetAttribute, /* 60 global transform 2d */ - inquireSetAttribute, /* 61 model clip */ - inquireMCVolume, /* 62 model clip volume 3d */ - inquireMCVolume2D, /* 63 model clip volume 2d */ - inquireSetAttribute, /* 64 restore model clip volume */ - inquireSetAttribute, /* 65 view index */ - inquireLightState, /* 66 light source state */ - inquireSetAttribute, /* 67 depth cue index */ - inquireSetAttribute, /* 68 pick id */ - inquireSetAttribute, /* 69 hlhsr identifier */ - inquireSetAttribute, /* 70 colour approx index */ - inquireSetAttribute, /* 71 rendering colour model */ - inquirePSurfaceChars, /* 72 parametric surface attributes */ - inquireSetAttribute, /* 73 add names to name set */ - inquireSetAttribute, /* 74 remove names from name set */ - inquireSetAttribute, /* 75 execute structure */ - inquireSetAttribute, /* 76 label */ - inquireSetAttribute, /* 77 application data */ - inquireSetAttribute, /* 78 gse */ - inquireMarker, /* 79 marker 3d */ - inquireMarker2D, /* 80 marker 2d */ - inquireText, /* 81 text3d */ - inquireText2D, /* 82 text2d */ - inquireAnnotationText, /* 83 annotation text3d */ - inquireAnnotationText2D, /* 84 annotation text2d */ - inquirePolyline, /* 85 polyline3d */ - inquirePolyline2D, /* 86 polyline2d */ - inquirePolylineSet, /* 87 polyline set 3d with data */ - inquireNurbCurve, /* 88 non-uniform b spline curve */ - inquireFillArea, /* 89 fill area 3d */ - inquireFillArea2D, /* 90 fill area 2d */ - inquireExtFillArea, /* 91 fill area 3d with data */ - inquireFillAreaSet, /* 92 fill area set 3d */ - inquireFillAreaSet2D, /* 93 fill area set 2d */ - inquireExtFillAreaSet, /* 94 fill area set 3d with data */ - inquireTriangleStrip, /* 95 triangle strip */ - inquireQuadrilateralMesh, /* 96 quadrilateral mesh */ - inquireSOFAS, /* 97 set of fill area sets */ - inquireNurbSurface, /* 98 non-uniform b spline surface */ - inquireCellArray, /* 99 cell array 3d */ - inquireCellArray2D, /* 100 cell array 2d */ - inquireExtCellArray, /* 101 extended cell array 3d */ - inquireGdp, /* 102 gdp 3d */ - inquireGdp2D, /* 103 gdp 2d */ - inquireSetAttribute /* 104 Noop */ -}; - - - -extern ddpex2rtn - replaceNurbSurface(), - replaceLightState(), - replaceSOFAS(); - - -ocTableType ReplaceOCTable[] = { - parsePropOC, /* 0 dummy entry */ - parseSetAttribute, /* 1 marker type */ - parseSetAttribute, /* 2 marker scale */ - parseColourIndexOC, /* 3 marker colour index */ - parseColourOC, /* 4 marker colour */ - parseSetAttribute, /* 5 marker bundle index */ - parseSetAttribute, /* 6 text font index */ - parseSetAttribute, /* 7 text precision */ - parseSetAttribute, /* 8 character expansion */ - parseSetAttribute, /* 9 character spacing */ - parseColourIndexOC, /* 10 text colour index */ - parseColourOC, /* 11 text colour */ - parseSetAttribute, /* 12 character height */ - parseSetAttribute, /* 13 character up vector */ - parseSetAttribute, /* 14 text path */ - parseSetAttribute, /* 15 text alignment */ - parseSetAttribute, /* 16 annotation text height */ - parseSetAttribute, /* 17 annotation text up vector */ - parseSetAttribute, /* 18 annotation text path */ - parseSetAttribute, /* 19 annotation text alignment */ - parseSetAttribute, /* 20 annotation text style */ - parseSetAttribute, /* 21 text bundle index */ - parseSetAttribute, /* 22 line type */ - parseSetAttribute, /* 23 line width */ - parseColourIndexOC, /* 24 line colour index */ - parseColourOC, /* 25 line colour */ - parseSetAttribute, /* 26 curve approximation method */ - parseSetAttribute, /* 27 polyline interpolation method */ - parseSetAttribute, /* 28 line bundle index */ - parseSetAttribute, /* 29 surface interior style */ - parseSetAttribute, /* 30 surface interior style index */ - parseColourIndexOC, /* 31 surface colour index */ - parseColourOC, /* 32 surface colour */ - parseSetAttribute, /* 33 surface reflection attributes */ - parseSetAttribute, /* 34 surface reflection model */ - parseSetAttribute, /* 35 surface interpolation method */ - parseSetAttribute, /* 36 backface surface interior style */ - parseSetAttribute, /* 37 backface surface interior style index */ - parseColourIndexOC, /* 38 backface surface colour index */ - parseColourOC, /* 39 backface surface colour */ - parseSetAttribute, /* 40 backface surface reflection attributes */ - parseSetAttribute, /* 41 backface surface reflection model */ - parseSetAttribute, /* 42 backface surface interpolation method */ - parseSetAttribute, /* 43 surface approximation */ - parseSetAttribute, /* 44 facet culling mode */ - parseSetAttribute, /* 45 facet distinguish flag */ - parseSetAttribute, /* 46 pattern size */ - parseSetAttribute, /* 47 pattern reference point */ - parseSetAttribute, /* 48 pattern reference point and vectors */ - parseSetAttribute, /* 49 interior bundle index */ - parseSetAttribute, /* 50 surface edge flag */ - parseSetAttribute, /* 51 surface edge type */ - parseSetAttribute, /* 52 surface edge width */ - parseColourIndexOC, /* 53 surface edge colour index */ - parseColourOC, /* 54 surface edge colour */ - parseSetAttribute, /* 55 edge bundle index */ - parseSetAttribute, /* 56 set individual asf */ - parseSetAttribute, /* 57 local transform 3d */ - parseSetAttribute, /* 58 local transform 2d */ - parseSetAttribute, /* 59 global transform 3d */ - parseSetAttribute, /* 60 global transform 2d */ - parseSetAttribute, /* 61 model clip */ - parseSetMCVolume, /* 62 set model clip volume 3d */ - parseSetMCVolume2D, /* 63 set model clip volume 2d */ - parseSetAttribute, /* 64 restore model clip volume */ - parseSetAttribute, /* 65 view index */ - replaceLightState, /* 66 light source state */ - parseSetAttribute, /* 67 depth cue index */ - parseSetAttribute, /* 68 pick id */ - parseSetAttribute, /* 69 hlhsr identifier */ - parseSetAttribute, /* 70 colour approx index */ - parseSetAttribute, /* 71 rendering colour model */ - parsePSurfaceChars, /* 72 parametric surface attributes */ - parseSetAttribute, /* 73 add names to name set */ - parseSetAttribute, /* 74 remove names from name set */ - parseSetAttribute, /* 75 execute structure */ - parseSetAttribute, /* 76 label */ - parseSetAttribute, /* 77 application data */ - parseSetAttribute, /* 78 gse */ - parseMarker, /* 79 marker 3d */ - parseMarker2D, /* 80 marker 2d */ - parseText, /* 81 text3d */ - parseText2D, /* 82 text2d */ - parseAnnotationText, /* 83 annotation text3d */ - parseAnnotationText2D, /* 84 annotation text2d */ - parsePolyline, /* 85 polyline3d */ - parsePolyline2D, /* 86 polyline2d */ - parsePolylineSet, /* 87 polyline set 3d with data */ - parseNurbCurve, /* 88 non-uniform b spline curve */ - parseFillArea, /* 89 fill area 3d */ - parseFillArea2D, /* 90 fill area 2d */ - parseExtFillArea, /* 91 fill area 3d with data */ - parseFillAreaSet, /* 92 fill area set 3d */ - parseFillAreaSet2D, /* 93 fill area set 2d */ - parseExtFillAreaSet, /* 94 fill area set 3d with data */ - parseTriangleStrip, /* 95 triangle strip */ - parseQuadrilateralMesh, /* 96 quadrilateral mesh */ - replaceSOFAS, /* 97 set of fill area sets */ - replaceNurbSurface, /* 98 non-uniform b spline surface */ - parseCellArray, /* 99 cell array 3d */ - parseCellArray2D, /* 100 cell array 2d */ - parseExtCellArray, /* 101 extended cell array 3d */ - parseGdp, /* 102 gdp 3d */ - parseGdp2D, /* 103 gdp 2d */ - parseSetAttribute /* 104 Noop */ -}; Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c:3.7 Fri Dec 14 14:57:28 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c Sat Feb 28 21:41:54 2004 @@ -1,150 +0,0 @@ -/* $Xorg: miMarkers.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miMarkers.c,v 3.7 2001/12/14 19:57:28 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miStruct.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miMarkers.h" -#include "miClip.h" - - -/*++ - | - | Function Name: miPolyMarker - | - | Function Description: - | Handles the Polymarker 3D, and Polymarker 2D ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miPolyMarker(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - ddpex3rtn miTransform(); - ddpex3rtn miClipPointList(); - -/* Local variable definitions */ - miMarkerStruct *ddmarker = (miMarkerStruct *)(pExecuteOC+1); - miListHeader *input_list = (miListHeader *)ddmarker; - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - ddpex3rtn status; - miListHeader *mc_list, - *mc_clist, - *cc_list, - *clip_list, - *dc_list; - ddUSHORT clip_mode; /* view or model clipping */ - ddPointType out_type; - - /* Check for Model clipping */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - clip_mode = MI_MCLIP; - - /* Tranform points to 4D for clipping */ - out_type = input_list->type; - if (status = miTransform(pddc, input_list, &mc_clist, - ident4x4, - ident4x4, - DD_SetVert4D(out_type))) - return (status); - - if (status = miClipPointList(pddc, mc_clist, &mc_list, clip_mode)) - return(status); - - } else mc_list = input_list; - - clip_mode = MI_VCLIP; - - - /* - * Transform and clip the input list of marker positions. - */ - if (status = miTransform(pddc, mc_list, &cc_list, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - /* Note that miClipPointList discards clipped points */ - if (status = miClipPointList(pddc, cc_list, &clip_list, clip_mode)) - return(status); - - /* if nothing left, return early */ - if (clip_list->numLists <= 0) return(Success); - - - /* Transform to DC coordinates */ - if (status = miTransform(pddc, clip_list, &dc_list, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - - return (pddc->Static.RenderProcs[MARKER_RENDER_TABLE_INDEX](pRend, - pddc, - dc_list)); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c:3.8 Fri Dec 14 14:57:28 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c Sat Feb 28 21:41:54 2004 @@ -1,747 +0,0 @@ -/* $Xorg: miNCurve.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNCurve.c,v 3.8 2001/12/14 19:57:28 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miNurbs.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miNurbsCurve - | - | Function Description: - | Handles the Nurbs Curve Pex OC. - | - | Note(s): - | - --*/ - -ddpex3rtn -miNurbsCurve(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - ddpex3rtn tessellate_curve(); - extern ocTableType InitExecuteOCTable[]; - -/* Local variable definitions */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miNurbStruct *ddCurve = (miNurbStruct *)(pExecuteOC+1); - miGenericStr *pGStr; - miListHeader *tesselated_list; - miListHeader *polyline_list; - ddpex3rtn status; - - switch(pddc->Static.attrs->curveApprox.approxMethod) { - - case PEXApproxImpDep: - case PEXApproxConstantBetweenKnots: - case PEXApproxDcChordalSize: - case PEXCurveApproxDcChordalDev: - case PEXApproxDcRelative: - default: - - case PEXApproxWcsChordalSize: - case PEXCurveApproxWcsChordalDev: - case PEXApproxWcsRelative: - - /* apply curve approximation criteria in wc */ - if (status = tessellate_curve( pddc, ddCurve, - &tesselated_list, - pddc->Dynamic->mc_to_wc_xform )) - return (status); - - break; - - - case PEXApproxNpcChordalSize: - case PEXCurveApproxNpcChordalDev: - case PEXApproxNpcRelative: - - /* apply curve approximation criteria in wc */ - if (status = tessellate_curve( pddc, ddCurve, - &tesselated_list, - pddc->Dynamic->mc_to_npc_xform )) - return (status); - - break; - } - - /* allocate polyline command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miListHeader))))) - return(BadAlloc); - - pGStr->elementType = PEXOCPolylineSet; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - polyline_list = (miListHeader *) (pGStr + 1); - *polyline_list = *tesselated_list; - - /* render tesselated curve */ - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - xfree(pGStr); - - return (status); - -} - -/*++ - | - | Function Name: multiply_basis_func_control_pts - | - | Function Description: - | - | Multiply nurb basis func and control points to get polynomial coeffs - | - | |poly[0]| |C0,0 C0,1 C0,2 C0,3| |Pxi+3| - | |poly[1]| = |C1,0 C1,1 C1,2 C1,3| |Pxi+2| - | |poly[2]| |C2,0 C2,1 C2,2 C2,3| |Pxi+1| - | |poly[3]| |C3,0 C3,1 C3,2 C3,3| |Pxi | - | - | - | Note(s): - | - --*/ -static -void -multiply_basis_func_control_pts( pt_type, order, span, pts, C, poly ) - ddPointType pt_type; - ddUSHORT order; - int span; - char *pts; /* control points */ - double C[MAXORD][MAXORD]; /* span basis matrix */ - double poly[4][MAXORD]; /* computed polynomial basis mtx */ -{ - int i, k; - double x, y, z, w; - char *pt; - int point_size; - - DD_VertPointSize(pt_type, point_size); - - for ( k = 0; k < order; k++ ) { - x = y = z = w = 0.0; - pt = pts + point_size * (span - order); - for ( i = 0; i < order; i++ ) { /* for all coeffs */ - pt += point_size; - x += C[k][i] * ((ddCoord4D *)pt)->x; - y += C[k][i] * ((ddCoord4D *)pt)->y; - if ( !DD_IsVert2D(pt_type) ) { - z += C[k][i] * ((ddCoord4D *)pt)->z; - if ( DD_IsVert4D(pt_type) ) - w += C[k][i] * ((ddCoord4D *)pt)->w; - } - } - poly[XX][k] = x; - poly[YY][k] = y; - poly[ZZ][k] = z; - poly[WW][k] = w; - } -} - - - -/*++ - | - | Function Name: compute_fwd_matrix2D - | - | Function Description: - | - | initial scale and convert coefficients to forward difference basis - | - | |1 0 0 0 | |1 0 0 0 | |polyx[0]| - | |fdx[0]| |0 1 1 1 | |0 dt 0 0 | |polyx[1]| - | |fdx[1]| = | | | 2 | | | - | |fdx[2]| |0 0 2 6 | |0 0 dt 0 | |polyx[2]| - | |fdx[3]| | | | 3| | | - | |0 0 0 6 | |0 0 0 dt | |polyx[3]| - | - | - | Note(s): - | - --*/ -static -void -compute_fwd_matrix2D( pt_type, order, dt, poly ) - ddPointType pt_type; - ddUSHORT order; - float dt; - double poly[MAXORD][MAXORD]; -{ - int i, j, k; - double fd[MAXORD]; - double sptofd[MAXORD][MAXORD]; - double dtpow[MAXORD]; - - register double a0; - - dtpow[0] = 1.0; /* make scale matrix */ - for ( i = 1; i < order; i++ ) - dtpow[i] = dtpow[i-1] * dt; - - for ( i = 0; i < order; i++ ) /* scale matrix x fwd matrix */ - for (j = i; j < order; j++ ) - sptofd[i][j] = mi_nu_ptofd[i][j] * dtpow[j]; - - for ( i = 0; i < 3; i++ ) { /* x, y, z */ - for ( j = 0; j < order; j++ ) { - a0 = 0.0; - for ( k = j; k < order; k++ ) - a0 += sptofd[j][k] * poly[i][k]; - fd[j] = a0; - } - for ( j = 0; j < order; j++ ) - poly[i][j] = fd[j]; - } - - if ( DD_IsVert4D(pt_type) ) { - for ( j = 0; j < order; j++ ) { - a0 = 0.0; - for ( k = j; k < order; k++ ) - a0 += sptofd[j][k] * poly[WW][k]; - fd[j] = a0; - } - for ( j = 0; j < order; j++ ) - poly[WW][j] = fd[j]; - } -} - - - -/*++ - | - | Function Name: ofd_curve - | - | Function Description: - | - | Note(s): - | - --*/ -static -void -ofd_curve( pt_type, order, knot, num_segs, dt, A, pts ) - ddPointType pt_type; - ddUSHORT order; - ddFLOAT *knot; - int num_segs; - float dt; - register double A[4][MAXORD]; - char *pts; -{ - register int i, j; - register int point_size; - - DD_VertPointSize(pt_type, point_size); - - /* Move to the first point of the span. */ - ((ddCoord4D *)pts)->x = A[XX][0]; - ((ddCoord4D *)pts)->y = A[YY][0]; - ((ddCoord4D *)pts)->z = A[ZZ][0]; - ((ddCoord4D *)pts)->w = A[WW][0]; - pts += point_size; - - for ( i = 1; i <= num_segs; i++ ) { /* number of steps */ - for ( j = 0; j < order - 1; j++ ) { /* forward difference */ - A[XX][j] += A[XX][j+1]; - A[YY][j] += A[YY][j+1]; - } - - ((ddCoord4D *)pts)->x = A[XX][0]; - ((ddCoord4D *)pts)->y = A[YY][0]; - - if ( !DD_IsVert2D(pt_type) ) { - - for ( j = 0; j < order - 1; j++ ) - A[ZZ][j] += A[ZZ][j+1]; - - ((ddCoord4D *)pts)->z = A[ZZ][0]; - - if ( DD_IsVert4D(pt_type) ) { - - for ( j = 0; j < order - 1; j++ ) - A[WW][j] += A[WW][j+1]; - - ((ddCoord4D *)pts)->w = A[WW][0]; - } - } - - pts += point_size; - } - - return; -} - - - -/*++ - | - | Function Name: nu_compute_nurb_curve - | - | Function Description: - | - | Note(s): - | - --*/ -static -ddpex3rtn -nu_compute_nurb_curve( pddc, curve, aptype, apval, curve_list ) - miDDContext *pddc; - miNurbStruct *curve; - int aptype; - ddFLOAT apval; - miListHeader **curve_list; -{ - ddUSHORT order = curve->order; - int i; - - miListHeader *control_points = &curve->points; - ddFLOAT (*rknots)[MAXORD]=0; /* reciprocal of knot diff */ - double C[MAXORD][MAXORD]; /* bspline to poly matrix */ - double A[4][MAXORD]; /* xyzw curve coefficients */ - int numKnots; /* number of knots aftetr insertion */ - int numnewKnots; - ddFLOAT *knots = 0; /* new knots after insertion */ - ddCoord4D *cpts = 0; /* new ctrl pts after insertion */ - ddCoord4D *out_pts; /* output data pointer */ - listofddPoint *pddlist; /* data list pointer */ - int num_cpts, num_subsegs, num_additional_knots; - float additional_knots[2]; - float dt; - - if (curve->numKnots != control_points->ddList->numPoints + order) - return 0; - - if ( !(curve->numKnots > 0 && control_points->ddList->numPoints > 0) ) - return 0; - - /* Trimming by knot insertion (if needed). */ - num_additional_knots = 0; - if ( curve->uMin > curve->pKnots[order-1] ) - additional_knots[num_additional_knots++] = curve->uMin; - - if ( curve->uMax < curve->pKnots[curve->numKnots - order] ) - additional_knots[num_additional_knots++] = curve->uMax; - - if ( num_additional_knots > 0 ) { - - if ( !( knots = (ddFLOAT *) - xalloc((num_additional_knots + curve->numKnots)*sizeof(float)))) - goto no_mem; - - if ( !( cpts = (ddCoord4D *) - xalloc( (num_additional_knots + control_points->ddList->numPoints) - * sizeof(ddCoord4D))) ) - goto no_mem; - - numnewKnots = num_additional_knots; - for ( i = 0; i < num_additional_knots; i++ ) - knots[i] = additional_knots[i]; - - if ( !mi_nu_insert_knots( order, control_points->type, - curve->numKnots, curve->pKnots, - (ddFLOAT *)(control_points->ddList->pts.ptr), - &numnewKnots, knots, - (ddFLOAT *)cpts ) ) - goto no_mem; - - numKnots = numnewKnots; - num_cpts = numnewKnots - order; - - } else { - - numKnots = curve->numKnots; - knots = curve->pKnots; - num_cpts = numKnots - order; - cpts = control_points->ddList->pts.p4Dpt; - } - - - - /* Build the tessellation. */ - if ( order > MAXORD || order == 1 ) { - - /* - * if order > MAXORD, Draw only the control polygon. - * if order == 1, draw point at each control point. - */ - *curve_list = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER((*curve_list), 1); - - if ( DD_IsVert4D(control_points->type) ) { - - ddCoord4D *in_pt4D, *out_pt4D; - - (*curve_list)->type = DDPT_4D; - MI_ALLOCLISTOFDDPOINT( (*curve_list)->ddList, num_cpts, - sizeof(ddCoord4D) ); - out_pt4D = (*curve_list)->ddList->pts.p4Dpt; - if ( !out_pt4D ) return(BadAlloc); - in_pt4D = cpts; - - for ( i = 0; i < num_cpts; i++ ) *(out_pt4D++) = *(in_pt4D++); - - } else if ( DD_IsVert3D(control_points->type) ) { - - ddCoord3D *in_pt3D, *out_pt3D; - - (*curve_list)->type = DDPT_3D; - MI_ALLOCLISTOFDDPOINT( (*curve_list)->ddList, num_cpts, - sizeof(ddCoord3D) ); - out_pt3D = (*curve_list)->ddList->pts.p3Dpt; - if ( !out_pt3D ) return(BadAlloc); - in_pt3D = (ddCoord3D *)cpts; - - for ( i = 0; i < num_cpts; i++ ) *(out_pt3D++) = *(in_pt3D++); - - } else { - - ddCoord2D *in_pt2D, *out_pt2D; - - (*curve_list)->type = DDPT_2D; - MI_ALLOCLISTOFDDPOINT( (*curve_list)->ddList, num_cpts, - sizeof(ddCoord2D) ); - out_pt2D = (*curve_list)->ddList->pts.p2Dpt; - if ( !out_pt2D ) return(BadAlloc); - in_pt2D = (ddCoord2D *)cpts; - - for ( i = 0; i < num_cpts; i++ ) *(out_pt2D++) = *(in_pt2D++); - - } - - } else { /* ( order > 1 and <= MAXORD ) */ - - switch( aptype ) { - case PEXApproxImpDep: - case PEXApproxConstantBetweenKnots: - default: - if ( apval <= 0.0 ) { - dt = 1.0; - num_subsegs = 1; - - } else { - dt = 1.0 / (apval + 1.0); - num_subsegs = apval + 1; /* assume it's been clamped */ - } - - if ( !( rknots = (ddFLOAT (*)[MAXORD]) - xalloc( MAXORD * numKnots * sizeof(float))) ) - goto no_mem; - - mi_nu_preprocess_knots( order, numKnots, knots, rknots ); - - /* build a new list for each span */ - (*curve_list) = MI_NEXTTEMPDATALIST(pddc); - (*curve_list)->type = control_points->type; - (*curve_list)->numLists = 0; - MI_ALLOCLISTHEADER((*curve_list), num_cpts); - if (!(pddlist = (*curve_list)->ddList )) return(BadAlloc); - - for ( i = order - 1; i < num_cpts; i++ ) { - if ( knots[i+1] > knots[i] - && knots[i] >= curve->uMin - && knots[i+1] <= curve->uMax ) - { - mi_nu_compute_nurb_basis_function( order, i, - knots, rknots, C ); - multiply_basis_func_control_pts( control_points->type, - order, i, - (char *)cpts, C, A ); - compute_fwd_matrix2D( control_points->type,order,dt,A ); - - MI_ALLOCLISTOFDDPOINT(pddlist, num_subsegs + 1, - sizeof(ddCoord4D)); - if (!(out_pts = pddlist->pts.p4Dpt)) - return(BadAlloc); - - ofd_curve( control_points->type, order, &knots[i], - num_subsegs, dt, A, (char *)out_pts ); - - (pddlist++)->numPoints = num_subsegs + 1; - (*curve_list)->numLists += 1; - } - } - - break; - } /* end switch on approx type */ - } - - if (knots != curve->pKnots) xfree(knots); - if (cpts != control_points->ddList->pts.p4Dpt) xfree(cpts); - xfree(rknots); - - return 0; - -no_mem: - if ((knots)&&(knots != curve->pKnots)) xfree(knots); - if ((cpts)&&(cpts != control_points->ddList->pts.p4Dpt)) xfree(cpts); - if (rknots) xfree(rknots); - - return (BadAlloc); -} - - - -/*++ - | - | Function Name: compute_adaptive_crv_interval - | - | Function Description: - | - | Note(s): - | - --*/ -static -ddpex3rtn -compute_adaptive_crv_interval( pddc, curve, xform, apxval ) - miDDContext *pddc; - miNurbStruct *curve; - ddFLOAT xform[4][4]; - ddFLOAT *apxval; -{ - ddFLOAT a_coeff, b_coeff, c_coeff, denom, z1, z2, z3; - int i, use_z_coord = 0; - int npts = curve->points.ddList->numPoints; - ddCoord4D *xpts, *pa, *pb, *pc; - ddPointUnion in_pt; - double w, perp_d, max_perp_d = 0.0; - miListHeader *tmp_list; - int point_size; - ddpex3rtn status; - - /* - * Compute the constant parametric between knots interval needed to - * come close to meeting the specified approximation criteria. The - * method used is a gross compromise for the adaptive approximation - * criteria, but fulfills the basic need for an adaptive approximation - * method. - * Note that for the NPC approximation criteria NPC isn't even the space - * being used, it's clipping space, which is [-1,1], [-1,1], [0,1]. - * The Z component is ignored in this case though since the Z dimension - * is perpendicular to the screen. - */ - *apxval = 0.0; - switch ( pddc->Static.attrs->curveApprox.approxMethod ) { - case PEXApproxNpcChordalSize: - case PEXCurveApproxNpcChordalDev: - use_z_coord = 0; - break; - - case PEXApproxWcsChordalSize: - case PEXCurveApproxWcsChordalDev: - use_z_coord = 1; - break; - } - - if ( xform ) { - if (status = miTransform( pddc, &curve->points, &tmp_list, - xform, NULL4x4, DD_HOMOGENOUS_POINT)) - return (status); - - /* Normalize result by w */ - xpts = tmp_list->ddList->pts.p4Dpt; - for ( i = 0, pa = xpts; i < npts; i++, pa++ ) { - w = 1.0 / pa->w; - pa->x *= w; pa->y *= w; - if ( use_z_coord ) pa->z *= w; - } - - } else { - - DD_VertPointSize(curve->points.type, point_size); - - if ( !( xpts = (ddCoord4D *)xalloc(npts * sizeof(ddCoord4D))) ) { - return BadAlloc; - } - - if ( DD_IsVert4D(curve->points.type) ) { - - /* if homogeneous values, then normalize by w */ - for ( i = 0, in_pt.p4Dpt = curve->points.ddList->pts.p4Dpt, pa = xpts; - i < npts; - i++ ) { - - w = 1.0 / in_pt.p4Dpt->w; - pa->x = in_pt.p4Dpt->x * w; - pa->y = in_pt.p4Dpt->y * w; - if ( use_z_coord ) pa->z = in_pt.p4Dpt->z * w; - - in_pt.ptr += point_size; - pa++; - } - - } else { - - if ( DD_IsVert2D(curve->points.type) ) use_z_coord = 0; - - /* Copy 2D or 3D points into 4D array */ - for ( i = 0, in_pt.p4Dpt = curve->points.ddList->pts.p4Dpt, pa = xpts; - i < npts; - i++ ) { - - pa->x = in_pt.p4Dpt->x; - pa->y = in_pt.p4Dpt->y; - if ( use_z_coord ) pa->z = in_pt.p4Dpt->z; - - in_pt.ptr += point_size; - pa++; - } - - } - - } - - /* - * For the above approx. types, the approx. value is the max. allowable - * distance between the actual curve and the generated chord. - * The distance of the ctrl point from the line joining the ctrl pts on - * either side of it is calculated for every ctrl pt. This is calculated - * in 2D. For approx. in WC, the 3D length is got from the 2D-length - * and the z values of the ctrl pts. The max of all these lengths is - * found. The final approx. value is obtd. from the ratio of the max length - * and the required approx. value. - */ - - pa = xpts; pb = pa + 2, pc = pa + 1; - for ( i = 1; i < npts-1; i++, pa++, pb++, pc++ ) { - a_coeff = pb->y - pa->y; - b_coeff = pa->x - pb->x; - c_coeff = pb->x * pa->y - pa->x * pb->y; - denom = ( a_coeff * a_coeff + b_coeff * b_coeff ); - perp_d = (a_coeff * pc->x + b_coeff * pc->y + c_coeff); - if ( use_z_coord ) { - z1 = pc->z; - z2 = (pa->z + pb->z) /2.0; - z3 = z1 - z2; - perp_d = sqrt( (perp_d * perp_d + z3 * z3 * denom) /denom ); - } else - perp_d = perp_d/ (sqrt(denom)); - perp_d = fabs(perp_d); - if ( perp_d > max_perp_d ) - max_perp_d = perp_d; - } - - *apxval = (int)(1 + sqrt( 10*max_perp_d / - (pddc->Static.attrs->curveApprox.tolerance > 0.0 - ? pddc->Static.attrs->curveApprox.tolerance : 0.01))); - - if (xpts != tmp_list->ddList->pts.p4Dpt) xfree(xpts); - - return Success; -} - -/*++ - | - | Function Name: tessellate_curve - | - | Function Description: - | - | Note(s): - | - --*/ -ddpex3rtn -tessellate_curve( pddc, curve, curve_list, xform ) - miDDContext *pddc; - miNurbStruct *curve; - miListHeader **curve_list; - ddFLOAT xform[4][4]; -{ - int approx_type; - ddFLOAT approx_value; - ddpex3rtn status = 0; /* !0 if successful */ - - if ( curve->points.ddList->numPoints <= 0 ) - return status; - - switch ( pddc->Static.attrs->curveApprox.approxMethod ) { - case PEXApproxImpDep: - case PEXApproxConstantBetweenKnots: - approx_type = PEXApproxConstantBetweenKnots; - approx_value=MAX((int)pddc->Static.attrs->curveApprox.tolerance,0); - break; - - case PEXApproxWcsChordalSize: - case PEXApproxNpcChordalSize: - case PEXCurveApproxWcsChordalDev: - case PEXCurveApproxNpcChordalDev: - /* The same approximation method is used for all these - * approximation types, and it's not exactly any of them. - * But the method used serves the same purpose and - * PHIGS PLUS allows us to approximate the defined methods. - */ - approx_type = PEXApproxConstantBetweenKnots; - compute_adaptive_crv_interval( pddc, curve, xform, - &approx_value ); - break; - - default: - approx_type = PEXApproxConstantBetweenKnots; - approx_value = 1.0; - break; - } - - return(nu_compute_nurb_curve( pddc, curve, - approx_type, approx_value, - curve_list )); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c:3.7 Fri Dec 14 14:57:28 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c Sat Feb 28 21:41:54 2004 @@ -1,1947 +0,0 @@ -/* $Xorg: miNSTrim.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSTrim.c,v 3.7 2001/12/14 19:57:28 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "miRender.h" -#include "PEXErr.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miNurbs.h" -#include "pexos.h" - -#define INACTIVE 0 - -#define NEW_SEG( _td ) \ - ((Nurb_trim_segment *)xalloc( sizeof(Nurb_trim_segment) )) - -/*++ - | - | Function Name: phg_nt_free_trim_data - | - | Function Description: - | - | frees data allocated during the triming process. - | - | Note(s): - | - --*/ - -void -phg_nt_free_trim_data( tdata ) - register Nurb_trim_data *tdata; -{ - - register int i; - register Nurb_trim_segment *seg, *next_seg; - - for ( i = 0; i < tdata->nloops; i++ ) { - for ( seg = tdata->loops[i].segs; seg; seg = next_seg ) { - next_seg = seg->next; - xfree( seg ); - } - } - tdata->nloops = 0; - - if ( tdata->vertices ) { - xfree( tdata->vertices ); - tdata->vertices = (Nurb_param_point *)NULL; - } - if ( tdata->loops ) { - xfree( tdata->loops ); - tdata->loops = (Nurb_trim_loop_rep *)NULL; - } - if ( tdata->ep_list_size > 0 ) { - xfree( tdata->ep_list ); - tdata->ep_list_size = 0; - tdata->ep_list = (Nurb_edge_point *)NULL; - } -} - - - -#define CHUNK_SIZE 5 - -/*++ - | - | Function Name: grow_range_list - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -grow_range_list( itr, inters ) - int itr; - double **inters; -{ - if ( itr == 0 ) - *inters = (double *)xalloc( CHUNK_SIZE * sizeof(double) ); - else - *inters = (double *)xrealloc( *inters, - (itr + CHUNK_SIZE) * sizeof(double) ); - - return (*inters ? Success : BadAlloc); -} - -/*++ - | - | Function Name: compute_intersections - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -compute_intersections( state, dir, s, inters, inter_count ) - Nurb_surf_state *state; - int dir; /* coordinate direction, 1 ==> U, 2 ==> V */ - double s; - double **inters; - int *inter_count; -{ - register int i, j; - register int itr; - register Nurb_trim_data *tdata; - register Nurb_trim_segment *cur; - register Nurb_param_limit *ext; - register Nurb_param_point *trim_pts; - register double pa, pb, pc, pd; - register double alpha; - - itr = 0; - tdata = &state->trim_data; - trim_pts = tdata->vertices; - - for ( i = 0; i < tdata->nloops; i++ ) { - ext = &tdata->loops[i].extent; - if ( (dir == 1 && s > ext->umin && s <= ext->umax ) - || (dir == 2 && s > ext->vmin && s <= ext->vmax ) ) { - for ( cur = tdata->loops[i].segs; cur; cur = cur->next ) { - ext = &cur->extent; - if ( (dir == 1 && s > ext->umin && s <= ext->umax ) - || (dir == 2 && s > ext->vmin && s <= ext->vmax ) ) { - for ( j = cur->first; j < cur->last; j++ ) { - if ( dir == 1 ) { /* U direction */ - pa = trim_pts[j].u; pb = trim_pts[j+1].u; - pc = trim_pts[j].v; pd = trim_pts[j+1].v; - } else { /* V direction */ - pa = trim_pts[j].v; pb = trim_pts[j+1].v; - pc = trim_pts[j].u; pd = trim_pts[j+1].u; - } - if ( s > pa && s <= pb || s > pb && s <= pa ) { - if ( itr % CHUNK_SIZE == 0 ) - if ( grow_range_list( itr, inters ) ) { - return (BadAlloc); - } - alpha = (s - pa) / (pb - pa); - (*inters)[itr++] = pc + alpha * (pd - pc); - } - } - } - } - } - } - - *inter_count = itr; - return ( Success ); -} -#undef CHUNK_SIZE - - - -/*++ - | - | Function Name: phg_nt_compute_trim_range - | - | Function Description: - | - | Note(s): - | - --*/ - -int -phg_nt_compute_trim_range( state, dir, s, knot_min, knot_max, - ranges, trim_range_count ) - Nurb_surf_state *state; - int dir; /* coordinate direction, 1 ==> U, 2 ==> V */ - double s; - double knot_min; - double knot_max; - Nurb_limitlst *ranges; - int *trim_range_count; -{ - /* -1 ==> paint entire curve - * 0 ==> discard the curve - * >0 ==> paint in between trim ranges - */ - - int inter_count; - double tmp; - double *intersections = (double *)NULL; - int trim_ranges = -1; - int status; - - register int i, j; - - if ( state->trim_data.nloops <= 0 ) { - *trim_range_count = -1; - return ( Success ); - } - - if ( status = compute_intersections( state, dir, s, - &intersections, &inter_count )) - return(status); - - if ( inter_count == -1 || inter_count == 0 ) { - /* All painted or none painted. */ - trim_ranges = inter_count; - - } else if ( inter_count == 1 && intersections[0] <= knot_min ) { - /* All painted */ - trim_ranges = -1; - - } else { - ranges->number = 0; - if ( inter_count % 2 == 1 ) { - /* Odd number of intersections. */ - intersections[inter_count] = 1.0E30; - } - - if ( inter_count > 0 ) { - /* Get space for range values. */ - if ( inter_count > ranges->size ) { - if ( ranges->size <= 0 ) { - ranges->size = inter_count; - ranges->limits = (Nurb_limit *) - xalloc( ranges->size * sizeof(Nurb_limit) ); - } else { - ranges->size = inter_count; - ranges->limits = (Nurb_limit *) xrealloc( ranges->limits, - ranges->size * sizeof(Nurb_limit) ); - } - - if ( ! ranges->limits ) { - ranges->size = 0; - xfree( intersections ); - return ( BadAlloc ); - } - } - } - - if ( inter_count > 1 ) { - /* Sort intersections, lowest to highest. */ - for ( j = 0; j < inter_count-1; j++ ) { - for ( i = j+1; i < inter_count; i++ ) { - if ( intersections[j] > intersections[i] ) { - tmp = intersections[i]; - intersections[i] = intersections[j]; - intersections[j] = tmp; - } - } - } - } - - /* Compute trim ranges. */ - for ( j = 0; j < inter_count; ) { - if ( intersections[j] >= knot_max ) { - /* Out of range, not painted. */ - break; - } else { - if ( intersections[j] <= knot_min ) - ranges->limits[ranges->number].lmin = knot_min; - else - ranges->limits[ranges->number].lmin = intersections[j]; - ++j; - - if ( intersections[j] >= knot_min ) { - if ( intersections[j] >= knot_max) - ranges->limits[ranges->number].lmax = knot_max; - else - ranges->limits[ranges->number].lmax = intersections[j]; - ++ranges->number; - } - ++j; - } - } - trim_ranges = ranges->number; - } - - if ( intersections ) - xfree( intersections ); - - *trim_range_count = trim_ranges; - - return( Success ); -} - - - -/*++ - | - | Function Name: evaluate_trim_curve - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -evaluate_trim_curve( crv, span, t, p ) - ddTrimCurve *crv; - int span; - double t; - ddCoord3D *p; -{ - ddCoord3D temp_points[MAXORD] ; - double alpha; - - register int i, j, k, left; - register int order = crv->order; - register ddFLOAT *knots = crv->pKnots; - register ddCoord3D *tmp; - char rat; - - /* Find the span where t belongs if not specified. */ - if ( span ) - left = span - order; - else { - left = crv->numKnots - 1; - if ( knots[left] == t ) - while ( knots[left] >= t ) - --left; - else - while ( knots[left] > t ) - --left; - left -= order - 1; - } - - /* Note that 3D implies homogeneous for trim curves */ - rat = DD_IsVert3D(crv->pttype); - - if (rat) { - ddCoord3D *cpts3; - - /* Copy points to temp space. */ - cpts3 = &crv->points.pts.p3Dpt[left]; - tmp = temp_points; - memcpy( (char *)tmp, (char *)cpts3, order * sizeof(ddCoord3D) ); - - } else { - ddCoord2D *cpts2; - - /* Copy points to temp space. */ - cpts2 = &crv->points.pts.p2Dpt[left]; - tmp = temp_points; - for ( i = 0; i < order; i++, cpts2++, tmp++ ) { - tmp->x = cpts2->x; - tmp->y = cpts2->y; - tmp->z = 1.0; - } - - } - - /* Evaluate the span. */ - tmp = temp_points; - for ( k = 1; k < order; k++ ) { - for ( j = order-1; j >= k; j-- ) { - i = left + j; - alpha = (t - knots[i]) / (knots[i+order-k] - knots[i]); - tmp[j].x = tmp[j-1].x + alpha * (tmp[j].x - tmp[j-1].x); - tmp[j].y = tmp[j-1].y + alpha * (tmp[j].y - tmp[j-1].y); - if ( rat ) - tmp[j].z = tmp[j-1].z + alpha * (tmp[j].z - tmp[j-1].z); - } - } - - p->x = tmp[order-1].x; - p->y = tmp[order-1].y; - p->z = ( ( rat ) ? tmp[order-1].z : 1.0 ); -} - - - -#define ADD_TRIM_POINT( _r, _u, _v, _w ) \ - { \ - if ( (_r) ) { \ - tdata->vertices[tdata->cur_vertex].u = (_u) / (_w); \ - tdata->vertices[tdata->cur_vertex].v = (_v) / (_w); \ - } else { \ - tdata->vertices[tdata->cur_vertex].u = (_u); \ - tdata->vertices[tdata->cur_vertex].v = (_v); \ - } \ - ++tdata->cur_vertex; \ - } - -/*++ - | - | Function Name: add_trim_curve - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -add_trim_curve( state, crv, tdata, seg ) - Nurb_surf_state *state; - ddTrimCurve *crv; - Nurb_trim_data *tdata; - Nurb_trim_segment *seg; -{ - double t, dt; - double tmin = crv->uMin; - double tmax = crv->uMax; - double left, right; - ddCoord3D p; - char rat; - - int i; - ddFLOAT *knots = crv->pKnots; - ddFLOAT tolerance; - - /* Initialize segment and store location of first curve vertex. */ - seg->vis = crv->visibility; - seg->start = tdata->cur_vertex; - seg->first = seg->start; - - /* Note that 3D implies homogeneous for trim curves */ - rat = DD_IsVert3D(crv->pttype); - - /* Tessellate the trim curve and add the points to the vertex list. */ - - /* Special case second order (linear) curves. */ - if ( crv->order == 2 ) { - double alpha, beta; - - if (rat) { - - ddCoord3D *pts3 = crv->points.pts.p3Dpt; - - /* Find first interval of interest. */ - if (tmin < knots[1]) tmin = knots[1]; - for ( i = 2; knots[i] <= tmin; i++ ) - ; - - /* First point. */ - alpha = (tmin - knots[i-1]) / (knots[i] - knots[i-1]); - beta = 1.0 - alpha; - p.x = beta * pts3[i-2].x + alpha * pts3[i-1].x; - p.y = beta * pts3[i-2].y + alpha * pts3[i-1].y; - p.z = beta * pts3[i-2].z + alpha * pts3[i-1].z; - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - - /* Interior points. */ - if (tmax > knots[crv->numKnots - 2]) tmax = knots[crv->numKnots - 2]; - for ( ; knots[i] < tmax; i++ ) { - ADD_TRIM_POINT( rat, pts3[i-1].x, pts3[i-1].y, pts3[i-1].z ) - } - - /* Last point. */ - alpha = (tmax - knots[i-1]) / (knots[i] - knots[i-1]); - beta = 1.0 - alpha; - p.x = beta * pts3[i-2].x + alpha * pts3[i-1].x; - p.y = beta * pts3[i-2].y + alpha * pts3[i-1].y; - p.z = beta * pts3[i-2].z + alpha * pts3[i-1].z; - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - - } else { - - ddCoord2D *pts2 = crv->points.pts.p2Dpt; - - /* Find first interval of interest. */ - if (tmin < knots[1]) tmin = knots[1]; - for ( i = 2; knots[i] <= tmin; i++ ) - ; - - /* First point. */ - alpha = (tmin - knots[i-1]) / (knots[i] - knots[i-1]); - beta = 1.0 - alpha; - p.x = beta * pts2[i-2].x + alpha * pts2[i-1].x; - p.y = beta * pts2[i-2].y + alpha * pts2[i-1].y; - ADD_TRIM_POINT( rat, p.x, p.y, 1.0 ); - - /* Interior points. */ - if (tmax > knots[crv->numKnots - 2]) tmax = knots[crv->numKnots - 2]; - for ( ; knots[i] < tmax; i++ ) { - ADD_TRIM_POINT( rat, pts2[i-1].x, pts2[i-1].y, 1.0 ) - } - - /* Last point. */ - alpha = (tmax - knots[i-1]) / (knots[i] - knots[i-1]); - beta = 1.0 - alpha; - p.x = beta * pts2[i-2].x + alpha * pts2[i-1].x; - p.y = beta * pts2[i-2].y + alpha * pts2[i-1].y; - ADD_TRIM_POINT( rat, p.x, p.y, 1.0 ); - } - - } else if ( crv->order > MAXTCORD || crv->order < 2) { /* unsupported */ - /* Use untrimmed control polygon. */ - if (rat) { - ddCoord3D *pts3 = crv->points.pts.p3Dpt; - for ( i = 0; i < crv->points.numPoints; i++ ) - ADD_TRIM_POINT(rat, pts3[i].x, pts3[i].y, pts3[i].z ); - } else { - ddCoord2D *pts2 = crv->points.pts.p2Dpt; - for ( i = 0; i < crv->points.numPoints; i++ ) - ADD_TRIM_POINT(rat, pts2[i].x, pts2[i].y, 1.0 ); - } - - } else { /* supported order > 2 */ - GET_TRIM_CURVE_TOLERANCE(crv, tolerance); - -#ifdef BWEE - if ( crv->curveApprox.approxMethod == PCURV_CONSTANT_PARAMETRIC ) { - /* First point. */ - evaluate_trim_curve( crv, 0, tmin, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - - /* Interior points. */ - dt = (tmax - tmin) / (tolerance + 1); - for ( t = tmin + dt; t < tmax; t += dt ) { - evaluate_trim_curve( crv, 0, t, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - } - - /* Last point. */ - evaluate_trim_curve( crv, 0, tmax, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - - } else -#endif /* BWEE */ - - { - - for ( i = crv->order - 1; i < crv->points.numPoints; i++ ) { - if ( knots[i] != knots[i+1] - && knots[i] <= tmax && knots[i+1] >= tmin ) { - left = knots[i]; - right = knots[i+1]; - dt = (right - left) / (tolerance + 1); - t = left; - - /* If interval contains tmin get first point(s). */ - if ( left <= tmin && right >= tmin ) { - while ( t < tmin ) - t += dt; - evaluate_trim_curve( crv, i+1, tmin, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - if ( t > tmin ) { - evaluate_trim_curve( crv, i+1, t, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - } - t += dt; - } - - /* Interior points. */ - while ( t < right && t < tmax ) { - evaluate_trim_curve( crv, i+1, t, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - t += dt; - } - - /* If interval contains tmax get last point. */ - if ( left <= tmax && right >= tmax ) { - evaluate_trim_curve( crv, i+1, tmax, &p ); - ADD_TRIM_POINT( rat, p.x, p.y, p.z ); - break; /* all done */ - } - } - } - } - } - - /* Store location of last vertex */ - seg->end = tdata->cur_vertex - 1; - seg->last = seg->end; - seg->next = NULL; -} - - - -#define CONNECT(_pa, _pb) \ - { \ - (_pb).u = (_pa).u; \ - (_pb).v = (_pa).v; \ - } - -/*++ - | - | Function Name: connect_trim_endpoints - | - | Function Description: - | - | Insures that a list of tesselated trim curve segments - | forms a closed loop. - | - | Note(s): - | - --*/ - -static void -connect_trim_endpoints( tdata, seglist ) - Nurb_trim_data *tdata; - register Nurb_trim_segment *seglist; /* linked list of segments */ -{ - register Nurb_param_point *trim_pts = tdata->vertices; - register Nurb_trim_segment *cur; - - /* Connect the tail of each curve to the head of the following curve. */ - for ( cur = seglist; cur; cur = cur->next ) { - if ( cur->next ) - CONNECT( trim_pts[cur->last], trim_pts[cur->next->first] ) - else /* tail of last one to head of first one */ - CONNECT( trim_pts[seglist->first], trim_pts[cur->last] ) - } -} - - - -/*++ - | - | Function Name: make_segments_monotonic - | - | Function Description: - | - | Each curve segment description is traversed and, if - | necessary, subdivided into smaller segments until - | each remaining segment in the list of segments contains - | only monotonically increasing or decreasing (in both u & v) - | line segments (in other words, there are no changes in sign - | in the slope in either u and v in any segment). - | - | Note(s): - | - --*/ - -static int -make_segments_monotonic( tdata, tdloop ) - Nurb_trim_data *tdata; - Nurb_trim_loop_rep *tdloop; -{ - unsigned old_u, old_v, u_direc, v_direc; - - register int top, bot, mid; - register Nurb_param_point *trim_pts = tdata->vertices; - register Nurb_trim_segment *cur, *new; - - for ( cur = tdloop->segs; cur; cur = cur->next ) { - top = cur->first; - mid = top; - bot = cur->last; - old_u = old_v = 0; - while (1) { - ++mid ; - if ( trim_pts[mid].u > trim_pts[top].u) - u_direc = 1; - else if ( trim_pts[mid].u < trim_pts[top].u ) - u_direc = 2; - else - u_direc = old_u; - - if ( trim_pts[mid].v > trim_pts[top].v ) - v_direc = 1; - else if ( trim_pts[mid].v < trim_pts[top].v ) - v_direc = 2; - else - v_direc = old_v; - - if ( (u_direc | old_u) == 3 || (v_direc | old_v) == 3 ) { - cur->dir = ((old_u < 2) << 1) | (old_v < 2); - if ( !(new = NEW_SEG( tdata )) ) - return BadAlloc; /* RETURN */ - - new->next = cur->next; - cur->next = new; - cur->end = cur->last = top; - new->start = new->first = top; - new->end = new->last = bot; - new->vis = cur->vis; - cur = new; - old_u = old_v = 0; - } - old_u = u_direc; - old_v = v_direc; - if ( mid == bot ) { /* LOOP EXIT CONDITION */ - cur->dir = ((old_u < 2) << 1) | (old_v < 2); - break; - } - top = mid; - } /* while (1) */ - } - - return Success; -} - - - -/*++ - | - | Function Name: compute_trim_curve_extents - | - | Function Description: - | - | This function computes a trim loop extent - | as well as the extents of each of the segments - | in the loop. - | - | Note(s): - | - --*/ - -static void -compute_trim_curve_extents( tdata, tdloop ) - Nurb_trim_data *tdata; - Nurb_trim_loop_rep *tdloop; -{ - double umin, vmin, umax, vmax; - - register int top, bot; - register Nurb_param_point *trim_pts = tdata->vertices; - register Nurb_trim_segment *cur; - - umin = vmin = 1.0E30; /* large number */ - umax = vmax = -umin; - /* Assumes each segment is monotonic in both directions. */ - for ( cur = tdloop->segs; cur; cur = cur->next ) { - if ( cur->start == INACTIVE || cur->end == INACTIVE ) - continue; - top = cur->start; - bot = cur->end; - - if ( trim_pts[top].u >= trim_pts[bot].u ) { - cur->extent.umin = trim_pts[bot].u; - cur->extent.umax = trim_pts[top].u; - } else { - cur->extent.umin = trim_pts[top].u; - cur->extent.umax = trim_pts[bot].u; - } - - if ( trim_pts[top].v >= trim_pts[bot].v ) { - cur->extent.vmin = trim_pts[bot].v; - cur->extent.vmax = trim_pts[top].v; - } else { - cur->extent.vmin = trim_pts[top].v; - cur->extent.vmax = trim_pts[bot].v; - } - - if ( cur->extent.umin < umin ) - umin = cur->extent.umin; - if ( cur->extent.umax > umax ) - umax = cur->extent.umax; - if ( cur->extent.vmin < vmin ) - vmin = cur->extent.vmin; - if ( cur->extent.vmax > vmax ) - vmax = cur->extent.vmax; - } - tdloop->extent.umin = umin; - tdloop->extent.umax = umax; - tdloop->extent.vmin = vmin; - tdloop->extent.vmax = vmax; -} - - - -/*++ - | - | Function Name: phg_nt_install_trim_loops - | - | Function Description: - | - | this routine creates a linked list of sorted tesselated - | curve segments as a prelude to trimming. - | - | Note(s): - | - --*/ - -int -phg_nt_install_trim_loops( surface, state ) - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; -{ - int interval_count; - listofTrimCurve *loop; - Nurb_trim_segment *seg; - - int i, j; - Nurb_trim_data *tdata = &state->trim_data; - ddTrimCurve *crv; - Nurb_trim_loop_rep *tdloop; - Nurb_trim_segment **last_segp; - ddFLOAT tolerance; - - /* Determine sizes for initial memory allocations. */ - interval_count = 0; - loop = surface->trimCurves; - for ( i = 0; i < surface->numTrimCurveLists; i++, loop++ ) { - crv = loop->pTC; - for (j = 0; j < loop->count; j++, crv++) { - GET_TRIM_CURVE_TOLERANCE( crv, tolerance ); - interval_count += (crv->points.numPoints * (tolerance + 4)); - } - } - - if ( ! (tdata->vertices = (Nurb_param_point *) - xalloc( interval_count * sizeof(tdata->vertices[0]) )) ) - goto abort; - - if ( ! (tdata->loops = (Nurb_trim_loop_rep *) - xalloc( surface->numTrimCurveLists * sizeof(tdata->loops[0]) )) ) - goto abort; - - /* Initialize the loop structures. */ - for ( i = 0; i < surface->numTrimCurveLists; i++ ) - tdata->loops[i].segs = (Nurb_trim_segment *)NULL; - - /* Build the initial (non-monotonic) trim curve segments. */ - for ( i = 0, loop = surface->trimCurves; - i < surface->numTrimCurveLists; i++, loop++ ) { - - tdloop = &tdata->loops[i]; - for ( j = 0, crv = loop->pTC; j < loop->count; j++, crv++ ) { - if ( !(seg = NEW_SEG( tdata )) ) - goto abort; - add_trim_curve( state, crv, tdata, seg ); - /* Add the new segment to the end of the list. */ - last_segp = &tdloop->segs; - while ( *last_segp ) - last_segp = &(*last_segp)->next; - *last_segp = seg; - - } - - ++tdata->nloops; - connect_trim_endpoints( tdata, tdloop->segs ); - if ( make_segments_monotonic( tdata, tdloop ) ) - goto abort; - compute_trim_curve_extents( tdata, tdloop ); - } - - return Success; - -abort: - phg_nt_free_trim_data( &state->trim_data ); - return BadAlloc; -} - - - -#ifdef NDEBUG - -#define PRINT_EXTENT( _e ) \ - fprintf( stderr, "extent: u = ( %f, %f), v = ( %f, %f)\n", \ - (_e).umin, (_e).umax, (_e).vmin, (_e).vmax ); - -/*++ - | - | Function Name: phg_nt_print_trim_rep_data - | - | Function Description: - | - | Note(s): - | - --*/ - -void -phg_nt_print_trim_rep_data( state ) - Nurb_surf_state *state; -{ - Nurb_trim_data *tdata = &state->trim_data; - Nurb_trim_loop_rep *loop; - Nurb_trim_segment *cur; - - register int i, j; - - fprintf( stderr, "Trim data: %d loops\n", tdata->nloops ); - loop = tdata->loops; - for ( i = 0; i < tdata->nloops; i++, loop++ ) { - fprintf( stderr, "loop %d\n", i ); - PRINT_EXTENT( loop->extent ) - for ( cur = loop->segs; cur; cur = cur->next ) { - fprintf( stderr, "\n\tsegment: visibility = %s, direction = %d\n", - cur->vis ? "PON" : "POFF", cur->dir ); - fprintf( stderr, "\tfirst = %d, last = %d, start = %d, end = %d\n", - cur->first, cur->last, cur->start, cur->end ); - fprintf( stderr, "\t" ); - PRINT_EXTENT( cur->extent ) - for ( j = cur->first; j <= cur->last; j++ ) - fprintf( stderr, "\t\t%3d: ( %10f, %10f)\n", j, - tdata->vertices[j].u, tdata->vertices[j].v ); - } - } -} -#endif /* NDEBUG */ - - - -/* Polygon Trimming Code */ - -#define INACTIVE 0 - -#define VISITED 4 -#define NEXT 2 -#define LAST 1 - -#define EP_LIST_CHUNK 10 /* must be >= 5 */ - -#define xin(_a,_b,_x) ((_x) >= (_a) && (_x) <= (_b)) - - -#define ROOM_IN_EP_LIST( _td ) \ - ( (_td)->ep_index < (_td)->ep_list_size || !grow_ep_list(_td) ) - -/*++ - | - | Function Name: grow_ep_list - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -grow_ep_list( tdata ) - Nurb_trim_data *tdata; -{ - /* TODO: Error reporting for failed allocations. */ - tdata->ep_list_size += EP_LIST_CHUNK; - if ( tdata->ep_list_size == EP_LIST_CHUNK ) - tdata->ep_list = (Nurb_edge_point *) xalloc( - EP_LIST_CHUNK * sizeof(Nurb_edge_point) ); - else - tdata->ep_list = (Nurb_edge_point *) xrealloc( tdata->ep_list, - tdata->ep_list_size * sizeof(Nurb_edge_point) ); - - if ( !tdata->ep_list ) - tdata->ep_list_size = 0; - - return (tdata->ep_list ? Success : BadAlloc); -} - - - -/*++ - | - | Function Name: linear_interpolate - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -linear_interpolate( alpha, rat, normflag, a, b, out ) - double alpha; - char rat; - unsigned normflag; - register Nurb_edge_point *a, *b, *out; -{ - out->pt.x = a->pt.x + (b->pt.x - a->pt.x) * alpha; - out->pt.y = a->pt.y + (b->pt.y - a->pt.y) * alpha; - out->pt.z = a->pt.z + (b->pt.z - a->pt.z) * alpha; - if ( rat ) - out->pt.w = a->pt.w + (b->pt.w - a->pt.w) * alpha; - if ( normflag ) { - out->normal.x = a->normal.x + (b->normal.x - a->normal.x) * alpha; - out->normal.y = a->normal.y + (b->normal.y - a->normal.y) * alpha; - out->normal.z = a->normal.z + (b->normal.z - a->normal.z) * alpha; - } -} - -/*++ - | - | Function Name: bilinear - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -bilinear( alpha, beta, rat, normflag, a, b, c, d, out ) - double alpha, beta; - char rat; - unsigned normflag; - Nurb_edge_point *a, *b, *c, *d; - Nurb_edge_point *out; -{ - Nurb_edge_point top, bot; - - linear_interpolate( alpha, rat, normflag, a, b, &top ); - linear_interpolate( alpha, rat, normflag, d, c, &bot ); - linear_interpolate( beta, rat, normflag, &top, &bot, out ); -} - - - -/*++ - | - | Function Name: append_pt - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -append_pt( tdata, normflag, rat, u, v, epa, epb, epc, epd ) - Nurb_trim_data *tdata; - unsigned normflag; - char rat; - double u, v; - int epa, epb, epc, epd; -{ - double alpha, beta; - int status = BadAlloc; - - register Nurb_edge_point *ep_list; - register Nurb_edge_point *cur_ep; - - if ( ROOM_IN_EP_LIST(tdata) ) { - ep_list = tdata->ep_list; - cur_ep = &ep_list[tdata->ep_index]; - cur_ep->u = u; cur_ep->v = v; - cur_ep->flags = 0; - alpha = (v - ep_list[epa].v) / (ep_list[epc].v - ep_list[epa].v); - beta = (u - ep_list[epa].u) / (ep_list[epc].u - ep_list[epa].u); - bilinear( alpha, beta, rat, normflag, &ep_list[epa], &ep_list[epb], - &ep_list[epc], &ep_list[epd], cur_ep ); - cur_ep->branch = 0; - cur_ep->prev = tdata->ep_index - 1; - cur_ep->next = tdata->ep_index + 1; - ++tdata->ep_index; - status = Success; - } - - return status; -} - - - -/*++ - | - | Function Name: insert_pt - | - | Function Description: - | - | This routine takes two indices into the - | Nurb_edge_point list, a point along one of the - | segment between the two edge points indicated - | by the two indices, and inserts a new edge - | point into the list corresponding to the - | supplied point. - | - | Inserting a new point means that the next and - | previous indices of the neighboring edge points are - | updated, and (x,y,z) and (if necessary) normal data - | is computed from the neighboring points for the new point. - | - | Note(s): - | - --*/ - -static int -insert_pt( tdata, normflag, rat, u, v, epa, epb, edge, branch ) - Nurb_trim_data *tdata; - unsigned normflag; - char rat; - int epa, epb; - double u, v; - int edge, branch; -{ - double alpha; - int status = BadAlloc; - - register int eptr; - register Nurb_edge_point *ep_list; - register Nurb_edge_point *cur_ep; - - if ( ROOM_IN_EP_LIST(tdata) ) { - ep_list = tdata->ep_list; - cur_ep = &ep_list[tdata->ep_index]; - cur_ep->u = u; cur_ep->v = v; - cur_ep->flags = 0; - switch ( edge ) { - case 0: - case 2: - alpha = (v - ep_list[epa].v)/(ep_list[epb].v - ep_list[epa].v); - break; - case 1: - case 3: - alpha = (u - ep_list[epa].u)/(ep_list[epb].u - ep_list[epa].u); - break; - default: - break; - } - linear_interpolate( alpha, rat, normflag, &ep_list[epa], - &ep_list[epb], cur_ep ); - eptr = epa; - while ( eptr != epb ) { - double a, e, b; - - switch ( edge ) { - case 0: - a = ep_list[eptr].v; - e = v; - b = ep_list[ep_list[eptr].next].v; - break; - case 1: - a = ep_list[eptr].u; - e = u; - b = ep_list[ep_list[eptr].next].u; - break; - case 2: - a = ep_list[ep_list[eptr].next].v; - e = v; - b = ep_list[eptr].v; - break; - case 3: - a = ep_list[ep_list[eptr].next].u; - e = u; - b = ep_list[eptr].u; - break; - default: - break; - } - if (xin(a, b, e) ) { - cur_ep->prev = eptr; - cur_ep->next = ep_list[eptr].next; - ep_list[ep_list[eptr].next].prev = tdata->ep_index; - ep_list[eptr].next = tdata->ep_index; - break; /* out of while */ - } - eptr = ep_list[eptr].next; - } - cur_ep->branch = branch ? tdata->ep_index - 1 : tdata->ep_index + 1; - ++tdata->ep_index; - status = Success; - } - - return status; -} - - - -/*++ - | - | Function Name: traverse - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -traverse( state, surface, output, ddSOFAS, el, winding ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - ddpex3rtn (*output)(); - miSOFASStruct *ddSOFAS; - int el; - int winding; -{ - int inside, branch, forward; - int more = 1; - Nurb_facet_op start = NURB_NEW_FACET; - - register int i, ep, epstart, ep_index; - register Nurb_edge_point *ep_list = state->trim_data.ep_list; - - ep = epstart = el; - inside = winding & 1; - /* Preprocess to mark edges. */ - do { - if ( ep_list[ep].branch ) { - ep_list[ep].flags = (inside) ? LAST : NEXT; - inside = !inside; - } - ep = ep_list[ep].next; - } while ( ep != epstart ); - - inside = winding & 1; - branch = 0; - forward = 1; - /* Currently ep = epstart = el. */; - do { /* for all loops */ - if ( start != NURB_NEW_FACET ) - start = NURB_NEW_CONTOUR; - do { /* for all points in loop */ - ep_list[ep].flags |= VISITED; - if ( branch ) { /* when on a branch */ - (*output)( state, surface, ddSOFAS, start, &ep_list[ep] ); - start = NURB_SAME_CONTOUR; - if ( ep_list[ep].branch ) { /* branch hits edge */ - branch = 0; - forward = (ep_list[ep].flags & NEXT); - ep = (forward) ? ep_list[ep].next : ep_list[ep].prev; - } else { /* continue along branch */ - ep = (forward) ? ep_list[ep].next : ep_list[ep].prev; - } - } else { /* when on the u,v quad boundary */ - if ( ep_list[ep].branch ) { /* edge hits branch */ - (*output)( state, surface, ddSOFAS, start, &ep_list[ep] ); - start = NURB_SAME_CONTOUR; - branch = 1; - if ( !inside ) { - inside = 1; - epstart = ep; - } - forward = (ep_list[ ep_list[ep].branch].prev == ep); - ep = ep_list[ep].branch; - } else { /* continue along edge */ - if ( inside ) { - (*output)(state, surface, ddSOFAS, start, &ep_list[ep]); - start = NURB_SAME_CONTOUR; - } - ep = (forward) ? ep_list[ep].next : ep_list[ep].prev; - } - } - } while ( ep != epstart ); - forward = 1; - branch = 0; - inside = 1; - if ( more ) { - do { /* find next edge start pt */ - if ( !(ep_list[epstart].flags & VISITED) && - (ep_list[epstart].flags & LAST) ) - break; - else - epstart = ep_list[epstart].next; - } while ( more = epstart != el ); - } - /* Find next inside start pt. */ - if ( !more ) { - epstart = 0; - /* Note: the first ep_index starts at 5. */ - ep_index = state->trim_data.ep_index; - for ( i = 5; i < ep_index; i++ ) { - if ( !(ep_list[i].flags & VISITED) ) - epstart = i; - } - branch = 1; - } - } while ( ep = epstart ); -} - - - -/* NEXT_TRIM_POINT gets next trim_pt and assign a bit pattern = - * - * 1001 | 0001 | 0011 9 | 1 | 3 - * -------------------- u0 ------------ - * 1000 | 0000 | 0010 8 | 0 | 2 - * -------------------- u1 ------------ - * 1100 | 0100 | 0110 12 | 4 | 6 - * v0 v1 - */ -#define NEXT_TRIM_POINT( _idx, _ptrn, _u, _v ) \ - { \ - (_u) = trim_pts[_idx].u; (_v) = trim_pts[_idx].v; \ - if ( (_u) < u0 ) \ - (_ptrn) = (_v) < v0 ? 9 : (_v) <= v1 ? 1 : 3 ; \ - else if ( (_u) <= u1 ) \ - (_ptrn) = (_v) < v0 ? 8 : (_v) <= v1 ? 0 : 2 ; \ - else \ - (_ptrn) = (_v) < v0 ? 12 : (_v) <= v1 ? 4 : 6 ; \ - } - -/* NOTE: These are different than the ones in the surface code. */ -#define LL 1 -#define LR 4 -#define UR 3 -#define UL 2 - -#define INSERT_PT( _u, _v, _ea, _eb, _ed, _br ) \ - ( insert_pt( tdata, state->reps.normals, \ - rat, (_u), (_v), (_ea), (_eb), (_ed), (_br) ) ) - -#define APPEND_PT( _u, _v, _ea, _eb, _ec, _ed ) \ - ( append_pt( tdata, state->reps.normals, \ - rat, (_u), (_v), (_ea), (_eb), (_ec), (_ed) ) ) - - - - -/*++ - | - | Function Name: phg_nt_trim_rect - | - | Function Description: - | - | This routine takes as input a list of trim curves - | (each trim curve loop described as a linked list - | of tesselated line segments broken into montonic - | sections), and a rectangle in u,v space, and creates - | a SOFAS description of the intersection of the rectangle - | and the trim curve loops. - | - | Note(s): - | - --*/ - -int -phg_nt_trim_rect( state, surface, rect, output, ddSOFAS ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - Nurb_edge_point **rect; - ddpex3rtn (*output)(); - miSOFASStruct *ddSOFAS; -{ - double u0, u1, v0, v1; /* rectangle in u,v space */ - double itr; - double oldu, oldv, newu, newv; - int winding; - int old_out, new_out, tmp, index, first_pt; - Nurb_param_limit *ext; - char rat; - - register int j; - register Nurb_trim_data *tdata = &state->trim_data; - register Nurb_edge_point *ep_list; - register Nurb_trim_segment *seg; - register Nurb_param_point *trim_pts = tdata->vertices; - - /* Note that 3D implies homogeneous for trim curves */ - rat = DD_IsVert3D(surface->points.type); - - /* Make room for at least 4 points. */ - if ( tdata->ep_list_size < 5 ) - if ( grow_ep_list( tdata ) ) - goto abort; - - /* Copy the rectangle into ep_list[1,2,3,4] */ - ep_list = tdata->ep_list; - for ( j = 1; j < 5; j++, rect++ ) { - ep_list[j].u = (*rect)->u; - ep_list[j].v = (*rect)->v; - ep_list[j].flags = 0; - ep_list[j].branch = 0; - ep_list[j].pt.x = (*rect)->pt.x; - ep_list[j].pt.y = (*rect)->pt.y; - ep_list[j].pt.z = (*rect)->pt.z; - if ( rat ) - ep_list[j].pt.w = (*rect)->pt.w; - if ( state->reps.normals ) { - ep_list[j].normal.x = (*rect)->normal.x; - ep_list[j].normal.y = (*rect)->normal.y; - ep_list[j].normal.z = (*rect)->normal.z; - } - ep_list[j].next = j+1; - ep_list[j].prev = j-1; - } - /* Link the first and last elements */ - ep_list[1].prev = 4; - ep_list[4].next = 1; - tdata->ep_index = 5; /* elements 1 to 4 used */ - - if ( tdata->nloops > 0 ) { - winding = 0; - u0 = ep_list[LL].u; v0 = ep_list[LL].v; - u1 = ep_list[UR].u; v1 = ep_list[UR].v; - } else - winding = 1; /* if no trim curves, default winding = 1 */ - - /* Intersect each trim loop against the rectangle bounds */ - for ( j = 0; j < tdata->nloops ; j++ ) { - - /* First, check against trim loop extent. */ - if ( (tdata->loops[j].extent.umin > u1) || - (tdata->loops[j].extent.umax < u0) || - (tdata->loops[j].extent.vmin > v1) || - (tdata->loops[j].extent.vmax < v0) ) - /* Cannot intersect rectangle */ - continue; - - seg = tdata->loops[j].segs; - if ( seg ) { /* first point of the loop */ - NEXT_TRIM_POINT( seg->start, new_out, newu, newv ); - first_pt = new_out ? 0 : tdata->ep_index; - } - for ( ; seg; seg = seg->next ) { - if ( seg->start == 0 ) - continue; - ext = &seg->extent; - if ( ext->umin > u1 || ext->vmin > v1 || ext->umax < u0 ) - continue; - if ( ext->vmax < v0 ) { - if ( ext->umin < u0 && ext->umax >= u0 ) - ++ winding; - continue; - } - index = seg->start; - NEXT_TRIM_POINT( index, new_out, newu, newv ); - /* Note: first point is not inserted because trim_loop is closed */ - while ( index != seg->end ) { - oldu = newu; - oldv = newv; - old_out = new_out; - ++index; - NEXT_TRIM_POINT( index, new_out, newu, newv ); - if ( tmp = (new_out & old_out) ) { /* in same region */ - if ( (tmp & 010) - && (newu < u0 && oldu >= u0 || newu >= u0 && oldu < u0)) - ++ winding; - continue; - } - if ( old_out ) { - /* Intersects top edge between a and b? */ - if ( (old_out & 01) && xin( v0, v1, - itr = oldv+(u0-oldu)*(newv-oldv)/(newu-oldu)) ) { - if ( INSERT_PT( u0, itr, LL, UL, 0, 0 ) ) - goto abort; - } else { - if ( (old_out & 01) && itr < v0) - ++winding; - /* Intersects right edge between b and c? */ - if ( (old_out & 02) && xin( u0, u1, - itr = oldu+(v1-oldv)*(newu-oldu)/(newv-oldv))){ - if ( INSERT_PT(itr, v1, UL, UR, 1, 0) ) - goto abort; - /* Intersects bottom edge between c and d? */ - } else if ((old_out & 04) && xin(v0, v1, - itr = oldv+(u1-oldu)*(newv-oldv)/(newu-oldu))){ - if ( INSERT_PT( u1, itr, UR, LR, 2, 0 ) ) - goto abort; - /* intersects left edge between d and a? */ - } else if ((old_out & 010) && xin( u0, u1, - itr = oldu+(v0-oldv)*(newu-oldu)/(newv-oldv))){ - if ( INSERT_PT( itr, v0, LR, LL, 3, 0 ) ) - goto abort; - } - } - } - - if ( new_out == 0 ) { - if ( APPEND_PT( newu, newv, LL, UL, UR, LR ) ) - goto abort; - } else { - /* Intersect top edge? */ - if (( new_out & 01) && xin( v0, v1, - itr = oldv+(u0-oldu)*(newv-oldv)/(newu-oldu))) { - if ( INSERT_PT( u0, itr, LL, UL, 0, 1 ) ) - goto abort; - } else { - if ( (new_out & 01) && itr < v0 ) - ++winding; - /* Intersects right edge? */ - if ( (new_out & 02) && xin( u0, u1, - itr = oldu+(v1-oldv)*(newu-oldu)/(newv-oldv))){ - if ( INSERT_PT(itr, v1, UL, UR, 1, 1) ) - goto abort; - /* Intersects bottom? */ - } else if ( (new_out&04) && xin( v0, v1, - itr = oldv+(u1-oldu)*(newv-oldv)/(newu-oldu))){ - if ( INSERT_PT(u1, itr, UR, LR, 2, 1) ) - goto abort; - /* Intersects left edge? */ - } else if ( (new_out & 010) && xin( u0, u1, - itr = oldu+(v0-oldv)*(newu-oldu)/(newv-oldv))){ - if ( INSERT_PT(itr, v0, LR, LL, 3, 1) ) - goto abort; - } - /* Left region? */ - if ( (new_out & 010) && newu >= u0 - && trim_pts[seg->end].u < u0 ) - ++winding; - } - break; /* Skip remaining points in segment. */ - } - } /* while ( not at end of segment ) */ - } /* for all segments */ - - if ( first_pt ) { - index = tdata->ep_index - 1; /* back upto the last edge pt */ - if ( tdata->ep_list[index].branch ) - tdata->ep_list[index].branch = first_pt; - else - tdata->ep_list[index].next = first_pt; - - if ( tdata->ep_list[first_pt].branch ) - tdata->ep_list[first_pt].branch = index; - else - tdata->ep_list[first_pt].prev = index; - } - } - - /* Traverse net and generate polygons. */ - traverse( state, surface, output, ddSOFAS, LL, winding ); - - return Success; - -abort: - return BadAlloc; -} - - - -#ifdef NDEBUG - -/*++ - | - | Function Name: print_rect - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -print_rect( rat, rect ) - char rat; - Nurb_edge_point **rect; -{ - fprintf( stderr, "\n" ); - if ( rat ) { - fprintf( stderr, "LL: ( %f, %f) ==> ( %f, %f, %f, %f)\n", - rect[LL-1]->u, rect[LL-1]->v, - rect[LL-1]->pt.x, rect[LL-1]->pt.y, rect[LL-1]->pt.z, - rect[LL-1]->pt.w ); - fprintf( stderr, "LR: ( %f, %f) ==> ( %f, %f, %f, %f)\n", - rect[LR-1]->u, rect[LR-1]->v, - rect[LR-1]->pt.x, rect[LR-1]->pt.y, rect[LR-1]->pt.z, - rect[LR-1]->pt.w ); - fprintf( stderr, "UR: ( %f, %f) ==> ( %f, %f, %f, %f)\n", - rect[UR-1]->u, rect[UR-1]->v, - rect[UR-1]->pt.x, rect[UR-1]->pt.y, rect[UR-1]->pt.z, - rect[UR-1]->pt.w ); - fprintf( stderr, "UL: ( %f, %f) ==> ( %f, %f, %f, %f)\n", - rect[UL-1]->u, rect[UL-1]->v, - rect[UL-1]->pt.x, rect[UL-1]->pt.y, rect[UL-1]->pt.z, - rect[UL-1]->pt.w ); - } else { - fprintf( stderr, "LL: ( %f, %f) ==> ( %f, %f, %f)\n", - rect[LL-1]->u, rect[LL-1]->v, - rect[LL-1]->pt.x, rect[LL-1]->pt.y, rect[LL-1]->pt.z ); - fprintf( stderr, "LR: ( %f, %f) ==> ( %f, %f, %f)\n", - rect[LR-1]->u, rect[LR-1]->v, - rect[LR-1]->pt.x, rect[LR-1]->pt.y, rect[LR-1]->pt.z ); - fprintf( stderr, "UR: ( %f, %f) ==> ( %f, %f, %f)\n", - rect[UR-1]->u, rect[UR-1]->v, - rect[UR-1]->pt.x, rect[UR-1]->pt.y, rect[UR-1]->pt.z ); - fprintf( stderr, "UL: ( %f, %f) ==> ( %f, %f, %f)\n", - rect[UL-1]->u, rect[UL-1]->v, - rect[UL-1]->pt.x, rect[UL-1]->pt.y, rect[UL-1]->pt.z ); - } -} -#endif - - - -#define IN_SAME_REGION( _oca, _ocb ) ((_oca) & (_ocb)) - -#define MORE_TRIM_POINTS( _s ) \ - ((_s) && ((_s)->current != (_s)->last || (_s)->next)) - -#define NEXT_POINT( _pts, _s, _p, _v ) \ - { if ((_s)->current < 0) \ - (_s)->current = (_s)->first; \ - else if ((_s)->current != (_s)->last) \ - ++(_s)->current; \ - else { \ - (_s) = (_s)->next; \ - if ( (_s) ) \ - (_s)->current = (_s)->first; \ - } \ - if ( _s ) { \ - (_p).u = (_pts)[(_s)->current].u; \ - (_p).v = (_pts)[(_s)->current].v; \ - (_v) = (_s)->vis; \ - } \ - } - -/* Outcodes */ -#define IN 0 -#define OUT_TL 3 -#define OUT_TC 2 -#define OUT_TR 6 -#define OUT_CL 1 -#define OUT_CR 4 -#define OUT_BL 9 -#define OUT_BC 8 -#define OUT_BR 12 - -#define LEFT OUT_CL -#define RIGHT OUT_CR -#define TOP OUT_TC -#define BOTTOM OUT_BC - -#define OUTCODE( _e, _p, _c ) \ - { if ( (_p).u < (_e).umin ) \ - (_c) = (_p).v < (_e).vmin ? OUT_BL : \ - (_p).v <= (_e).vmax ? OUT_CL : OUT_TL; \ - else if ( (_p).u <= (_e).umax ) \ - (_c) = (_p).v < (_e).vmin ? OUT_BC : \ - (_p).v <= (_e).vmax ? IN : OUT_TC; \ - else \ - (_c) = (_p).v < (_e).vmin ? OUT_BR : \ - (_p).v <= (_e).vmax ? OUT_CR : OUT_TR; \ - } - -#define ADJACENT_RECT( _g, _e, _r ) \ - switch ( _e ) { \ - case LEFT: \ - --(_r)[LL]; --(_r)[LR]; --(_r)[UL]; --(_r)[UR]; \ - break; \ - case RIGHT: \ - ++(_r)[LL]; ++(_r)[LR]; ++(_r)[UL]; ++(_r)[UR]; \ - break; \ - case TOP: \ - (_r)[LL]+=(_g)->nu; (_r)[LR]+=(_g)->nu; \ - (_r)[UL]+=(_g)->nu; (_r)[UR]+=(_g)->nu; \ - break; \ - case BOTTOM: \ - (_r)[LL]-=(_g)->nu; (_r)[LR]-=(_g)->nu; \ - (_r)[UL]-=(_g)->nu; (_r)[UR]-=(_g)->nu; \ - break; \ - } - -#define RECT_EXTENT( _r, _e ) \ - { \ - (_e).umin = (_r)[LL]->u; (_e).umax = (_r)[UR]->u; \ - (_e).vmin = (_r)[LL]->v; (_e).vmax = (_r)[UR]->v; \ - } - -#define AT_EDGE( _g, _e, _p ) \ - ( ((_e) & LEFT && (_p).u <= (_g)->extent.umin) \ - || ((_e) & RIGHT && (_p).u >= (_g)->extent.umax) \ - || ((_e) & BOTTOM && (_p).v <= (_g)->extent.vmin) \ - || ((_e) & TOP && (_p).v >= (_g)->extent.vmax)) - - -/*++ - | - | Function Name: intersect - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -intersect( ext, old_out, new_out, old, new, inter ) - Nurb_param_limit *ext; - unsigned old_out, new_out; - Nurb_param_point *old, *new, *inter; -{ - double t; - int edge; - - if ( ((old_out == IN && new_out & OUT_CL) || (old_out & OUT_CL)) - && xin( ext->vmin, ext->vmax, - t = old->v + (ext->umin-old->u) * (new->v-old->v)/(new->u-old->u))){ - inter->u = ext->umin; - inter->v = t; - edge = LEFT; - } else if ( ((old_out == IN && new_out & OUT_TC) || (old_out & OUT_TC)) - && xin( ext->umin, ext->umax, - t = old->u + (ext->vmax-old->v) * (new->u-old->u)/(new->v-old->v))){ - inter->u = t; - inter->v = ext->vmax; - edge = TOP; - } else if ( ((old_out == IN && new_out & OUT_CR) || (old_out & OUT_CR)) - && xin( ext->vmin, ext->vmax, - t = old->v + (ext->umax-old->u) * (new->v-old->v)/(new->u-old->u))){ - inter->u = ext->umax; - inter->v = t; - edge = RIGHT; - } else if ( ((old_out == IN && new_out & OUT_BC) || (old_out & OUT_BC)) - && xin( ext->umin, ext->umax, - t = old->u + (ext->vmin-old->v) * (new->u-old->u)/(new->v-old->v))){ - inter->u = t; - inter->v = ext->vmin; - edge = BOTTOM; - } else - edge = 0; - - return edge; -} - - - -/*++ - | - | Function Name: find_containing_rect - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -find_containing_rect( pt, grid, rect ) - register Nurb_param_point *pt; - register Nurb_grid *grid; - Nurb_edge_point *rect[5]; -{ - register Nurb_edge_point *gpt = &grid->pts[grid->nu+1]; - - for ( ; gpt->u < pt->u; gpt++ ) - ; - for ( ; gpt->v < pt->v; gpt += grid->nu ) - ; - rect[UR] = gpt; - rect[UL] = gpt - 1; - rect[LL] = rect[UL] - grid->nu; - rect[LR] = rect[UR] - grid->nu; -} - - - -/*++ - | - | Function Name: add_point - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -add_point( state, surface, vert_list, op, pt, edge, rect ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - miListHeader *vert_list; - Nurb_path_op op; - Nurb_param_point *pt; - int edge; - Nurb_edge_point *rect[5]; -{ - Nurb_edge_point new, *pa, *pb; - double alpha, beta; - char rat; - - rat = DD_IsVert4D(surface->points.type); - - new.u = pt->u; new.v = pt->v; - if ( edge ) { - switch ( edge ) { - case LEFT: - alpha = (pt->v - rect[LL]->v)/(rect[UL]->v - rect[LL]->v); - pa = rect[LL]; pb = rect[UL]; - break; - case RIGHT: - alpha = (pt->v - rect[LR]->v)/(rect[UR]->v - rect[LR]->v); - pa = rect[LR]; pb = rect[UR]; - break; - case TOP: - alpha = (pt->u - rect[UL]->u)/(rect[UR]->u - rect[UL]->u); - pa = rect[UL]; pb = rect[UR]; - break; - case BOTTOM: - alpha = (pt->u - rect[LL]->u)/(rect[LR]->u - rect[LL]->u); - pa = rect[LL]; pb = rect[LR]; - break; - } - linear_interpolate( alpha, rat, 0, pa, pb, &new ); - } else { - alpha = (pt->v - rect[LL]->v)/(rect[UR]->v - rect[LL]->v); - beta = (pt->u - rect[LL]->u)/(rect[UR]->u - rect[LL]->u); - bilinear( alpha, beta, rat, 0, rect[LL], rect[UL], - rect[UR], rect[LR], &new ); - } - - ADD_POINT_TO_LIST( vert_list, rat, op, &new.pt ); - -} - - - -#define NPATH_OP( _o, _n ) \ - ((_o) ? ((_n) ? PT_LINE : PT_NOP) : ((_n) ? PT_MOVE : PT_NOP)) - -/*++ - | - | Function Name: follow_segs - | - | Function Description: - | - | Note(s): - | - --*/ - -static Nurb_trim_segment * -follow_segs(state, surface, grid, tpts, seg, vert_list, start_pt,use_edge_flags) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - Nurb_grid *grid; - Nurb_param_point *tpts; - Nurb_trim_segment *seg; - miListHeader *vert_list; - Nurb_param_point *start_pt; - int use_edge_flags; -{ - Nurb_edge_point *rect[5]; - Nurb_param_limit extent; - unsigned old_out, new_out; - Nurb_param_point old, new; - int edge, done = 0; - ddULONG new_vis, old_vis; - Nurb_path_op op; - - find_containing_rect( start_pt, grid, rect ); - - RECT_EXTENT( rect, extent ) - - op = use_edge_flags ? NPATH_OP( 0, seg->vis ) : PT_MOVE; - if ( op != PT_NOP ) - add_point( state, surface, vert_list, op, start_pt, 0, rect ); - - old = *start_pt; - old_vis = seg->vis; - NEXT_POINT( tpts, seg, new, new_vis ) - op = use_edge_flags ? NPATH_OP( old_vis, new_vis ) : PT_LINE; - while ( !done ) { - OUTCODE( extent, new, new_out ) - if ( new_out == IN ) { - if ( op != PT_NOP ) - add_point( state, surface, vert_list, op, &new, 0, rect ); - old = new; old_vis = new_vis; - if ( MORE_TRIM_POINTS(seg) ) { - NEXT_POINT( tpts, seg, new, new_vis ) - if ( use_edge_flags ) - op = NPATH_OP( old_vis, new_vis ); - } else - done = 1; - } else { - OUTCODE( extent, old, old_out ) - edge = intersect( &extent, old_out, new_out, &old, &new, &old ); - if ( op != PT_NOP ) - add_point( state, surface, vert_list, op, &old, edge, rect ); - if ( !AT_EDGE( grid, edge, old ) ) { - ADJACENT_RECT( grid, edge, rect ) - RECT_EXTENT( rect, extent ) - } else /* hit an edge of the grid */ - done = 1; - } - } - - /* Segments are monotonic so we're done with this one when an - * edge is hit. - */ - seg = seg->next; - if ( seg ) - seg->current = -1; - return seg; -} - - - -/*++ - | - | Function Name: phg_nt_draw_segs - | - | Function Description: - | - | Note(s): - | - --*/ - -int -phg_nt_draw_segs( state, surface, grid, seg, spts, use_edge_flags, vert_list ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - Nurb_grid *grid; - register Nurb_trim_segment *seg; - Nurb_param_point *spts; - int use_edge_flags; - miListHeader *vert_list; -{ - unsigned old_out, new_out; - Nurb_param_point old, new; - Nurb_param_limit *ext; - ddULONG vis; - - ext = &grid->extent; - seg->current = -1; - old_out = IN; - for ( ; MORE_TRIM_POINTS(seg); old = new, old_out = new_out ) { - NEXT_POINT( spts, seg, new, vis ) - OUTCODE( *ext, new, new_out ) - if ( new_out == IN ) { - if ( old_out ) { - (void)intersect( ext, old_out, new_out, &old, &new, &new ); - } - --seg->current; - seg = follow_segs( state, surface, grid, spts, seg, vert_list, - &new, use_edge_flags ); - old_out = IN; - continue; - } else if ( old_out ) { - if ( IN_SAME_REGION(old_out, new_out) ) - continue; - if ( intersect( ext, old_out, new_out, &old, &new, &new )) { - --seg->current; - seg = follow_segs( state, surface, grid, spts, seg, vert_list, - &new, use_edge_flags ); - old_out = IN; - continue; - } - } - } -} - -#define WS_NTRM_BOTTOM Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c:3.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c:3.9 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c Sat Feb 28 21:41:54 2004 @@ -1,2474 +0,0 @@ -/* $Xorg: miNSurf.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNSurf.c,v 3.9 2001/12/14 19:57:29 dawes Exp $ */ - -#define TRIMING 1 - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "miRender.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miNurbs.h" -#include "pexos.h" - -#if !defined(IN_MODULE) /* hv: not a module header file */ -#include -#else -#include -#endif - -static ddpex3rtn build_surf_reps(); -static int add_grid(); -static int uniform_isocurves(); -static int nonuniform_isocurves(); -static void nurb_surf_state_free(); -static ddpex3rtn compute_adaptive_surf_interval(); -static void determine_reps_required(); -static ddpex3rtn compute_nurb_surface(); -static ddpex3rtn build_facets(); -static ddpex3rtn build_control_polygon(); -static ddpex3rtn build_surf_markers(); -static ddpex3rtn span_grids(); -static void compute_edge_point_normals(); -static void build_edge_reps(); -static void make_edge_segments(); -static void span_evaluation_points(); -#ifdef TRIMING -static ddpex3rtn add_pgon_point(); -#endif - - -/* - * This convention is established in the trimming code. - * Note that it's clockwise from lower left. - */ -#define LL 0 -#define LR 3 -#define UR 2 -#define UL 1 - -#define xin(_a,_b,_x) ((_x) >= (_a) && (_x) <= (_b)) - -/*++ - | - | Function Name: miNurbsSurface - | - | Function Description: - | Handles the Nurbs Surface Pex OC. - | - | Rendering a surface path is a 4 step process in this - | implementation. - | - | The first step is to determine the proper parametric step - | size according to the specified surface tolerance. Note - | that tesselation is performed in Model Coordinates in this - | implementation. However, surface tolerances are specified - | in one of WC, NPC, or DC. Thus the control points are tranformed - | in a temporary buffer into the specified space for determination - | of the maximum parametric step size. - | - | Once this step size is determined, a series of grid descriptions - | are created - one grid per knot interval. In other words, - | each grid describes the area specified by the four knot pairs - | (u,v), (u+1,v), (u,v+1), (u+1,v+1). These grids are then - | subdivided according to the u,v step size computed above - | and the (x,y,z,w) coordinates corresponding to each of the - | (u,v) steps computed. The result of this operation is a linked - | list of (u,v) (x,y,z,w) pairs for each span in the surface. - | - | The third step in the process is to trim this surface according - | to the supplied trim curve bounds. NEED MORE TEXT HERE. - | - | The fourth and last step in the procedure is to convert - | the (potentially trimmed) grid description od the surface - | into miListHeader point lists that can be used by the - | rest of the system. Note that no "direct" rendering is performed - | by this routine. Rather, the data that resulted from the - | previous steps are converted into one of the other primitive - | in the system (ie SOFAS, quad mesh, polyline, etc...) and - | rendered by one of these routines. - | - | Note(s): - | - --*/ - -ddpex3rtn -miNurbsSurface(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - ddpex3rtn build_surf_reps(); - extern ocTableType InitExecuteOCTable[]; - -/* Local variable definitions */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miNurbSurfaceStruct *ddSurface = (miNurbSurfaceStruct *)(pExecuteOC+1); - miListHeader *input_list = &ddSurface->points; - miListHeader *listheader; - Nurb_surf_state surface_state; - miGenericStr *pGStr; - miMarkerStruct *ddMarker; - miPolylineStruct *ddPolyline; - miFillAreaStruct *ddFillArea; - Nurb_grid *grid; - miQuadMeshStruct *ddQuad; - miSOFASStruct *ddSOFAS; - listofddFacet facet_list; - ddUSHORT save_edges; - ddEnumTypeIndex save_intStyle; - int num_points; - int i, j; - ddpex3rtn status = Success; - - - - switch(pddc->Static.attrs->surfApprox.approxMethod) { - - case PEXApproxImpDep: - case PEXApproxConstantBetweenKnots: - case PEXApproxDcChordalSize: - case PEXSurfaceApproxDcPlanarDev: - case PEXApproxDcRelative: - default: - - case PEXApproxWcsChordalSize: - case PEXSurfaceApproxWcsPlanarDev: - case PEXApproxWcsRelative: - - /* Transform to WC prior to tesselation */ - /* tesselate surface into facets */ - if (status = build_surf_reps( pddc, ddSurface, &surface_state, - pddc->Dynamic->mc_to_wc_xform )) - goto exit; - - break; - - - case PEXApproxNpcChordalSize: - case PEXSurfaceApproxNpcPlanarDev: - case PEXApproxNpcRelative: - - /* tesselate surface into facets */ - if (status = build_surf_reps( pddc, ddSurface, &surface_state, - pddc->Dynamic->mc_to_npc_xform )) - goto exit; - - break; - } - - - /* - * render the computed structures. - * - * Note that the final structure can be rendered in many ways - * according to the surface data and rendering attributes. - * the surface_state.reps structure contains flags to indicate - * the data created during the tesselation process. - */ - if ( surface_state.reps.markers ) { - - /* allocate polyline command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miMarkerStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCMarker; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddMarker = (miMarkerStruct *) (pGStr + 1); - *ddMarker = *((miMarkerStruct *)(surface_state.markers)); - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - xfree(pGStr); - - } else { - - if ( surface_state.reps.facets ) { - - /* Don't draw edges here - they are drawn seperately */ - save_edges = pddc->Static.attrs->edges; - pddc->Static.attrs->edges = PEXOff; - - if ( ddSurface->numTrimCurveLists <= 0 ) { - /* - * If no trimming, then each tesselated surface - * is described by a number of grids, each grid containing - * a single quad mesh. Therefore, loop through the - * grid list in the surface state, and call quad mesh - * for each grid. - */ - - /* allocate polyline command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miQuadMeshStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCQuadrilateralMesh; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddQuad = (miQuadMeshStruct *) (pGStr + 1); - - /* Initialize quad mesh structure */ - /*** ddQuad->shape = ***/ - - facet_list.numFacets = 0; - facet_list.type = DD_FACET_NONE; - facet_list.facets.pNoFacet = NULL; - facet_list.maxData = 0; - ddQuad->pFacets = &facet_list; - - grid = surface_state.grids.grids; - listheader = surface_state.facets; - - for (i = 0; i < surface_state.grids.number; i++) { - - ddQuad->mPts = grid->nu; - ddQuad->nPts = (grid++)->nv; - ddQuad->points = *(listheader++); - - if(status=InitExecuteOCTable[(int)(pGStr->elementType)](pRend,pGStr)) - break; - - } - - } else { - /* - * If trimming is enabled, then SOFAS are output from - * the tesselation code. - * The SOFAS structure is already built, so just call the - * SOFAS routine. - */ - - /* allocate polyline command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miSOFASStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCSOFAS; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddSOFAS = (miSOFASStruct *) (pGStr + 1); - *ddSOFAS = *((miSOFASStruct *)(surface_state.sofas)); - - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - } - - xfree(pGStr); - /* restore edge flag */ - pddc->Static.attrs->edges = save_edges; - - } else if ( surface_state.reps.hollow ) { - - /* allocate fill area command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miFillAreaStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCFillAreaSet; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddFillArea = (miFillAreaStruct *) (pGStr + 1); - ddFillArea->shape = PEXUnknownShape; - ddFillArea->ignoreEdges = PEXOn; - ddFillArea->contourHint = PEXUnknownContour; - facet_list.numFacets = 0; - facet_list.type = DD_FACET_NONE; - facet_list.facets.pNoFacet = NULL; - facet_list.maxData = 0; - ddFillArea->pFacets = &facet_list; - ddFillArea->points = *(surface_state.hollow); - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - xfree(pGStr); - - } - - if ( surface_state.reps.isocrvs ) { - - /* allocate polyline command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miPolylineStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCPolylineSet; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddPolyline = (miPolylineStruct *) (pGStr + 1); - *ddPolyline = *((miPolylineStruct *)(surface_state.isocrvs)); - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - xfree(pGStr); - - } - - if ( surface_state.reps.edges ) { - - /* set edge flag and interior style such that only edges are drawn */ - save_edges = pddc->Static.attrs->edges; - pddc->Static.attrs->edges = PEXOn; - - save_intStyle = pddc->Static.attrs->intStyle; - pddc->Static.attrs->intStyle = PEXInteriorStyleEmpty; - - /* allocate fill area command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miFillAreaStruct))))) { - status = BadAlloc; - goto exit; - } - - pGStr->elementType = PEXOCFillAreaSet; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddFillArea = (miFillAreaStruct *) (pGStr + 1); - ddFillArea->shape = PEXUnknownShape; - ddFillArea->ignoreEdges = PEXOff; - ddFillArea->contourHint = PEXUnknownContour; - facet_list.numFacets = 0; - facet_list.type = DD_FACET_NONE; - facet_list.facets.pNoFacet = NULL; - facet_list.maxData = 0; - ddFillArea->pFacets = &facet_list; - ddFillArea->points = *(surface_state.edges); - status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr); - - xfree(pGStr); - - /* restore edge flag */ - pddc->Static.attrs->edges = save_edges; - /* restore interior style */ - pddc->Static.attrs->intStyle = save_intStyle; - - } - } - -exit: - - /* free all temporary storage */ - nurb_surf_state_free(&surface_state); - - return (status); - -} - - - -#define ANY_REP_NEEDED(_st) \ - ( (_st)->reps.edges || (_st)->reps.facets || (_st)->reps.isocrvs \ - || (_st)->reps.markers || (_st)->reps.hollow ) - -#define NEED_NORMALS(_st) ( (_st)->reps.facets ) - -/*++ - | - | Function Name: build_surf_reps - | - | Function Description: - | - | Note(s): - | - --*/ - -static -ddpex3rtn -build_surf_reps( pddc, surface, state, trans ) - miDDContext *pddc; - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; - ddFLOAT trans[4][4]; -{ - /* uses */ - ddpex3rtn status = Success; /* assume success */ - - if ( surface->mPts <= 0 || surface->nPts <= 0 ) - return 0; - - NURB_SURF_STATE_INIT(state); - - switch ( pddc->Static.attrs->surfApprox.approxMethod ) { - case PEXApproxConstantBetweenKnots: - case PEXApproxImpDep: - default: - state->approx_type = PEXApproxConstantBetweenKnots; - state->approx_value[0] = - MAX((int)pddc->Static.attrs->surfApprox.uTolerance,0); - state->approx_value[1] = - MAX((int)pddc->Static.attrs->surfApprox.vTolerance,0); - break; - - case PEXApproxWcsChordalSize: - case PEXApproxNpcChordalSize: - case PEXSurfaceApproxWcsPlanarDev: - case PEXSurfaceApproxNpcPlanarDev: - case PEXApproxWcsRelative: - case PEXApproxNpcRelative: - /* The same approximation method is used for all these - * approximation types, and it's not exactly any of them. - * But the method used serves the same purpose and - * PHIGS PLUS allows us to approximate the defined methods. - */ - state->approx_type = PEXApproxConstantBetweenKnots; - compute_adaptive_surf_interval( pddc, surface, state, trans ); - break; - } - - determine_reps_required( pddc, surface, state ); - - if ( ANY_REP_NEEDED(state) ) { - status = compute_nurb_surface( pddc, surface, state ); - } - - return ( status ); -} - - - -/*++ - | - | Function Name: compute_adaptive_surf_interval - | - | Function Description: - | - | This routine computes the number of steps that must - | be taken in the u & v directions. Note that although - | the actual tesselation takes place in model coordinates - | (to ease integration with the remainder of the rendering code), - | the control points must be transformed here to the - | space specified by the curve approximation criteria - | to guarantee the proper number of steps are computed. - | - | Note(s): - | - --*/ - -static -ddpex3rtn -compute_adaptive_surf_interval( pddc, surface, state, trans ) - miDDContext *pddc; - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; - ddFLOAT trans[4][4]; -{ -/* uses */ - ddFLOAT uval, vval, a_coeff, b_coeff, c_coeff, denom, - z1, z2, z3; - ddCoord4D p; - double perp_d, max_u_perp_d = 0.0, max_v_perp_d = 0.0; - - int i, j, use_z_coord = 0; - int nu = surface->mPts; - int nv = surface->nPts; - ddCoord4D *upper, *lower, *middle, *pa, *pb, *pc, *coord_buf; - char *ctlpts, *pin; - double w; - miListHeader *input = &surface->points; - char rat; - int point_size; - ddPointType out_type; - ddpex3rtn status; - - /* - * Compute the constant parametric between knots interval needed to - * come close to meeting the specified approximation criteria. The - * method used is a gross compromise for the adaptive approximation - * criteria, but fulfills the basic need for an adaptive approximation - * method. - * Note that for the NPC approximation criteria NPC isn't even the space - * being used, it's clipping space, which is [-1,1], [-1,1], [0,1]. - * The Z component is ignored in this case though since the Z dimension - * is perpendicular to the screen. - */ - state->approx_value[0] = 0.0; - state->approx_value[1] = 0.0; - switch ( pddc->Static.attrs->surfApprox.approxMethod ) { - case PEXApproxNpcChordalSize: - case PEXSurfaceApproxNpcPlanarDev: - use_z_coord = 0; - break; - case PEXApproxWcsChordalSize: - case PEXSurfaceApproxWcsPlanarDev: - use_z_coord = 1; - break; - } - - /* - * transform comtrol points into space specified by - * approximation tolerance - */ - if ( trans ) { - miListHeader *temp; - - /* Transform to WC prior to applying lighting */ - out_type = input->type; - if (status = miTransform( pddc, input, &temp, - trans, NULL4x4, DD_SetVert4D(out_type))) - return (status); - input = temp; - } - - rat = DD_IsVert4D(input->type); - ctlpts = input->ddList->pts.ptr; - DD_VertPointSize(input->type, point_size); - - - /* Allocate temporary control point store */ - if (!(coord_buf = (ddCoord4D *)xalloc(3 * nu * sizeof(ddCoord4D)))) - return(BadAlloc); - - /* - * For the above approx. types, the approx. value is the max. allowable - * distance between the actual surface and the generated segments. - * The distance of the ctrl point from the line joining the ctrl pts on - * either side of it is calculated for every ctrl pt. This is calculated - * in 2D. For approx. in WC, the 3D length is got from the 2D-length - * and the z values of the ctrl pts. The max of all these lengths is - * found. This is repeated for all the ctrl pts in the u and v directions. - * The final approx. value is obtd. from the ratio of the max length - * and the required approx. value. - */ - - upper = coord_buf; middle = coord_buf + nu; lower = coord_buf + 2*nu; - for ( j = 0; j < nv-1; j++, ctlpts += nu*point_size ) { - - /* - * project the points from homogeneous space. - */ - if ( rat ) { - for ( i = 0, pin = ctlpts, pa = lower; - i < nu; - i++, pa++, pin += point_size ) { - if (((ddCoord4D *)pin)->w == 1.0) *pa = *((ddCoord4D *)pin); - else { - w = 1.0 / ((ddCoord4D *)pin)->w; - pa->x = ((ddCoord4D *)pin)->x * w; - pa->y = ((ddCoord4D *)pin)->y * w; - if ( use_z_coord ) pa->z = ((ddCoord4D *)pin)->z * w; - } - } - } else { - for ( i = 0, pin = ctlpts, pa = lower; - i < nu; - i++, pa++, pin += point_size ) { - memcpy( (char *)pa, pin, point_size); - pa->w = 1.0; - } - } - - /* Find the required u interval between points of this row. */ - pa = lower; pb = pa + 2, pc = pa + 1; - for ( i = 1; i < nu-1; i++, pa++, pb++,pc++) { - a_coeff = pb->y - pa->y; - b_coeff = pa->x - pb->x; - c_coeff = pb->x * pa->y - pa->x * pb->y; - denom = ( a_coeff * a_coeff + b_coeff * b_coeff ); - perp_d = (a_coeff * pc->x + b_coeff * pc->y + c_coeff); - if ( use_z_coord ) { - z1 = pc->z; - z2 = (pa->z + pb->z) /2.0; - z3 = z1-z2; - perp_d = sqrt( (perp_d * perp_d + z3 * z3 * denom) /denom ); - } else { - perp_d = perp_d/ (sqrt(denom)); - } - perp_d = fabs(perp_d); - if ( perp_d > max_u_perp_d ) - max_u_perp_d = perp_d; - } - - if ( j > 1 ) { - /* Find the required v interval between these two rows. */ - pa = upper; pb = lower, pc = middle; - for ( i = 0; i < nu; i++, pa++, pb++, pc++ ) { - a_coeff = pb->y - pa->y; - b_coeff = pa->x - pb->x; - c_coeff = pb->x * pa->y - pa->x * pb->y; - denom = ( a_coeff * a_coeff + b_coeff * b_coeff ); - perp_d = (a_coeff * pc->x + b_coeff * pc->y + c_coeff); - if ( use_z_coord ) { - z1 = pc->z; - z2 = (pa->z + pb->z) /2.0; - z3 = z1-z2; - perp_d = sqrt( (perp_d * perp_d + z3 * z3 * denom) /denom ); - } else { - perp_d = perp_d/ (sqrt(denom)); - } - perp_d = fabs(perp_d); - if ( perp_d > max_v_perp_d ) - max_v_perp_d = perp_d; - } - } - - /* Swap row pointers so that next row is the "lower" row. */ - pa = upper; - upper = middle; - middle = lower; - lower = pa; - } - - switch ( pddc->Static.attrs->surfApprox.approxMethod ) { - case PEXApproxWcsChordalSize: - case PEXApproxNpcChordalSize: - uval = pddc->Static.attrs->surfApprox.uTolerance; - vval = pddc->Static.attrs->surfApprox.vTolerance; - break; - case PEXSurfaceApproxWcsPlanarDev: - case PEXSurfaceApproxNpcPlanarDev: - uval = pddc->Static.attrs->surfApprox.uTolerance; - vval = pddc->Static.attrs->surfApprox.uTolerance; - break; - } - state->approx_value[0] = (int)( 1 + sqrt(10*max_u_perp_d - / (uval > 0.0 ? uval : 0.01))); - state->approx_value[1] = (int)( 1 + sqrt(10*max_v_perp_d - / (vval > 0.0 ? vval : 0.01))); - - xfree(coord_buf); - - return(Success); -} - - - -/*++ - | - | Function Name: determine_reps_required - | - | Function Description: - | - | This routine selects the format of the data - | created for rendering the speecified surface patch. - | Different data descriptions are generated according - | to both the surface data and the current rendering - | attributes. For example, quad mesh data is created - | to describe an un-trimmed solid surface; polyline - | data, however, is created if surface iso-curves - | are enabled. - | - | Note(s): - | - --*/ - -static void -determine_reps_required( pddc, surface, state ) - miDDContext *pddc; - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; -{ - if ( surface->uOrder <= 1 && surface->vOrder <= 1 ) { - state->reps.markers = 1; - - } else if ( (surface->uOrder > MAXORD) || (surface->vOrder > MAXORD) ) { - /* Order is not supported; just draw the control net. */ - state->reps.isocrvs = 1; - state->isocount[0] = 1; - state->isocount[1] = 1; - - } else { - - /* - * First evaluate interior style - */ - switch ( pddc->Static.attrs->intStyle ) { - case PEXInteriorStyleSolid: - state->reps.facets = 1; - /* Only compute normals if lighting enabled */ - if (pddc->Static.attrs->reflModel != PEXReflectionNoShading) - state->reps.normals = 1; - break; - case PEXInteriorStyleHollow: - state->reps.hollow = 1; - break; - case PEXInteriorStylePattern: - case PEXInteriorStyleHatch: - state->reps.facets = 1; - /* Only compute normals if lighting enabled */ - if (pddc->Static.attrs->reflModel != PEXReflectionNoShading) - state->reps.normals = 1; - break; - case PEXInteriorStyleEmpty: - /* No addtional action required. */ - break; - } - - /* - * Next, parametric surface characteristics. - */ - switch ( pddc->Dynamic->pPCAttr->psc.type ) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - case PEXPSCIsoCurves: - state->reps.isocrvs = 1; - /* Negative curve counts mean no curves between knots. */ - state->isocount[0] = - MAX(pddc->Dynamic->pPCAttr->psc.data.isoCurves.numUcurves,0); - state->isocount[1] = - MAX(pddc->Dynamic->pPCAttr->psc.data.isoCurves.numVcurves,0); - break; - case PEXPSCMcLevelCurves: - case PEXPSCWcLevelCurves: - /* Note that level curves are not implemented */ - break; - } - - if ( pddc->Static.attrs->edges == PEXOn ) - state->reps.edges = 1; - } -} - - - -/*++ - | - | Function Name: compute_nurb_surface - | - | Function Description: - | - | Note(s): - | - --*/ - -static -ddpex3rtn -compute_nurb_surface( pddc, surface, state ) - miDDContext *pddc; - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; -{ - -/* calls */ -#ifdef TRIMING - ddpex3rtn phg_nt_install_trim_loops(); -#endif - -/* uses */ - ddpex3rtn status = Success; - int i; - - state->range.umin = surface->pUknots[surface->uOrder - 1]; - state->range.umax = surface->pUknots[surface->numUknots - surface->uOrder]; - state->range.vmin = surface->pVknots[surface->vOrder - 1]; - state->range.vmax = surface->pVknots[surface->numVknots - surface->vOrder]; - - state->param_limits.umin = state->range.umin; - state->param_limits.umax = state->range.umax; - state->param_limits.vmin = state->range.vmin; - state->param_limits.vmax = state->range.vmax; - - /* Check for unsupported order. */ - if ( surface->uOrder > MAXORD || surface->uOrder > MAXORD ) { - /* Draw *only* the control polygon. */ - return build_control_polygon( surface, state ); - } - - if ( state->reps.markers ) { - return build_surf_markers( surface, state ); - } - - /* - * build initial grid description - */ - if (status = span_grids( state, surface )) - goto abort; - - if ( state->reps.normals ) { - for ( i = 0; i < state->grids.number; i++ ) - compute_edge_point_normals( surface, &state->grids.grids[i] ); - state->grids.flags.normals = 1; - } - - if ( surface->numTrimCurveLists > 0 ) { -#ifdef TRIMING - if ( status = phg_nt_install_trim_loops( surface, state ) ) - goto abort; -#endif /* TRIMING */ - } - - if ( state->reps.edges || state->reps.hollow ) { - if ( surface->numTrimCurveLists <= 0 ) - make_edge_segments( state ); - if ( state->reps.edges ) - build_edge_reps( pddc, state, surface, &state->edges, 1 ); - if ( state->reps.hollow ) - build_edge_reps( pddc, state, surface, &state->hollow, 0 ); - } - - if ( state->reps.facets ) { - status = build_facets( state, surface ); - } - - if ( state->reps.isocrvs ) { - switch( pddc->Dynamic->pPCAttr->psc.data.isoCurves.placementType ) { - default: - case 0 /* PEXPSCUniform */: - status = uniform_isocurves( state, surface ); - break; - case 1 /* PEXPSCNonUniform */: - status = nonuniform_isocurves( state, surface ); - break; - } - } - -abort: - return (status); - -} - - - -/*++ - | - | Function Name: span_grids - | - | Function Description: - | - | This routine is the first step in creating a tesselated - | polygon description of a surface patch. The rendering - | - | - | Note(s): - | - --*/ - -static -ddpex3rtn -span_grids( state, surface ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; -{ -/* uses */ - double *uvals = 0, - *vvals = 0; /* need double precision */ - int num_uvals, num_vvals; - int ucount, vcount; - int uspan, vspan; - int *uspans = 0, - *vspans = 0; - int num_uspans, num_vspans; - - int i, j; - ddFLOAT *uknots = surface->pUknots; - ddFLOAT *vknots = surface->pVknots; - ddpex3rtn status = Success; - - /* Small inaccuracies sometimes cause span_evaluation_points() to - * generate an extra point or two, so allocate the arrays two sizes - * larger than the expected need. - */ - ucount = state->approx_value[0] + 4; - vcount = state->approx_value[1] + 4; - - if ( !( uvals = (double *) xalloc(ucount * sizeof(double))) ) { - status = BadAlloc; - goto abort; - } - - if ( !( vvals = (double *) xalloc(vcount * sizeof(double))) ) { - status = BadAlloc; - goto abort; - } - - num_uspans = 1; uspans = &uspan; - num_vspans = 1; vspans = &vspan; - for ( i = surface->uOrder - 1; i < surface->mPts; i++ ) { - if ( uknots[i] != uknots[i+1] ) { - uspan = i + 1; - span_evaluation_points( uknots, i, - state->range.umin, state->range.umax, - state->approx_value[0], - &num_uvals, uvals ); - if ( num_uvals <= 0 ) - continue; - - for ( j = surface->vOrder - 1; j < surface->nPts; j++ ) { - if ( vknots[j] != vknots[j+1] ) { - vspan = j + 1; - span_evaluation_points( vknots, j, - state->range.vmin,state->range.vmax, - state->approx_value[1], - &num_vvals, vvals ); - if ( num_vvals <= 0 ) - continue; - - if ( status = add_grid( state, surface, - num_uvals, num_vvals, - uvals, vvals, - num_uspans, num_vspans, - uspans, vspans ) ) - goto abort; - } - } - } - } - -abort: - if (uvals) xfree(uvals); - if (vvals) xfree(vvals); - - return (status); -} - - - -/*++ - | - | Function Name: span_evaluation_points - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -span_evaluation_points( knots, span, tmin, tmax, apxval, num_vals, vals ) - ddFLOAT *knots; - int span; - double tmin, tmax; - double apxval; - int *num_vals; - double *vals; -{ - double t, dt; - double left, right; - - int count = 0, maxvals; - double *ep = vals; - - if ( knots[span] < tmax && knots[span+1] > tmin ) { - /* maxvals is used to control the number of positions generated so - * that very small nearly zero-width intervals aren't generated - * due to small floating point inaccuracies. - */ - maxvals = apxval + 2; - left = knots[span]; - right = knots[span+1]; - dt = (right - left) / (double)(maxvals - 1); - t = left; - - /* If tmin is in the interval then start with it. */ - if ( tmin > left && tmin < right ) { - ep[count++] = tmin; - while ( t <= tmin ) { - t += dt; --maxvals; - } - } - ep[count++] = t; - t += dt; --maxvals; - - /* Interior values. */ - for ( ; maxvals > 1 && t < tmax; t += dt, --maxvals ) - ep[count++] = t; - - /* Last value. */ - if ( right > tmax ) - ep[count++] = tmax; - else - ep[count++] = right; - } - *num_vals = count; -} - - - -#define GRID_LIST_CHUNK 5 - -/*++ - | - | Function Name: add_grid - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -add_grid( state, surface, ucount, vcount, uvals, vvals, - num_uspans, num_vspans, uspans, vspans ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - int ucount, vcount; - double *uvals, *vvals; - int num_uspans, num_vspans; - int *uspans, *vspans; -{ -/* calls */ - void phg_ns_evaluate_surface_in_span(); - -/* uses */ - int uspan, vspan; - int i, j; - Nurb_edge_point *ep; - Nurb_grid *grid; - - if ( ucount <= 0 || vcount <= 0 ) - return 1; - - if ( state->grids.number % GRID_LIST_CHUNK == 0 ) { - if ( state->grids.number == 0 ) - state->grids.grids = (Nurb_grid *)xalloc( - GRID_LIST_CHUNK * sizeof(Nurb_grid) ); - else - state->grids.grids = (Nurb_grid *)xrealloc( state->grids.grids, - (state->grids.number + GRID_LIST_CHUNK) * sizeof(Nurb_grid) ); - } - if ( !state->grids.grids ) { - return (BadAlloc); - } - - ++state->grids.number; - - grid = &state->grids.grids[state->grids.number-1]; - if ( !( grid->pts = (Nurb_edge_point *) - xalloc(ucount * vcount * sizeof(Nurb_edge_point))) ) { - return (BadAlloc); - } - - /* Calculate vertex coordinates. */ - ep = grid->pts; - for ( j = 0; j < vcount; j++ ) { - vspan = (num_vspans > 1) ? vspans[j] : vspans[0]; - for ( i = 0; i < ucount; i++, ep++ ) { - ep->count = 0; - ep->u = uvals[i]; ep->v = vvals[j]; - uspan = (num_uspans > 1) ? uspans[i]:uspans[0]; - phg_ns_evaluate_surface_in_span( surface, ep->u, ep->v, - uspan, vspan, &ep->pt ); - } - } - grid->nu = ucount; grid->nv = vcount; - grid->extent.umin = uvals[0]; grid->extent.umax = uvals[ucount-1]; - grid->extent.vmin = vvals[0]; grid->extent.vmax = vvals[vcount-1]; - - return (Success); -} - - - -/*++ - | - | Function Name: phg_ns_evaluate_surface_in_span - | - | Function Description: - | - | Note(s): - | - --*/ - -void -phg_ns_evaluate_surface_in_span( surface, u, v, uspan, vspan, spt ) - miNurbSurfaceStruct *surface; - register double u, v; - int uspan, vspan; - ddCoord4D *spt; -{ - ddCoord4D npt[MAXORD], tmppts[MAXORD]; - int iu, iv; - int i; - double alpha, alpha1; - int nu, nv, j, k; - int uorder = surface->uOrder; - int vorder = surface->vOrder; - ddFLOAT *uknots = surface->pUknots; - ddFLOAT *vknots = surface->pVknots; - ddCoord4D *tmp; - char rat; - - rat = DD_IsVert4D(surface->points.type); - - iu = uspan - uorder; iv = vspan - vorder; - for ( nv = 0; nv < vorder; nv++ ) { - - if ( rat ) { - for ( nu = 0; nu < uorder; nu++ ) - tmppts[nu] = surface->points.ddList->pts.p4Dpt[(iv + nv) * surface->mPts + (iu + nu)]; - } else { - for ( nu = 0; nu < uorder; nu++ ) { - tmppts[nu].x = surface->points.ddList->pts.p3Dpt[(iv + nv) * surface->mPts + (iu + nu)].x; - tmppts[nu].y = surface->points.ddList->pts.p3Dpt[(iv + nv) * surface->mPts + (iu + nu)].y; - tmppts[nu].z = surface->points.ddList->pts.p3Dpt[(iv + nv) * surface->mPts + (iu + nu)].z; - } - } - - for ( k = 1; k < uorder; k++ ) { - for ( j = uorder-1, tmp = &tmppts[j]; j >= k; j--, tmp--) { - i= j + iu; - alpha = (u - uknots[i]) / (uknots[i+uorder-k] - uknots[i]); - alpha1 = 1.0 - alpha; - tmp->x = alpha * tmp->x + alpha1 * (tmp-1)->x; - tmp->y = alpha * tmp->y + alpha1 * (tmp-1)->y; - tmp->z = alpha * tmp->z + alpha1 * (tmp-1)->z; - if ( rat ) - tmp->w = alpha * tmp->w + alpha1 * (tmp-1)->w; - } - } - - npt[nv] = tmppts[uorder - 1]; - } - - for ( nv = 0; nv < vorder; nv++ ) { - tmppts[nv] = npt[nv]; - } - - for ( k = 1; k < vorder; k++ ) { - for ( j = vorder - 1, tmp = &tmppts[j]; j >= k; j--, tmp--) { - i= j + iv; - alpha = (v - vknots[i]) / (vknots[i+vorder-k] - vknots[i]); - alpha1 = 1.0 - alpha; - tmp->x = alpha * tmp->x + alpha1 * (tmp-1)->x; - tmp->y = alpha * tmp->y + alpha1 * (tmp-1)->y; - tmp->z = alpha * tmp->z + alpha1 * (tmp-1)->z; - if ( rat ) - tmp->w = alpha * tmp->w + alpha1 * (tmp-1)->w; - } - } - - *spt = tmppts[vorder-1]; - if ( !rat ) - spt->w = 1.0; -} - - - -/*++ - | - | Function Name: phg_ns_evaluate_surface - | - | Function Description: - | - | Note(s): - | - --*/ - -void -phg_ns_evaluate_surface( surface, u, v, spt ) - miNurbSurfaceStruct *surface; - register double u, v; - ddCoord4D *spt; -{ - int iu, iv; - - register ddFLOAT *uknots = surface->pUknots; - register ddFLOAT *vknots = surface->pVknots; - - iu = surface->numUknots - 1; - iv = surface->numVknots - 1; - - /* Ensure parameters are within range. */ - if ( u < uknots[0] ) - u = uknots[0]; - else if ( u > uknots[iu] ) - u = uknots[iu]; - - if ( v < vknots[0] ) - v = vknots[0]; - else if ( v > vknots[iv] ) - v = vknots[iv]; - - /* Find the span where u,v belong. */ - if ( uknots[iu] == u ) - while ( uknots[iu] >= u ) --iu; - else - while ( uknots[iu] > u ) --iu; - - if ( vknots[iv] == v ) - while ( vknots[iv] >= v ) --iv; - else - while ( vknots[iv] > v ) --iv; - phg_ns_evaluate_surface_in_span( surface, u, v, ++iu, ++iv, spt ); -} - - - -/*++ - | - | Function Name: avg_vertex_normal - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -avg_vertex_normal( count, pt, ptp, ptq, nout ) - int count; - ddCoord3D *pt, *ptp, *ptq; - ddVector3D *nout; -{ - ddVector3D pvec, qvec; - ddVector3D nscratch; - double h; - - ddVector3D *p = &pvec, - *q = &qvec; - ddVector3D *n; - - /* Calculate the vertex normal for the specified vertex by computing - * the cross product of the vectors connecting "pt" to "ptp" and "ptq," - * N = (ptp - pt) X (ptq - pt). If the count is > 0 average this normal - * into the vertex normal rather than just writing it there. This - * facilitates computing the average normal derived from all polygons - * adjacent to the vertex. - */ - p->x = ptp->x - pt->x; p->y = ptp->y - pt->y; p->z = ptp->z - pt->z; - q->x = ptq->x - pt->x; q->y = ptq->y - pt->y; q->z = ptq->z - pt->z; - n = count > 0 ? &nscratch : nout; - n->x = p->y * q->z - q->y * p->z; - n->y = q->x * p->z - p->x * q->z; - n->z = p->x * q->y - q->x * p->y; - /* Normalize. */ - h = 1.0 / sqrt(n->x * n->x + n->y * n->y + n->z * n->z); - n->x *= h; n->y *= h; n->z *= h; - if ( count > 0 ) { - /* Average in this normal. */ - h = 1.0 / (double)(count + 1); - nout->x = h * ((double)count * nout->x + n->x); - nout->y = h * ((double)count * nout->y + n->y); - nout->z = h * ((double)count * nout->z + n->z); - /* Normalize the new average. */ - n = nout; - h = 1.0 / sqrt(n->x * n->x + n->y * n->y + n->z * n->z); - n->x *= h; n->y *= h; n->z *= h; - } -} - - - -/*++ - | - | Function Name: build_facets - | - | Function Description: - | - | The purpose of this function is to take the surface internal - | descriptions of the grids and trim curves and convert them - | into descriptions of either quad meshes or SOFAS for - | rendering. - | - | Note that quad meshes are output if there are no trim curves, - | otherwise SOFAS are used. - | - | Note(s): - | - --*/ - -static ddpex3rtn -build_facets( state, surface ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; -{ - -#ifdef TRIMING - ddpex3rtn phg_nt_trim_rect(); -#endif /* TRIMING */ - - Nurb_edge_point *rect[4]; - int g; - int i, j; - int ucount, vcount; - Nurb_grid *grid; - miListHeader *listheader; - char rat; - ddpex3rtn status; - - /* Set the Path_d flags. */ - if ( state->grids.number <= 0 ) return (Success); - - rat = DD_IsVert4D(surface->points.type); - - if ( surface->numTrimCurveLists > 0 ) { -#ifdef TRIMING - /* - * If trim curves are present, build a SOFAS description - * of the trimmed surface. - */ - - /* Initialize output SOFAS structure */ - state->sofas = (miSOFASStruct *)xalloc(sizeof(miSOFASStruct)); - state->sofas->edgeAttribs = 0; - state->sofas->numFAS = state->sofas->numEdges = 0; - state->sofas->pFacets.type = DD_FACET_NONE; - state->sofas->pFacets.numFacets = state->sofas->pFacets.maxData = 0; - state->sofas->pFacets.facets.pNoFacet = 0; - state->sofas->points.numLists = state->sofas->points.maxLists = 0; - state->sofas->points.ddList = 0; - state->sofas->connects.numListLists = state->sofas->connects.maxData = 0; - state->sofas->connects.data = 0; - - /* Note that each rectangle of each grid is trimmed separately */ - for ( g = 0; g < state->grids.number; g++ ) { - grid = &state->grids.grids[g]; - ucount = grid->nu; vcount = grid->nv; - if ( surface->numTrimCurveLists > 0 ) { - register Nurb_edge_point *ll, *lr, *ur, *ul; - - /* Determine the facets and pass them to the trimming code. */ - ll = &grid->pts[0]; lr = ll + 1; - ul = &grid->pts[ucount]; ur = ul + 1; - for ( j = 0; j < vcount-1; j++, ll++, lr++, ur++, ul++ ) { - for ( i = 0; i < ucount-1; i++, ll++, lr++, ur++, ul++ ) { - rect[LL] = ll; - rect[LR] = lr; - rect[UR] = ur; - rect[UL] = ul; - if ( status = phg_nt_trim_rect( state, surface, rect, - add_pgon_point, - state->sofas ) ) - return status; - } - } - } - } -#endif /* TRIMING */ - } else { - - /* - * no triming - * Create a list of quad meshes from the grid data. - */ - - state->facets = - (miListHeader *)xalloc(state->grids.number*sizeof(miListHeader)); - - listheader = state->facets; - grid = state->grids.grids; - - /* - * Create a quad mesh for each grid - */ - for ( g = 0; g < state->grids.number; g++ ) { - - int j; - ddPointUnion new_point; - int num_pts = grid->nu * grid->nv; - Nurb_edge_point *ep = grid->pts; - - listheader->flags = 0; - listheader->numLists = 0; - listheader->maxLists = 0; - listheader->ddList = 0; - - MI_ALLOCLISTHEADER( listheader, 1); - - /* - * Note that the data in the grid is already organized - * in quad mesh order. Therefore, all that needs to be - * done is to copy the data from the list of edge_points to - * a listofddPoints. - */ - if ( rat ) { - - if (state->reps.normals) { - listheader->type = DD_NORM_POINT4D; - MI_ALLOCLISTOFDDPOINT( listheader->ddList, - num_pts, sizeof(ddNormalPoint4D)); - } else { - listheader->type = DD_HOMOGENOUS_POINT; - MI_ALLOCLISTOFDDPOINT( listheader->ddList, - num_pts, sizeof(ddCoord4D)); - } - - new_point = listheader->ddList->pts; - if (!(new_point.ptr)) return(BadAlloc); - - for ( j = 0; j < num_pts; j++, ep++ ) { - *(new_point.p4Dpt++) = ep->pt; - if (state->reps.normals) *(new_point.pNormal++) = ep->normal; - } - - listheader->ddList->numPoints = num_pts; - - } else { - - if (state->reps.normals) { - listheader->type = DD_NORM_POINT; - MI_ALLOCLISTOFDDPOINT( listheader->ddList, - num_pts, sizeof(ddNormalPoint)); - } else { - listheader->type = DD_3D_POINT; - MI_ALLOCLISTOFDDPOINT( listheader->ddList, - num_pts, sizeof(ddCoord3D)); - } - - new_point = listheader->ddList->pts; - if (!(new_point.ptr)) return(BadAlloc); - - for ( j = 0; j < num_pts; j++, ep++ ) { - *(new_point.p3Dpt++) = *((ddCoord3D *)(&ep->pt)); - if (state->reps.normals) *(new_point.pNormal++) = ep->normal; - } - - listheader->ddList->numPoints = num_pts; - - } - - /* skip to next grid and point list */ - listheader++; - grid++; - - } - } - - return ( Success ); -} - - - -/*++ - | - | Function Name: build_edge_reps - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -build_edge_reps( pddc, state, surface, edge_list, use_edge_flags ) - miDDContext *pddc; - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - miListHeader **edge_list; - int use_edge_flags; -{ - Nurb_grid *grid = state->grids.grids; - miListHeader *out_list; - register int i, j; - - /* Initialize output structure */ - out_list = (miListHeader *)xalloc(sizeof(miListHeader)); - *edge_list = out_list; - out_list->type = surface->points.type; - out_list->numLists = out_list->maxLists = 0; - out_list->ddList = 0; - - if ( surface->numTrimCurveLists > 0 ) { -#ifdef TRIMING - Nurb_trim_data *tdata = &state->trim_data; - Nurb_trim_segment *seg; - - for ( i = 0; i < state->grids.number; i++, grid++ ) { - for ( j = 0; j < tdata->nloops; j++ ) { - if ( !EXTENTS_OVERLAP( grid->extent, tdata->loops[j].extent) ) - continue; - if ( !(seg = tdata->loops[j].segs) ) - continue; - phg_nt_draw_segs( state, surface, grid, seg, tdata->vertices, - use_edge_flags, out_list ); - } - } -#endif /* TRIMING */ - } else { - for ( i = 0; i < state->grids.number; i++, grid++ ) { - phg_nt_draw_segs( state, surface, grid, state->edge_segs, - state->corners, use_edge_flags, out_list ); - } - } -} - - -/*++ - | - | Function Name: isocurve - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -isocurve( state, surface, dir, val, tmin, tmax, curve_list ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - int dir; /* 1 ==> constant U, 2 ==> constant V */ - double val; - double tmin, tmax; - miListHeader *curve_list; -{ - Nurb_trim_segment seg; - Nurb_param_point spts[2]; - int i, j; - Nurb_grid *grid; - ddpex3rtn status; - - /* Dummy up one or more trimming segments for this iso curve and pass - * them to the trim segment drawer. - */ - seg.first = seg.start = 0; seg.last = seg.end = 1; - seg.next = (Nurb_trim_segment *)NULL; - if ( dir == 2 ) { /* constant V */ - spts[0].v = spts[1].v = val; - seg.extent.vmin = seg.extent.vmax = val; - } else { /* constant U */ - spts[0].u = spts[1].u = val; - seg.extent.umin = seg.extent.umax = val; - } - - if ( surface->numTrimCurveLists > 0 ) { -#ifdef TRIMING - ddpex3rtn phg_nt_compute_trim_range(); - Nurb_limitlst ranges; - Nurb_limit no_limit; - int tc; - - /* Get the trimming intervals. */ - NURB_INIT_RANGE_LIST(&ranges); - if (status = phg_nt_compute_trim_range( state, dir, val, - tmin, tmax, &ranges, &tc )) - return( status ); - - if ( tc == -1) { - tc = 1; - ranges.limits = &no_limit; - no_limit.lmin = tmin; - no_limit.lmax = tmax; - } - - for ( i = 0; i < tc; i++ ) { - if ( dir == 2 ) { /* constant V */ - spts[0].u = seg.extent.umin = ranges.limits[i].lmin; - spts[1].u = seg.extent.umax = ranges.limits[i].lmax; - } else { /* constant U */ - spts[0].v = seg.extent.vmin = ranges.limits[i].lmin; - spts[1].v = seg.extent.vmax = ranges.limits[i].lmax; - } - grid = state->grids.grids; - for ( j = 0; j < state->grids.number; j++, grid++ ) { - if ( dir == 1 && xin(grid->extent.umin,grid->extent.umax,val) - || dir == 2 && xin(grid->extent.vmin,grid->extent.vmax,val)) - phg_nt_draw_segs(state, surface, grid, &seg, spts, 0, curve_list); - } - } - - if ( ranges.size > 0 ) - xfree( ranges.limits ); - -#endif /* TRIMING */ - } else { /* no trimming */ - if ( dir == 2 ) { /* constant V */ - spts[0].u = seg.extent.umin = tmin; - spts[1].u = seg.extent.umax = tmax; - } else { /* constant U */ - spts[0].v = seg.extent.vmin = tmin; - spts[1].v = seg.extent.vmax = tmax; - } - - grid = state->grids.grids; - for ( i = 0; i < state->grids.number; i++, grid++ ) { - if ( dir == 1 && xin(grid->extent.umin,grid->extent.umax,val) - || dir == 2 && xin(grid->extent.vmin,grid->extent.vmax,val)) - phg_nt_draw_segs( state, surface, grid, &seg, spts, 0, curve_list ); - } - } - - return Success; -} - - - -/*++ - | - | Function Name: uniform_isocurves - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -uniform_isocurves( state, surface ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; -{ - double t, dt; - int j; - Nurb_param_limit *range = &state->param_limits; - - /* Initialize output structure */ - state->isocrvs = (miListHeader *)xalloc(sizeof(miListHeader)); - state->isocrvs->type = surface->points.type; - state->isocrvs->numLists = state->isocrvs->maxLists = 0; - state->isocrvs->ddList = 0; - - /* Place curves uniformly between the specified parameter limits. - * Also place curves at the parameter limits, only if there is no - * trimming. - */ - - /* First curve of constant U. */ - t = range->umin; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming */ -#endif /* CADAM */ - (void)isocurve( state, surface, 1, t, range->vmin, range->vmax, - state->isocrvs ); -#ifdef CADAM - } -#endif /* CADAM */ - - /* Interior curves of constant U. */ - dt = (range->umax - range->umin) / (state->isocount[0] + 1); - for ( j = 0, t += dt; j < state->isocount[0]; j++, t += dt ) { - (void)isocurve( state, surface, 1, t, range->vmin, range->vmax, - state->isocrvs ); - } - - /* Last curve of constant U. */ - t = range->umax; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming */ -#endif /* CADAM */ - (void)isocurve( state, surface, 1, t, range->vmin, range->vmax, - state->isocrvs ); -#ifdef CADAM - } -#endif /* CADAM */ - - - /* First curve of constant V. */ - t = range->vmin; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming */ -#endif /* CADAM */ - (void)isocurve( state, surface, 2, t, range->umin, range->umax, - state->isocrvs ); -#ifdef CADAM - } -#endif /* CADAM */ - - /* Interior curves of constant V. */ - dt = (range->vmax - range->vmin) / (state->isocount[1] + 1); - for ( j = 0, t += dt; j < state->isocount[1]; j++, t += dt ) { - (void)isocurve( state, surface, 2, t, range->umin, range->umax, - state->isocrvs ); - } - - /* Last curve of constant V. */ - t = range->vmax; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming */ -#endif /* CADAM */ - (void)isocurve( state, surface, 2, t, range->umin, range->umax, - state->isocrvs ); -#ifdef CADAM - } -#endif /* CADAM */ - - return Success; -} - - -/*++ - | - | Function Name: nonuniform_isocurves - | - | Function Description: - | - | Note(s): - | - --*/ - -static int -nonuniform_isocurves( state, surface ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; -{ - ddFLOAT *uknots = surface->pUknots; - ddFLOAT *vknots = surface->pVknots; - double t, dt; - - int i, j; - Nurb_param_limit *range = &state->range; - - /* Initialize output structure */ - state->isocrvs = (miListHeader *)xalloc(sizeof(miListHeader)); - state->isocrvs->type = surface->points.type; - state->isocrvs->numLists = state->isocrvs->maxLists = 0; - state->isocrvs->ddList = 0; - - /* - * Place curves uniformly between each non-vacuous span. - * For each non-vacuous U span draw the iso U curves for all - * surface V. - */ - for ( i = surface->uOrder - 1; i < surface->mPts; i++ ) { - if ( uknots[i] != uknots[i+1] ) { - /* First curve of span. */ - t = uknots[i]; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming -*/ -#endif /* CADAM */ - if ( t >= range->umin && t <= range->umax ) - (void)isocurve( state, surface, 1, t, - range->vmin, range->vmax, - state->isocrvs ); -#ifdef CADAM - } else { - if ( t > range->umin && t < range->umax ) - (void)isocurve( state, surface, 1, t, - range->vmin, range->vmax, - state->isocrvs ); - } -#endif /* CADAM */ - - /* Interior curves of span. */ - dt = (uknots[i+1] - uknots[i]) / (state->isocount[0] + -1); - for ( j = 0, t += dt; j < state->isocount[0]; j++, t += -dt ) { - if ( t >= range->umin && t <= range->umax ) - (void)isocurve( state, surface, 1, t, - range->vmin, range->vmax, - state->isocrvs ); - } - - /* Last curve of span. */ - t = uknots[i+1]; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming -*/ -#endif /* CADAM */ - if ( t >= range->umin && t <= range->umax ) - (void)isocurve( state, surface, 1, t, - range->vmin, range->vmax, - state->isocrvs ); -#ifdef CADAM - } else { - if ( t > range->umin && t < range->umax ) - (void)isocurve( state, surface, 1, t, - range->vmin, range->vmax, - state->isocrvs ); - } -#endif /* CADAM */ - } - } - - /* For each non-vacuous V span draw the iso V curves for all -surface U. */ - for ( i = surface->vOrder - 1; i < surface->nPts; i++ ) { - if ( vknots[i] != vknots[i+1] ) { - /* First curve of span. */ - t = vknots[i]; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming -*/ -#endif /* CADAM */ - if ( t >= range->vmin && t <= range->vmax ) - (void)isocurve( state, surface, 2, t, - range->umin, range->umax, - state->isocrvs ); -#ifdef CADAM - } else { - if ( t > range->vmin && t < range->vmax ) - (void)isocurve( state, surface, 2, t, - range->umin, range->umax, - state->isocrvs ); - } -#endif /* CADAM */ - - /* Inteior curves of span. */ - dt = (vknots[i+1] - vknots[i]) / (state->isocount[1] + -1); - for ( j = 0, t += dt; j < state->isocount[1]; j++, t += -dt ) { - if ( t >= range->vmin && t <= range->vmax ) - (void)isocurve( state, surface, 2, t, - range->umin, range->umax, - state->isocrvs ); - } - - /* Last curve of span. */ - t = vknots[i+1]; -#ifdef CADAM - if ( surface->numTrimCurveLists <= 0 ) { /* no trimming -*/ -#endif /* CADAM */ - if ( t >= range->vmin && t <= range->vmax ) - (void)isocurve( state, surface, 2, t, - range->umin, range->umax, - state->isocrvs ); -#ifdef CADAM - } else { - if ( t > range->vmin && t < range->vmax ) - (void)isocurve( state, surface, 2, t, - range->umin, range->umax, - state->isocrvs ); - } -#endif /* CADAM */ - } - } - - return Success; -} - - - -/*++ - | - | Function Name: compute_average_edge_point_normals - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -compute_average_edge_point_normals( surface, grid ) - miNurbSurfaceStruct *surface; - Nurb_grid *grid; -{ - int i, j; - int ucount = grid->nu, - vcount = grid->nv; - Nurb_edge_point *ll, *lr, *ur, *ul; - char rat; - - rat = DD_IsVert4D(surface->points.type); - - /* Step along the surface and calculate averaged normals. */ - ll = &grid->pts[0]; lr = ll + 1; - ul = &grid->pts[ucount]; ur = ul + 1; - for ( j = 0; j < vcount-1; j++, ll++, lr++, ul++, ur++ ) { - for ( i = 0; i < ucount-1; i++, ll++, lr++, ul++, ur++ ) { - /* Calculate and average vertex normals. */ - if ( rat ) { - ddCoord3D pll, plr, pur, pul; - register ddCoord4D *pt; - register double h; - - pt = &ll->pt; h = 1.0 / pt->w; - pll.x = h * pt->x; pll.y = h * pt->y; pll.z = h * pt->z; - pt = &lr->pt; h = 1.0 / pt->w; - plr.x = h * pt->x; plr.y = h * pt->y; plr.z = h * pt->z; - pt = &ur->pt; h = 1.0 / pt->w; - pur.x = h * pt->x; pur.y = h * pt->y; pur.z = h * pt->z; - pt = &ul->pt; h = 1.0 / pt->w; - pul.x = h * pt->x; pul.y = h * pt->y; pul.z = h * pt->z; - avg_vertex_normal( ll->count, &pll, &plr, &pul, &ll->normal ); - avg_vertex_normal( lr->count, &plr, &pur, &pll, &lr->normal ); - avg_vertex_normal( ur->count, &pur, &pul, &plr, &ur->normal ); - avg_vertex_normal( ul->count, &pul, &pll, &pur, &ul->normal ); - } else { - avg_vertex_normal( ll->count, (ddCoord3D*)&ll->pt, - (ddCoord3D*)&lr->pt, (ddCoord3D*)&ul->pt, &ll->normal ); - avg_vertex_normal( lr->count, (ddCoord3D*)&lr->pt, - (ddCoord3D*)&ur->pt, (ddCoord3D*)&ll->pt, &lr->normal ); - avg_vertex_normal( ur->count, (ddCoord3D*)&ur->pt, - (ddCoord3D*)&ul->pt, (ddCoord3D*)&lr->pt, &ur->normal ); - avg_vertex_normal( ul->count, (ddCoord3D*)&ul->pt, - (ddCoord3D*)&ll->pt, (ddCoord3D*)&ur->pt, &ul->normal ); - } - ++ll->count; ++lr->count; ++ur->count; ++ul->count; - } - } -} - - -/*++ - | - | Function Name: compute_edge_point_normals - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -compute_edge_point_normals( surface, grid ) - miNurbSurfaceStruct *surface; - Nurb_grid *grid; -{ - register int i, j; - register int ucount = grid->nu, vcount = grid->nv; - register Nurb_edge_point *ll, *lr, *ur, *ul; - char rat; - - rat = DD_IsVert4D(surface->points.type); - - /* Step along the surface and calculate normals. */ - ll = &grid->pts[0]; lr = ll + 1; - ul = &grid->pts[ucount]; ur = ul + 1; - for ( j = 0; j < vcount-1; j++, ll++, lr++, ul++, ur++ ) { - for ( i = 0; i < ucount-1; i++, ll++, lr++, ul++, ur++ ) { - /* Calculate vertex normals. */ - if ( rat ) { - ddCoord3D pll, plr, pur, pul; - register ddCoord4D *pt; - register double h; - - pt = &ll->pt; h = 1.0 / pt->w; - pll.x = h * pt->x; pll.y = h * pt->y; pll.z = h * pt->z; - pt = &lr->pt; h = 1.0 / pt->w; - plr.x = h * pt->x; plr.y = h * pt->y; plr.z = h * pt->z; - pt = &ul->pt; h = 1.0 / pt->w; - pul.x = h * pt->x; pul.y = h * pt->y; pul.z = h * pt->z; - avg_vertex_normal( 0, &pll, &plr, &pul, &ll->normal ); - - /* Calculate normals at edge of grid. */ - if ( i == ucount-2 || j == vcount-2 ) { - pt = &ur->pt; h = 1.0 / pt->w; - pur.x = h * pt->x; pur.y = h * pt->y; pur.z = h * pt->z; - } - if ( i == ucount-2 ) - avg_vertex_normal( 0, &plr, &pur, &pll, &lr->normal ); - if ( j == vcount-2 ) - avg_vertex_normal( 0, &pul, &pll, &pur, &ul->normal ); - if ( i == ucount-2 && j == vcount-2 ) - avg_vertex_normal( 0, &pur, &pul, &plr, &ur->normal ); - } else { - avg_vertex_normal( 0, (ddCoord3D*)&ll->pt, - (ddCoord3D*)&lr->pt, (ddCoord3D*)&ul->pt, &ll->normal ); - - /* Calculate normals at edge of grid. */ - if ( i == ucount-2 ) - avg_vertex_normal( 0, (ddCoord3D*)&lr->pt, - (ddCoord3D*)&ur->pt, (ddCoord3D*)&ll->pt, &lr->normal ); - if ( j == vcount-2 ) - avg_vertex_normal( 0, (ddCoord3D*)&ul->pt, - (ddCoord3D*)&ll->pt, (ddCoord3D*)&ur->pt, &ul->normal ); - if ( i == ucount-2 && j == vcount-2 ) - avg_vertex_normal( 0, (ddCoord3D*)&ur->pt, - (ddCoord3D*)&ul->pt, (ddCoord3D*)&lr->pt, &ur->normal ); - } - } - } -} - - - -/*++ - | - | Function Name: make_edge_segments - | - | Function Description: - | - | Note(s): - | - --*/ - -static void -make_edge_segments( state ) - Nurb_surf_state *state; -{ - int i; - Nurb_param_point *corners = state->corners; - Nurb_trim_segment *segs = state->edge_segs; - Nurb_trim_segment *seg; - - /* Generate the edges by building a fake trimming segment for each edge - * and calling the trim edge generator. - */ - corners[0].u = state->range.umin; corners[0].v = state->range.vmin; - corners[1].u = state->range.umax; corners[1].v = state->range.vmin; - corners[2].u = state->range.umax; corners[2].v = state->range.vmax; - corners[3].u = state->range.umin; corners[3].v = state->range.vmax; - corners[4].u = state->range.umin; corners[4].v = state->range.vmin; - segs[0].first = segs[0].start = 0; segs[0].last = segs[0].end = 1; - segs[1].first = segs[1].start = 1; segs[1].last = segs[1].end = 2; - segs[2].first = segs[2].start = 2; segs[2].last = segs[2].end = 3; - segs[3].first = segs[3].start = 3; segs[3].last = segs[3].end = 4; - segs[0].next = &segs[1]; - segs[1].next = &segs[2]; - segs[2].next = &segs[3]; - segs[3].next = (Nurb_trim_segment *)NULL; - - for ( i = 0, seg = segs; i < 4; i++, seg++ ) { - seg->vis = ~0; - if ( corners[seg->first].u <= corners[seg->last].u ) { - seg->extent.umin = corners[seg->first].u; - seg->extent.umax = corners[seg->last].u; - } else { - seg->extent.umin = corners[seg->last].u; - seg->extent.umax = corners[seg->first].u; - } - if ( corners[seg->first].v <= corners[seg->last].v ) { - seg->extent.vmin = corners[seg->first].v; - seg->extent.vmax = corners[seg->last].v; - } else { - seg->extent.vmin = corners[seg->last].v; - seg->extent.vmax = corners[seg->first].v; - } - } -} - - - -/*++ - | - | Function Name: build_surf_markers - | - | Function Description: - | - | Note(s): - | - --*/ - -static ddpex3rtn -build_surf_markers( surface, state ) - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; -{ - - if (!state->markers) - state->markers = (miListHeader *)xalloc(sizeof(miListHeader)); - - *state->markers = surface->points; - - return Success; -} - - - -/*++ - | - | Function Name: build_control_polygon - | - | Function Description: - | - | Note(s): - | - --*/ - -static ddpex3rtn -build_control_polygon( surface, state ) - miNurbSurfaceStruct *surface; - Nurb_surf_state *state; -{ - int i, j; - listofddPoint *pddolist; - ddCoord3D *cpts3, *out_pt3; - ddCoord4D *cpts4, *out_pt4; - char rat; - - rat = DD_IsVert4D(surface->points.type); - - if (!state->isocrvs) - if (!(state->isocrvs = (miListHeader *)xalloc(sizeof(miListHeader)))) - return(BadAlloc); - - MI_ALLOCLISTHEADER(state->isocrvs, surface->mPts * surface->nPts); - if (!(pddolist = state->isocrvs->ddList)) return(BadAlloc); - - state->isocrvs->type = surface->points.type; - state->isocrvs->flags = surface->points.flags; - state->isocrvs->numLists = surface->mPts * surface->nPts; - - /* Connect the points in the U dimension. */ - if ( rat ) { - - for ( j = 0; j < surface->mPts; j++ ) { - cpts4 = &surface->points.ddList->pts.p4Dpt[j * surface->mPts]; - MI_ALLOCLISTOFDDPOINT(pddolist, surface->mPts, sizeof(ddCoord4D)); - if (!(out_pt4 = pddolist->pts.p4Dpt)) return(BadAlloc); - for ( i = 1; i < surface->mPts; i++ ) { - *(out_pt4++) = *(cpts4++); - } - (pddolist++)->numPoints = surface->mPts; - } - - } else { - - for ( j = 0; j < surface->mPts; j++ ) { - cpts3 = &surface->points.ddList->pts.p3Dpt[j * surface->mPts]; - MI_ALLOCLISTOFDDPOINT(pddolist, surface->mPts, sizeof(ddCoord3D)); - if (!(out_pt3 = pddolist->pts.p3Dpt)) return(BadAlloc); - for ( i = 1; i < surface->mPts; i++ ) { - *(out_pt3++) = *(cpts3++); - } - (pddolist++)->numPoints = surface->mPts; - } - - } - - /* Connect the points in the V dimension. */ - if ( rat ) { - - for ( j = 0; j < surface->nPts; j++ ) { - cpts4 = &surface->points.ddList->pts.p4Dpt[j]; - MI_ALLOCLISTOFDDPOINT(pddolist, surface->nPts, sizeof(ddCoord4D)); - if (!(out_pt4 = pddolist->pts.p4Dpt)) return(BadAlloc); - for ( i = 1; i < surface->nPts; i++ ) { - *(out_pt4++) = *cpts4; - cpts4 += surface->mPts; - } - (pddolist++)->numPoints = surface->nPts; - } - - } else { - - for ( j = 0; j < surface->nPts; j++ ) { - cpts3 = &surface->points.ddList->pts.p3Dpt[j]; - MI_ALLOCLISTOFDDPOINT(pddolist, surface->nPts, sizeof(ddCoord3D)); - if (!(out_pt3 = pddolist->pts.p3Dpt)) return(BadAlloc); - for ( i = 1; i < surface->nPts; i++ ) { - *(out_pt3++) = *cpts3; - cpts3 += surface->mPts; - } - (pddolist++)->numPoints = surface->nPts; - } - - } - - return Success; -} - - - -/*++ - | - | Function Name: free_grids - | - | Function Description: - | - | free the allocated data associated with a list of grids. - | - | Note(s): - | - --*/ - -static void -free_grids( grids ) - Nurb_gridlst *grids; -{ - int i; - - if ( grids && grids->number > 0 ) { - for ( i = 0; i < grids->number; i++ ) { - if ( grids->grids[i].pts ) - xfree( grids->grids[i].pts ); - } - xfree( grids->grids ); - } -} - - - -/*++ - | - | Function Name: nurb_surf_state_free - | - | Function Description: - | - | free all of the allocated data associated with a surface - | Nurb_surf_state data structure. - | - | Note(s): - | - --*/ - -static void -nurb_surf_state_free( state ) - Nurb_surf_state *state; -{ - int facet; - - /* Free everything but the cache data. */ - if ( state->ruknots ) - xfree( state->ruknots ); - if ( state->rvknots ) - xfree( state->rvknots ); - -#ifdef TRIMING - phg_nt_free_trim_data( &state->trim_data ); -#endif /* TRIMING */ - - if ( state->reps.facets ) { - if ( state->facets ) { - MI_FREELISTHEADER(state->facets); - for (facet = 0; facet < state->grids.number; facet++) - MI_FREELISTHEADER(state->facets + facet); - xfree(state->facets); - } - else if ( state->sofas ) { - MI_FREELISTHEADER(&(state->sofas->points)); - xfree(state->sofas); - } - } - if ( state->reps.edges && state->edges ) { - MI_FREELISTHEADER(state->edges); - xfree(state->edges); - } - if ( state->reps.isocrvs && state->isocrvs ) { - MI_FREELISTHEADER(state->isocrvs); - xfree(state->isocrvs); - } - if ( state->reps.markers && state->markers) { - /* Note that markers are a copy of the input data - DON`T FREE IT */ - xfree(state->markers); - } - if ( state->reps.hollow && state->hollow ) { - MI_FREELISTHEADER(state->hollow); - xfree(state->hollow); - } - - if ( state->grids.number > 0 ) { - free_grids( &state->grids ); - state->grids.number = 0; - state->grids.grids = (Nurb_grid *)NULL; - } -} - - - -#ifdef TRIMING - -/*++ - | - | Function Name: add_pgon_point - | - | Function Description: - | - | Enter the specified edge point into a miSOFASStruct - | according to the specified operation. - | - | Note(s): - | - --*/ - -static ddpex3rtn -add_pgon_point( state, surface, ddSOFAS, op, ep ) - Nurb_surf_state *state; - miNurbSurfaceStruct *surface; - miSOFASStruct *ddSOFAS; - Nurb_facet_op op; - Nurb_edge_point *ep; -{ - miConnListList *ConnListList; - miConnList *ConnList; - int num_points, data_count, i; - - /* a new point for the vertex list */ - if (ddSOFAS->points.ddList) - num_points = ddSOFAS->points.ddList->numPoints; - else num_points = 0; - - switch (op) { - - /* - * A new facet is to be started in the SOFAS output structure. - * The first task to complete is to insure that there is sufficient - * space for the new list od list of indices in the connection lists. - */ - case NURB_NEW_FACET: - ddSOFAS->connects.numListLists++; - data_count = MI_ROUND_LISTHEADERCOUNT(ddSOFAS->connects.numListLists) - * sizeof(miConnListList); - - if (data_count > ddSOFAS->connects.maxData) { - if (ddSOFAS->connects.data) { - ddSOFAS->connects.data = - (miConnListList *)xrealloc(ddSOFAS->connects.data, data_count); - ddSOFAS->connects.maxData = data_count; - } else { - ddSOFAS->connects.data = (miConnListList *)xalloc(data_count); - ddSOFAS->connects.maxData = data_count; - } - - if (!(ddSOFAS->connects.data)) return(BadAlloc); - - /* Initialize newly created entries */ - ConnListList = &ddSOFAS->connects.data[ddSOFAS->numFAS]; - for (i = MI_ROUND_LISTHEADERCOUNT(ddSOFAS->connects.numListLists) - - ddSOFAS->numFAS; - i > 0; - i--) { - ConnListList->numLists = ConnListList->maxData = 0; - (ConnListList++)->pConnLists = 0; - - } - } - - ddSOFAS->numFAS++; - - - /* - * a new contour is to be started in the SOFAS output structure. - * The first task is to insure that there is sufficient output - * space for the contour is the list of contour index lists - */ - case NURB_NEW_CONTOUR: - ConnListList = &ddSOFAS->connects.data[ddSOFAS->numFAS - 1]; - - data_count = MI_ROUND_LISTHEADERCOUNT( ConnListList->numLists+1 ) - * sizeof(miConnList); - - if (data_count > ConnListList->maxData) { - - if (ConnListList->pConnLists) { - ConnListList->pConnLists = - (miConnList *)xrealloc(ConnListList->pConnLists, - data_count ); - ConnListList->maxData = data_count; - } else { - ConnListList->pConnLists = (miConnList *)xalloc(data_count); - ConnListList->maxData = data_count; - } - - if (!(ConnListList->pConnLists)) return (BadAlloc); - - /* Initialize newly created entries */ - ConnList = &ConnListList->pConnLists[ConnListList->numLists]; - for (i = MI_ROUND_LISTHEADERCOUNT( ConnListList->numLists+1 ) - - ConnListList->numLists; - i > 0; - i--) { - ConnList->numLists = ConnList->maxData = 0; - (ConnList++)->pConnects = 0; - - } - } - - ConnListList->numLists++; - - /* - * Finally, insure sufficent space for the index! - */ - case NURB_SAME_CONTOUR: - ConnListList = &ddSOFAS->connects.data[ddSOFAS->numFAS - 1]; - ConnList = &ConnListList->pConnLists[ConnListList->numLists - 1]; - - data_count = MI_ROUND_LISTHEADERCOUNT( ConnList->numLists+1 ) - * sizeof(ddUSHORT); - - if (data_count > ConnList->maxData) { - if (ConnList->pConnects) { - ConnList->pConnects = (ddUSHORT *)xrealloc( ConnList->pConnects, - data_count); - ConnList->maxData = data_count; - } else { - ConnList->pConnects = (ddUSHORT *)xalloc(data_count); - ConnList->maxData = data_count; - } - - if (!(ConnList->pConnects)) return (BadAlloc); - } - - /* Lastly, enter the index into the appropriate list */ - ConnList->pConnects[ConnList->numLists] = num_points; - ConnList->numLists++; - - - } - - - /* Insure there is a list for the vertex data */ - if (!(ddSOFAS->points.ddList)) { - - MI_ALLOCLISTHEADER(&ddSOFAS->points, 1) - if (!(ddSOFAS->points.ddList)) return(BadAlloc); - - if (state->reps.normals) ddSOFAS->points.type = DD_NORM_POINT4D; - else ddSOFAS->points.type = DD_HOMOGENOUS_POINT; - - ddSOFAS->points.flags = 0; - ddSOFAS->points.numLists = 1; - - } - - /* Now, enter the point information into the point array */ - if (state->reps.normals) { - - MI_ALLOCLISTOFDDPOINT(ddSOFAS->points.ddList, - MI_ROUND_LISTHEADERCOUNT(num_points + 1), - sizeof(ddNormalPoint4D)); - if (!(ddSOFAS->points.ddList->pts.ptr)) - return(BadAlloc); - - ddSOFAS->points.ddList->pts.pNpt4D[num_points].pt = ep->pt; - ddSOFAS->points.ddList->pts.pNpt4D[num_points].normal = ep->normal; - - } else { - - MI_ALLOCLISTOFDDPOINT(ddSOFAS->points.ddList, - MI_ROUND_LISTHEADERCOUNT(num_points + 1), - sizeof(ddCoord4D)); - if (!(ddSOFAS->points.ddList->pts.ptr)) - return(BadAlloc); - - ddSOFAS->points.ddList->pts.p4Dpt[num_points] = ep->pt; - } - - ddSOFAS->points.ddList->numPoints = num_points + 1; - -} - -#endif /* TRIMING */ - -#define WS_NSRF_BOTTOM Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c:3.8 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c Sat Feb 28 21:41:54 2004 @@ -1,382 +0,0 @@ -/* $Xorg: miNurbs.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miNurbs.c,v 3.8 2001/12/14 19:57:29 dawes Exp $ */ - -#include "X.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "ddpex.h" -#include "ddpex3.h" -#include "miRender.h" -#include "ddpex2.h" -#include "miNurbs.h" -#include "pexos.h" - - -/* - * mtx to convert polynomial coeffs ai, to fwd basis coeffs Aj is - * D j+1 k i - * Aj = Sum [Sum (-1) * (j!/k!(j-k)!)*(j-k) ] * ai where D=degree - * i=0 k=0 - */ - -#if MAXORD == 4 -/* Debugging is often easier if MAXORD is made small. */ - -double mi_nu_ptofd[MAXORD][MAXORD] = { -{ 1.0, 0.0, 0.0, 0.0}, -{ 0.0, 1.0, 1.0, 1.0}, -{ 0.0, 0.0, 2.0, 6.0}, -{ 0.0, 0.0, 0.0, 6.0} -}; - -#else - -double mi_nu_ptofd[MAXORD][MAXORD] = { -{ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, -{ 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, -{ 0.0, 0.0, 2.0, 6.0, 14.0, 30.0, 62.0, 126.0, 254.0, 510.0}, -{ 0.0, 0.0, 0.0, 6.0, 36.0, 150.0, 540.0, 1806.0, 5796.0, 18150.0}, -{ 0.0, 0.0, 0.0, 0.0, 24.0, 240.0, 1560.0, 8400.0, 40824.0, 186480.0}, -{ 0.0, 0.0, 0.0, 0.0, 0.0, 120.0, 1800.0, 16800.0, 126000.0, 834120.0}, -{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 720.0, 15120.0, 191520.0, 1905120.0}, -{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5040.0, 141120.0, 2328480.0}, -{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40320.0, 1451520.0}, -{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 362880.0} -}; - -#endif - -#undef HUGE -#define HUGE 10E30 - - - -/*++ - | - | Function Name: mi_nu_preprocess_knots - | - | Function Description: - | - | Note(s): - | - --*/ - -void -mi_nu_preprocess_knots( order, nk, knots, rp ) - ddUSHORT order; - int nk; - ddFLOAT *knots; - ddFLOAT rp[][MAXORD]; /* reciprocal of knots diff */ -{ - double x; - - register int i, j; - - for ( i = 0; i < nk; i++ ) - rp[i][0] = 1.0 ; - for ( j = 1; j < order; j++ ) { - for ( i = 0; i <= nk - j; i++ ) { - if ( (x = knots[i+j] - knots[i]) == 0.0 ) { - rp[i][j] = HUGE; - } else { - rp[i][j] = 1.0 / x; - } - } - } -} - - - -/*++ - | - | Function Name: mi_nu_compute_nurb_basis_function - | - | Function Description: - | - | Recursive definition of polynomial coefficients for span (0<= s <=1). - | C(i,j,k) = a*C(i,j-1,k-1) + b*C(i,j,k-1) + c*C(i+1,j-1,k-1) + d*C(i+1,j,k-1) - | a = (s(l+1) - s(l))/(s(i+k-1) - s(i)), b = (s(l) - s(i))/(s(i+k-1) - s(i)) - | c = -(s(l+1) - s(l))/(s(i+k) - s(i+1)), d = (s(i+k) - s(l))/(s(i+k) - s(i+1)) - | - | Note(s): - | - --*/ - -void -mi_nu_compute_nurb_basis_function( order, span, knots, kr, C ) - ddUSHORT order; - int span; - ddFLOAT *knots; - ddFLOAT kr[][MAXORD]; /* reciprocal of knots diff */ - double C[MAXORD][MAXORD]; -{ - int i, j, k, m, im, degree = order - 1; - double t0, t1, t2, t3; - - if ( order == 2 ) { - C[0][0] = 1.0; - C[0][1] = 0.0; - C[1][0] = -1.0; - C[1][1] = 1.0; - return; - } - - /* Compute the coefficients of Nik in polynomial basis, for the span - * knots[i] to knots[i+1] where s goes from 0 to 1.0 - */ - t1 = knots[span+1] - knots[span]; - C[0][degree] = 1.0; /* Ni1 = 1.0 within span */ - for ( k = 1; k < order; k++ ) { /* recurse on order for Cj,i,k */ - t0 = t1 * kr[span-k+1][k]; - im = degree - k; - C[0][im] = t0 * C[0][im+1]; /* top left coeff */ - for ( j = k-1; j > 0; j-- ) - C[j][im] = t0 * ( C[j][im+1] - C[j-1][im+1] ); /*middle*/ - C[k][im] = -t0 * C[k-1][im+1]; /* top right coeff */ - for (m=k-1; m>0; m--) { /* central section */ - i = span - m; /* right edge first */ - im = degree - m; - C[k][im] = t1 * (kr[i][k] * C[k-1][im] - kr[i+1][k] * C[k-1][im+1]); - t2 = knots[i+k+1] - knots[span]; - t3 = knots[span] - knots[i]; - for ( j = k-1; j > 0; j-- ) /* then j down to 1 */ - C[j][im] = - kr[i][k] * (t1 * C[j-1][im] - + t3 * C[j][im]) - + kr[i+1][k] * (t2 * C[j][im+1] - t1 * C[j-1][im+1]); - C[0][im] = kr[i][k] * t3 * C[0][im] - + kr[i+1][k] * t2 * C[0][im+1]; /* left edge */ - } - t0 = t1 * kr[span][k]; /* bottom rt,middle coeffs */ - for ( j = k; j > 0; j-- ) - C[j][degree] = t0 * C[j-1][degree]; - C[0][degree] = 0.0; /* bottom left coeff */ - } -} - - - -/*++ - | - | Function Name: mi_nu_insert_knots - | - | Function Description: - | - | Note(s): - | - --*/ - -int -mi_nu_insert_knots( order, pt_type, - numinknots, oknots, opoints, - numoutknots, nknots, npoints ) - ddUSHORT order; - ddPointType pt_type; - ddUSHORT numinknots; - ddFLOAT *oknots; /* original knots */ - ddFLOAT *opoints; /* original control points */ - int *numoutknots; - ddFLOAT *nknots; /* new knots */ - ddFLOAT *npoints; /* new control points */ -{ - /* - * Assumptions: - inserted knots are within range of original knots. - */ - int i, k, iok, ink, mult, num_pts; - int numtmpknots; - ddFLOAT *tmpknots; - ddFLOAT alpha, alph1; - ddCoord2D *npts2; - ddCoord3D *npts3; - ddCoord4D *npts4; - - /* Check to see if new knots needed. Copy and return if not. */ - if ( *numoutknots <= 0 ) { - *numoutknots = numinknots; - memcpy( (char *)nknots, (char *)oknots, (int)numinknots * sizeof(ddFLOAT) ); - return 1; - } - - /* Copy old control points into new space. */ - num_pts = numinknots - order; - if ( DD_IsVert2D(pt_type) ) { - memcpy( (char *)npoints, (char *)opoints, num_pts * sizeof(ddCoord2D)); - npts2 = (ddCoord2D *)npoints; - } else if ( DD_IsVert3D(pt_type) ) { - memcpy( (char *)npoints, (char *)opoints, num_pts * sizeof(ddCoord3D)); - npts3 = (ddCoord3D *)npoints; - } else if ( DD_IsVert4D(pt_type) ) { - memcpy( (char *)npoints, (char *)opoints, num_pts * sizeof(ddCoord4D)); - npts4 = (ddCoord4D *)npoints; - } else return (1); - - if ( !(tmpknots = (ddFLOAT *) - xalloc( (numinknots + *numoutknots) * sizeof(float))) ) - return 0; - - /* Insert new knots and control points, starting from the end of the - * original lists. - */ - memcpy( (char *)tmpknots, (char *)oknots, (int)numinknots * sizeof(ddFLOAT) ); - numtmpknots = numinknots; - ink = *numoutknots; - iok = numinknots - 1; - - while ( ink > 0 ) { - - mult = 1; - --ink; - /* Count mutiplicity of the new knot to be inserted. */ - while ( ink > 0 && nknots[ink] == nknots[ink-1] ) { - ++mult; - --ink; - } - - /* Find position of knot(s) to insert. */ - while ( iok >= 0 && tmpknots[iok] >= nknots[ink] ) - --iok; - - /* Move control points down to make space for inserted ones. - * Use memove so that the overlap is handled. - */ - /* note that the funky &blah[...] notation is equivalent - to blah+... since blah is a pointer. JSH 4-10-91 - */ - if ( DD_IsVert2D(pt_type) ) - memmove((char *)(&npts2[iok + 1 + mult]),(char *)(&npts2[iok + 1]), - ((num_pts - iok) - 1) * sizeof(ddCoord2D) ); - else if ( DD_IsVert3D(pt_type) ) - memmove((char *)(&npts3[iok + 1 + mult]),(char *)(&npts3[iok + 1]), - ((num_pts - iok) - 1) * sizeof(ddCoord3D) ); - else - memmove((char *)(&npts4[iok + 1 + mult]),(char *)(&npts4[iok + 1]), - ((num_pts - iok) - 1) * sizeof(ddCoord4D) ); - - /* Do de Boor to insert new knot with multiplicity `mult'. */ - if ( DD_IsVert2D(pt_type) ) { - for ( k = 1; k <= mult; k++ ) { - /* Move pts down recursively. */ - for ( i = iok + k; i > iok; i-- ) { - npts2[i].x = npts2[i-1].x; - npts2[i].y = npts2[i-1].y; -/******************************************************** - if ( rat == PRATIONAL ) - npts2[i].z = npts2[i-1].z; -********************************************************/ - } - for ( i = iok; i > iok - order + k; i-- ) { - alpha = (nknots[ink] - tmpknots[i]) - / (tmpknots[i + order - k] - tmpknots[i]); - alph1 = 1.0 - alpha; - npts2[i].x = alpha * npts2[i].x + alph1 * npts2[i-1].x; - npts2[i].y = alpha * npts2[i].y + alph1 * npts2[i-1].y; -/******************************************************** - if ( rat == PRATIONAL ) - npts2[i].z = alpha * npts2[i].z + alph1 * npts2[i-1].z; -********************************************************/ - } - } - - } else if ( DD_IsVert3D(pt_type) ) { /* dim is 3 */ - for ( k = 1; k <= mult; k++ ) { - for ( i = iok + k; i > iok; i-- ) { - npts3[i].x = npts3[i-1].x; - npts3[i].y = npts3[i-1].y; - npts3[i].z = npts3[i-1].z; - } - for ( i = iok; i > iok - order + k; i-- ) { - alpha = (nknots[ink] - tmpknots[i]) - / (tmpknots[i + order - k] - tmpknots[i]); - alph1 = 1.0 - alpha; - npts3[i].x = alpha * npts3[i].x + alph1 * npts3[i-1].x; - npts3[i].y = alpha * npts3[i].y + alph1 * npts3[i-1].y; - npts3[i].z = alpha * npts3[i].z + alph1 * npts3[i-1].z; - } - } - } else /* if ( DD_IsVert4D(pt_type) ) */ { /* dim is 4 */ - for ( k = 1; k <= mult; k++ ) { - for ( i = iok + k; i > iok; i-- ) { - npts4[i].x = npts4[i-1].x; - npts4[i].y = npts4[i-1].y; - npts4[i].z = npts4[i-1].z; - npts4[i].w = npts4[i-1].w; - } - for ( i = iok; i > iok - order + k; i-- ) { - alpha = (nknots[ink] - tmpknots[i]) - / (tmpknots[i + order - k] - tmpknots[i]); - alph1 = 1.0 - alpha; - npts4[i].x = alpha * npts4[i].x + alph1 * npts4[i-1].x; - npts4[i].y = alpha * npts4[i].y + alph1 * npts4[i-1].y; - npts4[i].z = alpha * npts4[i].z + alph1 * npts4[i-1].z; - npts4[i].w = alpha * npts4[i].w + alph1 * npts4[i-1].w; - } - } - } - - /* Total number of points and knots increased by `mult'. */ - for ( k = numtmpknots - 1; k > iok; k-- ) - tmpknots[k + mult] = tmpknots[k]; - for ( k = 1; k <= mult; k++ ) - tmpknots[iok + k] = nknots[ink]; - numtmpknots += mult; - num_pts +=mult; - } - - - /* copy results into output buffers */ - *numoutknots = numtmpknots; /* resulting total knots */ - memcpy( (char *)nknots, (char *)tmpknots, numtmpknots * sizeof(ddFLOAT) ); - - xfree( (char *)tmpknots ); - return 1; -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c:3.7 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c Sat Feb 28 21:41:54 2004 @@ -1,1618 +0,0 @@ -/* $Xorg: miOCs.c,v 1.6 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miOCs.c,v 3.7 2001/12/14 19:57:29 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "ddpex2.h" -#include "miRender.h" -#include "miStruct.h" -#include "gcstruct.h" -#include "miLight.h" -#include "pexos.h" - - -/* Level II Output Command Attributes */ - -/* - * Marker type - */ -ddpex2rtn -miMarkerType(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexMarkerType *pMT = (pexMarkerType *)(pOC+1); - - pddc->Dynamic->pPCAttr->markerType = pMT->markerType; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerTypeAsf) != PEXBundled) - pddc->Static.attrs->markerType = pMT->markerType; - - return(Success); -} - -/* - * Marker scale - */ -ddpex2rtn -miMarkerScale(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexMarkerScale *pMS = (pexMarkerScale *)(pOC+1); - - pddc->Dynamic->pPCAttr->markerScale = pMS->scale; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerScaleAsf) != PEXBundled) - pddc->Static.attrs->markerScale = pMS->scale; - - return(Success); -} - -/* - * Marker Bundle Index - */ -ddpex2rtn -miMarkerBundleIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexMarkerBundleIndex *pMBI = (pexMarkerBundleIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pddc->Dynamic->pPCAttr->markerIndex != pMBI->index) { - pddc->Dynamic->pPCAttr->markerIndex = pMBI->index; - - namesets = attrs = 0; - tables = PEXDynMarkerBundle; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - } - return(Success); -} - -/* - * Text Font Index - */ -ddpex2rtn -miTextFontIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexTextFontIndex *pMBI = (pexTextFontIndex *)(pOC+1); - pddc->Dynamic->pPCAttr->textFont = pMBI->index; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextFontIndexAsf) != PEXBundled) - pddc->Static.attrs->textFont = pMBI->index; - return(Success); -} - -/* - * Text Precision - */ -ddpex2rtn -miTextPrecision(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexTextPrecision *pMBI = (pexTextPrecision *)(pOC+1); - pddc->Dynamic->pPCAttr->textPrecision = pMBI->precision; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextPrecAsf) != PEXBundled) - pddc->Static.attrs->textPrecision = pMBI->precision; - return(Success); -} - -/* - * Character Expansion - */ -ddpex2rtn -miCharExpansion(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCharExpansion *pMBI = (pexCharExpansion *)(pOC+1); - pddc->Dynamic->pPCAttr->charExpansion = pMBI->expansion; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXCharExpansionAsf) != PEXBundled) - pddc->Static.attrs->charExpansion = pMBI->expansion; - return(Success); -} - -/* - * Character Spacing - */ -ddpex2rtn -miCharSpacing(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCharSpacing *pMBI = (pexCharSpacing *)(pOC+1); - pddc->Dynamic->pPCAttr->charSpacing = pMBI->spacing; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXCharSpacingAsf) != PEXBundled) - pddc->Static.attrs->charSpacing = pMBI->spacing; - return(Success); -} - -/* - * Character Height - */ -ddpex2rtn -miCharHeight(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCharHeight *pMBI = (pexCharHeight *)(pOC+1); - pddc->Dynamic->pPCAttr->charHeight = pMBI->height; - pddc->Static.attrs->charHeight = pMBI->height; - return(Success); -} - -/* - * Character Up Vector - */ -ddpex2rtn -miCharUpVector(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCharUpVector *pMBI = (pexCharUpVector *)(pOC+1); - pddc->Dynamic->pPCAttr->charUp.x = pMBI->up.x; - pddc->Dynamic->pPCAttr->charUp.y = pMBI->up.y; - pddc->Static.attrs->charUp = pddc->Dynamic->pPCAttr->charUp; - return(Success); -} - -/* - * Text Path - */ -ddpex2rtn -miTextPath(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexTextPath *pMBI = (pexTextPath *)(pOC+1); - pddc->Dynamic->pPCAttr->textPath = pMBI->path; - pddc->Static.attrs->textPath = pMBI->path; - return(Success); -} - -/* - * Text Alignment - */ -ddpex2rtn -miTextAlignment(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexTextAlignment *pMBI = (pexTextAlignment *)(pOC+1); - pddc->Dynamic->pPCAttr->textAlignment.vertical = - (ddUSHORT) pMBI->alignment.vertical; - pddc->Dynamic->pPCAttr->textAlignment.horizontal = - (ddUSHORT) pMBI->alignment.horizontal; - pddc->Static.attrs->textAlignment = - pddc->Dynamic->pPCAttr->textAlignment; - - return(Success); -} - -/* - * Annotation Text Height - */ -ddpex2rtn -miAtextHeight(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAtextHeight *pMBI = (pexAtextHeight *)(pOC+1); - pddc->Dynamic->pPCAttr->atextHeight = pMBI->height; - pddc->Static.attrs->atextHeight = pMBI->height; - return(Success); -} - -/* - * Annotation Text Up Vector - */ -ddpex2rtn -miAtextUpVector(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAtextUpVector *pMBI = (pexAtextUpVector *)(pOC+1); - pddc->Dynamic->pPCAttr->atextUp.x = pMBI->up.x; - pddc->Dynamic->pPCAttr->atextUp.y = pMBI->up.y; - pddc->Static.attrs->atextUp = pddc->Dynamic->pPCAttr->atextUp; - return(Success); -} - -/* - * Annotation Text Path - */ -ddpex2rtn -miAtextPath(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAtextPath *pMBI = (pexAtextPath *)(pOC+1); - pddc->Dynamic->pPCAttr->atextPath = pMBI->path; - pddc->Static.attrs->atextPath = pMBI->path; - return(Success); -} - -/* - * Annotation Text Alignment - */ -ddpex2rtn -miAtextAlignment(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAtextAlignment *pMBI = (pexAtextAlignment *)(pOC+1); - pddc->Dynamic->pPCAttr->atextAlignment.vertical = - (ddUSHORT) pMBI->alignment.vertical; - pddc->Dynamic->pPCAttr->atextAlignment.horizontal = - (ddUSHORT) pMBI->alignment.horizontal; - pddc->Static.attrs->atextAlignment = - pddc->Dynamic->pPCAttr->atextAlignment; - return(Success); -} - -/* - * Annotation Text Style - */ -ddpex2rtn -miAtextStyle(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAtextStyle *pMT = (pexAtextStyle *)(pOC+1); - pddc->Dynamic->pPCAttr->atextStyle = pMT->style; - pddc->Static.attrs->atextStyle = pMT->style; - return(Success); -} - -/* - * Text Bundle Index - */ -ddpex2rtn -miTextBundleIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexTextBundleIndex *pTBI = (pexTextBundleIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pddc->Dynamic->pPCAttr->textIndex != pTBI->index) { - pddc->Dynamic->pPCAttr->textIndex = pTBI->index; - - namesets = attrs = 0; - tables = PEXDynTextBundle; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - } - return(Success); -} - -/* - * Line type (Dashing style) - */ -ddpex2rtn -miLineType(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexLineType *pLT = (pexLineType *)(pOC+1); - pddc->Dynamic->pPCAttr->lineType = pLT->lineType; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineTypeAsf) != PEXBundled) { - pddc->Static.attrs->lineType = pLT->lineType; - pddc->Static.misc.flags |= POLYLINEGCFLAG; - } - return(Success); -} - - -/* - * Line Width - */ -ddpex2rtn -miLineWidth(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexLineWidth *pLW = (pexLineWidth *)(pOC+1); - pddc->Dynamic->pPCAttr->lineWidth = pLW->width; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineWidthAsf) != PEXBundled) { - pddc->Static.attrs->lineWidth = pLW->width; - pddc->Static.misc.flags |= POLYLINEGCFLAG; - } - return(Success); -} - -/* - * Line Bundle Index - */ -ddpex2rtn -miLineBundleIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexLineBundleIndex *pLBI = (pexLineBundleIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pddc->Dynamic->pPCAttr->lineIndex != pLBI->index) { - pddc->Dynamic->pPCAttr->lineIndex = pLBI->index; - - namesets = attrs = 0; - tables = PEXDynLineBundle; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - } - return(Success); -} - -/* - * curve approximation method - */ -ddpex2rtn -miCurveApproximation(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCurveApproximation *pCA = (pexCurveApproximation *)(pOC+1); - pddc->Dynamic->pPCAttr->curveApprox.approxMethod = pCA->approx.approxMethod; - pddc->Dynamic->pPCAttr->curveApprox.tolerance = pCA->approx.tolerance; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineWidthAsf) != PEXBundled) - pddc->Static.attrs->curveApprox=pddc->Dynamic->pPCAttr->curveApprox; - - return(Success); -} - - -/* - * Surface interior style - */ -ddpex2rtn -miInteriorStyle(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexInteriorStyle *pIS = (pexInteriorStyle *)(pOC+1); - pddc->Dynamic->pPCAttr->intStyle = pIS->interiorStyle; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXInteriorStyleAsf) != PEXBundled) { - pddc->Static.attrs->intStyle = pIS->interiorStyle; - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - return(Success); -} - -/* - * Depth Cue Bundle Index - */ -ddpex2rtn -miDepthCueIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexDepthCueIndex *pDCI = (pexDepthCueIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - pddc->Dynamic->pPCAttr->depthCueIndex = pDCI->index; - - /* Mark as invalid cc version of depth cue entry in dd context */ - pddc->Static.misc.flags |= CC_DCUEVERSION; - - namesets = attrs = 0; - tables = PEXDynDepthCueTableContents; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - - return(Success); -} - -/* - * Interior Bundle Index - */ -ddpex2rtn -miInteriorBundleIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexInteriorBundleIndex *pIBI = (pexInteriorBundleIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pddc->Dynamic->pPCAttr->intIndex != pIBI->index) { - pddc->Dynamic->pPCAttr->intIndex = pIBI->index; - - namesets = attrs = 0; - tables = PEXDynInteriorBundle; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - } - return(Success); -} - -/* - * Surface reflection attributes - */ -ddpex2rtn -miSurfaceReflAttr(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceReflAttr *pSRA = (pexSurfaceReflAttr *)(pOC+1); - ddColourSpecifier *pSC = - (ddColourSpecifier *)&pSRA->reflectionAttr.specularColour; - - pddc->Dynamic->pPCAttr->reflAttr.ambient = - (ddFLOAT)pSRA->reflectionAttr.ambient; - pddc->Dynamic->pPCAttr->reflAttr.diffuse = - (ddFLOAT)pSRA->reflectionAttr.diffuse; - pddc->Dynamic->pPCAttr->reflAttr.specular = - (ddFLOAT)pSRA->reflectionAttr.specular; - pddc->Dynamic->pPCAttr->reflAttr.specularConc = - (ddFLOAT)pSRA->reflectionAttr.specularConc; - pddc->Dynamic->pPCAttr->reflAttr.transmission = - (ddFLOAT)pSRA->reflectionAttr.transmission; - - switch (pddc->Dynamic->pPCAttr->reflAttr.specularColour.colourType = - pSC->colourType) { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->reflAttr.specularColour.colour.indexed = - pSC->colour.indexed; - break; - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->reflAttr.specularColour.colour.rgbFloat = - pSC->colour.rgbFloat; - break; - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->reflAttr.specularColour.colour.rgb8 = - pSC->colour.rgb8; - break; - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->reflAttr.specularColour.colour.rgb16 = - pSC->colour.rgb16; - break; - } - - /* Update DDC rendering attributes if not bundled */ - if((pddc->Dynamic->pPCAttr->asfs & PEXReflectionAttrAsf) != PEXBundled) - pddc->Static.attrs->reflAttr = pddc->Dynamic->pPCAttr->reflAttr; - - return(Success); -} -/* - * Surface reflection model - */ -ddpex2rtn -miSurfaceReflModel(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceReflModel *pSRM = (pexSurfaceReflModel *)(pOC+1); - pddc->Dynamic->pPCAttr->reflModel = pSRM->reflectionModel; - /* Update DDC rendering attributes if not bundled */ - if((pddc->Dynamic->pPCAttr->asfs & PEXReflectionModelAsf)!=PEXBundled) - pddc->Static.attrs->reflModel = pSRM->reflectionModel; - return(Success); -} - -/* - * Surface interpolation scheme - */ -ddpex2rtn -miSurfaceInterp(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceInterp *pSI = (pexSurfaceInterp *)(pOC+1); - pddc->Dynamic->pPCAttr->surfInterp = pSI->surfaceInterp; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceInterpAsf) != PEXBundled) - pddc->Static.attrs->surfInterp = pSI->surfaceInterp; - return(Success); -} - -/* - * Surface approximation criteria - */ -ddpex2rtn -miSurfaceApproximation(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceApproximation *pSA = (pexSurfaceApproximation *)(pOC+1); - pddc->Dynamic->pPCAttr->surfApprox.approxMethod = pSA->approx.approxMethod; - pddc->Dynamic->pPCAttr->surfApprox.uTolerance = pSA->approx.uTolerance; - pddc->Dynamic->pPCAttr->surfApprox.vTolerance = pSA->approx.vTolerance; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceApproxAsf) != PEXBundled) - pddc->Static.attrs->surfApprox = pddc->Dynamic->pPCAttr->surfApprox; - return(Success); -} - -/* - * Cull back or front facing facets. - */ -ddpex2rtn -miCullingMode(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexCullingMode *pCM = (pexCullingMode *)(pOC+1); - pddc->Dynamic->pPCAttr->cullMode = pCM->cullMode; - return(Success); -} - -/* - * Surface edge flag (enable/disable dispaly of fill area edges) - */ -ddpex2rtn -miSurfaceEdgeFlag(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceEdgeFlag *pSEF = (pexSurfaceEdgeFlag *)(pOC+1); - pddc->Dynamic->pPCAttr->edges = pSEF->onoff; - /*set the dd context edge visibility flag if not a bundled attribute*/ - if((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgesAsf) != PEXBundled) { - pddc->Static.attrs->edges = pSEF->onoff; - pddc->Static.misc.flags |= EDGEGCFLAG; - } - return(Success); -} -/* - * Surface edge type (Dashing style) - */ -ddpex2rtn -miSurfaceEdgeType(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceEdgeType *pSET = (pexSurfaceEdgeType *)(pOC+1); - pddc->Dynamic->pPCAttr->edgeType = pSET->edgeType; - /* Update DDC rendering attributes if not bundled */ - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgeTypeAsf)!=PEXBundled) { - pddc->Static.attrs->edgeType = pSET->edgeType; - pddc->Static.misc.flags |= EDGEGCFLAG; - } - return(Success); -} - - -/* - * Surface edge Width - */ -ddpex2rtn -miSurfaceEdgeWidth(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSurfaceEdgeWidth *pSEW = (pexSurfaceEdgeWidth *)(pOC+1); - pddc->Dynamic->pPCAttr->edgeWidth = pSEW->width; - /* Update DDC rendering attributes if not bundled */ - if((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceEdgeWidthAsf)!=PEXBundled) { - pddc->Static.attrs->edgeWidth = pSEW->width; - pddc->Static.misc.flags |= EDGEGCFLAG; - } - return(Success); -} -/* - * Surface edge Bundle Index - */ -ddpex2rtn -miEdgeBundleIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexEdgeBundleIndex *pEBI = (pexEdgeBundleIndex *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pddc->Dynamic->pPCAttr->edgeIndex != pEBI->index) { - pddc->Dynamic->pPCAttr->edgeIndex = pEBI->index; - - namesets = attrs = 0; - tables = PEXDynEdgeBundle; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - } - return(Success); -} - -/* - * Set ASF values - */ -ddpex2rtn -miSetAsfValues(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexSetAsfValues *pSAV = (pexSetAsfValues *)(pOC+1); - ddBitmask tables, namesets, attrs; - - if (pSAV->source == PEXBundled) { /* Note that PEXBundled == 0 */ - pddc->Dynamic->pPCAttr->asfs &= ~(pSAV->attribute); - - } else { - pddc->Dynamic->pPCAttr->asfs |= pSAV->attribute; - - } - - /* changing the table behaves the same as changing - * the asf, so use that for ValidateDDContext - */ - tables = namesets = attrs = 0; - if (pSAV->attribute & ( PEXMarkerTypeAsf | - PEXMarkerScaleAsf | - PEXMarkerColourAsf)) - tables |= PEXDynMarkerBundle; - if (pSAV->attribute & (PEXTextFontIndexAsf | - PEXTextPrecAsf | - PEXCharExpansionAsf | - PEXCharSpacingAsf | - PEXTextColourAsf)) - tables |= PEXDynTextBundle; - if (pSAV->attribute & (PEXLineTypeAsf | - PEXLineWidthAsf | - PEXLineColourAsf | - PEXCurveApproxAsf | - PEXPolylineInterpAsf)) - tables |= PEXDynLineBundle; - if (pSAV->attribute & (PEXInteriorStyleAsf | - PEXInteriorStyleIndexAsf | - PEXSurfaceColourAsf | - PEXSurfaceInterpAsf | - PEXReflectionModelAsf | - PEXReflectionAttrAsf | - PEXBfInteriorStyleAsf | - PEXBfInteriorStyleIndexAsf | - PEXBfSurfaceColourAsf | - PEXBfSurfaceInterpAsf | - PEXBfReflectionModelAsf | - PEXBfReflectionAttrAsf | - PEXSurfaceApproxAsf)) - tables |= PEXDynInteriorBundle; - if (pSAV->attribute & ( PEXSurfaceEdgeTypeAsf | - PEXSurfaceEdgeWidthAsf | - PEXSurfaceEdgeColourAsf | - PEXSurfaceEdgesAsf )) - tables |= PEXDynEdgeBundle; - - /* Re-initialize the dd context rendering attributes */ - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - - return(Success); -} - -/* - * Local transformations - */ -ddpex2rtn -miLocalTransform(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexLocalTransform *pLT = (pexLocalTransform *)(pOC+1); - - switch (pLT->compType) { - case PEXPreConcatenate: - miMatMult( pddc->Dynamic->pPCAttr->localMat, - pLT->matrix, pddc->Dynamic->pPCAttr->localMat); - break; - case PEXPostConcatenate: - miMatMult( pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->localMat, pLT->matrix); - break; - case PEXReplace: - memcpy( (char *)(pddc->Dynamic->pPCAttr->localMat), - (char *)(pLT->matrix), - 16*sizeof(ddFLOAT)); - break; - } - - /* Update composite transforms */ - /* First, composite [CMM] */ - miMatMult( pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - /* Next, composite [VCM] next */ - miMatMult( pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_cc_xform); - - /* Lastly, Compute the composite mc -> dc transform */ - miMatMult( pddc->Dynamic->mc_to_dc_xform, - pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->cc_to_dc_xform); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG); - - return(Success); -} - -ddpex2rtn -miLocalTransform2D(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexLocalTransform2D *pLT = (pexLocalTransform2D *)(pOC+1); - ddFLOAT *s, *d; - ddFLOAT temp[4][4]; - - /* - * 2D -> 3D transform as follows: - * - * a d g a d 0 g - * b e h b e 0 h - * c f i 0 0 1 0 - * c f 0 i - * - */ - s = (ddFLOAT *)pLT->matrix3X3; - d = (ddFLOAT *)temp; - - *d++ = *s++; /* [0][0] */ - *d++ = *s++; /* [0][1] */ - *d++ = 0.0; /* [0][2] */ - *d++ = *s++; /* [0][3] */ - *d++ = *s++; /* [1][0] */ - *d++ = *s++; /* [1][1] */ - *d++ = 0.0; /* [1][2] */ - *d++ = *s++; /* [1][3] */ - *d++ = 0.0; /* [2][0] */ - *d++ = 0.0; /* [2][1] */ - *d++ = 1.0; /* [2][2] */ - *d++ = 0.0; /* [2][3] */ - *d++ = *s++; /* [3][0] */ - *d++ = *s++; /* [3][0] */ - *d++ = 0.0; /* [3][0] */ - *d++ = *s++; /* [3][0] */ - - switch (pLT->compType) { - case PEXPreConcatenate: - miMatMult( pddc->Dynamic->pPCAttr->localMat, - temp, pddc->Dynamic->pPCAttr->localMat); - break; - case PEXPostConcatenate: - miMatMult( pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->localMat, temp); - break; - case PEXReplace: - memcpy( (char *)(pddc->Dynamic->pPCAttr->localMat), (char *)temp, - 16*sizeof(ddFLOAT)); - break; - } - - /* Update composite transforms */ - /* First, composite [CMM] */ - miMatMult( pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - /* Next, composite [VCM] next */ - miMatMult( pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_cc_xform); - - /* Lastly, Compute the composite mc -> dc transform */ - miMatMult( pddc->Dynamic->mc_to_dc_xform, - pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->cc_to_dc_xform); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG); - - return(Success); -} - - -/* - * Global transformations - */ -ddpex2rtn -miGlobalTransform(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexGlobalTransform *pGT = (pexGlobalTransform *)(pOC+1); - - memcpy( (char *)(pddc->Dynamic->pPCAttr->globalMat), (char *)(pGT->matrix), - 16 * sizeof(ddFLOAT)); - - /* Update composite transforms */ - /* First, composite [CMM] */ - miMatMult( pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - /* Next, composite [VCM] next */ - miMatMult( pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_cc_xform); - - /* Lastly, Compute the composite mc -> dc transform */ - miMatMult( pddc->Dynamic->mc_to_dc_xform, - pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->cc_to_dc_xform); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG); - - return(Success); -} - -ddpex2rtn -miGlobalTransform2D(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexGlobalTransform2D *pGT = (pexGlobalTransform2D *)(pOC+1); - ddFLOAT *s, *d; - - /* - * 2D -> 3D transform as follows: - * - * a d g a d 0 g - * b e h b e 0 h - * c f i 0 0 1 0 - * c f 0 i - * - */ - s = (ddFLOAT *)pGT->matrix3X3; - d = (ddFLOAT *)pddc->Dynamic->pPCAttr->globalMat; - - *d++ = *s++; /* [0][0] */ - *d++ = *s++; /* [0][1] */ - *d++ = 0.0; /* [0][2] */ - *d++ = *s++; /* [0][3] */ - *d++ = *s++; /* [1][0] */ - *d++ = *s++; /* [1][1] */ - *d++ = 0.0; /* [1][2] */ - *d++ = *s++; /* [1][3] */ - *d++ = 0.0; /* [2][0] */ - *d++ = 0.0; /* [2][1] */ - *d++ = 1.0; /* [2][2] */ - *d++ = 0.0; /* [2][3] */ - *d++ = *s++; /* [3][0] */ - *d++ = *s++; /* [3][0] */ - *d++ = 0.0; /* [3][0] */ - *d++ = *s++; /* [3][0] */ - - /* Update composite transforms */ - /* First, composite [CMM] */ - miMatMult( pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - /* Next, composite [VCM] next */ - miMatMult( pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_cc_xform); - - /* Lastly, Compute the composite mc -> dc transform */ - miMatMult( pddc->Dynamic->mc_to_dc_xform, - pddc->Dynamic->mc_to_cc_xform, - pddc->Dynamic->cc_to_dc_xform); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG); - - return(Success); -} - -ddpex2rtn -miModelClip(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexModelClip *pMC = (pexModelClip *)(pOC+1); - pddc->Dynamic->pPCAttr->modelClip = pMC->onoff; - - return(Success); -} - - - -ddpex2rtn -miViewIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexViewIndex *pVI = (pexViewIndex *)(pOC+1); - - /* first, make sure this is a new index */ - if (pddc->Dynamic->pPCAttr->viewIndex == pVI->index) return(Success); - - /* Copy new index into ddContext */ - pddc->Dynamic->pPCAttr->viewIndex = pVI->index; - - /* Now, update internal transform cache to reflect new index */ - miBldCC_xform(pRend, pddc); - - return(Success); -} - - - -ddpex2rtn -miPickId(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexPickId *pPI = (pexPickId *)(pOC+1); - - pddc->Dynamic->pPCAttr->pickId = pPI->pickId; - return(Success); -} - - -ddpex2rtn -miColourApproxIndex(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexColourApproxIndex *pCAI = (pexColourApproxIndex *)(pOC+1); - pddc->Dynamic->pPCAttr->colourApproxIndex = pCAI->index; - return(Success); -} - - -ddpex2rtn -miRenderingColourModel(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexRenderingColourModel *pRCM = (pexRenderingColourModel *)(pOC+1); - pddc->Dynamic->pPCAttr->rdrColourModel = pRCM->model; - return(Success); -} - - -ddpex2rtn -miParaSurfCharacteristics(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miPSurfaceCharsStruct *pPSC = (miPSurfaceCharsStruct *)(pOC+1); - switch (pddc->Dynamic->pPCAttr->psc.type = pPSC->type) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - case PEXPSCIsoCurves: - pddc->Dynamic->pPCAttr->psc.data.isoCurves = *pPSC->data.pIsoCurves; - break; - case PEXPSCMcLevelCurves: - /* Note that level curves are not implemented */ - pddc->Dynamic->pPCAttr->psc.data.mcLevelCurves = - *pPSC->data.pMcLevelCurves; - break; - case PEXPSCWcLevelCurves: - /* Note that level curves are not implemented */ - pddc->Dynamic->pPCAttr->psc.data.wcLevelCurves = - *pPSC->data.pWcLevelCurves; - break; - default: - break; - } - return(Success); - -} - -ddpex2rtn -miAddToNameSet(pRend, pOC) /* and RemoveNameFromNameSet */ - ddRendererPtr pRend; - miGenericStr *pOC; -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - pexAddToNameSet *pANS = (pexAddToNameSet *)(pOC+1); - ddULONG *pName = (ddULONG *)(pANS + 1); - register int num = (pANS->head.length) - 1; - ddUSHORT save_flags = pddc->Dynamic->filter_flags; - ddBitmask namesets; - extern void ValidateFilters(); - - for (; num>0; num--, pName++) - /* ignore values that are out of range */ - if ( MINS_VALID_NAME(*pName) ) { - if (pANS->head.elementType == PEXOCAddToNameSet) { - MINS_ADD_TO_NAMESET(*pName, pddc->Dynamic->currentNames); - } else { - MINS_REMOVE_FROM_NAMESET(*pName, pddc->Dynamic->currentNames); - } - } - - /* changing current namesset, so update all filters */ - namesets = PEXDynHighlightNameset | - PEXDynInvisibilityNameset | - PEXDynHighlightNamesetContents | - PEXDynInvisibilityNamesetContents; - - - ValidateFilters(pRend, pddc, namesets); - - return(Success); -} - - -ddpex2rtn -miExecuteStructure(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - extern void execute_structure_OC(); - - execute_structure_OC(pRend, (pexExecuteStructure *)(pOC+1)); - return(Success); -} - - -ddpex2rtn -miNoop(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ - return (Success); -} - - -ddpex2rtn -miUndefined(pRend, pOC) - ddRendererPtr pRend; - miGenericStr *pOC; -{ -#ifdef PR_INFO - ErrorF( "Attribute is not implemented\n"); -#endif - return (PEXNYI); -} - - - -/*++ - | - | Function Name: miLightStateOC - | - | Function Description: - | Handles PEXOCLightState OC - | - | Note(s): - | - --*/ -ddpex2rtn -miLightStateOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miLightStateStruct *pLS = (miLightStateStruct *)(pOC+1); - ddUSHORT *ptr; - int i; - - /* - * Merge in a new set of light source indices - */ - if (pLS->enableList->numObj > 0) - puMergeLists( pddc->Dynamic->pPCAttr->lightState, pLS->enableList, - pddc->Dynamic->pPCAttr->lightState); - - if (pLS->disableList->numObj > 0) - for (i = pLS->disableList->numObj, - ptr = (ddUSHORT *)pLS->disableList->pList; - i > 0; - --i, ptr++) - puRemoveFromList(ptr, pddc->Dynamic->pPCAttr->lightState); - - return (Success); -} - -/*++ - | - | Function Name: SetMCVolume - | - | Function Description: - | Handles Handles SetModelClipVolume and - | SetModelClipVolume2D OCs - | - | Note(s): Although model clipping half spaces are specified - | in modelling space, the pipeline stores the current clipping - | volume in world coordinates. This is because the modelling - | transformation matrix can change independently of this particular - | OC, and world coordinates are the the only common coordinates to - | intersect. HOWEVER, when model clipping is enabled, this - | intersect volume is transferred BACK to model space and stored - | in pddc->Static->ms_MCV for the actual clipping. This is done - | in order to "prune" out as many primitives as early as possible - | in the pipeline. - | - | Whenever the modelling transformation matrix is changed, or - | when a new renderer is created, the model space version of - | the model clipping volume is invalidated; the world - | coordinate volume is the "reference." The validation flag is - | the INVMCXFRMFLAG defined in ddpex/mi/include/miRender.h - | - --*/ -ddpex2rtn -miSetMCVolume(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miMCVolume_Struct *OC_MCV = (miMCVolume_Struct *)(pOC+1); - listofObj *pc_MCV; - ddHalfSpace *OC_HS, tmp_HS; - int i, count; - ddFLOAT length; - - static ddFLOAT vect_xform[4][4]; - - - pc_MCV = pddc->Dynamic->pPCAttr->modelClipVolume; - if (!(OC_MCV->operator == PEXModelClipIntersection)) pc_MCV->numObj = 0; - /* invalidate flag */ - pddc->Static.misc.flags |= MCVOLUMEFLAG; - - - /* overwrite list */ - OC_HS = (ddHalfSpace *)(OC_MCV->halfspaces->pList); - count = OC_MCV->halfspaces->numObj; - for(i = 0; i < count; i++) { - - /* transform ref point and vector to world coords */ - /* transform ref point */ - - miTransformPoint(&OC_HS->orig_point, pddc->Dynamic->mc_to_wc_xform, - &tmp_HS.point); - - /* transform ref vector - * Vectors are transformed using the inverse transpose - */ - - miMatCopy(pddc->Dynamic->mc_to_wc_xform, - vect_xform); - - miMatInverse(vect_xform); - - miMatTranspose(vect_xform); - - miTransformVector(&OC_HS->orig_vector, vect_xform, - &tmp_HS.vector); - - puAddToList(&tmp_HS, 1, pc_MCV); - OC_HS++; - } - - return(Success); -} - -/*++ - | - | Function Name: miRestoreMCV - | - | Function Description: - | Restores the model clipping volume to that of the - | parent, or nil if this is the first structure. - | - | Note(s): - | - --*/ -ddpex2rtn -miRestoreMCV(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -{ - - - miDDContext *thispddc = (miDDContext *)(pRend->pDDContext); - miDynamicDDContext *parentpddc = - (miDynamicDDContext *)(thispddc->Dynamic->next); - - if (!(thispddc->Dynamic->next)) /* First structure */ - thispddc->Dynamic->pPCAttr->modelClipVolume->numObj = 0; - else { - /* invalidate flag */ - thispddc->Static.misc.flags |= MCVOLUMEFLAG; - if (puCopyList(parentpddc->pPCAttr->modelClipVolume, - thispddc->Dynamic->pPCAttr->modelClipVolume )) - - return (BadAlloc); - } - - return(Success); -} - -/*++ - | - | Function Name: miMarkerColourOC - | - | Function Description: - | Handles PEXOCMarkerColourIndex and PEXOCMarkerColour. - | - | Note(s): - | - --*/ -ddpex2rtn -miMarkerColourOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - ddpex3rtn miConvertColor(); - - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miColourStruct *pMC = (miColourStruct *)(pOC+1); - - - switch (pddc->Dynamic->pPCAttr->markerColour.colourType = pMC->colourType) - { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->markerColour.colour.indexed = - *pMC->colour.pIndex; - break; - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->markerColour.colour.rgbFloat = - *pMC->colour.pRgbFloat; - break; - - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->markerColour.colour.rgb8 = - *pMC->colour.pRgb8; - break; - - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->markerColour.colour.rgb16 = - *pMC->colour.pRgb16; - break; - } - - if (!(MI_DDC_IS_HIGHLIGHT(pddc))) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXMarkerColourAsf) != PEXBundled) { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->markerColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->markerColour); - pddc->Static.misc.flags |= MARKERGCFLAG; - } - } - return(Success); -} - - -/*++ - | - | Function Name: miTextColourOC - | - | Function Description: - | Handles PEXOCTextColourIndex and PEXOCTextColour. - | - | Note(s): - | - --*/ -ddpex2rtn -miTextColourOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - ddpex3rtn miConvertColor(); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miColourStruct *pTC = (miColourStruct *)(pOC+1); - - switch (pddc->Dynamic->pPCAttr->textColour.colourType = pTC->colourType) - { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->textColour.colour.indexed = - *pTC->colour.pIndex; - break; - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->textColour.colour.rgbFloat = - *pTC->colour.pRgbFloat; - break; - - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->textColour.colour.rgb8 = - *pTC->colour.pRgb8; - break; - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->textColour.colour.rgb16 = - *pTC->colour.pRgb16; - break; - } - - if (!(MI_DDC_IS_HIGHLIGHT(pddc))) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXTextColourAsf) != PEXBundled) { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->textColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->textColour); - pddc->Static.misc.flags |= TEXTGCFLAG; - } - } - return(Success); -} - - -/*++ - | - | Function Name: miLineColourOC - | - | Function Description: - | Handles PEXOCLineColourIndex and PEXOCLineColour. - | - | Note(s): - | - --*/ -ddpex2rtn -miLineColourOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - ddpex3rtn miConvertColor(); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miColourStruct *pLC = (miColourStruct *)(pOC+1); - - switch (pddc->Dynamic->pPCAttr->lineColour.colourType = pLC->colourType) - { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->lineColour.colour.indexed = - *pLC->colour.pIndex; - break; - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->lineColour.colour.rgbFloat = - *pLC->colour.pRgbFloat; - break; - - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->lineColour.colour.rgb8 = *pLC->colour.pRgb8; - break; - - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->lineColour.colour.rgb16 = - *pLC->colour.pRgb16; - break; - } - - if (!(MI_DDC_IS_HIGHLIGHT(pddc))) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXLineColourAsf) != PEXBundled) { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->lineColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->lineColour); - pddc->Static.misc.flags |= POLYLINEGCFLAG; - } - } - return(Success); -} - -/*++ - | - | Function Name: miSurfaceColourOC - | - | Function Description: - | Handles PEXOCSurfaceColourIndex and PEXOCSurfaceColour. - | - | Note(s): - | - --*/ -ddpex2rtn -miSurfaceColourOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - ddpex3rtn miConvertColor(); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miColourStruct *pSC = (miColourStruct *)(pOC+1); - - switch (pddc->Dynamic->pPCAttr->surfaceColour.colourType=pSC->colourType) - { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->surfaceColour.colour.indexed = - *pSC->colour.pIndex; - break; - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->surfaceColour.colour.rgbFloat = - *pSC->colour.pRgbFloat; - break; - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->surfaceColour.colour.rgb8 = - *pSC->colour.pRgb8; - break; - - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->surfaceColour.colour.rgb16 = - *pSC->colour.pRgb16; - break; - } - - if (!(MI_DDC_IS_HIGHLIGHT(pddc))) { - if ((pddc->Dynamic->pPCAttr->asfs & PEXSurfaceColourAsf)!=PEXBundled) { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->surfaceColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->surfaceColour); - pddc->Static.misc.flags |= FILLAREAGCFLAG; - } - } - return(Success); -} - -/*++ - | - | Function Name: miEdgeColourOC - | - | Function Description: - | Handles PEXOCSurfaceEdgeColourIndex and PEXOCSurfaceEdgeColour. - | - | Note(s): - | - --*/ -ddpex2rtn -miEdgeColourOC(pRend, pOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pOC; /* output command */ -/* out */ -{ - ddpex3rtn miConvertColor(); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miColourStruct *pSEC = (miColourStruct *)(pOC+1); - - switch (pddc->Dynamic->pPCAttr->edgeColour.colourType = pSEC->colourType) - { - case PEXIndexedColour: - pddc->Dynamic->pPCAttr->edgeColour.colour.indexed = - *pSEC->colour.pIndex; - break; - - case PEXRgbFloatColour: - case PEXCieFloatColour: - case PEXHsvFloatColour: - case PEXHlsFloatColour: - pddc->Dynamic->pPCAttr->edgeColour.colour.rgbFloat = - *pSEC->colour.pRgbFloat; - break; - - case PEXRgb8Colour: - pddc->Dynamic->pPCAttr->edgeColour.colour.rgb8 = *pSEC->colour.pRgb8; - break; - case PEXRgb16Colour: - pddc->Dynamic->pPCAttr->edgeColour.colour.rgb16 = - *pSEC->colour.pRgb16; - break; - } - - if (!(MI_DDC_IS_HIGHLIGHT(pddc))) { - if ((pddc->Dynamic->pPCAttr->asfs &PEXSurfaceEdgeColourAsf)!=PEXBundled) - { - miConvertColor(pRend, - &pddc->Dynamic->pPCAttr->edgeColour, - pddc->Dynamic->pPCAttr->rdrColourModel, - &pddc->Static.attrs->edgeColour); - pddc->Static.misc.flags |= EDGEGCFLAG; - } - } - return(Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c:3.8 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c Sat Feb 28 21:41:54 2004 @@ -1,1246 +0,0 @@ -/* $Xorg: miPickPrim.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miPickPrim.c,v 3.8 2001/12/14 19:57:29 dawes Exp $ */ - -#include "miWks.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miStruct.h" -#include "ddpex2.h" -#include "miFont.h" -#include "miText.h" -#include "miClip.h" -#include "pexos.h" - -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - -extern ocTableType InitExecuteOCTable[]; -extern int atx_el_to_path(); -extern void text2_xform(); -extern void text3_xform(); - -/* - * Function Name: compute_pick_volume - * - * Purpose: Compute the intersection of the clip limits and the - * pick aperture. PEX-SI's pick aperture can be a DC_HitBox - * or an NPC_HitVolume. However, for pick correllation purposes, - * the pick aperture will always be a NPC subvolume. i.e., the - * DC_HitBox has been mapped into NPC. - * Return: - * pick volume, if any. - */ -ddpex2rtn -compute_pick_volume(aperture, view, pDDC, pick_volume) -/* in */ -register ddNpcSubvolume *aperture; /* NPC Pick Aperture */ - ddViewEntry *view; /* View clipping info. - * view->clipLimits contains - * the desired clip limits */ - miDDContext *pDDC; /* Pointer to DDContext */ -/* out */ -register ddNpcSubvolume *pick_volume; /* Intersection to use */ -{ - register ddNpcSubvolume *clip_limit; - ddUSHORT all_clipped; - ddCoord4D NPC_Min, NPC_Max; -/* calls */ - - all_clipped = 0; - clip_limit = &(view->clipLimits); - - NPC_Max.x = clip_limit->maxval.x; - NPC_Max.y = clip_limit->maxval.y; - NPC_Max.z = clip_limit->maxval.z; - NPC_Max.w = 1.0; - NPC_Min.x = clip_limit->minval.x; - NPC_Min.y = clip_limit->minval.y; - NPC_Min.z = clip_limit->minval.z; - NPC_Min.w = 1.0; - - if (view->clipFlags != 0) { - /* - * only test intersection of volumes if any view clipping flags are on - */ - all_clipped = - ( (aperture->minval.x > NPC_Max.x) || - (aperture->minval.y > NPC_Max.y) || - (aperture->minval.z > NPC_Max.z) || - (aperture->maxval.x < NPC_Min.x) || - (aperture->maxval.y < NPC_Min.y) || - (aperture->maxval.z < NPC_Min.z) ); - - if (all_clipped) { - /* - * the intersection of the volumes is null; - * everything is always clipped. - */ - return (all_clipped); /* - * I.E., trivial reject situation, nothing - * will be picked - */ - } - } - - /* look at X-Y */ - if (view->clipFlags >= PEXClipXY) { - /* not clipping to the clip limit so use all of aperture */ - pick_volume->minval.x = aperture->minval.x; - pick_volume->minval.y = aperture->minval.y; - pick_volume->maxval.x = aperture->maxval.x; - pick_volume->maxval.y = aperture->maxval.y; - } - else { - pick_volume->minval.x = MAX(aperture->minval.x, NPC_Min.x); - pick_volume->minval.y = MAX(aperture->minval.y, NPC_Min.y); - pick_volume->maxval.x = MIN(aperture->maxval.x, NPC_Max.x); - pick_volume->maxval.y = MIN(aperture->maxval.y, NPC_Max.y); - } - - /* look at Z */ - if (view->clipFlags >= PEXClipBack) - pick_volume->maxval.z = aperture->maxval.z; - else - pick_volume->maxval.z = MIN(aperture->maxval.z, NPC_Max.z); - - if (view->clipFlags >= PEXClipFront) - pick_volume->minval.z = aperture->minval.z; - else - pick_volume->minval.z = MAX(aperture->minval.z, NPC_Min.z); - - return (Success); -} - - -/* - * Function Name: compute_pick_volume_xform - * - * Purpose: Compute the transformation that transform the primitive - * to be picked from pick_volume to CC. Remember that we - * will use the standard primitive clipping functions to figure - * out whether a given primitive lies within the pick aperture. - * Return: - * pv_to_cc_xform to be used to figure out pick hits. - */ -void -compute_pick_volume_xform(pick_volume, pv_to_cc_xform) -/* in */ - ddNpcSubvolume *pick_volume; -/* out */ - ddFLOAT pv_to_cc_xform[4][4]; -/* calls */ -{ - /* The transformation needed here is to go from pick_volume to clip_volume - * as shown in 2D below. We extend the transform to handle the 3D case - * trivially. - * - * pick_volume clip_volume - * ----------- ----------- - * - * +-----+(c,d) +---------+(1,1) - * | | | | - * | | =======> | | - * | | | | - * (a,b)+-----+ (-1,-1)+---------+ - * - * pv_to_cc_xform (2D): 2/(c-a) 0 (c+a)/(a-c) - * 0 2/(d-b) (d+b)/(b-d) - * 0 0 0 - */ - - memcpy( (char *)pv_to_cc_xform, (char *)ident4x4, 16 * sizeof(ddFLOAT)); - pv_to_cc_xform[0][0] = - 2.0 / (pick_volume->maxval.x - pick_volume->minval.x); - pv_to_cc_xform[1][1] = - 2.0 / (pick_volume->maxval.y - pick_volume->minval.y); - pv_to_cc_xform[2][2] = - 2.0 / (pick_volume->maxval.z - pick_volume->minval.z); - pv_to_cc_xform[0][3] = - (pick_volume->maxval.x + pick_volume->minval.x) / - (pick_volume->minval.x - pick_volume->maxval.x); - pv_to_cc_xform[1][3] = - (pick_volume->maxval.y + pick_volume->minval.y) / - (pick_volume->minval.y - pick_volume->maxval.y); - pv_to_cc_xform[2][3] = - (pick_volume->maxval.z + pick_volume->minval.z) / - (pick_volume->minval.z - pick_volume->maxval.z); -} - - -/* - * Function Name: convert_dcHitBox_to_npc - * - * Purpose: Convert a dcHitBox into an equivalent NPCHitVolume. This - * is to facilitate picking to be done always in NPC. - * Return: - * NPCHitVolume to be used as the aperture. - */ -void -convert_dcHitBox_to_npc (pRend, aperture) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ - ddPC_NPC_HitVolume *aperture; -{ -/* calls */ - void miTransformPoint(); - -/* Local variable definitions */ - miDDContext *pDDC = (miDDContext *)(pRend->pDDContext); - ddCoord4D DC_Min, DC_Max, NPC_Min, NPC_Max; - ddFLOAT inv_xform[4][4]; - ddPC_DC_HitBox dcHitBox; - - /* Get the DC pick aperture first */ - - dcHitBox = pDDC->Static.pick.input_rec.dc_hit_box; - - /* Figure out the square aperture centered around the DC_HitBox */ - /* position and sides along X and Y equal to twice the distance */ - /* specified in the DC_HitBox. */ - - DC_Min.x = (ddFLOAT)(dcHitBox.position.x - dcHitBox.distance); - DC_Min.y = (ddFLOAT)(dcHitBox.position.y - dcHitBox.distance); - DC_Min.z = 0.0; /* This is a DONT CARE value */ - DC_Min.w = 1.0; - DC_Max.x = (ddFLOAT)(dcHitBox.position.x + dcHitBox.distance); - DC_Max.y = (ddFLOAT)(dcHitBox.position.y + dcHitBox.distance); - DC_Max.z = 0.0; /* This is a DONT CARE value */ - DC_Max.w = 1.0; - - /* Now get the inverse viewport transform to transform the DC_HitBox */ - /* into NPC_HitVolume. */ - - memcpy( (char *)inv_xform, (char *)pDDC->Static.misc.inv_vpt_xform, - 16*sizeof(ddFLOAT)); - - /* Compute the corners of the DC_HitBox in NPC */ - - miTransformPoint (&DC_Min, inv_xform, &NPC_Min); - miTransformPoint (&DC_Max, inv_xform, &NPC_Max); - - /* Use the z coordinates of the current NPC subvolume in use to */ - /* set up the DC aperture as an equivalent NPC sub-volume. */ - - aperture->minval.x = NPC_Min.x; - aperture->minval.y = NPC_Min.y; - aperture->minval.z = pRend->viewport.minval.z; - aperture->maxval.x = NPC_Max.x; - aperture->maxval.y = NPC_Max.y; - aperture->maxval.z = pRend->viewport.maxval.z; -} - - -/* - * Function Name: ClipNPCPoint4D - * - * Purpose: Dtermine if the 4D NPC point is within the current NPC - * sub-volume and set the outcode accordingly. - * Return: - * outcode to indicate whether the 4D point is in or out. - */ -static ddpex2rtn -ClipNPCPoint4D (pRend, in_pt, oc) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - ddCoord4D *in_pt; -/* out */ - ddUSHORT *oc; -{ -/* Local variables */ - ddCoord3D npc_pt; - ddNpcSubvolume *cliplimits; - int j; - ddUSHORT status; - miViewEntry *view_entry; - ddUSHORT cur_index; - - /* Get the actual 3D point by dividing by w first */ - - npc_pt.x = (in_pt->x)/(in_pt->w); - npc_pt.y = (in_pt->y)/(in_pt->w); - npc_pt.z = (in_pt->z)/(in_pt->w); - - /* Get the next defined view entry from the View LUT */ - - cur_index = ((miDDContext *)pRend->pDDContext)->Dynamic - ->pPCAttr->viewIndex; - - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - cur_index, &status, (ddPointer *)&view_entry)) - == PEXLookupTableError) - return (PEXLookupTableError); - - /* Get the pointer to current NPC subvolume clip limits */ - - cliplimits = &(view_entry->entry.clipLimits); - - *oc = 0; /* Initialize oc to NOT CLIPPED state */ - - /* Compare the npc_pt against these cliplimits and set the oc */ - - if (npc_pt.x < cliplimits->minval.x) - *oc |= MI_CLIP_LEFT; - else if (npc_pt.x > cliplimits->maxval.x) - *oc |= MI_CLIP_RIGHT; - if (npc_pt.y < cliplimits->minval.y) - *oc |= MI_CLIP_BOTTOM; - else if (npc_pt.y > cliplimits->maxval.y) - *oc |= MI_CLIP_TOP; - if (npc_pt.z < cliplimits->minval.z) - *oc |= MI_CLIP_FRONT; - else if (npc_pt.z > cliplimits->maxval.z) - *oc |= MI_CLIP_BACK; -} - - -/*++ - | - | Function Name: miPickAnnoText2D - | - | Function Description: - | Handles the picking of Annotation text 2D ocs. - | - | Note(s): - | - --*/ - -ddpex2rtn -miPickAnnoText2D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - /* local */ - miAnnoText2DStruct *ddText = (miAnnoText2DStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddUSHORT numEncodings = ddText->numEncodings; - ddCoord2D *pOrigin = ddText->pOrigin; /* string origin */ - ddCoord2D *pOffset = ddText->pOffset; - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - extern void miTransformPoint(); - -/* Define required temporary variables */ - - ddPC_NPC_HitVolume aperture; - ddNpcSubvolume pv; - miViewEntry *view_entry; - ddViewEntry *view; - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_npc_xform[4][4]; - ddFLOAT buf_xform[4][4], buf1_xform[4][4]; - ddFLOAT buf2_xform[4][4]; - miDDContext *pDDC, *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first, pty_first; - int i, j, k; - int count; /* Count of characters to be picked */ - ddFLOAT ei0npc, ei1npc, ei3npc; - miCharPath *save_ptr; - miListHeader *cc_path, *clip_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag, LUTstatus; - ddCoord4D MC_Origin, CC_Origin, NPC_Origin; - ddUSHORT oc; /* Outcode for 4D point clipping */ - ddUSHORT Pick_Flag, cur_index; - - /* Get the DDContext handle for local use */ - - pddc = pDDC = (miDDContext *)pRend->pDDContext; - - /* Transform and clip the text origin first to see if any picking */ - /* needs to be done at all. If the NPC subvolume does not contain */ - /* the origin, the annotation text is not picked. */ - - MC_Origin.x = pOrigin->x; - MC_Origin.y = pOrigin->y; - MC_Origin.z = 0.0; - MC_Origin.w = 1.0; - - if (pDDC->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - CLIP_POINT4D(&MC_Origin, oc, MI_MCLIP); - - if (oc) { - pDDC->Static.pick.status = PEXNoPick; - return (Success); /* origin model clipped out */ - } - } - - /* Get the current view index and the corresponding transforms */ - - cur_index = pDDC->Dynamic->pPCAttr->viewIndex; - - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - cur_index, &LUTstatus, (ddPointer *)&view_entry)) - == PEXLookupTableError) - return (PEXLookupTableError); - - /* Compute the mc_to_npc for the current view */ - - miMatMult (pDDC->Dynamic->mc_to_npc_xform, - pDDC->Dynamic->mc_to_wc_xform, - view_entry->vom); - - miTransformPoint (&MC_Origin, pDDC->Dynamic->mc_to_npc_xform, - &NPC_Origin); - - if ((ClipNPCPoint4D (pRend, &NPC_Origin, &oc)) == PEXLookupTableError) - return (PEXLookupTableError); - if (oc) { - pDDC->Static.pick.status = PEXNoPick; - return (Success); /* Don't pick anything; origin clipped out */ - } - - - /* Keep the NPC_Origin computed above for later use */ - - /* Get the pick aperture and convert into NPC, if required. */ - - if (pDDC->Static.pick.type == PEXPickDeviceDC_HitBox) { - - /* Convert the dcHitBox into a NPCHitVolume */ - - convert_dcHitBox_to_npc (pRend, &aperture); - } - else { - - /* Copy data straight from the NPC pick aperture input record */ - - aperture = pDDC->Static.pick.input_rec.npc_hit_volume; - } - - /* Set the annotation text flag to one */ - - aflag = 1; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - { - pDDC->Static.pick.status = PEXNoPick; - return (Success); - } - - - /* Convert text string into required paths */ - - if ((status = atx_el_to_path (pRend, pDDC, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text2_xform (pOrigin, pDDC->Static.attrs, &align, text_el.xform, aflag); - - /* Set up the new composite transform first. Note that in the case */ - /* of annotation text, only the text origin is transformed by the */ - /* complete pipeline transform. The text itself is affected only by*/ - /* the transformed origin in NPC, the NPC offset , npc_to_cc, and */ - /* the workstation transform. */ - - /* Now compute the initial composite transform for the first char. */ - /* The required transforms for characters are - text space to model */ - /* space transform, transformation of the annotation text origin, if*/ - /* any. Note the ABSENCE of npc to cc transform here because of the */ - /* PICKING as opposed to rendering. */ - - /* Get the translation due to the transformation of the annotation */ - /* text origin by mc_to_npc_xform into buf1_xform. */ - - memcpy( (char *)buf1_xform, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - buf1_xform[0][3] += NPC_Origin.x - MC_Origin.x; - buf1_xform[1][3] += NPC_Origin.y - MC_Origin.y; - - miMatMult (buf2_xform, text_el.xform, buf1_xform); - - /* Add the offset in NPC */ - - buf2_xform[0][3] += pOffset->x; - buf2_xform[1][3] += pOffset->y; - - /* Pick the paths in text_el as polylines */ - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pDDC->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - Pick_Flag = 0; /* Initialize flag to indicate NO_PICK */ - - /* Get the current defined view entry from the View LUT */ - - view = &(view_entry->entry); - - /* Compute the intersection of the pick aperture with the NPC */ - /* sub-volume defined for the current view. */ - - if (compute_pick_volume (&aperture, view, pDDC, &pv)) { - - /* We have NO intersection between the pick aperture */ - /* and the NPC subvolume defined for the current view */ - - goto TextHit; /* NoPick, Skip everything else */ - } - - /* Get the transform to go from pick volume to CC - buf1_xform */ - - compute_pick_volume_xform (&pv, buf1_xform); - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the */ - /* text path is Up or Down. If so, we need to modify tx by */ - /* first character translation to align with the rest of the*/ - /* characters in the string. */ - - if ((pDDC->Static.attrs->atextPath == PEXPathUp || - pDDC->Static.attrs->atextPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE */ - /* FIRST CHARACTER IN THE STRING. ptx FOR ALL OTHERS WILL */ - /* BE RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE*/ - /* REQUIRED EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS */ - /* NOT A PROBLEM HERE SINCE WE NEED THIS SPECIAL CASE ONLY*/ - /* FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE */ - /* OF += */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to*/ - /* get just the character width. */ - - ptx_first += (pDDC->Static.attrs->charSpacing) * - FONT_COORD_HEIGHT; - - pty_first = pty; /* Save first character height */ - - /* Adjust the translation by character spacing factor to*/ - /* get just the character height. */ - - pty_first += (pDDC->Static.attrs->charSpacing) * - FONT_COORD_HEIGHT; - } - - /* Check to see if the text path is Left. If so, we need */ - /* to modify tx by the first character width so as to start*/ - /* the string to the left of the text origin. */ - - if (pDDC->Static.attrs->atextPath == PEXPathLeft) - tx += ptx_first; - - /* Buffer the tc_to_npc_xform first */ - - memcpy( (char *)tc_to_npc_xform, (char *)buf2_xform,16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by */ - /* directly modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0npc = tc_to_npc_xform[i][0]; - ei1npc = tc_to_npc_xform[i][1]; - ei3npc = tc_to_npc_xform[i][3]; - /* Modify the transform */ - tc_to_npc_xform[i][0] = exp * ei0npc; - tc_to_npc_xform[i][3] = tx * ei0npc + ty * ei1npc + ei3npc; - } - - /* Get buf_xform = (tc_to_npc_xform * buf1_xform) */ - - miMatMult (buf_xform, tc_to_npc_xform, buf1_xform); - - /* Transform and clip the paths corresponding to current */ - /* character. */ - - if (status = miTransform(pDDC, text_el.paths->path, &cc_path, - buf_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - /* Now pass the paths through the line clipper to see if */ - /* it lies within the pick aperture. If anything remains,*/ - /* then return a PICK. Otherwise, return a NO_PICK. */ - - if (status = miClipPolyLines (pDDC, cc_path, &clip_path, - MI_VCLIP)) { - - /* BadAlloc, or NOT 4D points */ - - return (status); - } - else { - /* Check if anything is remaining. If so, the pick volume */ - /* intersects the text string. If not, this char has been */ - /* clipped out. Accordingly, update the Pick_Flag. */ - - if (clip_path->numLists > 0) { - Pick_Flag = 1; - goto TextHit; - } - } - - /* Update the pointer to next character */ - - text_el.paths++; - - } /* Loop for all characters in the text string */ - - TextHit: - - if (Pick_Flag) - - /* Update the ddContext pick status to PICK */ - - pDDC->Static.pick.status = PEXOk; - else - /* Update the ddContext pick status to NO_PICK */ - - pDDC->Static.pick.status = PEXNoPick; - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - - -/*++ - | - | Function Name: miPickAnnoText3D - | - | Function Description: - | Handles the picking of Annotation text 3D ocs. - | - | Note(s): - | - --*/ - -ddpex2rtn -miPickAnnoText3D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - /* local */ - miAnnoTextStruct *ddText = (miAnnoTextStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddUSHORT numEncodings = ddText->numEncodings; - ddCoord3D *pOrigin = ddText->pOrigin; /* string origin */ - ddCoord3D *pOffset = ddText->pOffset; - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - extern void miTransformPoint(); - -/* Define required temporary variables */ - - ddPC_NPC_HitVolume aperture; - ddNpcSubvolume pv; - miViewEntry *view_entry; - ddViewEntry *view; - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_npc_xform[4][4]; - ddFLOAT buf_xform[4][4], buf1_xform[4][4]; - ddFLOAT buf2_xform[4][4]; - miDDContext *pDDC, *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first, pty_first; - int i, j, k; - int count; /* Count of characters to be picked */ - ddFLOAT ei0npc, ei1npc, ei3npc; - miCharPath *save_ptr; - miListHeader *cc_path, *clip_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag, LUTstatus; - static ddVector3D Directions[2] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0}; - ddCoord3D *pDirections = (ddCoord3D *)Directions; - ddCoord4D MC_Origin, CC_Origin, NPC_Origin; - ddUSHORT oc; /* Outcode for 4D point clipping */ - ddUSHORT Pick_Flag, cur_index; - - /* Get the DDContext handle for local use */ - - pddc = pDDC = (miDDContext *)pRend->pDDContext; - - /* Transform and clip the text origin first to see if any picking */ - /* needs to be done at all. If the NPC subvolume does not contain */ - /* the origin, the annotation text is not picked. */ - - MC_Origin.x = pOrigin->x; - MC_Origin.y = pOrigin->y; - MC_Origin.z = pOrigin->z; - MC_Origin.w = 1.0; - - if (pDDC->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - CLIP_POINT4D(&MC_Origin, oc, MI_MCLIP); - - if (oc) { - pDDC->Static.pick.status = PEXNoPick; - return (Success); /* origin model clipped out */ - } - } - - /* Get the current view index and the corresponding transforms */ - - cur_index = pDDC->Dynamic->pPCAttr->viewIndex; - - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - cur_index, &LUTstatus, (ddPointer *)&view_entry)) - == PEXLookupTableError) - return (PEXLookupTableError); - - /* Compute the mc_to_npc for the current view */ - - miMatMult (pDDC->Dynamic->mc_to_npc_xform, - pDDC->Dynamic->mc_to_wc_xform, - view_entry->vom); - - miTransformPoint (&MC_Origin, pDDC->Dynamic->mc_to_npc_xform, - &NPC_Origin); - - if ((ClipNPCPoint4D (pRend, &NPC_Origin, &oc)) == PEXLookupTableError) - return (PEXLookupTableError); - if (oc) { - pDDC->Static.pick.status = PEXNoPick; - return (Success); /* Don't pick anything; origin clipped out */ - } - - /* Keep the NPC_Origin computed above for later use */ - - /* Get the pick aperture and convert into NPC, if required. */ - - if (pDDC->Static.pick.type == PEXPickDeviceDC_HitBox) { - - /* Convert the dcHitBox into a NPCHitVolume */ - - convert_dcHitBox_to_npc (pRend, &aperture); - } - else { - - /* Copy data straight from the NPC pick aperture input record */ - - aperture = pDDC->Static.pick.input_rec.npc_hit_volume; - } - - /* Set the annotation text flag to one */ - - aflag = 1; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - { - pDDC->Static.pick.status = PEXNoPick; - return (Success); - } - - - /* Convert text string into required paths */ - - if ((status = atx_el_to_path (pRend, pDDC, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text3_xform (pOrigin,pDirections, (pDirections+1), - pDDC->Static.attrs, &align, text_el.xform, aflag); - - /* Set up the new composite transform first. Note that in the case */ - /* of annotation text, only the text origin is transformed by the */ - /* complete pipeline transform. The text itself is affected only by*/ - /* the transformed origin in NPC, the NPC offset , npc_to_cc, and */ - /* the workstation transform. */ - - /* Now compute the initial composite transform for the first char. */ - /* The required transforms for characters are - text space to model */ - /* space transform, transformation of the annotation text origin, if*/ - /* any. Note the ABSENCE of npc to cc transform here because of the */ - /* PICKING as opposed to rendering. */ - - /* Get the translation due to the transformation of the annotation */ - /* text origin by mc_to_npc_xform into buf1_xform. */ - - memcpy( (char *)buf1_xform, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - buf1_xform[0][3] += NPC_Origin.x - MC_Origin.x; - buf1_xform[1][3] += NPC_Origin.y - MC_Origin.y; - buf1_xform[2][3] += NPC_Origin.z - MC_Origin.z; - - miMatMult (buf2_xform, text_el.xform, buf1_xform); - - /* Add the offset in NPC */ - - buf2_xform[0][3] += pOffset->x; - buf2_xform[1][3] += pOffset->y; - buf2_xform[2][3] += pOffset->z; - - /* Pick the paths in text_el as polylines */ - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pDDC->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - Pick_Flag = 0; /* Initialize flag to indicate NO_PICK */ - - /* Get the current defined view entry from the View LUT */ - - view = &(view_entry->entry); - - /* Compute the intersection of the pick aperture with the NPC */ - /* sub-volume defined for the current view. */ - - if (compute_pick_volume (&aperture, view, pDDC, &pv)) { - - /* We have NO intersection between the pick aperture */ - /* and the NPC subvolume defined for the current view */ - - goto TextHit; /* NoPick, Skip everything else */ - } - - /* Get the transform to go from pick volume to CC - buf1_xform */ - - compute_pick_volume_xform (&pv, buf1_xform); - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the */ - /* text path is Up or Down. If so, we need to modify tx by */ - /* first character translation to align with the rest of the*/ - /* characters in the string. */ - - if ((pDDC->Static.attrs->atextPath == PEXPathUp || - pDDC->Static.attrs->atextPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE */ - /* FIRST CHARACTER IN THE STRING. ptx FOR ALL OTHERS WILL */ - /* BE RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE*/ - /* REQUIRED EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS */ - /* NOT A PROBLEM HERE SINCE WE NEED THIS SPECIAL CASE ONLY*/ - /* FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE */ - /* OF += */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to*/ - /* get just the character width. */ - - ptx_first += (pDDC->Static.attrs->charSpacing) * - FONT_COORD_HEIGHT; - - pty_first = pty; /* Save first character height */ - - /* Adjust the translation by character spacing factor to*/ - /* get just the character height. */ - - pty_first += (pDDC->Static.attrs->charSpacing) * - FONT_COORD_HEIGHT; - } - - /* Check to see if the text path is Left. If so, we need */ - /* to modify tx by the first character width so as to start*/ - /* the string to the left of the text origin. */ - - if (pDDC->Static.attrs->atextPath == PEXPathLeft) - tx += ptx_first; - - /* Buffer the tc_to_npc_xform first */ - - memcpy( (char *)tc_to_npc_xform, (char *)buf2_xform,16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by */ - /* directly modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0npc = tc_to_npc_xform[i][0]; - ei1npc = tc_to_npc_xform[i][1]; - ei3npc = tc_to_npc_xform[i][3]; - /* Modify the transform */ - tc_to_npc_xform[i][0] = exp * ei0npc; - tc_to_npc_xform[i][3] = tx * ei0npc + ty * ei1npc + ei3npc; - } - - /* Get buf_xform = (tc_to_npc_xform * buf1_xform) */ - - miMatMult (buf_xform, tc_to_npc_xform, buf1_xform); - - /* Transform and clip the paths corresponding to current */ - /* character. */ - - if (status = miTransform(pDDC, text_el.paths->path, &cc_path, - buf_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - /* Now pass the paths through the line clipper to see if */ - /* it lies within the pick aperture. If anything remains,*/ - /* then return a PICK. Otherwise, return a NO_PICK. */ - - if (status = miClipPolyLines (pDDC, cc_path, &clip_path, - MI_VCLIP)) { - - /* BadAlloc, or NOT 4D points */ - - return (status); - } - else { - /* Check if anything is remaining. If so, the pick volume */ - /* intersects the text string. If not, this char has been */ - /* clipped out. Accordingly, update the Pick_Flag. */ - - if (clip_path->numLists > 0) { - Pick_Flag = 1; - goto TextHit; - } - } - - /* Update the pointer to next character */ - - text_el.paths++; - - } /* Loop for all characters in the text string */ - - TextHit: - - if (Pick_Flag) - - /* Update the ddContext pick status to PICK */ - - pDDC->Static.pick.status = PEXOk; - else - /* Update the ddContext pick status to NO_PICK */ - - pDDC->Static.pick.status = PEXNoPick; - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - - -/*++ - | - | Function Name: miPickPrimitives - | - | Function Description: - | Handles the picking of most primitives in a generic fashion. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miPickPrimitives(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - -/* Local variable definitions */ - miDDContext *pDDC = (miDDContext *)(pRend->pDDContext); - ddPC_NPC_HitVolume aperture; - ddNpcSubvolume pv; - miViewEntry *view_entry; - ddViewEntry *view; - ddFLOAT buf1_xform[4][4]; - ddUSHORT cur_index; - ddUSHORT status; - - /* Get the pick aperture and convert into NPC, if required. */ - - if (pDDC->Static.pick.type == PEXPickDeviceDC_HitBox) { - - /* Convert the dcHitBox into a NPCHitVolume */ - - convert_dcHitBox_to_npc (pRend, &aperture); - - } - else { - - /* Copy data straight from the NPC pick aperture input record */ - - aperture = pDDC->Static.pick.input_rec.npc_hit_volume; - } - - /* Clear out the cc_to_dc_xform, since we will not be going to DC */ - - memcpy( (char *) pDDC->Dynamic->cc_to_dc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /* Get the current defined view entry from the View LUT */ - - cur_index = pDDC->Dynamic->pPCAttr->viewIndex; - - if ((InquireLUTEntryAddress (PEXViewLUT, pRend->lut[PEXViewLUT], - cur_index, &status, (ddPointer *)&view_entry)) - == PEXLookupTableError) - return (PEXLookupTableError); - - view = &(view_entry->entry); - - /* Compute the intersection of the pick aperture with the NPC */ - /* sub-volume defined for the current view. */ - - if (compute_pick_volume (&aperture, view, pDDC, &pv)) { - - /* We have NO intersection between the pick aperture */ - /* and the NPC subvolume defined for the current view */ - - return (Success); /* NoPick, Just return */ - } - - /* Get the transform to go from pick volume to CC - buf1_xform */ - - compute_pick_volume_xform (&pv, buf1_xform); - - /* Compute the mc_to_npc for the current view */ - - miMatMult (pDDC->Dynamic->mc_to_npc_xform, - pDDC->Dynamic->mc_to_wc_xform, - view_entry->vom); - - /* Get wc_to_cc_xform = (wc_to_npc_xform * buf1_xform) */ - /* Note that wc_to_npc_xform == view_entry->vom. */ - - miMatMult (pDDC->Dynamic->wc_to_cc_xform, - view_entry->vom, buf1_xform); - - /* Get mc_to_cc_xform = (mc_to_npc_xform * buf1_xform) */ - - miMatMult (pDDC->Dynamic->mc_to_cc_xform, - pDDC->Dynamic->mc_to_npc_xform, buf1_xform); - - /* Now, call the level 2 rendering function to transform and */ - /* clip the primitive. Note that the level 1 function vector */ - /* now has PICKING routines instead of rendering routines. If*/ - /* a pick is detected the GLOBAL PICK FLAG will have been up-*/ - /* dated. Check this flag to determine if anything was indeed*/ - /* picked by the level 1 picking routines. */ - - InitExecuteOCTable[(int)(pExecuteOC->elementType)] - (pRend, pExecuteOC); - - /* If successful PICK, just return */ - - if (pDDC->Static.pick.status == PEXOk) ;; /* For debug */ - - return (Success); -} - - -/*++ - | - | Function Name: miTestPickGdp3d - | - | Function Description: - | Provides the dummy test routine for picking 3d Gdps. - | with data OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miTestPickGdp3d(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - ErrorF ("miTestPickGdp3d\n"); - return (Success); -} - - -/*++ - | - | Function Name: miTestPickGdp2d - | - | Function Description: - | Provides the dummy test routine for picking 2d Gdps. - | with data OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miTestPickGdp2d(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - ErrorF ("miTestPickGdp2d\n"); - return (Success); -} - - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c:3.7 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c Sat Feb 28 21:41:54 2004 @@ -1,534 +0,0 @@ -/* $Xorg: miPolyLine.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miPolyLine.c,v 3.7 2001/12/14 19:57:29 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miClip.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miPolyLines - | - | Function Description: - | Handles the Polyline 3D, Polyline 2D, Polyline set 3D with data ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miPolyLines(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - ddpex3rtn miTransform(); - ddpex3rtn miConvertVertexColors(); - ddpex3rtn miClipPolyLines(); - ddpex3rtn miRenderPolyLine(); - -/* Local variable definitions */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miPolylineStruct *ddPoly = (miPolylineStruct *)(pExecuteOC+1); - miListHeader *input_list = (miListHeader *)ddPoly; - miListHeader *color_list, - *mc_list, - *mc_clist, - *cc_list, - *clip_list, - *dcue_list, - *dc_list; - ddpex3rtn status; - ddPointType out_type; - ddUSHORT clip_mode; /* view or model clipping */ - - /* - * Convert per-vertex colors to rendering color model. - * Note that this implementation only supports rgb float. - */ - - if (DD_IsVertColour(input_list->type)) { - if (status = miConvertVertexColors(pRend, - input_list, PEXRdrColourModelRGB, - &color_list)) - return (status); - } else { - color_list = input_list; - } - - /* Check for Model clipping */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - clip_mode = MI_MCLIP; - - - /* Tranform points to 4D for clipping */ - out_type = color_list->type; - if (status = miTransform(pddc, color_list, &mc_clist, - ident4x4, - ident4x4, - DD_SetVert4D(out_type))) - return (status); - - - if (status = miClipPolyLines(pddc, mc_clist, &mc_list, clip_mode)) - return(status); - - /* if nothing left, return early */ - if (mc_list->numLists <= 0) return(Success); - - - } else mc_list = color_list; - - clip_mode = MI_VCLIP; - - - /* Transform and clip the paths created */ - out_type = mc_list->type; - if (status = miTransform(pddc, mc_list, &cc_list, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_SetVert4D(out_type))) - return (status); - - if (status = miClipPolyLines(pddc, cc_list, &clip_list, clip_mode)) - return(status); - - /* if nothing left, return early */ - if (clip_list->numLists <= 0) return(Success); - - /* DEPTH CUEING */ - if (pddc->Dynamic->pPCAttr->depthCueIndex) { - miDepthCuePLine(pRend, clip_list, &dcue_list); - clip_list = dcue_list; - } - - /* Transform to DC coordinates */ - out_type = clip_list->type; - DD_SetVert2D(out_type); - DD_SetVertShort(out_type); - if (status = miTransform(pddc, clip_list, &dc_list, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - out_type)) - return (status); - - - return (pddc->Static.RenderProcs[POLYLINE_RENDER_TABLE_INDEX](pRend, - pddc, - dc_list)); -} - -/*++ - | - | Function Name: miClipPolyLines - | - | Function Description: - | Handles the Polyline 3D, Polyline 2D, Polyline set 3D with data ocs. - | - | Note(s): - | This routine modifies both the input and output - | data structures - the input had better not - | be pointing at the CSS data store! - | - --*/ - -ddpex3rtn -miClipPolyLines(pddc, vinput, voutput, clip_mode) -/* in */ - miDDContext *pddc; - miListHeader *vinput; - miListHeader **voutput; - ddUSHORT clip_mode; /* view or model clipping */ -{ - -/* uses */ - ddPointUnion in_ptP, in_ptQ; - ddPointUnion out_pt; - float t_ptP, t_ptQ; - miListHeader *input, *output, *list1, *list2; - listofddPoint *pddilist; - listofddPoint *pddolist; - int num_lists; - int vert_count; - int point_size, num_planes; - int current_plane,j,k, - clip_code, pts_in_list; - ddHalfSpace *MC_HSpace; - ddUSHORT current_clip; - char new_list; - - - /* Vertex data must be homogeneous for view clipping */ - if ((clip_mode == MI_VCLIP) && !(DD_IsVert4D(vinput->type))) - return(1); - - - /* Allocate an initial number of headers */ - list1 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list1, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)); - if (!list1->ddList) return(BadAlloc); - list1->type = vinput->type; - list1->flags = vinput->flags; - input = vinput; - - list2 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list2, MI_ROUND_LISTHEADERCOUNT(vinput->numLists)); - if (!list2->ddList) return(BadAlloc); - list2->type = vinput->type; - list2->flags = vinput->flags; - - *voutput = output = list2; - - DD_VertPointSize(vinput->type, point_size); - - num_lists = 0; - - /* Now, clip each list */ - - /* Get point size so that this works for all point types */ - DD_VertPointSize(vinput->type, point_size); - - /* - * Each list is now clipped in turn against each (enabled) boundary. - */ - - - if (clip_mode == MI_MCLIP) { - num_planes = pddc->Static.misc.ms_MCV->numObj; - MC_HSpace = (ddHalfSpace *)(pddc->Static.misc.ms_MCV->pList); - } - - else num_planes = 6; /* view clipping to a cube */ - - for (current_plane = 0; current_plane < num_planes; current_plane++) { - current_clip = 1 << current_plane; - - num_lists = 0; /* Restart list counter each pass */ - - for (j = 0, pddilist = input->ddList, pddolist = output->ddList, - output->numLists = 0, num_lists = 0, new_list = 1; - j < input->numLists; j++) { - - - /* Don't process if no points */ - if ((vert_count = pddilist->numPoints) <= 0) { - pddilist++; - continue; - } - - /* - * Insure sufficient room for each vertex. - * Note that twice the vertex count is an upper-bound for - * a clipped polygon (although there is probably a "tighter fit"). - */ - MI_ALLOCLISTOFDDPOINT(pddolist, 2*vert_count, point_size); - if (!(out_pt.ptr = (char *)pddolist->pts.ptr)) return(BadAlloc); - pts_in_list = 0; - clip_code = 0; - - /* Aquire two points */ - /* and generate clip code */ - in_ptP.ptr = pddilist->pts.ptr; - COMPUTE_CLIP_PARAMS(in_ptP,t_ptP,0,clip_mode, - current_clip,MC_HSpace,clip_code); - /* - * Initialize the output array. If the first point is - * inside the bounds, load it. - */ - - if(!(clip_code)) { - COPY_POINT(in_ptP, out_pt, point_size); - ++pts_in_list; - out_pt.ptr += point_size; - } - - in_ptQ.ptr = in_ptP.ptr + point_size; - - for (k = 1; k < pddilist->numPoints; k++){ - - COMPUTE_CLIP_PARAMS(in_ptQ, t_ptQ, 1, clip_mode, - current_clip,MC_HSpace,clip_code); - - switch(clip_code) { - case 0: /* both P and Q are in bounds */ - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - ++pts_in_list; - break; - - case 1: /* P is out, Q is in */ - CLIP_AND_COPY(input->type, in_ptP, t_ptP, - in_ptQ, t_ptQ, out_pt); - out_pt.ptr += point_size; - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - pts_in_list = 2; - break; - - case 2: /* P is in, Q is out */ - CLIP_AND_COPY(input->type, in_ptQ, t_ptQ, - in_ptP, t_ptP, out_pt); - out_pt.ptr += point_size; - ++pts_in_list; - pddolist->numPoints = pts_in_list; - pddolist++; - output->numLists++; - num_lists++; - MI_ALLOCLISTHEADER(output, - MI_ROUND_LISTHEADERCOUNT(output->numLists)); - /* skip to next output list */ - pddolist = output->ddList + num_lists; - - /* Insure sufficient room for remaining verts - and degenerate points */ - MI_ALLOCLISTOFDDPOINT(pddolist, - ((pddilist->numPoints - k)+1), - point_size); - - out_pt.ptr = pddolist->pts.ptr; - if (!out_pt.ptr) return(BadAlloc); - pts_in_list = 0; /*start a new list*/ - break; - - case 3: /* both are out; do nothing */ - break; - - } - in_ptP.ptr = in_ptQ.ptr; - t_ptP = t_ptQ; - in_ptQ.ptr += point_size; - clip_code >>= 1; - } - if (pts_in_list > 1) { - pddolist->numPoints = pts_in_list; - pddolist++; - num_lists++; - } /* else use the same output list */ - - /* Now, skip to next input list */ - pddilist++; - } - - - - /* Complete initialization of output list header */ - output->numLists = num_lists; - - /* Use result of previous clip for input to next clip */ - input = output; - if (output == list2) - output = list1; - else output = list2; - - if (clip_mode == MI_MCLIP) MC_HSpace++; - - } /* end of processing for all planes */ - - /* Current input list is last processed (clipped) list */ - *voutput = input; - - return (Success); - -} - - -/*++ - | - | DepthCuePLine(pRend, input_vert, output_vert) - | - | Applies depth cueing to the vertex colors in a data list - | - --*/ -ddpex3rtn -miDepthCuePLine(pRend, input_vert, output_vert) - ddRendererPtr pRend; /* renderer handle */ - miListHeader *input_vert; /* input vertex data */ - miListHeader **output_vert; /* output vertex data */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *out_vert; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddPointUnion in_pt, out_pt; - ddRgbFloatColour *in_color; - int point_size, facet_size; - int numPoints; - int i,j,outpoint_size; - miColourEntry *pintcolour; - ddFLOAT pt_depth; - ddULONG colourindex; - ddColourSpecifier intcolour; - ddUSHORT status; - ddDepthCueEntry *dcue_entry; - - /* look for empty list header */ - if (input_vert->numLists == 0) return(Success); - - /* validate CC version of Depth Cue information */ - if (pddc->Static.misc.flags & CC_DCUEVERSION) - Compute_CC_Dcue(pRend, pddc); - - /* check to make sure depth cuing is enabled */ - if (pddc->Static.misc.cc_dcue_entry.mode == PEXOff) { - *output_vert = input_vert; - return(Success); - } - - /* Else, depth cue! Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, input_vert->numLists) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = input_vert->type; - DD_SetVertRGBFLOAT(out_vert->type); - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - DD_VertPointSize(input_vert->type, point_size); - - /* Get current line color if appropriate */ - if (!(DD_IsVertColour(input_vert->type)) && - (pddc->Static.attrs->lineColour.colourType - == PEXIndexedColour)) { - if ((InquireLUTEntryAddress (PEXColourLUT, pRend->lut[PEXColourLUT], - pddc->Static.attrs->lineColour.colour.indexed.index, - &status, (ddPointer *)&pintcolour)) == PEXLookupTableError) - return (PEXLookupTableError); - } - - DD_VertPointSize(out_vert->type, outpoint_size); - - for (i = 0; i < input_vert->numLists; i++) { - - pddolist->numPoints = pddilist->numPoints; - - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - outpoint_size); - if (!(out_pt.ptr = pddolist->pts.ptr)) return(BadAlloc); - in_pt = pddilist->pts; - - for (j = 0; j < pddilist->numPoints; j++) - { - /* First copy over coordinate data */ - pt_depth = in_pt.p4Dpt->z; - *out_pt.p4Dpt = *in_pt.p4Dpt; - in_pt.p4Dpt++; - out_pt.p4Dpt++; - - /* - * Next color - * Colour is derived first from the vertex, second from the - * from the current PC attributes. - */ - - if (DD_IsVertColour(input_vert->type)){ - in_color = in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - } - else { - if (pddc->Static.attrs->lineColour.colourType - == PEXIndexedColour) - in_color = &pintcolour->entry.colour.rgbFloat; - else in_color = - &(pddc->Static.attrs->lineColour.colour.rgbFloat); - } - - APPLY_DEPTH_CUEING(pddc->Static.misc.cc_dcue_entry, - pt_depth, in_color, out_pt.pRgbFloatClr) - - out_pt.pRgbFloatClr++; - - /* - * Next normals - * Colour is derived first from the vertex, second from the - * facet (note that we insured above that there were facet normals). - */ - - if DD_IsVertNormal(input_vert->type) { - *out_pt.pNormal = *in_pt.pNormal; - in_pt.pNormal++; - out_pt.pNormal++; - } - - /* Next pass along edge info if there is any */ - if (DD_IsVertEdge(out_vert->type)) { - *out_pt.pEdge = *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - - } - - pddilist++; - pddolist++; - } - - return(Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c:3.8 Fri Dec 14 14:57:29 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c Sat Feb 28 21:41:54 2004 @@ -1,269 +0,0 @@ -/* $Xorg: miQuadMesh.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miQuadMesh.c,v 3.8 2001/12/14 19:57:29 dawes Exp $ */ - -#include "miLUT.h" -#include "ddpex2.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "misc.h" -#include "miscstruct.h" -#include "miRender.h" -#include "gcstruct.h" -#include "miClip.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miQuadMesh - | - | Function Description: - | Handles the Quad Mesh OC - | - | Note(s):This routine decomposes Quad Meshes to a series of triangle - | meshes for rendering - | - --*/ - -ddpex3rtn -miQuadMesh(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; - miGenericStr *pExecuteOC; - - -{ - -/* Calls */ - extern ocTableType InitExecuteOCTable[]; - -/* Local variable definitions */ - miQuadMeshStruct *ddQuad = (miQuadMeshStruct *)(pExecuteOC+1); - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - - miGenericStr *pGStr; - miTriangleStripStruct - *ddTri; /*pointer to temporary - |triangle strip structure - |for decomposed QuadMesh - |row of cells - */ - miListHeader *tri_list; - - ddPointUnion in_pt, out_pt; - - listofddFacet *tri_facets; - - char *quad_fptr, /* pointers to */ - *tri_fptr; /* facet data */ - - ddpex3rtn status; - - int inpoint_size, - outpoint_size, - facet_size, - row_size, - edge_offset, - i,j, - num_cols, - num_rows; - -/***********************************************************************/ - - - /* Initialize status */ - - status = Success; - - /* Allocate space for a Generic Structure Element */ - - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miTriangleStripStruct))))) { - status = BadAlloc; - goto exit; - } - - /* Initialize the header data into allocated generic struct */ - - pGStr->elementType = PEXOCTriangleStrip; - - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddTri = (miTriangleStripStruct *) (pGStr + 1); - - num_cols = (ddQuad->mPts - 1); - num_rows = (ddQuad->nPts - 1); - - /* At this point, we need to check if the edges are visible or not. */ - /* If they are we need to explicitly add them. This is part of the */ - /* because they are in the FillArea primitive, and we didn't wish */ - /* to have special cases all over the code. (particularly structure */ - /* storage and readback on both sides of the wire) */ - - DD_VertPointSize(ddQuad->points.type, inpoint_size); - - in_pt.ptr = ddQuad->points.ddList->pts.ptr; - row_size = (inpoint_size * (num_cols+ 1)); - quad_fptr = (char *)ddQuad->pFacets->facets.pNoFacet; - - for (i = 1; i <= num_rows ; i++) { - - /* All temporary storage must be reallocated - * each time, since the allocation routines rotate through - * the headers, and will overwrite any particular header - * after four calls. This coould perhaps be avoided by - * directly using xalloc, but we do it this way for - * consistency. - */ - - - tri_list = MI_NEXTTEMPDATALIST(pddc); /* get new miListHeader */ - MI_ALLOCLISTHEADER(tri_list, 1); /* get new ddList attached */ - - tri_list->ddList->numPoints = 2 * (num_cols + 1); - tri_list->type = ddQuad->points.type; - if ((pddc->Static.attrs->edges != PEXOff) && - (!(DD_IsVertEdge(ddQuad->points.type)))) { - DD_SetVertEdge(tri_list->type); - DD_VertOffsetEdge(tri_list->type, edge_offset); - } - DD_VertPointSize(tri_list->type, outpoint_size); - tri_list->flags = ddQuad->points.flags; - tri_list->numLists = 1; - MI_ALLOCLISTOFDDPOINT( /* get vertex storage */ - tri_list->ddList, (2 * (num_cols + 1)), (outpoint_size)); - - /* Allocate triangle strip facet storage if necessary*/ - if (ddQuad->pFacets) { - if (ddQuad->pFacets->numFacets > 0) { - DDFacetSIZE(ddQuad->pFacets->type, facet_size); - tri_facets = MI_NEXTTEMPFACETLIST(pddc); - tri_facets->type = ddQuad->pFacets->type; - MI_ALLOCLISTOFDDFACET(tri_facets, 2 * num_cols, facet_size); - if (!tri_facets->facets.pFacetRgbFloatN) { - status = BadAlloc; - goto exit; - } - tri_fptr = (char *)tri_facets->facets.pNoFacet; - tri_facets->numFacets = 2 * num_cols; - ddTri->pFacets = tri_facets; - } - else { - quad_fptr = 0; - tri_fptr = 0; - tri_facets = 0; - ddTri->pFacets = 0; - } - - } else { - quad_fptr = 0; - tri_fptr = 0; - tri_facets = 0; - ddTri->pFacets = 0; - } - - out_pt.ptr = tri_list->ddList->pts.ptr; - - memcpy( out_pt.ptr, in_pt.ptr, inpoint_size); - if (pddc->Static.attrs->edges != PEXOff) { - *(out_pt.ptr + edge_offset) = ~0; - } - out_pt.ptr += outpoint_size; - - memcpy( out_pt.ptr, (in_pt.ptr + row_size), inpoint_size); - if (pddc->Static.attrs->edges != PEXOff) { - *(out_pt.ptr + edge_offset) = ~0; - CLEAR_FWD_EDGE(out_pt.ptr, edge_offset); - } - in_pt.ptr += inpoint_size; - out_pt.ptr += outpoint_size; - - /* Build up a triangle strip */ - for (j = 1; j <= num_cols; j++) { - - memcpy( out_pt.ptr, in_pt.ptr, inpoint_size); - if (pddc->Static.attrs->edges != PEXOff) { - *(out_pt.ptr + edge_offset) = ~0; - } - out_pt.ptr += outpoint_size; - memcpy( out_pt.ptr, (in_pt.ptr + row_size), inpoint_size); - if (pddc->Static.attrs->edges != PEXOff){ - *(out_pt.ptr + edge_offset) = ~0; - CLEAR_FWD_EDGE(out_pt.ptr, edge_offset); - } - in_pt.ptr += inpoint_size; - out_pt.ptr += outpoint_size; - - if (ddQuad->pFacets->numFacets > 0) { - memcpy( tri_fptr, quad_fptr, facet_size); - tri_fptr += facet_size; - memcpy( tri_fptr, quad_fptr, facet_size); - tri_fptr += facet_size; - quad_fptr += facet_size; - } - } - - ddTri->points = *tri_list; - - /*fire off the triangle strip routine*/ - if (status = InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr)) - goto exit; - } - - /* Free up allocated space for generic struct and return */ - - exit: - - xfree((char *)pGStr); - return (status); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c:3.8 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c Sat Feb 28 21:41:54 2004 @@ -1,313 +0,0 @@ -/* $Xorg: miReplace.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miReplace.c,v 3.8 2001/12/14 19:57:30 dawes Exp $ */ - - -#include "ddpex2.h" -#include "miStruct.h" -#include "pexExtract.h" -#include "pexUtils.h" -#include "miLight.h" -#include "pexos.h" - - -/** Replace functions: - ** Each takes two parameters: a pointer to the element to be - ** parsed (in PEX format) and a pointer to a pointer to return the - ** parsed element (in server native internal format). - ** - ** See comments in pexOCParse.c - ** - ** The routines in this file are exceptions to the symmetry - ** in parsing that allows us to use the same routines for creation - ** and replacement. - ** - ** Note that these routines DO NOT allocate any memory; the calling - ** routines must ensure that sufficient memory has been allocated - ** in which to store the parsed element. Coders adding routines - ** to this file must obide by this rule. - **/ - - -extern void ParseFacetOptData(); -extern void ParseVertexData(); -extern int CountFacetOptData(); -extern int CountVertexData(); - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define CAT(a,b) a##b -#else -#define CAT(a,b) a/**/b -#endif - -#define OC_REPLACE_FUNC_HEADER(suffix) \ - ddpex2rtn CAT(replace,suffix)(pPEXOC, ppExecuteOC) \ - ddElementInfo *pPEXOC; /* PEX format */ \ - miGenericElementPtr *ppExecuteOC; /* internal format */ - -#define OC_REPLACE_RETURN(ANSWER) \ - return(Success); - -#define PARSER_PTR(PTR) \ - ddPointer PTR = (ddPointer)(pPEXOC + 1) - -#define LEN_WO_HEADER(OCtype) (pPEXOC->length * sizeof(CARD32) - sizeof(OCtype)) - -/* Note this macro assumes that if the old size is the same as the new - size, then the replace in place can happen. This may not be sufficient - proof. Counterexamples are dealt with on a case by case basis - (e.g., see replaceLightState below). - */ -#define CHECK_REPLACE(DD_ST, TYPE) \ - if (!*ppExecuteOC) return (BadAlloc); \ - if (pPEXOC->length != (*ppExecuteOC)->element.pexOClength) \ - return (BadAlloc); \ - (DD_ST) = (TYPE *)((*ppExecuteOC)+1); - - - -OC_REPLACE_FUNC_HEADER(LightState) -{ - miLightStateStruct *ddLightState; - pexLightState *pLight = (pexLightState *)pPEXOC; - extern ddpex2rtn parseLightState(); - - CHECK_REPLACE( ddLightState, miLightStateStruct); - - /* - may have padding due to pointer alignment insurance - */ - if ((MAKE_EVEN(pLight->numEnable) + MAKE_EVEN(pLight->numDisable)) - != (MAKE_EVEN(ddLightState->enableList->numObj) - + MAKE_EVEN(ddLightState->disableList->numObj))) - return(BadAlloc); - - return(parseLightState(pPEXOC, ppExecuteOC)); -} - - -OC_REPLACE_FUNC_HEADER(SOFAS) -{ - miSOFASStruct *ddFill; - pexSOFAS *pFill = (pexSOFAS *)pPEXOC; - PARSER_PTR(ptr); - CARD16 i,j; - miConnListList *pCLL; - miConnList *pCList; - ddPointer rptr = 0; - ddPointer vertexPtr = 0; - ddPointer facetPtr = 0; - int edgeSize = 0; - int facetSize = 0; - int vertexSize = 0; - ddpex2rtn err = Success; - - CHECK_REPLACE( ddFill, miSOFASStruct); - if ( (pFill->numFAS != ddFill->numFAS) - || (pFill->numEdges != ddFill->numEdges) - || (pFill->numVertices != ddFill->points.ddList->maxData)) - return(BadAlloc); /* still not a sufficient check... */ - - facetSize = CountFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)(pFill->numFAS), - pFill->FAS_Attributes); - vertexSize = CountVertexData( ptr, pFill->colourType, - (CARD32)(pFill->numVertices), - pFill->vertexAttributes); - if (pFill->edgeAttributes){ - edgeSize = pFill->numEdges * sizeof(ddUCHAR); - edgeSize += ((4 - (edgeSize & 3)) & 3); - } - - EXTRACT_CARD16(ddFill->shape, ptr); - ddFill->contourHint = pFill->contourHint; - ddFill->contourCountsFlag = pFill->contourCountsFlag; - ddFill->numFAS = pFill->numFAS; - ddFill->numEdges = pFill->numEdges; - ptr = (ddPointer)(pFill+1); - ddFill->points.ddList = (listofddPoint *)(ddFill + 1); - ddFill->points.flags = 0; - ddFill->points.numLists = 1; - ddFill->points.maxLists = 1; - - facetPtr = (ddPointer)(ddFill->points.ddList + 1); - ParseFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)(pFill->numFAS), - pFill->FAS_Attributes, &(ddFill->pFacets), - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - ParseVertexData( ptr, pFill->colourType, (CARD32)(pFill->numVertices), - pFill->vertexAttributes, ddFill->points.ddList, - &vertexPtr, &(ddFill->points.type), &rptr); - ptr = rptr; - - ddFill->edgeAttribs = pFill->edgeAttributes; - if (pFill->edgeAttributes) { - ddFill->edgeData = (ddUCHAR *)vertexPtr; - EXTRACT_STRUCT(ddFill->numEdges, ddUCHAR, ddFill->edgeData, ptr); - SKIP_PADDING( ptr, ((4 - (ddFill->numEdges & 3)) & 3) ); - } - else { ddFill->edgeData = 0; } - vertexPtr += edgeSize; - - ddFill->connects.numListLists = pFill->numFAS; - ddFill->connects.data = (miConnListList *)vertexPtr; - ddFill->connects.maxData = ddFill->numFAS * sizeof(miConnListList); - for (i=0, pCLL = ddFill->connects.data; inumFAS; i++, pCLL++) { - EXTRACT_CARD16(pCLL->numLists,ptr); - pCLL->maxData = pCLL->numLists * sizeof(miConnList); - for (j=0, pCList=pCLL->pConnLists; jnumLists; j++, pCList++) { - EXTRACT_CARD16(pCList->numLists,ptr); - EXTRACT_STRUCT(pCList->numLists, ddUSHORT, pCList->pConnects, ptr); - pCList->maxData = pCList->numLists * sizeof(ddUSHORT); - } - } - OC_REPLACE_RETURN(ddFill); - -} - - - -OC_REPLACE_FUNC_HEADER(NurbSurface) -{ - miNurbSurfaceStruct *ddNurb; - PARSER_PTR(ptr); - pexNurbSurface *pNurb = (pexNurbSurface *)pPEXOC; - ddULONG i, j, k; - listofTrimCurve *ddTrim; - ddTrimCurve *ddtc; - ddUSHORT type; - - CHECK_REPLACE( ddNurb, miNurbSurfaceStruct); - if ( (pNurb->numUknots != ddNurb->numUknots) - || (pNurb->numVknots != ddNurb->numVknots) - || (pNurb->mPts != ddNurb->mPts) - || (pNurb->nPts != ddNurb->nPts) - || (pNurb->numLists != ddNurb->numTrimCurveLists) - || (pNurb->uOrder != ddNurb->uOrder) - || (pNurb->vOrder != ddNurb->vOrder) - || ( (pNurb->type == PEXRational) - && (ddNurb->points.type != DD_HOMOGENOUS_POINT)) - || ( (pNurb->type == PEXNonRational) - && (ddNurb->points.type != DD_3D_POINT))) - return(BadAlloc); /* still not a sufficient check... */ - - ddNurb->pUknots = (ddFLOAT *)(ddNurb+1); - ddNurb->pVknots = (ddFLOAT *)((ddNurb->pUknots) + pNurb->numUknots); - ddNurb->points.ddList = - (listofddPoint *)((ddNurb->pVknots) + pNurb->numVknots); - ddNurb->points.ddList->pts.ptr = (char *)(ddNurb->points.ddList + 1); - ddNurb->trimCurves = - (listofTrimCurve *)((ddNurb->points.ddList->pts.ptr) - + (pNurb->mPts * pNurb->nPts) * sizeof(ddCoord4D)); - - SKIP_PADDING(ptr, 2); /* place holder for type */ - EXTRACT_CARD16(ddNurb->uOrder, ptr); - EXTRACT_CARD16(ddNurb->vOrder, ptr); - SKIP_PADDING(ptr, 2); - EXTRACT_CARD32(ddNurb->numUknots, ptr); - EXTRACT_CARD32(ddNurb->numVknots, ptr); - EXTRACT_CARD16(ddNurb->mPts, ptr); - EXTRACT_CARD16(ddNurb->nPts, ptr); - EXTRACT_CARD32(ddNurb->numTrimCurveLists, ptr); /* is pNurb->numLists */ - - EXTRACT_STRUCT(ddNurb->numUknots, PEXFLOAT, ddNurb->pUknots, ptr); - EXTRACT_STRUCT(ddNurb->numVknots, PEXFLOAT, ddNurb->pVknots, ptr); - - ddNurb->points.numLists = 1; - ddNurb->points.maxLists = 1; - if (pNurb->type == PEXRational) { - ddNurb->points.type = DD_HOMOGENOUS_POINT; - EXTRACT_STRUCT( ddNurb->mPts * ddNurb->nPts, ddCoord4D, - ddNurb->points.ddList->pts.p4Dpt, ptr); - } else { - ddNurb->points.type = DD_3D_POINT; - EXTRACT_STRUCT( ddNurb->mPts * ddNurb->nPts, ddCoord3D, - ddNurb->points.ddList->pts.p3Dpt, ptr); - } - - for ( i=0, ddTrim = ddNurb->trimCurves; - inumTrimCurveLists; - i++, ddTrim++) { - EXTRACT_CARD32(ddTrim->count, ptr); - - for ( j=0, ddtc = ddTrim->pTC; - j < ddTrim->count; - j++, ddtc++) { - EXTRACT_CARD8(ddtc->visibility, ptr); - SKIP_PADDING(ptr, 1); - EXTRACT_CARD16(ddtc->order, ptr); - EXTRACT_CARD16(type, ptr); - EXTRACT_CARD16(ddtc->curveApprox.approxMethod, ptr); - EXTRACT_FLOAT(ddtc->curveApprox.tolerance, ptr); - EXTRACT_FLOAT(ddtc->uMin, ptr); - EXTRACT_FLOAT(ddtc->uMax, ptr); - EXTRACT_CARD32(ddtc->numKnots, ptr); - EXTRACT_CARD32(ddtc->points.numPoints, ptr); - EXTRACT_STRUCT( ddtc->numKnots, PEXFLOAT, ddtc->pKnots, ptr); - if (type == PEXRational) { - /* Note this only works because these points are never - transformed */ - ddtc->pttype = DD_3D_POINT; - ddtc->points.pts.p3Dpt = 0; - EXTRACT_STRUCT( ddtc->points.numPoints, ddCoord3D, - ddtc->points.pts.p3Dpt, ptr); - } else { - ddtc->pttype = DD_2D_POINT; - ddtc->points.pts.p2Dpt = 0; - EXTRACT_STRUCT( ddtc->points.numPoints, ddCoord2D, - ddtc->points.pts.p2Dpt, ptr); - } - } - } - OC_REPLACE_RETURN(ddNurb); - -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c:3.8 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c Sat Feb 28 21:41:54 2004 @@ -1,220 +0,0 @@ -/* $Xorg: miSOFAS.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miSOFAS.c,v 3.8 2001/12/14 19:57:30 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "gcstruct.h" -#include "ddpex2.h" -#include "miLight.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miSOFAS - | - | Function Description: - | - | Note(s): - | - --*/ - -ddpex3rtn -miSOFAS(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ -/* calls */ - extern ocTableType InitExecuteOCTable[]; - -/* Local variable definitions */ - miSOFASStruct *ddSOFAS = (miSOFASStruct *)(pExecuteOC+1); - miFillAreaStruct *ddFill; - miGenericStr *pGStr; - listofddFacet *input_facet = &ddSOFAS->pFacets; /* facets */ - miConnHeader *index_list_hdr = &ddSOFAS->connects; /* vertex index */ - miConnListList *index_list_list = index_list_hdr->data; - miConnList *index_list; - ddUSHORT *index; - ddUCHAR *edge_ptr = ddSOFAS->edgeData; - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *fillarea; - listofddFacet *fillareafacet; - listofddPoint *pddilist, *pddolist; - char *in_pt; - ddPointUnion out_pt; - ddPointer in_fct, out_fct; - int i, j, k; - int point_size, out_point_size, facet_size; - ddpex3rtn status = Success; - - /* - * This implementation does not implement SOFAS directly. - * Instead, the SOFAS data is re-organized to describe a - * fill area set, and the fill area set code is then called - * to perform the rendering. - */ - /* Allocate storage for the fill area command block */ - if (!(pGStr = (miGenericStr *) (xalloc(sizeof(miGenericStr) + - sizeof(miFillAreaStruct))))) - return(BadAlloc); - - pGStr->elementType = PEXOCFillAreaSet; - /* The length data is ignored by the rendering routine and hence is */ - /* left as whatever GARBAGE that will be present at the alloc time. */ - - ddFill = (miFillAreaStruct *) (pGStr + 1); - - /* Initialize constant part of fill area command structure */ - ddFill->shape = ddSOFAS->shape; /* shape hint */ - ddFill->ignoreEdges = PEXOff; /* edge flag */ - ddFill->contourHint = ddSOFAS->contourHint;/* contour hint */ - ddFill->points.type = ddSOFAS->points.type; - if (ddSOFAS->edgeAttribs) DD_SetVertEdge(ddFill->points.type); - ddFill->points.flags = ddSOFAS->points.flags; - ddFill->pFacets = NULL; - - DD_VertPointSize( ddSOFAS->points.type, point_size); - DD_VertPointSize( ddFill->points.type, out_point_size); - DDFacetSIZE( input_facet->type, facet_size); - - /* Only one input vertex list */ - pddilist = ddSOFAS->points.ddList; - in_pt = pddilist->pts.ptr; - if (input_facet->type != DD_FACET_NONE) - in_fct = input_facet->facets.pNoFacet; - else in_fct = NULL; - - /* one fill area set call per facet */ - for (i = 0; i < ddSOFAS->numFAS; i++) { - - /* get next set of vertex indices */ - index_list = index_list_list->pConnLists; - ddFill->points.numLists = index_list_list->numLists; - - /* Get next free vertex list header */ - fillarea = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(fillarea, - MI_ROUND_LISTHEADERCOUNT(index_list_list->numLists)); - if (!(pddolist = fillarea->ddList)) { - status = BadAlloc; - goto exit; - } - - /* get next free facet list header */ - if (in_fct) { - fillareafacet = MI_NEXTTEMPFACETLIST(pddc); - MI_ALLOCLISTOFDDFACET(fillareafacet, 1, facet_size); - ddFill->pFacets = fillareafacet; - fillareafacet->type = input_facet->type; - fillareafacet->numFacets = 1; - out_fct = fillareafacet->facets.pNoFacet; - } - - /* Now, transform each list */ - for (j = 0; j < index_list_list->numLists; j++) { - /* - * Insure sufficient room for each vertex - */ - MI_ALLOCLISTOFDDPOINT(pddolist,index_list->numLists,out_point_size); - if (!(pddolist->pts.ptr)) { - status = BadAlloc; - goto exit; - } - - out_pt = pddolist->pts; - - index = index_list->pConnects; - - for (k = 0; k < index_list->numLists; k++) { - memcpy( out_pt.ptr, (in_pt+(*index * point_size)), point_size); - out_pt.ptr += point_size; - if (ddSOFAS->edgeAttribs) *(out_pt.pEdge++) = *(edge_ptr++); - index++; - } - - pddolist->numPoints = index_list->numLists; - - /* Prepare for next bound */ - pddolist++; - /* get indices for next bound */ - index_list++; - } - - /* Copy facet data for FAS */ - if (in_fct) { - memcpy( (char *)out_fct, (char *)in_fct, facet_size); - out_fct += facet_size; - in_fct += facet_size; - } - - /* Render fill area */ - ddFill->points.numLists = index_list_list->numLists; - ddFill->points.ddList = fillarea->ddList; - if (status=InitExecuteOCTable[(int)(pGStr->elementType)](pRend, pGStr)) - goto exit; - - index_list_list++; - } - -exit: - xfree(pGStr); - - return(status); - -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c:3.7 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c Sat Feb 28 21:41:54 2004 @@ -1,299 +0,0 @@ -/* $Xorg: miSearch.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miSearch.c,v 3.7 2001/12/14 19:57:30 dawes Exp $ */ - -#include "miWks.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miStruct.h" -#include "ddpex2.h" -#include "miFont.h" -#include "miText.h" -#include "miClip.h" -#include "pexos.h" - -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - -extern ocTableType InitExecuteOCTable[]; - -/* - * Function Name: compute_search_volume - * - * Purpose: Compute the intersection of the clip limits and the - * search aperture. The search aperture is defined as - * a cube centered around search position and search - * distance being the distance between the center and the - * faces of the cube. - * Return: - * search volume. - */ -ddpex2rtn -compute_search_volume(pDDC, search_volume) -/* in */ - miDDContext *pDDC; - -/* out */ -register ddNpcSubvolume *search_volume; /* Intersection to use */ -{ -/* calls */ - -/* Local variable definitions */ - ddCoord3D pos; - ddFLOAT dis; - - /* Get the search position and distance first */ - - pos = pDDC->Static.search.position; - dis = pDDC->Static.search.distance; - - if (dis <= 0.0) dis = 0.0001; /* Make sure we have the search volume */ - /* collapsing almost to reference point */ - /* when the distance is negative or zero*/ - - /* Compute a search volume centered around the search position and */ - /* of half width, half height, and half length equal to the search */ - /* distance. */ - - search_volume->minval.x = pos.x - dis; - search_volume->maxval.x = pos.x + dis; - - search_volume->minval.y = pos.y - dis; - search_volume->maxval.y = pos.y + dis; - - search_volume->minval.z = pos.z - dis; - search_volume->maxval.z = pos.z + dis; - - return (Success); -} - - -/* - * Function Name: compute_search_volume_xform - * - * Purpose: Compute the transformation that transform the primitive - * to be searched from search_volume to CC. Remember that we - * will use the standard primitive clipping functions to figure - * out whether a given primitive lies within the search aperture. - * Return: - * sv_to_cc_xform to be used to figure out search hits. - */ -void -compute_search_volume_xform(search_volume, sv_to_cc_xform) -/* in */ - ddNpcSubvolume *search_volume; -/* out */ - ddFLOAT sv_to_cc_xform[4][4]; -/* calls */ -{ - /* The transformation needed here is to go from search_volume to clip_ - * volume as shown in 2D below. We extend the transform to handle the 3D - * trivially. - * - * search_volume clip_volume - * ------------- ----------- - * - * +-----+(c,d) +---------+(1,1) - * | | | | - * | | =======> | | - * | | | | - * (a,b)+-----+ (-1,-1)+---------+ - * - * sv_to_cc_xform (2D): 2/(c-a) 0 (c+a)/(a-c) - * 0 2/(d-b) (d+b)/(b-d) - * 0 0 0 - */ - - memcpy( (char *)sv_to_cc_xform, (char *)ident4x4, 16 * sizeof(ddFLOAT)); - - /* Check for trivial search volume, I.E., a point or a cube with */ - /* zero dimensions. If so, initialize the transform to ? ? ? */ - - if (search_volume->maxval.x == search_volume->minval.x) { - - /* Plug in the special ? ? ? */ - - return; - } - - /* The search volume is NOT trivially a point; it is a finite */ - /* volume for which a transform can be computed to go to CC. */ - - sv_to_cc_xform[0][0] = - 2.0 / (search_volume->maxval.x - search_volume->minval.x); - sv_to_cc_xform[1][1] = - 2.0 / (search_volume->maxval.y - search_volume->minval.y); - sv_to_cc_xform[2][2] = - 2.0 / (search_volume->maxval.z - search_volume->minval.z); - sv_to_cc_xform[0][3] = - (search_volume->maxval.x + search_volume->minval.x) / - (search_volume->minval.x - search_volume->maxval.x); - sv_to_cc_xform[1][3] = - (search_volume->maxval.y + search_volume->minval.y) / - (search_volume->minval.y - search_volume->maxval.y); - sv_to_cc_xform[2][3] = - (search_volume->maxval.z + search_volume->minval.z) / - (search_volume->minval.z - search_volume->maxval.z); -} - - -/*++ - | - | Function Name: miSearchPrimitives - | - | Function Description: - | Handles the searching of most primitives in a generic fashion. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miSearchPrimitives(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ -/* calls */ - -/* Local variable definitions */ - miDDContext *pDDC = (miDDContext *)(pRend->pDDContext); - ddNpcSubvolume sv; - ddFLOAT buf1_xform[4][4]; - - /* Compute the search volume to do the ISS */ - - compute_search_volume (pDDC, &sv); - - /* Get the transform to go from search volume to CC - buf1_xform */ - - compute_search_volume_xform (&sv, buf1_xform); - - /* Get wc_to_cc_xform = (wc_to_npc_xform * buf1_xform) */ - - miMatMult (pDDC->Dynamic->wc_to_cc_xform, - pDDC->Dynamic->wc_to_npc_xform, buf1_xform); - - /* Get mc_to_cc_xform = (mc_to_wc_xform * wc_to_cc_xform) */ - - miMatMult (pDDC->Dynamic->mc_to_cc_xform, - pDDC->Dynamic->mc_to_wc_xform, - pDDC->Dynamic->wc_to_cc_xform); - - /* Now, call the level 2 rendering function to transform and */ - /* clip the primitive. Note that the level 1 function vector */ - /* now has PICKING routines instead of rendering routines. If*/ - /* a search is detected the GLOBAL FLAG will have been up- */ - /* dated. Check this flag to determine if anything was indeed*/ - /* searched by the level 1 searching routines. */ - - InitExecuteOCTable[(int)(pExecuteOC->elementType)] - (pRend, pExecuteOC); - - /* If successful PICK, set the search status flag */ - - if (pDDC->Static.pick.status == PEXOk) - pDDC->Static.search.status = PEXFound; - - return (Success); -} - - -/*++ - | - | Function Name: miTestSearchGdp3d - | - | Function Description: - | Provides the dummy test routine for searching 3d Gdps. - | with data OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miTestSearchGdp3d(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - ErrorF ("miTestSearchGdp3d\n"); - return (Success); -} - - -/*++ - | - | Function Name: miTestSearchGdp2d - | - | Function Description: - | Provides the dummy test routine for searching 2d Gdps. - | with data OCs. - | - | Note(s): - | - ++*/ - -ddpex2rtn -miTestSearchGdp2d(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - ErrorF ("miSearchPickGdp2d\n"); - return (Success); -} - - - - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miTestOCs.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miTestOCs.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miTestOCs.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miTestOCs.c:1.9 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miTestOCs.c Sat Feb 28 21:41:54 2004 @@ -1,273 +0,0 @@ -/* $Xorg: miTestOCs.c,v 1.4 2001/02/09 02:04:10 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#include "mipex.h" -#include "ddpex3.h" -#include "miStruct.h" -#include "miRender.h" -#include "PEXErr.h" -#include "PEXprotost.h" - - -/* Level III Output Command Primitives */ - -static char *ptTypeNames[] = { - "DD_2D_POINT", /* 2D point */ - "DD_3D_POINT", /* 3D point */ - "DD_INDEX_POINT", /* 3D point w/ colour */ - "DD_RGB8_POINT", /* 3D point w/ colour */ - "DD_RGB16_POINT", /* 3D point w/ colour */ - "DD_RGBFLOAT_POINT", /* 3D point w/ colour */ - "DD_HSV_POINT", /* 3D point w/ colour */ - "DD_HLS_POINT", /* 3D point w/ colour */ - "DD_CIE_POINT", /* 3D point w/ colour */ - "DD_NORM_POINT", /* 3D point w/ normal */ - "DD_EDGE_POINT", /* 3D point w/ edge flag */ - "DD_INDEX_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_RGB8_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_RGB16_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_RGBFLOAT_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_HSV_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_HLS_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_CIE_NORM_POINT", /* 3D point w/ colour & normal */ - "DD_INDEX_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_RGB8_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_RGB16_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_RGBFLOAT_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_HSV_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_HLS_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_CIE_EDGE_POINT", /* 3D point w/ colour & edge flag */ - "DD_NORM_EDGE_POINT", /* 3D point w/ normal & edge flag */ - "DD_INDEX_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_RGB8_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_RGB16_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_RGBFLOAT_NORM_EDGE_POINT",/* 3D point w/ colour, normal & edge */ - "DD_HSV_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_HLS_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_CIE_NORM_EDGE_POINT", /* 3D point w/ colour, normal & edge */ - "DD_HOMOGENOUS_POINT" /* homogenous point (4D) */ -}; - -static char *pfTypeNames[] = { - "DD_FACET_NONE", /* no facet attributes */ - "DD_FACET_INDEX", /* facet colour */ - "DD_FACET_RGB8", /* facet colour */ - "DD_FACET_RGB16", /* facet colour */ - "DD_FACET_RGBFLOAT", /* facet colour */ - "DD_FACET_HSV", /* facet colour */ - "DD_FACET_HLS", /* facet colour */ - "DD_FACET_CIE", /* facet colour */ - "DD_FACET_NORM", /* facet normal */ - "DD_FACET_INDEX_NORM", /* facet colour & normal */ - "DD_FACET_RGB8_NORM", /* facet colour & normal */ - "DD_FACET_RGB16_NORM", /* facet colour & normal */ - "DD_FACET_RGBFLOAT_NORM", /* facet colour & normal */ - "DD_FACET_HSV_NORM", /* facet colour & normal */ - "DD_FACET_HLS_NORM", /* facet colour & normal */ - "DD_FACET_CIE_NORM" /* facet colour & normal */ -}; - -static char *piTypeNames[] = { - "DD_VERTEX", - "DD_VERTEX_EDGE" -}; - -static int test_print_flag = 0; - -#define PRINT_POINT_INFO( pt ) \ -\ - ErrorF( "\tPoint Type: %d %s\tNum Lists: %d\n", \ - (pt)->type, ptTypeNames[(int)((pt)->type)], (pt)->numLists ) - -#define PRINT_FACET_INFO( pf ) \ -\ - ErrorF( "\tFacet Type: %d %s\tNum Facets: %d\n", \ - (pf)->type, pfTypeNames[(int)((pf)->type)], (pf)->numFacets ) - -#define PRINT_INDEX_INFO( pi ) \ -\ - ErrorF( "\tIndex Type: %d %s\tNum Index: %d\n", \ - (pi)->type, piTypeNames[(int)((pi)->type)], (pi)->numIndex ) - -/*++ - | - | Function Name: miTestNurbSurface - | - | Function Description: - | Handles the Non-uniform B-spline surfac ocs. - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestNurbSurface(pRend, pSurf, numCurves, pTrimCurve) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - ddNurbSurface *pSurf; /* surface data */ - ddULONG numCurves;/* number of trim curves */ - listofTrimCurve *pTrimCurve; /* trim curve */ -/* out */ -{ - if (test_print_flag) ErrorF( "miTestNurbSurface\n"); - return (Success); -} - -/*++ - | - | Function Name: miTestCellArrays - | - | Function Description: - | Handles the Cell array 3D, Cell array 2D ocs. - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestCellArrays(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - if (test_print_flag) ErrorF( "miTestCellArrays\n"); - return (Success); -} - -/*++ - | - | Function Name: miTestExtCellArray - | - | Function Description: - | Handles the Extended Cell array ocs - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestExtCellArray(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - if (test_print_flag) ErrorF( "miTestExtCellArray\n"); - return (Success); -} - -/*++ - | - | Function Name: miTestGDP - | - | Function Description: - | Handles the GDP 3D, GDP 2D ocs. - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestGDP(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - if (test_print_flag) ErrorF( "miTestGDP\n"); - return (Success); -} - -/*++ - | - | Function Name: miTestSetAttribute - | - | Function Description: - | Handles the All Other ocs (to set attributes). - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestSetAttribute(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; /* output command */ -/* out */ -{ - if (test_print_flag) ErrorF( "miTestSetAttribute\n"); - return (Success); -} - - - -/*++ - | - | Function Name: miTestColourOC - | - | Function Description: - | Handles the Colour setting OC's. - | - | Note(s): - | - --*/ - -ddpex2rtn -miTestColourOC(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - if (test_print_flag) ErrorF( "miTestColourOC\n"); - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c:3.8 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c Sat Feb 28 21:41:54 2004 @@ -1,2172 +0,0 @@ -/* $Xorg: miText.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miText.c,v 3.8 2001/12/14 19:57:30 dawes Exp $ */ - -#include "miLUT.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "ddpex3.h" -#include "ddpex2.h" -#include "miRender.h" -#include "miFont.h" -#include "miText.h" -#include "miClip.h" -#include "gcstruct.h" -#include "pexos.h" - -#ifndef PADDING -#define PADDING(n) ( (n)%4 ? (4 - ((n)%4)) : 0) -#endif - -extern ddpex3rtn ComputeMCVolume(); - -ddpex2rtn -tx_el_to_path(pRend, pddc, numFragments, pString, numChars, tx_el, - align_pt, count_ret) -/* in */ - ddRendererPtr pRend; /* Renderer handle */ - miDDContext *pddc; /* Context handle */ - ddUSHORT numFragments; /* # of mono encodings */ - pexMonoEncoding *pString; /* Pointer to ISTRING */ - ddULONG numChars; /* Total # of chars in ISTRING */ -/* out */ - miTextElement *tx_el; /* text element data */ - ddCoord2D *align_pt; /* text alignment */ - ddULONG *count_ret; /* return character count */ -{ -/* Define required temporary variables */ - - miCharPath *CharPtr; - ddUSHORT fontIndex; - ddUSHORT path; - ddFLOAT expansion; - ddFLOAT spacing; - ddTextAlignmentData *pAlignment; - diLUTHandle fontTable; - register ddPointer ptr, save_ptr; - miTextFontEntry *ptr1; - pexMonoEncoding *mono_enc; - int fragnum, charnum, some_characters, signum, bytes; - CARD32 charval; - diFontHandle font_handle; - miFontHeader *font; - Ch_stroke_data *char_data; - ddFLOAT sp; - Meta_font meta_font; - pexCoord2D cur, end, cpt; - float xmin, xmax, ymin, ymax; - ddTextFontEntry *fontEntry; - ddUSHORT es, clip_mode; - extern void micalc_cpt_and_align(); - - *count_ret = 0; - - fontIndex = pddc->Static.attrs->textFont; - expansion = ABS(pddc->Static.attrs->charExpansion); - spacing = pddc->Static.attrs->charSpacing; - path = pddc->Static.attrs->textPath; - sp = spacing * FONT_COORD_HEIGHT; - pAlignment = &(pddc->Static.attrs->textAlignment); - - /* Get the handle for font table */ - - fontTable = pRend->lut[PEXTextFontLUT]; - - /* Inquire the Font table to get the ddTextFontEntry member */ - - if ((InquireLUTEntryAddress (PEXTextFontLUT, fontTable, fontIndex, &es, - (ddPointer *)&ptr1)) == PEXLookupTableError) - return (PEXLookupTableError); - - fontEntry = &ptr1->entry; - - /* Allocate space for stroke definitions of all chars in ISTRING */ - - if (!((tx_el->paths) = (miCharPath *) xalloc(numChars * - sizeof(miCharPath)))) - return (BadAlloc); - - /* signum is used later on to encapsulate addition vs. subtraction */ - - if (path == PEXPathRight || path == PEXPathUp) - signum = 1; - else - signum = -1; - - ptr = (ddPointer) pString; - - /* Process the input ISTRING */ - - meta_font.top = -1.0e20; - meta_font.bottom = 1.0e20; - meta_font.width = 1.0e-20; - - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = 0.0; - cur.x = end.x = cur.y = end.y = 0.0; - - some_characters = 0; /* Make TRUE when a valid character is found */ - - save_ptr = ptr; /* Save this for later use */ - - /* First determine the largest character box size within ISTRING */ - /* Do for each MONO_ENCODING fragment within the ISTRING */ - - for (fragnum = 0; fragnum < numFragments; fragnum++) { - - mono_enc = (pexMonoEncoding *)ptr; - ptr += sizeof(pexMonoEncoding); - - if (mono_enc->characterSet < 1 || - mono_enc->characterSet > fontEntry->numFonts) - mono_enc->characterSet = 1; - - font_handle = fontEntry->fonts[mono_enc->characterSet - 1]; - - /* This is the font that this MONO_ENCODING would be rendered with */ - - font = (miFontHeader *)(font_handle->deviceData); - - /* Bump up ISTRINGS extremes if appropriate */ - - if (font->top > meta_font.top) - meta_font.top = font->top; - if (font->bottom < meta_font.bottom) - meta_font.bottom = font->bottom; - if (font->max_width > meta_font.width) - meta_font.width = font->max_width; - - bytes = mono_enc->numChars * - ((mono_enc->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((mono_enc->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - - ptr += (bytes + PADDING (bytes)); - } - - /* Now get the character definition and the required per character */ - /* translation component required to be applied during rendering. */ - - ptr = save_ptr; /* Restore the ptr */ - CharPtr = tx_el->paths; /* Initialize the pointer to character data */ - - for (fragnum = 0; fragnum < numFragments; fragnum++) { - - mono_enc = (pexMonoEncoding *)ptr; - ptr += sizeof(pexMonoEncoding); - - font_handle = fontEntry->fonts[mono_enc->characterSet - 1]; - font = (miFontHeader *)(font_handle->deviceData); - - /* Do for each character within the MONO_ENCODING */ - - for (charnum = 0; charnum < mono_enc->numChars; charnum++) { - - switch (mono_enc->characterSetWidth) { - case PEXCSByte : - charval = (CARD32)(*(CARD8 *)ptr); - ptr += sizeof(CARD8); - break; - case PEXCSShort : - charval = (CARD32)(*(CARD16 *)ptr); - ptr += sizeof(CARD16); - break; - case PEXCSLong : - charval = *(CARD32 *)ptr; - ptr += sizeof(CARD32); - break; - } - - if (!(font->ch_data[charval])) /* undefined character */ - if (font->font_info.defaultGlyph == 0 && - font->font_info.firstGlyph > 0) /* no default */ - /* no extent info is calculated for undefined indices - * in charsets where there is no default glyph */ - continue; - else - charval = font->font_info.defaultGlyph; - - some_characters = 1; - char_data = font->ch_data[charval]; /* Get strokes for char */ - - switch (path) { - - case PEXPathRight : - case PEXPathLeft : - end.x = cur.x + signum*(char_data->right)*expansion; - if (cur.x > xmax) xmax = cur.x; - if (cur.x < xmin) xmin = cur.x; - if (end.x > xmax) xmax = end.x; - if (end.x < xmin) xmin = end.x; - cur.x = end.x + signum * sp; - break; - - case PEXPathUp : - case PEXPathDown : - end.y = cur.y + signum * (meta_font.top - - meta_font.bottom); - if (cur.y > ymax) ymax = cur.y; - if (cur.y < ymin) ymin = cur.y; - if (end.y > ymax) ymax = end.y; - if (end.y < ymin) ymin = end.y; - cur.y = end.y + signum * sp; - cur.x += -char_data->right * 0.5 * expansion; - break; - } - - /* Save the stroke definitions for the character */ - - CharPtr->path = &(char_data->strokes); - - /* Save the translation per character */ - - (CharPtr->trans).x = cur.x; - (CharPtr->trans).y = cur.y; - - /* Set cur.x back to lower left corner of character box */ - /* for the cases of PEXPathUp and PEXPathDown. */ - - if (path==PEXPathUp || path==PEXPathDown) - cur.x -= -char_data->right * 0.5 * expansion; - - CharPtr++; (*count_ret)++; /* Update pointer and count */ - - } /* for each character */ - - ptr += PADDING(mono_enc->numChars * - ((mono_enc->characterSetWidth == PEXCSByte) - ? sizeof(CARD8) - : ((mono_enc->characterSetWidth == PEXCSShort) - ? sizeof(CARD16) - : sizeof(CARD32)))); - - } /* for each MONO_ENCODING (fragment) */ - - /* Compute the alignment and concatenation point; however, */ - /* the concatenation point (cpt) can be ignored here ! */ - - if (some_characters) { - - micalc_cpt_and_align(&meta_font, &xmin, &xmax, &ymin, &ymax, path, - expansion, pAlignment, &cpt, align_pt); - - } else { - /* no valid characters */ - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = align_pt->x = align_pt->y = 0.0; - } - - return (Success); -} - - -ddpex2rtn -atx_el_to_path(pRend, pddc, numFragments, pString, numChars, tx_el, - align_pt, count_ret) -/* in */ - ddRendererPtr pRend; /* Renderer handle */ - miDDContext *pddc; /* Context handle */ - ddUSHORT numFragments; /* # of mono encodings */ - pexMonoEncoding *pString; /* Pointer to ISTRING */ - ddULONG numChars; /* Total # of chars in ISTRING */ -/* out */ - miTextElement *tx_el; /* text element data */ - ddCoord2D *align_pt; /* text alignment */ - ddULONG *count_ret; /* return character count */ -{ -/* Define required temporary variables */ - - miCharPath *CharPtr; - ddUSHORT fontIndex; - ddUSHORT path; - ddFLOAT expansion; - ddFLOAT spacing; - ddTextAlignmentData *pAlignment; - diLUTHandle fontTable; - register ddPointer ptr, save_ptr; - miTextFontEntry *ptr1; - pexMonoEncoding *mono_enc; - int fragnum, charnum, some_characters, signum, bytes; - CARD32 charval; - diFontHandle font_handle; - miFontHeader *font; - Ch_stroke_data *char_data; - ddFLOAT sp; - Meta_font meta_font; - pexCoord2D cur, end, cpt; - float xmin, xmax, ymin, ymax; - ddTextFontEntry *fontEntry; - ddUSHORT es; - extern void micalc_cpt_and_align(); - - *count_ret = 0; - - fontIndex = pddc->Static.attrs->textFont; - expansion = ABS(pddc->Static.attrs->charExpansion); - spacing = pddc->Static.attrs->charSpacing; - path = pddc->Static.attrs->atextPath; - sp = spacing * FONT_COORD_HEIGHT; - pAlignment = &(pddc->Static.attrs->atextAlignment); - - /* Get the handle for font table */ - - fontTable = pRend->lut[PEXTextFontLUT]; - - /* Inquire the Font table to get the ddTextFontEntry member */ - - if ((InquireLUTEntryAddress (PEXTextFontLUT, fontTable, fontIndex, &es, - (ddPointer *)&ptr1)) == PEXLookupTableError) - return (PEXLookupTableError); - - fontEntry = &ptr1->entry; - - /* Allocate space for stroke definitions of all chars in ISTRING */ - - if (!((tx_el->paths) = (miCharPath *) xalloc(numChars * - sizeof(miCharPath)))) - return (BadAlloc); - - /* signum is used later on to encapsulate addition vs. subtraction */ - - if (path == PEXPathRight || path == PEXPathUp) - signum = 1; - else - signum = -1; - - ptr = (ddPointer) pString; - - /* Process the input ISTRING */ - - meta_font.top = -1.0e20; - meta_font.bottom = 1.0e20; - meta_font.width = 1.0e-20; - - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = 0.0; - cur.x = end.x = cur.y = end.y = 0.0; - - some_characters = 0; /* Make TRUE when a valid character is found */ - - save_ptr = ptr; /* Save this for later use */ - - /* First determine the largest character box size within ISTRING */ - /* Do for each MONO_ENCODING fragment within the ISTRING */ - - for (fragnum = 0; fragnum < numFragments; fragnum++) { - - mono_enc = (pexMonoEncoding *)ptr; - ptr += sizeof(pexMonoEncoding); - - if (mono_enc->characterSet < 1 || - mono_enc->characterSet > fontEntry->numFonts) - mono_enc->characterSet = 1; - - font_handle = fontEntry->fonts[mono_enc->characterSet - 1]; - - /* This is the font that this MONO_ENCODING would be rendered with */ - - font = (miFontHeader *)(font_handle->deviceData); - - /* Bump up ISTRINGS extremes if appropriate */ - - if (font->top > meta_font.top) - meta_font.top = font->top; - if (font->bottom < meta_font.bottom) - meta_font.bottom = font->bottom; - if (font->max_width > meta_font.width) - meta_font.width = font->max_width; - - bytes = mono_enc->numChars * - ((mono_enc->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((mono_enc->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - - ptr += (bytes + PADDING (bytes)); - } - - /* Now get the character definition and the required per character */ - /* translation component required to be applied during rendering. */ - - ptr = save_ptr; /* Restore the ptr */ - CharPtr = tx_el->paths; /* Initialize the pointer to character data */ - - for (fragnum = 0; fragnum < numFragments; fragnum++) { - - mono_enc = (pexMonoEncoding *)ptr; - ptr += sizeof(pexMonoEncoding); - - font_handle = fontEntry->fonts[mono_enc->characterSet - 1]; - font = (miFontHeader *)(font_handle->deviceData); - - /* Do for each character within the MONO_ENCODING */ - - for (charnum = 0; charnum < mono_enc->numChars; charnum++) { - - switch (mono_enc->characterSetWidth) { - case PEXCSByte : - charval = (CARD32)(*(CARD8 *)ptr); - ptr += sizeof(CARD8); - break; - case PEXCSShort : - charval = (CARD32)(*(CARD16 *)ptr); - ptr += sizeof(CARD16); - break; - case PEXCSLong : - charval = *(CARD32 *)ptr; - ptr += sizeof(CARD32); - break; - } - - if (!(font->ch_data[charval])) /* undefined character */ - if (font->font_info.defaultGlyph == 0 && - font->font_info.firstGlyph > 0) /* no default */ - /* no extent info is calculated for undefined indices - * in charsets where there is no default glyph */ - continue; - else - charval = font->font_info.defaultGlyph; - - some_characters = 1; - char_data = font->ch_data[charval]; /* Get strokes for char */ - - switch (path) { - - case PEXPathRight : - case PEXPathLeft : - end.x = cur.x + signum*(char_data->right)*expansion; - if (cur.x > xmax) xmax = cur.x; - if (cur.x < xmin) xmin = cur.x; - if (end.x > xmax) xmax = end.x; - if (end.x < xmin) xmin = end.x; - cur.x = end.x + signum * sp; - break; - - case PEXPathUp : - case PEXPathDown : - end.y = cur.y + signum * (meta_font.top - - meta_font.bottom); - if (cur.y > ymax) ymax = cur.y; - if (cur.y < ymin) ymin = cur.y; - if (end.y > ymax) ymax = end.y; - if (end.y < ymin) ymin = end.y; - cur.y = end.y + signum * sp; - cur.x += -char_data->right * 0.5 * expansion; - break; - } - - /* Save the stroke definitions for the character */ - - CharPtr->path = &(char_data->strokes); - - /* Save the translation per character */ - - (CharPtr->trans).x = cur.x; - (CharPtr->trans).y = cur.y; - - /* Set cur.x back to lower left corner of character box */ - /* for the cases of PEXPathUp and PEXPathDown. */ - - if (path==PEXPathUp || path==PEXPathDown) - cur.x -= -char_data->right * 0.5 * expansion; - - CharPtr++; (*count_ret)++; /* Update pointer and count */ - - } /* for each character */ - - ptr += PADDING(mono_enc->numChars * - ((mono_enc->characterSetWidth == PEXCSByte) - ? sizeof(CARD8) - : ((mono_enc->characterSetWidth == PEXCSShort) - ? sizeof(CARD16) - : sizeof(CARD32)))); - - } /* for each MONO_ENCODING (fragment) */ - - /* Compute the alignment and concatenation point; however, */ - /* the concatenation point (cpt) can be ignored here ! */ - - if (some_characters) { - - micalc_cpt_and_align(&meta_font, &xmin, &xmax, &ymin, &ymax, path, - expansion, pAlignment, &cpt, align_pt); - - } else { - /* no valid characters */ - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = align_pt->x = align_pt->y = 0.0; - } - - return (Success); -} - - -void -text2_xform( pos, attrs, align, xf, aflag) - ddCoord2D *pos; - miDDContextRendAttrs *attrs; - ddVector2D *align; - register ddFLOAT xf[4][4]; - ddUSHORT aflag; -{ - ddFLOAT ht_scale, inv_mag; - ddCoord2D vup; - ddCoord2D vbase; - register ddFLOAT a, b; - ddFLOAT temp[4][4], temp1[4][4]; - - /* Get the text or annotation text attribute values */ - - if (aflag == 0) { - ht_scale = ABS(attrs->charHeight / HEIGHT); - vup.x = attrs->charUp.x; - vup.y = attrs->charUp.y; - } - else { - ht_scale = ABS(attrs->atextHeight / HEIGHT); - vup.x = attrs->atextUp.x; - vup.y = attrs->atextUp.y; - } - - inv_mag = 1.0 / sqrt( vup.x * vup.x + vup.y * vup.y); - vup.x *= inv_mag; - vup.y *= inv_mag; - - /* Compute base vector = up vector rotated by 90 in Z */ - - vbase.x = vup.y; - vbase.y = -vup.x; - - inv_mag = 1.0 / sqrt( vbase.x * vbase.x + vbase.y * vbase.y); - vbase.x *= inv_mag; - vbase.y *= inv_mag; - - a = -ht_scale * align->x; - b = -ht_scale * align->y; - - /* Initialize temp to identity */ - - miMatIdent (temp); - - /* Store the scaling components */ - - temp[0][0] = temp[1][1] = ht_scale; - - /* Store the translation components */ - - temp[0][3] = a; - temp[1][3] = b; - - /* Let temp1 hold the base vector, the up vector, and the - text position. */ - - temp1[0][0] = vbase.x; - temp1[0][1] = vup.x; - temp1[0][2] = 0.0; - temp1[0][3] = pos->x; - - temp1[1][0] = vbase.y; - temp1[1][1] = vup.y; - temp1[1][2] = 0.0; - temp1[1][3] = pos->y; - - temp1[2][0] = temp1[3][0] = 0.0; - temp1[2][1] = temp1[3][1] = 0.0; - temp1[2][2] = temp1[3][3] = 1.0; - temp1[2][3] = 0.0; - temp1[3][2] = 0.0; - - miMatMult( xf, temp, temp1 ); -} - - -void -text3_xform( pos, u, v, attrs, align, xf, aflag) - ddCoord3D *pos; - register ddVector3D *u, *v; - miDDContextRendAttrs *attrs; - ddVector2D *align; - register ddFLOAT xf[4][4]; - ddUSHORT aflag; -{ - ddFLOAT ht_scale, inv_mag; - ddCoord3D vup; - ddCoord3D vbase; - register ddFLOAT a, b; - ddFLOAT temp[4][4], temp1[4][4]; - ddFLOAT temp2[4][4], temp3[4][4]; - ddVector3D e_one, e_two, e_three; - register ddVector3D *e3 = &e_three, *e2 = &e_two, *e1 = &e_one; - - /* Get the text or annotation text attribute values */ - - if (aflag == 0) { - ht_scale = ABS(attrs->charHeight / HEIGHT); - vup.x = attrs->charUp.x; - vup.y = attrs->charUp.y; - vup.z = 0.0; - } - else { - ht_scale = ABS(attrs->atextHeight / HEIGHT); - vup.x = attrs->atextUp.x; - vup.y = attrs->atextUp.y; - vup.z = 0.0; - } - - inv_mag = 1.0 / sqrt( vup.x * vup.x + vup.y * vup.y); - vup.x *= inv_mag; - vup.y *= inv_mag; - - /* Compute base vector = up vector rotated by 90 in Z */ - - vbase.x = vup.y; - vbase.y = -vup.x; - vbase.z = 0.0; - - inv_mag = 1.0 / sqrt( vbase.x * vbase.x + vbase.y * vbase.y); - vbase.x *= inv_mag; - vbase.y *= inv_mag; - - a = -align->x * ht_scale; - b = -align->y * ht_scale; - - /* Initialize temp to identity */ - - miMatIdent (temp); - - /* Store the scaling components */ - - temp[0][0] = temp[1][1] = ht_scale; - - /* Store the translation components */ - - temp[0][3] = a; - temp[1][3] = b; - - /* Let temp1 hold the base vector and the up vector */ - - temp1[0][0] = vbase.x; - temp1[0][1] = vup.x; - temp1[0][2] = 0.0; - temp1[0][3] = 0.0; - - temp1[1][0] = vbase.y; - temp1[1][1] = vup.y; - temp1[1][2] = 0.0; - temp1[1][3] = 0.0; - - temp1[2][0] = temp1[3][0] = 0.0; - temp1[2][1] = temp1[3][1] = 0.0; - temp1[2][2] = temp1[3][3] = 1.0; - temp1[2][3] = 0.0; - temp1[3][2] = 0.0; - - /* e3 is the cross-product of direction vectors u and v */ - - e3->x = u->y * v->z - u->z * v->y; - e3->y = u->z * v->x - u->x * v->z; - e3->z = u->x * v->y - u->y * v->x; - - inv_mag = sqrt(e3->x * e3->x + e3->y * e3->y + e3->z * e3->z); - - /* See if the direction is valid or if we can get by with a 2D - transform, i.e. if u and v are collinear. */ - - if ( MI_ZERO_MAG( inv_mag) ) { - miMatMult( xf, temp, temp1 ); - - } else { /* Build a 3D transform. */ - -/* The rotation matrix, temp2, for orienting the text - coordinate space consists of the row vectors, e1, e2 and e3, - and the position. */ - -/* Normalized vector e3 is row 3 of the rotation matrix */ - - inv_mag = 1.0 / inv_mag; - temp2[0][2] = e3->x*inv_mag; - temp2[1][2] = e3->y*inv_mag; - temp2[2][2] = e3->z*inv_mag; - temp2[3][2] = 0.0; - -/* e1 is the normalized u vector and is row 1 of the rotation - matrix. */ - - inv_mag = 1.0 / sqrt(u->x * u->x + u->y * u->y + u->z * u->z); - temp2[0][0] = e1->x = u->x * inv_mag; - temp2[1][0] = e1->y = u->y * inv_mag; - temp2[2][0] = e1->z = u->z * inv_mag; - temp2[3][0] = 0.0; - -/* e2 is the normalized v vector, (u X v) X u, and is row 2 - of the rotation matrix. */ - - e2->x = e3->y * e1->z - e3->z * e1->y; - e2->y = e3->z * e1->x - e3->x * e1->z; - e2->z = e3->x * e1->y - e3->y * e1->x; - inv_mag = 1.0 / sqrt(e2->x * e2->x + e2->y * e2->y + e2->z * e2->z); - temp2[0][1] = (e2->x *= inv_mag); - temp2[1][1] = (e2->y *= inv_mag); - temp2[2][1] = (e2->z *= inv_mag); - temp2[3][1] = 0.0; - - temp2[0][3] = pos->x; - temp2[1][3] = pos->y; - temp2[2][3] = pos->z; - temp2[3][3] = 1.0; - -/* The final transformation matrix, xf, is the product of the - 3 matrices: temp2 x temp1 x temp. */ - - miMatMult( temp3, temp1, temp2 ); - miMatMult( xf, temp, temp3 ); - } -} - - -/*++ - | - | Function Name: miText3D - | - | Function Description: - | Handles the Text 3D ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miText3D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ -/* local */ - miTextStruct *ddText = (miTextStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddUSHORT numEncodings = ddText->numEncodings; - ddCoord3D *pOrigin = ddText->pOrigin; /* string origin */ - ddCoord3D *pDirections = ddText->pDirections;/* orientation */ - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - -/* Define required temporary variables */ - - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_cc_xform[4][4]; - ddFLOAT tc_to_mc_xform[4][4]; - ddFLOAT buf_xform[4][4]; - miDDContext *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first; - int i, j, k; - int count; /* Count of characters to be rendered */ - ddFLOAT ei0cc, ei1cc, ei3cc; - ddFLOAT ei0mc, ei1mc, ei3mc; - miCharPath *save_ptr; - miListHeader *mc_path, *mclip_path, *cc_path, *clip_path, *dc_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag, clip_mode; - - /* Set the annotation text flag to zero */ - - aflag = 0; - - /* Get the DDContext handle for local use */ - - pddc = (miDDContext *)pRend->pDDContext; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - return (Success); - - - /* Convert text string into required paths */ - - if ((status = tx_el_to_path (pRend, pddc, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text3_xform (pOrigin, pDirections, (pDirections+1), - pddc->Static.attrs, &align, text_el.xform, aflag); - - /* Render the paths in text_el as polylines */ - - /* Set up the new composite transform first */ - - miMatMult (buf_xform, text_el.xform, - pddc->Dynamic->mc_to_cc_xform); - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pddc->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - /* Check for modelling clip and set up the volume if required */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - ComputeMCVolume(pRend, pddc); /* Get the current model clip volume */ - } - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the text */ - /* path is Up or Down. If so, we need to modify tx by the first */ - /* character translation to align with the rest of the characters*/ - /* in the string. */ - - if ((pddc->Static.attrs->textPath == PEXPathUp || - pddc->Static.attrs->textPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE FIRST */ - /* CHARACTER IN THE STRING. ptx FOR ALL OTHER CHARACTERS WILL BE */ - /* RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE REQUIRED */ - /* EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS NOT A PROBLEM HERE*/ - /* SINCE WE NEED THIS SPECIAL CASE ONLY FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE OF += */ - - /* Check to see if the text path is Left. If so, we need to modify */ - /* tx by the first character width so as to start the string to the*/ - /* left of the text origin. */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to get */ - /* just the character width. */ - - ptx_first += (pddc->Static.attrs->charSpacing) * FONT_COORD_HEIGHT; - } - - if (pddc->Static.attrs->textPath == PEXPathLeft) - tx += ptx_first; - - /* Check to see if modelling clip is required. If so, apply it */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Buffer the tc_to_mc_xform first */ - - memcpy( (char *)tc_to_mc_xform, (char *)text_el.xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0mc = tc_to_mc_xform[i][0]; - ei1mc = tc_to_mc_xform[i][1]; - ei3mc = tc_to_mc_xform[i][3]; - /* Modify the transform */ - tc_to_mc_xform[i][0] = exp * ei0mc; - tc_to_mc_xform[i][3] = tx * ei0mc + ty * ei1mc + ei3mc; - } - /* Transform the character strokes into Model space */ - - if (status = miTransform(pddc, text_el.paths->path, &mc_path, - tc_to_mc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - if (status = miClipPolyLines(pddc, mc_path, &mclip_path, MI_MCLIP)) - return (status); - - } - else { - mclip_path = text_el.paths->path; - } - - /* Buffer the tc_to_cc_xform first */ - - memcpy( (char *)tc_to_cc_xform, (char *)buf_xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0cc = tc_to_cc_xform[i][0]; - ei1cc = tc_to_cc_xform[i][1]; - ei3cc = tc_to_cc_xform[i][3]; - /* Modify the transform */ - tc_to_cc_xform[i][0] = exp * ei0cc; - tc_to_cc_xform[i][3] = tx * ei0cc + ty * ei1cc + ei3cc; - } - - /* Transform and clip the paths corresponding to current character */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Note that we are already in Model space here */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - else { - - /* Note that we are still in text local space here ! */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - tc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* if nothing left, then update pointers and continue */ - if (clip_path->numLists <= 0) { - text_el.paths++; - continue; - } - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Text to screen */ - - pddc->Static.RenderProcs[TEXT_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - /* Update the pointer to next character */ - - text_el.paths++; - } - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - -/*++ - | - | Function Name: miText2D - | - | Function Description: - | Handles the Text 2D ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miText2D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ -/* local */ - miText2DStruct *ddText = (miText2DStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddCoord2D *pOrigin = ddText->pOrigin; /* string origin */ - ddUSHORT numEncodings = ddText->numEncodings; - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - -/* Define required temporary variables */ - - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_cc_xform[4][4]; - ddFLOAT tc_to_mc_xform[4][4]; - ddFLOAT buf_xform[4][4]; - miDDContext *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first; - int i, j, k; - int count; /* Count of characters to be rendered */ - ddFLOAT ei0cc, ei1cc, ei3cc; - ddFLOAT ei0mc, ei1mc, ei3mc; - miCharPath *save_ptr; - miListHeader *mc_path, *mclip_path, *cc_path, *clip_path, *dc_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag, clip_mode; - - /* Set the annotation text flag to zero */ - - aflag = 0; - - /* Get the DDContext handle for local use */ - - pddc = (miDDContext *)pRend->pDDContext; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - return (Success); - - - /* Convert text string into required paths */ - - if ((status = tx_el_to_path (pRend, pddc, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text2_xform (pOrigin, pddc->Static.attrs, &align, text_el.xform, aflag); - - /* Render the paths in text_el as polylines */ - - /* Set up the new composite transform first */ - - miMatMult (buf_xform, text_el.xform, - pddc->Dynamic->mc_to_cc_xform); - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pddc->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - /* Check for modelling clip and set up the volume if required */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - ComputeMCVolume(pRend, pddc); /* Get the current model clip volume */ - } - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the text */ - /* path is Up or Down. If so, we need to modify tx by the first */ - /* character translation to align with the rest of the characters*/ - /* in the string. */ - - if ((pddc->Static.attrs->textPath == PEXPathUp || - pddc->Static.attrs->textPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE FIRST */ - /* CHARACTER IN THE STRING. ptx FOR ALL OTHER CHARACTERS WILL BE */ - /* RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE REQUIRED */ - /* EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS NOT A PROBLEM HERE*/ - /* SINCE WE NEED THIS SPECIAL CASE ONLY FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE OF += */ - - /* Check to see if the text path is Left. If so, we need to modify */ - /* tx by the first character width so as to start the string to the*/ - /* left of the text origin. */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to get */ - /* just the character width. */ - - ptx_first += (pddc->Static.attrs->charSpacing) * FONT_COORD_HEIGHT; - } - - if (pddc->Static.attrs->textPath == PEXPathLeft) - tx += ptx_first; - - /* Check to see if modelling clip is required. If so, apply it */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Buffer the tc_to_mc_xform first */ - - memcpy( (char *)tc_to_mc_xform, (char *)text_el.xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0mc = tc_to_mc_xform[i][0]; - ei1mc = tc_to_mc_xform[i][1]; - ei3mc = tc_to_mc_xform[i][3]; - /* Modify the transform */ - tc_to_mc_xform[i][0] = exp * ei0mc; - tc_to_mc_xform[i][3] = tx * ei0mc + ty * ei1mc + ei3mc; - } - /* Transform the character strokes into Model space */ - - if (status = miTransform(pddc, text_el.paths->path, &mc_path, - tc_to_mc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - if (status = miClipPolyLines(pddc, mc_path, &mclip_path, MI_MCLIP)) - return (status); - } - else { - mclip_path = text_el.paths->path; - } - - /* Buffer the tc_to_cc_xform first */ - - memcpy( (char *)tc_to_cc_xform, (char *)buf_xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0cc = tc_to_cc_xform[i][0]; - ei1cc = tc_to_cc_xform[i][1]; - ei3cc = tc_to_cc_xform[i][3]; - /* Modify the transform */ - tc_to_cc_xform[i][0] = exp * ei0cc; - tc_to_cc_xform[i][3] = tx * ei0cc + ty * ei1cc + ei3cc; - } - - /* Transform and clip the paths corresponding to current character */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Note that we are already in Model space here */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - } - else { - - /* Note that we are still in text local space here ! */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - tc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* if nothing left, then update pointers and continue */ - if (clip_path->numLists <= 0) { - text_el.paths++; - continue; - } - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Text to screen */ - - pddc->Static.RenderProcs[TEXT_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - - /* Update the pointer to next character */ - - text_el.paths++; - } - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - - -/*++ - | - | Function Name: miAnnoText3D - | - | Function Description: - | Handles the Annotation text 3D ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miAnnoText3D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - /* local */ - miAnnoTextStruct *ddText = (miAnnoTextStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddUSHORT numEncodings = ddText->numEncodings; - ddCoord3D *pOrigin = ddText->pOrigin; /* string origin */ - ddCoord3D *pOffset = ddText->pOffset; - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - -/* Define required temporary variables */ - - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_cc_xform[4][4]; - ddFLOAT tc_to_mc_xform[4][4]; - ddFLOAT buf_xform[4][4]; - ddFLOAT buf1_xform[4][4]; - miDDContext *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first, pty_first; - int i, j, k; - int count; /* Count of characters to be rendered */ - ddFLOAT ei0cc, ei1cc, ei3cc; - ddFLOAT ei0mc, ei1mc, ei3mc; - miCharPath *save_ptr; - miListHeader *mc_path, *mclip_path, *cc_path, *clip_path, *dc_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag; - static ddVector3D Directions[2] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0}; - ddCoord3D *pDirections = (ddCoord3D *)Directions; - miListHeader Connector; - ddCoord4D CC_Offset; /* Offset in Clipping Coordinates */ - ddCoord4D MC_Origin, CC_Origin, NPC_Origin; - ddUSHORT oc; /* Outcode for 4D point clipping */ - ddUSHORT clip_mode; /* distinguish model from view " */ - - /* Get the DDContext handle for local use */ - - pddc = (miDDContext *)pRend->pDDContext; - - /* Transform and clip the text origin first to see if any rendering*/ - /* needs to be done at all. If the NPC sub-volume does not contain */ - /* the origin, the annotation text is not rendered. */ - - MC_Origin.x = pOrigin->x; - MC_Origin.y = pOrigin->y; - MC_Origin.z = pOrigin->z; - MC_Origin.w = 1.0; - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - clip_mode = MI_MCLIP; - CLIP_POINT4D(&MC_Origin, oc, clip_mode); - - if (oc) return (Success); /* origin model clipped out */ - } - - miTransformPoint (&MC_Origin, pddc->Dynamic->mc_to_cc_xform, - &CC_Origin); - - clip_mode = MI_VCLIP; - CLIP_POINT4D(&CC_Origin, oc, clip_mode); - if (oc) { - return (Success); /* origin view clipped out */ - } - - /* Compute the NPC_Origin for later use */ - - miMatMult (buf_xform, pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_npc_xform); - miTransformPoint (&MC_Origin, buf_xform, &NPC_Origin); - - /* Set the annotation text flag to one */ - - aflag = 1; - - /* Transform the NPC Offset to CC. Note that we are transforming a */ - /* vector. i.e., only scaling components of the viewport transform */ - /* need be applied. This is simply done by multiplication of the x */ - /* and y components by the respective scale factors. */ - - CC_Offset.x = pOffset->x * pddc->Dynamic->npc_to_cc_xform[0][0]; - CC_Offset.y = pOffset->y * pddc->Dynamic->npc_to_cc_xform[1][1]; - CC_Offset.z = pOffset->z * pddc->Dynamic->npc_to_cc_xform[2][2]; - CC_Offset.w = 0.0; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - return (Success); - - - /* Convert text string into required paths */ - - if ((status = atx_el_to_path (pRend, pddc, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text3_xform (pOrigin, pDirections, (pDirections+1), - pddc->Static.attrs, &align, text_el.xform, aflag); - - /* Set up the new composite transform first. Note that in the case */ - /* of annotation text, only the text origin is transformed by the */ - /* complete pipeline transform. The text itself is affected only by*/ - /* the transformed origin in NPC, the NPC offset , npc_to_cc, and */ - /* the workstation transform. */ - - /* Now compute the initial composite transform for the first char. */ - /* The required transforms for characters are - text space to model */ - /* space transform, transformation of the annotation text origin, if*/ - /* any, and the npc to cc transform. */ - - /* Get the translation due to the transformation of the annotation */ - /* text origin by mc_to_npc_xform into buf1_xform. */ - - memcpy( (char *)buf1_xform, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - buf1_xform[0][3] += NPC_Origin.x - MC_Origin.x; - buf1_xform[1][3] += NPC_Origin.y - MC_Origin.y; - buf1_xform[2][3] += NPC_Origin.z - MC_Origin.z; - - miMatMult (buf_xform, text_el.xform, buf1_xform); - miMatMult (buf_xform, buf_xform, pddc->Dynamic->npc_to_cc_xform); - - /* Add the offset in CC */ - - buf_xform[0][3] += CC_Offset.x; - buf_xform[1][3] += CC_Offset.y; - buf_xform[2][3] += CC_Offset.z; - - /******** Render the text string first, and then the connector ********/ - - /* Render the paths in text_el as polylines */ - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pddc->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the text */ - /* path is Up or Down. If so, we need to modify tx by the first */ - /* character translation to align with the rest of the characters*/ - /* in the string. */ - - if ((pddc->Static.attrs->atextPath == PEXPathUp || - pddc->Static.attrs->atextPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE FIRST */ - /* CHARACTER IN THE STRING. ptx FOR ALL OTHER CHARACTERS WILL BE */ - /* RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE REQUIRED */ - /* EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS NOT A PROBLEM HERE*/ - /* SINCE WE NEED THIS SPECIAL CASE ONLY FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE OF += */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to get */ - /* just the character width. */ - - ptx_first += (pddc->Static.attrs->charSpacing) * FONT_COORD_HEIGHT; - - pty_first = pty; /* Save first character height */ - } - - /* Check to see if the text path is Left. If so, we need to modify */ - /* tx by the first character width so as to start the string to the*/ - /* left of the text origin. */ - - if (pddc->Static.attrs->atextPath == PEXPathLeft) - tx += ptx_first; - - /* Check to see if modelling clip is required. If so, apply it */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Buffer the tc_to_mc_xform first */ - - memcpy( (char *)tc_to_mc_xform, (char *)text_el.xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0mc = tc_to_mc_xform[i][0]; - ei1mc = tc_to_mc_xform[i][1]; - ei3mc = tc_to_mc_xform[i][3]; - /* Modify the transform */ - tc_to_mc_xform[i][0] = exp * ei0mc; - tc_to_mc_xform[i][3] = tx * ei0mc + ty * ei1mc + ei3mc; - } - /* Transform the character strokes into Model space */ - - if (status = miTransform(pddc, text_el.paths->path, &mc_path, - tc_to_mc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - if (status = miClipPolyLines(pddc, mc_path, &mclip_path, MI_MCLIP)) - return (status); - } - else { - mclip_path = text_el.paths->path; - } - - /* Buffer the tc_to_cc_xform first */ - memcpy( (char *)tc_to_cc_xform, (char *)buf_xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0cc = tc_to_cc_xform[i][0]; - ei1cc = tc_to_cc_xform[i][1]; - ei3cc = tc_to_cc_xform[i][3]; - /* Modify the transform */ - tc_to_cc_xform[i][0] = exp * ei0cc; - tc_to_cc_xform[i][3] = tx * ei0cc + ty * ei1cc + ei3cc; - } - - /* Transform and clip the paths corresponding to current character */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Note that we are already in Model space here */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - else { - - /* Note that we are still in text local space here ! */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - tc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - - /* Clip */ - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* if nothing left, then update pointers and continue */ - if (clip_path->numLists <= 0) { - text_el.paths++; - continue; - } - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Text to screen */ - - pddc->Static.RenderProcs[TEXT_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - - /* Update the pointer to next character */ - - text_el.paths++; - } - - /* Check the annotation style and draw a connecting line to the text */ - - if (pddc->Static.attrs->atextStyle == 2) { - - /* Use the offset and text origin to build a polyline */ - - Connector.type = DD_3D_POINT; - Connector.numLists = 1; - if (!(Connector.ddList = (listofddPoint *) - xalloc(sizeof(listofddPoint)))) - return (BadAlloc); - Connector.ddList->numPoints = 2; - if (!((Connector.ddList->pts.p3Dpt) = (ddCoord3D *) - xalloc(sizeof(ddCoord3D) * 2))) - return (BadAlloc); - - Connector.ddList->pts.p3Dpt->x = pOrigin->x; - Connector.ddList->pts.p3Dpt->y = pOrigin->y; - Connector.ddList->pts.p3Dpt->z = pOrigin->z; - Connector.ddList->pts.p3Dpt++; - Connector.ddList->pts.p3Dpt->x = pOrigin->x; - Connector.ddList->pts.p3Dpt->y = pOrigin->y; - Connector.ddList->pts.p3Dpt->z = pOrigin->z; - Connector.ddList->pts.p3Dpt--; /* Reset pointer to head of the list */ - - /* Render the connector as a polyline */ - - /* Transform and clip the connector polyline */ - - if (status = miTransform(pddc, &Connector, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - /* Modify the second point by the amount of transformed offset. */ - - cc_path->ddList->pts.p4Dpt++; - cc_path->ddList->pts.p4Dpt->x += CC_Offset.x; - cc_path->ddList->pts.p4Dpt->y += CC_Offset.y; - cc_path->ddList->pts.p4Dpt->z += CC_Offset.z; - cc_path->ddList->pts.p4Dpt--; /* Reset pointer to head of the list */ - - /* Clip */ - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Connector to screen */ - - pddc->Static.RenderProcs[POLYLINE_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - - } /* if atextStyle == 2 */ - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - -/*++ - | - | Function Name: miAnnoText2D - | - | Function Description: - | Handles the Annotation text 2D ocs. - | - | Note(s): - | - --*/ - -ddpex3rtn -miAnnoText2D(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -/* out */ -{ - /* local */ - miAnnoText2DStruct *ddText = (miAnnoText2DStruct *)(pExecuteOC+1); - miTextElement text_el; /* text element */ - ddUSHORT numEncodings = ddText->numEncodings; - ddCoord2D *pOrigin = ddText->pOrigin; /* string origin */ - ddCoord2D *pOffset = ddText->pOffset; - pexMonoEncoding *pText = ddText->pText; /* text string */ - -/* calls */ - extern ddpex3rtn miTransform(); - extern ddpex3rtn miClipPolyLines(); - -/* Define required temporary variables */ - - ddULONG numChars; /* Needed for xalloc */ - pexMonoEncoding *pMono; - ddCoord2D align; /* alignment info */ - ddFLOAT tc_to_cc_xform[4][4]; - ddFLOAT tc_to_mc_xform[4][4]; - ddFLOAT buf_xform[4][4]; - ddFLOAT buf1_xform[4][4]; - miDDContext *pddc; - ddFLOAT exp, tx, ty; - ddFLOAT ptx, pty, ptx_first, pty_first; - int i, j, k; - int count; /* Count of characters to be rendered */ - ddFLOAT ei0cc, ei1cc, ei3cc; - ddFLOAT ei0mc, ei1mc, ei3mc; - miCharPath *save_ptr; - miListHeader *mc_path, *mclip_path, *cc_path, *clip_path, *dc_path; - listofddPoint *sp; - XID temp; - int status; - ddUSHORT aflag; - miListHeader Connector; - ddCoord4D CC_Offset; /* Offset in Clipping Coordinates */ - ddCoord4D MC_Origin, CC_Origin, NPC_Origin; - ddUSHORT oc; /* Outcode for 4D point clipping */ - ddUSHORT clip_mode; - - /* Get the DDContext handle for local use */ - - pddc = (miDDContext *)pRend->pDDContext; - - /* Transform and clip the text origin first to see if any rendering*/ - /* needs to be done at all. If the NPC sub-volume does not contain */ - /* the origin, the annotation text is not rendered. */ - - MC_Origin.x = pOrigin->x; - MC_Origin.y = pOrigin->y; - MC_Origin.z = 0.0; - MC_Origin.w = 1.0; - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - ComputeMCVolume(pRend, pddc); /* Compute modelling coord version - of clipping volume */ - clip_mode = MI_MCLIP; - CLIP_POINT4D(&MC_Origin, oc, clip_mode); - - if (oc) return (Success); /* origin model clipped out */ - } - - miTransformPoint (&MC_Origin, pddc->Dynamic->mc_to_cc_xform, - &CC_Origin); - - clip_mode = MI_VCLIP; - CLIP_POINT4D(&CC_Origin, oc, clip_mode); - if (oc) { - return (Success); /* Don't render anything; origin clipped out */ - } - - /* Compute the NPC_Origin for later use */ - - miMatMult (buf_xform, pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->wc_to_npc_xform); - miTransformPoint (&MC_Origin, buf_xform, &NPC_Origin); - - /* Set the annotation text flag to one */ - - aflag = 1; - - /* Transform the NPC Offset to CC. Note that we are transforming a */ - /* vector. i.e., only scaling components of the viewport transform */ - /* need be applied. This is simply done by multiplication of the x */ - /* and y components by the respective scale factors. */ - - CC_Offset.x = pOffset->x * pddc->Dynamic->npc_to_cc_xform[0][0]; - CC_Offset.y = pOffset->y * pddc->Dynamic->npc_to_cc_xform[1][1]; - CC_Offset.z = 0.0; - CC_Offset.w = 0.0; - - /* Determine the total number of characters in the ISTRING */ - - numChars = 0; - pMono = pText; - for (i=0; inumChars * ((pMono->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pMono->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - numChars += (ddULONG)pMono->numChars; - pMono = (pexMonoEncoding *) ((char *) (pMono + 1) + - bytes + PADDING (bytes)); - } - - if (numChars == 0) - return (Success); - - - /* Convert text string into required paths */ - - if ((status = atx_el_to_path (pRend, pddc, numEncodings, pText, - numChars, &text_el, &align, &count)) != Success) { - return (status); - } - - /* Compute the required Character Space to Modelling Space Transform */ - - text2_xform (pOrigin, pddc->Static.attrs, &align, text_el.xform, aflag); - - /* Set up the new composite transform first. Note that in the case */ - /* of annotation text, only the text origin is transformed by the */ - /* complete pipeline transform. The text itself is affected only by*/ - /* the transformed origin in NPC, the NPC offset , npc_to_cc, and */ - /* the workstation transform. */ - - /* Now compute the initial composite transform for the first char. */ - /* The required transforms for characters are - text space to model */ - /* space transform, transformation of the annotation text origin, if*/ - /* any, and the npc to cc transform. */ - - /* Get the translation due to the transformation of the annotation */ - /* text origin by mc_to_npc_xform into buf1_xform. */ - - memcpy( (char *)buf1_xform, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - buf1_xform[0][3] += NPC_Origin.x - MC_Origin.x; - buf1_xform[1][3] += NPC_Origin.y - MC_Origin.y; - - miMatMult (buf_xform, text_el.xform, buf1_xform); - miMatMult (buf_xform, buf_xform, pddc->Dynamic->npc_to_cc_xform); - - /* Add the offset in CC */ - - buf_xform[0][3] += CC_Offset.x; - buf_xform[1][3] += CC_Offset.y; - - /******** Render the text string first, and then the connector ********/ - - /* Render the paths in text_el as polylines */ - - /* Get the current character expansion factor */ - - exp = ABS((ddFLOAT)pddc->Static.attrs->charExpansion); - - /* Save the pointer to the beginning of the character data */ - - save_ptr = text_el.paths; - - /* Do for all characters (paths) in the text_el */ - - /* Initialize the previous translation components */ - - ptx = pty = 0.0; - - for (k=0; kpath->ddList)) { - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - text_el.paths++; - continue; - } - - /* Modify the composite transform by the previous translation */ - /* and the current scaling in x realizing the char expansion */ - - tx = ptx; - ty = pty; - - ptx = (ddFLOAT)(((text_el.paths)->trans).x); - pty = (ddFLOAT)(((text_el.paths)->trans).y); - - /* Check to see if this is the very first character and the text */ - /* path is Up or Down. If so, we need to modify tx by the first */ - /* character translation to align with the rest of the characters*/ - /* in the string. */ - - if ((pddc->Static.attrs->atextPath == PEXPathUp || - pddc->Static.attrs->atextPath == PEXPathDown) && k == 0) - tx += ptx; - - /* NOTE THAT THE ABOVE COMPUTATION WILL ONLY WORK FOR THE FIRST */ - /* CHARACTER IN THE STRING. ptx FOR ALL OTHER CHARACTERS WILL BE */ - /* RELATIVE TO THE TEXT ORIGIN AND SO WILL NOT GIVE THE REQUIRED */ - /* EFFECTIVE CHARACTER WIDTH. HOWEVER, THIS IS NOT A PROBLEM HERE*/ - /* SINCE WE NEED THIS SPECIAL CASE ONLY FOR THE FIRST CHARACTER. */ - /* */ - /* FURTHER, NOTE THAT ptx WILL BE NEGATIVE AND HENCE USE OF += */ - - if (k == 0) { - ptx_first = ptx; /* Get the first character translation */ - - /* Adjust the translation by character spacing factor to get */ - /* just the character width. */ - - ptx_first += (pddc->Static.attrs->charSpacing) * FONT_COORD_HEIGHT; - - pty_first = pty; /* Save first character height */ - - /* Adjust the translation by character spacing factor to get */ - /* just the character height. */ - - pty_first += (pddc->Static.attrs->charSpacing) * FONT_COORD_HEIGHT; - } - - /* Check to see if the text path is Left. If so, we need to modify */ - /* tx by the first character width so as to start the string to the*/ - /* left of the text origin. */ - - if (pddc->Static.attrs->atextPath == PEXPathLeft) - tx += ptx_first; - - /* Check to see if modelling clip is required. If so, apply it */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Buffer the tc_to_mc_xform first */ - - memcpy( (char *)tc_to_mc_xform, (char *)text_el.xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0mc = tc_to_mc_xform[i][0]; - ei1mc = tc_to_mc_xform[i][1]; - ei3mc = tc_to_mc_xform[i][3]; - /* Modify the transform */ - tc_to_mc_xform[i][0] = exp * ei0mc; - tc_to_mc_xform[i][3] = tx * ei0mc + ty * ei1mc + ei3mc; - } - /* Transform the character strokes into Model space */ - - if (status = miTransform(pddc, text_el.paths->path, &mc_path, - tc_to_mc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - if (status = miClipPolyLines(pddc, mc_path, &mclip_path, MI_MCLIP)) - return (status); - } - else { - mclip_path = text_el.paths->path; - } - - /* Buffer the tc_to_cc_xform first */ - - memcpy( (char *)tc_to_cc_xform, (char *)buf_xform, 16*sizeof(ddFLOAT)); - - /* Apply the per character translation and scaling by directly */ - /* modifying the concerned matrix elements. */ - - for (i=0; i<4; ++i) { - /* Buffer the element values */ - ei0cc = tc_to_cc_xform[i][0]; - ei1cc = tc_to_cc_xform[i][1]; - ei3cc = tc_to_cc_xform[i][3]; - /* Modify the transform */ - tc_to_cc_xform[i][0] = exp * ei0cc; - tc_to_cc_xform[i][3] = tx * ei0cc + ty * ei1cc + ei3cc; - } - - /* Transform and clip the paths corresponding to current character */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Note that we are already in Model space here */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - } - else { - - /* Note that we are still in text local space here ! */ - - if (status = miTransform(pddc, mclip_path, &cc_path, - tc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - } - - /* Clip */ - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* if nothing left, then update pointers and continue */ - if (clip_path->numLists <= 0) { - text_el.paths++; - continue; - } - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Text to screen */ - - pddc->Static.RenderProcs[TEXT_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - - /* Update the pointer to next character */ - - text_el.paths++; - } - - /* Check the annotation style and draw a connecting line to the text */ - - if (pddc->Static.attrs->atextStyle == 2) { - - /* Use the offset and the text origin to build a polyline */ - - Connector.type = DD_2D_POINT; - Connector.numLists = 1; - if (!(Connector.ddList = (listofddPoint *) xalloc(sizeof(listofddPoint)))) - return (BadAlloc); - Connector.ddList->numPoints = 2; - if (!((Connector.ddList->pts.p2Dpt) = (ddCoord2D *) - xalloc(sizeof(ddCoord2D) * 2))) - return (BadAlloc); - Connector.ddList->pts.p2Dpt->x = pOrigin->x; - Connector.ddList->pts.p2Dpt->y = pOrigin->y; - Connector.ddList->pts.p2Dpt++; - Connector.ddList->pts.p2Dpt->x = pOrigin->x; - Connector.ddList->pts.p2Dpt->y = pOrigin->y; - Connector.ddList->pts.p2Dpt--; /* Reset pointer to head of the list */ - - /* Render the connector as a polyline */ - - /* Transform and clip the connector polyline */ - - if (status = miTransform(pddc, &Connector, &cc_path, - pddc->Dynamic->mc_to_cc_xform, - NULL4x4, - DD_HOMOGENOUS_POINT)) - return (status); - - /* Modify the second point by the amount of transformed offset. */ - - cc_path->ddList->pts.p4Dpt++; - cc_path->ddList->pts.p4Dpt->x += CC_Offset.x; - cc_path->ddList->pts.p4Dpt->y += CC_Offset.y; - cc_path->ddList->pts.p4Dpt--; /* Reset pointer to head of the list */ - - /* Clip */ - - clip_mode = MI_VCLIP; - if (status = miClipPolyLines(pddc, cc_path, &clip_path, clip_mode)) - return (status); - - /* Transform to DC coordinates */ - - if (status = miTransform(pddc, clip_path, &dc_path, - pddc->Dynamic->cc_to_dc_xform, - NULL4x4, - DD_2DS_POINT)) - return (status); - - /* Render Connector to screen */ - - pddc->Static.RenderProcs[POLYLINE_RENDER_TABLE_INDEX](pRend, - pddc, - dc_path); - } /* if atextStyle == 2 */ - - /* Free up space allocated for text stroke data */ - - xfree ((char *)save_ptr); - - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c:1.9 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c Sat Feb 28 21:41:54 2004 @@ -1,1028 +0,0 @@ -/* $Xorg: miTrans.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miTrans.c,v 1.9 2001/12/14 19:57:30 dawes Exp $ */ - -#include "mipex.h" -#include "misc.h" -#include "miscstruct.h" -#include "PEXErr.h" -#include "miRender.h" -#include "miLight.h" -#include "pexos.h" - -#define IRINT(x) ( ((x) >= 0.0) ? ((int)((x) + 0.5)) : ((int)((x) - 0.5)) ) - -/*++ - | - | miTransform(pddc, vinput, voutput, - | vert_mat, norm_mat, outtype) - | - | Generalized vertex list transform routine. - | - | This routine takes in four parameters: a list of vertices, - | an output point type, and two matrices: one for transforming - | vertex data, the second for transforming normal data. - | The following assumptions are made: - | a) 2DS input is never used - | b) 2D input does not support normal, color or edge info - | c) output types do not have more attributes (color, normal or edge) - | than input data types - | d) only color specifiers with triplets of float values are - | supported - | - | All other cases produce undefined output - | - --*/ - -ddpex3rtn -miTransform(pddc, vinput, voutput, vert_mat, norm_mat, outtype) - miDDContext *pddc; - miListHeader *vinput; - miListHeader **voutput; - ddFLOAT vert_mat[4][4]; - ddFLOAT norm_mat[4][4]; - ddPointType outtype; -{ - ddCoord4D new_pt; - miListHeader *output; - - - register int i, j; - register listofddPoint *pddilist; - register listofddPoint *pddolist; - - ddPointUnion in_pt, - out_pt; - - ddCoord2D tmp_pt; - - ddFLOAT length; - - int output_size; - - /* remember that ALL vertex types are of the form: - * - * |---------------------------|---------|----------|---------| - * coords color normal edge - * (opt) (opt) (opt) - */ - - /* Don't pass on normals unless valid xform */ - if (norm_mat == NULL) DD_UnSetVertNormal(outtype); - - DD_VertPointSize(outtype, output_size); - - - switch (outtype) { - - case DD_RGBFLOAT_POINT4D: - case DD_HSV_POINT4D: - case DD_HLS_POINT4D: - case DD_CIE_POINT4D: - case DD_NORM_POINT4D: - case DD_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_POINT4D: - case DD_HSV_NORM_POINT4D: - case DD_HLS_NORM_POINT4D: - case DD_CIE_NORM_POINT4D: - case DD_RGBFLOAT_EDGE_POINT4D: - case DD_HSV_EDGE_POINT4D: - case DD_HLS_EDGE_POINT4D: - case DD_CIE_EDGE_POINT4D: - case DD_NORM_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_EDGE_POINT4D: - case DD_HSV_NORM_EDGE_POINT4D: - case DD_HLS_NORM_EDGE_POINT4D: - case DD_CIE_NORM_EDGE_POINT4D: - case DD_HOMOGENOUS_POINT: - { - switch (vinput->type) { - case DD_2D_POINT: - { - - /* Use the pre-defined 4D list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(i+1),output_size); - if(!(out_pt.p4Dpt = (pddolist->pts.p4Dpt))) - return(BadAlloc); - - in_pt.p2Dpt = pddilist->pts.p2Dpt; - - /* Note - just assume z = 0.0, w = 1.0 */ - while (i--) { - - out_pt.p4Dpt->x = vert_mat[0][0]*in_pt.p2Dpt->x; - out_pt.p4Dpt->x += vert_mat[0][1]*in_pt.p2Dpt->y; - out_pt.p4Dpt->x += vert_mat[0][3]; - - out_pt.p4Dpt->y = vert_mat[1][0]*in_pt.p2Dpt->x; - out_pt.p4Dpt->y += vert_mat[1][1]*in_pt.p2Dpt->y; - out_pt.p4Dpt->y += vert_mat[1][3]; - - out_pt.p4Dpt->z = vert_mat[2][0]*in_pt.p2Dpt->x; - out_pt.p4Dpt->z += vert_mat[2][1]*in_pt.p2Dpt->y; - out_pt.p4Dpt->z += vert_mat[2][3]; - - out_pt.p4Dpt->w = vert_mat[3][0]*in_pt.p2Dpt->x; - out_pt.p4Dpt->w += vert_mat[3][1]*in_pt.p2Dpt->y; - out_pt.p4Dpt->w += vert_mat[3][3]; - - in_pt.p2Dpt++; - out_pt.p4Dpt++; - - /* At this point we should be pointing to - * to the beginning of the next vertex - */ - - } - pddilist++; - pddolist++; - } - break; - } - case DD_RGBFLOAT_POINT: - case DD_HSV_POINT: - case DD_HLS_POINT: - case DD_CIE_POINT: - case DD_NORM_POINT: - case DD_EDGE_POINT: - case DD_RGBFLOAT_NORM_POINT: - case DD_HSV_NORM_POINT: - case DD_HLS_NORM_POINT: - case DD_CIE_NORM_POINT: - case DD_RGBFLOAT_EDGE_POINT: - case DD_HSV_EDGE_POINT: - case DD_HLS_EDGE_POINT: - case DD_CIE_EDGE_POINT: - case DD_NORM_EDGE_POINT: - case DD_RGBFLOAT_NORM_EDGE_POINT: - case DD_HSV_NORM_EDGE_POINT: - case DD_HLS_NORM_EDGE_POINT: - case DD_CIE_NORM_EDGE_POINT: - case DD_3D_POINT: - { - - /* Use the pre-defined 4D list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(i+1),output_size); - if(!(out_pt.p4Dpt = (pddolist->pts.p4Dpt))) - return(BadAlloc); - - in_pt.p3Dpt = pddilist->pts.p3Dpt; - - /* Note - just assume w = 1.0 */ - while (i--) { - - /* cast operands & transform the coordinates - portions */ - - - out_pt.p4Dpt->x = vert_mat[0][0]*in_pt.p3Dpt->x; - out_pt.p4Dpt->x += vert_mat[0][1]*in_pt.p3Dpt->y; - out_pt.p4Dpt->x += vert_mat[0][2]*in_pt.p3Dpt->z; - out_pt.p4Dpt->x += vert_mat[0][3]; - - out_pt.p4Dpt->y = vert_mat[1][0]*in_pt.p3Dpt->x; - out_pt.p4Dpt->y += vert_mat[1][1]*in_pt.p3Dpt->y; - out_pt.p4Dpt->y += vert_mat[1][2]*in_pt.p3Dpt->z; - out_pt.p4Dpt->y += vert_mat[1][3]; - - out_pt.p4Dpt->z = vert_mat[2][0]*in_pt.p3Dpt->x; - out_pt.p4Dpt->z += vert_mat[2][1]*in_pt.p3Dpt->y; - out_pt.p4Dpt->z += vert_mat[2][2]*in_pt.p3Dpt->z; - out_pt.p4Dpt->z += vert_mat[2][3]; - - out_pt.p4Dpt->w = vert_mat[3][0]*in_pt.p3Dpt->x; - out_pt.p4Dpt->w += vert_mat[3][1]*in_pt.p3Dpt->y; - out_pt.p4Dpt->w += vert_mat[3][2]*in_pt.p3Dpt->z; - out_pt.p4Dpt->w += vert_mat[3][3]; - - in_pt.p3Dpt++; - out_pt.p4Dpt++; - - if (!DD_IsVertCoordsOnly(outtype)) { - - if DD_IsVertColour(outtype) { - *out_pt.pRgbFloatClr = - *in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - out_pt.pRgbFloatClr++; - } - - - if DD_IsVertNormal(outtype) { - - - out_pt.pNormal->x = norm_mat[0][0]*in_pt.pNormal->x; - out_pt.pNormal->x += norm_mat[0][1]*in_pt.pNormal->y; - out_pt.pNormal->x += norm_mat[0][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->y = norm_mat[1][0]*in_pt.pNormal->x; - out_pt.pNormal->y += norm_mat[1][1]*in_pt.pNormal->y; - out_pt.pNormal->y += norm_mat[1][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->z = norm_mat[2][0]*in_pt.pNormal->x; - out_pt.pNormal->z += norm_mat[2][1]*in_pt.pNormal->y; - out_pt.pNormal->z += norm_mat[2][2]*in_pt.pNormal->z; - /* no translation */ - - NORMALIZE_VECTOR (out_pt.pNormal, length); - - in_pt.pNormal++; - out_pt.pNormal++; - } - - if (DD_IsVertEdge(outtype)) { - *out_pt.pEdge = *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - } - - /* At this point we should be pointing to - * to the beginning of the next vertex - */ - } - pddilist++; - pddolist++; - } - break; - } - case DD_RGBFLOAT_POINT4D: - case DD_HSV_POINT4D: - case DD_HLS_POINT4D: - case DD_CIE_POINT4D: - case DD_NORM_POINT4D: - case DD_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_POINT4D: - case DD_HSV_NORM_POINT4D: - case DD_HLS_NORM_POINT4D: - case DD_CIE_NORM_POINT4D: - case DD_RGBFLOAT_EDGE_POINT4D: - case DD_HSV_EDGE_POINT4D: - case DD_HLS_EDGE_POINT4D: - case DD_CIE_EDGE_POINT4D: - case DD_NORM_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_EDGE_POINT4D: - case DD_HSV_NORM_EDGE_POINT4D: - case DD_HLS_NORM_EDGE_POINT4D: - case DD_CIE_NORM_EDGE_POINT4D: - case DD_HOMOGENOUS_POINT: - { - - /* Use the pre-defined 4D list for output */ - *voutput = output = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(i+1),output_size); - if(!(out_pt.p4Dpt = (pddolist->pts.p4Dpt))) - return(BadAlloc); - - in_pt.p4Dpt = pddilist->pts.p4Dpt; - - /* Note - just assume w = 1.0 */ - while (i--) { - - /* cast operands & transform the coordinates */ - - out_pt.p4Dpt->x = vert_mat[0][0]*in_pt.p4Dpt->x; - out_pt.p4Dpt->x += vert_mat[0][1]*in_pt.p4Dpt->y; - out_pt.p4Dpt->x += vert_mat[0][2]*in_pt.p4Dpt->z; - out_pt.p4Dpt->x += vert_mat[0][3]*in_pt.p4Dpt->w; - - out_pt.p4Dpt->y = vert_mat[1][0]*in_pt.p4Dpt->x; - out_pt.p4Dpt->y += vert_mat[1][1]*in_pt.p4Dpt->y; - out_pt.p4Dpt->y += vert_mat[1][2]*in_pt.p4Dpt->z; - out_pt.p4Dpt->y += vert_mat[1][3]*in_pt.p4Dpt->w; - - out_pt.p4Dpt->z = vert_mat[2][0]*in_pt.p4Dpt->x; - out_pt.p4Dpt->z += vert_mat[2][1]*in_pt.p4Dpt->y; - out_pt.p4Dpt->z += vert_mat[2][2]*in_pt.p4Dpt->z; - out_pt.p4Dpt->z += vert_mat[2][3]*in_pt.p4Dpt->w; - - out_pt.p4Dpt->w = vert_mat[3][0]*in_pt.p4Dpt->x; - out_pt.p4Dpt->w += vert_mat[3][1]*in_pt.p4Dpt->y; - out_pt.p4Dpt->w += vert_mat[3][2]*in_pt.p4Dpt->z; - out_pt.p4Dpt->w += vert_mat[3][3]*in_pt.p4Dpt->w; - - in_pt.p4Dpt++; - out_pt.p4Dpt++; - - if (!DD_IsVertCoordsOnly(outtype)) { - - if DD_IsVertColour(outtype) { - *out_pt.pRgbFloatClr = - *in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - out_pt.pRgbFloatClr++; - } - - if DD_IsVertNormal(outtype) { - - out_pt.pNormal->x = norm_mat[0][0]*in_pt.pNormal->x; - out_pt.pNormal->x += norm_mat[0][1]*in_pt.pNormal->y; - out_pt.pNormal->x += norm_mat[0][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->y = norm_mat[1][0]*in_pt.pNormal->x; - out_pt.pNormal->y += norm_mat[1][1]*in_pt.pNormal->y; - out_pt.pNormal->y += norm_mat[1][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->z = norm_mat[2][0]*in_pt.pNormal->x; - out_pt.pNormal->z += norm_mat[2][1]*in_pt.pNormal->y; - out_pt.pNormal->z += norm_mat[2][2]*in_pt.pNormal->z; - - NORMALIZE_VECTOR (out_pt.pNormal, length); - - in_pt.pNormal++; - out_pt.pNormal++; - } - - if (DD_IsVertEdge(outtype)) { - *out_pt.pEdge= *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - } - - } - - pddilist++; - pddolist++; - } - break; - } - default: - *voutput = NULL; - return(1); - } - - return(0); - } - - /* - * Next case output a 2DS point. Note that this point is - * normalized by w if necessary. - */ - case DD_2DS_POINT: - case DD_RGBFLOAT_POINT2DS: - case DD_HSV_POINT2DS: - case DD_HLS_POINT2DS: - case DD_CIE_POINT2DS: - case DD_NORM_POINT2DS: - case DD_EDGE_POINT2DS: - case DD_RGBFLOAT_NORM_POINT2DS: - case DD_HSV_NORM_POINT2DS: - case DD_HLS_NORM_POINT2DS: - case DD_CIE_NORM_POINT2DS: - case DD_RGBFLOAT_EDGE_POINT2DS: - case DD_HSV_EDGE_POINT2DS: - case DD_HLS_EDGE_POINT2DS: - case DD_CIE_EDGE_POINT2DS: - case DD_NORM_EDGE_POINT2DS: - case DD_RGBFLOAT_NORM_EDGE_POINT2DS: - case DD_HSV_NORM_EDGE_POINT2DS: - case DD_HLS_NORM_EDGE_POINT2DS: - case DD_CIE_NORM_EDGE_POINT2DS: - { - ddFLOAT w; - switch (vinput->type) { - case DD_2D_POINT: - { - - /* Use the pre-defined 2D list for output */ - *voutput = output = &pddc->Static.misc.list2D; - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(i+1),output_size); - if(!(out_pt.p2DSpt = (pddolist->pts.p2DSpt))) - return(BadAlloc); - - - in_pt.p2DSpt = pddilist->pts.p2DSpt; - - /* Note - just assume z = 0.0, w = 1.0 */ - while (i--) { - - /* cast operands & transform the coordinates */ - - tmp_pt.x = vert_mat[0][0]*in_pt.p2Dpt->x; - tmp_pt.x += vert_mat[0][1]*in_pt.p2Dpt->y; - tmp_pt.x += vert_mat[0][3]; - - tmp_pt.y = vert_mat[1][0]*in_pt.p2Dpt->x; - tmp_pt.y += vert_mat[1][1]*in_pt.p2Dpt->y; - tmp_pt.y += vert_mat[1][3]; - - /* Skip Z transformation */ - - /* The w must be computed to normalize the result */ - w = vert_mat[3][0]*in_pt.p2Dpt->x; - w += vert_mat[3][1]*in_pt.p2Dpt->y; - w += vert_mat[3][3]; - - /* Now round and normalize the result */ - if (w != 1.0) { - out_pt.p2DSpt->x = (ddSHORT)(tmp_pt.x / w); - out_pt.p2DSpt->y = (ddSHORT)(tmp_pt.y / w); - } else { - out_pt.p2DSpt->x = (ddSHORT)(tmp_pt.x); - out_pt.p2DSpt->y = (ddSHORT)(tmp_pt.y); - } - in_pt.p2Dpt++; - out_pt.p2DSpt++; - - - /* At this point we should be pointing to - * to the beginning of the next vertex - */ - - } - pddilist++; - pddolist++; - } - break; - } - case DD_3D_POINT: - case DD_RGBFLOAT_POINT: - case DD_HSV_POINT: - case DD_HLS_POINT: - case DD_CIE_POINT: - case DD_NORM_POINT: - case DD_EDGE_POINT: - case DD_RGBFLOAT_NORM_POINT: - case DD_HSV_NORM_POINT: - case DD_HLS_NORM_POINT: - case DD_CIE_NORM_POINT: - case DD_RGBFLOAT_EDGE_POINT: - case DD_HSV_EDGE_POINT: - case DD_HLS_EDGE_POINT: - case DD_CIE_EDGE_POINT: - case DD_NORM_EDGE_POINT: - case DD_RGBFLOAT_NORM_EDGE_POINT: - case DD_HSV_NORM_EDGE_POINT: - case DD_HLS_NORM_EDGE_POINT: - case DD_CIE_NORM_EDGE_POINT: - { - - /* Use the pre-defined 2D list for output */ - *voutput = output = &pddc->Static.misc.list2D; - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->numLists = vinput->numLists; - output->flags = vinput->flags; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j=0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist,(i+1),output_size); - if(!(out_pt.p2DSpt = (pddolist->pts.p2DSpt))) - return(BadAlloc); - - - in_pt.p3Dpt = pddilist->pts.p3Dpt; - - /* Note - just assume z = 0.0, w = 1.0 */ - while (i--) { - - /* cast operands & transform the coordinates */ - - tmp_pt.x = vert_mat[0][0]*in_pt.p3Dpt->x; - tmp_pt.x += vert_mat[0][1]*in_pt.p3Dpt->y; - tmp_pt.x += vert_mat[0][2]*in_pt.p3Dpt->z; - tmp_pt.x += vert_mat[0][3]; - - tmp_pt.y = vert_mat[1][0]*in_pt.p3Dpt->x; - tmp_pt.y += vert_mat[1][1]*in_pt.p3Dpt->y; - tmp_pt.y += vert_mat[1][2]*in_pt.p3Dpt->z; - tmp_pt.y += vert_mat[1][3]; - - /* Skip Z transformation */ - - /* The w must be computed to normalize the result */ - w = vert_mat[3][0]*in_pt.p3Dpt->x; - w += vert_mat[3][1]*in_pt.p3Dpt->y; - w += vert_mat[3][2]*in_pt.p3Dpt->z; - w += vert_mat[3][3]; - - /* Now round and normalize the result */ - if (w != 1.0) { - out_pt.p2DSpt->x = IRINT(tmp_pt.x / w); - out_pt.p2DSpt->y = IRINT(tmp_pt.y / w); - } else { - out_pt.p2DSpt->x = IRINT(tmp_pt.x); - out_pt.p2DSpt->y = IRINT(tmp_pt.y); - } - in_pt.p3Dpt++; - out_pt.p2DSpt++; - - - if (!DD_IsVertCoordsOnly(outtype)) { - - if DD_IsVertColour(outtype) { - *out_pt.pRgbFloatClr = - *in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - out_pt.pRgbFloatClr++; - } - - if DD_IsVertNormal(outtype) { - - out_pt.pNormal->x = norm_mat[0][0]*in_pt.pNormal->x; - out_pt.pNormal->x += norm_mat[0][1]*in_pt.pNormal->y; - out_pt.pNormal->x += norm_mat[0][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->y = norm_mat[1][0]*in_pt.pNormal->x; - out_pt.pNormal->y += norm_mat[1][1]*in_pt.pNormal->y; - out_pt.pNormal->y += norm_mat[1][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->z = norm_mat[2][0]*in_pt.pNormal->x; - out_pt.pNormal->z += norm_mat[2][1]*in_pt.pNormal->y; - out_pt.pNormal->z += norm_mat[2][2]*in_pt.pNormal->z; - - NORMALIZE_VECTOR (out_pt.pNormal, length); - - in_pt.pNormal++; - out_pt.pNormal++; - } - - if (DD_IsVertEdge(outtype)) { - *out_pt.pEdge= *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - } - - } - pddilist++; - pddolist++; - } - break; - } - case DD_RGBFLOAT_POINT4D: - case DD_HSV_POINT4D: - case DD_HLS_POINT4D: - case DD_CIE_POINT4D: - case DD_NORM_POINT4D: - case DD_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_POINT4D: - case DD_HSV_NORM_POINT4D: - case DD_HLS_NORM_POINT4D: - case DD_CIE_NORM_POINT4D: - case DD_RGBFLOAT_EDGE_POINT4D: - case DD_HSV_EDGE_POINT4D: - case DD_HLS_EDGE_POINT4D: - case DD_CIE_EDGE_POINT4D: - case DD_NORM_EDGE_POINT4D: - case DD_RGBFLOAT_NORM_EDGE_POINT4D: - case DD_HSV_NORM_EDGE_POINT4D: - case DD_HLS_NORM_EDGE_POINT4D: - case DD_CIE_NORM_EDGE_POINT4D: - case DD_HOMOGENOUS_POINT: - { - - /* Use the pre-defined 2D list for output */ - *voutput = output = &pddc->Static.misc.list2D; - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(output, vinput->numLists) - if (!output->ddList) return(BadAlloc); - - output->type = outtype; - output->flags = vinput->flags; - output->numLists = vinput->numLists; - - pddilist = vinput->ddList; - pddolist = output->ddList; - - /* Now, transform each list */ - for(j = 0; j < vinput->numLists; j++) { - - if ((i = pddolist->numPoints = pddilist->numPoints) <= 0) - continue; - - /* - * Insure sufficient room for each vertex - * Add one to leave room for possible polygon close. - */ - MI_ALLOCLISTOFDDPOINT(pddolist, (i+1), output_size); - if(!(out_pt.p2DSpt = (pddolist->pts.p2DSpt))) - return(BadAlloc); - - in_pt.p4Dpt = pddilist->pts.p4Dpt; - - /* Note - just assume w = 1.0 */ - while (i--) { - - /* cast operands & transform the coordinates */ - - tmp_pt.x = vert_mat[0][0]*in_pt.p4Dpt->x; - tmp_pt.x += vert_mat[0][1]*in_pt.p4Dpt->y; - tmp_pt.x += vert_mat[0][2]*in_pt.p4Dpt->z; - tmp_pt.x += vert_mat[0][3]*in_pt.p4Dpt->w; - - tmp_pt.y = vert_mat[1][0]*in_pt.p4Dpt->x; - tmp_pt.y += vert_mat[1][1]*in_pt.p4Dpt->y; - tmp_pt.y += vert_mat[1][2]*in_pt.p4Dpt->z; - tmp_pt.y += vert_mat[1][3]*in_pt.p4Dpt->w; - - /* Skip Z transformation */ - - w = vert_mat[3][0]*in_pt.p4Dpt->x; - w += vert_mat[3][1]*in_pt.p4Dpt->y; - w += vert_mat[3][2]*in_pt.p4Dpt->z; - w += vert_mat[3][3]*in_pt.p4Dpt->w; - - /* Now round and normal->ze the result */ - if (w != 1.0) { - out_pt.p2DSpt->x = IRINT(tmp_pt.x / w); - out_pt.p2DSpt->y = IRINT(tmp_pt.y / w); - } else { - out_pt.p2DSpt->x = IRINT(tmp_pt.x); - out_pt.p2DSpt->y = IRINT(tmp_pt.y); - } - - in_pt.p4Dpt++; - out_pt.p2DSpt++; - - - if (!DD_IsVertCoordsOnly(outtype)) { - - if DD_IsVertColour(outtype) { - *out_pt.pRgbFloatClr = - *in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - out_pt.pRgbFloatClr++; - } - - if DD_IsVertNormal(outtype) { - - out_pt.pNormal->x = norm_mat[0][0]*in_pt.pNormal->x; - out_pt.pNormal->x += norm_mat[0][1]*in_pt.pNormal->y; - out_pt.pNormal->x += norm_mat[0][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->y = norm_mat[1][0]*in_pt.pNormal->x; - out_pt.pNormal->y += norm_mat[1][1]*in_pt.pNormal->y; - out_pt.pNormal->y += norm_mat[1][2]*in_pt.pNormal->z; - /* no translation */ - - out_pt.pNormal->z = norm_mat[2][0]*in_pt.pNormal->x; - out_pt.pNormal->z += norm_mat[2][1]*in_pt.pNormal->y; - out_pt.pNormal->z += norm_mat[2][2]*in_pt.pNormal->z; - - NORMALIZE_VECTOR (out_pt.pNormal, length); - - in_pt.pNormal++; - out_pt.pNormal++; - } - - if (DD_IsVertEdge(outtype)) { - *out_pt.pEdge= *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - } - - } - pddilist++; - pddolist++; - } - break; - } - - /* no more input types for 2DS outputs*/ - default: - *voutput = NULL; - return(1); - break; - } - - return(0); - } - - /* no more output types left */ - default: - *voutput = NULL; - return(1); - break; - } - - -} - -/*++ - | - | miFacetTransform(pddc, finput, foutput, norm_mat) - | - | Facet list transform routine. - | - | General transform routine for PEX. - | - | This routine takes in four parameters: a list of vertices, - | an output point type, and two matrices: one for transforming - | vertex data, the second for transforming normal data. - | The following assumptions are made: - | a) 2DS input is never used - | b) 2D input does not support normal, color or edge info - | c) output types do not have more attributes (color, normal or edge) - | than input data types - | d) only color specifiers with triplets of float values are - | supported - | - | All other cases produce undefined output - | - --*/ - -ddpex3rtn -miFacetTransform(pddc, finput, foutput, norm_mat) - miDDContext *pddc; - listofddFacet *finput; - listofddFacet **foutput; - ddFLOAT norm_mat[4][4]; -{ - - listofddFacet *fct_list; - ddFacetUnion in_fct; - ddFacetUnion out_fct; - ddFLOAT length; - char color_flag; - int j; - int facet_size; - - /* Some quick error checking */ - if (!DD_IsFacetNormal(finput->type)) { - *foutput = finput; - return(Success); - } - - /* - * First, allocate storage for the facet list - */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = finput->type; - - DDFacetSIZE(finput->type, facet_size); - MI_ALLOCLISTOFDDFACET(fct_list, finput->numFacets, facet_size); - if (!(out_fct.pNoFacet = fct_list->facets.pNoFacet)) return(BadAlloc); - - color_flag = DD_IsFacetColour(finput->type); - - in_fct = finput->facets; - - - - /* Remember, facet data is of the form: - * - * |--------------|--------------------------| - * color (opt) normal (opt) - */ - - for (j = 0; j < finput->numFacets; j++) { - - /* Copy the input facet color */ - if (color_flag) - *(out_fct.pFacetRgbFloat++) = *(in_fct.pFacetRgbFloat++); - - out_fct.pFacetN->x = norm_mat[0][0]*in_fct.pFacetN->x; - out_fct.pFacetN->x += norm_mat[0][1]*in_fct.pFacetN->y; - out_fct.pFacetN->x += norm_mat[0][2]*in_fct.pFacetN->z; - /* no translation */ - - out_fct.pFacetN->y = norm_mat[1][0]*in_fct.pFacetN->x; - out_fct.pFacetN->y += norm_mat[1][1]*in_fct.pFacetN->y; - out_fct.pFacetN->y += norm_mat[1][2]*in_fct.pFacetN->z; - /* no translation */ - - out_fct.pFacetN->z = norm_mat[2][0]*in_fct.pFacetN->x; - out_fct.pFacetN->z += norm_mat[2][1]*in_fct.pFacetN->y; - out_fct.pFacetN->z += norm_mat[2][2]*in_fct.pFacetN->z; - - NORMALIZE_VECTOR (out_fct.pFacetN, length); - - /* Process next facet */ - in_fct.pFacetN++; - out_fct.pFacetN++; - } - - fct_list->numFacets = finput->numFacets; - *foutput = fct_list; - - return(Success); - -} - -/*++ - | - | miBoundsTransform(pddc, ibounds, obounds, mat) - | - | Transforms a ddListBounds stucture by the specified matrix. - | - --*/ - -ddpex3rtn -miBoundsTransform(pddc, ibounds, obounds, mat) - miDDContext *pddc; - ddListBounds *ibounds; - ddListBounds *obounds; - ddFLOAT *mat; -{ - - ddFLOAT *f = mat; - - obounds->xmin = (*f++)*ibounds->xmin; - obounds->xmin += (*f++)*ibounds->ymin; - obounds->xmin += (*f++)*ibounds->zmin; - obounds->xmin += (*f++)*ibounds->wmin; - - obounds->ymin = (*f++)*ibounds->xmin; - obounds->ymin += (*f++)*ibounds->ymin; - obounds->ymin += (*f++)*ibounds->zmin; - obounds->ymin += (*f++)*ibounds->wmin; - - obounds->zmin = (*f++)*ibounds->xmin; - obounds->zmin += (*f++)*ibounds->ymin; - obounds->zmin += (*f++)*ibounds->zmin; - obounds->zmin += (*f++)*ibounds->wmin; - - obounds->wmin = (*f++)*ibounds->xmin; - obounds->wmin += (*f++)*ibounds->ymin; - obounds->wmin += (*f++)*ibounds->zmin; - obounds->wmin += (*f++)*ibounds->wmin; - - f = mat; - - obounds->xmax = (*f++)*ibounds->xmax; - obounds->xmax += (*f++)*ibounds->ymax; - obounds->xmax += (*f++)*ibounds->zmax; - obounds->xmax += (*f++)*ibounds->wmax; - - obounds->ymax = (*f++)*ibounds->xmax; - obounds->ymax += (*f++)*ibounds->ymax; - obounds->ymax += (*f++)*ibounds->zmax; - obounds->ymax += (*f++)*ibounds->wmax; - - obounds->zmax = (*f++)*ibounds->xmax; - obounds->zmax += (*f++)*ibounds->ymax; - obounds->zmax += (*f++)*ibounds->zmax; - obounds->zmax += (*f++)*ibounds->wmax; - - obounds->wmax = (*f++)*ibounds->xmax; - obounds->wmax += (*f++)*ibounds->ymax; - obounds->wmax += (*f++)*ibounds->zmax; - obounds->wmax += (*f++)*ibounds->wmax; - - return(Success); - -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c:3.7 Fri Dec 14 14:57:30 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c Sat Feb 28 21:41:54 2004 @@ -1,2223 +0,0 @@ -/* $Xorg: miTriStrip.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/miTriStrip.c,v 3.7 2001/12/14 19:57:30 dawes Exp $ */ - -#include "miClip.h" -#include "misc.h" -#include "miscstruct.h" -#include "ddpex3.h" -#include "PEXErr.h" -#include "miStruct.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "gcstruct.h" -#include "miLight.h" -#include "ddpex2.h" -#include "pexos.h" - - -static ddpex3rtn miClipTriStrip(); -static ddpex3rtn miCullTriStrip(); -static ddpex3rtn miDepthCueTriStrip(); -static ddpex3rtn Complete_TriFacetList(); -static ddpex3rtn Calculate_TriStrip_Facet_Normal(); -static ddpex3rtn Calculate_TriStrip_Vertex_Color_and_Normal(); -static ddpex3rtn Breakup_TriStrip(); - -/*++ - | - | Function Name: miTriangleStrip - | - | Function Description: - | Handles the triangle strip OC. - | - | Note(s): - | - --*/ - -ddpex3rtn -miTriangleStrip(pRend, pExecuteOC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - miGenericStr *pExecuteOC; -{ - -/* calls */ - ddpex3rtn miTransform(); - ddpex3rtn miConvertVertexColors(); - ddpex3rtn miConvertFacetColors(); - ddpex3rtn miLightTriStrip(); - ddpex3rtn miRenderTriStrip(); - ddpex3rtn ComputeMCVolume(); - -/* Local variable definitions */ - miTriangleStripStruct *ddTri - = (miTriangleStripStruct *)(pExecuteOC+1); - miListHeader *input_list = &(ddTri->points); /* Input points */ - listofddFacet *input_facet = ddTri->pFacets; /* facets */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *color_list, - *mc_list, - *wc_list, - *mc_clist, - *light_list, - *cc_list, - *clip_list, - *cull_list, - *dcue_list, - *dc_list; - - listofddFacet *color_facet, - *mc_facet, - *wc_facet, - *light_facet, - *cc_facet, - *clip_facet, - *cull_facet, - *dc_facet; - listofddPoint *sp; - int i, j; - ddpex3rtn status; - ddPointType out_type; - ddUSHORT clip_mode; - - - /* - * First, check data input - * At this point, the data is all in one list - */ - - if (input_list->numLists == 0) return(Success); - - /* - * Convert per-vertex and per-facet colors to rendering color model. - * Note that this implementation only supports rgb float. - */ - - if (DD_IsVertColour(input_list->type)) { - if (status = miConvertVertexColors(pRend, - input_list, PEXRdrColourModelRGB, - &color_list)) - return (status); - } else { - color_list = input_list; - } - - if ((input_facet) && (DD_IsFacetColour(input_facet->type))) { - if (status = miConvertFacetColors(pRend, - input_facet, PEXRdrColourModelRGB, - &color_facet)) - return (status); - } else { - color_facet = input_facet; - } - - /* Check for Model clipping */ - - if (pddc->Dynamic->pPCAttr->modelClip == PEXClip) { - - /* Compute modelling coord version of clipping volume */ - ComputeMCVolume(pRend, pddc); - - clip_mode = MI_MCLIP; - - /* Tranform points to 4D for clipping */ - out_type = color_list->type; - if (status = miTransform(pddc, - color_list, &mc_clist, - ident4x4, - ident4x4, - DD_SetVert4D(out_type))) - return (status); - - - if (status = miClipTriStrip(pddc, mc_clist, color_facet, - &mc_list, &mc_facet, clip_mode)) - return (status); - - /* if nothing left after model clip, return early */ - if (mc_list->numLists <= 0) return(Success); - - } else { - mc_list = color_list; - mc_facet = color_facet; - } - - /* Note - After clipping the triangle strip may have - * decomposed into a number of separate triangle strips - */ - - - /* - * Next, check lighting requirements - */ - - if (pddc->Static.attrs->reflModel != PEXReflectionNoShading) { - - /* Transform to WC prior to applying lighting */ - out_type = mc_list->type; - if (DD_IsVertNormal(out_type)) VALIDATEINVTRMCTOWCXFRM(pddc); - if (status = miTransform(pddc, - mc_list, &wc_list, - pddc->Dynamic->mc_to_wc_xform, - pddc->Static.misc.inv_tr_mc_to_wc_xform, - DD_SetVert4D(out_type))) - return (status); - - /* Transform facet normals if necessary */ - if ((mc_facet) && - (mc_facet->numFacets > 0) && - (DD_IsFacetNormal(mc_facet->type))) { - VALIDATEINVTRMCTOWCXFRM(pddc); - if (status = miFacetTransform(pddc, - mc_facet, &wc_facet, - pddc->Static.misc.inv_tr_mc_to_wc_xform)) - return (status); - } else wc_facet = mc_facet; - - /* Apply lighting */ - if (status = miLightTriStrip(pRend, pddc, - wc_list, wc_facet, - &light_list, &light_facet)) - return (status); - - - /* Transform to CC for clipping */ - if (DD_IsVertNormal(light_list->type)) VALIDATEINVTRWCTOCCXFRM(pddc); - if (status = miTransform(pddc, - light_list, &cc_list, - pddc->Dynamic->wc_to_cc_xform, - pddc->Static.misc.inv_tr_wc_to_cc_xform, - light_list->type)) - return (status); - - /* Transform facet normals if necessary */ - if ( (light_facet) && - (light_facet->numFacets > 0) && - (DD_IsFacetNormal(light_facet->type)) ) { - VALIDATEINVTRWCTOCCXFRM(pddc); - if (status = miFacetTransform(pddc, - light_facet, &cc_facet, - pddc->Static.misc.inv_tr_wc_to_cc_xform)) - return (status); - } else cc_facet = light_facet; - - } else { - - /* PEXReflectionNoShading case */ - - /* Now transform points and facets normals to CC */ - out_type = mc_list->type; - if (DD_IsVertNormal(out_type)) VALIDATEINVTRMCTOCCXFRM(pddc); - if (status = miTransform(pddc, - mc_list, &cc_list, - pddc->Dynamic->mc_to_cc_xform, - pddc->Static.misc.inv_tr_mc_to_cc_xform, - DD_SetVert4D(out_type))) - return (status); - - if ( (mc_facet) && - (mc_facet->numFacets > 0) && - (DD_IsFacetNormal(mc_facet->type)) ) { - VALIDATEINVTRMCTOCCXFRM(pddc); - if (status = miFacetTransform(pddc, - mc_facet, &cc_facet, - pddc->Static.misc.inv_tr_mc_to_cc_xform)) - return (status); - } else cc_facet = mc_facet; - - } - - /* View clip primitive */ - clip_mode = MI_VCLIP; - if (status = miClipTriStrip(pddc, cc_list, cc_facet, - &clip_list, &clip_facet, clip_mode)) - return (status); - - /* if nothing left after view clip, return early */ - if (clip_list->numLists <= 0) return(Success); - - /* Note - After View clipping, the triangle strip may have - * decomposed into a number of separate triangle strips - */ - - if (pddc->Dynamic->pPCAttr->cullMode) { - /* Now cull according to current culling mode */ - if (status = miCullTriStrip(pddc, clip_list, clip_facet, - &cull_list, &cull_facet)) - return (status); - - /* if nothing left after culling, return early */ - if (cull_list->numLists <= 0) return(Success); - } else { - cull_list = clip_list; - cull_facet = clip_facet; - } - - /* DEPTH CUEING */ - if (pddc->Dynamic->pPCAttr->depthCueIndex) { - miDepthCueTriStrip(pRend, cull_list, cull_facet, &dcue_list); - cull_list = dcue_list; - } - - /* Lastly, transform to DC coordinates */ - out_type = cull_list->type; - DD_SetVert2D(out_type); - DD_SetVertShort(out_type); - if (DD_IsVertNormal(out_type)) VALIDATEINVTRCCTODCXFRM(pddc); - if (status = miTransform(pddc, - cull_list, &dc_list, - pddc->Dynamic->cc_to_dc_xform, - pddc->Static.misc.inv_tr_cc_to_dc_xform, - out_type) ) - return (status); - - /* Transform facet normals if necessary */ - if ( (cull_facet) && - (cull_facet->numFacets > 0) && - (DD_IsFacetNormal(cull_facet->type)) ) { - VALIDATEINVTRCCTODCXFRM(pddc); - if (status = miFacetTransform(pddc, - cull_facet, &dc_facet, - pddc->Static.misc.inv_tr_cc_to_dc_xform)) - return (status); - } else dc_facet = cull_facet; - - return (pddc->Static.RenderProcs[TRISTRIP_RENDER_TABLE_INDEX](pRend, - pddc, - dc_list, - dc_facet)); -} -/*************************************************************************/ - -/*++ - | - | Function Name: miClipTriStrip - | - | Function Description: - | Clips a triangle strip. Note that this routine - | will return a triangle strip, though it sometimes creates - | "degenerate" (ie colinear vertices) triangles to achieve - | this result. At this point "hollow" filled triangles will - | exhibit clipping artifacts, (degenerate triangles) whereas - | "empty" fill with edge visibility enabled will not. - | - | Note(s): - | - | This routine uses a Sutherland-Hodgman approach for - | polygon clipping. (See, for example, Rodger's "Procedural - | Elements for Computer Graphics", pp 169-179). - | Each triangle strip is clipped successively against each (enabled) - | clipping boundary. - | - --*/ - -static -ddpex3rtn -miClipTriStrip(pddc, input_vert, input_fct, output_vert, output_fct,clip_mode) -/* in */ - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ - ddUSHORT clip_mode; -{ -/* uses */ - ddPointUnion in_ptP, in_ptQ, in_ptR; - ddPointUnion out_pt; - float t_ptP, t_ptQ, t_ptR; - char *in_fct, *out_fct; - miListHeader *vinput, *voutput, *list1, *list2; - listofddFacet *finput, *foutput, *fct_list1, *fct_list2; - listofddPoint *pddilist; - listofddPoint *pddolist; - int point_size; - int facet_size; - int pts_in_list; - int vert_count; - int new_facets; - int clip_plane, j, k, out_listnum; - ddUSHORT clipflags; - ddUSHORT current_clip; - int edge_offset; - ddHalfSpace *MC_HSpace; - ddVector3D PdotN, QdotN; - int clip_code; - ddULONG *edge_ptr; - char new_list; - ddpex3rtn status; - int num_planes; - - /* Vertex data must be homogeneous and contain more than two points - * for clipper - */ - if (!(DD_IsVert4D(input_vert->type)) - || (input_vert->numLists == 0)) return(1); - - /* - * Use the pre-defined clip lists for output - */ - - /* - * Must have edge flags in vertex if edges are to be drawn - - * otherwise, cannot determine wich edges are "original" and - * which edges where added by the clipper. - */ - if ((pddc->Static.attrs->edges != PEXOff) && - (!(DD_IsVertEdge(input_vert->type)))) - { - if (status = miAddEdgeFlag(pddc, input_vert, &list1)) return(status); - vinput = list1; - - } else { - /* Allocate an initial number of headers */ - list1 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list1, - MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)); - if (!list1->ddList) return(BadAlloc); - list1->type = input_vert->type; - list1->flags = input_vert->flags; - vinput = input_vert; /* Initially set to input list */ - } - - list2 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list2, - MI_ROUND_LISTHEADERCOUNT(vinput->numLists)); - if (!list2->ddList) return(BadAlloc); - list2->type = vinput->type; - list2->flags = vinput->flags; - voutput = list2; - - /* - * Initialize an output facet list. Note that facet lists are only - * maintained if an initial one is supplied. - * Note that twice the number of input facets is an upper bound, - * although there is probably a tighter "fit". - */ - if ((input_fct) && (input_fct->numFacets)) { - finput = input_fct; - DDFacetSIZE(input_fct->type, facet_size); - fct_list1 = MI_NEXTTEMPFACETLIST(pddc); - fct_list1->type = input_fct->type; - MI_ALLOCLISTOFDDFACET(fct_list1, 3*input_fct->numFacets, facet_size); - if (!fct_list1->facets.pFacetRgbFloatN) - return(BadAlloc); - foutput = fct_list1; - - fct_list2 = MI_NEXTTEMPFACETLIST(pddc); - fct_list2->type = input_fct->type; - MI_ALLOCLISTOFDDFACET(fct_list2, 3*input_fct->numFacets, facet_size); - if (!fct_list2->facets.pFacetRgbFloatN) - return(BadAlloc); - } else - finput = foutput = fct_list1 = fct_list2 = 0; - - /* - * Get point size so that this works for all point types - */ - DD_VertPointSize(vinput->type, point_size); - if DD_IsVertEdge(vinput->type) - DD_VertOffsetEdge(vinput->type, edge_offset); - - /* - * Each list is now clipped in turn against each (enabled) boundary. - */ - - if (clip_mode == MI_MCLIP) - num_planes = pddc->Static.misc.ms_MCV->numObj; - else num_planes = 6; - - if (clip_mode == MI_MCLIP) - MC_HSpace = (ddHalfSpace *)(pddc->Static.misc.ms_MCV->pList); - - for (clip_plane = 0; clip_plane < num_planes; clip_plane++) { - - /* do entire list against one clipping plane at a time */ - current_clip = 1 << clip_plane; /* current_clip is new clip bound */ - - /* - * Triangle strips begin with only one input and output - * vertex list. If a facet is found to be entirely out - * of bounds, A new list is started at the new included - * point. This new series of lists is clipped in turn - * against the next clipping planei, and may be decomposed into - * yet more lists. However, only a single facet list is - * maintained, at it is assumed that a one<->one correspondence - * exists between vertex triads and facets (within a single list) - * even if degenerate facets are added. - */ - - if (finput) { - in_fct = (char *)(finput->facets.pNoFacet); - MI_ALLOCLISTOFDDFACET(foutput, - (3*finput->numFacets), facet_size); - out_fct = (char *)(foutput->facets.pNoFacet); - } - - for (j = 0, out_listnum = 0, new_list = 1, new_facets = 0, - pddilist = vinput->ddList, pddolist = voutput->ddList, - voutput->numLists = 0; - j < vinput->numLists; j++) { - - - /* Don't process if not enough points */ - if ((vert_count = pddilist->numPoints) < 3) { - pddilist++; - continue; - } - - - /* Insure sufficient room for vertecies and degenerate points - * Note that twice the vertex count is an upper-bound for - * a clipped triangle(although there is probably a "tighter fit"). - */ - - MI_ALLOCLISTOFDDPOINT(pddolist, 2*vert_count, point_size); - out_pt = pddolist->pts; - if (!out_pt.ptr) return(BadAlloc); - - clip_code = 0; - /* Aquire first three points */ - /* and generate clip code */ - in_ptP.ptr = pddilist->pts.ptr; - COMPUTE_CLIP_PARAMS(in_ptP,t_ptP,0,clip_mode, - current_clip,MC_HSpace,clip_code); - in_ptQ.ptr = in_ptP.ptr + point_size; - COMPUTE_CLIP_PARAMS(in_ptQ, t_ptQ, 1, clip_mode, - current_clip,MC_HSpace,clip_code); - in_ptR.ptr = in_ptQ.ptr + point_size; - /* - * Initialize the output array. The output array is expected - * to always contain the first two points, so load them - - * clipped if necessary. - */ - switch(clip_code) - { - case 0: /* both P and Q are in bounds */ - COPY_POINT(in_ptP, out_pt, point_size); - out_pt.ptr += point_size; - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - pts_in_list = 2; - break; - case 1: /* P is out, Q is in */ - CLIP_AND_COPY(vinput->type, in_ptP, t_ptP, - in_ptQ, t_ptQ, out_pt); - out_pt.ptr += point_size; - COPY_POINT(in_ptQ, out_pt, point_size); - out_pt.ptr += point_size; - pts_in_list = 2; - break; - case 2: /* P is in, Q is out */ - COPY_POINT(in_ptP, out_pt, point_size); - out_pt.ptr += point_size; - CLIP_AND_COPY(vinput->type, in_ptQ, t_ptQ, - in_ptP, t_ptP, out_pt); - out_pt.ptr += point_size; - pts_in_list = 2; - break; - case 3: /* both are out */ - pts_in_list = 0; - break; - } - - /* - * For each vertex, clip a triangle. - * Each case assumes that points P & Q (the first and - * second points in the triangle, pointed to in the input - * list by in_ptR & in_ptQ) are already copied - * into the output array (clipped, if necessary and except for - * case 3), while R will be copied into the output array (pointed - * to by out_pt) if necessary during execution of the case - * statement. - * - * It is important to note that if a facet is completely - * rejected, a new list is formed. Also, to maintain - * the correct "sense" of the normals, if the new - * list is about to begin on an even facet #, a - * degenerate facet is placed at the beginning of the - * new list. - * - * Also, note that if additional facets are generated - * (cases 1,2,3,4,& 6) the artifact edge flag is set to zero. - * Within an edge flag, there are two bits determining edge - * visibility. Bit zero determines whether an edge is drawn - * between the current vertex N and vertex N-2, while bit one - * determines if an edge is drawn between edge N and N+1. - * If N-2 < 0 or N+1 > numfacets the edge is not drawn. - * - * 2_________ _4 - * /\ /|\ - * / \ / \ - * / \ / \ - * / \ / \ - * 1<--------+3+---------5 - * - * So, for the third element in the edge list, - * bit 0 indicates presence of an edge from 3 -> 4 - * (forward edge) - * bit 1 indicates presence of an edge from 3 -> 1 - * (backward edge) - * - * Also note that clipping in PHIGS does NOT - * display clipped edges along the boundaries, whereas fill - * area attribute HOLLOW does. This implementation does - * not handle the HOLLOW fill style properly in that respect. - * One possible solution is to use additional bits in the - * edge flag field. - */ - - for (k = 2; k < vert_count; k++) { - /* - * Clip the new triangle - * There are 8 possible ways that the triangle (P, Q, R) can - * be intersected by a clipping plane: - * - * P, Q, R in P, Q, R out - * P in Q, R out P, Q in R out P, R in, Q out - * Q in P, R out Q, R in P out - * R in P, Q out - * - * Each of these cases are handled separately. - */ - - new_list = 0; - COMPUTE_CLIP_PARAMS(in_ptR, t_ptR, 2, clip_mode, - current_clip,MC_HSpace,clip_code); - - switch(clip_code) - { - /* - * Case 0 - trivial accept P, Q, and R - * Proceed to next triangle. - */ - case 0: - COPY_POINT(in_ptR, out_pt, point_size); - out_pt.ptr += point_size; - pts_in_list++; - if (finput) { - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - ++new_facets; - } - break; - - /* - * Case 1 - P is outside, Q & R are inside clip zone. - * This is a complex case which results in the creation - * of several new triangles including a "degenerate" triangle - * (two identical endpoints). Point "A" and point "Q" are - * already in the output list. Output vertex list is A-Q-B-Q-R - * - * |Q+ |Q+ - * | /\ | /\ - * |/ \ |/ \ - * | \ ===> A+ \ - * /| \ | \ - * P+-|------+R B+------+R - * | | - * triangle PQR triangles AQB, QBQ(degenerate) - * & BQR - * - */ - case 1: - /* If edges are visible, - * we wish to disable the edge from - * Q to B. This edge is specified - * by the forward edge of the first Q, - * the forward edge of B, and the - * backward edge of the second Q - */ - if (pddc->Static.attrs->edges != PEXOff) { - out_pt.ptr -= point_size; - CLEAR_FWD_EDGE(out_pt.ptr, edge_offset); - /* edge from Q -> B */ - out_pt.ptr += point_size; - } - - CLIP_AND_COPY(vinput->type, in_ptP, t_ptP, - in_ptR, t_ptR, out_pt); - /* Places point "B" into output list */ - if (pddc->Static.attrs->edges != PEXOff) { - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /* edge from B -> Q */ - CLEAR_BKWD_EDGE(out_pt.ptr,edge_offset); - /* edge from B -> A */ - } - out_pt.ptr += point_size; - - COPY_POINT(in_ptQ, out_pt, point_size); /* degenerate point */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_BKWD_EDGE(out_pt.ptr,edge_offset); - out_pt.ptr += point_size; - - COPY_POINT(in_ptR, out_pt, point_size); - out_pt.ptr += point_size; - pts_in_list += 3; - - if (finput) { - /* - * Add three identical facets - */ - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - new_facets += 3; - } - break; - - /* - * Case 2 - P is inside, Q is outside, R is inside. - * Points P and A are already in the output list. - * Output list is P-A-R-B-R : disable edges from - * A to R - * - * Q+ - * /\ A B - * ---------- ---+--+--- - * / \ ===> / \ - * / \ / \ - * P+--------+R P+--------+R - * - * triangle PQR triangles PAR, ARB, RBR - * - */ - case 2: - if (pddc->Static.attrs->edges != PEXOff) { - out_pt.ptr -= point_size; - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from A -> R */ - out_pt.ptr += point_size; - } - - COPY_POINT(in_ptR, out_pt, point_size); - /* Place point "R" into output list */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from R -> B */ - out_pt.ptr += point_size; - - CLIP_AND_COPY(vinput->type, in_ptQ, t_ptQ, - in_ptR, t_ptR, out_pt); - /*place point "B" into output list */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_BKWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from B -> A */ - out_pt.ptr += point_size; - - COPY_POINT(in_ptR, out_pt, point_size); /* degenerate point */ - out_pt.ptr += point_size; - pts_in_list += 3; - - if (finput) { - /* - * Add three identical facets - */ - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - new_facets += 3; - } - break; - - /* - * Case 3 - P and Q outside, R inside. - * Note - this is the first triangle in a new list - * - * Output list is A-B-R. If beginning on odd facet - * output list is B-A-B-R - * - * - * Q+ | | - * /\ | | - * / \| | - * / | ===> B+ - * / |\ |\ - * P+------|-+R A+-+R - * | | - * triangle PQR triangle ABR or BABR - * - * - */ - case 3: - /* - * Note - this is the first triangle in a - * list, so copy the first two points in - * addition to copying the last point. Also, - * in model clipping we must be careful to - * preserve the "sense" of the normals, so - * add a degenerate facet if necessary. - */ - - if(IS_ODD(k)) { - CLIP_AND_COPY(vinput->type, in_ptQ, t_ptQ, - in_ptR, t_ptR, out_pt); - /*Places point "B" into output list */ - out_pt.ptr += point_size; - pts_in_list++; - if (finput) { - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - ++new_facets; - } - } - - CLIP_AND_COPY(vinput->type, in_ptP, t_ptP, - in_ptR, t_ptR, out_pt); - /*Places point "A" into output list */ - - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /*Edge from A -> B */ - out_pt.ptr += point_size; - - CLIP_AND_COPY(vinput->type, in_ptQ, t_ptQ, - in_ptR, t_ptR, out_pt); - /*Places point "B" into output list */ - out_pt.ptr += point_size; - - - COPY_POINT(in_ptR, out_pt, point_size); - /*Places point "R" into output list */ - out_pt.ptr += point_size; - - if (finput) { - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - ++new_facets; - } - pts_in_list += 3; - break; - - /* - * Case 4 - P and Q inside, R outside - * Output list is P-Q-B-Q-A - * - * Q+ | Q+ | - * /\ | /\ | - * / \| / \| - * / | ===> / +A - * / |\ / | - * P+------|-+R P+------+B - * | | - * - * triangle PQR triangles PQB, BQB, BQA - * - */ - case 4: - - if (pddc->Static.attrs->edges != PEXOff) { - out_pt.ptr -= point_size; - CLEAR_FWD_EDGE(out_pt.ptr, edge_offset); - /* edge from Q -> B */ - out_pt.ptr += point_size; - } - - CLIP_AND_COPY(vinput->type, in_ptR, t_ptR, - in_ptP, t_ptP, out_pt); - /* Places "B" into output */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from B -> Q */ - out_pt.ptr += point_size; - - COPY_POINT(in_ptQ, out_pt, point_size); - /* Places "Q" into output */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from Q -> B */ - out_pt.ptr += point_size; - - CLIP_AND_COPY(vinput->type, in_ptR, t_ptR, - in_ptQ, t_ptQ, out_pt); - /* Places "A" into output */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_BKWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from A -> B */ - out_pt.ptr += point_size; - pts_in_list += 3; - - if (finput) { - /* - * Add three identical facets - */ - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - new_facets += 3; - } - break; - - /* - * Case 5 - P and R are outside, Q in inside. - * Output list is A-Q-B. A and Q already in list - * - * Q+ Q+ - * /\ /\ - * ---------- ---+--+--- - * / \ ===> A B - * / \ - * P+--------+R - * - * triangle PQR triangles AQB - * - */ - case 5: - CLIP_AND_COPY(vinput->type, in_ptR, t_ptR, - in_ptQ, t_ptQ, out_pt); - /*Places point "B" into output list */ - if (pddc->Static.attrs->edges != PEXOff) - CLEAR_BKWD_EDGE(out_pt.ptr,edge_offset); - /* Edge from B -> A */ - out_pt.ptr += point_size; - pts_in_list++; - - if (finput) { - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - ++new_facets; - } - break; - - /* - * Case 6 - P is inside, R and Q are outside - * Output list is: P-A-B - * - * |Q+ | - * | /\ | - * |/ \ | - * | \ ===> +A - * /| \ /| - * P+-|------+R P+-+B - * | | - * triangle PQR triangles - * - */ - case 6: - if (pddc->Static.attrs->edges != PEXOff) { - out_pt.ptr -= point_size; - CLEAR_FWD_EDGE(out_pt.ptr,edge_offset); - out_pt.ptr += point_size; - } - - CLIP_AND_COPY(vinput->type, in_ptR, t_ptR, - in_ptP, t_ptP, out_pt); - /* Places "B" into output list */ - out_pt.ptr += point_size; - pts_in_list += 1; - - if (finput) { - COPY_FACET(in_fct, out_fct, facet_size); - out_fct += facet_size; - ++new_facets; - } - break; - - /* - * Case 7 - P, Q, and R are outside - * trivial rejection; begin new list - * at first "included" point if - * sufficient number of points - * - * Q+ - * /\ - * / \ - * / \ ===> - * / \ - * P+--------+R - * - */ - case 7: - /* Complete initialization of last list */ - if (pts_in_list > 2) { - /* Generate a new output list, increment list count. */ - pddolist->numPoints = pts_in_list; - voutput->numLists++; - out_listnum++; - MI_ALLOCLISTHEADER(voutput, - MI_ROUND_LISTHEADERCOUNT(voutput->numLists)); - /* skip to next output list */ - pddolist = voutput->ddList + out_listnum; - - /* Insure sufficient room for remaining verts - and degenerate points */ - MI_ALLOCLISTOFDDPOINT(pddolist, - 2*(vert_count - k), point_size); - - out_pt.ptr = pddolist->pts.ptr; - if (!out_pt.ptr) return(BadAlloc); - } - - else { - /* Not enough points for output list */ - pddolist->numPoints = 0; - } - - /* Look for next point inside bounds */ - do { - clip_code = 0; - in_ptR.ptr += point_size; - if (finput) in_fct += facet_size; - k++; - if (k == vert_count) - break; - COMPUTE_CLIP_PARAMS(in_ptR, t_ptR, 2, clip_mode, - current_clip,MC_HSpace,clip_code); - } while(clip_code); - if (k < vert_count) { - /* - * k is incremented by the for loop, but because we have - * a new_list, the pointers won't get bumped. Therefore, - * k must be decremented to keep it consistent with the - * pointers for reentering the for loop. - * - * However, k must not be adjusted when k == vert_count, - * because in this case P, Q and R are all clipped and it - * is necessary to leave k == vert_count to terminate the - * for loop. - */ - k--; - - /* Get P & Q; re-enter loop. - * Next case encountered will be 3, which will - * handle the odd-even rule for normals. - */ - in_ptQ.ptr = in_ptR.ptr - point_size; - in_ptP.ptr = in_ptQ.ptr - point_size; - clip_code = 0; /* Q's ORd in at top of loop */ - COMPUTE_CLIP_PARAMS(in_ptP, t_ptP, 0, clip_mode, - current_clip,MC_HSpace,clip_code); - COMPUTE_CLIP_PARAMS(in_ptQ, t_ptQ, 1, clip_mode, - current_clip,MC_HSpace,clip_code); - } - new_list = 1; - pts_in_list = 0; /*start a new list*/ - break; - - } /* end of cases */ - - if (!new_list) { - /* Prepare for next point */ - in_ptP = in_ptQ; t_ptP = t_ptQ; - in_ptQ = in_ptR; t_ptQ = t_ptR; - in_ptR.ptr += point_size; - if (finput) in_fct += facet_size; - clip_code >>= 1; - } - - } /* end of single list processing */ - - if (pts_in_list > 2) { /* Got some points! */ - /* skip to next list, increment list count. */ - pddolist->numPoints = pts_in_list; - ++pddolist; - ++out_listnum; - ++voutput->numLists; - } - else pddolist->numPoints = 0; /* use same list */ - - pddilist++; - } /* end of list of lists processing */ - - if (foutput) foutput->numFacets = new_facets; - - if (out_listnum > 0) { - /* Use result of previous clip for input to next clip */ - vinput = voutput; - if (voutput == list2) voutput = list1; /* ping-pong */ - else voutput = list2; - - if (finput) { - /* Use result of previous clip for input to next clip */ - finput = foutput; - if (foutput == fct_list2) foutput = fct_list1; - else foutput = fct_list2; - } - } else { - /* If no lists, exit loop */ - vinput = voutput; - finput = foutput; - } - if (clip_mode == MI_MCLIP) MC_HSpace++; - - } /* end of processing for all clip planes */ - - - /* Current input list is last processed (clipped) list */ - *output_vert = vinput; - if (finput) *output_fct = finput; - else *output_fct = input_fct; - - - return (Success); - -} - - - -/*++ - | - | miLightTriStrip - | - | Perform lighting calculations for the vertex or facet - | data provided according to the current attributes. - | - --*/ - -ddpex3rtn -miLightTriStrip(pRend, pddc, input_vert, input_fct, output_vert, output_fct) - ddRendererPtr pRend; /* renderer handle */ - miDDContext *pddc; /* dd Context pointer */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ -{ -/* calls */ - ddpex3rtn miApply_Lighting(); - ddpex3rtn miFilterPath(); - -/* uses */ - listofddFacet *fct_list, *broken_fct; - miListHeader *out_vert, *broken_list; - ddVector3D in_vertnorm; - ddRgbFloatColour in_vertcolour; - ddRgbFloatNormal *in_fct; - ddRgbFloatColour *out_fct; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddPointUnion in_pt, out_pt; - int i, j, k, num_facets, - inpoint_size, outpoint_size; - ddpex3rtn status; - - - /* Look for empty fill style. Still might have to render edges. */ - if (pddc->Static.attrs->intStyle == PEXInteriorStyleEmpty) - return(Success); - - /* - * First, Insure that the vertex and/or facet data - * is sufficient for the current Surface Interpolation method. - * Note that this implementation does not support - * PEXSurfaceInterpDotProduct and PEXSurfaceInterpNormal and - * that these surface interpolation types are approximated by - * PEXSurfaceInterpColour. The cases dealt with here, therefore, - * are constant surface color (thus a single color is computed - * per facet) and interpolated surface color (thus a color - * per vertex is required). - */ - - DD_VertPointSize(input_vert->type, inpoint_size); - switch(pddc->Static.attrs->surfInterp) { - - case PEXSurfaceInterpNone: /* Flat shading */ - - if ((!input_fct) || - (input_fct->numFacets == 0) || - (!( (DD_IsFacetColour(input_fct->type)) && - (DD_IsFacetNormal(input_fct->type))))) { - - Complete_TriFacetList(pRend, input_vert, input_fct, - output_fct); - - input_fct = *output_fct; - } - - /* - * Should have facets with normals and surface colors now. - * Since we are flat shading, there is no further use - * for per-vertex color or normal data (however, leave - * any edge information). Remove it to prevent confusion - * further down the pipeline. - */ - if ( (DD_IsVertNormal(input_vert->type)) || - (DD_IsVertColour(input_vert->type)) ) { - if (status = miFilterPath(pddc, input_vert, output_vert, - ((1 << 3) | 1) )) - return(status); - } else { - *output_vert = input_vert; - } - - /* - * Now allocate storage for the output facet list - * Note that the output facet list only contains colors. - */ - *output_fct = fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->numFacets = input_fct->numFacets; - fct_list->type = DD_FACET_RGBFLOAT; - MI_ALLOCLISTOFDDFACET(fct_list, input_fct->numFacets, - sizeof(ddRgbFloatColour)); - if (!(out_fct = fct_list->facets.pFacetRgbFloat)) return(BadAlloc); - in_fct = input_fct->facets.pFacetRgbFloatN; - pddilist = input_vert->ddList; - for(i = 0, in_pt.ptr = pddilist->pts.ptr; - i < input_vert->numLists; i++) { - - /* - * Compute lighted facet color for each facet. - * Facet color is simply the sum of the lighting contributions - * from each light source. - */ - for (k = 2; k < pddilist->numPoints; k++) { - - /* One point at a time. Again, it is assumed there is a */ - /* one<->one correspondence between the points in the lists */ - /* and individual facets. Also note that we are associating */ - /* arbitrarily the first point with the "position" of the */ - /* facet. Perhaps a more correct method would use that average */ - - if (status = miApply_Lighting(pRend, pddc, - in_pt.p4Dpt, - &(in_fct->colour), - &(in_fct->normal), - out_fct )) - return(status); - - in_pt.ptr += inpoint_size; - in_fct++; - out_fct++; - } - /* skip to next input vertex list */ - pddilist++; - } - break; - - case PEXSurfaceInterpColour: - case PEXSurfaceInterpDotProduct: - case PEXSurfaceInterpNormal: - - if (!DD_IsVertNormal(input_vert->type)) { - /* Here, and only here, we must create a separate list for - * facet of the triangle strip. The reason for this is that - * we can only associate with each vertex a single normal, - * when in reality a vertex has different normals depending - * upon which facet is being rendered. The lighting effects - * only appear in positional lights, because the dot - * product with the vertex normals is indeed dependent upon - * position */ - - if (i = Breakup_TriStrip(pddc, input_vert, input_fct, - &broken_list, &broken_fct)) return (i); - input_vert = broken_list; - input_fct = broken_fct; - } - - /* Insure sufficient info for calculation */ - if ( (!DD_IsVertColour(input_vert->type)) || - (!DD_IsVertNormal(input_vert->type)) ) { - Calculate_TriStrip_Vertex_Color_and_Normal(pRend, input_vert, - input_fct, - output_vert); - input_vert = *output_vert; - } - - /* From here facet data only used in culling operation */ - *output_fct = input_fct; - - /* Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, - MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = DD_RGBFLOAT_POINT4D; - if (pddc->Static.attrs->edges != PEXOff && - DD_IsVertEdge(input_vert->type)) { - DD_SetVertEdge(out_vert->type); - } - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - DD_VertPointSize(out_vert->type, outpoint_size); - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - - for(i = 0; i < input_vert->numLists; i++) { - - pddolist->numPoints = pddilist->numPoints; - MI_ALLOCLISTOFDDPOINT(pddolist, pddolist->numPoints, - outpoint_size); - if (!(out_pt.ptr = pddolist->pts.ptr)) return(BadAlloc); - - for (j = 0, in_pt.ptr = pddilist->pts.ptr; - j < pddilist->numPoints; j++) { - - /* Copy over the coordinate info */ - *out_pt.p4Dpt = *in_pt.p4Dpt; - - /* move output pointer to colour field */ - out_pt.p4Dpt++; - - /* miApplyLighting works on a single point at a time */ - if (status = miApply_Lighting(pRend, pddc, - in_pt.p4Dpt, - &(in_pt.pRgbFloatNpt4D->colour), - &(in_pt.pRgbFloatNpt4D->normal), - out_pt.pRgbFloatClr)) - return(status); - - /* increment pointers */ - in_pt.pRgbFloatNpt4D++; - out_pt.pRgbFloatClr++; - - if (DD_IsVertEdge(out_vert->type)) { - *out_pt.pEdge = *in_pt.pEdge; - out_pt.pEdge++; - in_pt.pEdge++; - } - - - } - /* skip to next input and output vertex list */ - pddilist++; - pddolist++; - } - - break; - - default: - *output_vert = input_vert; - *output_fct = input_fct; - - } - - return(Success); -} - -/*++ - | - | Complete_TriFacetList(pRend, input_vert, output_fct) - | - | Generates a facet list with colors and normals - | This routine should get folded into one with - | Create_Normals, with some form of flag to signal - | the type of output required. It would also be the - | place to put back-face attribute distinction. - | - --*/ -/* calls */ - -static -ddpex3rtn -Complete_TriFacetList(pRend, input_vert, input_fct, output_fct) - ddRendererPtr pRend; /* renderer handle */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - listofddFacet **output_fct; /* output facet data */ -{ -/* local */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - listofddFacet *fct_list; - ddRgbFloatNormal *out_fct; - listofddPoint *pddlist; - ddPointUnion in_pt, tmp_pt; - ddFacetUnion in_fct; - int point_size; - ddRgbFloatPoint4D *vert1, *vert2, *vert3; - int total_facets; - int i,j; - float length; - ddpex3rtn status; - char have_colors, have_normals; - - have_colors = have_normals = 0; - - /* What data must be added to output facet list ? */ - if (!(input_fct) || (input_fct->type == DD_FACET_NONE)) { - /* - * Since we are creating the facet list for the first - * we need to learn how many verticies are in all the - * lists. - */ - pddlist = input_vert->ddList; - for (i = 0, total_facets = 0; i < input_vert->numLists; pddlist++, i++) - total_facets += (pddlist->numPoints - 2); - } else { - /* use input facet information */ - total_facets = input_fct->numFacets; - in_fct.pNoFacet = input_fct->facets.pNoFacet; - if DD_IsFacetNormal(input_fct->type) have_normals = ~0; - if DD_IsFacetColour(input_fct->type) have_colors = ~0; - } - - if ((have_colors) && (have_normals)) { /* Why are we here? */ - *output_fct = input_fct; - return(Success); - } - - /* - * Allocate storage for the facet list - */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = DD_FACET_RGBFLOAT_NORM; - MI_ALLOCLISTOFDDFACET(fct_list, total_facets, sizeof(ddRgbFloatNormal)); - if (!fct_list->facets.pNoFacet) return(BadAlloc); - out_fct = (ddRgbFloatNormal *)fct_list->facets.pFacetRgbFloatN; - - DD_VertPointSize(input_vert->type, point_size); - - /* Don't process if insufficient number of points */ - - if (input_vert->numLists > 0) { - - pddlist = input_vert->ddList; - - for (i = 0; i < input_vert->numLists; i++) { - - in_pt.ptr = pddlist->pts.ptr; - - for (j = 2; j < pddlist->numPoints; j++) { - - /* - * Compute "intrinsic" color of facet. - * There is a "hierarchy" of sources for a facet's intrinsic - * color: - * vertex_colors present? facet_color = - * vertex_color of 1st point of facet - * else facet_color present? facet_color = facet_color - * else facet_color = PC_surface_color - * Note - this needs to be enhanced, using a dot product - * with the eye position to determine which surface color - * should be assigned in the case of front/back face - * distinguishing. this entire routine might get rolled into - * miLightTriStrip, and the correct color and reflectance - * model get passed into miApplyLighting. - */ - - if (DD_IsVertColour(input_vert->type)) { - - out_fct->colour.red=out_fct->colour.green=out_fct->colour.blue=0.0; - vert1 = in_pt.pRgbFloatpt4D; - tmp_pt.ptr = in_pt.ptr + point_size; - vert2 = tmp_pt.pRgbFloatpt4D; - tmp_pt.ptr += point_size; - vert3 = tmp_pt.pRgbFloatpt4D; - - out_fct->colour.red = ( vert1->colour.red + - vert2->colour.red + - vert3->colour.red )/3.0; - out_fct->colour.green = ( vert1->colour.green + - vert2->colour.green + - vert3->colour.green )/3.0; - out_fct->colour.blue = ( vert1->colour.blue + - vert2->colour.blue + - vert3->colour.blue )/3.0; - - } else if (have_colors) { - out_fct->colour = *in_fct.pFacetRgbFloat; - in_fct.pFacetRgbFloat++; - } else { - /* use front face colors. This needs to get generalized - to deal with back-facing attributes*/ - out_fct->colour = - (pddc->Static.attrs->surfaceColour.colour.rgbFloat); - } - - if (!(have_normals)) { - /* - * Compute surface normal. Normals are required in - * Apply_Lighting for directional and positional lights, - * as well as culling (if enabled). One COULD check - * for ambient only, no culling, to optimize. - * - * The Surface normal is the cross product - * of three non-colinear points, in correct order. - */ - - vert1 = in_pt.pRgbFloatpt4D; - tmp_pt.ptr = in_pt.ptr + point_size; - vert2 = tmp_pt.pRgbFloatpt4D; - tmp_pt.ptr += point_size; - vert3 = tmp_pt.pRgbFloatpt4D; - - if IS_ODD(j) { - CROSS_PRODUCT((&(vert3->pt)), (&(vert2->pt)), (&(vert1->pt)), - &(out_fct->normal)); - } - else { - CROSS_PRODUCT((&(vert1->pt)), (&(vert2->pt)), (&(vert3->pt)), - &(out_fct->normal)); - } - - NORMALIZE_VECTOR(&(out_fct->normal), length); - - /* Initialize to zero if triangle is - * degenerate and points are co-linear - */ - - if NEAR_ZERO(length) { - /* degenerate facet */ - (out_fct->normal.x = 0.0); - (out_fct->normal.y = 0.0); - (out_fct->normal.z = 0.0); - } - } else { - /* use input facet normals */ - out_fct->normal = *in_fct.pFacetN; - in_fct.pFacetN++; - } - - /* Process next facet */ - out_fct++; - in_pt.ptr += point_size; - } - - pddlist++; - } - - fct_list->numFacets = total_facets; - fct_list->type = DD_FACET_RGBFLOAT_NORM; - - } else { - fct_list->type = DD_FACET_NONE; - fct_list->numFacets = 0; - } - - *output_fct = fct_list; - return(Success); - -} - -/*++ - | - | Calculate_TriStrip_Facet_Normal - | - | Add facet normals to a facet list. - | Here we are counting on the fact that there is a one to one - | correspondance between input facets and vertex ordering. - | - --*/ -static -ddpex3rtn -Calculate_TriStrip_Facet_Normal(pddc, input_vert, input_fct, output_fct) - miDDContext *pddc; - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - listofddFacet **output_fct; /* output facet data */ -{ - - listofddFacet *fct_list; - ddRgbFloatColour *in_fct; - ddFacetUnion out_fct; - listofddPoint *pddlist; - ddPointUnion in_pt, nxt_pt; - ddVector3D normal; - int point_size; - ddCoord3D *vert1, *vert2, *vert3; - int numfacets; - int i,j; - float length; - - - /* Some quick error checking */ - if ((input_fct) && (DD_IsFacetNormal(input_fct->type))) return(Success); - - - /* - * First, allocate storage for the facet list - */ - fct_list = MI_NEXTTEMPFACETLIST(pddc); - if ((input_fct) && DD_IsFacetColour(input_fct->type)) { - in_fct = input_fct->facets.pFacetRgbFloat; - fct_list->type = DD_FACET_RGBFLOAT_NORM; - numfacets = input_fct->numFacets; - MI_ALLOCLISTOFDDFACET(fct_list, numfacets, sizeof(ddRgbFloatNormal)); - } else { - in_fct = 0; - fct_list->type = DD_FACET_NORM; - - - /* Determine the total number of facets in all the lists */ - for (i = 0, numfacets = 0, pddlist = input_vert->ddList; - i < input_vert->numLists; pddlist++, i++) - numfacets += (pddlist->numPoints - 2); - - MI_ALLOCLISTOFDDFACET(fct_list, numfacets, sizeof(ddVector3D)); - } - - fct_list->numFacets = numfacets; - if (!fct_list->facets.pNoFacet) return(BadAlloc); - - /* Otherwise... */ - out_fct = fct_list->facets; - DD_VertPointSize(input_vert->type, point_size); - - /* Don't process if no facets (!) */ - if (numfacets == 0) return(1); - - else { - for(i = 0, pddlist = input_vert->ddList; - i < input_vert->numLists; i++) { - for (j = 2, in_pt.ptr = pddlist->pts.ptr; - j < pddlist->numPoints; j++) { - - /* Copy the input facet color */ - if (in_fct) { - *out_fct.pFacetRgbFloat = *in_fct; - in_fct++; - } - - /* Calculate and copy normal */ - - vert1 = in_pt.p3Dpt; - nxt_pt.ptr = in_pt.ptr + point_size; - vert2 = nxt_pt.p3Dpt; - nxt_pt.ptr += point_size; - vert3 = nxt_pt.p3Dpt; - - if (IS_ODD(j)) { - CROSS_PRODUCT(vert3, vert2, vert1, &normal); - } else { - CROSS_PRODUCT(vert1, vert2, vert3, &normal); - } - - NORMALIZE_VECTOR(&normal, length) - - /* Initialize to zero if triangle is - * degenerate and points are co-linear - */ - - if (length == 0.0) { - (normal.x = 0.0); - (normal.y = 0.0); - (normal.z = 0.0); - } - - - if (in_fct) (out_fct.pFacetRgbFloatN++)->normal = normal; - else *(out_fct.pFacetN++) = normal; - - in_pt.ptr += point_size; - } - pddlist++; - } - } - - *output_fct = fct_list; - - return(Success); -} - - -/*++ - | - | Breakup_TriStrip - | - | Breaks up a triangle strip into as many lists as there are facets. - | This is necessary for shading interpolation methods as we need to - | facilitate a set of normals per facet. - | - | - | - --*/ -static -ddpex3rtn -Breakup_TriStrip(pddc, input_vert, input_fct, output_vert, output_fct) - miDDContext *pddc; - miListHeader *input_vert; - miListHeader **output_vert; - listofddFacet *input_fct; /* input facet data */ - listofddFacet **output_fct; /* output facet data */ -{ - miListHeader *list1; - listofddFacet *fct_list; - ddRgbFloatColour *in_fct; - ddFacetUnion out_fct; - listofddPoint *pddilist, *pddolist; - ddPointUnion pt_in, nxt_pt; - char *in_vert, *out_vert; - int point_size; - int numfacets, facetofpoints; - int i,j; - - - - /* make sure that we have a facet list, and that it has normals */ - if (!((input_fct) && (DD_IsFacetNormal(input_fct->type)))) { - if (i = Calculate_TriStrip_Facet_Normal(pddc, input_vert, - input_fct, &fct_list)) - return(i); - input_fct = fct_list; - } - - list1 = MI_NEXTTEMPDATALIST(pddc); - MI_ALLOCLISTHEADER(list1, - MI_ROUND_LISTHEADERCOUNT(input_fct->numFacets)); - if (!list1->ddList) return(BadAlloc); - list1->type = input_vert->type; - list1->flags = input_vert->flags; - - list1->numLists = input_fct->numFacets; - - - DD_VertPointSize(input_vert->type, point_size); - facetofpoints = 3 * point_size; - - for(i = 0, pddilist = input_vert->ddList, - pddolist = list1->ddList; - i < input_vert->numLists; i++) { - - for (j = 2, pt_in.ptr = pddilist->pts.ptr; - j < pddilist->numPoints; j++) { - - MI_ALLOCLISTOFDDPOINT(pddolist, 1, facetofpoints); - - /* - * Note that to preserver correct normals, must - * flip the order of the vertices every other facet. - */ - if IS_ODD(j) { - - in_vert = pt_in.ptr + 2*point_size; - out_vert = pddolist->pts.ptr; - memcpy( out_vert, in_vert, point_size); - in_vert -= point_size; out_vert += point_size; - memcpy( out_vert, in_vert, point_size); - out_vert += point_size; - memcpy( out_vert, pt_in.ptr, point_size); - - } else { - - memcpy( pddolist->pts.ptr, pt_in.ptr, facetofpoints); - - } - - pddolist->numPoints = 3; - pddolist++; /* one list per facet */ - pt_in.ptr += point_size; - } - pddilist++; - } - - *output_fct = input_fct; - *output_vert = list1; - return(Success); -} - - - - - -/*++ - | - | Calculate_TriStrip_Vertex_Color_and_Normal - | - | Add vertex normals and colors to a vertex list. - | - --*/ -static -ddpex3rtn -Calculate_TriStrip_Vertex_Color_and_Normal(pRend, input_vert, input_fct, - output_vert) - - ddRendererPtr pRend; /* renderer handle */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *out_vert; - listofddFacet *fct_list; - ddRgbFloatNormal *out_fct; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddPointUnion in_pt, out_pt; - ddFacetUnion in_fct; - int inpoint_size, outpoint_size; - int facet_size; - int numFacets=0; - int i,j; - ddpex3rtn status; - - - /* Some quick error checking */ - if ((DD_IsVertNormal(input_vert->type)) && - (DD_IsVertColour(input_vert->type))) - return(Success); - - /* Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, - MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = DD_RGBFLOAT_NORM_POINT4D; - if (pddc->Static.attrs->edges != PEXOff && - DD_IsVertEdge(input_vert->type)) { - DD_SetVertEdge(out_vert->type); - } - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - - DD_VertPointSize(input_vert->type, inpoint_size); - DD_VertPointSize(out_vert->type, outpoint_size); - - /* Compute facet normals if no per-vertex normals with data */ - if ( (!(DD_IsVertNormal(input_vert->type))) && - ((!(input_fct)) || (!(DD_IsFacetNormal(input_fct->type)))) ) { - - if (i = Calculate_TriStrip_Facet_Normal(pddc, input_vert, - input_fct, &fct_list)) - return(i); - - input_fct = fct_list; - } - - if ((input_fct) && (input_fct->numFacets > 0)) { - in_fct = input_fct->facets; - DDFacetSIZE(input_fct->type, facet_size); - } - else in_fct.pNoFacet = 0; - - - for(i = 0; i < input_vert->numLists; i++) { - pddolist->numPoints = pddilist->numPoints; - in_pt.ptr = pddilist->pts.ptr; - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - outpoint_size); - if (!(out_pt.ptr = pddolist->pts.ptr)) return(BadAlloc); - - for (j = 0, in_pt.ptr = pddilist->pts.ptr, - out_pt.ptr = pddolist->pts.ptr; - j < pddilist->numPoints; j++) { - - /* First copy over coordinate data */ - *out_pt.p4Dpt = *in_pt.p4Dpt; - in_pt.p4Dpt++; - out_pt.p4Dpt++; - - /* - * Next color - * Colour is derived first from the vertex, second from the - * facet, and third from the current PC attributes. - */ - if (DD_IsVertColour(input_vert->type)){ - *out_pt.pRgbFloatClr = *in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - } - else { - if ((in_fct.pNoFacet) && (DD_IsFacetColour(input_fct->type))) - *out_pt.pRgbFloatClr = *in_fct.pFacetRgbFloat; - else { - *out_pt.pRgbFloatClr = - (pddc->Static.attrs->surfaceColour.colour.rgbFloat); - } - } - - out_pt.pRgbFloatClr++; - - /* - * Next normals - * Normals are derived first from the vertex, second from the - * facet (note that we insured above that there were facet normals). - */ - if DD_IsVertNormal(input_vert->type) { - *out_pt.pNormal = *in_pt.pNormal; - in_pt.pNormal++; - } - else if (DD_IsFacetColour(input_fct->type)) - *out_pt.pNormal = in_fct.pFacetRgbFloatN->normal; - else *out_pt.pNormal = *in_fct.pFacetN; - - out_pt.pNormal++; - - /* Next pass along edge info if there is any */ - if (DD_IsVertEdge(out_vert->type)) { - *out_pt.pEdge = *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - } - if ((in_fct.pNoFacet)) in_fct.pNoFacet += facet_size; - pddilist++; - pddolist++; - } - return(Success); -} - -/*++ - | - | miCullTriStrip(pddc, input_vert, input_fct, output_vert, output_fct) - | - | Perform culling of facets, and their associated data points, - | according to the current culling mode. - | - --*/ - -static -ddpex3rtn -miCullTriStrip(pddc, input_vert, input_fct, output_vert, output_fct) - miDDContext *pddc; /* dd Context pointer */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ - listofddFacet **output_fct; /* output facet data */ -{ -/* uses */ - miListHeader *out_vert; - listofddPoint *pddilist; - listofddPoint *pddolist; - listofddFacet *fct_list; - ddFacetUnion in_fct; - ddFacetUnion out_fct; - ddPointUnion in_pt,out_pt; - listofddPoint temp; - int i, j; - char accept, new_list; - char return_facet_list; - int point_size, facet_size; - int verts_in_list, out_listnum; - - /* - * Create facet normals if necessary. These are used to determine - * if the facet is to be culled. Note: only return a facet list - * if a valid facet list is input. - */ - if ( (!input_fct) || (input_fct->numFacets <= 0) ) { - Calculate_TriStrip_Facet_Normal(pddc, input_vert, - (listofddFacet *)0, &input_fct); - return_facet_list = 0; - *output_fct = 0; - } else { - if (!(DD_IsFacetNormal(input_fct->type))) { - Calculate_TriStrip_Facet_Normal(pddc, input_vert, - input_fct, output_fct); - input_fct = *output_fct; - } - return_facet_list = 1; - } - - /* - * allocate storage for the output vertex and facet list - */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - out_vert->type = input_vert->type; - out_vert->flags = input_vert->flags; - out_vert->numLists = 0; - MI_ALLOCLISTHEADER(out_vert, - MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)) - if (!out_vert->ddList) return(BadAlloc); - - - DD_VertPointSize(input_vert->type, point_size); - - fct_list = MI_NEXTTEMPFACETLIST(pddc); - fct_list->type = input_fct->type; - DDFacetSIZE(input_fct->type, facet_size); - MI_ALLOCLISTOFDDFACET(fct_list, input_fct->numFacets, facet_size); - out_fct = fct_list->facets; - if (!out_fct.pNoFacet) return(BadAlloc); - in_fct = input_fct->facets; - - - /* - * This test is performed in NPC space. As a result, - * the sign of the z component of the facet normal - * indicates the direction in which the facet is pointing. - * Therefore if the cullmode is PEXBackFaces and the - * z component is negative, reject the facet. Similarily, - * if the z component of the normal is positive, and - * the cullmode is PEXFrontFaces, also reject the face. - */ - - for(i = 0, out_listnum = 1, fct_list->numFacets = 0, - out_vert->numLists = 0, - pddilist = input_vert->ddList, pddolist = out_vert->ddList; - i < input_vert->numLists; i++) { - - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1),point_size); - if (!pddolist->pts.ptr) return(BadAlloc); - - for (j= 2, verts_in_list = 0, new_list = 1, - in_pt.ptr = pddilist->pts.ptr + (2 * point_size), - out_pt.ptr = pddolist->pts.ptr, - pddolist->numPoints = 0; - j < pddilist->numPoints; j++) { - - accept = 0; - - if (pddc->Dynamic->pPCAttr->cullMode == PEXBackFaces) { - if (DD_IsFacetColour(input_fct->type)) { - if (in_fct.pFacetRgbFloatN->normal.z >= 0) accept = 1; - } else if (in_fct.pFacetN->z >= 0) accept = 1; - } else /* pddc->Dynamic->pPCAttr->cullMode == PEXFrontFaces */ { - if (DD_IsFacetColour(input_fct->type)) { - if (in_fct.pFacetRgbFloatN->normal.z < 0) accept = 1; - } else if (in_fct.pFacetN->z < 0) accept = 1; - } - - if (accept) { - - if (new_list) { /* starting new list after facet(s) culled */ - /*initialize first points for the first facet */ - memcpy( out_pt.ptr, in_pt.ptr - (2 * point_size), (2*point_size)); - out_pt.ptr += 2 * point_size; - new_list = 0; - verts_in_list += 2; - } - - /* copy the vertex info associated with this facet */ - memcpy( out_pt.ptr, in_pt.ptr, point_size); - out_pt.ptr += point_size; - ++verts_in_list; - - /* copy the facet info */ - if (DD_IsFacetColour(input_fct->type)) - *out_fct.pFacetRgbFloatN = *in_fct.pFacetRgbFloatN; - else *out_fct.pFacetN = *in_fct.pFacetN; - - /* increment the output pointer */ - out_fct.pNoFacet += facet_size; - fct_list->numFacets++; - - } else { - /* Facet culled; terminate output vertex list */ - if (verts_in_list > 2) { /* facets in this list */ - pddolist->numPoints = verts_in_list; - ++out_vert->numLists; - out_listnum++; - /* create a new output vertex list; load first points */ - MI_ALLOCLISTHEADER(out_vert, - MI_ROUND_LISTHEADERCOUNT(out_listnum)) - if (!out_vert->ddList) return(BadAlloc); - - pddolist = out_vert->ddList + (out_listnum - 1); - pddolist->numPoints = 0; - MI_ALLOCLISTOFDDPOINT(pddolist, - (pddilist->numPoints - j + 2), point_size); - if (!pddolist->pts.ptr) return(BadAlloc); - out_pt.ptr = pddolist->pts.ptr; - verts_in_list = 0; - } - new_list = 1; - } - in_pt.ptr += point_size; - in_fct.pNoFacet += facet_size; - } - ++pddilist; - if (verts_in_list > 2) { - pddolist->numPoints = verts_in_list; - ++out_listnum; - ++out_vert->numLists; - ++pddolist; - } - } - - /* - * Only return facet list if one was passed in. Reduces the - * information that must be processed by the rest of the pipeline. - */ - if (return_facet_list) *output_fct = fct_list; - - return(Success); -} - -/*++ - | - | miDepthCueTriStrip(pddc, input_vert, input_fct, output_vert, output_fct) - | - | Performs Depth cueing of triangle strips data lists.. - | Assigns per-vertex colors to the data list according to the - | "Annex E - Informative" discussion of the ISO PHIGS PLUS spec. - | - | - --*/ -static -ddpex3rtn -miDepthCueTriStrip(pRend, input_vert, input_fct, output_vert) - - ddRendererPtr pRend; /* renderer handle */ - miListHeader *input_vert; /* input vertex data */ - listofddFacet *input_fct; /* input facet data */ - miListHeader **output_vert; /* output vertex data */ -{ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - miListHeader *out_vert; - listofddFacet *fct_list; - ddFLOAT pt_depth; - listofddPoint *pddilist; - listofddPoint *pddolist; - ddPointUnion in_pt, out_pt; - ddRgbFloatColour *in_color; - ddFacetUnion in_fct; - int inpoint_size, outpoint_size; - int facet_size; - int numFacets=0; - int i,j; - ddpex3rtn status; - ddDepthCueEntry *dcue_entry; - - /* look for empty list header */ - if (input_vert->numLists == 0) return(Success); - - /* validate CC version of Depth Cue information */ - if (pddc->Static.misc.flags & CC_DCUEVERSION) - Compute_CC_Dcue(pRend, pddc); - - /* check to make sure depth cuing is enabled */ - if (pddc->Static.misc.cc_dcue_entry.mode == PEXOff) { - *output_vert = input_vert; - return(Success); - } - - /* Else, depth cue! Use one of the pre-defined 4D list for output */ - *output_vert = out_vert = MI_NEXTTEMPDATALIST(pddc); - - /* Insure sufficient room for each header */ - MI_ALLOCLISTHEADER(out_vert, - MI_ROUND_LISTHEADERCOUNT(input_vert->numLists)) - if (!out_vert->ddList) return(BadAlloc); - - out_vert->type = input_vert->type; - if (!(DD_IsVertColour(input_vert->type))) - DD_SetVertRGBFLOAT(out_vert->type); - out_vert->numLists = input_vert->numLists; - out_vert->flags = input_vert->flags; - - pddilist = input_vert->ddList; - pddolist = out_vert->ddList; - - DD_VertPointSize(input_vert->type, inpoint_size); - DD_VertPointSize(out_vert->type, outpoint_size); - - if ((input_fct) && (input_fct->numFacets > 0)) { - in_fct = input_fct->facets; - DDFacetSIZE(input_fct->type, facet_size); - } else in_fct.pNoFacet = 0; - - for(i = 0; i < input_vert->numLists; i++) { - pddolist->numPoints = pddilist->numPoints; - in_pt.ptr = pddilist->pts.ptr; - MI_ALLOCLISTOFDDPOINT(pddolist,(pddilist->numPoints+1), - outpoint_size); - if (!(out_pt.ptr = pddolist->pts.ptr)) return(BadAlloc); - - for (j = 0, in_pt.ptr = pddilist->pts.ptr, - out_pt.ptr = pddolist->pts.ptr; - j < pddilist->numPoints; j++) { - - /* First copy over coordinate data */ - pt_depth = in_pt.p4Dpt->z; - *out_pt.p4Dpt = *in_pt.p4Dpt; - in_pt.p4Dpt++; - out_pt.p4Dpt++; - - /* - * Next color - * Colour is derived first from the vertex, second from the - * facet, and third from the current PC attributes. - */ - if (DD_IsVertColour(input_vert->type)){ - in_color = in_pt.pRgbFloatClr; - in_pt.pRgbFloatClr++; - } - else { - if ((in_fct.pNoFacet) && (DD_IsFacetColour(input_fct->type))) - in_color = in_fct.pFacetRgbFloat; - else { - in_color = - &(pddc->Static.attrs->surfaceColour.colour.rgbFloat); - } - } - - APPLY_DEPTH_CUEING(pddc->Static.misc.cc_dcue_entry, - pt_depth, in_color, out_pt.pRgbFloatClr) - - out_pt.pRgbFloatClr++; - - /* - * Next normals - * Normals are derived first from the vertex, second from the - * facet (note that we insured above that there were facet normals). - */ - if DD_IsVertNormal(input_vert->type) { - *out_pt.pNormal = *in_pt.pNormal; - in_pt.pNormal++; - out_pt.pNormal++; - } - - /* Next pass along edge info if there is any */ - if (DD_IsVertEdge(out_vert->type)) { - *out_pt.pEdge = *in_pt.pEdge; - in_pt.pEdge++; - out_pt.pEdge++; - } - - } - if ((in_fct.pNoFacet)) in_fct.pNoFacet += facet_size; - pddilist++; - pddolist++; - } - return(Success); -} - - - - - Index: xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c:3.8 xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c:3.8 Fri Dec 14 14:57:31 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c Sat Feb 28 21:41:54 2004 @@ -1,2253 +0,0 @@ -/* $Xorg: pexOCParse.c,v 1.6 2001/02/09 02:04:11 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level2/pexOCParse.c,v 3.8 2001/12/14 19:57:31 dawes Exp $ */ - - -#include "miStruct.h" -#include "ddpex2.h" -#include "pexExtract.h" -#include "pexUtils.h" -#include "miLight.h" -#include "pexos.h" - - -/** Parsing functions: - ** Each function takes two parameters: a pointer to the element to be - ** parsed (in PEX format) and a pointer to a pointer to return the - ** parsed element (in server native internal format). - ** - ** These routines may be used in most cases for both creation - ** and replacement of structure elements. If the second argument - ** points to a NULL, then the memory is allocated for the creation - ** of the structure element. Otherwise, no new memory is - ** allocated and the structure element is replaced in place. - ** This scheme requires that the calling routine ensure - ** that there is sufficient memory already allocated for replacing - ** in place. - ** - ** To support this scheme, parse routine writers must calculate - ** the amount of memory required to store the element in server - ** native format before allocating it, and pass this number of - ** bytes as the 3rd argument to the below macro GET_DD_STORAGE. - ** Then the parse routine can be put in both the parse and - ** replace tables as the entry for handling the OC. - ** - ** Note that there are 3 exceptions to this symmetry: - ** LightState - ** SOFAS - ** NurbSurfaces - ** - ** For each of these, there are separate parse and replace - ** routines. - ** - ** For any OC that follows the above scheme, the corresponding - ** entry in the destroy table can be the default (destroyOC_PEX), - ** since memory allocation is therefore in one chunk. If the - ** coder of a parse routine cannot write the routine so that all - ** of the memory is allocated at once, then they must also write - ** a special destroy routine for this element (to ensure no - ** memory leakage). - ** - ** Coders of parsing routines must also provide corresponding - ** copy and inquire routines (see miCopy.c and miInquire.c). - **/ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define CAT(a,b) a##b -#else -#define CAT(a,b) a/**/b -#endif - -#define OC_PARSER_FUNC_HEADER(suffix) \ - ddpex2rtn CAT(parse,suffix)(pPEXOC, ppExecuteOC)\ - ddElementInfo *pPEXOC; /* PEX format */ \ - miGenericElementPtr *ppExecuteOC; /* internal format */ - -#define OC_PARSER_RETURN(ANSWER) \ - return(Success); - -#define PARSER_PTR(PTR) \ - ddPointer PTR = (ddPointer)(pPEXOC + 1) - -#define LEN_WO_HEADER(OCtype) (pPEXOC->length * sizeof(CARD32) - sizeof(OCtype)) - -#define GET_DD_STORAGE(DD_ST, TYPE, SIZE) \ - if (*ppExecuteOC == 0) { \ - *ppExecuteOC = \ - (miGenericElementPtr) xalloc((unsigned long)((SIZE) \ - + sizeof(miGenericElementStr)));\ - if (!(*ppExecuteOC)) return (BadAlloc); \ - } \ - (DD_ST) = (TYPE *)((*ppExecuteOC)+1); - -#define GET_MORE_STORAGE(DD_ST, TYPE, SIZE) \ - if ((SIZE) > 0) { \ - (DD_ST) = (TYPE *)xalloc((unsigned long)(SIZE)); \ - if (!(DD_ST)) err = BadAlloc; } \ - else DD_ST = 0; - - -extern void freeTrimCurves(); -extern void freeKnots(); - - -/* - Returns number of bytes required to store the indicated data - */ -int -CountFacetOptData(ptr, colourType, numFacets, facetMask) -ddPointer ptr; -CARD16 colourType; -CARD32 numFacets; -CARD16 facetMask; -{ - ASSURE(facetMask <= 3); - - switch (facetMask) { - case PEXGAColour | PEXGANormal : { - - switch (colourType) { - - case PEXIndexedColour: - return(numFacets * sizeof(ddIndexNormal)); - - case PEXRgbFloatColour : - return(numFacets * sizeof(ddRgbFloatNormal)); - - case PEXCieFloatColour : - return(numFacets * sizeof(ddCieNormal)); - - case PEXHsvFloatColour : - return(numFacets * sizeof(ddHsvNormal)); - - case PEXHlsFloatColour : - return(numFacets * sizeof(ddHlsNormal)); - - case PEXRgb8Colour : - return(numFacets * sizeof(ddRgb8Normal)); - - case PEXRgb16Colour : - return(numFacets * sizeof(ddRgb16Normal)); - default: - return(0); - } - break; } - - case PEXGANormal : - - return(numFacets * sizeof(ddVector3D)); - - case PEXGAColour : { - - switch (colourType) { - - case PEXIndexedColour: - return(numFacets * sizeof(ddIndexedColour)); - /* force lword alignment for any adjacent pointers */ - - case PEXRgbFloatColour : - return(numFacets * sizeof(ddRgbFloatColour)); - - case PEXCieFloatColour : - return(numFacets * sizeof(ddCieColour)); - - case PEXHsvFloatColour : - return(numFacets * sizeof(ddHsvColour)); - - case PEXHlsFloatColour : - return(numFacets * sizeof(ddHlsColour)); - - case PEXRgb8Colour : - return(numFacets * sizeof(ddRgb8Colour)); - - case PEXRgb16Colour : - return(numFacets * sizeof(ddRgb16Colour)); - - default: - return(0); - } - break; } - - case 0x0000 : - return(0); - default: - return(0); - } - -} - - -/* - Parses facet data into already allocated memory (pFacetData) -*/ -void -ParseFacetOptData(ptr, colourType, numFacets, facetMask, pFacetList, pFacetData,rptr) -ddPointer ptr; -CARD16 colourType; -CARD32 numFacets; -CARD16 facetMask; -listofddFacet *pFacetList; -ddPointer pFacetData; -ddPointer *rptr; -{ - ASSURE(facetMask <= 3); - - switch (facetMask) { - case PEXGAColour | PEXGANormal : { - - pFacetList->numFacets = numFacets; - - switch (colourType) { - - case PEXIndexedColour: { - pFacetList->type = DD_FACET_INDEX_NORM; - pFacetList->facets.pFacetIndexN - = (ddIndexNormal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddIndexNormal); - EXTRACT_STRUCT( numFacets, ddIndexNormal, - pFacetList->facets.pFacetIndexN, ptr); - - break; } - - case PEXRgbFloatColour : { - pFacetList->type = DD_FACET_RGBFLOAT_NORM; - pFacetList->facets.pFacetRgbFloatN - = (ddRgbFloatNormal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddRgbFloatNormal); - EXTRACT_STRUCT( numFacets, ddRgbFloatNormal, - pFacetList->facets.pFacetRgbFloatN, ptr); - break; } - - case PEXCieFloatColour : { - pFacetList->type = DD_FACET_CIE_NORM; - pFacetList->facets.pFacetCieN = (ddCieNormal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddCieNormal); - EXTRACT_STRUCT( numFacets, ddCieNormal, - pFacetList->facets.pFacetCieN, ptr); - break; } - - case PEXHsvFloatColour : { - pFacetList->type = DD_FACET_HSV_NORM; - pFacetList->facets.pFacetHsvN = (ddHsvNormal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddHsvNormal); - EXTRACT_STRUCT( numFacets, ddHsvNormal, - pFacetList->facets.pFacetHsvN, ptr); - break; } - - case PEXHlsFloatColour : { - pFacetList->type = DD_FACET_HLS_NORM; - pFacetList->facets.pFacetHlsN = (ddHlsNormal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddHlsNormal); - EXTRACT_STRUCT( numFacets, ddHlsNormal, - pFacetList->facets.pFacetHlsN, ptr); - break; } - - case PEXRgb8Colour : { - pFacetList->type = DD_FACET_RGB8_NORM; - pFacetList->facets.pFacetRgb8N = (ddRgb8Normal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddRgb8Normal); - EXTRACT_STRUCT( numFacets, ddRgb8Normal, - pFacetList->facets.pFacetRgb8N, ptr); - break; } - - case PEXRgb16Colour : { - pFacetList->type = DD_FACET_RGB16_NORM; - pFacetList->facets.pFacetRgb16N - = (ddRgb16Normal *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddRgb16Normal); - EXTRACT_STRUCT( numFacets, ddRgb16Normal, - pFacetList->facets.pFacetRgb16N, ptr); - break; } - - } - break; } - - case PEXGANormal : { - - pFacetList->type = DD_FACET_NORM; - pFacetList->numFacets = numFacets; - pFacetList->facets.pFacetN = (ddVector3D *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddVector3D); - EXTRACT_STRUCT( numFacets, ddVector3D, pFacetList->facets.pFacetN, - ptr); - break; } - - case PEXGAColour : { - - pFacetList->numFacets = numFacets; - - switch (colourType) { - - case PEXIndexedColour: { - pFacetList->type = DD_FACET_INDEX; - pFacetList->facets.pFacetIndex = - (ddIndexedColour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddIndexedColour); - EXTRACT_STRUCT( numFacets, ddIndexedColour, - pFacetList->facets.pFacetIndex, ptr); - - break; } - - case PEXRgbFloatColour : { - pFacetList->type = DD_FACET_RGBFLOAT; - pFacetList->facets.pFacetRgbFloat = - (ddRgbFloatColour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddRgbFloatColour); - EXTRACT_STRUCT( numFacets, ddRgbFloatColour, - pFacetList->facets.pFacetRgbFloat, ptr); - break; } - - case PEXCieFloatColour : { - pFacetList->type = DD_FACET_CIE; - pFacetList->facets.pFacetCie = (ddCieColour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddCieColour); - EXTRACT_STRUCT( numFacets, ddCieColour, - pFacetList->facets.pFacetCie, ptr); - break; } - - case PEXHsvFloatColour : { - pFacetList->type = DD_FACET_HSV; - pFacetList->facets.pFacetHsv = (ddHsvColour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddHsvColour); - EXTRACT_STRUCT( numFacets, ddHsvColour, - pFacetList->facets.pFacetHsv, ptr); - break; } - - case PEXHlsFloatColour : { - pFacetList->type = DD_FACET_HLS; - pFacetList->facets.pFacetHls = (ddHlsColour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddHlsColour); - EXTRACT_STRUCT( numFacets, ddHlsColour, - pFacetList->facets.pFacetHls, ptr); - break; } - - case PEXRgb8Colour : { - pFacetList->type = DD_FACET_RGB8; - pFacetList->facets.pFacetRgb8 = (ddRgb8Colour *)pFacetData; - EXTRACT_STRUCT( numFacets, ddRgb8Colour, - pFacetList->facets.pFacetRgb8, ptr); - pFacetList->maxData = numFacets * sizeof(ddRgb8Colour); - break; } - - case PEXRgb16Colour : { - pFacetList->type = DD_FACET_RGB16; - pFacetList->facets.pFacetRgb16 = (ddRgb16Colour *)pFacetData; - pFacetList->maxData = numFacets * sizeof(ddRgb16Colour); - EXTRACT_STRUCT( numFacets, ddRgb16Colour, - pFacetList->facets.pFacetRgb16, ptr); - break; } - - } - break; } - - case 0x0000 : { - /* neither Colour nor Normal specified */ - pFacetList->numFacets = 0; - pFacetList->type = DD_FACET_NONE; - pFacetList->facets.pNoFacet = NULL; - pFacetList->maxData = 0; - break; } - } - - *rptr = ptr; -} - - -/* - Returns number of bytes needed to store this vertex data - */ -int -CountVertexData(ptr, colourType, numVertices, vertexMask) -ddPointer ptr; -INT16 colourType; -CARD32 numVertices; -CARD16 vertexMask; -{ - ASSURE(vertexMask <= 7); - - switch (vertexMask) { - - case PEXGAColour | PEXGANormal | PEXGAEdges : { - - switch (colourType) { - case PEXIndexedColour: - return(numVertices * sizeof(ddIndexNormEdgePoint)); - - case PEXRgbFloatColour : - return(numVertices * sizeof(ddRgbFloatNormEdgePoint)); - - case PEXCieFloatColour : - return(numVertices *sizeof(ddCieNormEdgePoint)); - - case PEXHsvFloatColour : - return(numVertices *sizeof(ddHsvNormEdgePoint)); - - case PEXHlsFloatColour : - return(numVertices *sizeof(ddHlsNormEdgePoint)); - - case PEXRgb8Colour : - return(numVertices*sizeof(ddRgb8NormEdgePoint)); - - case PEXRgb16Colour : - return(numVertices * sizeof(ddRgb16NormEdgePoint)); - - default: - return(0); - } - break; } - - case PEXGAColour | PEXGANormal : { - - switch (colourType) { - case PEXIndexedColour: - return(numVertices* sizeof(ddIndexNormalPoint)); - - case PEXRgbFloatColour : - return(numVertices * sizeof(ddRgbFloatNormalPoint)); - - case PEXCieFloatColour : - return(numVertices * sizeof(ddCieNormalPoint)); - - case PEXHsvFloatColour : - return(numVertices * sizeof(ddHsvNormalPoint)); - - case PEXHlsFloatColour : - return(numVertices * sizeof(ddHlsNormalPoint)); - - case PEXRgb8Colour : - return(numVertices * sizeof(ddRgb8NormalPoint)); - - case PEXRgb16Colour : - return(numVertices * sizeof(ddRgb16NormalPoint)); - - default: - return(0); - } - break; } - - case PEXGANormal | PEXGAEdges: - return(numVertices * sizeof(ddNormEdgePoint)); - - case PEXGANormal : - return(numVertices * sizeof(ddNormalPoint)); - - case PEXGAEdges : - return(numVertices * sizeof(ddEdgePoint)); - - case PEXGAColour | PEXGAEdges : { - - switch (colourType) { - case PEXIndexedColour: - return(numVertices * sizeof(ddIndexEdgePoint)); - - case PEXRgbFloatColour : - return(numVertices*sizeof(ddRgbFloatEdgePoint)); - - case PEXCieFloatColour : - return(numVertices * sizeof(ddCieEdgePoint)); - - case PEXHsvFloatColour : - return(numVertices * sizeof(ddHsvEdgePoint)); - - case PEXHlsFloatColour : - return(numVertices * sizeof(ddHlsEdgePoint)); - - case PEXRgb8Colour : - return(numVertices * sizeof(ddRgb8EdgePoint)); - - case PEXRgb16Colour : - return(numVertices * sizeof(ddRgb16EdgePoint)); - - default: - return(0); - } - break; } - - case PEXGAColour: { - - switch (colourType) { - case PEXIndexedColour: - return(numVertices * sizeof(ddIndexPoint)); - - case PEXRgbFloatColour : - return(numVertices * sizeof(ddRgbFloatPoint)); - - case PEXCieFloatColour : - return(numVertices * sizeof(ddCiePoint)); - - case PEXHsvFloatColour : - return(numVertices * sizeof(ddHsvPoint)); - - case PEXHlsFloatColour : - return(numVertices * sizeof(ddHlsPoint)); - - case PEXRgb8Colour : - return(numVertices * sizeof(ddRgb8Point)); - - case PEXRgb16Colour : - return(numVertices * sizeof(ddRgb16Point)); - - default: - return(0); - } - break; } - - case 0x0000 : - /* none of Colour nor Normal nor Edge specified */ - return(numVertices * sizeof(ddCoord3D)); - - default: - return(0); - } - -} - - -/* - Parses vertex data into already allocated memory (pVertexData) -*/ -void -ParseVertexData(ptr, colourType, numVertices, vertexMask, pVertexList, pVertexData, rtype, rptr) -ddPointer ptr; -INT16 colourType; -CARD32 numVertices; -CARD16 vertexMask; -listofddPoint *pVertexList; /* out */ -ddPointer *pVertexData; /* out */ -ddPointType *rtype; /* out */ -ddPointer *rptr; /* out */ -{ - ASSURE(vertexMask <= 7); - - pVertexList->numPoints = numVertices; - switch (vertexMask) { - - case PEXGAColour | PEXGANormal | PEXGAEdges : { - - switch (colourType) { - case PEXIndexedColour: { - *rtype = DD_INDEX_NORM_EDGE_POINT; - pVertexList->pts.pIndexNEpt - = (ddIndexNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices* sizeof(ddIndexNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddIndexNormEdgePoint, - pVertexList->pts.pIndexNEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddIndexNormEdgePoint); - break; } - - case PEXRgbFloatColour : { - *rtype = DD_RGBFLOAT_NORM_EDGE_POINT; - pVertexList->pts.pRgbFloatNEpt - = (ddRgbFloatNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgbFloatNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddRgbFloatNormEdgePoint, - pVertexList->pts.pRgbFloatNEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgbFloatNormEdgePoint); - break; } - - case PEXCieFloatColour : { - *rtype = DD_CIE_NORM_EDGE_POINT; - pVertexList->pts.pCieNEpt = (ddCieNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices *sizeof(ddCieNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddCieNormEdgePoint, - pVertexList->pts.pCieNEpt, ptr); - pVertexList->maxData = numVertices *sizeof(ddCieNormEdgePoint); - break; } - - case PEXHsvFloatColour : { - *rtype = DD_HSV_NORM_EDGE_POINT; - pVertexList->pts.pHsvNEpt = (ddHsvNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices *sizeof(ddHsvNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddHsvNormEdgePoint, - pVertexList->pts.pHsvNEpt, ptr); - pVertexList->maxData = numVertices *sizeof(ddHsvNormEdgePoint); - break; } - - case PEXHlsFloatColour : { - *rtype = DD_HLS_NORM_EDGE_POINT; - pVertexList->pts.pHlsNEpt = (ddHlsNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices *sizeof(ddHlsNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddHlsNormEdgePoint, - pVertexList->pts.pHlsNEpt, ptr); - pVertexList->maxData = numVertices *sizeof(ddHlsNormEdgePoint); - break; } - - case PEXRgb8Colour : { - *rtype = DD_RGB8_NORM_EDGE_POINT; - pVertexList->pts.pRgb8NEpt - = (ddRgb8NormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices*sizeof(ddRgb8NormEdgePoint); - EXTRACT_STRUCT( numVertices, ddRgb8NormEdgePoint, - pVertexList->pts.pRgb8NEpt, ptr); - pVertexList->maxData = numVertices*sizeof(ddRgb8NormEdgePoint); - break; } - - case PEXRgb16Colour : { - *rtype = DD_RGB16_NORM_EDGE_POINT; - pVertexList->pts.pRgb16NEpt - = (ddRgb16NormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices* sizeof(ddRgb16NormEdgePoint); - EXTRACT_STRUCT( numVertices, ddRgb16NormEdgePoint, - pVertexList->pts.pRgb16NEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb16NormEdgePoint); - break; } - - } - break; } - - case PEXGAColour | PEXGANormal : { - - switch (colourType) { - case PEXIndexedColour: { - *rtype = DD_INDEX_NORM_POINT; - pVertexList->pts.pIndexNpt - = (ddIndexNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices* sizeof(ddIndexNormalPoint); - EXTRACT_STRUCT( numVertices, ddIndexNormalPoint, - pVertexList->pts.pIndexNpt, ptr); - pVertexList->maxData = numVertices* sizeof(ddIndexNormalPoint); - break; } - - case PEXRgbFloatColour : { - *rtype = DD_RGBFLOAT_NORM_POINT; - pVertexList->pts.pRgbFloatNpt - = (ddRgbFloatNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgbFloatNormalPoint); - EXTRACT_STRUCT( numVertices, ddRgbFloatNormalPoint, - pVertexList->pts.pRgbFloatNpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgbFloatNormalPoint); - break; } - - case PEXCieFloatColour : { - *rtype = DD_CIE_NORM_POINT; - pVertexList->pts.pCieNpt = (ddCieNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddCieNormalPoint); - EXTRACT_STRUCT( numVertices, ddCieNormalPoint, - pVertexList->pts.pCieNpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddCieNormalPoint); - break; } - - case PEXHsvFloatColour : { - *rtype = DD_HSV_NORM_POINT; - pVertexList->pts.pHsvNpt = (ddHsvNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHsvNormalPoint); - EXTRACT_STRUCT( numVertices, ddHsvNormalPoint, - pVertexList->pts.pHsvNpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHsvNormalPoint); - break; } - - case PEXHlsFloatColour : { - *rtype = DD_HLS_NORM_POINT; - pVertexList->pts.pHlsNpt = (ddHlsNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHlsNormalPoint); - EXTRACT_STRUCT( numVertices, ddHlsNormalPoint, - pVertexList->pts.pHlsNpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHlsNormalPoint); - break; } - - case PEXRgb8Colour : { - *rtype = DD_RGB8_NORM_POINT; - pVertexList->pts.pRgb8Npt = (ddRgb8NormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgb8NormalPoint); - EXTRACT_STRUCT( numVertices, ddRgb8NormalPoint, - pVertexList->pts.pRgb8Npt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb8NormalPoint); - break; } - - case PEXRgb16Colour : { - *rtype = DD_RGB16_NORM_POINT; - pVertexList->pts.pRgb16Npt = (ddRgb16NormalPoint *)(*pVertexData); - (*pVertexData) += numVertices* sizeof(ddRgb16NormalPoint); - EXTRACT_STRUCT( numVertices, ddRgb16NormalPoint, - pVertexList->pts.pRgb16Npt, ptr); - pVertexList->maxData = numVertices* sizeof(ddRgb16NormalPoint); - break; } - - } - break; } - - case PEXGANormal | PEXGAEdges: { - *rtype = DD_NORM_EDGE_POINT; - pVertexList->pts.pNEpt = (ddNormEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddNormEdgePoint); - EXTRACT_STRUCT( numVertices, ddNormEdgePoint, - pVertexList->pts.pNEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddNormEdgePoint); - break; } - - case PEXGANormal : { - *rtype = DD_NORM_POINT; - pVertexList->pts.pNpt = (ddNormalPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddNormalPoint); - EXTRACT_STRUCT( numVertices, ddNormalPoint, - pVertexList->pts.pNpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddNormalPoint); - break; } - - case PEXGAEdges : { - *rtype = DD_EDGE_POINT; - pVertexList->pts.pEpt = (ddEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddEdgePoint); - EXTRACT_STRUCT( numVertices, ddEdgePoint, - pVertexList->pts.pEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddEdgePoint); - break; } - - case PEXGAColour | PEXGAEdges : { - - switch (colourType) { - case PEXIndexedColour: { - *rtype = DD_INDEX_EDGE_POINT; - pVertexList->pts.pIndexEpt = (ddIndexEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddIndexEdgePoint); - EXTRACT_STRUCT( numVertices, ddIndexEdgePoint, - pVertexList->pts.pIndexEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddIndexEdgePoint); - break; } - - case PEXRgbFloatColour : { - *rtype = DD_RGBFLOAT_EDGE_POINT; - pVertexList->pts.pRgbFloatEpt = (ddRgbFloatEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices*sizeof(ddRgbFloatEdgePoint); - EXTRACT_STRUCT( numVertices, ddRgbFloatEdgePoint, - pVertexList->pts.pRgbFloatEpt, ptr); - pVertexList->maxData = numVertices*sizeof(ddRgbFloatEdgePoint); - break; } - - case PEXCieFloatColour : { - *rtype = DD_CIE_EDGE_POINT; - pVertexList->pts.pCieEpt = (ddCieEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddCieEdgePoint); - EXTRACT_STRUCT( numVertices, ddCieEdgePoint, - pVertexList->pts.pCieEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddCieEdgePoint); - break; } - - case PEXHsvFloatColour : { - *rtype = DD_HSV_EDGE_POINT; - pVertexList->pts.pHsvEpt = (ddHsvEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHsvEdgePoint); - EXTRACT_STRUCT( numVertices, ddHsvEdgePoint, - pVertexList->pts.pHsvEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHsvEdgePoint); - break; } - - case PEXHlsFloatColour : { - *rtype = DD_HLS_EDGE_POINT; - pVertexList->pts.pHlsEpt = (ddHlsEdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHlsEdgePoint); - EXTRACT_STRUCT( numVertices, ddHlsEdgePoint, - pVertexList->pts.pHlsEpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHlsEdgePoint); - break; } - - case PEXRgb8Colour : { - *rtype = DD_RGB8_EDGE_POINT; - pVertexList->pts.pRgb8Ept = (ddRgb8EdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgb8EdgePoint); - EXTRACT_STRUCT( numVertices, ddRgb8EdgePoint, - pVertexList->pts.pRgb8Ept, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb8EdgePoint); - break; } - - case PEXRgb16Colour : { - *rtype = DD_RGB16_EDGE_POINT; - pVertexList->pts.pRgb16Ept = (ddRgb16EdgePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgb16EdgePoint); - EXTRACT_STRUCT( numVertices, ddRgb16EdgePoint, - pVertexList->pts.pRgb16Ept, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb16EdgePoint); - break; } - - } - break; } - - case PEXGAColour: { - - switch (colourType) { - case PEXIndexedColour: { - *rtype = DD_INDEX_POINT; - pVertexList->pts.pIndexpt = (ddIndexPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddIndexPoint); - EXTRACT_STRUCT( numVertices, ddIndexPoint, - pVertexList->pts.pIndexpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddIndexPoint); - break; } - - case PEXRgbFloatColour : { - *rtype = DD_RGBFLOAT_POINT; - pVertexList->pts.pRgbFloatpt = (ddRgbFloatPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgbFloatPoint); - EXTRACT_STRUCT( numVertices, ddRgbFloatPoint, - pVertexList->pts.pRgbFloatpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgbFloatPoint); - break; } - - case PEXCieFloatColour : { - *rtype = DD_CIE_POINT; - pVertexList->pts.pCiept = (ddCiePoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddCiePoint); - EXTRACT_STRUCT( numVertices, ddCiePoint, - pVertexList->pts.pCiept, ptr); - pVertexList->maxData = numVertices * sizeof(ddCiePoint); - break; } - - case PEXHsvFloatColour : { - *rtype = DD_HSV_POINT; - pVertexList->pts.pHsvpt = (ddHsvPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHsvPoint); - EXTRACT_STRUCT( numVertices, ddHsvPoint, - pVertexList->pts.pHsvpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHsvPoint); - break; } - - case PEXHlsFloatColour : { - *rtype = DD_HLS_POINT; - pVertexList->pts.pHlspt = (ddHlsPoint *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddHlsPoint); - EXTRACT_STRUCT( numVertices, ddHlsPoint, - pVertexList->pts.pHlspt, ptr); - pVertexList->maxData = numVertices * sizeof(ddHlsPoint); - break; } - - case PEXRgb8Colour : { - *rtype = DD_RGB8_POINT; - pVertexList->pts.pRgb8pt = (ddRgb8Point *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgb8Point); - EXTRACT_STRUCT( numVertices, ddRgb8Point, - pVertexList->pts.pRgb8pt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb8Point); - break; } - - case PEXRgb16Colour : { - *rtype = DD_RGB16_POINT; - pVertexList->pts.pRgb16pt = (ddRgb16Point *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddRgb16Point); - EXTRACT_STRUCT( numVertices, ddRgb16Point, - pVertexList->pts.pRgb16pt, ptr); - pVertexList->maxData = numVertices * sizeof(ddRgb16Point); - break; } - - } - break; } - - case 0x0000 : { - /* none of Colour nor Normal nor Edge specified */ - *rtype = DD_3D_POINT; - pVertexList->pts.p3Dpt = (ddCoord3D *)(*pVertexData); - (*pVertexData) += numVertices * sizeof(ddCoord3D); - EXTRACT_STRUCT( numVertices, ddCoord3D, pVertexList->pts.p3Dpt, ptr); - pVertexList->maxData = numVertices * sizeof(ddCoord3D); - break; } - } - - *rptr = ptr; - -} - - -OC_PARSER_FUNC_HEADER(ColourOC) -{ - CARD16 colourType; - miColourStruct *ddColour; - PARSER_PTR(ptr); - - EXTRACT_CARD16(colourType,ptr);/*temp since we haven't alloc'd ddColour yet*/ - SKIP_PADDING(ptr,2); - switch (colourType) { - - case PEXIndexedColour: { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddIndexedColour))) - ddColour->colour.pIndex = (ddIndexedColour *)(ddColour+1); - EXTRACT_STRUCT(1, ddIndexedColour, ddColour->colour.pIndex, ptr); - break; } - - case PEXRgbFloatColour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddRgbFloatColour))); - ddColour->colour.pRgbFloat = (ddRgbFloatColour *)(ddColour+1); - EXTRACT_STRUCT(1, ddRgbFloatColour, ddColour->colour.pRgbFloat, ptr); - break; } - - case PEXCieFloatColour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddCieColour))); - ddColour->colour.pCie = (ddCieColour *)(ddColour+1); - EXTRACT_STRUCT(1, ddCieColour, ddColour->colour.pCie, ptr); - break; } - - case PEXHsvFloatColour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddHsvColour))); - ddColour->colour.pHsv = (ddHsvColour *)(ddColour+1); - EXTRACT_STRUCT(1, ddHsvColour, ddColour->colour.pHsv, ptr); - break; } - - case PEXHlsFloatColour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddHlsColour))); - ddColour->colour.pHls = (ddHlsColour *)(ddColour+1); - EXTRACT_STRUCT(1, ddHlsColour, ddColour->colour.pHls, ptr); - break; } - - case PEXRgb8Colour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddRgb8Colour))); - ddColour->colour.pRgb8 = (ddRgb8Colour *)(ddColour+1); - EXTRACT_STRUCT(1, ddRgb8Colour, ddColour->colour.pRgb8, ptr); - break; } - - case PEXRgb16Colour : { - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddRgb16Colour))); - ddColour->colour.pRgb16 = (ddRgb16Colour *)(ddColour+1); - EXTRACT_STRUCT(1, ddRgb16Colour, ddColour->colour.pRgb16, ptr); - break; } - } - - ddColour->colourType = colourType; - OC_PARSER_RETURN(ddColour); -} - -OC_PARSER_FUNC_HEADER(ColourIndexOC) -{ - miColourStruct *ddColour; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddColour, miColourStruct, - (sizeof(miColourStruct) + sizeof(ddIndexedColour))); - ddColour->colour.pIndex = (ddIndexedColour *)(ddColour+1); - ddColour->colourType = PEXIndexedColour; - EXTRACT_CARD16(ddColour->colour.pIndex->index,ptr); - - OC_PARSER_RETURN(ddColour); -} - -OC_PARSER_FUNC_HEADER(LightState) -{ - miLightStateStruct *ddLightState; - PARSER_PTR(ptr); - ddSHORT enable_count, disable_count; - ddSHORT en_count, dis_count; - int listSize = 0; - - EXTRACT_CARD16(enable_count, ptr); - EXTRACT_CARD16(disable_count, ptr); - - /* must modify counts so they are always even to guarantee - * pointer alignment at 4 byte boundary - */ - en_count = MAKE_EVEN(enable_count); - dis_count = MAKE_EVEN(disable_count); /* probably unnecessary */ - listSize = puCountList(DD_INDEX, en_count) + puCountList(DD_INDEX,dis_count); - GET_DD_STORAGE( ddLightState,miLightStateStruct, - sizeof(miLightStateStruct) + listSize); - - ddLightState->enableList = (listofObj *)(ddLightState + 1); - puInitList(ddLightState->enableList, DD_INDEX, en_count); - puAddToList(ptr, enable_count, ddLightState->enableList); - - SKIP_PADDING(ptr, (en_count * sizeof(CARD16)) ); - - listSize = puCountList(DD_INDEX, en_count); - ddLightState->disableList = - (listofObj *)(((ddPointer)(ddLightState->enableList)) + listSize); - puInitList(ddLightState->disableList, DD_INDEX, dis_count); - puAddToList(ptr, disable_count, ddLightState->disableList); - - OC_PARSER_RETURN(ddLightState); -} - -OC_PARSER_FUNC_HEADER(SetMCVolume) -{ - miMCVolume_Struct *ddMCV; - PARSER_PTR(ptr); - - ddHalfSpace ddHS; - INT16 i, count, op; - int listSize = 0; - ddFLOAT length; - - EXTRACT_INT16(op, ptr); - EXTRACT_INT16(count, ptr); - listSize = puCountList(DD_HALF_SPACE, count); - GET_DD_STORAGE( ddMCV, miMCVolume_Struct, - sizeof(miMCVolume_Struct) + listSize); - - ddMCV->operator = op; - ddMCV->halfspaces = (listofObj *)(ddMCV + 1); - puInitList(ddMCV->halfspaces, DD_HALF_SPACE, count); - - for (i = 0; i < count; i++){ - EXTRACT_COORD3D(&ddHS.orig_point, ptr); - ddHS.orig_point.w = 0.0; /* JSH */ - ddHS.point.w = 0.5; /* ? */ - EXTRACT_VECTOR3D(&ddHS.orig_vector, ptr); - - puAddToList(&ddHS, 1, ddMCV->halfspaces); - } - - OC_PARSER_RETURN(ddMCV); -} - -OC_PARSER_FUNC_HEADER(SetMCVolume2D) -{ - - miMCVolume_Struct *ddMCV; - PARSER_PTR(ptr); - ddHalfSpace ddHS; - INT16 i, count, op; - int listSize = 0; - ddFLOAT length; - - EXTRACT_INT16(op, ptr); - EXTRACT_INT16(count, ptr); - listSize = puCountList(DD_HALF_SPACE, count); - GET_DD_STORAGE( ddMCV, miMCVolume_Struct, - sizeof(miMCVolume_Struct) + listSize); - - ddMCV->operator = op; - ddMCV->halfspaces = (listofObj *)(ddMCV + 1); - puInitList(ddMCV->halfspaces, DD_HALF_SPACE, count); - - for (i = 0; i < count; i++){ - EXTRACT_COORD2D(&ddHS.orig_point, ptr); - ddHS.orig_point.z = 0.0; - ddHS.orig_point.w = 0.0; - ddHS.point.w = 0.5; /* ? */ - EXTRACT_VECTOR2D(&ddHS.orig_vector, ptr); - ddHS.orig_vector.z = 0.0; - - puAddToList(&ddHS, 1, ddMCV->halfspaces); - } - - OC_PARSER_RETURN(ddMCV); -} - -OC_PARSER_FUNC_HEADER(Marker) -{ - miMarkerStruct *ddMarker; - listofddPoint *ddPoint; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexMarker) / sizeof(pexCoord3D); - GET_DD_STORAGE( ddMarker, miListHeader, (sizeof(miListHeader) + - sizeof(listofddPoint) + numPoints * sizeof(ddCoord3D))); - ddPoint = (listofddPoint *)(ddMarker+1); - ddMarker->type = DD_3D_POINT; - ddMarker->flags = 0; - ddMarker->numLists = 1; - ddMarker->maxLists = 1; - ddMarker->ddList = ddPoint; - ddPoint->numPoints = numPoints; - ddPoint->pts.p3Dpt = (ddCoord3D *)(ddPoint + 1); - EXTRACT_LISTOF_COORD3D(ddPoint->numPoints,ddPoint->pts.p3Dpt,ptr); - - OC_PARSER_RETURN(ddMarker); -} - - -OC_PARSER_FUNC_HEADER(Marker2D) -{ - miMarkerStruct *ddMarker; - listofddPoint *ddPoint; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexMarker2D) / sizeof(pexCoord2D); - GET_DD_STORAGE( ddMarker, miListHeader, (sizeof(miListHeader) + - sizeof(listofddPoint) + numPoints * sizeof(ddCoord2D))); - ddPoint = (listofddPoint *)(ddMarker+1); - ddMarker->type = DD_2D_POINT; - ddMarker->flags = 0; - ddMarker->numLists = 1; - ddMarker->maxLists = 1; - ddMarker->ddList = ddPoint; - ddPoint->numPoints = numPoints; - ddPoint->pts.p2Dpt = (ddCoord2D *)(ddPoint + 1); - EXTRACT_LISTOF_COORD2D(ddPoint->numPoints,ddPoint->pts.p2Dpt,ptr); - - OC_PARSER_RETURN(ddMarker); -} - - -OC_PARSER_FUNC_HEADER(Text) -{ - miTextStruct *ddText; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddText, miTextStruct, sizeof(miTextStruct) - + 3 * sizeof(ddCoord3D) - + ((pexText *)pPEXOC)->head.length * sizeof(CARD32) - - sizeof(pexText)); - /* this also allocates any trailing pads, but so - much the better */ - ddText->pOrigin = (ddCoord3D *)(ddText + 1); - ddText->pDirections = (ddText->pOrigin) + 1; - EXTRACT_LISTOF_COORD3D(1, ddText->pOrigin, ptr); - EXTRACT_LISTOF_COORD3D(2, ddText->pDirections, ptr); - EXTRACT_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - ddText->pText = (pexMonoEncoding *)((ddText->pDirections) + 2); - memcpy( (char *)(ddText->pText), (char *)ptr, - (int)( sizeof(CARD32) * ((pexText *)pPEXOC)->head.length - - sizeof(pexText))); - - OC_PARSER_RETURN(ddText); -} - - -OC_PARSER_FUNC_HEADER(Text2D) -{ - miText2DStruct *ddText; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddText, miText2DStruct, sizeof(miText2DStruct) - + sizeof(ddCoord2D) - + ((pexText2D *)pPEXOC)->head.length * sizeof(CARD32) - - sizeof(pexText2D)); - /* this also allocates any trailing pads, but so - much the better */ - ddText->pOrigin = (ddCoord2D *)(ddText + 1); - EXTRACT_LISTOF_COORD2D(1, ddText->pOrigin, ptr); - EXTRACT_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - ddText->pText = (pexMonoEncoding *)((ddText->pOrigin) + 1); - memcpy( (char *)(ddText->pText), (char *)ptr, - (int)( sizeof(CARD32) * ((pexText2D *)pPEXOC)->head.length - - sizeof(pexText2D))); - - OC_PARSER_RETURN(ddText); -} - - -OC_PARSER_FUNC_HEADER(AnnotationText) -{ - miAnnoTextStruct *ddText; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddText, miAnnoTextStruct, sizeof(miAnnoTextStruct) - + 2 * sizeof(ddCoord3D) - + ((pexAnnotationText *)pPEXOC)->head.length - * sizeof(CARD32) - - sizeof(pexAnnotationText)); - /* this also allocates any trailing pads, but so - much the better */ - ddText->pOrigin = (ddCoord3D *)(ddText + 1); - ddText->pOffset = (ddText->pOrigin) + 1; - EXTRACT_LISTOF_COORD3D(1, ddText->pOrigin, ptr); - EXTRACT_LISTOF_COORD3D(1, ddText->pOffset, ptr); - EXTRACT_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - ddText->pText = (pexMonoEncoding *)((ddText->pOffset) + 1); - memcpy( (char *)(ddText->pText), (char *)ptr, - (int)( sizeof(CARD32) * ((pexAnnotationText *)pPEXOC)->head.length - - sizeof(pexAnnotationText))); - - OC_PARSER_RETURN(ddText); - -} - - - - -OC_PARSER_FUNC_HEADER(AnnotationText2D) -{ - miAnnoText2DStruct *ddText; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddText, miAnnoText2DStruct, sizeof(miAnnoText2DStruct) - + 2 * sizeof(ddCoord2D) - + ((pexAnnotationText2D *)pPEXOC)->head.length - * sizeof(CARD32) - - sizeof(pexAnnotationText2D)); - /* this also allocates any trailing pads, but so - much the better */ - ddText->pOrigin = (ddCoord2D *)(ddText + 1); - ddText->pOffset = (ddText->pOrigin) + 1; - EXTRACT_LISTOF_COORD2D(1, ddText->pOrigin, ptr); - EXTRACT_LISTOF_COORD2D(1, ddText->pOffset, ptr); - EXTRACT_CARD16(ddText->numEncodings, ptr); - SKIP_PADDING(ptr, 2); - ddText->pText = (pexMonoEncoding *)((ddText->pOffset) + 1); - memcpy( (char *)(ddText->pText), (char *)ptr, - (int)( sizeof(CARD32) * ((pexAnnotationText2D *)pPEXOC)->head.length - - sizeof(pexAnnotationText2D))); - - OC_PARSER_RETURN(ddText); - -} - - -OC_PARSER_FUNC_HEADER(Polyline2D) -{ - miPolylineStruct *ddPoly; - listofddPoint *ddPoint; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexPolyline2D) / sizeof(pexCoord2D); - GET_DD_STORAGE( ddPoly, miListHeader, sizeof(miListHeader) + - sizeof(listofddPoint) + numPoints * sizeof(ddCoord2D)); - ddPoint = (listofddPoint *)(ddPoly+1); - ddPoly->type = DD_2D_POINT; - ddPoly->flags = 0; - ddPoly->numLists = 1; - ddPoly->maxLists = 1; - ddPoly->ddList = ddPoint; - ddPoint->numPoints = numPoints; - ddPoint->maxData = numPoints * sizeof(ddCoord2D); - ddPoint->pts.p2Dpt = (ddCoord2D *)(ddPoint + 1); - EXTRACT_LISTOF_COORD2D(ddPoint->numPoints,ddPoint->pts.p2Dpt,ptr); - - OC_PARSER_RETURN(ddPoly); - -} - - - -OC_PARSER_FUNC_HEADER(Polyline) -{ - miPolylineStruct *ddPoly; - listofddPoint *ddPoint; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexPolyline) / sizeof(pexCoord3D); - GET_DD_STORAGE( ddPoly, miListHeader, sizeof(miListHeader) + - sizeof(listofddPoint) + numPoints * sizeof(ddCoord3D)); - ddPoint = (listofddPoint *)(ddPoly+1); - ddPoly->type = DD_3D_POINT; - ddPoly->flags = 0; - ddPoly->numLists = 1; - ddPoly->maxLists = 1; - ddPoly->ddList = ddPoint; - ddPoint->numPoints = numPoints; - ddPoint->maxData = numPoints * sizeof(ddCoord3D); - ddPoint->pts.p3Dpt = (ddCoord3D *)(ddPoint + 1); - EXTRACT_LISTOF_COORD3D(ddPoint->numPoints,ddPoint->pts.p3Dpt,ptr); - - OC_PARSER_RETURN(ddPoly); - -} - - -OC_PARSER_FUNC_HEADER(PolylineSet) -{ - miPolylineStruct *ddPoly; - listofddPoint *ddPoint; - pexPolylineSet *pPoly = (pexPolylineSet *)pPEXOC; - PARSER_PTR(ptr); - ddULONG i; - CARD32 numPoints; - int vertexSize = 0; - ddPointer vertexPtr = 0; - ddPointer rptr = 0; - ddpex2rtn err = Success; - - ptr = (ddPointer)(pPoly+1); - for (i=0; inumLists; i++) { - EXTRACT_CARD32(numPoints, ptr); - ptr += CountVertexData( ptr, pPoly->colourType, numPoints, - pPoly->vertexAttribs); } - - vertexSize = ptr - (ddPointer)(pPoly+1) - - pPoly->numLists * sizeof(CARD32); - - GET_DD_STORAGE( ddPoly, miListHeader, - (sizeof(miListHeader) + vertexSize - + pPoly->numLists * sizeof(listofddPoint))); - ddPoly->numLists = (ddULONG)(pPoly->numLists); - ddPoly->maxLists = ddPoly->numLists; - ddPoly->flags = 0; - ddPoly->ddList = (listofddPoint *)(ddPoly+1); - ptr = (ddPointer)(pPoly+1); - - for (i=0, ddPoint = (listofddPoint *)(ddPoly+1), - vertexPtr = (ddPointer)(ddPoly->ddList + ddPoly->numLists); - inumLists; - i++, ddPoint++) { - - EXTRACT_CARD32(numPoints, ptr); - ParseVertexData( ptr, pPoly->colourType, numPoints, - pPoly->vertexAttribs, ddPoint, - &vertexPtr, &(ddPoly->type), &rptr); - ptr = rptr; - } - - OC_PARSER_RETURN(ddPoly); - -} - - -OC_PARSER_FUNC_HEADER(NurbCurve) -{ - miNurbStruct *ddNurb; - pexNurbCurve *pNurb = (pexNurbCurve *)pPEXOC; - ddUSHORT pointSize = 0; - PARSER_PTR(ptr); - - - pointSize = ((pNurb->coordType == PEXRational) - ? sizeof(ddCoord4D) : sizeof(ddCoord3D)); - GET_DD_STORAGE( ddNurb, miNurbStruct, (sizeof(miNurbStruct) - + sizeof(listofddPoint) + pNurb->numKnots * sizeof(ddFLOAT) - + pNurb->numPoints) * pointSize); - ddNurb->pKnots = (ddFLOAT *)(ddNurb+1); - ddNurb->points.ddList = (listofddPoint *)(ddNurb->pKnots + pNurb->numKnots); - EXTRACT_CARD16(ddNurb->order, ptr); - SKIP_PADDING(ptr,2); /* place holder for type */ - EXTRACT_FLOAT(ddNurb->uMin, ptr); - EXTRACT_FLOAT(ddNurb->uMax, ptr); - EXTRACT_CARD32(ddNurb->numKnots, ptr); - EXTRACT_CARD32(ddNurb->points.ddList->numPoints, ptr); - - EXTRACT_STRUCT(ddNurb->numKnots, PEXFLOAT, ddNurb->pKnots, ptr); - if (pNurb->coordType == PEXRational) { - ddNurb->points.type = DDPT_4D; - ddNurb->points.ddList->pts.p4Dpt = - (ddCoord4D *)((ddNurb->points.ddList)+1); - EXTRACT_STRUCT( ddNurb->points.ddList->numPoints, ddCoord4D, - ddNurb->points.ddList->pts.p4Dpt, ptr); - } else { - ddNurb->points.type = DDPT_3D; - ddNurb->points.ddList->pts.p3Dpt = - (ddCoord3D *)((ddNurb->points.ddList)+1); - EXTRACT_STRUCT( ddNurb->points.ddList->numPoints, ddCoord3D, - ddNurb->points.ddList->pts.p3Dpt, ptr); - } - - ddNurb->points.numLists = 1; - ddNurb->points.maxLists = 1; - ddNurb->points.flags = 0; - - OC_PARSER_RETURN(ddNurb); -} - - -OC_PARSER_FUNC_HEADER(FillArea2D) -{ - miFillAreaStruct *ddFill; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexFillArea2D) / sizeof(pexCoord2D); - GET_DD_STORAGE( ddFill, miFillAreaStruct, (sizeof(miFillAreaStruct) + - sizeof(listofddFacet) + sizeof(listofddPoint) - + numPoints * sizeof(ddCoord2D))); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - EXTRACT_CARD16(ddFill->shape, ptr); - EXTRACT_CARD8(ddFill->ignoreEdges, ptr); - SKIP_PADDING(ptr, 1); - - ddFill->pFacets->type = DD_FACET_NONE; - ddFill->pFacets->numFacets = 0; - ddFill->pFacets->facets.pNoFacet = NULL; - ddFill->contourHint = 0; - - ddFill->points.type = DD_2D_POINT; - ddFill->points.flags = 0; - ddFill->points.numLists = 1; - ddFill->points.maxLists = 1; - ddFill->points.ddList->numPoints = numPoints; - ddFill->points.ddList->pts.p2Dpt = (ddCoord2D *)((ddFill->points.ddList) +1); - EXTRACT_LISTOF_COORD2D( ddFill->points.ddList->numPoints, - ddFill->points.ddList->pts.p2Dpt,ptr); - - OC_PARSER_RETURN(ddFill); -} - - - - -OC_PARSER_FUNC_HEADER(FillArea) -{ - miFillAreaStruct *ddFill; - ddULONG numPoints; - PARSER_PTR(ptr); - - numPoints = LEN_WO_HEADER(pexFillArea) / sizeof(pexCoord3D); - GET_DD_STORAGE( ddFill, miFillAreaStruct, (sizeof(miFillAreaStruct) + - sizeof(listofddFacet) + sizeof(listofddPoint) - + numPoints * sizeof(ddCoord3D))); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - EXTRACT_CARD16(ddFill->shape, ptr); - EXTRACT_CARD8(ddFill->ignoreEdges, ptr); - SKIP_PADDING(ptr, 1); - ddFill->contourHint = 0; - - ddFill->pFacets->type = DD_FACET_NONE; - ddFill->pFacets->numFacets = 0; - ddFill->pFacets->facets.pNoFacet = NULL; - - ddFill->points.type = DD_3D_POINT; - ddFill->points.flags = 0; - ddFill->points.numLists = 1; - ddFill->points.maxLists = 1; - ddFill->points.ddList->numPoints = numPoints; - ddFill->points.ddList->pts.p3Dpt = (ddCoord3D *)((ddFill->points.ddList) +1); - EXTRACT_LISTOF_COORD3D( ddFill->points.ddList->numPoints, - ddFill->points.ddList->pts.p3Dpt,ptr); - - OC_PARSER_RETURN(ddFill); -} - - -OC_PARSER_FUNC_HEADER(ExtFillArea) -{ - miFillAreaStruct *ddFill; - pexExtFillArea *pFill = (pexExtFillArea *)pPEXOC; - PARSER_PTR(ptr); - ddPointer rptr = 0; - ddPointer facetPtr = 0; - int facetSize = 0; - ddPointer vertexPtr = 0; - int vertexSize = 0; - ddpex2rtn err = Success; - CARD32 totalVertices; - - ptr = (ddPointer)(pFill+1); - facetSize = CountFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)1, pFill->facetAttribs); - - ptr += facetSize; /* this works because dd types == protocol types */ - EXTRACT_CARD32(totalVertices, ptr); - vertexSize = CountVertexData( ptr, pFill->colourType, totalVertices, - pFill->vertexAttribs); - GET_DD_STORAGE( ddFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + sizeof(listofddPoint) + facetSize + vertexSize)); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - ddFill->shape = pFill->shape; - ddFill->ignoreEdges = pFill->ignoreEdges; - ddFill->contourHint = 0; - ddFill->points.numLists = 1; - ddFill->points.maxLists = 1; - ddFill->points.flags = 0; - - ptr = (ddPointer)(pFill+1); - facetPtr = (ddPointer)(ddFill->points.ddList + 1); - ParseFacetOptData( ptr, (CARD16)(pFill->colourType), (CARD32)1, - pFill->facetAttribs, ddFill->pFacets, - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - ParseVertexData( ptr, pFill->colourType, totalVertices, - pFill->vertexAttribs, ddFill->points.ddList, - &vertexPtr, &(ddFill->points.type), &rptr); - ptr = rptr; - - OC_PARSER_RETURN(ddFill); -} - - -OC_PARSER_FUNC_HEADER(FillAreaSet2D) -{ - miFillAreaStruct *ddFill; - PARSER_PTR(ptr); - ddULONG i; - int listSize = 0, numPoints = 0; - listofddPoint *ddPoint; - ddPointer ddPtr; - pexFillAreaSet2D *pFill = (pexFillAreaSet2D *)pPEXOC; - - ptr = (ddPointer)(pFill+1); - for (i=0; inumLists; i++) { - EXTRACT_CARD32( numPoints, ptr); - listSize += numPoints * sizeof(ddCoord2D); - ptr += numPoints * sizeof(ddCoord2D); } - - GET_DD_STORAGE( ddFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + (pFill->numLists * sizeof(listofddPoint)) - + listSize )); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - ddFill->shape = pFill->shape; - ddFill->ignoreEdges = pFill->ignoreEdges; - ddFill->contourHint = pFill->contourHint; - - ddFill->pFacets->type = DD_FACET_NONE; - ddFill->pFacets->numFacets = 0; - ddFill->pFacets->facets.pNoFacet = NULL; - - ddFill->points.type = DD_2D_POINT; - ddFill->points.flags = 0; - ddFill->points.numLists = pFill->numLists; - ddFill->points.maxLists = ddFill->points.numLists; - - ptr = (ddPointer)(pFill+1); - for (i=0, ddPoint = ddFill->points.ddList, - ddPtr = (ddPointer)(ddFill->points.ddList + ddFill->points.numLists); - ipoints.numLists; - i++, ddPoint++) { - EXTRACT_CARD32( ddPoint->numPoints, ptr); - ddPoint->pts.p2Dpt = (ddCoord2D *)ddPtr; - ddPtr += ddPoint->numPoints * sizeof(ddCoord2D); - EXTRACT_STRUCT( ddPoint->numPoints, ddCoord2D, - ddPoint->pts.p2Dpt, ptr); - } - - OC_PARSER_RETURN(ddFill); -} - - -OC_PARSER_FUNC_HEADER(FillAreaSet) -{ - miFillAreaStruct *ddFill; - PARSER_PTR(ptr); - ddULONG i; - int listSize = 0, numPoints = 0; - listofddPoint *ddPoint; - ddPointer ddPtr; - pexFillAreaSet *pFill = (pexFillAreaSet *)pPEXOC; - - ptr = (ddPointer)(pFill+1); - for (i=0; inumLists; i++) { - EXTRACT_CARD32( numPoints, ptr); - listSize += numPoints * sizeof(ddCoord3D); - ptr += numPoints * sizeof(ddCoord3D); } - - GET_DD_STORAGE( ddFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) - + sizeof(listofddFacet) - + (pFill->numLists * sizeof(listofddPoint)) - + listSize )); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - ddFill->shape = pFill->shape; - ddFill->ignoreEdges = pFill->ignoreEdges; - ddFill->contourHint = pFill->contourHint; - - ddFill->pFacets->type = DD_FACET_NONE; - ddFill->pFacets->numFacets = 0; - ddFill->pFacets->facets.pNoFacet = NULL; - - ddFill->points.type = DD_3D_POINT; - ddFill->points.flags = 0; - ddFill->points.numLists = pFill->numLists; - ddFill->points.maxLists = ddFill->points.numLists; - - ptr = (ddPointer)(pFill+1); - for (i=0, ddPoint = ddFill->points.ddList, - ddPtr = (ddPointer)(ddFill->points.ddList + ddFill->points.numLists); - ipoints.numLists; - i++, ddPoint++) { - EXTRACT_CARD32( ddPoint->numPoints, ptr); - ddPoint->pts.p3Dpt = (ddCoord3D *)ddPtr; - ddPtr += ddPoint->numPoints * sizeof(ddCoord3D); - EXTRACT_STRUCT( ddPoint->numPoints, ddCoord3D, - ddPoint->pts.p3Dpt, ptr); - } - - OC_PARSER_RETURN(ddFill); -} - - -OC_PARSER_FUNC_HEADER(ExtFillAreaSet) -{ - miFillAreaStruct *ddFill; - PARSER_PTR(ptr); - ddULONG i; - ddULONG numPoints; - listofddPoint *ddPoint; - pexExtFillAreaSet *pFill = (pexExtFillAreaSet *)(pPEXOC); - ddPointer rptr = 0; - ddPointer facetPtr = 0; - int facetSize = 0; - ddPointer vertexPtr = 0; - int vertexSize = 0; - ddpex2rtn err = Success; - - ptr = (ddPointer)(pFill+1); - facetSize = CountFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)1, pFill->facetAttribs); - ptr += facetSize; /* this works because dd types == protocol types */ - for (i=0; inumLists; i++) { - EXTRACT_CARD32( numPoints, ptr); - ptr += CountVertexData( ptr, pFill->colourType, numPoints, - pFill->vertexAttribs); } - - vertexSize = ptr - (ddPointer)(pFill+1) - facetSize; - GET_DD_STORAGE( ddFill, miFillAreaStruct, - (sizeof(miFillAreaStruct) + sizeof(listofddFacet) - + (pFill->numLists * sizeof(listofddPoint) - + facetSize + vertexSize))); - ddFill->pFacets = (listofddFacet *)(ddFill+1); - ddFill->points.ddList = (listofddPoint *)((ddFill->pFacets)+1); - ddFill->shape = pFill->shape; - ddFill->ignoreEdges = pFill->ignoreEdges; - ddFill->contourHint = pFill->contourHint; - ddFill->points.numLists = (ddULONG)(pFill->numLists); - ddFill->points.maxLists = ddFill->points.numLists; - ddFill->points.flags = 0; - ptr = (ddPointer)(pFill+1); - - facetPtr = (ddPointer)(ddFill->points.ddList + pFill->numLists); - ParseFacetOptData( ptr, (CARD16)(pFill->colourType), (CARD32)1, - pFill->facetAttribs, ddFill->pFacets, - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - for (i=0, ddPoint = ddFill->points.ddList; - ipoints.numLists; - i++, ddPoint++) { - - EXTRACT_CARD32( numPoints, ptr); - ParseVertexData( ptr, pFill->colourType, numPoints, - pFill->vertexAttribs, ddPoint, &vertexPtr, - &(ddFill->points.type), &rptr); - ptr = rptr; - } - - - OC_PARSER_RETURN(ddFill); -} - - -OC_PARSER_FUNC_HEADER(SOFAS) -{ - miSOFASStruct *ddFill; - pexSOFAS *pFill = (pexSOFAS *)pPEXOC; - PARSER_PTR(ptr); - CARD16 i,j,k; - miConnListList *pCLL; - miConnList *pCList; - ddPointer rptr = 0; - ddpex2rtn err = Success; - ddPointer facetPtr = 0; - ddPointer vertexPtr = 0; - int facetSize = 0; - int vertexSize = 0; - int edgeSize = 0; - extern void destroySOFAS(); - - facetSize = CountFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)(pFill->numFAS), - pFill->FAS_Attributes); - vertexSize = CountVertexData( ptr, pFill->colourType, - (CARD32)(pFill->numVertices), - pFill->vertexAttributes); - if (pFill->edgeAttributes) { - edgeSize = pFill->numEdges * sizeof(ddUCHAR); - edgeSize += ((4 - (edgeSize & 3)) & 3); /* force lword alignment for - connects data */ - } - - GET_DD_STORAGE( ddFill, miSOFASStruct, (sizeof(miSOFASStruct) + - sizeof(listofddPoint) + - facetSize + vertexSize + edgeSize + - (pFill->numFAS * sizeof(miConnListList)))); - EXTRACT_CARD16(ddFill->shape, ptr); - ddFill->contourHint = pFill->contourHint; - ddFill->contourCountsFlag = pFill->contourCountsFlag; - ddFill->numFAS = pFill->numFAS; - ddFill->numEdges = pFill->numEdges; - ptr = (ddPointer)(pFill+1); - ddFill->points.ddList = (listofddPoint *)(ddFill + 1); - ddFill->points.flags = 0; - ddFill->points.numLists = 1; - ddFill->points.maxLists = 1; - - facetPtr = (ddPointer)(ddFill->points.ddList + 1); - ParseFacetOptData( ptr, (CARD16)(pFill->colourType), - (CARD32)(pFill->numFAS), - pFill->FAS_Attributes, &(ddFill->pFacets), - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - ParseVertexData( ptr, pFill->colourType, (CARD32)(pFill->numVertices), - pFill->vertexAttributes, ddFill->points.ddList, - &vertexPtr, &(ddFill->points.type), &rptr); - ptr = rptr; - - ddFill->edgeAttribs = pFill->edgeAttributes; - if (pFill->edgeAttributes){ - ddFill->edgeData = (ddUCHAR *)vertexPtr; - EXTRACT_STRUCT(ddFill->numEdges, ddUCHAR, ddFill->edgeData, ptr); - SKIP_PADDING( ptr, ((4 - (ddFill->numEdges & 3)) & 3) ); - } - else { ddFill->edgeData = 0; } - vertexPtr += edgeSize; - - ddFill->connects.numListLists = pFill->numFAS; - ddFill->connects.data = (miConnListList *)vertexPtr; - ddFill->connects.maxData = ddFill->numFAS * sizeof(miConnListList); - for (i=0, pCLL = ddFill->connects.data; inumFAS; i++, pCLL++) { - EXTRACT_CARD16(pCLL->numLists,ptr); - GET_MORE_STORAGE( pCLL->pConnLists, miConnList, - pCLL->numLists * sizeof(miConnList)); - if (err) { - destroySOFAS(ddFill); - return(BadAlloc); - } - pCLL->maxData = pCLL->numLists * sizeof(miConnList); - for (j=0, pCList=pCLL->pConnLists; jnumLists; j++, pCList++) { - EXTRACT_CARD16(pCList->numLists,ptr); - GET_MORE_STORAGE( pCList->pConnects, ddUSHORT, - pCList->numLists * sizeof(ddUSHORT)); - if (err) { - destroySOFAS(ddFill); - return(BadAlloc); - } - EXTRACT_STRUCT(pCList->numLists, ddUSHORT, pCList->pConnects, ptr); - pCList->maxData = pCList->numLists * sizeof(ddUSHORT); - } - } - - OC_PARSER_RETURN(ddFill); -} - - - -OC_PARSER_FUNC_HEADER(TriangleStrip) -{ - miTriangleStripStruct *ddTriangle; - PARSER_PTR(ptr); - pexTriangleStrip *pTriangle = (pexTriangleStrip *)pPEXOC; - ddPointer rptr = 0; - ddpex2rtn err = Success; - ddPointer facetPtr = 0; - int facetSize = 0; - ddPointer vertexPtr = 0; - int vertexSize = 0; - - facetSize = CountFacetOptData( ptr, (CARD16)(pTriangle->colourType), - (CARD32)(pTriangle->numVertices - 2), - pTriangle->facetAttribs); - vertexSize = CountVertexData( ptr, pTriangle->colourType, - pTriangle->numVertices, - pTriangle->vertexAttribs); - GET_DD_STORAGE( ddTriangle, miTriangleStripStruct, - (sizeof(miTriangleStripStruct) + sizeof(listofddFacet) - + sizeof(listofddPoint) + facetSize + vertexSize)); - ddTriangle->pFacets = (listofddFacet *)(ddTriangle+1); - ddTriangle->points.numLists = 1; - ddTriangle->points.maxLists = 1; - ddTriangle->points.ddList = (listofddPoint *)((ddTriangle->pFacets)+1); - ptr = (ddPointer)(pTriangle +1); - - facetPtr = (ddPointer)(ddTriangle->points.ddList + 1); - ParseFacetOptData( ptr, (CARD16)(pTriangle->colourType), - (pTriangle->numVertices - 2), - pTriangle->facetAttribs, ddTriangle->pFacets, - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - ParseVertexData( ptr, pTriangle->colourType, pTriangle->numVertices, - pTriangle->vertexAttribs, ddTriangle->points.ddList, - &vertexPtr, &(ddTriangle->points.type), &rptr); - ptr = rptr; - - OC_PARSER_RETURN(ddTriangle); -} - - -OC_PARSER_FUNC_HEADER(QuadrilateralMesh) -{ - miQuadMeshStruct *ddQuad; - PARSER_PTR(ptr); - pexQuadrilateralMesh *pQuad = (pexQuadrilateralMesh *)pPEXOC; - ddPointer rptr = 0; - ddpex2rtn err = Success; - ddPointer facetPtr = 0; - int facetSize = 0; - ddPointer vertexPtr = 0; - int vertexSize = 0; - - facetSize = CountFacetOptData( ptr, (CARD16)(pQuad->colourType), - (CARD32)((pQuad->mPts-1)*(pQuad->nPts-1)), - pQuad->facetAttribs); - vertexSize = CountVertexData( ptr, pQuad->colourType, - (CARD32)(pQuad->mPts * pQuad->nPts), - pQuad->vertexAttribs); - GET_DD_STORAGE( ddQuad, miQuadMeshStruct, - (sizeof(miQuadMeshStruct) + facetSize + vertexSize - + sizeof(listofddFacet) + sizeof(listofddPoint))); - ddQuad->pFacets = (listofddFacet *)(ddQuad+1); - ddQuad->points.numLists = 1; - ddQuad->points.maxLists = 1; - ddQuad->points.ddList = (listofddPoint *)((ddQuad->pFacets)+1); - ddQuad->mPts = pQuad->mPts; - ddQuad->nPts = pQuad->nPts; - ddQuad->shape = (ddUSHORT)(pQuad->shape); - ptr = (ddPointer)(pQuad+1); - - /** Now we should be at the head of the opt data **/ - facetPtr = (ddPointer)(ddQuad->points.ddList + 1); - ParseFacetOptData( ptr, (CARD16)(pQuad->colourType), - (CARD32)((pQuad->mPts-1)*(pQuad->nPts-1)), - pQuad->facetAttribs, ddQuad->pFacets, - facetPtr, &rptr); - ptr = rptr; - - vertexPtr = facetPtr + facetSize; - ParseVertexData( ptr, pQuad->colourType, - (CARD32)(pQuad->mPts*pQuad->nPts), - pQuad->vertexAttribs, ddQuad->points.ddList, - &vertexPtr, &(ddQuad->points.type), &rptr); - ptr = rptr; - - OC_PARSER_RETURN(ddQuad); -} - - -OC_PARSER_FUNC_HEADER(NurbSurface) -{ - miNurbSurfaceStruct *ddNurb; - PARSER_PTR(ptr); - pexNurbSurface *pNurb = (pexNurbSurface *)pPEXOC; - ddULONG i, j; - listofTrimCurve *ddTrim; - ddTrimCurve *ddtc; - ddUSHORT type; - ddpex2rtn err = Success; - - GET_DD_STORAGE(ddNurb, miNurbSurfaceStruct, (sizeof(miNurbSurfaceStruct) - + (pNurb->numUknots * pNurb->numVknots) * (sizeof(ddFLOAT)) - + (sizeof(listofddPoint)) - + pNurb->mPts * pNurb->nPts * sizeof(ddCoord4D) - + (sizeof(listofTrimCurve)) - + pNurb->numLists * sizeof(ddTrimCurve))); - - ddNurb->pUknots = (ddFLOAT *)(ddNurb+1); - ddNurb->pVknots = (ddFLOAT *)((ddNurb->pUknots) + pNurb->numUknots); - ddNurb->points.ddList = - (listofddPoint *)((ddNurb->pVknots) + pNurb->numVknots); - ddNurb->points.ddList->pts.ptr = (char *)(ddNurb->points.ddList + 1); - ddNurb->trimCurves = - (listofTrimCurve *)((ddNurb->points.ddList->pts.ptr) - + (pNurb->mPts * pNurb->nPts) * sizeof(ddCoord4D)); - - SKIP_PADDING(ptr, 2); /* place holder for type */ - EXTRACT_CARD16(ddNurb->uOrder, ptr); - EXTRACT_CARD16(ddNurb->vOrder, ptr); - SKIP_PADDING(ptr, 2); - EXTRACT_CARD32(ddNurb->numUknots, ptr); - EXTRACT_CARD32(ddNurb->numVknots, ptr); - EXTRACT_CARD16(ddNurb->mPts, ptr); - EXTRACT_CARD16(ddNurb->nPts, ptr); - EXTRACT_CARD32(ddNurb->numTrimCurveLists, ptr); /* is pNurb->numLists */ - - EXTRACT_STRUCT(ddNurb->numUknots, PEXFLOAT, ddNurb->pUknots, ptr); - EXTRACT_STRUCT(ddNurb->numVknots, PEXFLOAT, ddNurb->pVknots, ptr); - - ddNurb->points.numLists = 1; - ddNurb->points.maxLists = 1; - ddNurb->points.ddList->numPoints = ddNurb->mPts * ddNurb->nPts; - if (pNurb->type == PEXRational) { - ddNurb->points.type = DD_HOMOGENOUS_POINT; - EXTRACT_STRUCT( ddNurb->points.ddList->numPoints, ddCoord4D, - ddNurb->points.ddList->pts.p4Dpt, ptr); - } else { - ddNurb->points.type = DD_3D_POINT; - EXTRACT_STRUCT( ddNurb->points.ddList->numPoints, ddCoord3D, - ddNurb->points.ddList->pts.p3Dpt, ptr); - } - - for ( i=0, ddTrim = ddNurb->trimCurves; - inumTrimCurveLists; - i++, ddTrim++) { - EXTRACT_CARD32(ddTrim->count, ptr); - GET_MORE_STORAGE( ddTrim->pTC, ddTrimCurve, - ddTrim->count*sizeof(ddTrimCurve)); - if (err) { - destroyNurbSurface(ddNurb); - return (BadAlloc); - } - - for ( j=0, ddtc = ddTrim->pTC; - j < ddTrim->count; - j++, ddtc++) { - EXTRACT_CARD8(ddtc->visibility, ptr); - SKIP_PADDING(ptr, 1); - EXTRACT_CARD16(ddtc->order, ptr); - EXTRACT_CARD16(type, ptr); - EXTRACT_CARD16(ddtc->curveApprox.approxMethod, ptr); - EXTRACT_FLOAT(ddtc->curveApprox.tolerance, ptr); - EXTRACT_FLOAT(ddtc->uMin, ptr); - EXTRACT_FLOAT(ddtc->uMax, ptr); - EXTRACT_CARD32(ddtc->numKnots, ptr); - EXTRACT_CARD32(ddtc->points.numPoints, ptr); - GET_MORE_STORAGE( ddtc->pKnots, ddFLOAT, - sizeof(ddFLOAT) * ddtc->numKnots ); - if (err) { - ddtc->points.pts.ptr = 0; - destroyNurbSurface(ddNurb); - return(BadAlloc); - } - EXTRACT_STRUCT( ddtc->numKnots, PEXFLOAT, ddtc->pKnots, ptr); - if (type == PEXRational) { - /* Note this only works because these points are never - transformed */ - ddtc->pttype = DD_3D_POINT; - ddtc->points.pts.p3Dpt = 0; - GET_MORE_STORAGE( ddtc->points.pts.p3Dpt, ddCoord3D, - sizeof(ddCoord3D)*ddtc->points.numPoints); - EXTRACT_STRUCT( ddtc->points.numPoints, ddCoord3D, - ddtc->points.pts.p3Dpt, ptr); - } else { - ddtc->pttype = DD_2D_POINT; - ddtc->points.pts.p2Dpt = 0; - GET_MORE_STORAGE( ddtc->points.pts.p2Dpt, ddCoord2D, - sizeof(ddCoord2D)*ddtc->points.numPoints ); - EXTRACT_STRUCT( ddtc->points.numPoints, ddCoord2D, - ddtc->points.pts.p2Dpt, ptr); - } - if (err) { - destroyNurbSurface(ddNurb); - return(BadAlloc); - } - } - } - - OC_PARSER_RETURN(ddNurb); - -} - - -OC_PARSER_FUNC_HEADER(CellArray2D) -{ - miCellArrayStruct *ddCell; - PARSER_PTR(ptr); - pexCellArray2D *pCell = (pexCellArray2D *)pPEXOC; - - GET_DD_STORAGE( ddCell, miCellArrayStruct, sizeof(miCellArrayStruct) - + sizeof(listofddPoint) + 2 * sizeof(ddCoord2D) - + pCell->dx * pCell->dy * sizeof(ddIndexedColour)); - ddCell->point.ddList = (listofddPoint *)(ddCell+1); - - ddCell->point.type = DD_2D_POINT; - ddCell->point.numLists = 1; - ddCell->point.maxLists = 1; - ddCell->point.ddList->numPoints = 2; - ddCell->point.ddList->pts.p2Dpt = - (ddCoord2D *)((ddCell->point.ddList) + 1); - EXTRACT_LISTOF_COORD2D(2, ddCell->point.ddList->pts.p2Dpt, ptr); - - EXTRACT_CARD32(ddCell->dx, ptr); - EXTRACT_CARD32(ddCell->dy, ptr); - ddCell->colours.colour.pIndex = - (ddIndexedColour *)((ddCell->point.ddList->pts.p2Dpt) + 2); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddIndexedColour, - ddCell->colours.colour.pIndex, ptr); - - OC_PARSER_RETURN(ddCell); -} - - -OC_PARSER_FUNC_HEADER(CellArray) -{ - miCellArrayStruct *ddCell; - PARSER_PTR(ptr); - pexCellArray *pCell = (pexCellArray *)pPEXOC; - - GET_DD_STORAGE( ddCell, miCellArrayStruct, sizeof(miCellArrayStruct) - + sizeof(listofddPoint) + 3 * sizeof(ddCoord3D) - + pCell->dx * pCell->dy * sizeof(ddIndexedColour)); - ddCell->point.ddList = (listofddPoint *)(ddCell+1); - - ddCell->point.type = DD_3D_POINT; - ddCell->point.numLists = 1; - ddCell->point.maxLists = 1; - ddCell->point.ddList->numPoints = 3; - ddCell->point.ddList->pts.p3Dpt = - (ddCoord3D *)((ddCell->point.ddList) + 1); - EXTRACT_LISTOF_COORD3D(3, ddCell->point.ddList->pts.p3Dpt, ptr); - - EXTRACT_CARD32(ddCell->dx, ptr); - EXTRACT_CARD32(ddCell->dy, ptr); - ddCell->colours.colour.pIndex = - (ddIndexedColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddIndexedColour, - ddCell->colours.colour.pIndex, ptr); - - OC_PARSER_RETURN(ddCell); -} - - -OC_PARSER_FUNC_HEADER(ExtCellArray) -{ - miCellArrayStruct *ddCell; - PARSER_PTR(ptr); - pexExtCellArray *pCell = (pexExtCellArray *)pPEXOC; - unsigned long size; - - size = (((pCell->colourType==PEXIndexedColour) - || (pCell->colourType==PEXRgb8Colour)) ? 4 : - ((pCell->colourType==PEXRgb16Colour) ? 8 : 12 )); - GET_DD_STORAGE( ddCell, miCellArrayStruct, sizeof(miCellArrayStruct) - + sizeof(listofddPoint) + 3 * sizeof(ddCoord3D) - + pCell->dx * pCell->dy * size); - ddCell->point.ddList = (listofddPoint *)(ddCell+1); - - EXTRACT_CARD16(ddCell->colours.colourType, ptr); - SKIP_PADDING(ptr, 2); - - ddCell->point.type = DD_3D_POINT; - ddCell->point.numLists = 1; - ddCell->point.maxLists = 1; - ddCell->point.ddList->numPoints = 3; - ddCell->point.ddList->pts.p3Dpt = - (ddCoord3D *)((ddCell->point.ddList) + 1); - EXTRACT_LISTOF_COORD3D(3, ddCell->point.ddList->pts.p3Dpt, ptr); - EXTRACT_CARD32(ddCell->dx, ptr); - EXTRACT_CARD32(ddCell->dy, ptr); - - switch (pCell->colourType) { - - case PEXIndexedColour: { - ddCell->colours.colour.pIndex = - (ddIndexedColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddIndexedColour, - ddCell->colours.colour.pIndex, ptr); - break; } - - case PEXRgbFloatColour : { - ddCell->colours.colour.pRgbFloat = - (ddRgbFloatColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddRgbFloatColour, - ddCell->colours.colour.pRgbFloat, ptr); - break; } - - case PEXCieFloatColour : { - ddCell->colours.colour.pCie = - (ddCieColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddCieColour, - ddCell->colours.colour.pCie, ptr); - break; } - - case PEXHsvFloatColour : { - ddCell->colours.colour.pHsv = - (ddHsvColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddHsvColour, - ddCell->colours.colour.pHsv, ptr); - break; } - - case PEXHlsFloatColour : { - ddCell->colours.colour.pHls = - (ddHlsColour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddHlsColour, - ddCell->colours.colour.pHls, ptr); - break; } - - case PEXRgb8Colour : { - ddCell->colours.colour.pRgb8 = - (ddRgb8Colour *)((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddRgb8Colour, - ddCell->colours.colour.pRgb8, ptr); - break; } - - case PEXRgb16Colour : { - ddCell->colours.colour.pRgb16 = - (ddRgb16Colour *) ((ddCell->point.ddList->pts.p3Dpt) + 3); - EXTRACT_STRUCT( ddCell->dx * ddCell->dy, ddRgb16Colour, - ddCell->colours.colour.pRgb16, ptr); - break; } - - } - - OC_PARSER_RETURN(ddCell); - -} - - -OC_PARSER_FUNC_HEADER(PSurfaceChars) -{ - miPSurfaceCharsStruct *ddPSC; - ddULONG sType = 0; - ddPointer ptr = (ddPointer)pPEXOC; - - sType = ((pexParaSurfCharacteristics *)pPEXOC)->characteristics; - SKIP_PADDING(ptr,sizeof(pexParaSurfCharacteristics)); - - switch (sType) { - case PEXPSCNone: - case PEXPSCImpDep: - GET_DD_STORAGE( ddPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct)); - break; - - case PEXPSCIsoCurves: { - GET_DD_STORAGE( ddPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_IsoparametricCurves)); - ddPSC->data.pIsoCurves = (ddPSC_IsoparametricCurves *)(ddPSC + 1); - EXTRACT_CARD16(ddPSC->data.pIsoCurves->placementType, ptr); - SKIP_PADDING(ptr, 2); - EXTRACT_CARD16(ddPSC->data.pIsoCurves->numUcurves, ptr); - EXTRACT_CARD16(ddPSC->data.pIsoCurves->numVcurves, ptr); - break; } - - case PEXPSCMcLevelCurves: { - GET_DD_STORAGE( ddPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_LevelCurves)); - ddPSC->data.pMcLevelCurves = (ddPSC_LevelCurves *)(ddPSC + 1); - EXTRACT_STRUCT( 1,ddPSC_LevelCurves,ddPSC->data.pMcLevelCurves, ptr); - break; } - - case PEXPSCWcLevelCurves: { - GET_DD_STORAGE( ddPSC, miPSurfaceCharsStruct, - sizeof(miPSurfaceCharsStruct) - + sizeof(ddPSC_LevelCurves)); - ddPSC->data.pWcLevelCurves = (ddPSC_LevelCurves *)(ddPSC + 1); - EXTRACT_STRUCT( 1,ddPSC_LevelCurves,ddPSC->data.pWcLevelCurves, ptr); - break; } - } - - ddPSC->type = sType; - - OC_PARSER_RETURN(ddPSC); -} - - - - -OC_PARSER_FUNC_HEADER(Gdp2D) -{ - miGdpStruct *ddGdp; - pexGdp2D *pGdp = (pexGdp2D *)pPEXOC; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddGdp, miGdpStruct, (sizeof(miGdpStruct) + - sizeof(listofddPoint) + pGdp->numBytes - + pGdp->numPoints * sizeof(ddCoord2D))); - ddGdp->points.ddList = (listofddPoint *)(ddGdp+1); - ddGdp->GDPid = pGdp->gdpId; - ddGdp->points.ddList->numPoints = pGdp->numPoints; - ddGdp->numBytes = pGdp->numBytes; - ddGdp->points.type = DD_2D_POINT; - ddGdp->points.numLists = 1; - ddGdp->points.maxLists = 1; - ddGdp->points.ddList->pts.p2Dpt = (ddCoord2D *)((ddGdp->points.ddList) + 1); - ptr = (ddPointer)(pGdp+1); - EXTRACT_LISTOF_COORD2D(ddGdp->points.ddList->numPoints, - ddGdp->points.ddList->pts.p2Dpt, ptr); - ddGdp->pData = ((ddUCHAR *)(ddGdp->points.ddList)) - + pGdp->numPoints * sizeof(ddCoord2D); - EXTRACT_STRUCT( ddGdp->numBytes, ddUCHAR, ddGdp->pData, ptr); - - OC_PARSER_RETURN(ddGdp); - -} - - -OC_PARSER_FUNC_HEADER(Gdp) -{ - miGdpStruct *ddGdp; - pexGdp *pGdp = (pexGdp *)pPEXOC; - PARSER_PTR(ptr); - - GET_DD_STORAGE( ddGdp, miGdpStruct, (sizeof(miGdpStruct) + - sizeof(listofddPoint) + pGdp->numBytes - + pGdp->numPoints * sizeof(ddCoord3D))); - ddGdp->points.ddList = (listofddPoint *)(ddGdp+1); - ddGdp->GDPid = pGdp->gdpId; - ddGdp->points.ddList->numPoints = pGdp->numPoints; - ddGdp->numBytes = pGdp->numBytes; - ddGdp->points.type = DD_3D_POINT; - ddGdp->points.numLists = 1; - ddGdp->points.maxLists = 1; - ddGdp->points.ddList->pts.p3Dpt = (ddCoord3D *)((ddGdp->points.ddList) + 1); - ptr = (ddPointer)(pGdp+1); - EXTRACT_LISTOF_COORD3D(ddGdp->points.ddList->numPoints, - ddGdp->points.ddList->pts.p3Dpt, ptr); - ddGdp->pData = ((ddUCHAR *)(ddGdp->points.ddList)) - + pGdp->numPoints * sizeof(ddCoord3D); - EXTRACT_STRUCT( ddGdp->numBytes, ddUCHAR, ddGdp->pData, ptr); - - OC_PARSER_RETURN(ddGdp); - -} - - -OC_PARSER_FUNC_HEADER(SetAttribute) -{ - /** The function vector should be set up to have this - ** SetAttribute function as the entry for all of the OC entries other - ** than those listed above or those NULL'd out - **/ - - ddElementInfo *dstAttrib; - - GET_DD_STORAGE( dstAttrib, ddElementInfo, - pPEXOC->length * sizeof(CARD32)); - - memcpy( (char *)dstAttrib, (char *)pPEXOC, - (int)(pPEXOC->length * sizeof(CARD32))); - - OC_PARSER_RETURN(pPEXOC); -} - - -OC_PARSER_FUNC_HEADER(PropOC) -{ - /** This handles storing ProprietaryOC - **/ - - ddElementInfo *dstPropOC; - - GET_DD_STORAGE( dstPropOC, ddElementInfo, - pPEXOC->length * sizeof(CARD32)); - - memcpy( (char *)dstPropOC, (char *)pPEXOC, - (int)(pPEXOC->length * sizeof(CARD32))); - - OC_PARSER_RETURN(pPEXOC); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile diff -u xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile:3.11 xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile:3.11 Wed Jan 17 17:12:27 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile Sat Feb 28 21:41:54 2004 @@ -1,66 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:08 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level3/Imakefile,v 3.11 2001/01/17 22:12:27 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM or the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDdpexCDebugFlags -#define PexDdpexCDebugFlags ServerCDebugFlags -#endif - -XCOMM -D defines for ddpex: -XCOMM DDTEST turns on some fprintf(stderr...)s for debugging - - DEFINES = PexDdpexDefines -CDEBUGFLAGS = PexDdpexCDebugFlags - - PEXSERVINC = ../../../include -DDPEXINCLUDE = ../include - -INCLUDES = -I. \ - -I$(DDPEXINCLUDE) \ - -I$(XINCLUDESRC) \ - -I$(PEXSERVINC) \ - -I$(SERVERSRC)/include - -SRCS = miRender.c miRndrPick.c - -OBJS = miRender.o miRndrPick.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ddpex3,$(OBJS)) - -LintLibraryTarget(dp3, $(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c:3.7 Fri Dec 14 14:57:33 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c Sat Feb 28 21:41:54 2004 @@ -1,1970 +0,0 @@ -/* $Xorg: miRender.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level3/miRender.c,v 3.7 2001/12/14 19:57:33 dawes Exp $ */ - -#include "miLUT.h" -#include "dipex.h" -#include "ddpex3.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "PEXErr.h" -#include "pexUtils.h" -#include "pixmap.h" -#include "windowstr.h" -#include "regionstr.h" -#include "miscstruct.h" -#include "dixstruct.h" -#include "miRender.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "miWks.h" -#include "ddpex4.h" -#include "gcstruct.h" -#include "pexos.h" - - -/* External variables used */ - -extern void mi_set_filters(); -extern void miMatMult(); -extern ddpex3rtn miBldViewport_xform(); -extern ddpex3rtn miBldCC_xform(); -extern ocTableType ParseOCTable[]; -extern void (*DestroyOCTable[])(); -extern ocTableType InitExecuteOCTable[]; -extern ocTableType PickExecuteOCTable[]; -extern ocTableType SearchExecuteOCTable[]; -extern RendTableType RenderPrimitiveTable[]; -extern RendTableType PickPrimitiveTable[]; - -/* pcflag is initialized in ddpexInit() */ -ddBOOL pcflag; -ddPCAttr defaultPCAttr; -#define MI_GET_DEFAULT_PC(pPC) \ - if (!pcflag) { \ - DefaultPC(pPC); \ - pcflag = MI_TRUE; } - -ddFLOAT ident4x4[4][4] = { - {1.0, 0.0, 0.0, 0.0}, - {0.0, 1.0, 0.0, 0.0}, - {0.0, 0.0, 1.0, 0.0}, - {0.0, 0.0, 0.0, 1.0} -}; - - -/* Level III Rendering Procedures */ - -/*++ - | - | Function Name: InitRenderer - | - | Function Description: - | Initializes the dd stuff in the renderer for the - | PEXCreateRenderer request. - | - | Note(s): - | - --*/ - -ddpex3rtn -InitRenderer(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - - extern GCPtr CreateScratchGC(); - extern ddpex3rtn CreateDDContext(); - - ddpex3rtn err = Success; - - -#ifdef DDTEST - ErrorF( " InitRenderer\n"); -#endif - - /* set renderer dynamics */ - /* for now, set them all to be dynamic regardless of drawable type - * bit value of 0 means dynamic modifications - * bit value of 1 means no dynamic modifications - * todo: change this to be easy to specify individual dynamics - * OR with PEXDynxxx for static; OR with ~PEXDynxxx for dynamics - */ - /* since we don't actually make copies of namesets - * or luts so that their values are bound at BeginRendering, - * any change made in those tables/ns will be noticed anytime - * info is read from an lut/ns, therefore, the tables and namesets - * are dynamics and anytime a change is made, anything affected - * by that change must be updated. The update is done in - * ValidateRenderer, which is called at appropriate times to - * make sure everything is updated. - */ - pRend->tablesMask = 0; - pRend->namesetsMask = 0; - pRend->attrsMask = 0; - - /* - * Create a DDContext and associate it with the Renderer - */ - if (err = CreateDDContext(pRend)) return(err); - - /* copy the initial oc functions to the OC table */ - pRend->render_mode = MI_REND_DRAWING; - memcpy( (char *)pRend->executeOCs, - (char *)InitExecuteOCTable, - sizeof(ocTableType)*OCTABLE_LENGTH); - - MI_SET_ALL_CHANGES(pRend); - ValidateRenderer(pRend); - - return (Success); -} - -/*++ - | - | Function Name: DefaultPC - | - | Function Description: - | Initializes a global static copy of the PC to the default values. - | This copy is, in turn, used to initialize PC's the the initial values. - | - | Note(s): - | - --*/ - -void -DefaultPC(pPC) - ddPCAttr *pPC; -{ - pPC->markerType = PEXMarkerAsterisk; - pPC->markerScale = 1.0; - pPC->markerColour.colourType = PEXIndexedColour; - pPC->markerColour.colour.indexed.index = 1; - pPC->markerIndex = 1; - pPC->textFont = 1; - pPC->textPrecision = PEXStringPrecision; - pPC->charExpansion = 1.0; - pPC->charSpacing = 0.0; - pPC->textColour.colourType = PEXIndexedColour; - pPC->textColour.colour.indexed.index = 1; - pPC->charHeight = 0.01; - pPC->charUp.x = 0.0; - pPC->charUp.y = 1.0; - pPC->textPath = PEXPathRight; - pPC->textAlignment.vertical = PEXValignNormal; - pPC->textAlignment.horizontal = PEXHalignNormal; - pPC->atextHeight = 0.01; - pPC->atextUp.x = 0.0; - pPC->atextUp.y = 1.0; - pPC->atextPath = PEXPathRight; - pPC->atextAlignment.vertical = PEXValignNormal; - pPC->atextAlignment.horizontal = PEXHalignNormal; - pPC->atextStyle = PEXATextNotConnected; - pPC->textIndex = 1; - pPC->lineType = PEXLineTypeSolid; - pPC->lineWidth = 1.0; - pPC->lineColour.colourType = PEXIndexedColour; - pPC->lineColour.colour.indexed.index = 1; - pPC->curveApprox.approxMethod = PEXApproxConstantBetweenKnots; - pPC->curveApprox.tolerance = 1.0; - pPC->lineInterp = PEXPolylineInterpNone; - pPC->lineIndex = 1; - pPC->intStyle = PEXInteriorStyleHollow; - pPC->intStyleIndex = 1; - pPC->surfaceColour.colourType = PEXIndexedColour; - pPC->surfaceColour.colour.indexed.index = 1; - pPC->reflAttr.ambient = 1.0; - pPC->reflAttr.diffuse = 1.0; - pPC->reflAttr.specular = 1.0; - pPC->reflAttr.specularConc = 0.0; - pPC->reflAttr.transmission = 0.0; - pPC->reflAttr.specularColour.colourType = PEXIndexedColour; - pPC->reflAttr.specularColour.colour.indexed.index = 1; - pPC->reflModel = PEXReflectionNoShading; - pPC->surfInterp = PEXSurfaceInterpNone; - pPC->bfIntStyle = PEXInteriorStyleHollow; - pPC->bfIntStyleIndex = 1; - pPC->bfSurfColour.colourType = PEXIndexedColour; - pPC->bfSurfColour.colour.indexed.index = 1; - pPC->bfReflAttr.ambient = 1.0; - pPC->bfReflAttr.diffuse = 1.0; - pPC->bfReflAttr.specular = 1.0; - pPC->bfReflAttr.specularConc = 0.0; - pPC->bfReflAttr.transmission = 0.0; - pPC->bfReflAttr.specularColour.colourType = PEXIndexedColour; - pPC->bfReflAttr.specularColour.colour.indexed.index = 1; - pPC->bfReflModel = PEXReflectionNoShading; - pPC->bfSurfInterp = PEXSurfaceInterpNone; - - pPC->surfApprox.approxMethod = PEXApproxConstantBetweenKnots; - pPC->surfApprox.uTolerance = 1.0; - pPC->surfApprox.vTolerance = 1.0; - - pPC->cullMode = 0; - pPC->distFlag = FALSE; - pPC->patternSize.x = 1.0; - pPC->patternSize.y = 1.0; - pPC->patternRefPt.x = 0.0; - pPC->patternRefPt.y = 0.0; - pPC->patternRefPt.z = 0.0; - pPC->patternRefV1.x = 1.0; - pPC->patternRefV1.y = 0.0; - pPC->patternRefV1.z = 0.0; - pPC->patternRefV2.x = 0.0; - pPC->patternRefV2.y = 1.0; - pPC->patternRefV2.z = 0.0; - pPC->intIndex = 1; - pPC->edges = PEXOff; - pPC->edgeType = PEXSurfaceEdgeSolid; - pPC->edgeWidth = 1.0; - pPC->edgeColour.colourType = PEXIndexedColour; - pPC->edgeColour.colour.indexed.index = 1; - pPC->edgeIndex = 1; - memcpy( (char *) pPC->localMat, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - memcpy( (char *) pPC->globalMat, (char *) ident4x4, 16 * sizeof(ddFLOAT)); - pPC->modelClip = PEXNoClip; - pPC->modelClipVolume = puCreateList(DD_HALF_SPACE); - pPC->viewIndex = 0; - pPC->lightState = puCreateList(DD_INDEX); - pPC->depthCueIndex = 0; - pPC->colourApproxIndex = 0; - pPC->rdrColourModel = PEXRdrColourModelRGB; - pPC->psc.type = PEXPSCNone; - pPC->psc.data.none = '0'; - pPC->asfs = ~0L; - pPC->pickId = 0; - pPC->hlhsrType = 0; - pPC->pCurrentNS = NULL; - - return; -} - -/*++ - | - | Function Name: InquireRendererDynamics - | - | Function Description: - | Supports the PEXGetRendererDynamics request. - | - | Note(s): - | - --*/ - -ddpex3rtn -InquireRendererDynamics(pRend, pTablesMask, pNSMask, pAttrMask) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ - ddBitmask *pTablesMask; /* dynamics mask for luts */ - ddBitmask *pNSMask; /* dynamics mask for name sets */ - ddBitmask *pAttrMask;/* dynamics mask for renderer attributes */ -{ - -#ifdef DDTEST - ErrorF( " InquireRendererDynamics\n"); -#endif - - *pTablesMask = pRend->tablesMask; - *pNSMask = pRend->namesetsMask; - *pAttrMask = pRend->attrsMask; - - return (Success); -} - -/*++ - | - | Function Name: RenderOCs - | - | Function Description: - | Supports the PEXRenderOutputCommands request. - | - | Note(s): - | - --*/ - -ddpex3rtn -RenderOCs(pRend, numOCs, pOCs) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - ddULONG numOCs; - ddElementInfo *pOCs; -/* out */ -{ - register ddElementInfo *poc; - miGenericElementPtr pexoc; - ddpex2rtn err = Success; - XID fakestr; - diStructHandle sh = 0, ph; - pexStructure *ps; - pexOutputCommandError *pErr; - ddULONG offset1, offset2, numberOCs; - miTraverserState trav_state; - diPMHandle pPM = (diPMHandle) NULL; - unsigned long PEXStructType; - miStructPtr pheader; - ddPickPath *strpp; - miPPLevel *travpp; - int i, ROCdepth; - ddUSHORT serverstate; - - -#ifdef DDTEST - ErrorF( " RenderOCs\n"); -#endif - - /* if renderer idle ignore.... */ - if (pRend->state == PEXIdle) - return Success; - - ValidateRenderer(pRend); - - /* state == PEXPicking, call through traverser */ - if (pRend->state == PEXPicking) { - - /* get the structure handle from the last pickpath in the list of - fake structures (these are added by BeginStructure) - */ - ROCdepth = (pRend->pickstr.fakeStrlist)->numObj-1; - strpp = (ddPickPath *)(pRend->pickstr.fakeStrlist)->pList; - sh = strpp[ROCdepth].structure; - - /* set up incoming state properly for traverser */ - if (ROCdepth > 0) { - travpp = (miPPLevel *) xalloc(sizeof(miPPLevel)); - trav_state.p_pick_path = travpp; - travpp->pp = strpp[ROCdepth-1]; - for (i = ROCdepth-2; i >= 0; i--) { - travpp->up = (miPPLevel *) xalloc(sizeof(miPPLevel)); - travpp = travpp->up; - travpp->pp = strpp[i]; - } - } - - - /* now do the work of storing stuff into the structure */ - numberOCs = numOCs; - for ( poc=pOCs; numberOCs>0; numberOCs-- ) - { - - err = StoreElements( sh, 1, poc, &pErr); - if (err != Success) return(err); - - poc += poc->length; - } - - /* now call the traverser to traverse this structure */ - /* set exec_str_flag */ - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - trav_state.max_depth = ROCdepth; - trav_state.pickId = strpp[ROCdepth].pickid; - trav_state.ROCoffset = strpp[ROCdepth].offset; - pPM = pRend->pickstr.pseudoPM; - - /* turn off this flag so BeginStructure calls made inside traverser - do not cause fake structures to be allocated - */ - serverstate = pRend->pickstr.server; - pRend->pickstr.server = DD_NEITHER; - offset1 = 1; - offset2 = numOCs; - - err = traverser(pRend, sh, offset1, offset2, pPM, NULL, &trav_state); - - /* restore the state flag */ - pRend->pickstr.server = serverstate; - - /* save pickid returned by traverser */ - strpp[ROCdepth].pickid = trav_state.pickId; - strpp[ROCdepth].offset += numOCs; - - /* clean up structure */ - { - miStructPtr pheader = (miStructPtr) sh->deviceData; - extern cssTableType DestroyCSSElementTable[]; - - MISTR_DEL_ELS(sh, pheader, 1, numOCs); - MISTR_CURR_EL_PTR(pheader) = MISTR_ZERO_EL(pheader); - MISTR_CURR_EL_OFFSET(pheader) = 0; - - } - - } - else { - /* state == PEXRendering, call directly to level 2 for efficiency */ - for ( poc=pOCs; numOCs>0; numOCs-- ) - { - switch( poc->elementType ) { - /* drawing primitives */ - case PEXOCMarker: - case PEXOCMarker2D: - case PEXOCText: - case PEXOCText2D: - case PEXOCAnnotationText: - case PEXOCAnnotationText2D: - case PEXOCPolyline: - case PEXOCPolyline2D: - case PEXOCPolylineSet: - case PEXOCNurbCurve: - case PEXOCFillArea: - case PEXOCFillArea2D: - case PEXOCExtFillArea: - case PEXOCFillAreaSet: - case PEXOCFillAreaSet2D: - case PEXOCExtFillAreaSet: - case PEXOCTriangleStrip: - case PEXOCQuadrilateralMesh: - case PEXOCSOFAS: - case PEXOCNurbSurface: - case PEXOCCellArray: - case PEXOCCellArray2D: - case PEXOCExtCellArray: - case PEXOCGdp: - case PEXOCGdp2D: - - /* drop out if not doing primitives - * otherwise fall through */ - if (!MI_DDC_DO_PRIMS(pRend)) - break; - - default: - /* if a Proprietary OC bump the counter and continue */ - if (MI_HIGHBIT_ON((int)poc->elementType)) { - ((ddElementRef *)pRend->curPath->pList) - [pRend->curPath->numObj - 1].offset++; - break; - } - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC((int)poc->elementType)){ - - pexoc = 0; - err = ParseOCTable[ (int)poc->elementType ] - ( (ddPointer)poc, &pexoc ); - } - else - err = !Success; - } - - if (err != Success) - return( PEXERR(PEXOutputCommandError) ); - - /* If we make it here it is a valid OC no more checking to do */ - - /* add one to the current_path's element offset if a - * begin structure has been done - */ - if (pRend->curPath->numObj) - ((ddElementRef *)pRend->curPath->pList)[pRend->curPath->numObj - 1].offset++; - pRend->executeOCs[ (int)poc->elementType ]( pRend, &pexoc->element ); - - DestroyOCTable[ (int)poc->elementType ]( pexoc ); - } - - poc += poc->length; /* length is in four byte units & sizeof(poc) is 4 */ - } - } - - return (err); -} - -ddpex3rtn -convertoffset(pstruct, ppos, poffset) -/* in */ - miStructStr *pstruct; /* pointer to the structure involved */ - ddElementPos *ppos; /* the position information */ -/* out */ - ddULONG *poffset; /* valid offset calculated from the postition */ - -{ - /* shamelessly lifted from the pos2offset routine in miStruct.c */ - - ddUSHORT whence = ppos->whence; - ddLONG offset = ppos->offset, temp; - - switch (whence) { - case PEXBeginning: - temp = offset; - break; - - case PEXCurrent: - temp = MISTR_CURR_EL_OFFSET(pstruct) + offset; - break; - - case PEXEnd: - /* numElements is the same as the last elements offset */ - temp = MISTR_NUM_EL(pstruct) + offset; - break; - - default: - /* value error */ - return (BadValue); - break; - } - - /* now check that the new offset is in range of the structure */ - if (temp < 0) - *poffset = 0; - else if (temp > MISTR_NUM_EL(pstruct)) - *poffset = MISTR_NUM_EL(pstruct); - else - *poffset = temp; - - return (Success); - -} - - - -/*++ - | - | Function Name: RenderElements - | - | Function Description: - | Supports the PEXRenderElements request. - | - | Note(s): - | - --*/ - -ddpex3rtn -RenderElements(pRend, pStr, range) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - diStructHandle pStr; - ddElementRange *range; -/* out */ -{ - ddpex3rtn err = Success; - miStructPtr pstruct; - miGenericElementPtr pel; - ddULONG offset1, offset2, i; - miTraverserState trav_state; - diPMHandle pPM = (diPMHandle) NULL; - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - int eltype, ROCdepth, j; - ddPickPath *strpp, sIDpp, *sIDlist; - miPPLevel *travpp; - XID fakeStrID; - diStructHandle sh = 0, REfakeStr; - ddUSHORT serverstate; - ddElementPos REfakePos; - - - - - /* if renderer idle ignore.... */ - if (pRend->state == PEXIdle) - return Success; - - pstruct = (miStructPtr) pStr->deviceData; - - /* convert the offset based on whence value */ - if (convertoffset(pstruct, &(range->position1), &offset1)) - return (BadValue); /* bad whence value */ - - if (convertoffset(pstruct, &(range->position2), &offset2)) - return (BadValue); /* bad whence value */ - - /* flip the range if necessary */ - if (offset1 > offset2) { - i = offset1; - offset1 = offset2; - offset2 = i; - } - - /* return early if offsets out of range */ - if (offset1 == 0) - if (offset2 == 0) - return(Success); - else - offset1 = 1; - - ValidateRenderer(pRend); - - if (pRend->state == PEXPicking) { - - /* in client side picking RenderElements could be called - at different levels of nested Begin Structures. In - order to uniquely store a correspondence between - structure handles and the correct ID a fake structure - must be allocated - */ - - REfakeStr = (diStructHandle)xalloc((unsigned long) - sizeof(ddStructResource)); - if (!REfakeStr) return (BadAlloc); - REfakeStr->id = -666; - err = CreateStructure(REfakeStr); - if (err != Success) { - xfree((pointer)(REfakeStr)); - return (err); - } - - /* now copy the desired elements out of the structure passed in - and into the fake structure - */ - REfakePos.whence = PEXBeginning; - REfakePos.offset = 0; - err = CopyElements(pStr, range, REfakeStr, &REfakePos); - if (err != Success) { - xfree((pointer)(REfakeStr)); - return (err); - } - - - /* need to handle case where RenderElements is called - after a ROC that may or may not have Begin/End structures - nested in it - */ - ROCdepth = (pRend->pickstr.fakeStrlist)->numObj-1; - strpp = (ddPickPath *)(pRend->pickstr.fakeStrlist)->pList; - sh = strpp[ROCdepth].structure; - - - /* set up incoming state properly for traverser */ - if (ROCdepth > 0) { - travpp = (miPPLevel *) xalloc(sizeof(miPPLevel)); - trav_state.p_pick_path = travpp; - travpp->pp = strpp[ROCdepth-1]; - for (j = ROCdepth-2; j >= 0; j--) { - travpp->up = (miPPLevel *) xalloc(sizeof(miPPLevel)); - travpp = travpp->up; - travpp->pp = strpp[j]; - } - } - - - /* set exec_str_flag */ - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - trav_state.max_depth = ROCdepth; - trav_state.pickId = strpp[ROCdepth].pickid; - trav_state.ROCoffset = strpp[ROCdepth].offset; - - pPM = pRend->pickstr.pseudoPM; - - /* turn off this flag so BeginStructure calls made inside traverser - do not cause fake structures to be allocated - */ - serverstate = pRend->pickstr.server; - pRend->pickstr.server = DD_NEITHER; - /* redefine the offsets into the fake structure from the originals */ - offset2 = (offset2 - offset1 + 1); - offset1 = 1; - - err = traverser(pRend, REfakeStr, offset1, offset2, pPM, NULL, &trav_state); - - /* restore the state flag */ - pRend->pickstr.server = serverstate; - - /* save pickid returned by traverser */ - strpp[ROCdepth].pickid = trav_state.pickId; - strpp[ROCdepth].offset += offset2; - - /* now find the ID that corresponds to the handle sh and - save that as the corresponding ID for pStr in the sIDlist - note that the IDs ARE stored in the pickid field - */ - sIDpp.structure = REfakeStr; - sIDpp.offset = 0; - sIDlist = (ddPickPath *) (pRend->pickstr.sIDlist)->pList; - for (j = 0; j < (pRend->pickstr.sIDlist)->numObj; j++, sIDlist++) - if (sh == sIDlist->structure) { - sIDpp.pickid = sIDlist->pickid; - break; - } - - err = puAddToList((ddPointer) &sIDpp, (ddULONG) 1, pRend->pickstr.sIDlist); - if (err != Success) return (err); - - /* clean up structure */ - { - miStructPtr pheader = (miStructPtr) REfakeStr->deviceData; - extern cssTableType DestroyCSSElementTable[]; - - MISTR_DEL_ELS(REfakeStr, pheader, offset1, offset2); - MISTR_CURR_EL_PTR(pheader) = MISTR_ZERO_EL(pheader); - MISTR_CURR_EL_OFFSET(pheader) = 0; - - } - - } - else { - /* state == PEXRendering call directly into level 2 for efficiency */ - for (i = offset1; i <= offset2; i++){ - - /* set the element pointer */ - if ( i == offset1) { - MISTR_FIND_EL(pstruct, offset1, pel); - } - else - pel = MISTR_NEXT_EL(pel); - - eltype = MISTR_EL_TYPE (pel); - - switch (eltype) { - /* drawing primitives */ - case PEXOCMarker: - case PEXOCMarker2D: - case PEXOCText: - case PEXOCText2D: - case PEXOCAnnotationText: - case PEXOCAnnotationText2D: - case PEXOCPolyline: - case PEXOCPolyline2D: - case PEXOCPolylineSet: - case PEXOCNurbCurve: - case PEXOCFillArea: - case PEXOCFillArea2D: - case PEXOCExtFillArea: - case PEXOCFillAreaSet: - case PEXOCFillAreaSet2D: - case PEXOCExtFillAreaSet: - case PEXOCTriangleStrip: - case PEXOCQuadrilateralMesh: - case PEXOCSOFAS: - case PEXOCNurbSurface: - case PEXOCCellArray: - case PEXOCCellArray2D: - case PEXOCExtCellArray: - case PEXOCGdp: - - /* drop out if not doing primitives - * otherwise fall through */ - if (!MI_DDC_DO_PRIMS(pRend)) - break; - default: - /* if a Proprietary OC call the correct routine */ - if (MI_HIGHBIT_ON(eltype)) { - pRend->executeOCs[MI_OC_PROP]( pRend, - (ddPointer)&(MISTR_EL_DATA (pel))); - } - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(eltype)) - pRend->executeOCs[ eltype]( pRend, - (ddPointer)&(MISTR_EL_DATA (pel))); - else - err = !Success; - } - - if (err != Success) - return( PEXERR(PEXOutputCommandError) ); - - } - } - } - - return(err); -} - -/*++ - | - | Function Name: AccumulateState - | - | Function Description: - | Supports the PEXAccumulateState request. - | - | Note(s): - | - --*/ - -ddpex3rtn -AccumulateState(pRend, pAccSt ) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -ddAccStPtr pAccSt; /* accumulate state handle */ -/* out */ -{ - register int depth, offset; - ddpex3rtn err = Success; - ddElementRef *elemRef; - miStructPtr structPtr; - miGenericElementPtr elemPtr; - - /* if renderer idle ignore.... */ - if (pRend->state == PEXIdle) - return Success; - - ValidateRenderer(pRend); - - /* The path has already been validated */ - - elemRef = (ddElementRef *) pAccSt->Path->pList; - for (depth = 1; depth <= pAccSt->numElRefs; depth++) { - structPtr = (miStructPtr) elemRef->structure->deviceData; - elemPtr = MISTR_NEXT_EL (MISTR_ZERO_EL (structPtr)); - for (offset = 0; offset < elemRef->offset; offset++) { - switch (MISTR_EL_TYPE (elemPtr)) { - case PEXOCMarkerType: - case PEXOCMarkerScale: - case PEXOCMarkerColourIndex: - case PEXOCMarkerColour: - case PEXOCMarkerBundleIndex: - case PEXOCTextFontIndex: - case PEXOCTextPrecision: - case PEXOCCharExpansion: - case PEXOCCharSpacing: - case PEXOCTextColourIndex: - case PEXOCTextColour: - case PEXOCCharHeight: - case PEXOCCharUpVector: - case PEXOCTextPath: - case PEXOCTextAlignment: - case PEXOCAtextHeight: - case PEXOCAtextUpVector: - case PEXOCAtextPath: - case PEXOCAtextAlignment: - case PEXOCAtextStyle: - case PEXOCTextBundleIndex: - case PEXOCLineType: - case PEXOCLineWidth: - case PEXOCLineColourIndex: - case PEXOCLineColour: - case PEXOCCurveApproximation: - case PEXOCPolylineInterp: - case PEXOCLineBundleIndex: - case PEXOCInteriorStyle: - case PEXOCInteriorStyleIndex: - case PEXOCSurfaceColourIndex: - case PEXOCSurfaceColour: - case PEXOCSurfaceReflAttr: - case PEXOCSurfaceReflModel: - case PEXOCSurfaceInterp: - case PEXOCBfInteriorStyle: - case PEXOCBfInteriorStyleIndex: - case PEXOCBfSurfaceColourIndex: - case PEXOCBfSurfaceColour: - case PEXOCBfSurfaceReflAttr: - case PEXOCBfSurfaceReflModel: - case PEXOCBfSurfaceInterp: - case PEXOCSurfaceApproximation: - case PEXOCCullingMode: - case PEXOCDistinguishFlag: - case PEXOCPatternSize: - case PEXOCPatternRefPt: - case PEXOCPatternAttr: - case PEXOCInteriorBundleIndex: - case PEXOCSurfaceEdgeFlag: - case PEXOCSurfaceEdgeType: - case PEXOCSurfaceEdgeWidth: - case PEXOCSurfaceEdgeColourIndex: - case PEXOCSurfaceEdgeColour: - case PEXOCEdgeBundleIndex: - case PEXOCSetAsfValues: - case PEXOCLocalTransform: - case PEXOCLocalTransform2D: - case PEXOCGlobalTransform: - case PEXOCGlobalTransform2D: - case PEXOCModelClip: - case PEXOCModelClipVolume: - case PEXOCModelClipVolume2D: - case PEXOCRestoreModelClip: - case PEXOCViewIndex: - case PEXOCLightState: - case PEXOCDepthCueIndex: - case PEXOCPickId: - case PEXOCHlhsrIdentifier: - case PEXOCColourApproxIndex: - case PEXOCRenderingColourModel: - case PEXOCParaSurfCharacteristics: - case PEXOCAddToNameSet: - case PEXOCRemoveFromNameSet: - /* if a Proprietary OC call the correct routine */ - if (MI_HIGHBIT_ON(MISTR_EL_TYPE (elemPtr))) { - pRend->executeOCs[MI_OC_PROP]( pRend, - (ddPointer)&(MISTR_EL_DATA (elemPtr))); - } - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(MISTR_EL_TYPE (elemPtr))) - pRend->executeOCs[(int) MISTR_EL_TYPE (elemPtr)]( pRend, - (ddPointer)&(MISTR_EL_DATA (elemPtr))); - else - err = !Success; - } - - if (err != Success) - return( PEXERR(PEXOutputCommandError) ); - - break; - default: - break; - } - - elemPtr = MISTR_NEXT_EL (elemPtr); - } - - elemRef++; - } - - return(err); -} - - -/*++ - | - | Function Name: init_def_matrix - | - | Note(s): - | - --*/ - -void -init_def_matrix (matrix) -ddFLOAT matrix[4][4]; -{ - memcpy( (char *) matrix, (char *) ident4x4, 16 * sizeof(ddFLOAT)); -} - - -/*++ - | - | Function Name: init_pipeline - | - | Function Description: - | does stuff common to BeginRendering, BeginPicking, BeginSearching - | - | Note(s): - | - --*/ - -ddpex3rtn -init_pipeline(pRend, pDrawable) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - DrawablePtr pDrawable;/* pointer to drawable */ -/* out */ -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - ddPCAttr *ppca; - listofObj *pMC, *pLS; - -#ifdef DDTEST - ErrorF( " init_pipeline\n"); -#endif - - /* - * check that drawable is OK for renderer this means it's ok for the - * luts, ns, and GC since they are ok for the example drawable - */ - - /* empty current path */ - PU_EMPTY_LIST(pRend->curPath); - - /* - * Initialize ddcontext. - */ - ppca = pddc->Dynamic->pPCAttr; - pMC = ppca->modelClipVolume; - pLS = ppca->lightState; - if (pRend->pPC != NULL) { - *ppca = *pRend->pPC->pPCAttr; - /* - * don't forget the model clip half planes and list of - * light sources, which are only pointed to - */ - if (puCopyList(pRend->pPC->pPCAttr->modelClipVolume, pMC)) - return(BadAlloc); - if (puCopyList(pRend->pPC->pPCAttr->lightState, pLS)) - return(BadAlloc); - } else { /* use default PC values */ - MI_GET_DEFAULT_PC(&defaultPCAttr); - *ppca = defaultPCAttr; - /* - * don't forget the model clip half planes and list of - * light sources, which are only pointed to - */ - if (puCopyList(defaultPCAttr.modelClipVolume, pMC)) - return(BadAlloc); - if (puCopyList(defaultPCAttr.lightState, pLS)) - return(BadAlloc); - } - ppca->modelClipVolume = pMC; - ppca->lightState = pLS; - - /* copy the current name set from the ns resource to the renderer */ - MINS_EMPTY_NAMESET(pddc->Dynamic->currentNames); - if (ppca->pCurrentNS) - { - miNSHeader *pns = (miNSHeader *)ppca->pCurrentNS->deviceData; - - MINS_COPY_NAMESET(pns->names, pddc->Dynamic->currentNames); - } - - /* set the filter_flags in pddc for high, invis, pick, search */ - mi_set_filters(pRend, pddc); - - MI_DDC_SET_DO_PRIMS(pRend, pddc); - - /* this must be called before the rendering state is set - * and after the filters are set */ - - MI_SET_ALL_CHANGES(pRend); - ValidateRenderer(pRend); - - /* - * Compute composite 4x4s for use in the rendering pipeline - * Computed composites: 1. [GM][LM] = [CMM] or mc_to_wc_xform - * 2. [VO][VM] = [VOM] or wc_to_npc_xform - * 3. [CMM][VOM] = [VCM] or mc_to_npc_xform - * Reminder: [GM] and [LM] are in pipeline context, [VO] - * and [VM] are in the View LUT indexed by the - * view index set in the pipeline context. - */ - - /* Compute the composite [CMM] next */ - miMatMult (pddc->Dynamic->mc_to_wc_xform, - pddc->Dynamic->pPCAttr->localMat, - pddc->Dynamic->pPCAttr->globalMat); - - return (Success); -} - -/*++ - | - | Function Name: BeginRendering - | - | Function Description: - | Supports the PEXBeginRendering request. - | - | Note(s): - | - --*/ - -ddpex3rtn -BeginRendering(pRend, pDrawable) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - DrawablePtr pDrawable;/* pointer to drawable */ -/* out */ -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - -#ifdef DDTEST - ErrorF( " BeginRendering\n"); -#endif - - pRend->render_mode = MI_REND_DRAWING; - - init_pipeline(pRend, pDrawable); - - /* - * Determine the npc -> dc viewport transform - */ - miBldViewport_xform(pRend, pDrawable, pddc->Static.misc.viewport_xform, pddc ); - - /* - * compute cc xform, concatenate to appropriate dd context matrices. - */ - miBldCC_xform(pRend, pddc); - - /* - * Clear the window if clearI flag is on. - * Use the background color in the renderer attributes. - * The default (0) entry in the Color Approx Table is used - * to compute the pixel. - */ - if (pRend->clearI) { - - unsigned long colorindex, gcmask; - GCPtr pGC; - extern GCPtr CreateScratchGC(); - extern int ChangeGC(); - extern void ValidateGC(); - xRectangle xrect; - DrawablePtr pDraw; - xRectangle *xrects, *p; - ddDeviceRect *ddrects; - ddLONG numrects; - int i; - ddTableIndex colourApproxIndex; - - pDraw = pRend->pDrawable; - if ((!pRend->pPC) || (!pRend->pPC->pPCAttr)) colourApproxIndex = 0; - else colourApproxIndex = pRend->pPC->pPCAttr->colourApproxIndex; - miColourtoIndex(pRend, colourApproxIndex, - &pRend->backgroundColour, &colorindex); - pGC = CreateScratchGC(pDraw->pScreen, pDraw->depth); - gcmask = GCForeground; - ChangeGC(pGC, gcmask, &colorindex); - /* Set the Clip List if there is one */ - numrects = pRend->clipList->numObj; - if (numrects) { - ddrects = (ddDeviceRect *) pRend->clipList->pList; - xrects = (xRectangle*) xalloc(numrects * sizeof(xRectangle)); - if (!xrects) return BadAlloc; - /* Need to convert to XRectangle format and flip Y */ - for (i = 0, p = xrects; i < numrects; i++, p++, ddrects++) { - p->x = ddrects->xmin; - p->y = pDraw->height - ddrects->ymax; - p->width = ddrects->xmax - ddrects->xmin + 1; - p->height = ddrects->ymax - ddrects->ymin + 1; - } - SetClipRects(pGC, 0, 0, (int)numrects, xrects, Unsorted); - xfree((char*)xrects); - } - ValidateGC(pDraw, pGC); - /* Now draw a filled rectangle to clear the image buffer */ - xrect.x = 0; - xrect.y = 0; - xrect.width = pDraw->width; - xrect.height = pDraw->height; - (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &xrect); - gcmask = GCClipMask; - colorindex = 0; - ChangeGC(pGC, gcmask, &colorindex); - FreeScratchGC(pGC); - } - - /* do double buffering stuff */ - /* do hlhsr stuff */ - - pRend->state = PEXRendering; - return (Success); -} - -/*++ - | - | Function Name: EndRendering - | - | Function Description: - | Supports the PEXEndRendering request. - | - | Note(s): - | - --*/ - -ddpex3rtn -EndRendering(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - -#ifdef DDTEST - ErrorF( " EndRendering\n"); -#endif - - pRend->state = PEXIdle; - /* switch display buffers if doing multi-buffers */ - - return (Success); -} - -/*++ - | - | Function Name: BeginStructure - | - | Function Description: - | Supports the PEXBeginStructure request. - | - | Note(s): - | This procedure creates a new ddcontext which looks like the - | old (current) context. - | - | Since some of these elements contain and/or are pointers to - | objects, the info cannot be copied directly, but new objects - | must be made to be pointed to and their contents copied. - | So, the sequence that this procedure goes through is this: - | create a new dd context data structure - | copy old context to the new context, but remember - | that pointers to objects will be replaced. - | create a new PCAttr structure and copy old to new - | update the current path and transform matrices - | push the new context onto the stack - | - --*/ - -ddpex3rtn -BeginStructure(pRend, sId) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - ddResourceId sId; /* structure id */ -/* out */ -{ - ddpex3rtn PushddContext(); - ddpex3rtn err = Success; - ddElementRef newRef; - ddpex3rtn status; - XID fakeStrID; - diStructHandle fakeStr; - ddPickPath fakeStrpp, sIDpp, *curpp; - - -#ifdef DDTEST - ErrorF( " BeginStructure %d\n", sId); -#endif - - /* if renderer idle ignore.... */ - if (pRend->state == PEXIdle) - return Success; - - /* - * Push the current ddContext attributes onto the stack and create - * a new instance of these attributes. - */ - if (status = PushddContext(pRend)) return(status); - - /* update offset of existing path to count execute structure element */ - if (pRend->curPath->numObj) - ((ddElementRef *)pRend->curPath->pList)[pRend->curPath->numObj-1].offset++; - - /** Add a new element to the cur_path for the new structure **/ - /* sid is really an id not a handle*/ - newRef.structure = (diStructHandle)sId; - newRef.offset = 0; - - /* puAddToList returns 0 if it's successful, other there's an error */ - if (puAddToList((ddPointer)&newRef, (ddULONG)1, pRend->curPath)) - { - return (BadAlloc); - } - - /* when doing client side picking fake structures must be allocated - and the correspondence between their structure handles and IDs - saved for later lookup by the appropriate EndPick routine - */ - if ((pRend->state == PEXPicking) && (pRend->pickstr.server == DD_CLIENT)) { - - /* bump up the offset in the current element to simulate ExecStr */ - curpp = (ddPickPath *)(pRend->pickstr.fakeStrlist)->pList; - curpp[(pRend->pickstr.fakeStrlist)->numObj-1].offset++; - - /* allocate a new fake structure and add to both lists */ - fakeStr = (diStructHandle)xalloc((unsigned long) - sizeof(ddStructResource)); - if (!fakeStr) return (BadAlloc); - fakeStr->id = -666; - err = CreateStructure(fakeStr); - if (err != Success) { - xfree((pointer)(fakeStr)); - return (err); - } - - fakeStrpp.structure = fakeStr; - fakeStrpp.offset = 0; - fakeStrpp.pickid = 0; - err = puAddToList((ddPointer) &fakeStrpp, (ddULONG) 1, pRend->pickstr.fakeStrlist); - if (err != Success) { - xfree((pointer)(fakeStr)); - return (err); - } - - sIDpp.structure = fakeStr; - sIDpp.offset = 0; - /* Store the supplied structure ID here for retrieval at EndPick */ - sIDpp.pickid = sId; - err = puAddToList((ddPointer) &sIDpp, (ddULONG) 1, pRend->pickstr.sIDlist); - if (err != Success) { - xfree((pointer)(fakeStr)); - return (err); - } - - } - return (Success); -} /* BeginStructure */ - -/*++ - | - | Function Name: EndStructure - | - | Function Description: - | Supports the PEXEndStructure request. - | - | Note(s): - | - --*/ - -ddpex3rtn -EndStructure(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - ddpex3rtn PopddContext(); - ddpex3rtn status; - miStructPtr pheader; - diStructHandle sh = 0; - ddPickPath *strpp; - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - - - - -#ifdef DDTEST - ErrorF( " EndStructure\n"); -#endif - - /* if renderer idle ignore.... */ - if (pRend->state == PEXIdle) - return Success; - - /* if there is no next then BeginStructure has not been - called so simply ignore this EndStructure call.... - */ - if (pddc->Dynamic->next == NULL) - return Success; - - /* - * Pop ddContext off stack - retrieve attributes for current structure */ - if (status = PopddContext(pRend)) return (status); - - /* - * could put more intelligence here, - * but for now assume everything changes - */ - MI_SET_ALL_CHANGES(pRend); - ValidateRenderer(pRend); - - /** Remove the last currentPath element from the renderer **/ - PU_REMOVE_LAST_OBJ(pRend->curPath); - - if ((pRend->state == PEXPicking) && (pRend->pickstr.server == DD_CLIENT)) { - - /* the fake structure can not be freed until End Picking - since otherwise that chunk of memory could be allocated - to another client provided sID thus destroying the 1 to 1 - mapping that the sIDlist counts up, so just remove the info - for the structure from the fakeStrlist. The handle and ID - must stay on the sID list until after the reply is processed - */ - PU_REMOVE_LAST_OBJ(pRend->pickstr.fakeStrlist); - } - - return (Success); - -} /* EndStructure */ - -static void -set_highlight_colours(pRend, pddc) - ddRendererPtr pRend; - miDDContext *pddc; -{ - pddc->Static.attrs->lineColour = pddc->Static.misc.highlight_colour; - pddc->Static.attrs->edgeColour = pddc->Static.misc.highlight_colour; - pddc->Static.attrs->markerColour = pddc->Static.misc.highlight_colour; - pddc->Static.attrs->surfaceColour = pddc->Static.misc.highlight_colour; - pddc->Static.attrs->textColour = pddc->Static.misc.highlight_colour; - - pddc->Static.misc.flags |= POLYLINEGCFLAG; - pddc->Static.misc.flags |= EDGEGCFLAG; - pddc->Static.misc.flags |= MARKERGCFLAG; - pddc->Static.misc.flags |= FILLAREAGCFLAG; - pddc->Static.misc.flags |= TEXTGCFLAG; - return; -} - -static void -unset_highlight_colours(pRend, pddc) - ddRendererPtr pRend; - miDDContext *pddc; -{ - ddBitmask tables, namesets, attrs; - - /* not too efficient: ValidateDDContextAttrs does more than - * just colours - */ - tables = PEXDynMarkerBundle | PEXDynTextBundle | PEXDynLineBundle - | PEXDynInteriorBundle | PEXDynEdgeBundle; - namesets = 0; - attrs = 0; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - return; -} - -/*++ - | - | Function Name: ValidateFilters - | - | Function Description: - | updates filters flags - | - | Note(s): - | - --*/ - -void -ValidateFilters(pRend, pddc, namesets) -ddRendererPtr pRend; /* renderer handle */ -miDDContext *pddc; /* ddPEX attribute structure */ -ddBitmask namesets; -{ - ddUSHORT save_flags; - - if ((namesets & PEXDynHighlightNameset) || - (namesets & PEXDynInvisibilityNameset) || - (namesets & PEXDynHighlightNamesetContents) || - (namesets & PEXDynInvisibilityNamesetContents)) { - - save_flags = pddc->Dynamic->filter_flags; - - mi_set_filters(pRend, pddc, namesets); - - if ( (MI_DDC_IS_HIGHLIGHT(pddc)) && - !(save_flags & MI_DDC_HIGHLIGHT_FLAG) ) - /* just turned on highlighting */ - set_highlight_colours(pRend, pddc); - else if ( (!(MI_DDC_IS_HIGHLIGHT(pddc))) && - (save_flags & MI_DDC_HIGHLIGHT_FLAG) ) - /* just turned off highlighting */ - unset_highlight_colours(pRend, pddc); - - MI_DDC_SET_DO_PRIMS(pRend, pddc); - } -} - -/*++ - | - | Function Name: ValidateRenderer - | - | Function Description: - | loads executeOC table in renderer correctly and calls - | to validate the ddcontext - | - | Note(s): - | - --*/ - -ValidateRenderer(pRend) - ddRendererPtr pRend; /* renderer handle */ -{ - ddpex3rtn ValidateDDContextAttrs(); - - miDDContext *pddc = (miDDContext *)pRend->pDDContext; - ddBitmask tables, namesets, attrs; - extern void inq_last_colour_entry(); - - /* load in different executeOCs if needed - * can do this here or in ValidateDDContextAttrs as needed - * eg, if there are multiple procs in a set for an oc (different - * ones for hollow fill areas and solid ones), then load - * them here or in ValidateDDContextAttrs when the attribute - * controlling it changes - */ - - /* set highlight colour if necessary */ - if (pRend->tablesChanges & (PEXDynColourTable | PEXDynColourTableContents)) - inq_last_colour_entry(pRend->lut[PEXColourLUT], &pddc->Static.misc.highlight_colour); - - /* validate the attributes */ - if (pRend->state == PEXRendering) - { - /* validate only dynamic attrs */ - tables = pRend->tablesChanges & ~pRend->tablesMask; - namesets = pRend->namesetsChanges & ~pRend->namesetsMask; - attrs = pRend->attrsChanges & ~pRend->attrsMask; - ValidateFilters(pRend, pddc, namesets); - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - pRend->tablesChanges &= (~tables); - pRend->namesetsChanges &= (~namesets); - pRend->attrsChanges &= (~attrs); - } else - { - /* validate all attrs */ - tables = pRend->tablesChanges; - namesets = pRend->namesetsChanges; - attrs = pRend->attrsChanges; - ValidateDDContextAttrs(pRend, pddc, tables, namesets, attrs); - ValidateFilters(pRend, pddc, namesets); - /* reset change masks */ - MI_ZERO_ALL_CHANGES(pRend); - } -} - -/*++ - | - | Function Name: BeginPicking - | - | Function Description: - | Sets up the pipeline to do Picking. - | - | Note(s): This is a copy of BeginRendering with extraneous rendering - | stuff removed. Wherever, the code has been removed, comments - | have been placed to identify the removals. - | - --*/ - -ddpex3rtn -BeginPicking(pRend, pPM) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - diPMHandle pPM; /* pick measure */ -/* out */ -{ - miPickMeasureStr *ppm = (miPickMeasureStr *) pPM->deviceData; - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - DrawablePtr pDrawable = pRend->pDrawable; - ddPCAttr *ppca; - ddFLOAT inv_xform[4][4]; - -#ifdef DDTEST - ErrorF( " BeginPicking\n"); -#endif - - /* set device info needed for picking */ - pddc->Static.pick.type = ppm->type; - pddc->Static.pick.status = ppm->status; - switch (ppm->type) - { - case PEXPickDeviceDC_HitBox: - pddc->Static.pick.data_rec.dc_data_rec = - ppm->data_rec.dc_data_rec; - pddc->Static.pick.input_rec.dc_hit_box = - ppm->input_rec.dc_hit_box; - break; - - case PEXPickDeviceNPC_HitVolume: - pddc->Static.pick.data_rec.npc_data_rec = - ppm->data_rec.npc_data_rec; - pddc->Static.pick.input_rec.npc_hit_volume = - ppm->input_rec.npc_hit_volume; - break; - } - - MINS_EMPTY_NAMESET(pddc->Static.pick.inclusion); - MINS_EMPTY_NAMESET(pddc->Static.pick.exclusion); - if (ppm->incl_handle) { - miNSHeader *pns = (miNSHeader *)ppm->incl_handle->deviceData; - MINS_COPY_NAMESET(pns->names, pddc->Static.pick.inclusion); - } - if (ppm->excl_handle) { - miNSHeader *pns = (miNSHeader *)ppm->excl_handle->deviceData; - MINS_COPY_NAMESET(pns->names, pddc->Static.pick.exclusion); - } - -/* load picking procs into executeOCs */ - - memcpy( (char *)pRend->executeOCs, - (char *)PickExecuteOCTable, - sizeof(ocTableType)*OCTABLE_LENGTH); - - pRend->render_mode = MI_REND_PICKING; - - /* make sure this gets initialized for every pick */ - pRend->pickstr.more_hits = PEXNoMoreHits; - - - /* - * Reinitialize level 1 procedure jump table for PICKING ! - */ - memcpy( (char *)pddc->Static.RenderProcs, - (char *)PickPrimitiveTable, - sizeof(RendTableType) * RENDER_TABLE_LENGTH); - - init_pipeline(pRend, pDrawable); - - /* - * Determine the npc -> dc viewport transform - */ - miBldViewport_xform( pRend, pDrawable, pddc->Static.misc.viewport_xform, pddc ); - - /* Compute the inverse of the viewport transform to be used to */ - /* convert DC_HitBoxes to NPC_HitVolumes. */ - - memcpy( (char *)inv_xform, - (char *)pddc->Static.misc.viewport_xform, 16*sizeof(ddFLOAT)); - miMatInverse (inv_xform); - memcpy( (char *)pddc->Static.misc.inv_vpt_xform, - (char *) inv_xform, 16*sizeof(ddFLOAT)); - - /* Now, clear out the viewport transform computed above to identity */ - /* since we are PICKING, and we do not need this to go to final ddx */ - /* space. THIS IS IMPORTANT SINCE WE WILL BE USING THE LEVEL 2 REND-*/ - /* ERING ROUTINES TO DO TRANSFORMATIONS AND CLIPPING. ONLY LEVEL 1 */ - /* PICKING ROUTINES WILL ACTUALLY DO THE PICK HIT TEST IN CC. THUS */ - /* BY MAKING THE viewport transform IDENTITY WE WILL STAY IN CC. */ - - memcpy( (char *) pddc->Static.misc.viewport_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /* Clear out the cc_to_dc_xform also, since we will not be going to DC */ - - memcpy( (char *) pddc->Dynamic->cc_to_dc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG | - INVTRMCTOCCXFRMFLAG | INVTRCCTODCXFRMFLAG | - INVVIEWXFRMFLAG); - - /* Mark as invalid any transform dependant fields in ddContext */ - pddc->Static.misc.flags |= (MCVOLUMEFLAG | CC_DCUEVERSION); - - /* - * Computation of the composite mc -> dc transform has been REMOVED. - */ - - /* do double buffering stuff */ - /* do hlhsr stuff */ - - pRend->state = PEXPicking; - - return (Success); -} - -/*++ - | - | Function Name: EndPicking - | - | Function Description: - | Handles the stuff to be done after a Pick traversal. - | - | Note(s): - | - --*/ - -ddpex3rtn -EndPicking(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ -/* Locals */ - miDDContext *pddc = (miDDContext *)(pRend->pDDContext); - ddPickPath *strpp; - diStructHandle sh = 0; - int i; - - -#ifdef DDTEST - ErrorF( " EndPicking\n"); -#endif - - if (pRend->immediateMode == TRUE) { - /* empty listoflist for Pick All - this assumes the individual pick paths lists that this - pointed to have already been deleted by the EndPickAll routine - */ - PU_EMPTY_LIST(pRend->pickstr.list); - - /* free all but the first the fake structure - it should always be there to support ROCs - */ - strpp = (ddPickPath *)(pRend->pickstr.sIDlist)->pList; - for (i = 1; i < (pRend->pickstr.sIDlist)->numObj; i++) { - sh = strpp[i].structure; - DeleteStructure(sh, sh->id); - } - - (pRend->pickstr.sIDlist)->numObj = 1; - } - - pRend->state = PEXIdle; - - pRend->render_mode = MI_REND_DRAWING; - - /* copy the initial oc functions to the OC table */ - - memcpy( (char *)pRend->executeOCs, - (char *)InitExecuteOCTable, - sizeof(ocTableType)*OCTABLE_LENGTH); - - /* - * Reinitialize level 1 procedure jump table for Rendering ! - */ - memcpy( (char *)pddc->Static.RenderProcs, - (char *)RenderPrimitiveTable, - sizeof(RendTableType) * RENDER_TABLE_LENGTH); - - return (Success); -} - -/*++ - | - | Function Name: InquirePickStatus - | - | Function Description: - | returns current pick status - | - | Note(s): - - | - --*/ - -/* -#define PEX_SI_FAKE_PICK -*/ -#ifdef PEX_SI_FAKE_PICK -/*dummy proc to use to fake hit: - hit occurs when traversal depth = 3, structure offset = 3, - current pick id = 4 - need p_trav_state for this, but p_trav_state will not be a - parameter when real picking is done -*/ -InquirePickStatus(pRend, pStatus, p_trav_state) - ddRendererPtr pRend; - ddUSHORT *pStatus; - miTraverserState *p_trav_state; -{ - if ( (p_trav_state->max_depth == 3) && - (((ddElementRef *)pRend->curPath-> pList)[pRend->curPath->numObj - 1].offset == 3) && - ( ((miDDContext *)pRend->pDDContext)->Dynamic->pPCAttr->pickId == 4) ) - *pStatus = PEXOk; - else - *pStatus = PEXNoPick; - return; -} -#else - -void -InquirePickStatus(pRend, pStatus, p_trav_state) - ddRendererPtr pRend; - ddUSHORT *pStatus; -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - - *pStatus = pddc->Static.pick.status; - pddc->Static.pick.status = PEXNoPick; - return; -} -#endif - -/*++ - | - | Function Name: BeginSearching - | - | Function Description: - | Sets up the pipeline to do spatial search - | - | Note(s): This is a copy of BeginRendering with extraneous rendering - | stuff removed. Wherever, the code has been removed, comments - | have been placed to identify the removals. - | - --*/ - -ddpex3rtn -BeginSearching(pRend, pSC) -/* in */ - ddRendererPtr pRend; /* renderer handle */ - ddSCStr *pSC; /* search context */ -/* out */ -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - DrawablePtr pDrawable = pRend->pDrawable; - ddNSPair *pPairs; - miNSHeader *pns; - register int i; - -#ifdef DDTEST - ErrorF( " BeginSearching\n"); -#endif - - /* set device info needed for searching */ - pddc->Static.search.status = PEXNotFound; - pddc->Static.search.position = pSC->position; - pddc->Static.search.distance = pSC->distance; - pddc->Static.search.modelClipFlag = pSC->modelClipFlag; - - MINS_EMPTY_NAMESET(pddc->Static.search.norm_inclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.norm_exclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.invert_inclusion); - MINS_EMPTY_NAMESET(pddc->Static.search.invert_exclusion); - - if (pSC->normal.numPairs) { - pPairs = pSC->normal.pPairs; - for (i=0; inormal.numPairs; i++, pPairs++ ) { - - if (pPairs->incl) { - pns = (miNSHeader *)pPairs->incl->deviceData; - MINS_OR_NAMESETS(pns->names, pddc->Static.search.norm_inclusion); - } - if (pPairs->excl) { - pns = (miNSHeader *)pPairs->excl->deviceData; - MINS_OR_NAMESETS(pns->names, pddc->Static.search.norm_exclusion); - } - } - } - if (pSC->inverted.numPairs) { - pPairs = pSC->inverted.pPairs; - for (i=0; iinverted.numPairs; i++, pPairs++ ) { - - if (pPairs->incl) { - pns = (miNSHeader *)pPairs->incl->deviceData; - MINS_OR_NAMESETS(pns->names, pddc->Static.search.invert_inclusion); - } - if (pPairs->excl) { - pns = (miNSHeader *)pPairs->excl->deviceData; - MINS_OR_NAMESETS(pns->names, pddc->Static.search.invert_exclusion); - } - } - } - - /* load searching procs into executeOCs */ - - memcpy( (char *)pRend->executeOCs, - (char *)SearchExecuteOCTable, - sizeof(ocTableType)*OCTABLE_LENGTH); - - /* - * Reinitialize level 1 procedure jump table for Searching. - * Note that we use the same table as Picking. - */ - memcpy( (char *)pddc->Static.RenderProcs, - (char *)PickPrimitiveTable, - sizeof(RendTableType) * RENDER_TABLE_LENGTH); - - /* Set the model clipping flag to value in search context - resource */ - pddc->Dynamic->pPCAttr->modelClip = pSC->modelClipFlag; - - pRend->render_mode = MI_REND_SEARCHING; - - init_pipeline(pRend, pDrawable); - - /* - * Since searching is done in world coordinate space, we need NOT - * compute any of the rest of the matrices. They must all be set - * to identity. - */ - - memcpy( (char *) pddc->Static.misc.viewport_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->wc_to_npc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->mc_to_npc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->wc_to_cc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->cc_to_dc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->mc_to_cc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->mc_to_dc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - memcpy( (char *) pddc->Dynamic->npc_to_cc_xform, - (char *) ident4x4, 16 * sizeof(ddFLOAT)); - - /* Mark as invalid appropriate inverse transforms in dd context */ - pddc->Static.misc.flags |= (INVTRMCTOWCXFRMFLAG | INVTRWCTOCCXFRMFLAG | - INVTRMCTOCCXFRMFLAG | INVTRCCTODCXFRMFLAG | - INVVIEWXFRMFLAG); - - /* Mark as invalid any transform dependant fields in ddContext */ - pddc->Static.misc.flags |= (MCVOLUMEFLAG | CC_DCUEVERSION); - - /* - * Computation of the composite mc -> dc transform has been REMOVED. - */ - - /* do double buffering stuff */ - /* do hlhsr stuff */ - - pRend->state = PEXRendering; - - return (Success); -} - -/*++ - | - | Function Name: EndSearching - | - | Function Description: - | Handles the stuff to be done after a search traversal. - | - | Note(s): - | - --*/ - -ddpex3rtn -EndSearching(pRend) -/* in */ - ddRendererPtr pRend; /* renderer handle */ -/* out */ -{ - -#ifdef DDTEST - ErrorF( " EndSearching\n"); -#endif - - pRend->state = PEXIdle; - - pRend->render_mode = MI_REND_DRAWING; - /* copy the initial oc functions to the OC table */ - memcpy( (char *)pRend->executeOCs, - (char *)InitExecuteOCTable, - sizeof(ocTableType)*OCTABLE_LENGTH); - - return (Success); -} - -/*++ - | - | Function Name: InquireSearchStatus - | - | Function Description: - | returns current spatial search status - | - | Note(s): - | - --*/ - -void -InquireSearchStatus(pRend, pStatus) - ddRendererPtr pRend; - ddUSHORT *pStatus; /* PEXFound or PEXNotFound */ -{ - miDDContext *pddc = (miDDContext *) pRend->pDDContext; - - *pStatus = pddc->Static.search.status; - return; -} - - Index: xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c:1.10 Fri Dec 14 14:57:33 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c Sat Feb 28 21:41:55 2004 @@ -1,506 +0,0 @@ -/* $Xorg: miRndrPick.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ - -/************************************************************ - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level3/miRndrPick.c,v 1.10 2001/12/14 19:57:33 dawes Exp $ */ - -#include "miLUT.h" -#include "ddpex3.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "pexExtract.h" -#include "PEXErr.h" -#include "pexUtils.h" -#include "pixmap.h" -#include "windowstr.h" -#include "regionstr.h" -#include "miscstruct.h" -#include "miRender.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "miWks.h" -#include "ddpex4.h" -#include "pexos.h" - - -/* External variables used */ - -extern void mi_set_filters(); -extern void miMatMult(); -extern ddpex3rtn miBldViewport_xform(); -extern ddpex3rtn miBldCC_xform(); -extern ocTableType ParseOCTable[]; -extern void (*DestroyOCTable[])(); -extern ocTableType InitExecuteOCTable[]; -extern ocTableType PickExecuteOCTable[]; -extern ocTableType SearchExecuteOCTable[]; -extern RendTableType RenderPrimitiveTable[]; -extern RendTableType PickPrimitiveTable[]; - - -/* Level III Renderer Pick Procedures */ - -/*++ -| -| Function Name: CreatePseudoPickMeasure -| -| Function Description: -| Create a Pick Measure for Renderer Picking use -| -| Note(s): -| ---*/ - -ddpex3rtn -CreatePseudoPickMeasure( pRend) -ddRendererPtr pRend; /* renderer handle */ -{ - register miPickMeasureStr *ppm; - - ppm = (miPickMeasureStr *) xalloc(sizeof(miPickMeasureStr)); - if (!ppm) return (BadAlloc); - - ppm->path = puCreateList(DD_PICK_PATH); - if (!ppm->path) { - xfree(ppm); - return (BadAlloc); - } - - /* initialize pointers to NULL values */ - ppm->pWks = 0; - /* initialize type to an out of range value */ - ppm->type = -1; - ppm->status = PEXNoPick; - ppm->pathOrder = PEXTopFirst; - ppm->incl_handle = 0; - ppm->excl_handle = 0; - ppm->devPriv = (ddPointer) NULL; - - (pRend->pickstr.pseudoPM)->deviceData = (ddPointer) ppm; - return(Success); -} - - -/*++ -| -| Function Name: ChangePseudoPickMeasure -| -| Function Description: -| Change a Pick Measure for Renderer Picking use -| -| Note(s): -| ---*/ - -ddpex3rtn -ChangePseudoPickMeasure( pRend, pRec) -ddRendererPtr pRend; /* renderer handle */ -ddPickRecord *pRec; /* PickRecord */ -{ - register miPickMeasureStr *ppm; - - ppm = (miPickMeasureStr *) (pRend->pickstr.pseudoPM)->deviceData; - - if (!ppm->path) { - ppm->path = puCreateList(DD_PICK_PATH); - if (!ppm->path) { - xfree(ppm); - return (BadAlloc); - } - } else { - if (puCopyList(pRend->pickStartPath, ppm->path)) { - puDeleteList(ppm->path); - xfree(ppm); - return (BadAlloc); - } - } - ppm->incl_handle = pRend->ns[DD_PICK_INCL_NS]; - ppm->excl_handle = pRend->ns[DD_PICK_EXCL_NS]; - - if (ppm->incl_handle) - UpdateNSRefs( ppm->incl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - if (ppm->excl_handle) - UpdateNSRefs( ppm->excl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - /* now store the pick record */ - ppm->type = pRec->pickType; - switch (ppm->type) { - case PEXPickDeviceDC_HitBox: - memcpy( (char *)&(ppm->input_rec.dc_hit_box), - (char *)&(pRec->hit_box.DC_HitBox), - sizeof(pexPD_DC_HitBox)); - break; - - case PEXPickDeviceNPC_HitVolume: - memcpy( (char *)&(ppm->input_rec.npc_hit_volume), - (char *)&(pRec->hit_box.NPC_HitVolume), - sizeof(pexPD_NPC_HitVolume)); - break; - } - - - ppm->status = PEXNoPick; - - return(Success); -} - -ddpex3rtn -EndPickOne( pRend, pBuffer, numPickElRefs, pickStatus, betterPick) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -/* out */ -ddBufferPtr pBuffer; /* list of pick element ref */ -ddULONG *numPickElRefs; -ddUSHORT *pickStatus; -ddUSHORT *betterPick; -{ - ddpex3rtn err = Success; - miPickMeasureStr *ppm; - int numbytes, i, j; - ddPickPath *per; - pexPickElementRef *dest; - ddPickPath *sIDpp; - - ppm = (miPickMeasureStr *) (pRend->pickstr.pseudoPM)->deviceData; - *numPickElRefs = 0; - *pickStatus = ppm->status; - *betterPick = 0; - - if (ppm->status == PEXOk && ppm->path) { /* we have a pick */ - - /* send back the number of objects */ - *numPickElRefs = ppm->path->numObj; - - /* Now, tack on the list of Element Refs to the back of the reply - Note that we do NOT include the length of the list. - The length is found in the reply itself. - */ - numbytes = sizeof(ddPickPath) * ppm->path->numObj; - - PU_CHECK_BUFFER_SIZE(pBuffer, numbytes); - /* Copy the Pick Path to the buffer */ - for (per = (ddPickPath*) ppm->path->pList, - dest = (pexPickElementRef*) pBuffer->pBuf, i=0; - i < ppm->path->numObj; per++, dest++, i++) { - - /* if returned structure handle is in the sIDlist - then the pick was on a path below an immediate OC - so return the struct id the user sent over in the BeginPick - request, otherwise return the resource ID as normal - */ - sIDpp = (ddPickPath *) (pRend->pickstr.sIDlist)->pList; - for (j = 0; j < (pRend->pickstr.sIDlist)->numObj; j++, sIDpp++) { - if ((diStructHandle)(per->structure) == sIDpp->structure) { - /* this is CORRECT, pickid is used to store the client - provided structure id, yes it is a kludge... - */ - dest->sid = sIDpp->pickid; - break; - } - else - dest->sid = ((ddStructResource*)(per->structure))->id; - } - dest->offset = per->offset; - dest->pickid = per->pickid; - } - - pBuffer->dataSize = numbytes; /* tells dipex how long the reply is */ - } - - if (ppm->path) { - puDeleteList(ppm->path); - ppm->path = NULL; - } - - if (ppm->incl_handle) - UpdateNSRefs( ppm->incl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - if (ppm->excl_handle) - UpdateNSRefs( ppm->excl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - - return(err); -} - - -ddpex3rtn -PickOne( pRend) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -{ - ddpex3rtn err = Success; - ddElementRange range; - miStructPtr pstruct; - miTraverserState trav_state; - diPMHandle pPM = (diPMHandle) NULL; - ddULONG offset1, offset2; - diStructHandle psh = pRend->pickstr.strHandle; - - - pstruct = (miStructPtr) (pRend->pickstr.strHandle)->deviceData; - - - /* now call the traverser to traverse this structure */ - /* set exec_str_flag */ - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - pPM = pRend->pickstr.pseudoPM; - - offset1 = 1; - offset2 = MISTR_NUM_EL(pstruct); - - err = traverser(pRend, psh, offset1, offset2, pPM, NULL, &trav_state); - - return(err); -} - -ddpex3rtn -EndPickAll( pRend, pBuffer) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -/* out */ -ddBufferPtr pBuffer; /* list of pick element ref */ -{ - ddpex3rtn err = Success; - - pexEndPickAllReply *reply = (pexEndPickAllReply *)(pBuffer->pHead); - int i, j, k, numbytes = 0, pbytes, numObj; - listofObj *list; - listofObj **listofp; - ddPickPath *pp, *sIDpp; - ddPointer pplist; - ddPickElementRef ref; - miPickMeasureStr *ppm; - - ppm = (miPickMeasureStr *) (pRend->pickstr.pseudoPM)->deviceData; - - reply->numPicked = (pRend->pickstr.list)->numObj; - reply->pickStatus = ((pRend->pickstr.list)->numObj) ?1:0; - reply->morePicks = pRend->pickstr.more_hits; - - numObj = (pRend->pickstr.list)->numObj; - listofp = (listofObj **)(pRend->pickstr.list)->pList; - - /* convert the pick path to a pick element ref for return */ - for (i = 0; i < numObj; i++) { - list = listofp[0]; - pbytes = list->numObj * sizeof(ddPickElementRef); - numbytes += pbytes + sizeof(CARD32); - PU_CHECK_BUFFER_SIZE(pBuffer, numbytes); - PACK_CARD32(list->numObj, pBuffer->pBuf); - pplist = list->pList; - - /* now convert each pick path to a pick element ref */ - /* and pack it into the reply buffer */ - for (j = 0; j < list->numObj; j++) { - pp = (ddPickPath *) pplist; - pplist = (ddPointer)(pp+1); - sIDpp = (ddPickPath *) (pRend->pickstr.sIDlist)->pList; - for (k = 0; k < (pRend->pickstr.sIDlist)->numObj; k++, sIDpp++) { - if ((diStructHandle)(pp->structure) == sIDpp->structure) { - /* this is CORRECT, pickid is used to store the client - provided structure id, yes it is a kludge... - */ - ref.sid = sIDpp->pickid; - break; - } - else - ref.sid = ((ddStructResource *)(pp->structure))->id; - } - ref.offset = pp->offset; - ref.pickid = pp->pickid; - PACK_STRUCT(ddPickElementRef, &ref, pBuffer->pBuf); - } - - /* remove the list from the list of list */ - puRemoveFromList( (ddPointer) &list, pRend->pickstr.list); - - /* if there are more hits when doing a server side pick all - save the last hit into the start path - */ - if ((pRend->pickstr.more_hits == PEXMoreHits) && (i == numObj-1) - && (pRend->pickstr.server == DD_SERVER)) - pRend->pickStartPath = list; - else - puDeleteList( list); - - } - - /* if there were no more hits empty the pickStartPath */ - if (pRend->pickstr.more_hits == PEXNoMoreHits) { - PU_EMPTY_LIST(pRend->pickStartPath); - } - - pRend->pickstr.more_hits = PEXNoMoreHits; - pBuffer->dataSize = numbytes; - - if (ppm->incl_handle) - UpdateNSRefs( ppm->incl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - if (ppm->excl_handle) - UpdateNSRefs( ppm->excl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - - return(err); -} - - -ddpex3rtn -PickAll( pRend) -/* in */ -ddRendererPtr pRend; /* renderer handle */ -{ - ddpex3rtn err = Success; - miTraverserState trav_state; - ddULONG offset1, offset2, numberOCs; - diStructHandle pstruct = 0; - miStructPtr pheader; - ddPickPath *pp; - diPMHandle pPM = (diPMHandle) NULL; - ddpex3rtn ValidatePickPath(); - - if (!pRend->pickStartPath) return (PEXERR(PEXPathError)); - err = ValidatePickPath(pRend->pickStartPath); - if (err != Success) return(err); - - /* now call the traverser to traverse this structure */ - /* set exec_str_flag */ - trav_state.exec_str_flag = ES_FOLLOW_PICK; - trav_state.p_curr_pick_el = (ddPickPath *) pRend->pickStartPath->pList ; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - pPM = pRend->pickstr.pseudoPM; - - pp = (ddPickPath *) pRend->pickStartPath->pList ; - pstruct = pp->structure; - pheader = (miStructPtr) pstruct->deviceData; - - offset1 = 1; - offset2 = MISTR_NUM_EL(pheader); - - err = traverser(pRend, pstruct, offset1, offset2, pPM, NULL, &trav_state); - - return(err); -} - -ddpex3rtn -AddPickPathToList( pRend, depth, path) -ddRendererPtr pRend; /* renderer handle */ -int depth; /* pick path depth */ -miPPLevel *path; /* the path */ -{ - listofObj *list; - int i, err; - ddPickPath *patharray; - - - /* dont know what this is supposed to do */ - if ((pRend->pickstr.list)->numObj >= pRend->pickstr.max_hits) { - pRend->pickstr.more_hits = PEXMoreHits; - return(0); - } - else pRend->pickstr.more_hits = PEXNoMoreHits; - - /* allocate space to store path while reversing */ - patharray = (ddPickPath *) xalloc(depth * sizeof(ddPickPath)); - - /* create list to place the path into */ - list = puCreateList(DD_PICK_PATH); - - /* traverse the list from bottom up and copy into temp store */ - for (i = 0; i < depth; i++){ - patharray[i] = path->pp; - path = path->up; - } - - /* now store the path from top down */ - for (i = depth-1; i >= 0; i--){ - err = puAddToList((ddPointer) &patharray[i], (ddULONG) 1, list); - if (err != Success) return(err); - } - - xfree(patharray); - - err = puAddToList( (ddPointer) &list, (ddULONG) 1, pRend->pickstr.list); - if (err != Success) return(err); - - if ((pRend->pickstr.send_event) && - ((pRend->pickstr.list)->numObj == pRend->pickstr.max_hits)) - err = PEXMaxHitsReachedNotify( pRend->pickstr.client, pRend->rendId); - - return(err); -} - -ddpex3rtn -ValidatePickPath(pPath) - listofObj *pPath; -{ - miGenericElementPtr p_element; - diStructHandle pStruct, pNextStruct; - miStructPtr pstruct; - ddULONG offset; - int i; - ddPickPath *pPickPath; - - - pPickPath = (ddPickPath *) pPath->pList; - pNextStruct = pPickPath->structure; - - for (i = pPath->numObj; i > 0; i--, pPickPath++) { - pStruct = pPickPath->structure; - if (pNextStruct != pStruct) return (PEXERR(PEXPathError)); - - pstruct = (miStructPtr) pStruct->deviceData; - - offset = pPickPath->offset; - if (offset > MISTR_NUM_EL(pstruct)) return (PEXERR(PEXPathError)); - - /* dont bother with the leaves */ - if (i == 1) break; - - MISTR_FIND_EL(pstruct, offset, p_element); - - if (MISTR_EL_TYPE(p_element) != PEXOCExecuteStructure) - return (PEXERR(PEXPathError)); - - pNextStruct = (diStructHandle) MISTR_GET_EXSTR_STR(p_element); - } - return (Success); -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile:3.14 xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile:3.14 Mon Apr 23 12:17:07 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile Sat Feb 28 21:41:55 2004 @@ -1,84 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:09 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/Imakefile,v 3.14 2001/04/23 16:17:07 tsi Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM or the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDdpexCDebugFlags -#define PexDdpexCDebugFlags ServerCDebugFlags -#endif - -XCOMM -D defines for ddpex: -XCOMM DDTEST turns on some fprintf(stderr...)s for debugging - - DEFINES = PexDdpexDefines -DEPEND_DEFINES = $(EXT_DEFINES) DependDefines -CDEBUGFLAGS = PexDdpexCDebugFlags - - PEXSERVINC = ../../../include -DDPEXINCLUDE = ../include - -INCLUDES = -I. \ - -I$(DDPEXINCLUDE) \ - -I$(XINCLUDESRC) \ - -I$(PEXSERVINC) \ - -I$(SERVERSRC)/include - -SRCS = miPick.c \ - miSC.c \ - miStruct.c \ - miTraverse.c \ - miWks.c \ - miDynamics.c \ - css_plain.c \ - css_ex_str.c \ - css_tbls.c - -OBJS = miPick.o \ - miSC.o \ - miStruct.o \ - miTraverse.o \ - miWks.o \ - miDynamics.o \ - css_plain.o \ - css_ex_str.o \ - css_tbls.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ddpex4,$(OBJS)) - -LintLibraryTarget(dp4,$(SRCS)) -NormalLintTarget($(SRCS)) - -SpecialCObjectRule(miWks,$(ICONFIGFILES),$(EXT_DEFINES)) - -DependTarget() Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c:1.10 Fri Dec 14 14:57:33 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c Sat Feb 28 21:41:55 2004 @@ -1,313 +0,0 @@ -/* $Xorg: css_ex_str.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/css_ex_str.c,v 1.10 2001/12/14 19:57:33 dawes Exp $ */ -/* - * this file contains the element handling procedures for - * the execute structure element. It is stored in PEX format - * but needs special handling - */ - -#include "ddpex.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "pexUtils.h" -#include "pexos.h" - - -extern ocTableType ParseOCTable[]; -extern ocTableType CopyOCTable[]; -extern ocTableType InquireOCTable[]; - -extern void miRemoveWksFromAppearLists(); -extern int miAddWksToAppearLists(); -extern ddpex4rtn destroyCSS_Plain(); - -#define SET_STR_HEADER(pStruct, pheader) \ - register miStructPtr pheader = (miStructPtr) pStruct->deviceData - -#define PEX_EL_TYPE(POC) ((ddElementInfo *)(POC))->elementType - -/* must have err, i and ppwks defined to use this macro */ -#define ADD_WKS( plist, pstr ) \ - if (puAddToList((ddPointer)(plist)->pList, (ddULONG)(plist)->numObj, \ - ((miStructPtr)(pstr)->deviceData)->wksAppearOn) == MI_ALLOCERR) \ - return(MI_ALLOCERR); \ - for ( i=(plist)->numObj, ppwks=(diWKSHandle *)(plist)->pList; \ - i > 0; \ - i--, ppwks++) \ - if ((err = miAddWksToAppearLists( (pstr), *ppwks )) != MI_SUCCESS) \ - return(err) - -/* must have i and ppwks defined to use this macro */ -#define REMOVE_WKS( plist, pstr ) \ - for ( i=(plist)->numObj, ppwks=(diWKSHandle *)(plist)->pList; \ - i > 0; \ - i--, ppwks++) { \ - puRemoveFromList( (ddPointer)ppwks, \ - ((miStructPtr)(pstr)->deviceData)->wksAppearOn); \ - miRemoveWksFromAppearLists((pstr), *ppwks); } - -ddpex4rtn -createCSS_Exec_Struct(pStruct, pPEXOC, ppCSSElement) -/* in */ - diStructHandle pStruct; - pexExecuteStructure *pPEXOC; -/* out */ - miGenericElementStr **ppCSSElement; -{ - SET_STR_HEADER(pStruct, pheader); - diStructHandle pexecstr; - ddpex4rtn err; - register ddULONG i; - register diWKSHandle *ppwks; - - *ppCSSElement = (miGenericElementPtr) NULL; - - err = (*ParseOCTable[PEX_EL_TYPE(pPEXOC)]) (pPEXOC, ppCSSElement); - - if (err != Success) - return (err); - - /* - * update the structure cross reference lists the id in execute - * structure elements was replaced with the diStructHandle by diPEX - */ - pexecstr = *((diStructHandle *)&(pPEXOC->id)); - - /* update pStructs children list */ - err = UpdateStructRefs(pStruct, (diResourceHandle) pexecstr, - CHILD_STRUCTURE_RESOURCE, ADD); - if (err != Success) - return (err); - - /* update the executed structs parent list */ - err = UpdateStructRefs(pexecstr, (diResourceHandle) pStruct, - PARENT_STRUCTURE_RESOURCE, ADD); - if (err != Success) - return (err); - - /* update the wks appears on lists of the subordinate structure */ - ADD_WKS(pheader->wksPostedTo, pexecstr); - ADD_WKS(pheader->wksAppearOn, pexecstr); - - (*ppCSSElement)->pStruct = pStruct; - (*ppCSSElement)->element.pexOClength = - ((ddElementInfo *) pPEXOC)->length; /* protocol size, not - * parsed size */ - (*ppCSSElement)->element.elementType = - ((ddElementInfo *) pPEXOC)->elementType; - - MISTR_NUM_EL(pheader)++; - MISTR_LENGTH(pheader) += ((ddElementInfo *) pPEXOC)->length; - - return (Success); -} - -ddpex4rtn -destroyCSS_Exec_Struct(pStruct, pCSSElement) -/* in */ - diStructHandle pStruct; - miGenericElementPtr pCSSElement; -/* out */ -{ - SET_STR_HEADER(pStruct, pheader); - diStructHandle pexecstr; - register int i; - register diWKSHandle *ppwks; - - pexecstr = (diStructHandle) MISTR_GET_EXSTR_STR(pCSSElement); - /* Now remove this child from the parent's list of children */ - - UpdateStructRefs(pStruct, (diResourceHandle) pexecstr, - CHILD_STRUCTURE_RESOURCE, REMOVE); - - /* and remove the parent from the childs list */ - - UpdateStructRefs(pexecstr, (diResourceHandle) pStruct, - PARENT_STRUCTURE_RESOURCE, REMOVE); - - /* update the wks appears on lists of the subordinate structure */ - REMOVE_WKS(pheader->wksPostedTo, pexecstr); - REMOVE_WKS(pheader->wksAppearOn, pexecstr); - - return (destroyCSS_Plain(pStruct, pCSSElement)); -} - -ddpex4rtn -copyCSS_Exec_Struct(pSrcCSSElement, pDestStruct, ppDestCSSElement) -/* in */ - miGenericElementPtr pSrcCSSElement; - diStructHandle pDestStruct; -/* out */ - miGenericElementStr **ppDestCSSElement; -{ - SET_STR_HEADER(pDestStruct, pheader); - diStructHandle pexecstr; - ddpex4rtn err; - register ddULONG i; - register diWKSHandle *ppwks; - - *ppDestCSSElement = (miGenericElementPtr) NULL; - - err = (*CopyOCTable[(int) (pSrcCSSElement->element.elementType)]) - (pSrcCSSElement, ppDestCSSElement); - if (err != Success) - return (err); - - /* - * update the structure cross reference lists the id in execute - * structure elements was replaced with the diStructHandle by diPEX - */ - pexecstr = (diStructHandle) MISTR_GET_EXSTR_STR(pSrcCSSElement); - - /* update pStructs children list */ - err = UpdateStructRefs(pDestStruct, (diResourceHandle) pexecstr, - CHILD_STRUCTURE_RESOURCE, ADD); - if (err != Success) - return (err); - - /* update the executed structs parent list */ - err = UpdateStructRefs(pexecstr, (diResourceHandle) pDestStruct, - PARENT_STRUCTURE_RESOURCE, ADD); - if (err != Success) - return (err); - - /* update the wks appears on lists of the subordinate structure */ - ADD_WKS(pheader->wksPostedTo, pexecstr); - ADD_WKS(pheader->wksAppearOn, pexecstr); - - MISTR_NUM_EL(pheader)++; - MISTR_LENGTH(pheader) += MISTR_EL_LENGTH(pSrcCSSElement); - - (*ppDestCSSElement)->pStruct = pDestStruct; - - MISTR_EL_LENGTH(*ppDestCSSElement) = MISTR_EL_LENGTH(pSrcCSSElement); - MISTR_EL_TYPE(*ppDestCSSElement) = MISTR_EL_TYPE(pSrcCSSElement); - - return (Success); -} - -ddpex4rtn -replaceCSS_Exec_Struct(pStruct, pCSSElement, pPEXOC) -/* in */ - diStructHandle pStruct; - miGenericElementPtr pCSSElement; - pexExecuteStructure *pPEXOC; -{ - SET_STR_HEADER(pStruct, pheader); - diStructHandle pexecstr; - ddpex4rtn err; - register ddULONG i; - register diWKSHandle *ppwks; - - pexecstr = (diStructHandle) MISTR_GET_EXSTR_STR(pCSSElement); - if (pexecstr != *((diStructHandle *)&(pPEXOC->id))) { - - /* - * update the structure cross reference lists the id in - * execute structure elements was replaced with the - * diStructHandle by diPEX - */ - - /* update pStructs children list REMOVE the old element */ - UpdateStructRefs(pStruct, (diResourceHandle) pexecstr, - CHILD_STRUCTURE_RESOURCE, REMOVE); - - /* update the executed structs parent list REMOVE the parent */ - UpdateStructRefs(pexecstr, (diResourceHandle) pStruct, - PARENT_STRUCTURE_RESOURCE, REMOVE); - - /* - * update the wks appears on lists of the subordinate - * structure - */ - REMOVE_WKS(pheader->wksPostedTo, pexecstr); - REMOVE_WKS(pheader->wksAppearOn, pexecstr); - - /* update the new executed structs parent list */ - err = UpdateStructRefs( *((diStructHandle *)&(pPEXOC->id)), - (diResourceHandle) pStruct, - PARENT_STRUCTURE_RESOURCE, ADD); - if (err != Success) return (err); - - /* update pStructs children list with the new child */ - err = UpdateStructRefs( pStruct, - *((diResourceHandle *)&(pPEXOC->id)), - CHILD_STRUCTURE_RESOURCE, ADD); - if (err != Success) return (err); - - /* - * update the wks appears on lists of the subordinate - * structure - */ - ADD_WKS(pheader->wksPostedTo,*((diStructHandle *)&(pPEXOC->id))); - ADD_WKS(pheader->wksAppearOn,*((diStructHandle *)&(pPEXOC->id))); - - MISTR_PUT_EXSTR_STR(pCSSElement, pPEXOC->id); - } - return (Success); -} - - -ddpex4rtn -inquireCSS_Exec_Struct(pCSSElement, pBuf, ppPEXOC) - miGenericElementPtr pCSSElement; - ddBuffer *pBuf; - ddElementInfo **ppPEXOC; -{ - ddpex4rtn err = Success; - pexExecuteStructure *pexstr; - - err = (*InquireOCTable[(int) (pCSSElement->element.elementType)]) - (pCSSElement, pBuf, ppPEXOC); - - pexstr = (pexExecuteStructure *)*ppPEXOC; - pexstr->id = (*((diStructHandle *)&(pexstr->id)))->id; - return (err); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c:1.10 Fri Dec 14 14:57:34 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c Sat Feb 28 21:41:55 2004 @@ -1,226 +0,0 @@ -/* $Xorg: css_plain.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/css_plain.c,v 1.10 2001/12/14 19:57:34 dawes Exp $ */ -/* - * this file contains the element handling procedures for elements - * which are stored in the format they are received. This includes - * PEX elements stored in PEX format and any imp. dep. elements which - * are not defined by PEX. - */ - -#include "ddpex.h" -#include "miStrMacro.h" -#include "pexos.h" - - -extern ocTableType ParseOCTable[]; -extern destroyTableType DestroyOCTable[]; -extern ocTableType CopyOCTable[]; -extern ocTableType InquireOCTable[]; -extern ocTableType ReplaceOCTable[]; - -#define SET_STR_HEADER(pStruct, pheader) \ - register miStructPtr pheader = (miStructPtr) pStruct->deviceData - -#define PEX_EL_TYPE(POC) ((ddElementInfo *)(POC))->elementType - - -ddpex4rtn -createCSS_Plain(pStruct, pPEXOC, ppCSSElement) -/* in */ - diStructHandle pStruct; - ddPointer pPEXOC; -/* out */ - miGenericElementStr **ppCSSElement; -{ - ddpex4rtn err = Success; - SET_STR_HEADER(pStruct, pheader); - - *ppCSSElement = (miGenericElementPtr) NULL; - - /* - * Parse into server native format - * If we make it here OC is either proprietary or valid PEXOC - * still need to check proprietary to avoid Null Function Ptrs - */ - if (MI_HIGHBIT_ON(PEX_EL_TYPE(pPEXOC))) - err = (*ParseOCTable[MI_OC_PROP]) (pPEXOC, ppCSSElement); - else - err = (*ParseOCTable[PEX_EL_TYPE(pPEXOC)]) - (pPEXOC, ppCSSElement); - - if (err != Success) - return (PEXERR(PEXOutputCommandError)); - - (*ppCSSElement)->pStruct = pStruct; - (*ppCSSElement)->element.pexOClength = - ((ddElementInfo *) pPEXOC)->length; /* protocol size, not - * parsed size */ - (*ppCSSElement)->element.elementType = - ((ddElementInfo *) pPEXOC)->elementType; - - MISTR_NUM_EL(pheader)++; - MISTR_LENGTH(pheader) += ((ddElementInfo *) pPEXOC)->length; - - return (Success); -} - -ddpex4rtn -destroyCSS_Plain(pStruct, pCSSElement) -/* in */ - diStructHandle pStruct; - miGenericElementPtr pCSSElement; -/* out */ -{ - ddpex4rtn err = Success; - SET_STR_HEADER(pStruct, pheader); - - MISTR_NUM_EL(pheader)--; - MISTR_LENGTH(pheader) -= MISTR_EL_LENGTH(pCSSElement); - - /* - * Free the parsed format - * If we make it here OC is either proprietary or valid PEXOC - * still need to check proprietary to avoid Null Function Ptrs - * even though we use the same destroy routine - */ - - if (MI_HIGHBIT_ON(pCSSElement->element.elementType)) - (*DestroyOCTable[MI_OC_PROP]) (pCSSElement); - else - (*DestroyOCTable[(int) (pCSSElement->element.elementType)]) - (pCSSElement); - - return (err); -} - -ddpex4rtn -copyCSS_Plain(pSrcCSSElement, pDestStruct, ppDestCSSElement) -/* in */ - miGenericElementPtr pSrcCSSElement; - diStructHandle pDestStruct; -/* out */ - miGenericElementStr **ppDestCSSElement; -{ - ddpex4rtn err = Success; - SET_STR_HEADER(pDestStruct, pheader); - - *ppDestCSSElement = (miGenericElementPtr) NULL; - - /* - * If we make it here OC is either proprietary or valid PEXOC - * still need to check proprietary to avoid Null Function Ptrs - */ - if (MI_HIGHBIT_ON(pSrcCSSElement->element.elementType)) - err = (*CopyOCTable[MI_OC_PROP]) - (pSrcCSSElement, ppDestCSSElement); - else - err = (*CopyOCTable[(int) (pSrcCSSElement->element.elementType)]) - (pSrcCSSElement, ppDestCSSElement); - - if (err != Success) - return (err); - - (*ppDestCSSElement)->pStruct = pDestStruct; - (*ppDestCSSElement)->element.pexOClength = - pSrcCSSElement->element.pexOClength; - (*ppDestCSSElement)->element.elementType = - pSrcCSSElement->element.elementType; - - MISTR_NUM_EL(pheader)++; - MISTR_LENGTH(pheader) += MISTR_EL_LENGTH(*ppDestCSSElement); - - return (Success); -} - -ddpex4rtn -replaceCSS_Plain(pStruct, pCSSElement, pPEXOC) - diStructHandle pStruct; - miGenericElementPtr pCSSElement; - ddElementInfo *pPEXOC; -{ - ddpex4rtn err = Success; - - /* - * If we make it here OC is either proprietary or valid PEXOC - * still need to check proprietary to avoid Null Function Ptrs - */ - if (MI_HIGHBIT_ON(pCSSElement->element.elementType)) - err = (*ReplaceOCTable[MI_OC_PROP]) (pPEXOC, &pCSSElement); - else - err = (*ReplaceOCTable[(int) (pCSSElement->element.elementType)]) - (pPEXOC, &pCSSElement); - - if (err == Success) { - pCSSElement->pStruct = pStruct; - pCSSElement->element.elementType = pPEXOC->elementType; - pCSSElement->element.pexOClength = pPEXOC->length; - } - return (err); -} - -ddpex4rtn -inquireCSS_Plain(pCSSElement, pBuf, ppPEXOC) - miGenericElementPtr pCSSElement; - ddBuffer *pBuf; - ddElementInfo **ppPEXOC; -{ - ddpex4rtn err = Success; - - /* - * If we make it here OC is either proprietary or valid PEXOC - * still need to check proprietary to avoid Null Function Ptrs - */ - if (MI_HIGHBIT_ON(pCSSElement->element.elementType)) - err = (*InquireOCTable[MI_OC_PROP]) (pCSSElement, pBuf, ppPEXOC); - else - err = (*InquireOCTable[(int) (pCSSElement->element.elementType)]) - (pCSSElement, pBuf, ppPEXOC); - return (err); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/css_tbls.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/css_tbls.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level4/css_tbls.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/css_tbls.c:1.9 Fri Dec 14 14:57:34 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/css_tbls.c Sat Feb 28 21:41:55 2004 @@ -1,611 +0,0 @@ -/* $Xorg: css_tbls.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* Automatically generated element handling tables */ - -#include "ddpex.h" -#include "miStruct.h" - - -/* declarations for procs which handle elements stored in PEX format - * this includes elements stored in PEX format and any extra elements - * which are not defined in the protocol - */ - -extern ddpex4rtn createCSS_Plain(); -extern ddpex4rtn destroyCSS_Plain(); -extern ddpex4rtn copyCSS_Plain(); -extern ddpex4rtn replaceCSS_Plain(); -extern ddpex4rtn inquireCSS_Plain(); - -/* declarations for procs which handle execute structure elements */ -extern ddpex4rtn createCSS_Exec_Struct(); -extern ddpex4rtn destroyCSS_Exec_Struct(); -extern ddpex4rtn copyCSS_Exec_Struct(); -extern ddpex4rtn replaceCSS_Exec_Struct(); -extern ddpex4rtn inquireCSS_Exec_Struct(); - -cssTableType CreateCSSElementTable[] = { - createCSS_Plain, /* 0 Propietary */ - createCSS_Plain, /* 1 MarkerType */ - createCSS_Plain, /* 2 MarkerScale */ - createCSS_Plain, /* 3 MarkerColourIndex */ - createCSS_Plain, /* 4 MarkerColour */ - createCSS_Plain, /* 5 MarkerBundleIndex */ - createCSS_Plain, /* 6 TextFontIndex */ - createCSS_Plain, /* 7 TextPrecision */ - createCSS_Plain, /* 8 CharExpansion */ - createCSS_Plain, /* 9 CharSpacing */ - createCSS_Plain, /* 10 TextColourIndex */ - createCSS_Plain, /* 11 TextColour */ - createCSS_Plain, /* 12 CharHeight */ - createCSS_Plain, /* 13 CharUpVector */ - createCSS_Plain, /* 14 TextPath */ - createCSS_Plain, /* 15 TextAlignment */ - createCSS_Plain, /* 16 AtextHeight */ - createCSS_Plain, /* 17 AtextUpVector */ - createCSS_Plain, /* 18 AtextPath */ - createCSS_Plain, /* 19 AtextAlignment */ - createCSS_Plain, /* 20 AtextStyle */ - createCSS_Plain, /* 21 TextBundleIndex */ - createCSS_Plain, /* 22 LineType */ - createCSS_Plain, /* 23 LineWidth */ - createCSS_Plain, /* 24 LineColourIndex */ - createCSS_Plain, /* 25 LineColour */ - createCSS_Plain, /* 26 CurveApproximation */ - createCSS_Plain, /* 27 PolylineInterp */ - createCSS_Plain, /* 28 LineBundleIndex */ - createCSS_Plain, /* 29 InteriorStyle */ - createCSS_Plain, /* 30 InteriorStyleIndex */ - createCSS_Plain, /* 31 SurfaceColourIndex */ - createCSS_Plain, /* 32 SurfaceColour */ - createCSS_Plain, /* 33 SurfaceReflAttr */ - createCSS_Plain, /* 34 SurfaceReflModel */ - createCSS_Plain, /* 35 SurfaceInterp */ - createCSS_Plain, /* 36 BfInteriorStyle */ - createCSS_Plain, /* 37 BfInteriorStyleIndex */ - createCSS_Plain, /* 38 BfSurfaceColourIndex */ - createCSS_Plain, /* 39 BfSurfaceColour */ - createCSS_Plain, /* 40 BfSurfaceReflAttr */ - createCSS_Plain, /* 41 BfSurfaceReflModel */ - createCSS_Plain, /* 42 BfSurfaceInterp */ - createCSS_Plain, /* 43 SurfaceApproximation */ - createCSS_Plain, /* 44 CullingMode */ - createCSS_Plain, /* 45 DistinguishFlag */ - createCSS_Plain, /* 46 PatternSize */ - createCSS_Plain, /* 47 PatternRefPt */ - createCSS_Plain, /* 48 PatternAttr */ - createCSS_Plain, /* 49 InteriorBundleIndex */ - createCSS_Plain, /* 50 SurfaceEdgeFlag */ - createCSS_Plain, /* 51 SurfaceEdgeType */ - createCSS_Plain, /* 52 SurfaceEdgeWidth */ - createCSS_Plain, /* 53 SurfaceEdgeColourIndex */ - createCSS_Plain, /* 54 SurfaceEdgeColour */ - createCSS_Plain, /* 55 EdgeBundleIndex */ - createCSS_Plain, /* 56 SetAsfValues */ - createCSS_Plain, /* 57 LocalTransform */ - createCSS_Plain, /* 58 LocalTransform2D */ - createCSS_Plain, /* 59 GlobalTransform */ - createCSS_Plain, /* 60 GlobalTransform2D */ - createCSS_Plain, /* 61 ModelClip */ - createCSS_Plain, /* 62 ModelClipVolume */ - createCSS_Plain, /* 63 ModelClipVolume2D */ - createCSS_Plain, /* 64 RestoreModelClip */ - createCSS_Plain, /* 65 ViewIndex */ - createCSS_Plain, /* 66 LightState */ - createCSS_Plain, /* 67 DepthCueIndex */ - createCSS_Plain, /* 68 PickId */ - createCSS_Plain, /* 69 HlhsrIdentifier */ - createCSS_Plain, /* 70 ColourApproxIndex */ - createCSS_Plain, /* 71 RenderingColourModel */ - createCSS_Plain, /* 72 PSurfaceCharacteristics */ - createCSS_Plain, /* 73 AddToNameSet */ - createCSS_Plain, /* 74 RemoveFromNameSet */ - createCSS_Exec_Struct, /* 75 ExecuteStructure */ - createCSS_Plain, /* 76 Label */ - createCSS_Plain, /* 77 ApplicationData */ - createCSS_Plain, /* 78 Gse */ - createCSS_Plain, /* 79 Marker */ - createCSS_Plain, /* 80 Marker2D */ - createCSS_Plain, /* 81 Text */ - createCSS_Plain, /* 82 Text2D */ - createCSS_Plain, /* 83 AnnotationText */ - createCSS_Plain, /* 84 AnnotationText2D */ - createCSS_Plain, /* 85 Polyline */ - createCSS_Plain, /* 86 Polyline2D */ - createCSS_Plain, /* 87 PolylineSet */ - createCSS_Plain, /* 88 NurbCurve */ - createCSS_Plain, /* 89 FillArea */ - createCSS_Plain, /* 90 FillArea2D */ - createCSS_Plain, /* 91 ExtFillArea */ - createCSS_Plain, /* 92 FillAreaSet */ - createCSS_Plain, /* 93 FillAreaSet2D */ - createCSS_Plain, /* 94 ExtFillAreaSet */ - createCSS_Plain, /* 95 TriangleStrip */ - createCSS_Plain, /* 96 QuadrilateralMesh */ - createCSS_Plain, /* 97 SOFAS */ - createCSS_Plain, /* 98 NurbSurface */ - createCSS_Plain, /* 99 CellArray */ - createCSS_Plain, /* 100 CellArray2D */ - createCSS_Plain, /* 101 ExtCellArray */ - createCSS_Plain, /* 102 Gdp */ - createCSS_Plain, /* 103 Gdp2D */ - createCSS_Plain /* 104 Noop */ -}; - -cssTableType DestroyCSSElementTable[] = { - destroyCSS_Plain, /* 0 Propietary */ - destroyCSS_Plain, /* 1 MarkerType */ - destroyCSS_Plain, /* 2 MarkerScale */ - destroyCSS_Plain, /* 3 MarkerColourIndex */ - destroyCSS_Plain, /* 4 MarkerColour */ - destroyCSS_Plain, /* 5 MarkerBundleIndex */ - destroyCSS_Plain, /* 6 TextFontIndex */ - destroyCSS_Plain, /* 7 TextPrecision */ - destroyCSS_Plain, /* 8 CharExpansion */ - destroyCSS_Plain, /* 9 CharSpacing */ - destroyCSS_Plain, /* 10 TextColourIndex */ - destroyCSS_Plain, /* 11 TextColour */ - destroyCSS_Plain, /* 12 CharHeight */ - destroyCSS_Plain, /* 13 CharUpVector */ - destroyCSS_Plain, /* 14 TextPath */ - destroyCSS_Plain, /* 15 TextAlignment */ - destroyCSS_Plain, /* 16 AtextHeight */ - destroyCSS_Plain, /* 17 AtextUpVector */ - destroyCSS_Plain, /* 18 AtextPath */ - destroyCSS_Plain, /* 19 AtextAlignment */ - destroyCSS_Plain, /* 20 AtextStyle */ - destroyCSS_Plain, /* 21 TextBundleIndex */ - destroyCSS_Plain, /* 22 LineType */ - destroyCSS_Plain, /* 23 LineWidth */ - destroyCSS_Plain, /* 24 LineColourIndex */ - destroyCSS_Plain, /* 25 LineColour */ - destroyCSS_Plain, /* 26 CurveApproximation */ - destroyCSS_Plain, /* 27 PolylineInterp */ - destroyCSS_Plain, /* 28 LineBundleIndex */ - destroyCSS_Plain, /* 29 InteriorStyle */ - destroyCSS_Plain, /* 30 InteriorStyleIndex */ - destroyCSS_Plain, /* 31 SurfaceColourIndex */ - destroyCSS_Plain, /* 32 SurfaceColour */ - destroyCSS_Plain, /* 33 SurfaceReflAttr */ - destroyCSS_Plain, /* 34 SurfaceReflModel */ - destroyCSS_Plain, /* 35 SurfaceInterp */ - destroyCSS_Plain, /* 36 BfInteriorStyle */ - destroyCSS_Plain, /* 37 BfInteriorStyleIndex */ - destroyCSS_Plain, /* 38 BfSurfaceColourIndex */ - destroyCSS_Plain, /* 39 BfSurfaceColour */ - destroyCSS_Plain, /* 40 BfSurfaceReflAttr */ - destroyCSS_Plain, /* 41 BfSurfaceReflModel */ - destroyCSS_Plain, /* 42 BfSurfaceInterp */ - destroyCSS_Plain, /* 43 SurfaceApproximation */ - destroyCSS_Plain, /* 44 CullingMode */ - destroyCSS_Plain, /* 45 DistinguishFlag */ - destroyCSS_Plain, /* 46 PatternSize */ - destroyCSS_Plain, /* 47 PatternRefPt */ - destroyCSS_Plain, /* 48 PatternAttr */ - destroyCSS_Plain, /* 49 InteriorBundleIndex */ - destroyCSS_Plain, /* 50 SurfaceEdgeFlag */ - destroyCSS_Plain, /* 51 SurfaceEdgeType */ - destroyCSS_Plain, /* 52 SurfaceEdgeWidth */ - destroyCSS_Plain, /* 53 SurfaceEdgeColourIndex */ - destroyCSS_Plain, /* 54 SurfaceEdgeColour */ - destroyCSS_Plain, /* 55 EdgeBundleIndex */ - destroyCSS_Plain, /* 56 SetAsfValues */ - destroyCSS_Plain, /* 57 LocalTransform */ - destroyCSS_Plain, /* 58 LocalTransform2D */ - destroyCSS_Plain, /* 59 GlobalTransform */ - destroyCSS_Plain, /* 60 GlobalTransform2D */ - destroyCSS_Plain, /* 61 ModelClip */ - destroyCSS_Plain, /* 62 ModelClipVolume */ - destroyCSS_Plain, /* 63 ModelClipVolume2D */ - destroyCSS_Plain, /* 64 RestoreModelClip */ - destroyCSS_Plain, /* 65 ViewIndex */ - destroyCSS_Plain, /* 66 LightState */ - destroyCSS_Plain, /* 67 DepthCueIndex */ - destroyCSS_Plain, /* 68 PickId */ - destroyCSS_Plain, /* 69 HlhsrIdentifier */ - destroyCSS_Plain, /* 70 ColourApproxIndex */ - destroyCSS_Plain, /* 71 RenderingColourModel */ - destroyCSS_Plain, /* 72 PSurfaceCharacteristics */ - destroyCSS_Plain, /* 73 AddToNameSet */ - destroyCSS_Plain, /* 74 RemoveFromNameSet */ - destroyCSS_Exec_Struct, /* 75 ExecuteStructure */ - destroyCSS_Plain, /* 76 Label */ - destroyCSS_Plain, /* 77 ApplicationData */ - destroyCSS_Plain, /* 78 Gse */ - destroyCSS_Plain, /* 79 Marker */ - destroyCSS_Plain, /* 80 Marker2D */ - destroyCSS_Plain, /* 81 Text */ - destroyCSS_Plain, /* 82 Text2D */ - destroyCSS_Plain, /* 83 AnnotationText */ - destroyCSS_Plain, /* 84 AnnotationText2D */ - destroyCSS_Plain, /* 85 Polyline */ - destroyCSS_Plain, /* 86 Polyline2D */ - destroyCSS_Plain, /* 87 PolylineSet */ - destroyCSS_Plain, /* 88 NurbCurve */ - destroyCSS_Plain, /* 89 FillArea */ - destroyCSS_Plain, /* 90 FillArea2D */ - destroyCSS_Plain, /* 91 ExtFillArea */ - destroyCSS_Plain, /* 92 FillAreaSet */ - destroyCSS_Plain, /* 93 FillAreaSet2D */ - destroyCSS_Plain, /* 94 ExtFillAreaSet */ - destroyCSS_Plain, /* 95 TriangleStrip */ - destroyCSS_Plain, /* 96 QuadrilateralMesh */ - destroyCSS_Plain, /* 97 SOFAS */ - destroyCSS_Plain, /* 98 NurbSurface */ - destroyCSS_Plain, /* 99 CellArray */ - destroyCSS_Plain, /* 100 CellArray2D */ - destroyCSS_Plain, /* 101 ExtCellArray */ - destroyCSS_Plain, /* 102 Gdp */ - destroyCSS_Plain, /* 103 Gdp2D */ - destroyCSS_Plain /* 104 Noop */ -}; - -cssTableType CopyCSSElementTable[] = { - copyCSS_Plain, /* 0 Propietary */ - copyCSS_Plain, /* 1 MarkerType */ - copyCSS_Plain, /* 2 MarkerScale */ - copyCSS_Plain, /* 3 MarkerColourIndex */ - copyCSS_Plain, /* 4 MarkerColour */ - copyCSS_Plain, /* 5 MarkerBundleIndex */ - copyCSS_Plain, /* 6 TextFontIndex */ - copyCSS_Plain, /* 7 TextPrecision */ - copyCSS_Plain, /* 8 CharExpansion */ - copyCSS_Plain, /* 9 CharSpacing */ - copyCSS_Plain, /* 10 TextColourIndex */ - copyCSS_Plain, /* 11 TextColour */ - copyCSS_Plain, /* 12 CharHeight */ - copyCSS_Plain, /* 13 CharUpVector */ - copyCSS_Plain, /* 14 TextPath */ - copyCSS_Plain, /* 15 TextAlignment */ - copyCSS_Plain, /* 16 AtextHeight */ - copyCSS_Plain, /* 17 AtextUpVector */ - copyCSS_Plain, /* 18 AtextPath */ - copyCSS_Plain, /* 19 AtextAlignment */ - copyCSS_Plain, /* 20 AtextStyle */ - copyCSS_Plain, /* 21 TextBundleIndex */ - copyCSS_Plain, /* 22 LineType */ - copyCSS_Plain, /* 23 LineWidth */ - copyCSS_Plain, /* 24 LineColourIndex */ - copyCSS_Plain, /* 25 LineColour */ - copyCSS_Plain, /* 26 CurveApproximation */ - copyCSS_Plain, /* 27 PolylineInterp */ - copyCSS_Plain, /* 28 LineBundleIndex */ - copyCSS_Plain, /* 29 InteriorStyle */ - copyCSS_Plain, /* 30 InteriorStyleIndex */ - copyCSS_Plain, /* 31 SurfaceColourIndex */ - copyCSS_Plain, /* 32 SurfaceColour */ - copyCSS_Plain, /* 33 SurfaceReflAttr */ - copyCSS_Plain, /* 34 SurfaceReflModel */ - copyCSS_Plain, /* 35 SurfaceInterp */ - copyCSS_Plain, /* 36 BfInteriorStyle */ - copyCSS_Plain, /* 37 BfInteriorStyleIndex */ - copyCSS_Plain, /* 38 BfSurfaceColourIndex */ - copyCSS_Plain, /* 39 BfSurfaceColour */ - copyCSS_Plain, /* 40 BfSurfaceReflAttr */ - copyCSS_Plain, /* 41 BfSurfaceReflModel */ - copyCSS_Plain, /* 42 BfSurfaceInterp */ - copyCSS_Plain, /* 43 SurfaceApproximation */ - copyCSS_Plain, /* 44 CullingMode */ - copyCSS_Plain, /* 45 DistinguishFlag */ - copyCSS_Plain, /* 46 PatternSize */ - copyCSS_Plain, /* 47 PatternRefPt */ - copyCSS_Plain, /* 48 PatternAttr */ - copyCSS_Plain, /* 49 InteriorBundleIndex */ - copyCSS_Plain, /* 50 SurfaceEdgeFlag */ - copyCSS_Plain, /* 51 SurfaceEdgeType */ - copyCSS_Plain, /* 52 SurfaceEdgeWidth */ - copyCSS_Plain, /* 53 SurfaceEdgeColourIndex */ - copyCSS_Plain, /* 54 SurfaceEdgeColour */ - copyCSS_Plain, /* 55 EdgeBundleIndex */ - copyCSS_Plain, /* 56 SetAsfValues */ - copyCSS_Plain, /* 57 LocalTransform */ - copyCSS_Plain, /* 58 LocalTransform2D */ - copyCSS_Plain, /* 59 GlobalTransform */ - copyCSS_Plain, /* 60 GlobalTransform2D */ - copyCSS_Plain, /* 61 ModelClip */ - copyCSS_Plain, /* 62 ModelClipVolume */ - copyCSS_Plain, /* 63 ModelClipVolume2D */ - copyCSS_Plain, /* 64 RestoreModelClip */ - copyCSS_Plain, /* 65 ViewIndex */ - copyCSS_Plain, /* 66 LightState */ - copyCSS_Plain, /* 67 DepthCueIndex */ - copyCSS_Plain, /* 68 PickId */ - copyCSS_Plain, /* 69 HlhsrIdentifier */ - copyCSS_Plain, /* 70 ColourApproxIndex */ - copyCSS_Plain, /* 71 RenderingColourModel */ - copyCSS_Plain, /* 72 PSurfaceCharacteristics */ - copyCSS_Plain, /* 73 AddToNameSet */ - copyCSS_Plain, /* 74 RemoveFromNameSet */ - copyCSS_Exec_Struct, /* 75 ExecuteStructure */ - copyCSS_Plain, /* 76 Label */ - copyCSS_Plain, /* 77 ApplicationData */ - copyCSS_Plain, /* 78 Gse */ - copyCSS_Plain, /* 79 Marker */ - copyCSS_Plain, /* 80 Marker2D */ - copyCSS_Plain, /* 81 Text */ - copyCSS_Plain, /* 82 Text2D */ - copyCSS_Plain, /* 83 AnnotationText */ - copyCSS_Plain, /* 84 AnnotationText2D */ - copyCSS_Plain, /* 85 Polyline */ - copyCSS_Plain, /* 86 Polyline2D */ - copyCSS_Plain, /* 87 PolylineSet */ - copyCSS_Plain, /* 88 NurbCurve */ - copyCSS_Plain, /* 89 FillArea */ - copyCSS_Plain, /* 90 FillArea2D */ - copyCSS_Plain, /* 91 ExtFillArea */ - copyCSS_Plain, /* 92 FillAreaSet */ - copyCSS_Plain, /* 93 FillAreaSet2D */ - copyCSS_Plain, /* 94 ExtFillAreaSet */ - copyCSS_Plain, /* 95 TriangleStrip */ - copyCSS_Plain, /* 96 QuadrilateralMesh */ - copyCSS_Plain, /* 97 SOFAS */ - copyCSS_Plain, /* 98 NurbSurface */ - copyCSS_Plain, /* 99 CellArray */ - copyCSS_Plain, /* 100 CellArray2D */ - copyCSS_Plain, /* 101 ExtCellArray */ - copyCSS_Plain, /* 102 Gdp */ - copyCSS_Plain, /* 103 Gdp2D */ - copyCSS_Plain /* 104 Noop */ -}; - -cssTableType ReplaceCSSElementTable[] = { - replaceCSS_Plain, /* 0 Propietary */ - replaceCSS_Plain, /* 1 MarkerType */ - replaceCSS_Plain, /* 2 MarkerScale */ - replaceCSS_Plain, /* 3 MarkerColourIndex */ - replaceCSS_Plain, /* 4 MarkerColour */ - replaceCSS_Plain, /* 5 MarkerBundleIndex */ - replaceCSS_Plain, /* 6 TextFontIndex */ - replaceCSS_Plain, /* 7 TextPrecision */ - replaceCSS_Plain, /* 8 CharExpansion */ - replaceCSS_Plain, /* 9 CharSpacing */ - replaceCSS_Plain, /* 10 TextColourIndex */ - replaceCSS_Plain, /* 11 TextColour */ - replaceCSS_Plain, /* 12 CharHeight */ - replaceCSS_Plain, /* 13 CharUpVector */ - replaceCSS_Plain, /* 14 TextPath */ - replaceCSS_Plain, /* 15 TextAlignment */ - replaceCSS_Plain, /* 16 AtextHeight */ - replaceCSS_Plain, /* 17 AtextUpVector */ - replaceCSS_Plain, /* 18 AtextPath */ - replaceCSS_Plain, /* 19 AtextAlignment */ - replaceCSS_Plain, /* 20 AtextStyle */ - replaceCSS_Plain, /* 21 TextBundleIndex */ - replaceCSS_Plain, /* 22 LineType */ - replaceCSS_Plain, /* 23 LineWidth */ - replaceCSS_Plain, /* 24 LineColourIndex */ - replaceCSS_Plain, /* 25 LineColour */ - replaceCSS_Plain, /* 26 CurveApproximation */ - replaceCSS_Plain, /* 27 PolylineInterp */ - replaceCSS_Plain, /* 28 LineBundleIndex */ - replaceCSS_Plain, /* 29 InteriorStyle */ - replaceCSS_Plain, /* 30 InteriorStyleIndex */ - replaceCSS_Plain, /* 31 SurfaceColourIndex */ - replaceCSS_Plain, /* 32 SurfaceColour */ - replaceCSS_Plain, /* 33 SurfaceReflAttr */ - replaceCSS_Plain, /* 34 SurfaceReflModel */ - replaceCSS_Plain, /* 35 SurfaceInterp */ - replaceCSS_Plain, /* 36 BfInteriorStyle */ - replaceCSS_Plain, /* 37 BfInteriorStyleIndex */ - replaceCSS_Plain, /* 38 BfSurfaceColourIndex */ - replaceCSS_Plain, /* 39 BfSurfaceColour */ - replaceCSS_Plain, /* 40 BfSurfaceReflAttr */ - replaceCSS_Plain, /* 41 BfSurfaceReflModel */ - replaceCSS_Plain, /* 42 BfSurfaceInterp */ - replaceCSS_Plain, /* 43 SurfaceApproximation */ - replaceCSS_Plain, /* 44 CullingMode */ - replaceCSS_Plain, /* 45 DistinguishFlag */ - replaceCSS_Plain, /* 46 PatternSize */ - replaceCSS_Plain, /* 47 PatternRefPt */ - replaceCSS_Plain, /* 48 PatternAttr */ - replaceCSS_Plain, /* 49 InteriorBundleIndex */ - replaceCSS_Plain, /* 50 SurfaceEdgeFlag */ - replaceCSS_Plain, /* 51 SurfaceEdgeType */ - replaceCSS_Plain, /* 52 SurfaceEdgeWidth */ - replaceCSS_Plain, /* 53 SurfaceEdgeColourIndex */ - replaceCSS_Plain, /* 54 SurfaceEdgeColour */ - replaceCSS_Plain, /* 55 EdgeBundleIndex */ - replaceCSS_Plain, /* 56 SetAsfValues */ - replaceCSS_Plain, /* 57 LocalTransform */ - replaceCSS_Plain, /* 58 LocalTransform2D */ - replaceCSS_Plain, /* 59 GlobalTransform */ - replaceCSS_Plain, /* 60 GlobalTransform2D */ - replaceCSS_Plain, /* 61 ModelClip */ - replaceCSS_Plain, /* 62 ModelClipVolume */ - replaceCSS_Plain, /* 63 ModelClipVolume2D */ - replaceCSS_Plain, /* 64 RestoreModelClip */ - replaceCSS_Plain, /* 65 ViewIndex */ - replaceCSS_Plain, /* 66 LightState */ - replaceCSS_Plain, /* 67 DepthCueIndex */ - replaceCSS_Plain, /* 68 PickId */ - replaceCSS_Plain, /* 69 HlhsrIdentifier */ - replaceCSS_Plain, /* 70 ColourApproxIndex */ - replaceCSS_Plain, /* 71 RenderingColourModel */ - replaceCSS_Plain, /* 72 PSurfaceCharacteristics */ - replaceCSS_Plain, /* 73 AddToNameSet */ - replaceCSS_Plain, /* 74 RemoveFromNameSet */ - replaceCSS_Exec_Struct, /* 75 ExecuteStructure */ - replaceCSS_Plain, /* 76 Label */ - replaceCSS_Plain, /* 77 ApplicationData */ - replaceCSS_Plain, /* 78 Gse */ - replaceCSS_Plain, /* 79 Marker */ - replaceCSS_Plain, /* 80 Marker2D */ - replaceCSS_Plain, /* 81 Text */ - replaceCSS_Plain, /* 82 Text2D */ - replaceCSS_Plain, /* 83 AnnotationText */ - replaceCSS_Plain, /* 84 AnnotationText2D */ - replaceCSS_Plain, /* 85 Polyline */ - replaceCSS_Plain, /* 86 Polyline2D */ - replaceCSS_Plain, /* 87 PolylineSet */ - replaceCSS_Plain, /* 88 NurbCurve */ - replaceCSS_Plain, /* 89 FillArea */ - replaceCSS_Plain, /* 90 FillArea2D */ - replaceCSS_Plain, /* 91 ExtFillArea */ - replaceCSS_Plain, /* 92 FillAreaSet */ - replaceCSS_Plain, /* 93 FillAreaSet2D */ - replaceCSS_Plain, /* 94 ExtFillAreaSet */ - replaceCSS_Plain, /* 95 TriangleStrip */ - replaceCSS_Plain, /* 96 QuadrilateralMesh */ - replaceCSS_Plain, /* 97 SOFAS */ - replaceCSS_Plain, /* 98 NurbSurface */ - replaceCSS_Plain, /* 99 CellArray */ - replaceCSS_Plain, /* 100 CellArray2D */ - replaceCSS_Plain, /* 101 ExtCellArray */ - replaceCSS_Plain, /* 102 Gdp */ - replaceCSS_Plain, /* 103 Gdp2D */ - replaceCSS_Plain /* 104 Noop */ -}; - -cssTableType InquireCSSElementTable[] = { - inquireCSS_Plain, /* 0 Propietary */ - inquireCSS_Plain, /* 1 MarkerType */ - inquireCSS_Plain, /* 2 MarkerScale */ - inquireCSS_Plain, /* 3 MarkerColourIndex */ - inquireCSS_Plain, /* 4 MarkerColour */ - inquireCSS_Plain, /* 5 MarkerBundleIndex */ - inquireCSS_Plain, /* 6 TextFontIndex */ - inquireCSS_Plain, /* 7 TextPrecision */ - inquireCSS_Plain, /* 8 CharExpansion */ - inquireCSS_Plain, /* 9 CharSpacing */ - inquireCSS_Plain, /* 10 TextColourIndex */ - inquireCSS_Plain, /* 11 TextColour */ - inquireCSS_Plain, /* 12 CharHeight */ - inquireCSS_Plain, /* 13 CharUpVector */ - inquireCSS_Plain, /* 14 TextPath */ - inquireCSS_Plain, /* 15 TextAlignment */ - inquireCSS_Plain, /* 16 AtextHeight */ - inquireCSS_Plain, /* 17 AtextUpVector */ - inquireCSS_Plain, /* 18 AtextPath */ - inquireCSS_Plain, /* 19 AtextAlignment */ - inquireCSS_Plain, /* 20 AtextStyle */ - inquireCSS_Plain, /* 21 TextBundleIndex */ - inquireCSS_Plain, /* 22 LineType */ - inquireCSS_Plain, /* 23 LineWidth */ - inquireCSS_Plain, /* 24 LineColourIndex */ - inquireCSS_Plain, /* 25 LineColour */ - inquireCSS_Plain, /* 26 CurveApproximation */ - inquireCSS_Plain, /* 27 PolylineInterp */ - inquireCSS_Plain, /* 28 LineBundleIndex */ - inquireCSS_Plain, /* 29 InteriorStyle */ - inquireCSS_Plain, /* 30 InteriorStyleIndex */ - inquireCSS_Plain, /* 31 SurfaceColourIndex */ - inquireCSS_Plain, /* 32 SurfaceColour */ - inquireCSS_Plain, /* 33 SurfaceReflAttr */ - inquireCSS_Plain, /* 34 SurfaceReflModel */ - inquireCSS_Plain, /* 35 SurfaceInterp */ - inquireCSS_Plain, /* 36 BfInteriorStyle */ - inquireCSS_Plain, /* 37 BfInteriorStyleIndex */ - inquireCSS_Plain, /* 38 BfSurfaceColourIndex */ - inquireCSS_Plain, /* 39 BfSurfaceColour */ - inquireCSS_Plain, /* 40 BfSurfaceReflAttr */ - inquireCSS_Plain, /* 41 BfSurfaceReflModel */ - inquireCSS_Plain, /* 42 BfSurfaceInterp */ - inquireCSS_Plain, /* 43 SurfaceApproximation */ - inquireCSS_Plain, /* 44 CullingMode */ - inquireCSS_Plain, /* 45 DistinguishFlag */ - inquireCSS_Plain, /* 46 PatternSize */ - inquireCSS_Plain, /* 47 PatternRefPt */ - inquireCSS_Plain, /* 48 PatternAttr */ - inquireCSS_Plain, /* 49 InteriorBundleIndex */ - inquireCSS_Plain, /* 50 SurfaceEdgeFlag */ - inquireCSS_Plain, /* 51 SurfaceEdgeType */ - inquireCSS_Plain, /* 52 SurfaceEdgeWidth */ - inquireCSS_Plain, /* 53 SurfaceEdgeColourIndex */ - inquireCSS_Plain, /* 54 SurfaceEdgeColour */ - inquireCSS_Plain, /* 55 EdgeBundleIndex */ - inquireCSS_Plain, /* 56 SetAsfValues */ - inquireCSS_Plain, /* 57 LocalTransform */ - inquireCSS_Plain, /* 58 LocalTransform2D */ - inquireCSS_Plain, /* 59 GlobalTransform */ - inquireCSS_Plain, /* 60 GlobalTransform2D */ - inquireCSS_Plain, /* 61 ModelClip */ - inquireCSS_Plain, /* 62 ModelClipVolume */ - inquireCSS_Plain, /* 63 ModelClipVolume2D */ - inquireCSS_Plain, /* 64 RestoreModelClip */ - inquireCSS_Plain, /* 65 ViewIndex */ - inquireCSS_Plain, /* 66 LightState */ - inquireCSS_Plain, /* 67 DepthCueIndex */ - inquireCSS_Plain, /* 68 PickId */ - inquireCSS_Plain, /* 69 HlhsrIdentifier */ - inquireCSS_Plain, /* 70 ColourApproxIndex */ - inquireCSS_Plain, /* 71 RenderingColourModel */ - inquireCSS_Plain, /* 72 PSurfaceCharacteristics */ - inquireCSS_Plain, /* 73 AddToNameSet */ - inquireCSS_Plain, /* 74 RemoveFromNameSet */ - inquireCSS_Exec_Struct, /* 75 ExecuteStructure */ - inquireCSS_Plain, /* 76 Label */ - inquireCSS_Plain, /* 77 ApplicationData */ - inquireCSS_Plain, /* 78 Gse */ - inquireCSS_Plain, /* 79 Marker */ - inquireCSS_Plain, /* 80 Marker2D */ - inquireCSS_Plain, /* 81 Text */ - inquireCSS_Plain, /* 82 Text2D */ - inquireCSS_Plain, /* 83 AnnotationText */ - inquireCSS_Plain, /* 84 AnnotationText2D */ - inquireCSS_Plain, /* 85 Polyline */ - inquireCSS_Plain, /* 86 Polyline2D */ - inquireCSS_Plain, /* 87 PolylineSet */ - inquireCSS_Plain, /* 88 NurbCurve */ - inquireCSS_Plain, /* 89 FillArea */ - inquireCSS_Plain, /* 90 FillArea2D */ - inquireCSS_Plain, /* 91 ExtFillArea */ - inquireCSS_Plain, /* 92 FillAreaSet */ - inquireCSS_Plain, /* 93 FillAreaSet2D */ - inquireCSS_Plain, /* 94 ExtFillAreaSet */ - inquireCSS_Plain, /* 95 TriangleStrip */ - inquireCSS_Plain, /* 96 QuadrilateralMesh */ - inquireCSS_Plain, /* 97 SOFAS */ - inquireCSS_Plain, /* 98 NurbSurface */ - inquireCSS_Plain, /* 99 CellArray */ - inquireCSS_Plain, /* 100 CellArray2D */ - inquireCSS_Plain, /* 101 ExtCellArray */ - inquireCSS_Plain, /* 102 Gdp */ - inquireCSS_Plain, /* 103 Gdp2D */ - inquireCSS_Plain /* 104 Noop */ -}; Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miDynamics.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miDynamics.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level4/miDynamics.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miDynamics.c:1.9 Fri Dec 14 14:57:35 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miDynamics.c Sat Feb 28 21:41:55 2004 @@ -1,226 +0,0 @@ -/* $Xorg: miDynamics.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#include "ddpex.h" -#include "ddpex4.h" -#include "pexUtils.h" -#include "miWks.h" -#include "miStruct.h" -#include "miNS.h" - - -/*++ - | - | Function Name: miDealWithDynamics - | - | Function Description: - | Goes through each workstation in the given list and causes a Redraw - | of the workstation depending on the supplied dynamic and other values in - | the workstation state. - | - --*/ - - -ddpex4rtn -miDealWithDynamics(dynamic, pwksToLookAt) -/* in */ - ddDynamic dynamic; - listofObj *pwksToLookAt; -/* out */ -{ - register int i; - diWKSHandle *pWKS; - miWksPtr wksPtr; - ddpex4rtn err4 = Success; - - pWKS = (diWKSHandle *) pwksToLookAt->pList; - for (i = 0; i < pwksToLookAt->numObj; i++, pWKS++) { - - wksPtr = (miWksPtr) ((*pWKS)->deviceData); - - if (!wksPtr) continue; /* workstation has been freed */ - - switch (wksPtr->displayUpdate) { - case PEXVisualizeEach: - /* always make sure picture is correct */ - if ( (wksPtr->dynamics[(int) dynamic] != PEXIMM) - || (wksPtr->visualState != PEXCorrect)) { - if (err4 = RedrawStructures(*pWKS)) return (err4); - wksPtr->visualState = PEXCorrect; - } - break; - - case PEXVisualizeEasy: - case PEXVisualizeNone: - case PEXVisualizeWhenever: - /* - * for PEXIMM don't do anything (visual state doesn't change) - */ - if (wksPtr->dynamics[(int) dynamic] != PEXIMM) - /* IRG and CBS, the action is deferred */ - wksPtr->visualState = PEXDeferred; - break; - - case PEXSimulateSome: - - /* - * don't do anything if dynamic = PEXIMM (visual - * state doesn't change) - */ - if (wksPtr->dynamics[(int) dynamic] == PEXIRG) - /* the action is deferred */ - wksPtr->visualState = PEXDeferred; - else if (wksPtr->dynamics[(int) dynamic] == PEXCBS) - - /* - * the action should not be deferred and the - * simulation should be done when the action - * is done - */ - if (wksPtr->visualState != PEXDeferred) - wksPtr->visualState = PEXSimulated; - break; - } - } - return (Success); -} /* miDealWithDynamics */ - -/*++ - | - | Function Name: miDealWithStructDynamics - | - | Function Description: - | Goes through each workstation that the structure appears on, - | and causes a Redraw of the workstation depending on the supplied - | dynamic and other values in the workstation state. - | - --*/ - -ddpex4rtn -miDealWithStructDynamics(dynamic, pStruct) -/* in */ - ddDynamic dynamic; - diStructHandle pStruct; -/* out */ -{ - miStructPtr pstruct = (miStructPtr) pStruct->deviceData; - listofObj *pwksToLookAt; - ddpex4rtn err = Success; - - /** Build up a list of workstations from the PostedTo and AppearOn - ** lists in the structure structure. They are inserted in such a - ** manner that duplicates between the lists are eliminated. - **/ - - if (pstruct->wksPostedTo->numObj || pstruct->wksAppearOn->numObj) { - pwksToLookAt = puCreateList(DD_WKS); - if (!pwksToLookAt) return (BadAlloc); - err = puMergeLists( pstruct->wksPostedTo, pstruct->wksAppearOn, - pwksToLookAt); - - err = miDealWithDynamics(dynamic, pwksToLookAt); - puDeleteList(pwksToLookAt); - } - return (err); -} /* miDealWithStructDynamics */ - - -/*++ - | - | Function Name: miDealWithNSDynamics - | - | Function Description: - | Goes through each workstation that uses the name set - | and causes a Redraw of the workstation depending on the supplied - | dynamic and other values in the workstation state. - | - --*/ - -ddpex43rtn -miDealWithNSDynamics(pNS) -/* in */ - diNSHandle pNS; -/* out */ -{ - miNSHeader *pns = (miNSHeader *) pNS->deviceData; - listofObj *pwksToLookAt; - diWKSHandle *pWks; - miWksPtr pwks; - register int i; - ddpex43rtn err = Success; - - if (!pns->wksRefList->numObj) return (Success); - - pwksToLookAt = puCreateList(DD_WKS); - if (!pwksToLookAt) return (BadAlloc); - - pWks = (diWKSHandle *) pns->wksRefList->pList; - for (i = 0; i < pns->wksRefList->numObj; i++, pWks++) { - pwks = (miWksPtr) (*pWks)->deviceData; - if ( (pwks->pRend->ns[(int) DD_HIGH_INCL_NS] == pNS) - || (pwks->pRend->ns[(int) DD_HIGH_EXCL_NS] == pNS)) - err = puAddToList((ddPointer) pWks, (ddULONG) 1, pwksToLookAt); - } - - err = miDealWithDynamics(HIGH_FILTER_DYNAMIC, pwksToLookAt); - if (err == Success) { - pWks = (diWKSHandle *) pns->wksRefList->pList; - for (i = 0; i < pns->wksRefList->numObj; i++, pWks++) { - pwks = (miWksPtr) (*pWks)->deviceData; - if ( (pwks->pRend->ns[(int) DD_INVIS_INCL_NS] == pNS) - || (pwks->pRend->ns[(int) DD_INVIS_EXCL_NS] == pNS)) - err = puAddToList((ddPointer) pWks, (ddULONG) 1, pwksToLookAt); - } - - err = miDealWithDynamics(INVIS_FILTER_DYNAMIC, pwksToLookAt); - } - puDeleteList(pwksToLookAt); - - return (err); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c:1.9 Fri Dec 14 14:57:35 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c Sat Feb 28 21:41:55 2004 @@ -1,731 +0,0 @@ -/* $Xorg: miPick.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/miPick.c,v 1.9 2001/12/14 19:57:35 dawes Exp $ */ - -#include "miWks.h" /* miPickMeasureStr is defined in here */ -#include "miNS.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "pexUtils.h" -#include "PEXErr.h" -#include "pexExtract.h" -#include "pexos.h" - - -extern ddpex4rtn UpdateStructRefs(); -extern ddpex43rtn UpdateNSRefs(); -extern ddpex3rtn BeginStructure(); -extern ddpex3rtn EndStructure(); -static unsigned char * copy_pick_path_to_buffer(); -void path_update_struct_refs(); - -/* Level 4 Workstation Support */ -/* picking Procedures */ - -/*++ - | - | Function Name: InquirePickDevice - | - | Function Description: - | Handles the PEXGetPickDevice request. - | - | Note(s): - don't need pNumItems anymore, but it's not worth changing - the interface for now (post alpha release) - | - --*/ - -/* depends on mask, num, and dsize being declared */ -#define COUNTBYTES(type,bytes) \ - if (mask & (type)) \ - { \ - num++; \ - dsize += (bytes); \ - } - -ddpex4rtn -InquirePickDevice(pWKS, devType, mask, pNumItems, pBuffer) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddEnumTypeIndex devType; /* pick device type */ - ddBitmask mask; /* item bit mask */ -/* out */ - ddULONG *pNumItems; /* number of items in list */ - ddBufferPtr pBuffer; /* list of items */ -{ - - ddULONG num, dsize; - int dev_index; - register ddPointer pbuf; - - miPickDevice *pPickDevice; - -#ifdef DDTEST - ErrorF(" InquirePickDevice\n"); -#endif - - /* convert devType to index into devices array */ - MIWKS_PICK_DEV_INDEX(dev_index, devType); - - pPickDevice = &(((miWksPtr) pWKS->deviceData)->devices[dev_index]); - *pNumItems = 0; - - num = 0; - dsize = 0; - COUNTBYTES(PEXPDPickStatus, 4); - COUNTBYTES(PEXPDPickPath, 4 + (pPickDevice->path->numObj * 12)); - COUNTBYTES(PEXPDPickPathOrder, 4); - COUNTBYTES(PEXPDPickIncl, 4); - COUNTBYTES(PEXPDPickExcl, 4); - if (mask & PEXPDPickDataRec) - switch (dev_index) { - case 0: - num++; - dsize += MIWKS_SIZE_DATA_REC_1; - break; - case 1: - num++; - dsize += MIWKS_SIZE_DATA_REC_2; - break; - } - COUNTBYTES(PEXPDPickPromptEchoType, 4); - COUNTBYTES(PEXPDPickEchoVolume, sizeof(ddViewport)); - COUNTBYTES(PEXPDPickEchoSwitch, 4); - - /* Check the buffer size, and realloc if needed. */ - PU_CHECK_BUFFER_SIZE(pBuffer, dsize); - - *pNumItems = num; - pBuffer->dataSize = dsize; - pbuf = pBuffer->pBuf; - - if (mask & PEXPDPickStatus) { - PACK_CARD32(pPickDevice->status, pbuf); - } - - if (mask & PEXPDPickPath) { - PACK_CARD32(pPickDevice->path->numObj, pbuf); - pbuf = copy_pick_path_to_buffer(pPickDevice->path, pbuf); - } - - if (mask & PEXPDPickPathOrder) { - PACK_CARD32(pPickDevice->pathOrder, pbuf); - } - - if (mask & PEXPDPickIncl) { - ddULONG nsid; - if (pPickDevice->inclusion) - nsid = pPickDevice->inclusion->id; - else - nsid = 0; - PACK_CARD32(nsid, pbuf); - } - - if (mask & PEXPDPickExcl) { - ddULONG nsid; - if (pPickDevice->inclusion) - nsid = pPickDevice->exclusion->id; - else - nsid = 0; - PACK_CARD32(nsid, pbuf); - } - - /* - * no data recs are defined, so skip this - noone should expect to - * get data for this - */ - if (mask & PEXPDPickDataRec) { - /* Sun says no data records defined, this is dummy code - * switch (dev_index) { - * case 0: bcopy((char *) &(MIWKS_PICK_DATA_REC_1(pPickDevice)), - * (char *) pbuf, MIWKS_SIZE_DATA_REC_1); - * pbuf += MIWKS_SIZE_DATA_REC_1; - * break; - * case 1: bcopy((char *) &(MIWKS_PICK_DATA_REC_2(pPickDevice)), - * (char *) pbuf, MIWKS_SIZE_DATA_REC_2); - * pbuf += MIWKS_SIZE_DATA_REC_2; - * break; - * } - */ - /* if for some reason this bitflag is set return length - of zero bytes - */ - PACK_CARD32(0,pbuf); - } - - if (mask & PEXPDPickPromptEchoType) { - PACK_CARD32(pPickDevice->pet, pbuf); - } - if (mask & PEXPDPickEchoVolume) { - PACK_STRUCT(ddViewport,&(pPickDevice->echoVolume),pbuf); - } - if (mask & PEXPDPickEchoSwitch) { - PACK_CARD32(pPickDevice->echoSwitch,pbuf); - } - return (Success); -} /* InquirePickDevice */ - -/*++ - | - | Function Name: ChangePickDevice - | - | Function Description: - | Handles the PEXChangePickDevice request. - | - | Note(s): - | - --*/ - -ddpex4rtn -ChangePickDevice(pWKS, devType, mask, pItems) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddEnumTypeIndex devType;/* pick device type */ - ddBitmask mask; /* item bit mask */ - ddPointer pItems; /* list of items */ -{ - - register ddPointer pbuf; - int dev_index; - miPickDevice *pPickDevice; - CARD16 pickStatus; - CARD16 pickPathOrder; - CARD16 pickEchoSwitch; - INT16 pickPromptEchoType; - ddULONG numPickPath; - ddpex4rtn err; - extern ddpex4rtn ValidateStructurePath(); - -#ifdef DDTEST - ErrorF(" ChangePickDevice\n"); -#endif - - /* convert devType to index into devices array */ - MIWKS_PICK_DEV_INDEX(dev_index, devType); - - pPickDevice = &(((miWksPtr) pWKS->deviceData)->devices[dev_index]); - - pbuf = pItems; - - /* go through and check for errors first */ - if (mask & PEXPDPickStatus) { - EXTRACT_CARD16_FROM_4B(pickStatus,pbuf); - if (!((pickStatus == PEXNoPick) || (pickStatus == PEXOk))) - return (BadValue); - } - - if (mask & PEXPDPickPath) { - /* valid path is checked when it's set */ - EXTRACT_CARD32(numPickPath,pbuf); - SKIP_STRUCT(pbuf,numPickPath,ddPickPath); - } - - if (mask & PEXPDPickPathOrder) { - EXTRACT_CARD16_FROM_4B(pickPathOrder,pbuf); - if (!((pickPathOrder == PEXTopFirst)||(pickPathOrder == PEXBottomFirst))) - return (BadValue); - } - if (mask & PEXPDPickIncl) - SKIP_PADDING(pbuf,4); - - if (mask & PEXPDPickExcl) - SKIP_PADDING(pbuf,4); - - /* - * no data recs are defined, so skip the bytes if they're there - */ - if (mask & PEXPDPickDataRec) { - CARD32 i, skip; - EXTRACT_CARD32(i,pbuf); - skip = (i+3)/4; - SKIP_PADDING(pbuf,skip); - } - - if (mask & PEXPDPickPromptEchoType) { - EXTRACT_INT16_FROM_4B(pickPromptEchoType,pbuf); - switch (pickPromptEchoType) { - case PEXEchoPrimitive: - case PEXEchoStructure: - case PEXEchoNetwork: - break; - default: - return (BadValue); - } - } - - if (mask & PEXPDPickEchoVolume) - SKIP_PADDING(pbuf,sizeof(ddViewport)); - - if (mask & PEXPDPickEchoSwitch) { - EXTRACT_CARD16_FROM_4B(pickEchoSwitch,pbuf); - if (!((pickEchoSwitch == PEXOff) || (pickEchoSwitch == PEXOn))) - return (BadValue); - } - - /* now set the values */ - pbuf = pItems; - - if (mask & PEXPDPickStatus) { - pPickDevice->status = pickStatus; - SKIP_PADDING(pbuf,4); - } - - if (mask & PEXPDPickPath) { - SKIP_PADDING(pbuf,4); - - /* before putting this path in, remove structure ref - * count of current path - */ - if (pPickDevice->path->numObj) - path_update_struct_refs(pPickDevice->path, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - PU_EMPTY_LIST(pPickDevice->path); - - /* dipex changes struct ids to handles */ - puAddToList((ddPointer) pbuf, numPickPath, pPickDevice->path); - SKIP_STRUCT(pbuf,numPickPath,ddPickPath); - - /* - * now go through the path and update the structures's ref. count - */ - path_update_struct_refs( pPickDevice->path, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - /* make sure it's a valid path */ - err = ValidateStructurePath(pPickDevice->path); - if (err != Success) - return (err); - } - - if (mask & PEXPDPickPathOrder) { - pPickDevice->pathOrder = pickPathOrder; - SKIP_PADDING(pbuf,4); - } - - if (mask & PEXPDPickIncl) { - /* - * dipex looked up the nameset handle and passed it to here - */ - if (pPickDevice->inclusion != *(diNSHandle *)pbuf) { - if (pPickDevice->inclusion) - UpdateNSRefs( pPickDevice->inclusion, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - pPickDevice->inclusion = *(diNSHandle *) pbuf; - UpdateNSRefs( pPickDevice->inclusion, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - } - SKIP_PADDING(pbuf,4); - } - - if (mask & PEXPDPickExcl) { - /* - * dipex looked up the nameset handle and passed it to here - */ - if (pPickDevice->exclusion != *(diNSHandle *)pbuf) { - if (pPickDevice->exclusion) - UpdateNSRefs( pPickDevice->exclusion, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - pPickDevice->exclusion = *(diNSHandle *)pbuf; - UpdateNSRefs( pPickDevice->exclusion, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - } - SKIP_PADDING(pbuf,4); - } - - /* - * no data recs are defined, so skip this - there'd better not be any - * data there for these - */ - if (mask & PEXPDPickDataRec) { - /* This is dummy code from Sun, - * I am adding code to skip bytes if present - JSH - * switch (dev_index) { case 0: bcopy((char *) pbuf, (char *) - * &(MIWKS_PICK_DATA_REC_1(pPickDevice)), MIWKS_SIZE_DATA_REC_1); - * pbuf += MIWKS_SIZE_DATA_REC_1; break; case 1: bcopy((char *) pbuf, - * (char *) &(MIWKS_PICK_DATA_REC_2(pPickDevice)), - * MIWKS_SIZE_DATA_REC_2); pbuf += MIWKS_SIZE_DATA_REC_2; break; } - */ - - CARD32 i, skip; - EXTRACT_CARD32(i,pbuf); - skip = (i+3)/4; - SKIP_PADDING(pbuf,skip); - } - - if (mask & PEXPDPickPromptEchoType) { - pPickDevice->pet = pickPromptEchoType; - SKIP_PADDING(pbuf,4); - } - - if (mask & PEXPDPickEchoVolume) { - EXTRACT_STRUCT(1, ddViewport, &(pPickDevice->echoVolume), pbuf); - } - - if (mask & PEXPDPickEchoSwitch) { - pPickDevice->echoSwitch = pickEchoSwitch; - } - - return (Success); -} /* ChangePickDevice */ - -/*++ - | - | Function Name: UpdatePickMeasure - | - | Function Description: - | Handles the PEXUpdatePickMeasure request. - | - | Note(s): - | - --*/ - -ddpex4rtn -UpdatePickMeasure(pPM, size, pInput) -/* in */ - diPMHandle pPM; /* pick measure */ - ddULONG size; /* size of input record */ - ddPointer pInput; /* input record */ -/* out */ -{ - miPickMeasureStr *ppm = (miPickMeasureStr *) pPM->deviceData; - miWksStr *pwks = (miWksStr *) ppm->pWks->deviceData; - MIWKS_PM_INPUT_STR_1 *pIn1 = (MIWKS_PM_INPUT_STR_1 *)pInput; - MIWKS_PM_INPUT_STR_2 *pIn2 = (MIWKS_PM_INPUT_STR_2 *)pInput; - miTraverserState trav_state; - register ddOrdStruct *pos; - diStructHandle pstr; - ddULONG start_el; - ddULONG num_els; - ddpex4rtn err; - extern ddpex3rtn EndPicking(); - extern ddpex4rtn traverser(); - -#ifdef DDTEST - ErrorF(" UpdatePickMeasure\n"); -#endif - - if ((pwks->pRend->pDrawable == NULL) || - (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - if (!pwks->postedStructs.numStructs) - return (Success); - - switch (ppm->type) { - case PEXPickDeviceDC_HitBox: - MIWKS_PM_INPUT_REC_1(ppm) = *pIn1; - break; - case PEXPickDeviceNPC_HitVolume: - MIWKS_PM_INPUT_REC_2(ppm) = *pIn2; - break; - } - ppm->status = PEXNoPick; - - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - /* set to traverse all posted structs */ - pos = pwks->postedStructs.postruct; - pos = pos->next; - pstr = pos->pstruct; - start_el = 1; - num_els = MISTR_NUM_EL((miStructPtr) pstr->deviceData); - - - BeginPicking(pwks->pRend, pPM); - - /* traverse posted structs */ - do { - /* reset for each structure */ - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - - if (MISTR_NUM_EL((miStructPtr) pstr->deviceData)) { - BeginStructure(pwks->pRend, pstr->id); - - err = traverser( pwks->pRend, pstr, start_el, num_els, pPM, - (ddSCStr *)NULL, &trav_state); - - EndStructure(pwks->pRend); - } - if (pos) - if (pos = pos->next) { - pstr = pos->pstruct; - num_els = MISTR_NUM_EL((miStructPtr) pstr->deviceData); - } - } while (pos); - - EndPicking(pwks->pRend); - - if (ppm->status == PEXOk) { - /* now, update the structure ref counts */ - path_update_struct_refs(ppm->path, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - } else { - /* reset pick path??? */ - return(err); - } - - return (Success); -} /* UpdatePickMeasure */ - -/*++ - | - | Function Name: CreatePickMeasure - | - | Function Description: - | Handle the PEXCreatePickMeasure request - | - | Note(s): - | - --*/ - -extern void UpdateWksRefs(); - -ddpex4rtn -CreatePickMeasure(pWKS, devType, pPM) -/* in */ - diWKSHandle pWKS; - ddEnumTypeIndex devType;/* pick device type */ - diPMHandle pPM; /* pick measure handle */ -/* out */ -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - register miPickMeasureStr *ppm; - int dev_index; - register miPickDevice *pPickDevice; - -#ifdef DDTEST - ErrorF(" CreatePickMeasure\n"); -#endif - - MIWKS_PICK_DEV_INDEX(dev_index, devType); - - ppm = (miPickMeasureStr *) xalloc(sizeof(miPickMeasureStr)); - if (!ppm) return (BadAlloc); - - ppm->path = puCreateList(DD_PICK_PATH); - if (!ppm->path) { - xfree(ppm); - return (BadAlloc); - } - pPickDevice = &(pwks->devices[dev_index]); - - ppm->pWks = pWKS; - ppm->type = devType; - ppm->status = pPickDevice->status; - ppm->pathOrder = pPickDevice->pathOrder; - ppm->incl_handle = pPickDevice->inclusion; - ppm->excl_handle = pPickDevice->exclusion; - - if (ppm->incl_handle) - UpdateNSRefs( ppm->incl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - if (ppm->excl_handle) - UpdateNSRefs( ppm->excl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - - if (puCopyList(pPickDevice->path, ppm->path)) { - puDeleteList(ppm->path); - xfree(ppm); - return (BadAlloc); - } - /* now go through the path and update the structures' ref. count */ - path_update_struct_refs( ppm->path, (diResourceHandle) NULL, - PICK_RESOURCE, ADD); - - switch (dev_index) { - case 0: - MIWKS_PM_DATA_REC_1(ppm) = MIWKS_PD_DATA_REC_1(pPickDevice); - break; - case 1: - MIWKS_PM_DATA_REC_2(ppm) = MIWKS_PD_DATA_REC_2(pPickDevice); - break; - } - - /* no extra data for PEX-SI */ - ppm->devPriv = (ddPointer) NULL; - - UpdateWksRefs(pWKS, (diResourceHandle) ppm, PICK_RESOURCE, ADD); - pPM->deviceData = (ddPointer) ppm; - return (Success); -} - - -/*++ - | - | Function Name: FreePickMeasure - | - | Function Description: - | Handles the PEXFreePickMeasure request - | - | Note(s): - pick measure is not used by other resources, so delete it now - | - --*/ - -ddpex4rtn -FreePickMeasure(pPM, PMid) -/* in */ - diPMHandle pPM; /* pick measure */ - ddResourceId PMid; /* pick measure id */ -/* out */ -{ - register miPickMeasureStr *ppm = (miPickMeasureStr *) pPM->deviceData; - - if (ppm->devPriv) xfree(ppm->devPriv); - - /* go through the path and update the structures' ref. count */ - if (ppm->path) path_update_struct_refs( ppm->path, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - if (ppm->path) puDeleteList(ppm->path); - - if (ppm->pWks) - UpdateWksRefs(ppm->pWks, (diResourceHandle) ppm, PICK_RESOURCE, REMOVE); - - if (ppm->incl_handle) - UpdateNSRefs( ppm->incl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - if (ppm->excl_handle) - UpdateNSRefs( ppm->excl_handle, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - xfree(ppm); - xfree(pPM); - - return (Success); -} /* FreePickMeasure */ - -/*++ - | - | Function Name: InquirePickMeasure - | - | Function Description: - | Handles the PEXInquirePickMeasure request - | - | Note(s): - | - --*/ - -ddpex4rtn -InquirePickMeasure(pPM, itemMask, pNumItems, pBuffer) -/* in */ - diPMHandle pPM; /* pick measure */ - ddBitmask itemMask; /* pick item bit mask */ -/* out */ - ddULONG *pNumItems; /* number of items returned */ - ddBufferPtr pBuffer;/* return buffer */ -{ - register miPickMeasureStr *ppm = (miPickMeasureStr *) pPM->deviceData; - register ddULONG dsize = 0; - register ddPointer pbuf; - - *pNumItems = 0; - pBuffer->dataSize = 0; - - if (itemMask & PEXPMStatus) { - dsize += 4; - *pNumItems++; - } - if (itemMask & PEXPMPath) { - dsize += (4 + (ppm->path->numObj * 12)); - *pNumItems++; - } - PU_CHECK_BUFFER_SIZE(pBuffer, dsize); - pBuffer->dataSize = dsize; - pbuf = pBuffer->pBuf; - - if (itemMask & PEXPMStatus) { - PACK_CARD32(ppm->status,pbuf); - } - if (itemMask & PEXPMPath) { - PACK_CARD32(ppm->path->numObj,pbuf); - pbuf = copy_pick_path_to_buffer(ppm->path, pbuf); - } - return (Success); -} - -static unsigned char * -copy_pick_path_to_buffer(pPath, pBuf) - listofObj *pPath; - ddPointer pBuf; -{ - register int i; - ddPickPath *pp = (ddPickPath *)(pPath->pList); - unsigned char *ptr = pBuf; - - for (i = 0; i < pPath->numObj; i++, pp++) { - PACK_CARD32(pp->structure->id, ptr); - PACK_CARD32(pp->offset, ptr); - PACK_CARD32(pp->pickid, ptr); - } - return (ptr); -} - -/* pick devices and pick measures are counted */ -void -path_update_struct_refs(pPath, pResource, which, action) - listofObj *pPath; - diResourceHandle pResource; - ddResourceType which; - ddAction action; -{ - ddPickPath *pp = (ddPickPath *) pPath->pList; - register int i; - - for (i = 0; i < pPath->numObj; pp++, i++) - UpdateStructRefs(pp->structure, pResource, which, action); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c:1.10 Fri Dec 14 14:57:35 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c Sat Feb 28 21:41:55 2004 @@ -1,216 +0,0 @@ -/* $Xorg: miSC.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/miSC.c,v 1.10 2001/12/14 19:57:35 dawes Exp $ */ - - -#include "ddpex4.h" -#include "mipex.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "pexUtils.h" -#include "pexos.h" - - -/* Level 4 Workstation Support */ -/* Search Context procedures */ - -/*++ - | - | Function Name: SearchNetwork - | - | Function Description: - | Handles the PEXSearchNetwork request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SearchNetwork(pSC, pNumRefs, pBuffer) -/* in */ - ddSCStr *pSC; /* search context */ -/* out */ - ddULONG *pNumRefs; /* number of references returned in list */ - ddBufferPtr pBuffer;/* list of element references */ -{ - miTraverserState trav_state; - ddpex4rtn err = Success; - diStructHandle pstr; - register int i; - register pexElementRef *pb; - register ddElementRef *pr; - -#ifdef DDTEST - ErrorF(" SearchNetwork\n"); -#endif - - pSC->status = PEXNotFound; - *pNumRefs = 0; - - if (pSC->startPath->numObj) { - trav_state.exec_str_flag = ES_FOLLOW_SEARCH; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) pSC->startPath->pList; - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - } else - return (PEXERR(PEXPathError)); - - pstr = (diStructHandle) trav_state.p_curr_sc_el->structure; - - if (MISTR_NUM_EL((miStructPtr) pstr->deviceData)) { - ddRendererStr rend; - - /* init dummy renderer */ - rend.rendId = PEXAlreadyFreed; - rend.pPC = (ddPCPtr)NULL; - /* rend.drawExample = ?? */ - rend.pDrawable = (DrawablePtr)NULL; - rend.drawableId = 0; - rend.curPath = puCreateList(DD_ELEMENT_REF); - if ( !rend.curPath) - return(BadAlloc); - - rend.state = PEXIdle; - rend.tablesMask = 0; - rend.namesetsMask = 0; - rend.attrsMask = 0; - rend.tablesChanges = 0; - rend.namesetsChanges = 0; - rend.attrsChanges = 0; - - rend.lut[PEXMarkerBundleLUT] = 0; - rend.lut[PEXTextBundleLUT] = 0; - rend.lut[PEXLineBundleLUT] = 0; - rend.lut[PEXInteriorBundleLUT] = 0; - rend.lut[PEXEdgeBundleLUT] = 0; - rend.lut[PEXViewLUT] = 0; - rend.lut[PEXColourLUT] = 0; - rend.lut[PEXDepthCueLUT] = 0; - rend.lut[PEXLightLUT] = 0; - rend.lut[PEXColourApproxLUT] = 0; - rend.lut[PEXPatternLUT] = 0; - rend.lut[PEXTextFontLUT] = 0; - - rend.ns[(unsigned)DD_HIGH_INCL_NS] = 0; - rend.ns[(unsigned)DD_HIGH_EXCL_NS] = 0; - rend.ns[(unsigned)DD_INVIS_INCL_NS] = 0; - rend.ns[(unsigned)DD_INVIS_EXCL_NS] = 0; - - rend.hlhsrMode = PEXHlhsrOff; - rend.npcSubvolume.minval.x = 0.0; - rend.npcSubvolume.minval.y = 0.0; - rend.npcSubvolume.minval.z = 0.0; - rend.npcSubvolume.maxval.x = 1.0; - rend.npcSubvolume.maxval.y = 1.0; - rend.npcSubvolume.maxval.z = 1.0; - - /* can't use drawable, it doesn't exist. Is viewport needed?? - * what viewport to use? default is to use drawable - */ - rend.viewport.useDrawable = 0; - rend.viewport.minval.x = 0; - rend.viewport.minval.y = 0; - rend.viewport.minval.z = 0.0; - rend.viewport.maxval.x = 1; - rend.viewport.maxval.y = 1; - rend.viewport.maxval.z = 1.0; - rend.clipList = puCreateList( DD_DEVICE_RECT ); - if ( !rend.clipList ) { - puDeleteList( rend.curPath ); - return( BadAlloc ); - } - - rend.immediateMode = FALSE; - /* InitRenderer does some stuff not needed for Searching - * and since some of that stuff uses a drawable (and searching - * doesn't have one), a work-aroundis put in around the drawable - * code. * It may be good to sometime reevaluate this and find - * another way to deal with it. - */ - err = InitRenderer( &rend ); - if ( err != Success ) { - puDeleteList( rend.curPath ); - puDeleteList( rend.clipList ); - return( err ); - } - - BeginSearching(&rend, pSC); - - BeginStructure(&rend, pstr->id); - - /* always start at the first element in the structure */ - err = traverser(&rend, pstr, (ddULONG) 1, - MISTR_NUM_EL((miStructPtr) pstr->deviceData), - (diPMHandle) NULL, pSC, &trav_state); - - EndStructure(&rend); - - /* turn off searching */ - EndSearching(&rend); - - if (pSC->status == PEXFound) { - pBuffer->dataSize = pSC->startPath->numObj * sizeof(pexElementRef); - PU_CHECK_BUFFER_SIZE(pBuffer, pBuffer->dataSize); - pb = (pexElementRef *)pBuffer->pBuf; - pr = (ddElementRef *)pSC->startPath->pList; - for (i=pSC->startPath->numObj; i>0; i--, pb++, pr++) { - pb->structure = pr->structure->id; - pb->offset = pr->offset; - } - *pNumRefs = pSC->startPath->numObj; - } else - /* set start path to "not found" */ - pSC->startPath->numObj = 0; - } else - return (PEXERR(PEXPathError)); - - return (Success); -} /* SearchNetwork */ Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c:3.7 Fri Dec 14 14:57:35 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c Sat Feb 28 21:41:55 2004 @@ -1,2491 +0,0 @@ -/* $Xorg: miStruct.c,v 1.4 2001/02/09 02:04:11 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/miStruct.c,v 3.7 2001/12/14 19:57:35 dawes Exp $ */ - -#include "mipex.h" -#include "ddpex4.h" -#include "miStruct.h" -#include "PEXErr.h" -#include "PEXproto.h" -#include "pexError.h" -#include "pexUtils.h" -#include "miStrMacro.h" -#include "pexos.h" - - -/* Level 4 Workstation Support */ -/* Structure Procedures */ - -extern cssTableType CreateCSSElementTable[]; -extern cssTableType DestroyCSSElementTable[]; -extern cssTableType CopyCSSElementTable[]; -extern cssTableType ReplaceCSSElementTable[]; -extern cssTableType InquireCSSElementTable[]; - -extern ddBOOL miGetStructurePriority(); - -extern ddpex4rtn miDealWithStructDynamics(); -extern ddpex4rtn miDealWithDynamics(); - -void miPrintPath(); - -#define SET_STR_HEADER(pStruct, pheader) \ - register miStructPtr pheader = (miStructPtr) pStruct->deviceData - -#define DESTROY_STR_HEADER(pheader) \ - if (pheader->parents) puDeleteList(pheader->parents); \ - if (pheader->children) puDeleteList(pheader->children); \ - if (pheader->wksPostedTo) puDeleteList(pheader->wksPostedTo); \ - if (pheader->wksAppearOn) puDeleteList(pheader->wksAppearOn); \ - if (MISTR_ZERO_EL(pheader)) xfree(MISTR_ZERO_EL(pheader)); \ - if (MISTR_LAST_EL(pheader)) xfree(MISTR_LAST_EL(pheader)); \ - xfree(pheader) - -#define CHECK_DELETE(pHandle, pheader) \ - if ((pheader)->freeFlag && !(pheader)->refCount) { \ - DESTROY_STR_HEADER(pheader); \ - xfree(pHandle); \ - } - -/*++ - | - | Function Name: pos2offset - | - | Function Description: - | a utility function for converting whence, offset values to a valid - | structure offset - | - | Note(s): - | - --*/ - -static ddpex4rtn -pos2offset(pstruct, ppos, poffset) -/* in */ - miStructStr *pstruct;/* pointer to the structure involved */ - ddElementPos *ppos; /* the position information */ -/* out */ - ddULONG *poffset;/* the valid offset calculated from the - * postition */ -{ - ddUSHORT whence = ppos->whence; - ddLONG offset = ppos->offset, temp; - -#ifdef DDTEST - ErrorF(" POSITION : "); -#endif - - switch (whence) { - case PEXBeginning: - -#ifdef DDTEST - ErrorF("PEXBeginning, "); -#endif - - temp = offset; - break; - - case PEXCurrent: - -#ifdef DDTEST - ErrorF("PEXCurrent, "); -#endif - - temp = MISTR_CURR_EL_OFFSET(pstruct) + offset; - break; - - case PEXEnd: - -#ifdef DDTEST - ErrorF("End, "); -#endif - - /* numElements is the same as the last elements offset */ - temp = MISTR_NUM_EL(pstruct) + offset; - break; - - default: - -#ifdef DDTEST - ErrorF("Bad Value\n "); -#endif - - /* value error */ - return (BadValue); - break; - } - -#ifdef DDTEST - ErrorF("%d", offset); -#endif - - /* now check that the new offset is in range of the structure */ - if (temp < 0) - *poffset = 0; - else if (temp > MISTR_NUM_EL(pstruct)) - *poffset = MISTR_NUM_EL(pstruct); - else - *poffset = temp; - -#ifdef DDTEST - ErrorF(" = %d\n", *poffset); -#endif - - return (0); -} - -/*++ - | - | Function Name: CreateStructure - | - | Function Description: - | Handles the PEXCreateStructure request. - | - | Note(s): - | - --*/ - -ddpex4rtn -CreateStructure(pStruct) -/* in */ - diStructHandle pStruct;/* structure handle */ -/* out */ -{ - register miStructStr *pheader; - register miGenericElementPtr pelement; - -#ifdef DDTEST - ErrorF("\nCreateStructure %d\n", pStruct->id); -#endif - - pStruct->deviceData = NULL; - - if ((pheader = (miStructStr *) xalloc(sizeof(miStructStr))) == NULL) - return (BadAlloc); - - MISTR_EDIT_MODE(pheader) = PEXStructureInsert; - MISTR_NUM_EL(pheader) = 0; - MISTR_LENGTH(pheader) = 0; - - pheader->refCount = 0; - pheader->freeFlag = MI_FALSE; - - pheader->parents = pheader->children = pheader->wksPostedTo = pheader->wksAppearOn = NULL; - - pheader->parents = puCreateList(DD_STRUCT); - pheader->children = puCreateList(DD_STRUCT); - pheader->wksPostedTo = puCreateList(DD_WKS); - pheader->wksAppearOn = puCreateList(DD_WKS); - if ( !pheader->parents || !pheader->children - || !pheader->wksPostedTo || !pheader->wksAppearOn) { - DESTROY_STR_HEADER(pheader); - return (BadAlloc); - } - /* create dummy first and last elements */ - if ((pelement = (miGenericElementPtr)xalloc(sizeof(miGenericElementStr))) - == NULL) { - DESTROY_STR_HEADER(pheader); - return (BadAlloc); - } - MISTR_PREV_EL(pelement) = NULL; - MISTR_EL_TYPE(pelement) = PEXOCNil; - MISTR_EL_LENGTH(pelement) = 1; - MISTR_ZERO_EL(pheader) = MISTR_CURR_EL_PTR(pheader) = pelement; - MISTR_CURR_EL_OFFSET(pheader) = 0; - - if ((pelement = (miGenericElementPtr) xalloc(sizeof(miGenericElementStr))) - == NULL) { - DESTROY_STR_HEADER(pheader); - return (BadAlloc); - } - MISTR_EL_TYPE(pelement) = PEXOCNil; - MISTR_EL_LENGTH(pelement) = 1; - MISTR_PREV_EL(pelement) = MISTR_ZERO_EL(pheader); - MISTR_NEXT_EL(pelement) = NULL; - MISTR_NEXT_EL(MISTR_ZERO_EL(pheader)) = pelement; - MISTR_LAST_EL(pheader) = pelement; - - pStruct->deviceData = (ddPointer) pheader; - return (Success); -} /* CreateStructure */ - -/*++ - | - | Function Name: CopyStructure - | - | Function Description: - | Handles the PEXCopyStructure request. - | - | Note(s): - | - --*/ - -ddpex4rtn -CopyStructure(pSrcStruct, pDestStruct) -/* in */ - diStructHandle pSrcStruct; /* source structure */ - diStructHandle pDestStruct; /* destination structure */ -{ - SET_STR_HEADER(pSrcStruct, psource); - SET_STR_HEADER(pDestStruct, pdest); - ddpex4rtn err = Success; - ddElementRange sourceRange; - ddElementPos destPos; - miGenericElementPtr pel; - register ddULONG i; - -#ifdef DDTEST - ErrorF("\nCopyStructure\n"); -#endif - - /* to do: make this smarter so it can use Replace if possible */ - - i = MISTR_NUM_EL(pdest); - MISTR_DEL_ELS(pDestStruct, pdest, 1, i); /* can't use NUM_EL macro here - * because the num of els - * changes as they are deleted */ - - MISTR_CURR_EL_OFFSET(pdest) = 0; - MISTR_CURR_EL_PTR(pdest) = MISTR_ZERO_EL(pdest); - - sourceRange.position1.whence = PEXBeginning; - sourceRange.position1.offset = 0; - sourceRange.position2.whence = PEXEnd; - sourceRange.position2.offset = 0; - destPos.whence = PEXBeginning; - destPos.offset = 0; - - /* Copy Elements will redraw picture if nec */ - if (err = CopyElements(pSrcStruct, &sourceRange, pDestStruct, &destPos) - != Success) - return (err); - - MISTR_EDIT_MODE(pdest) = MISTR_EDIT_MODE(psource); - MISTR_CURR_EL_OFFSET(pdest) = MISTR_CURR_EL_OFFSET(psource); - - MISTR_FIND_EL(pdest, MISTR_CURR_EL_OFFSET(pdest), pel); - MISTR_CURR_EL_PTR(pdest) = pel; - - return (Success); -} /* CopyStructure */ - -/* find_execute_structure looks for the specified execute structure element - * If the specified structure is NULL, then it finds the next one. - * If the element is found, its offset from the start is returned in poffset - * When calling this repeatedly to look for all occurrences of the element, - * be sure to check that you've reached the end of the structure. Otherwise - * you would infinitely loop on finding the last element if it is a match. - */ -static ddpex4rtn -find_execute_structure(pStruct, pStartPos, structHandle, poffset) -diStructHandle pStruct;/* search this structure */ -ddElementPos *pStartPos; -diStructHandle structHandle; /* for this exec structure element */ -ddULONG *poffset; -{ - SET_STR_HEADER(pStruct, pstruct); - ddUSHORT foundExecuteElement; - ddUSHORT executeStructureElement = PEXOCExecuteStructure; - miGenericElementPtr pel; - ddpex4rtn err = Success; - - while (err == Success) { - /** Get the position of the next execute structure element **/ - err = ElementSearch( pStruct, pStartPos, (ddULONG) PEXForward, - (ddULONG) 1, (ddULONG) 0, - &executeStructureElement, (ddUSHORT *) NULL, - &foundExecuteElement, poffset); - - if (foundExecuteElement == PEXFound) { - MISTR_FIND_EL(pstruct, *poffset, pel); - - if ( (structHandle == (diStructHandle) MISTR_GET_EXSTR_STR(pel)) - || (structHandle == (diStructHandle) NULL)) - return (PEXFound); - - /* - * continue searching at the next element unless this one - * was the last - */ - if (*poffset == MISTR_NUM_EL(pstruct)) return (PEXNotFound); - - pStartPos->whence = PEXBeginning; - pStartPos->offset = *poffset + 1; - } else - return (PEXNotFound); - - } - if (err != Success) return (PEXNotFound); - return (PEXFound); -} - -/*++ - | - | Function Name: DeleteStructureRefs - | - | Function Description: - | Handles the PEXDeleteStructures request. - | - | This routine deletes all structure elements in all of the - | structures which reference the specified structure. It is called - | by DeleteStructure. - | - | Note(s): - | This does not correct the picture because it is called by - | DeleteStructure, which does correct it - | - --*/ - -ddpex4rtn -DeleteStructureRefs(pStruct) -/* in */ - diStructHandle pStruct;/* structure handle */ -/* out */ -{ - - SET_STR_HEADER(pStruct, pstruct); - diStructHandle parentHandle; - miStructPtr pparentStruct; - ddElementPos position; - miGenericElementPtr newPointer; - miGenericElementPtr pel, pprevel; - ddLONG newOffset; - ddULONG offsetFromStart, numParents; - -#ifdef DDTEST - ErrorF("\nDeleteStructureRefs of structure %d\n", pStruct->id); -#endif /* DDTEST */ - - /** Search through each of the structure's parents **/ - - /* - * The tricky part here is that each time the execute structure - * element is deleted from the parent, the structure's parent list - * changes (in DeleteElements) so, remember how many parents there - * originally are and look at that many. Each time a parent is - * deleted from the list, it's always deleted from the front of the - * list, so the next parent will be at the front of the list the next - * time through - */ - for (numParents = pstruct->parents->numObj; numParents > 0;) { - parentHandle = *(diStructHandle *) pstruct->parents->pList; - - /* - * look through all of this structure's elements to delete - * all references to the structure being deleted - */ - pparentStruct = (miStructPtr) (parentHandle)->deviceData; - - newOffset = 0; - newPointer = NULL; - - /* - * look for all execute structure (child) elements in the - * parent structure and delete them this could do only one - * element at a time. any other elements would be gotten - * later because the parent is duplicated in the childs list - * for each occurrence and the outer loop would find the - * parent again. - */ - /* start looking at the beginning of the parent structure */ - position.whence = PEXBeginning; - position.offset = 0; - - /* - * dont' forget we're really comparing the structure handles - * because the id was replaced with the handle in the exec - * str elements - */ - while (find_execute_structure( parentHandle, &position, pStruct, - &offsetFromStart) - == PEXFound) { - if (offsetFromStart == MISTR_CURR_EL_OFFSET(pparentStruct)) { - newOffset = MISTR_CURR_EL_OFFSET(pparentStruct) - 1; - newPointer = MISTR_PREV_EL(MISTR_CURR_EL_PTR(pparentStruct)); - } else if (offsetFromStart < MISTR_CURR_EL_OFFSET(pparentStruct)) { - newOffset = MISTR_CURR_EL_OFFSET(pparentStruct) - 1; - newPointer = MISTR_CURR_EL_PTR(pparentStruct); - } else { - newOffset = MISTR_CURR_EL_OFFSET(pparentStruct); - newPointer = MISTR_CURR_EL_PTR(pparentStruct); - } - - MISTR_FIND_EL(pparentStruct, offsetFromStart, pel); - pprevel = MISTR_PREV_EL(pel); - - MISTR_DEL_ONE_EL(parentHandle, pprevel, pel); - - MISTR_CURR_EL_PTR(pparentStruct) = newPointer; - MISTR_CURR_EL_OFFSET(pparentStruct) = newOffset; - - numParents--; - - /* - * continue looking for other execute structures - * after the one found but it just got deleted, so - * the next one is now the same offset as the old one - */ - position.whence = PEXBeginning; - position.offset = offsetFromStart; - } - - } - - return (Success); -} /* DeleteStructureRefs */ - -/*++ - | - | Function Name: DeleteStructure - | - | Function Description: - | Deletes all storage associated with the structure - | - | Note(s): - | - --*/ - -ddpex4rtn -DeleteStructure(pStruct, Sid) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddResourceId Sid; /* structure resource id */ -/* out */ -{ - SET_STR_HEADER(pStruct, pheader); - register ddULONG i, imax; - diWKSHandle pwks; - ddpex4rtn err = Success, next_err = Success; - listofObj *pwksToLookAt; - -#ifdef DDTEST - ErrorF("\nDeleteStructure %d\n", pStruct->id); -#endif - - /* - * Errors are ignored to try to delete and update as much info as possible; - * however, if an error is found, the last error detected is returned. - */ - - /* - * Save the posted to list before unposting this structure so wks - * pictures can be updated if necessary. - */ - /* Do this here before the parent and children lists are changed. */ - - /** Build up a list of workstations from the PostedTo and AppearOn - ** lists in the structure structure. They are inserted in such a - ** manner so that duplicates between the lists are eliminated. - **/ - - pwksToLookAt = (listofObj *) NULL; - - if (pheader->wksPostedTo->numObj || pheader->wksAppearOn->numObj) { - pwksToLookAt = puCreateList(DD_WKS); - if (!pwksToLookAt) err = BadAlloc; - else - err = puMergeLists( pheader->wksPostedTo, pheader->wksAppearOn, - pwksToLookAt); - } - - /* - * This changes the structures posted to list (because unpost removes - * the wks from this list) so always get the first wks from the list. - */ - imax = pheader->wksPostedTo->numObj; - for (i = 0; i < imax; i++) { - pwks = ((diWKSHandle *) pheader->wksPostedTo->pList)[0]; - next_err = UnpostStructure(pwks, pStruct); - } - - /* - * Now, delete all of the references to this struct (i.e. remove this - * structure from its parents). - */ - next_err = DeleteStructureRefs(pStruct); - if (next_err != Success) err = next_err; - - /* loop through to delete all of the elements */ - i = MISTR_NUM_EL(pheader); - MISTR_DEL_ELS(pStruct, pheader, 1, i); - - /* now redraw picture for all workstations (determined above) */ - if (pwksToLookAt) { - next_err = miDealWithDynamics(DELETE_STR_DYNAMIC, pwksToLookAt); - if (next_err != Success) err = next_err; - puDeleteList(pwksToLookAt); - } - - /* - * Don't delete the structure until sc and pick resources aren't using it. - */ - pStruct->id = PEXAlreadyFreed; - pheader->freeFlag = MI_TRUE; - CHECK_DELETE(pStruct, pheader); - - return (err); -} /* DeleteStructure */ - -/*++ - | - | Function Name: InquireStructureInfo - | - | Function Description: - | Handles the PEXGetStructureInfo request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireStructureInfo(fpFormat, pStruct, itemMask, pEditMode, pElOffset, pNumElements, pLength, pHasRefs) -/* in */ - ddEnumTypeIndex fpFormat; - diStructHandle pStruct; /* structure handle */ - ddBitmask itemMask; -/* out */ - ddUSHORT *pEditMode; /* edit mode */ - ddULONG *pElOffset; /* current element pointer */ - ddULONG *pNumElements; /* number of elements in structure */ - ddULONG *pLength; /* total size of structure */ - ddUSHORT *pHasRefs; /* is structure referenced by others */ -{ - SET_STR_HEADER(pStruct, pheader); - -#ifdef DDTEST - ErrorF("\nInquireStructureInfo of %d\n", pStruct->id); -#endif - - /* Since all info is easily available and this is a fixed-length - * request, ignore itemMask (to the dismay of lint). - */ - *pEditMode = MISTR_EDIT_MODE(pheader); - *pElOffset = MISTR_CURR_EL_OFFSET(pheader); - *pNumElements = MISTR_NUM_EL(pheader); - - /* - * test here: if fpFormat is double precision, then recalculate - * length - */ - *pLength = MISTR_LENGTH(pheader); - *pHasRefs = MISTR_NUM_PARENTS(pheader) != 0; - return (Success); -} /* InquireStructureInfo */ - -/*++ - | - | Function Name: InquireElementInfo - | - | Function Description: - | Handles the PEXGetElementInfo request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireElementInfo(pStruct, pRange, pNumElements, pBuffer) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementRange *pRange; /* element range */ -/* out */ - ddULONG *pNumElements; /* number of items in list */ - ddBufferPtr pBuffer;/* list of element information */ -{ - SET_STR_HEADER(pStruct, pheader); - ddULONG offset1, offset2, needbytes, i; - int peisize; - ddPointer pbuf; - miGenericElementPtr pel; - -#ifdef DDTEST - ErrorF("\nInquireElementInfo %d\n", pStruct->id); -#endif - - peisize = sizeof(pexElementInfo); - - if (pos2offset(pheader, &(pRange->position1), &offset1)) - return (BadValue); /* bad whence value */ - - if (pos2offset(pheader, &(pRange->position2), &offset2)) - return (BadValue); /* bad whence value */ - - if (offset1 > offset2) { - i = offset1; - offset1 = offset2; - offset2 = i; - } - - if (offset1 == 0) - if (offset2 == 0) - return(Success); - else - offset1 = 1; - - - /* make sure buffer is large enough */ - needbytes = (offset2 - offset1 + 1) * peisize; - PU_CHECK_BUFFER_SIZE(pBuffer, needbytes); - - pbuf = pBuffer->pBuf; - - MISTR_FIND_EL(pheader, offset1, pel); - - /* - * remember that element data is required to have the type & length - * first so this is portable - */ - for (i = offset1; i <= offset2; i++, pbuf += peisize) { - mibcopy(&MISTR_EL_DATA(pel), pbuf, peisize); - pel = MISTR_NEXT_EL(pel); - } - - *pNumElements = offset2 - offset1 + 1; - pBuffer->dataSize = *pNumElements * peisize; - - return (Success); -} /* InquireElementInfo */ - -static ddpex4rtn -get_structure_net(pStruct, plist) - diStructHandle pStruct; - listofObj *plist; -{ - SET_STR_HEADER(pStruct, pheader); - register int i; - register diStructHandle *pchild; - - /* put this structure on the list */ - if (puAddToList((ddPointer) & pStruct, (ddULONG) 1, plist) == - MI_ALLOCERR) - return (BadAlloc); - - /* loop through all of the children of this structure */ - pchild = (diStructHandle *) pheader->children->pList; - for (i = 0; i < pheader->children->numObj; i++, pchild++) - if (get_structure_net(*pchild, plist) == BadAlloc) - return (BadAlloc); - - return (Success); -} - -/*++ - | - | Function Name: InquireStructureNetwork - | - | Function Description: - | Handles the PEXGetStructuresInNetwork request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireStructureNetwork(pStruct, which, pNumSids, pBuffer) -/* in */ - diStructHandle pStruct; /* structure handle */ - ddUSHORT which; /* which structures to inquire */ -/* out */ - ddULONG *pNumSids; /* number of ids in list */ - ddBufferPtr pBuffer; /* list of structure ids */ -{ - register int i, j, num; - ddResourceId *pbuf; - ddStructResource **pstruct, **pparent; - listofObj *plist1, *plist2; - ddBOOL removing; - -#ifdef DDTEST - ErrorF("\nInquireStructureNetwork\n"); -#endif - - pBuffer->dataSize = 0; - *pNumSids = 0; - - plist1 = puCreateList(DD_STRUCT); - if (!plist1) return (BadAlloc); - - plist2 = puCreateList(DD_STRUCT); - if (!plist2) { - puDeleteList(plist1); - return (BadAlloc); - } - - if (get_structure_net(pStruct, plist1) != Success) { - puDeleteList(plist1); - puDeleteList(plist2); - return (BadAlloc); - } - /* now, make the list unique */ - puMergeLists(plist1, plist2, plist2); - - /* adjust for orphans if requested */ - if (which == PEXOrphans) { - - /* - * Look at the parents of each structure in list 3 if any parent is - * not in the list, then that structure is not an orphan (i.e., it - * is referenced by a structure not in this net), so remove it from - * the list. - * - * This is a pain though, because we aren't guaranteed that all - * parents of a structure precede it in the list; e.g., if plist2 - * for the network below starting at A is A, B, C, D, then when C - * is reached, both of its parents (B & D) are in the list, so it - * won't be deleted. But when D is reached, (after C) it will have - * parent E not in the list, so D will be deleted. Now C should be - * deleted also. - * - * A E / \ / B D \ / C - * - * My solution to this is to loop through plist2 multiple times until - * it is gone through once without any structs being deleted from it. - * If you have a better algorithm for this, then tell me about it. - * One solution is to guarantee the list has all parents in it before - * their children. I can't think of a way to do this, however. - */ - removing = MI_TRUE; - while (removing) { - removing = MI_FALSE; - pstruct = (ddStructResource **) plist2->pList; - - /* - * Note, while going through the list, it may be changed, so be - * careful of when pstruct gets incremented and be sure num - * reflects the original size of the list, not any changes made - * to it. - */ - num = plist2->numObj; - for (i = 0; i < num; i++, pstruct++) { - pparent = (ddStructResource **)((miStructPtr)(*pstruct)->deviceData)->parents->pList; - for ( j = 0; - j < ((miStructPtr)(*pstruct)->deviceData)->parents->numObj; - j++, pparent++) { - if (!puInList((ddPointer) pparent, plist2)) { - - /* - * This struct is not an orphan. - */ - puRemoveFromList((ddPointer) pstruct, plist2); - removing = MI_TRUE; - - /* - * Decrement the pointer so when it gets incremented - * in the for loop, it points to where the deleted - * struct was, - */ - pstruct--; - break; - } - } - } - } - } - /* now, return the structure ids */ - if (PU_BUF_TOO_SMALL(pBuffer, plist2->numObj * sizeof(ddResourceId))) { - if (puBuffRealloc(pBuffer, (ddULONG) plist2->numObj) != Success) { - pBuffer->dataSize = 0; - puDeleteList(plist1); - puDeleteList(plist2); - return (BadAlloc); - } - } - *pNumSids = plist2->numObj; - pbuf = (ddResourceId *) pBuffer->pBuf; - pstruct = (ddStructResource **) plist2->pList; - for (i = 0; i < plist2->numObj; i++, pbuf++, pstruct++) - *pbuf = (*pstruct)->id; - - pBuffer->dataSize = plist2->numObj * sizeof(ddResourceId); - - puDeleteList(plist1); - puDeleteList(plist2); - return (Success); -} /* InquireStructureNetwork */ - - -/* bufSave is the size of the buffer header when the buffer is - * passed into inq ancestors/descendants. the pBuf pointer - * is changed as paths are added to the buffers and bufSave - * is used to find where pBuf originally started - */ -static int bufSave; - -#define MI_ANCESTORS 0 -#define MI_DESCENDANTS 1 - -/* given a path, which is a list of descendants (in top-down order) - * or ancestors (in bottom-down order), see if the depth-length - * pathPart part of the list matches any of the lists already - * put in the buffer. If it doesn't, then it's unique and this - * proc returns MI_TRUE, else it returns MI_FALSE - */ -static ddBYTE -path_unique(pathPart, depth, pNumLists, pBuffer, pPath, which) - ddUSHORT pathPart; - ddULONG depth; - ddULONG *pNumLists; - ddBufferPtr pBuffer; - listofObj *pPath; /* current path */ - ddSHORT which; -{ - register int i, j; - ddPointer pb; - ddULONG *ll; - ddElementRef *pref, *ppath, *pathstart; - ddBYTE match; - - if (!depth || pPath->numObj < depth) depth = pPath->numObj; - - pb = pBuffer->pHead + bufSave; - pathstart = (ddElementRef *) pPath->pList; - if (which == MI_DESCENDANTS) - pathstart += (pathPart == PEXTopPart) ? 0 : pPath->numObj - depth; - else - pathstart += ((pathPart == PEXTopPart) ? pPath->numObj - 1 : depth - 1); - - for (i = 0; i < *pNumLists; i++) { - ll = (ddULONG *) pb; - pb += 4; - pref = (ddElementRef *) pb; - ppath = pathstart; - match = MI_TRUE; - if (*ll == depth) { - if (which==MI_DESCENDANTS) {/* descendants: increment through path */ - for (j = 0; (j < *ll && match); j++, pref++, ppath++) { - if ( (ppath->structure != pref->structure) - || (ppath->offset != pref->offset)) - match = MI_FALSE; - } - } else {/* ancestors: decrement through path */ - for (j = 0; (j < *ll && match); j++, pref++, ppath--) { - if ( (ppath->structure != pref->structure) - || (ppath->offset != pref->offset)) - match = MI_FALSE; - } - } - } - pb += *ll * sizeof(ddElementRef); - if (match) return (MI_FALSE); - } - - return (MI_TRUE); -} - -static ddpex4rtn -copy_list_to_buf(pathPart, depth, pNumLists, pBuffer, pPath, which) - ddUSHORT pathPart; - ddULONG depth; - ddULONG *pNumLists; - ddBufferPtr pBuffer; - listofObj *pPath; - ddSHORT which; -{ - ddUSHORT listsize; - ddULONG *pb; - ddElementRef *pref, *pbref; - - if (!depth || (pPath->numObj < depth)) - depth = pPath->numObj; - listsize = depth * sizeof(ddElementRef); - PU_CHECK_BUFFER_SIZE(pBuffer, listsize + 4); - - pb = (ddULONG *) pBuffer->pBuf; - *pb++ = depth; - pref = (ddElementRef *) pPath->pList; - if (which == MI_DESCENDANTS) { - if (pathPart == PEXTopPart) - mibcopy(pref, pb, listsize); - else { - pbref = (ddElementRef *) pb; - pref += pPath->numObj - 1; - while (depth--) - *pbref++ = *pref--; - } - } else { - if (pathPart == PEXBottomPart) - mibcopy(pref, pb, listsize); - else { - pbref = (ddElementRef *) pb; - pref += pPath->numObj - 1; - while (depth--) - *pbref++ = *pref--; - } - } - (*pNumLists)++; - pBuffer->pBuf += listsize + 4; - pBuffer->dataSize += listsize + 4; - - return (Success); -} - -static ddpex4rtn -get_ancestors(pStruct, pathPart, depth, pNumLists, pBuffer, pPath) - diStructHandle pStruct; - ddUSHORT pathPart; - ddULONG depth; - ddULONG *pNumLists; - ddBufferPtr pBuffer; - listofObj *pPath; /* current path */ -{ - SET_STR_HEADER(pStruct, pheader); - diStructHandle pParent; - miStructPtr pparent; - register int num; - ddElementRef newref; - ddULONG offset; - ddElementPos position; - ddpex4rtn err; - listofObj *singleparents; - - /* start out with the current struct */ - if (!pPath->numObj) { - newref.structure = (diStructHandle) pStruct->id; - newref.offset = 0; - if (puAddToList((ddPointer) & newref, (ddULONG) 1, pPath) != Success) - return (BadAlloc); - } - /* we're at the root or have gone far enough */ - num = pheader->parents->numObj; - if (!num || ((pathPart==PEXBottomPart) && depth && (pPath->numObj==depth))) { - if ( (pathPart == PEXTopPart) && depth && (pPath->numObj > depth) - && !path_unique( pathPart, depth, pNumLists, pBuffer, pPath, - MI_ANCESTORS)) - - /* - * if path is top first and has to be truncated to depth, don't - * add it to the buffer unless it's unique - */ - err = Success; - else - err = copy_list_to_buf( pathPart, depth, pNumLists, pBuffer, pPath, - MI_ANCESTORS); - -/*>>> pPath->numObj--; */ - return (err); - } - - /* take duplicates out of the list of parents */ - singleparents = puCreateList(DD_STRUCT); - if (!singleparents) return (BadAlloc); - - if (puMergeLists(pheader->parents, singleparents, singleparents) != Success) - return (BadAlloc); - - num = singleparents->numObj; - while (num--) { - pParent = ((diStructHandle *) singleparents->pList)[num]; - pparent = (miStructPtr) pParent->deviceData; - - /* - * now, look for each execute structure of this structure in the parent - */ - position.whence = PEXBeginning; - position.offset = 0; - - while (find_execute_structure(pParent, &position, pStruct, &offset) - == PEXFound) { - - newref.structure = (diStructHandle) pParent->id; - newref.offset = offset; - if (puAddToList((ddPointer) & newref, (ddULONG) 1, pPath) != Success) - return (BadAlloc); - - /* - * get the ancestors of this parent struct - */ - if (err = get_ancestors( pParent, pathPart, depth, pNumLists, - pBuffer, pPath) != Success) - return (err); - - /* - * go on to get the next exec struct element in the parent - */ - position.whence = PEXBeginning; - position.offset = offset + 1; - - /* - * Remove previous parent/ofset from the pathlist so the same - * pathlist can be used for the next path. - */ - pPath->numObj--; - - /* - * if the last one found was the last element in the - * struct, don't continue - */ - if (offset == MISTR_NUM_EL(pparent)) break; - - } /* end while finding execute structure elements in the parent */ - } /* end while (num--): while this child has parents to look at */ - - puDeleteList(singleparents); - - return (Success); -} - -static ddpex4rtn -get_descendants(pStruct, pathPart, depth, pNumLists, pBuffer, pPath) - diStructHandle pStruct; - ddUSHORT pathPart; - ddULONG depth; - ddULONG *pNumLists; - ddBufferPtr pBuffer; - listofObj *pPath; /* current path */ -{ - SET_STR_HEADER(pStruct, pheader); - register int num; - ddElementRef newref; - diStructHandle newstruct; - ddULONG offset; - ddElementPos position; - ddpex4rtn err; - miGenericElementPtr pel; - - /* if we're at the end of the path put the path in the buffer */ - num = pheader->children->numObj; - if (!num || ((pathPart == PEXTopPart) && depth && (pPath->numObj == depth))){ - /* add this structure to the path */ - - /* - * don't need to do this if (pathPart == PEXTopPart) && depth - * && (pPath->numObj == depth), but it's ok to do it because - * it won't get put into the buffer - */ - newref.structure = (diStructHandle) pStruct->id; - newref.offset = 0; - if (puAddToList((ddPointer) & newref, (ddULONG) 1, pPath) != Success) - return (BadAlloc); - - if ( (pathPart == PEXBottomPart) && depth && (pPath->numObj > depth) - && !path_unique( pathPart, depth, pNumLists, pBuffer, pPath, - MI_DESCENDANTS)) - - /* - * If path is bottom first and has to be truncated to depth, - * don't add it to the buffer unless it's unique. - */ - err = Success; - else - err = copy_list_to_buf( pathPart, depth, pNumLists, pBuffer, pPath, - MI_DESCENDANTS); - - pPath->numObj--; - return (err); - } - - /* now, look for each execute structure element in the structure */ - position.whence = PEXBeginning; - position.offset = 0; - while (find_execute_structure( pStruct, &position, (diStructHandle) NULL, - &offset) - == PEXFound) { - newref.structure = (diStructHandle) pStruct->id; - newref.offset = offset; - if (puAddToList((ddPointer) & newref, (ddULONG) 1, pPath) != Success) - return (BadAlloc); - - /* - * get the descendants of this child struct remember, - */ - MISTR_FIND_EL(pheader, offset, pel); - - newstruct = (diStructHandle) MISTR_GET_EXSTR_STR(pel); - if (err = get_descendants( newstruct, pathPart, depth, pNumLists, - pBuffer, pPath) != Success) - return (err); - - /* go on to get the next child */ - position.whence = PEXBeginning; - position.offset = offset + 1; - - /* - * remove previous child from the pathlist so the same - * pathlist can be used for the next path - */ - pPath->numObj--; - - /* - * if the last one found was the last element in the struct, - * don't continue - */ - if (offset == MISTR_NUM_EL(pheader)) break; - } - - return (Success); -} - -/*++ - | - | Function Name: InquireAncestors - | - | Function Description: - | Handles the PEXGetAncestors request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireAncestors(pStruct, pathPart, depth, pNumLists, pBuffer) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddUSHORT pathPart; /* which paths to return */ - ddULONG depth; /* how deep to search */ -/* out */ - ddULONG *pNumLists; /* number of lists returned */ - ddBufferPtr pBuffer;/* list of lists of element refs */ -{ - listofObj *pathlist; - ddpex4rtn err; - -#ifdef DDTEST - ErrorF("\nInquireAncestors\n"); -#endif - - bufSave = PU_BUF_HDR_SIZE(pBuffer); - pBuffer->dataSize = 0; - *pNumLists = 0; - - pathlist = puCreateList(DD_ELEMENT_REF); - if (!pathlist) return (BadAlloc); - - err = get_ancestors(pStruct, pathPart, depth, pNumLists, pBuffer, pathlist); - - pBuffer->pBuf = pBuffer->pHead + bufSave; - puDeleteList(pathlist); - return (err); -} /* InquireAncestors */ - -/*++ - | - | Function Name: InquireDescendants - | - | Function Description: - | Handles the PEXGetDescendants request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireDescendants(pStruct, pathPart, depth, pNumLists, pBuffer) -/* in */ - diStructHandle pStruct; /* structure handle */ - ddUSHORT pathPart; /* which paths to return */ - ddULONG depth; /* how deep to search */ -/* out */ - ddULONG *pNumLists; /* number of lists returned */ - ddBufferPtr pBuffer; /* list of lists of element refs */ -{ - listofObj *pathlist; - ddpex4rtn err; - -#ifdef DDTEST - ErrorF("\nInquireDescendants\n"); -#endif - - bufSave = PU_BUF_HDR_SIZE(pBuffer); - pBuffer->dataSize = 0; - *pNumLists = 0; - - pathlist = puCreateList(DD_ELEMENT_REF); - if (!pathlist) return (BadAlloc); - - err = get_descendants(pStruct, pathPart, depth, pNumLists, pBuffer,pathlist); - - pBuffer->pBuf = pBuffer->pHead + bufSave; - puDeleteList(pathlist); - return (err); -} /* InquireDescendants */ - - -/*++ - | - | Function Name: InquireElements - | - | Function Description: - | Handles the PEXFetchElements request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireElements(pStruct, pRange, pNumOCs, pBuffer) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementRange *pRange; /* range of elements */ -/* out */ - ddULONG *pNumOCs;/* number of items in list */ - ddBufferPtr pBuffer;/* list of element OCs */ -{ - SET_STR_HEADER(pStruct, pheader); - ddULONG offset1, offset2, i; - miGenericElementPtr pel; - ddpex4rtn err; - -#ifdef DDTEST - ErrorF("\nInquireElements of %d\n", pStruct->id); -#endif - - *pNumOCs = 0; - - if (pheader->numElements == 0) return(Success); - - if (pos2offset(pheader, &(pRange->position1), &offset1)) - return (BadValue); /* bad whence value */ - - if (pos2offset(pheader, &(pRange->position2), &offset2)) - return (BadValue); /* bad whence value */ - - if (offset1 > offset2) { - i = offset1; - offset1 = offset2; - offset2 = i; - } - - if (offset1 == 0) - if (offset2 == 0) - return(Success); - else - offset1 = 1; - - MISTR_FIND_EL(pheader, offset1, pel); - - for (i = offset1; i <= offset2; i++) { - /* Propreitary calls (and OCNil) through 0th Table Entry */ - if (MI_HIGHBIT_ON(MISTR_EL_TYPE(pel))) - err = (*InquireCSSElementTable[MI_OC_PROP]) - (pel, pBuffer, &(pBuffer->pBuf)); - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(MISTR_EL_TYPE(pel))) - err = (*InquireCSSElementTable[MISTR_EL_TYPE(pel)]) - (pel, pBuffer, &(pBuffer->pBuf)); - else - err = !Success; - } - - if (err != Success) { - *pNumOCs = i - offset1; - return (err); - } - pBuffer->dataSize += sizeof(CARD32) - *(((ddElementInfo *)(pBuffer->pBuf))->length); - pBuffer->pBuf += sizeof(CARD32) - * (((ddElementInfo *)(pBuffer->pBuf))->length); - - pel = MISTR_NEXT_EL(pel); - } - - *pNumOCs = offset2 - offset1 + 1; - return (Success); - -} /* InquireElements */ - -/*++ - | - | Function Name: SetEditMode - | - | Function Description: - | Handles the PEXSetEditingMode request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetEditMode(pStruct, editMode) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddUSHORT editMode; /* edit mode */ -/* out */ -{ - SET_STR_HEADER(pStruct, pheader); - -#ifdef DDTEST - ErrorF("\nSetEditMode of %d\n", pStruct->id); -#endif - - switch (editMode) { - case PEXStructureInsert: - case PEXStructureReplace: - MISTR_EDIT_MODE(pheader) = editMode; - return (Success); - - default: - return (BadValue); - } -} /* SetEditMode */ - -/*++ - | - | Function Name: SetElementPointer - | - | Function Description: - | Handles the PEXSetElementPointer request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetElementPointer(pStruct, pPosition) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementPos *pPosition; /* position to set pointer at */ -/* out */ -{ - SET_STR_HEADER(pStruct, pstruct); - register miGenericElementPtr pel; - ddULONG newoffset; - - -#ifdef DDTEST - ErrorF("\nSetElementPointer of %d\n", pStruct->id); -#endif - - if (pos2offset(pstruct, pPosition, &newoffset)) { - /* bad whence value */ - return (BadValue); - } - if (newoffset == MISTR_CURR_EL_OFFSET(pstruct)) - return (Success); - - /* special case */ - if (newoffset == 0) { - MISTR_CURR_EL_OFFSET(pstruct) = 0; - MISTR_CURR_EL_PTR(pstruct) = MISTR_ZERO_EL(pstruct); - return (Success); - } - MISTR_FIND_EL(pstruct, newoffset, pel); - - MISTR_CURR_EL_OFFSET(pstruct) = newoffset; - MISTR_CURR_EL_PTR(pstruct) = pel; - return (Success); -} /* SetElementPointer */ - -/* look for the next label */ -static ddpex4rtn -find_label(pStruct, label, startPos, poffset) -diStructHandle pStruct; -ddLONG label; -ddElementPos startPos; -ddULONG *poffset; -{ - ddUSHORT foundLabelElement; - SET_STR_HEADER(pStruct, pstruct); - ddUSHORT labelElement = PEXOCLabel; - miGenericElementPtr pel; - ddpex4rtn err = Success; - - do { - err = ElementSearch( pStruct, &startPos, (ddULONG) PEXForward, - (ddULONG) 1, (ddULONG) 0, &labelElement, - (ddUSHORT *) NULL, &foundLabelElement, poffset); - - if (foundLabelElement == PEXFound) { - MISTR_FIND_EL(pstruct, *poffset, pel); - - if (label == MISTR_GET_LABEL(pel)) return (PEXFound); - - if (*poffset == MISTR_NUM_EL(pstruct)) return (PEXNotFound); - - /* continue searching after the new current element */ - startPos.whence = PEXBeginning; - startPos.offset = *poffset + 1; - - } else return (PEXNotFound); - - } while (err == Success); - - if (err != Success) return (PEXNotFound); - return (PEXFound); -} - -/*++ - | - | Function Name: SetElementPointerAtLabel - | - | Function Description: - | Handles the PEXSetElementPointerAtLabel request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetElementPointerAtLabel(pStruct, label, offset) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddLONG label; /* label id */ - ddLONG offset; /* offset from label */ -/* out */ -{ - SET_STR_HEADER(pStruct, pstruct); - ddElementPos position; - ddULONG offsetFromStart; - miGenericElementPtr pel; - -#ifdef DDTEST - ErrorF("\nSetElementPointerAtLabel\n"); -#endif - - position.whence = PEXCurrent; - position.offset = 1; - - if (find_label(pStruct, label, position, &offsetFromStart) == PEXNotFound) - return (PEXERR(PEXLabelError)); - - offsetFromStart += offset; - - if (offsetFromStart > MISTR_NUM_EL(pstruct)) - offsetFromStart = MISTR_NUM_EL(pstruct); - - MISTR_FIND_EL(pstruct, offsetFromStart, pel); - - MISTR_CURR_EL_PTR(pstruct) = pel; - MISTR_CURR_EL_OFFSET(pstruct) = offsetFromStart; - - return (Success); -} /* SetElementPointerAtLabel */ - -static ddBOOL -InList(val, numInList, list) - register ddUSHORT val; - ddULONG numInList; - register ddUSHORT list[]; -{ - /** Just do a linear search **/ - register int i; - for (i = 0; i < numInList; i++) { - if ((val == list[i]) || PEXOCAll == list[i]) - return (MI_TRUE); - } - return (MI_FALSE); -} - - -/*++ - | - | Function Name: ElementSearch - | - | Function Description: - | Handles the PEXElementSearch request. - | - | Note(s): - | - --*/ - -ddpex4rtn -ElementSearch(pStruct, pPosition, direction, numIncl, numExcl, - pIncls, pExcls, pStatus, pOffset) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementPos *pPosition; /* search start position */ - ddULONG direction; /* search direction (forward/backward) */ - ddULONG numIncl;/* number of types in incl list */ - ddULONG numExcl;/* number of types in excl list */ - ddUSHORT *pIncls; /* list of included element types */ - ddUSHORT *pExcls; /* list of excluded element types */ -/* out */ - ddUSHORT *pStatus;/* (found/notfound) */ - ddULONG *pOffset;/* offset from the start position */ -{ - - SET_STR_HEADER(pStruct, str); - ddULONG positionOffset; - miGenericElementPtr pel; - -#ifdef DDTEST - ErrorF("\nElementSearch of %d\n", pStruct->id); -#endif - - /** An element is considered "being searched for" if it is in the - ** include list and not in the exclude list. Elements in both - ** are excluded. An OCAll element specifies that all elements - ** match - **/ - - if (pos2offset(str, pPosition, &positionOffset)) return (BadValue); - - *pStatus = PEXNotFound; - *pOffset = 0; - - MISTR_FIND_EL(str, positionOffset, pel); - - /* - * search is either forwards or backwards, check for end of search - * for both - */ - while ((positionOffset >= 0) && (positionOffset <= MISTR_NUM_EL(str))) { - ddUSHORT elType; - - elType = MISTR_EL_TYPE(pel); - - /** If current element is in include list and not in exclude - ** list, then succeed PEXOCAll matches all elements, even PEXOCNil */ - if ( InList(elType, numIncl, pIncls) - && !InList(elType, numExcl, pExcls)) { - *pStatus = PEXFound; - *pOffset = positionOffset; - return (Success); - } else { - if (direction == PEXForward) { - positionOffset++; - pel = MISTR_NEXT_EL(pel); - } else { - positionOffset--; - pel = MISTR_PREV_EL(pel); - } - } - } - - return (Success); -} /* ElementSearch */ - -/*++ - | - | Function Name: StoreElements - | - | Function Description: - | Handles the PEXStoreElements request. - | - | Note(s): - | - --*/ - -ddpex4rtn -StoreElements(pStruct, numOCs, pOCs, ppErr) -/* in */ - diStructHandle pStruct; /* structure handle */ - register ddULONG numOCs; /* number of output commands */ - ddElementInfo *pOCs; /* list of output commands */ -/* out */ - pexOutputCommandError **ppErr; -{ - SET_STR_HEADER(pStruct, pstruct); - register ddElementInfo *poc; - register miGenericElementPtr pprevel, /* insert new one after this */ - preplel; /* or replace this one: preplel = - * pprevel->next */ - miGenericElementPtr pnewel; /* new el to insert */ - int count; - ddpex4rtn err = Success; - -#ifdef DDTEST - ErrorF("\nStoreElements in %d\n", pStruct->id); -#endif - - switch (MISTR_EDIT_MODE(pstruct)) { - case PEXStructureReplace: - for ( poc = pOCs, count = 0, - preplel = MISTR_CURR_EL_PTR(pstruct), - pprevel = MISTR_PREV_EL(preplel); - numOCs > 0; - numOCs--, - pprevel = MISTR_NEXT_EL(pprevel), - preplel = MISTR_NEXT_EL(pprevel), poc += poc->length) { - - /* - * replace iff - * we're not at the end - * * and the types match - * * and we're not at the beginning - * * * and elements are the same size - */ - - if ((preplel != MISTR_LAST_EL(pstruct)) - && (poc->elementType == MISTR_EL_TYPE(preplel)) - && (preplel != MISTR_ZERO_EL(pstruct)) - && (MISTR_EL_LENGTH(preplel) == poc->length)) { - - /* - * * Replace calls Parse functions - */ - - /* Propreitary OC (and OCNil) through 0th Table Entry */ - if (MI_HIGHBIT_ON(poc->elementType)) - err = (*ReplaceCSSElementTable[MI_OC_PROP]) - (pStruct, preplel, poc ); - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(poc->elementType)) - err = (*ReplaceCSSElementTable[poc->elementType]) - (pStruct, preplel, poc); - else { - /* Bad Element Type Exit Now */ - err = !Success; - break; - } - } - } else - /* Bad Replace */ - err = !Success; - - if (err != Success) { /* create new el */ - /* Propreitary OC (and OCNil) through 0th Table Entry */ - if (MI_HIGHBIT_ON(poc->elementType)) - err = (*CreateCSSElementTable[MI_OC_PROP]) - (pStruct, poc, &pnewel); - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(poc->elementType)) - err = (*CreateCSSElementTable[poc->elementType]) - (pStruct, poc, &pnewel); - else - /* Bad Element Type */ - err = !Success; - } - - if (err != Success) break; - - count++; - if ( (preplel != MISTR_LAST_EL(pstruct)) - && (preplel != MISTR_ZERO_EL(pstruct))) { - /* get rid of old el */ - MISTR_DEL_ONE_EL(pStruct, pprevel, preplel); - } - if (preplel == MISTR_ZERO_EL(pstruct)) - pprevel = preplel; - - MISTR_INSERT_ONE_EL(pprevel, pnewel); - } - } - - if (err != Success) break; - MISTR_CURR_EL_PTR(pstruct) = pprevel; - MISTR_FIND_OFFSET(pstruct, pprevel, MISTR_CURR_EL_OFFSET(pstruct)); - - break; - - - case PEXStructureInsert: - for ( count = 0, poc = pOCs, pprevel = MISTR_CURR_EL_PTR(pstruct); - numOCs > 0; - numOCs--, pprevel = pnewel, poc += poc->length) { - - /* Propreitary OC (and OCNil) through 0th Table Entry */ - if (MI_HIGHBIT_ON(poc->elementType)) - err = (*CreateCSSElementTable[MI_OC_PROP]) - (pStruct, poc, &pnewel); - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(poc->elementType)) - err = (*CreateCSSElementTable[poc->elementType]) - (pStruct, poc, &pnewel); - else - /* Bad Element Type */ - err = !Success; - } - - if (err != Success) break; - - count++; - MISTR_INSERT_ONE_EL(pprevel, pnewel); - } - - if (err != Success) break; - if (count) { - MISTR_CURR_EL_PTR(pstruct) = pprevel; - MISTR_FIND_OFFSET( pstruct, pprevel, - MISTR_CURR_EL_OFFSET(pstruct)); - } - break; - - default: - /* better not get here */ - ErrorF("tsk, tsk, the edit mode was set wrong\n"); - return (BadImplementation); - break; - } - - if (err != Success) { - *ppErr = (pexOutputCommandError *)xalloc(sizeof(pexOutputCommandError)); - (*ppErr)->type = 0; - (*ppErr)->errorCode = PEX_ERROR_CODE(PEXOutputCommandError); - (*ppErr)->resourceId = pStruct->id; - (*ppErr)->opcode = poc->elementType; - (*ppErr)->numCommands = count; - return (err); - } - - - miDealWithStructDynamics(STR_MODIFY_DYNAMIC, pStruct); - - return (Success); -} /* StoreElements */ - -/*++ - | - | Function Name: DeleteElements - | - | Function Description: - | Handles the PEXDeleteElements request. - | - | Note(s): - | - --*/ - -ddpex4rtn -DeleteElements(pStruct, pRange) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementRange *pRange; /* range of elements to delete */ -/* out */ -{ - ddULONG low, high, temp; - SET_STR_HEADER(pStruct, pstruct); - ddElementPos newElementPointer; - ddpex4rtn err; - -#ifdef DDTEST - ErrorF("\nDeleteElements in %d\n", pStruct->id); -#endif - - if (pos2offset(pstruct, &(pRange->position1), &low)) - return (BadValue); /* bad whence value */ - if (pos2offset(pstruct, &(pRange->position2), &high)) - return (BadValue); /* bad whence value */ - - /** first pos needn't be lower then second pos, so order them now **/ - if (low > high) { - temp = low; - low = high; - high = temp; - } - /** deleting element 0 equivalent to a NO-OP **/ - if (low == 0) { - if (high == 0) - return (Success); - else - low = 1; - } - MISTR_DEL_ELS(pStruct, pstruct, low, high); - - /* - * the current element pointer may now be invalid, so set it back to - * the beginning so it can be set correctly - */ - MISTR_CURR_EL_PTR(pstruct) = MISTR_ZERO_EL(pstruct); - MISTR_CURR_EL_OFFSET(pstruct) = 0; - - /** Now, according to PEX spec, set element pointer to element - ** preceding the range of deletion **/ - newElementPointer.whence = PEXBeginning; - newElementPointer.offset = low - 1; - err = SetElementPointer(pStruct, &newElementPointer); - - err = miDealWithStructDynamics(STR_MODIFY_DYNAMIC, pStruct); - - return (err); -} /* DeleteElements */ - -/*++ - | - | Function Name: DeleteToLabel - | - | Function Description: - | Handles the PEXDeleteElementsToLabel request. - | - | Note(s): - | - --*/ - -ddpex4rtn -DeleteToLabel(pStruct, pPosition, label) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddElementPos *pPosition; /* starting position */ - ddLONG label; /* label id to delete to */ -/* out */ -{ - SET_STR_HEADER(pStruct, pstruct); - ddElementPos position; - ddElementRange range; - ddULONG labelOffset; - ddULONG start; - -#ifdef DDTEST - ErrorF("\nDeleteToLabel\n"); -#endif - - if (pos2offset(pstruct, pPosition, &start)) - return (BadValue); /* bad whence value */ - - position.whence = PEXBeginning; - position.offset = start + 1; - - if (find_label(pStruct, label, position, &labelOffset) == PEXNotFound) - return (PEXERR(PEXLabelError)); - - /* - * Now call DeleteElements to delete the elements, but first adjust - * the range since DeleteElements does an inclusive delete and - * DeleteToLabel doesn't. - */ - if ((start == labelOffset) || ((start + 1) == labelOffset)) { - /* there are no elements between them */ - /* set the element pointer to point to the offset */ - return(SetElementPointer(pStruct, pPosition)); - } - - range.position1.whence = PEXBeginning; - range.position1.offset = start + 1; - range.position2.whence = PEXBeginning; - range.position2.offset = labelOffset - 1; - - /* DeleteElements also updates picture if nec. */ - return (DeleteElements(pStruct, &range)); - -} /* DeleteToLabel */ - -/*++ - | - | Function Name: DeleteBetweenLabels - | - | Function Description: - | Handles the PEXDeleteElementsBetweenLabels request. - | - | Note(s): - | - --*/ - -ddpex4rtn -DeleteBetweenLabels(pStruct, label1, label2) -/* in */ - diStructHandle pStruct;/* structure handle */ - ddLONG label1; /* first label id */ - ddLONG label2; /* second label id */ -/* out */ -{ - ddElementPos position; - ddULONG labelOffset; - -#ifdef DDTEST - ErrorF("\nDeleteBetweenLabels\n"); -#endif - - position.whence = PEXCurrent; - position.offset = 1; - - if (find_label(pStruct, label1, position, &labelOffset) == PEXNotFound) - return (PEXERR(PEXLabelError)); - - position.whence = PEXBeginning; - position.offset = labelOffset; - - /* DeleteToLabel also updates picture if nec. */ - return (DeleteToLabel(pStruct, &position, label2)); - -} /* DeleteBetweenLabels */ - -/*++ - | - | Function Name: CopyElements - | - | Function Description: - | Handles the PEXCopyElements request. - | - | Note(s): - | - --*/ - -ddpex4rtn -CopyElements(pSrcStruct, pSrcRange, pDestStruct, pDestPosition) -/* in */ - diStructHandle pSrcStruct; /* source structure handle */ - ddElementRange *pSrcRange; /* element range to copy */ - diStructHandle pDestStruct; /* destination structure handle */ - ddElementPos *pDestPosition; /* destination position to put stuff */ -/* out */ -{ - SET_STR_HEADER(pSrcStruct, psource); - SET_STR_HEADER(pDestStruct, pdest); - ddULONG src_low, src_high, dest_offset, i, count; - miGenericElementPtr psrcel, pdestel, pdestprev; - miGenericElementStr pfirst, plast; /* dummies */ - ddpex4rtn err4 = Success; - - -#ifdef DDTEST - ErrorF("\nCopyElements\n"); -#endif - if (pos2offset(psource, &(pSrcRange->position1), &src_low)) - return (BadValue); /* bad whence value */ - - if (pos2offset(psource, &(pSrcRange->position2), &src_high)) - return (BadValue); /* bad whence value */ - - if (pos2offset(pdest, pDestPosition, &dest_offset)) - return (BadValue); /* bad whence value */ - - if (src_low > src_high) { - i = src_low; - src_low = src_high; - src_high = i; - } - if (src_low == 0) { - if (src_high == 0) - return (Success); - else - src_low = 1; - } - MISTR_FIND_EL(psource, src_low, psrcel); - - /* - * copy els to dummy list, then add dummy list to dest NOTE: - * CopyCSSElement procedure is passed pDestStruct for the copy even - * though the element is not really being inserted into the structure - * yet. This should be OK, but beware!! - */ - MISTR_NEXT_EL(&pfirst) = &plast; - MISTR_PREV_EL(&plast) = &pfirst; - MISTR_PREV_EL(&pfirst) = MISTR_NEXT_EL(&plast) = NULL; - pdestprev = &pfirst; - - for (i = src_low, count = 0; i <= src_high; i++) { - - /* Propreitary OC (and OCNil) through 0th Table Entry */ - if (MI_HIGHBIT_ON(MISTR_EL_TYPE(psrcel))) - err4 = (*CopyCSSElementTable[MI_OC_PROP]) - (psrcel, pDestStruct, &pdestel); - else { - /* not Proprietary see if valid PEX OC */ - if (MI_IS_PEX_OC(MISTR_EL_TYPE(psrcel))) - err4 = (*CopyCSSElementTable[MISTR_EL_TYPE(psrcel)]) - (psrcel, pDestStruct, &pdestel); - else - /* Bad Element Type - Problem if you get here */ - err4 = !Success; - } - - if (err4 != Success) - break; - - count++; - MISTR_INSERT_ONE_EL(pdestprev, pdestel); - pdestprev = pdestel; - psrcel = MISTR_NEXT_EL(psrcel); - } - - if (count) { - MISTR_FIND_EL(pdest, dest_offset, pdestprev); - - MISTR_NEXT_EL(MISTR_PREV_EL(&plast)) = MISTR_NEXT_EL(pdestprev); - MISTR_PREV_EL(MISTR_NEXT_EL(pdestprev)) = MISTR_PREV_EL(&plast); - - MISTR_NEXT_EL(pdestprev) = MISTR_NEXT_EL(&pfirst); - MISTR_PREV_EL(MISTR_NEXT_EL(&pfirst)) = pdestprev; - - MISTR_CURR_EL_PTR(pdest) = MISTR_PREV_EL(&plast); - MISTR_FIND_OFFSET(pdest, MISTR_CURR_EL_PTR(pdest), MISTR_CURR_EL_OFFSET(pdest)); - } - err4 = miDealWithStructDynamics(STR_MODIFY_DYNAMIC, pDestStruct); - - return (err4); -} /* CopyElements */ - -/*++ - | - | Function Name: ChangeStructureReferences - | - | Function Description: - | Handles the PEXChangeStructureReferences request. - | - | Note(s): - | - --*/ - -ddpex4rtn -ChangeStructureReferences(pStruct, pNewStruct) -/* in */ - diStructHandle pStruct;/* structure handle */ - diStructHandle pNewStruct; /* new structure resource */ -/* out */ -{ - - SET_STR_HEADER(pStruct, pstruct); - SET_STR_HEADER(pNewStruct, pnewstruct); - diStructHandle parentHandle; - miStructPtr pparentStruct; - int loopcount; - ddElementPos position; - ddpex4rtn foundExecuteElement, err; - ddULONG offsetFromStart; - diWKSHandle pWks; - miGenericElementPtr pel; - pexExecuteStructure execStrOC; - ddFLOAT prity; - -#ifdef DDTEST - ErrorF("\nChangeStructureReferences\n"); -#endif /* DDTEST */ - - /* set up OC with new structure that will replace old */ - execStrOC.head.elementType = PEXOCExecuteStructure; - execStrOC.head.length = 2; - execStrOC.id = (pexStructure) pNewStruct; - - /* - * Update all references to this structure by walking through the - * structure's parent list. Note that if the structure is referenced - * more than once by a parent structure, there will be more than one - * occurence of the parent in the parent list. - */ - - for (loopcount = pstruct->parents->numObj; loopcount > 0; loopcount--) { - - /* The parent list changes in loop, so always get first parent */ - parentHandle = *(diStructHandle *) pstruct->parents->pList; - pparentStruct = (miStructPtr) (parentHandle)->deviceData; - - /* start looking at the beginning of the parent structure */ - position.whence = PEXBeginning; - position.offset = 0; - offsetFromStart = 0; - - foundExecuteElement = find_execute_structure (parentHandle, &position, - pStruct, &offsetFromStart); - - if (foundExecuteElement == PEXFound) { - MISTR_FIND_EL(pparentStruct, offsetFromStart, pel); - err = (*ReplaceCSSElementTable[PEXOCExecuteStructure]) - (parentHandle, pel, &execStrOC); - if (err != Success) return (err); - } else - return (!Success); - } - - /* - * this changes the old structures posted to list (because unpost removes - * the wks from this list) so always get the first wks from the list and - * be sure to check the original number of posted wks - */ - for (loopcount = pstruct->wksPostedTo->numObj; loopcount > 0; loopcount--) { - pWks = ((diWKSHandle *) pstruct->wksPostedTo->pList)[0]; - if (puInList((ddPointer) pWks, pnewstruct->wksPostedTo)) - err = UnpostStructure(pWks, pStruct); - else { - miGetStructurePriority(pWks, pStruct, &prity); - err = PostStructure(pWks, pNewStruct, prity); - } - if (err) return (err); - } - - err = miDealWithStructDynamics(REF_MODIFY_DYNAMIC, pNewStruct); - - return (Success); -} /* ChangeStructureReferences */ - -int -miAddWksToAppearLists(pStruct, pWKS) - diStructHandle pStruct; - diWKSHandle pWKS; -{ - SET_STR_HEADER(pStruct, pheader); - register ddULONG i, num; - diStructHandle *ps; - - /* loop through the structures list of children */ - num = pheader->children->numObj; - ps = (diStructHandle *) pheader->children->pList; - for (i = 0; i < num; i++, ps++) { - if (puAddToList( (ddPointer) & pWKS, (ddULONG) 1, - ((miStructPtr) (*ps)->deviceData)->wksAppearOn) - == MI_ALLOCERR) - return (MI_ALLOCERR); - - /* recur to do the children of this child */ - if (miAddWksToAppearLists(*ps, pWKS) != MI_SUCCESS) - return (MI_ALLOCERR); - } - return (MI_SUCCESS); -} - -void -miRemoveWksFromAppearLists(pStruct, pWKS) - diStructHandle pStruct; - diWKSHandle pWKS; -{ - SET_STR_HEADER(pStruct, pheader); - register ddULONG i, num; - diStructHandle *ps; - -#ifdef DDTEST - ErrorF("\tmiRemoveWksFromAppearLists (of structure %d)\n", pStruct->id); -#endif - - num = pheader->children->numObj; - ps = (diStructHandle *) pheader->children->pList; - - /* look at all children of this structure */ - for (i = 0; i < num; i++, ps++) { - /* remove the wks from the child's list */ - puRemoveFromList( (ddPointer) & pWKS, - ((miStructPtr) (*ps)->deviceData)->wksAppearOn); - - /* recur to do the children of this child */ - miRemoveWksFromAppearLists(*ps, pWKS); - } - return; -} - -/*++ - | - | Function Name: UpdateStructRefs - | - | Function Description: - | A utility function to change the cross-reference lists in the structure. - | Each structure has a list of every workstation and structure which uses - | it. - | - | Note(s): - | - --*/ - -ddpex4rtn -UpdateStructRefs(pStruct, pResource, which, action) -/* in */ - diStructHandle pStruct;/* structure handle */ - diResourceHandle pResource; /* wks, struct, sc handle */ - ddResourceType which; /* wks, struct, pick, sc */ - ddAction action; /* add or remove */ -/* out */ -{ - SET_STR_HEADER(pStruct, pheader); - -#ifdef DDTEST - ErrorF("\nUpdateStructRefs\n"); -#endif - - switch (which) { - case WORKSTATION_RESOURCE: - - /* - * for each workstation, do it to the specified structures - * wksPostedTo list and do it to the wksAppearOn list of all - * of the structures children - */ - if (action == ADD) { - if (puAddToList( (ddPointer) & pResource, (ddULONG) 1, - pheader->wksPostedTo) == MI_ALLOCERR) - return (BadAlloc); /* couldn't add to list */ - if (miAddWksToAppearLists(pStruct, (diWKSHandle) pResource)) - return (BadAlloc); /* couldn't add to list */ - } else { - puRemoveFromList((ddPointer) & pResource, pheader->wksPostedTo); - miRemoveWksFromAppearLists(pStruct, (diWKSHandle) pResource); - } - - break; - - case PARENT_STRUCTURE_RESOURCE: - if (action == ADD) { - if (puAddToList( (ddPointer) & pResource, (ddULONG) 1, - pheader->parents) == MI_ALLOCERR) - return (BadAlloc); /* couldn't add to list */ - } else - puRemoveFromList((ddPointer) & pResource, pheader->parents); - - break; - - case CHILD_STRUCTURE_RESOURCE: - if (action == ADD) { - if (puAddToList( (ddPointer) & pResource, (ddULONG) 1, - pheader->children) == MI_ALLOCERR) - return (BadAlloc); /* couldn't add to list */ - } else - puRemoveFromList((ddPointer) & pResource, pheader->children); - - break; - - case SEARCH_CONTEXT_RESOURCE: - case PICK_RESOURCE: /* for both pick device & pick measure */ - if (action == ADD) - pheader->refCount++; - else { - pheader->refCount--; - CHECK_DELETE(pStruct, pheader); - } - break; - - default: /* better not get here */ - break; - } - return (Success); -} - -/* get_wks_postings for InquireWksPostings - * implement it here since it uses structure stuff - */ -ddpex4rtn -get_wks_postings(pStruct, pBuffer) - diStructHandle pStruct; - ddBufferPtr pBuffer; -{ - SET_STR_HEADER(pStruct, pheader); - listofObj *wkslist; - diWKSHandle *pwks; - ddResourceId *pbuf; - register int i; - - pBuffer->dataSize = 0; - - wkslist = pheader->wksPostedTo; - - if (PU_BUF_TOO_SMALL(pBuffer,(ddULONG)wkslist->numObj *sizeof(ddResourceId))) - if (puBuffRealloc( pBuffer, - (ddULONG)(wkslist->numObj * sizeof(ddResourceId))) - != Success) { - puDeleteList(wkslist); - return (BadAlloc); - } - pwks = (diWKSHandle *) wkslist->pList; - pbuf = (ddResourceId *) pBuffer->pBuf; - for (i = 0; i < wkslist->numObj; i++, pwks++, pbuf++) *pbuf = (*pwks)->id; - pBuffer->dataSize = wkslist->numObj * sizeof(ddResourceId); - - return (Success); -} - -/* make a generic puPrintList and put it in dipex/util/pexUtils.c sometime */ -void -miPrintPath(pPath) - listofObj *pPath; -{ - register int i; - register ddElementRef *pref; - - ErrorF("\nELEMENT REF PATH\n"); - pref = (ddElementRef *) pPath->pList; - for (i = 0; i < pPath->numObj; i++, pref++) - ErrorF("\tstructure id: %d\toffset: %d\n", - pref->structure, pref->offset); - ErrorF("\nEND PATH\n"); -} - -/*++ - | - | Function Name: miPrintStructure - | - | Function Description: - | Prints out the contents of a structure for debugging - | purposes. - | - | Input Description: - | miStructPtr pStruct; - | int strLevel - amount of struct info to display - | Output Description: - | Switch strLevel : - | case 0 : - | don't do anything. - | case 1 : - | print structure header and nothing more - | case 2 : - | print structure header and affil. structs and wks - | - --*/ - -static void printWorkstations(), printStructures(); - -void -miPrintStructure(S, strLevel) - diStructHandle S; - int strLevel; -{ - miStructPtr s = (miStructPtr) S->deviceData; - - if (strLevel > 0) { - - ErrorF("\n\n\n**********************************\n"); - ErrorF("* Printing Structure at 0x%x *\n", s); - ErrorF("**********************************\n"); - ErrorF("ID = %ld\n", S->id); - ErrorF("Edit Mode = %s\n", (s->editMode == PEXStructureReplace) ? - "REPLACE" : "INSERT"); - ErrorF("Num Elements = %ld\nTotal Size in 4 byte units = %ld\n", - s->numElements, s->totalSize); - ErrorF("Curr Offset = %ld\nCurr Elt Ptr = 0x%x\n", - s->currElementOffset, s->pCurrElement); - ErrorF("Zero El Ptr = 0x%x\nLast El Ptr = 0x%x\n", - s->pZeroElement, s->pLastElement); - - if (strLevel == 2) { - ErrorF("\nParent Structures :\n"); - printStructures(s->parents); - ErrorF("\nChild Structures :\n"); - printStructures(s->children); - ErrorF("\nWKS posted to:\n"); - printWorkstations(s->wksPostedTo); - ErrorF("\nWKS appearing on:\n"); - printWorkstations(s->wksAppearOn); - } - } -} - -static void -printStructures(list) - listofObj *list; -{ - int i; - diStructHandle *str; - - str = (diStructHandle *) list->pList; - for (i = 0; i < list->numObj; i++, str++) { - ErrorF("\tStruct Address: 0x%x\t\tId: %ld\n", - (*str)->deviceData, (*str)->id); - } -} - -static void -printWorkstations(list) - listofObj *list; -{ - int i; - diWKSHandle *wks; - - wks = (diWKSHandle *) list->pList; - for (i = 0; i < list->numObj; i++, wks++) { - ErrorF("\tWks Address: 0x%x\t\tId: %ld\n", - (*wks)->deviceData, (*wks)->id); - } -} - - -/*++ - | - | Function Name: ValidateStructurePath - | - | Function Description: - Follows the given search or pick path to see if it's valid - | - --*/ - -ddpex4rtn -ValidateStructurePath(pPath) - listofObj *pPath; -{ - miGenericElementPtr p_element; - diStructHandle pStruct, pNextStruct; - miStructPtr pstruct; - ddULONG offset; - int i, j; - - if (pPath->type == DD_ELEMENT_REF) { - ddElementRef *pSCPath; - - pSCPath = (ddElementRef *) pPath->pList; - pNextStruct = pSCPath->structure; - - for (i = pPath->numObj; i > 0; i--, pSCPath++) { - pStruct = pSCPath->structure; - if (pNextStruct != pStruct) return (PEXERR(PEXPathError)); - - pstruct = (miStructPtr) pStruct->deviceData; - - offset = pSCPath->offset; - if (offset > MISTR_NUM_EL(pstruct)) return (PEXERR(PEXPathError)); - - /* dont' check what the last element is */ - if (i == 1) break; - - MISTR_FIND_EL(pstruct, offset, p_element); - if (MISTR_EL_TYPE(p_element) != PEXOCExecuteStructure) - return (PEXERR(PEXPathError)); - - pNextStruct = (diStructHandle) MISTR_GET_EXSTR_STR(p_element); - } - } else { - ddPickPath *pPickPath; - ddULONG pickId; - - /* - * pick has to step through each element to check pick id also - */ - pPickPath = (ddPickPath *) pPath->pList; - pNextStruct = pPickPath->structure; - pickId = 0; - - for (i = pPath->numObj; i > 0; i--, pPickPath++) { - - pStruct = pPickPath->structure; - if (pNextStruct != pStruct) return (PEXERR(PEXPathError)); - - pstruct = (miStructPtr) pStruct->deviceData; - - offset = pPickPath->offset; - if (offset > MISTR_NUM_EL(pstruct)) return (PEXERR(PEXPathError)); - - /* - * start at the first element and look at each - * element until the offset is reached - */ - MISTR_FIND_EL(pstruct, 1, p_element); - - for (j = 1; j < offset; j++ ) { - if (MISTR_EL_TYPE(p_element) == PEXOCPickId) - pickId = MISTR_GET_PICK_ID(p_element); - p_element = MISTR_NEXT_EL(p_element); - } - - if (pickId != pPickPath->pickid) return (PEXERR(PEXPathError)); - - /* dont' check what the last element is */ - if (i == 1) break; - - if (MISTR_EL_TYPE(p_element) != PEXOCExecuteStructure) - return (PEXERR(PEXPathError)); - - pNextStruct = (diStructHandle) MISTR_GET_EXSTR_STR(p_element); - } - } - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c:1.10 Fri Dec 14 14:57:36 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c Sat Feb 28 21:41:55 2004 @@ -1,600 +0,0 @@ -/* $Xorg: miTraverse.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/miTraverse.c,v 1.10 2001/12/14 19:57:36 dawes Exp $ */ - -#include "miWks.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "miRender.h" -#include "miPick.h" -#include "miStruct.h" -#include "miStrMacro.h" -#include "pexos.h" - - -extern void InquirePickStatus(); -extern void InquireSearchStatus(); - -extern ddpex3rtn BeginStructure(); -extern ddpex3rtn EndStructure(); -extern ocTableType ExecuteOCTable[]; - -ddpex4rtn traverser(); - -#ifdef DDTEST -#define ASSURE(test) \ - if (!(test)) { \ - ErrorF( "test \n"); \ - ErrorF( "Failed: Line %d, File %s\n\n", __LINE__, __FILE__); \ - } -#else -#define ASSURE(test) -#endif /* DDTEST */ - -static ddBOOL -pickES (pRend, p_trav_state, p_str, depth, curr_offset) - ddRendererPtr pRend; - miTraverserState *p_trav_state; - diStructHandle p_str; /* current structure */ - ddSHORT depth; /* how far down in structures */ - ddULONG curr_offset; -{ - - if ((p_str->id == p_trav_state->p_curr_pick_el->structure->id) && - (curr_offset == p_trav_state->p_curr_pick_el->offset)) { - - if (depth < pRend->pickStartPath->numObj) - /* continue following start path */ - p_trav_state->p_curr_pick_el++; - else - /* at end of start path; time to start traversal */ - p_trav_state->exec_str_flag = ES_YES; - - return(MI_TRUE); - } - return (MI_FALSE); -} - -static ddBOOL -searchES(pSC, p_trav_state, p_str, depth, curr_offset) - ddSCStr *pSC; - miTraverserState *p_trav_state; - diStructHandle p_str; /* current structure */ - ddSHORT depth; /* how far down in structures */ - ddULONG curr_offset; -{ - if ((p_str->id == p_trav_state->p_curr_sc_el->structure->id) && - (curr_offset == p_trav_state->p_curr_sc_el->offset)) { - /* OK, this element is in the start path. Now if we're - * at the ceiling, don't follow the exec-str - */ - if ((pSC->ceiling == 1) || (depth < pSC->ceiling)) { - if (depth < pSC->startPath->numObj) - /* continue following start path */ - p_trav_state->p_curr_sc_el++; - else - /* at end of start path; time to start traversal */ - p_trav_state->exec_str_flag = ES_YES; - return(MI_TRUE); - } - } - return (MI_FALSE); -} - -int -miTraverse(pWks ) - diWKSHandle pWks; -{ - register ddOrdStruct *pos; - miWksPtr pwks = (miWksPtr) pWks->deviceData; - ddpex4rtn err = Success; - miTraverserState trav_state; - DrawablePtr pRealDrawable; - - - if ( (pwks->pRend->pDrawable == NULL) - || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - if (!pwks->postedStructs.numStructs || !pwks->pCurDrawable) return (Success); - - /* set exec_str_flag */ - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = (ddPickPath *) NULL; - trav_state.p_curr_sc_el = (ddElementRef *) NULL; - - /* save drawable to be restored later */ - pRealDrawable = pwks->pRend->pDrawable; - pwks->pRend->pDrawable = pwks->pCurDrawable; - - /** call into ddPEX level III Begin Rendering **/ - BeginRendering(pwks->pRend, pwks->pCurDrawable); - - /* traverse all posted structs */ - pos = pwks->postedStructs.postruct; - while ((pos->next) && (err == Success)) { - pos = pos->next; - /* reset for each structure */ - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - - - if (MISTR_NUM_EL((miStructPtr) pos->pstruct->deviceData)) { - BeginStructure(pwks->pRend, pos->pstruct->id); - - /* - * always start at the first element in the - * structure - */ - err = traverser( pwks->pRend, pos->pstruct, (ddULONG) 1, - MISTR_NUM_EL((miStructPtr) pos->pstruct->deviceData), - (diPMHandle)NULL, (ddSCStr *) NULL, &trav_state); - - EndStructure(pwks->pRend); - pwks->displaySurface = PEXNotEmpty; - } - } - - EndRendering(pwks->pRend); - - pwks->pRend->pDrawable = pRealDrawable; - - if (err != Success) { - /* do stuff here to return error */ - return(err); - } - - return (err); -} /* miTraverse */ - -/* this traverses server side structures */ -/* startel must be > 0 - * stopel must be <= num els in structure - */ -/* - * begin/end structure keep track of the current path, - * but calling the level II OCs directly does not - * so do this BEFORE calling the OCs - */ -#define INCREMENT_OFFSET(pRend) \ - if (pRend->curPath->numObj) \ - ((ddElementRef *)pRend->curPath->pList)[pRend->curPath->numObj-1].offset++ - -ddpex4rtn -traverser(pRend, pStruct, startel, stopel, pPM, pSC, p_trav_state) -ddRendererPtr pRend; -diStructHandle pStruct; -ddULONG startel; -ddULONG stopel; -diPMHandle pPM; -ddSCStr *pSC; -miTraverserState *p_trav_state; -{ - register ddULONG currOffset; - miPickMeasureStr *ppm; - miGenericElementPtr p_element; - ddPointer ddElement; /* imp. dep. parsed element */ - diStructHandle p_next_str; /* execute structure structure */ - ddSHORT depth; /* how far down in structures */ - ddULONG pickId, ROCoffset; - miStructPtr pstruct = (miStructPtr)(pStruct->deviceData); - ddUSHORT pickStatus, searchStatus; - ddpex2rtn err; - ddPickPath *pl; - ddElementRef *sl; - int zap; - miPPLevel myPickLevel, *pp; - int i; - - - if (pPM) - ppm = (miPickMeasureStr *) pPM->deviceData; - else - ppm = (miPickMeasureStr *) NULL; - - /* - * set depth=MaxDepth here when called on way in, - * so depth is current depth on way out - */ - p_trav_state->max_depth++; - depth = p_trav_state->max_depth; - /* same for pick id */ - pickId = p_trav_state->pickId; - MISTR_FIND_EL(pstruct, startel, p_element); - currOffset = startel; - - /* when calling traverser from ROC ROCoffset may be non-zero - to account for prior ROCs, all other times this should - be 0 and we set it to 0 here so recursion doesn't mess - up the offsets when processing execute structure - */ - ROCoffset = p_trav_state->ROCoffset; - p_trav_state->ROCoffset = 0; - - /* do stuff for following search start path */ - if (pSC) { - /* if following start path, and its at the last element_ref - * in the start path, and its after the last element in - * the element_ref, then its at the end of the start - * path and searching should begin - */ - if ( (p_trav_state->exec_str_flag == ES_FOLLOW_SEARCH) && - (depth == pSC->startPath->numObj) && - (currOffset > p_trav_state->p_curr_sc_el->offset) ) - p_trav_state->exec_str_flag = ES_YES; - } - - /* do stuff for following pick start path */ - if (pPM) { - if ( (p_trav_state->exec_str_flag == ES_FOLLOW_PICK) && - (depth == pRend->pickStartPath->numObj) && - (currOffset > p_trav_state->p_curr_pick_el->offset) ) - p_trav_state->exec_str_flag = ES_YES; - } - - while (currOffset <= stopel) { - ddElement = (ddPointer) (&(p_element->element)); - - switch (MISTR_EL_TYPE(p_element)) { - case PEXOCExecuteStructure: { - - /* - * While inside this traverser, don't call level II execute - * structure OC. It is used in mixed mode traversals to get - * from client-side traversing to server-side traverser - */ - ddBOOL go; - - p_next_str = ((diStructHandle) MISTR_GET_EXSTR_STR(p_element)); - if (p_trav_state->exec_str_flag == ES_FOLLOW_PICK) - go = pickES (pRend, p_trav_state, pStruct, depth, currOffset); - else if (p_trav_state->exec_str_flag == ES_FOLLOW_SEARCH) - go = searchES(pSC, p_trav_state, pStruct, depth, currOffset); - else if (p_trav_state->exec_str_flag == ES_YES) - go = MI_TRUE; - else - go = MI_FALSE; - - if (go) { - - BeginStructure(pRend, p_next_str->id); - - /* build the pick path as we descend the hierarchy */ - if (pPM) { - myPickLevel.up = p_trav_state->p_pick_path; - myPickLevel.pp.structure = pStruct; - myPickLevel.pp.offset = currOffset + ROCoffset; - myPickLevel.pp.pickid = pickId; - p_trav_state->p_pick_path = &myPickLevel; - } - - err = traverser( pRend, p_next_str, (ddULONG) 1, - MISTR_NUM_EL((miStructPtr) p_next_str->deviceData), - pPM, pSC, p_trav_state); - if (err != Success) return (err); - EndStructure(pRend); - } - - /* - * We built the candidate pick path when it was found. We - * do nothing on the way out - except restore pointer. - */ - if (pPM) { - p_trav_state->p_pick_path = myPickLevel.up; - } - - - /* do the same for searching, replacing the start - * path with the found path - */ - if (pSC && (pSC->status == PEXFound)) { - - sl = (ddElementRef *) pSC->startPath->pList; - - zap = depth -1; - - sl[zap].structure = pStruct; - sl[zap].offset = currOffset; - - return (Success); - } else - /* popping out of Not Found */ - if (pSC && (p_trav_state->exec_str_flag == ES_POP)) - return (Success); - - /* - * still picking or searching, so keep - * adjusting max_depth - */ - if (go) - p_trav_state->max_depth--; - break; - } - - case PEXOCPickId: - - /* - * For now, set own pick id and call into level II pick OC. - * Could do this in a level 4 pick procedure like execute struct - */ - pickId = p_trav_state->pickId = MISTR_GET_LABEL(p_element); - - INCREMENT_OFFSET(pRend); - - pRend->executeOCs[(int) (p_element->element.elementType)] - (pRend, ddElement); - - break; - - /* drawing primitives */ - case PEXOCMarker: - case PEXOCMarker2D: - case PEXOCText: - case PEXOCText2D: - case PEXOCAnnotationText: - case PEXOCAnnotationText2D: - case PEXOCPolyline: - case PEXOCPolyline2D: - case PEXOCPolylineSet: - case PEXOCNurbCurve: - case PEXOCFillArea: - case PEXOCFillArea2D: - case PEXOCExtFillArea: - case PEXOCFillAreaSet: - case PEXOCFillAreaSet2D: - case PEXOCExtFillAreaSet: - case PEXOCTriangleStrip: - case PEXOCQuadrilateralMesh: - case PEXOCSOFAS: - case PEXOCNurbSurface: - case PEXOCCellArray: - case PEXOCCellArray2D: - case PEXOCExtCellArray: - case PEXOCGdp: - case PEXOCGdp2D: - INCREMENT_OFFSET(pRend); - - /* if following pick or search path, don't call prims */ - if ( (p_trav_state->exec_str_flag == ES_FOLLOW_PICK) || - (p_trav_state->exec_str_flag == ES_FOLLOW_SEARCH) ) - break; - - if (MI_DDC_DO_PRIMS(pRend)) { - - pRend->executeOCs[(int) (p_element->element.elementType)] - (pRend, ddElement); - if (pSC) { - InquireSearchStatus(pRend, &searchStatus); - /* searchStatus is PEXFound or PEXNotFound */ - pSC->status = searchStatus; - if (searchStatus == PEXFound) { - sl = (ddElementRef *) pSC->startPath->pList; - - pSC->startPath->numObj = p_trav_state->max_depth; - - if (pSC->startPath->maxObj < p_trav_state->max_depth) { - pSC->startPath->pList = - (ddPointer) xrealloc( - pSC->startPath->pList, - p_trav_state->max_depth - * sizeof(ddElementRef)); - pSC->startPath->maxObj = p_trav_state->max_depth; - } - zap = depth -1; - - sl[zap].structure = pStruct; - sl[zap].offset = currOffset; - - p_trav_state->exec_str_flag = ES_POP; - return (Success); - } - } - if (pPM) { - InquirePickStatus(pRend, &pickStatus, p_trav_state); - if (pickStatus == PEXOk) { - if (pRend->pickstr.state == DD_PICK_ALL) { - myPickLevel.up = p_trav_state->p_pick_path; - myPickLevel.pp.structure = pStruct; - myPickLevel.pp.offset = currOffset + ROCoffset; - myPickLevel.pp.pickid = pickId; - - AddPickPathToList( pRend, depth, &myPickLevel); - ppm->status = pickStatus; - - } else { - - - pl = (ddPickPath *) ppm->path->pList; - - /* - * then do stuff to update - * pick measure path and stop - * traversing - */ - ppm->path->numObj = p_trav_state->max_depth; - - if (ppm->path->maxObj < p_trav_state->max_depth) { - ppm->path->pList = - (ddPointer) xrealloc(ppm->path->pList, - p_trav_state->max_depth - * sizeof(ddPickPath)); - ppm->path->maxObj = p_trav_state->max_depth; - } - - /* - * oh boy, this is where recursion is fun. - * In this current iteration of traverser we know - * the last element in the path, so stuff this - * element into the bottom/top of the pick path list - * depending on whether the top/bottom part was - * requested - */ - if (ppm->pathOrder == PEXTopFirst) - zap = depth - 1; - else - zap = p_trav_state->max_depth - depth; - - pl[zap].structure = pStruct; - pl[zap].offset = currOffset + ROCoffset; - pl[zap].pickid = pickId; - - /* - * we want to continue on, so we do not want to - * pop off to use the recursion. - * follow the linked list down - */ - pp = p_trav_state->p_pick_path; - for (i = depth-1; i > 0; i-- ) { - if (ppm->pathOrder == PEXTopFirst) - zap = i - 1; - else - zap = p_trav_state->max_depth - i; - - pl[zap] = pp->pp; /* structure assignment */ - pp = pp->up; - } - ppm->status = pickStatus; - - } - } - } - } - break; - - default: /* all others */ - - INCREMENT_OFFSET(pRend); - - /* could maybe skip some if doing pick or search */ - if (MI_IS_PEX_OC(MISTR_EL_TYPE(p_element))) - pRend->executeOCs[(int) (p_element->element.elementType)] - (pRend, ddElement); - - break; /* default */ - - } /* end switch */ - - - /* do stuff for following search start path */ - if ( pSC ) { - /* now, if its at the ceiling, forget it */ - if ( (depth == pSC->ceiling) && (pSC->ceiling != 1) && - (currOffset >= stopel) ) { - pSC->status = PEXNotFound; - p_trav_state->exec_str_flag = ES_POP; - return (Success); - } - - /* do stuff for following search start path */ - if (pSC) { - /* if following start path, and its at the last element_ref - * in the start path, and its after the last element in - * the element_ref, then its at the end of the start - * path and searching should begin - */ - if ( (p_trav_state->exec_str_flag == ES_FOLLOW_SEARCH) && - (depth == pSC->startPath->numObj) && - (currOffset >= p_trav_state->p_curr_sc_el->offset) ) - p_trav_state->exec_str_flag = ES_YES; - } - - } - - /* do stuff for following search start path */ - if (pPM) { - /* if following start path, and its at the last pick_path - * in the start path, and its after the last element in - * the pick_path, then its at the end of the start - * path and searching should begin - */ - if ( (p_trav_state->exec_str_flag == ES_FOLLOW_PICK) && - (depth == pRend->pickStartPath->numObj) && - (currOffset >= p_trav_state->p_curr_pick_el->offset) ) - p_trav_state->exec_str_flag = ES_YES; - } - - /* go on to the next element */ - currOffset++; - p_element = MISTR_NEXT_EL(p_element); - } /* while loop (while there are still elements - in the structure) */ - - return (Success); - -} /* traverser */ - - -/* for mixed mode traversals, this supports the execute structure OC */ -void -execute_structure_OC(pRend, pOC) -ddRendererPtr pRend; -pexExecuteStructure *pOC; -{ - diStructHandle pstruct = *((diStructHandle *)&(pOC->id)); - miTraverserState trav_state; - ddpex4rtn err = Success; - if (MISTR_NUM_EL((miStructPtr) pstruct->deviceData)) { - - BeginStructure(pRend, pstruct->id); - trav_state.exec_str_flag = ES_YES; - trav_state.p_curr_pick_el = NULL; - trav_state.p_curr_sc_el = NULL; - trav_state.max_depth = 0; - trav_state.pickId = 0; - trav_state.ROCoffset = 0; - - err = traverser( pRend, pstruct, (ddULONG)0, - MISTR_NUM_EL((miStructPtr)pstruct->deviceData), - (diPMHandle)NULL, (ddSCStr *)NULL, &trav_state); - EndStructure(pRend); - - } - return; -} Index: xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c:1.10 Fri Dec 14 14:57:36 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c Sat Feb 28 21:41:55 2004 @@ -1,2422 +0,0 @@ -/* $Xorg: miWks.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/level4/miWks.c,v 1.10 2001/12/14 19:57:36 dawes Exp $ */ - - -#include "miWks.h" -#include "miInfo.h" -#include "miLUT.h" -#include "pexUtils.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexExtract.h" -#include "Xprotostr.h" -#include "gcstruct.h" -#include "resource.h" -#include "pexos.h" - - -#ifdef MULTIBUFFER -#define _MULTIBUF_SERVER_ -#include -#endif - -/* Level 4 Workstation Support */ -/* PHIGS Workstation Procedures */ - -extern ddpex4rtn miDealWithStructDynamics(); -extern ddpex4rtn miDealWithDynamics(); -extern void miMatInverse(); -extern void miTransformPoint(); -extern void path_update_struct_refs(); -extern ddpex3rtn miBldViewport_xform(); - -ddpex4rtn mi_add_ord_view(); -ddOrdView *mi_find_ord_view(); - -extern miEnumType miHlhsrModeET[MI_MAXDRAWABLES][SI_HLHSR_NUM]; -extern miEnumType miDisplayUpdateModeET[MI_MAXDRAWABLES][SI_UPDATE_NUM]; - -static void deletewks(); - -/* init_pick_flag is initialized in ddpexInit() - * there are MIWKS_NUM_PICK_DEVICES pick devices (defined in miWks.h) - * pick_devices is the initial state for each of these that - * is used to initialize the pick devices in the wks - * pick_devices have to be initialized dynamically because - * there is a union in them - */ -ddBOOL init_pick_flag; -void initialize_pick_devices(); -miPickDevice pick_devices[MIWKS_NUM_PICK_DEVICES]; - -static ddNpcSubvolume NPCInit = -{{0.0, 0.0, 0.0}, -{1.0, 1.0, 1.0} -}; - -static ddViewport viewportInit = -{{0, 0, 0.0}, -{1, 1, 1.0}, -MI_TRUE -}; - -/* ugly globals for this module */ -static ddpex4rtn err4; -static ddpex43rtn err43; -static ddpex3rtn err3; -static int err; - -#define WKS_WINDOW_MASK 1 -#define WKS_VIEWPORT_MASK 2 - -/* here are the dynamics that our wks can support */ - -/* only one so far */ -ddBYTE mi_dynamics[MI_MAXDRAWABLES][MAX_DYNAMIC] = { - PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, - PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, PEXIRG, - PEXIRG, PEXIRG, PEXIRG -}; - -/* this macro checks to see if a change to the workstation affects - * the current display - */ -#define WKSIMMEDIATE(pws, attr) \ - ( (pws->displaySurface == PEXEmpty) || \ - ((pws)->dynamics[(int)attr] == PEXIMM) ) - -/* adjust this for the supported dynamics & update modes in your implementation - * this should be true if the change to the attribute is visualizable now - */ -#define VISUALIZE_NOW( pws, dynamic) \ - (((pws)->dynamics[(int)(dynamic)] == PEXIMM) || \ - ((pws)->displayUpdate == PEXVisualizeEach)) - -SetDoubleDrawable (pwks) -miWksPtr pwks; -{ - /* This routine sets the drawable pointer. It does this with or - without the MultiBuffer Extension - */ - - if (pwks->hasDoubleBuffer) - { - /* If you have the Double Buffer do whats right for the update mode */ - switch (pwks->displayUpdate) { - case PEXVisualizeEach: - case PEXVisualizeWhenever: - case PEXVisualizeNone: - pwks->pCurDrawable = pwks->doubleDrawables[pwks->curDoubleBuffer]; - pwks->usingDoubleBuffer = MI_TRUE; - break; - case PEXSimulateSome: - case PEXVisualizeEasy: - pwks->pCurDrawable = pwks->pRend->pDrawable; - pwks->usingDoubleBuffer = MI_FALSE; - break; - } - } - else - { - /* No Double Buffer so use the renderers drawable */ - pwks->usingDoubleBuffer = MI_FALSE; - pwks->pCurDrawable = pwks->pRend->pDrawable; - } -} - -ChangeDoubleBuffers (pwks) -miWksPtr pwks; -{ - - /* - * This routine does the actual work to create or delete the Double - * Buffers. It is a no-op if there is no MultiBuffer Extension or the - * drawable isn't a window, except it still has to SetDoubleBuffers to - * insure the right drawable gets used - */ - -#ifdef MULTIBUFFER - - if (pwks->pRend->pDrawable->type == DRAWABLE_WINDOW) - if (pwks->curBufferMode == PEXDoubleBuffered && !pwks->hasDoubleBuffer) - { - /* create the Double Buffers */ - int i; - int client; - int result; - XID ids[2]; - extern DrawablePtr GetBufferPointer (); - - client = CLIENT_ID(pwks->pRend->pDrawable->id); - for (i = 0; i < 2; i++) - ids[i] = FakeClientID (client); - result = CreateImageBuffers ((WindowPtr)(pwks->pRend->pDrawable), - 2, ids, - MultibufferUpdateActionBackground, - MultibufferUpdateHintFrequent); - if (result != Success) - { - pwks->pCurDrawable = pwks->pRend->pDrawable; - return; - } - for (i = 0; i < 2; i++) - pwks->doubleDrawables[i] = GetBufferPointer (pwks->pRend->pDrawable, i); - pwks->curDoubleBuffer = 1; - pwks->hasDoubleBuffer = MI_TRUE; - } - else if (pwks->curBufferMode == PEXSingleBuffered && pwks->hasDoubleBuffer) - { - /* Destroy the Double Buffers */ - DestroyImageBuffers ((WindowPtr)(pwks->pRend->pDrawable)); - pwks->hasDoubleBuffer = MI_FALSE; - } -#endif - - /* With or Without MultiBuffer Call this to set the Drawable Pointer */ - SetDoubleDrawable (pwks); -} - -SwapDoubleBuffers (pwks) -miWksPtr pwks; -{ - int i; - - /* This one swaps the buffers, a no-op if no MultiBuffer Extension */ - -#ifdef MULTIBUFFER - if (pwks->usingDoubleBuffer) - { - DisplayImageBuffers (&pwks->pCurDrawable->id, 1); - pwks->curDoubleBuffer ^= 1; - pwks->pCurDrawable = pwks->doubleDrawables[pwks->curDoubleBuffer]; - } -#endif -} - - - -/*++ - | - | Function Name: CreatePhigsWks - | - | Function Description: - | Handles the PEXCreatePhigsWKS request. - | - | Note(s): - | - --*/ - -/* set dst = src and if it's not NULL, update the ref list */ -#define MIWKS_SETLUT( SRCLUT, DSTLUT, WKS ) \ - if ( (DSTLUT) = (SRCLUT) ) { \ - if(UpdateLUTRefs( (DSTLUT), (diResourceHandle)WKS, \ - WORKSTATION_RESOURCE, ADD ) ) { \ - deletewks((miWksPtr)(WKS->deviceData), WKS); \ - return (BadAlloc); \ - } } - -#define MIWKS_SETNS( SRCNS, DSTNS, WKS ) \ - if ( (DSTNS) = (SRCNS) ) { \ - if (UpdateNSRefs( (DSTNS), (diResourceHandle)WKS, \ - WORKSTATION_RESOURCE, ADD )) { \ - deletewks((miWksPtr)(WKS->deviceData), WKS); \ - return (BadAlloc); \ - } } - -ddpex4rtn -CreatePhigsWks(pInitInfo, pWKS) -/* in */ - ddWksInit *pInitInfo; /* workstation info */ - diWKSHandle pWKS; /* workstation handle */ -/* out */ -{ - register miWksPtr pwks; - register ddRendererPtr prend; - ddOrdStruct *pos; - diLUTHandle view; - register int i; - int type; - -#ifdef DDTEST - ErrorF("\nCreatePhigsWks\n"); -#endif - pWKS->deviceData = NULL; - - if (!pInitInfo->pDrawable) - return (BadDrawable); - MI_WHICHDRAW(pInitInfo->pDrawable, type); - - pwks = (miWksPtr) xalloc(sizeof(miWksStr)); - if (pwks == NULL) - return (BadAlloc); - pWKS->deviceData = (ddPointer) pwks; - - pwks->pRend = NULL; - pwks->refCount = 0; - pwks->freeFlag = 0; - pwks->reqViewTable = 0; - - pwks->pwksList = puCreateList(DD_WKS); - if (!pwks->pwksList) { - xfree(pwks); - pWKS->deviceData = NULL; - return (BadAlloc); - } - - /* see miWks.h for explanation of how view priority list works - * there are dummy first and last entries */ - pwks->views.defined_views = 0; - pwks->views.highest = &(pwks->views.entries[0]); - pwks->views.lowest = &(pwks->views.entries[1]); - pwks->views.entries[0].defined = MI_FALSE; - pwks->views.entries[0].first_view = 0; - pwks->views.entries[0].last_view = 0; - pwks->views.entries[0].higher = NULL; - pwks->views.entries[0].lower = &(pwks->views.entries[2]); - pwks->views.entries[1].defined = MI_FALSE; - pwks->views.entries[1].first_view = 0; - pwks->views.entries[1].last_view = 0; - pwks->views.entries[1].higher = &(pwks->views.entries[2]); - pwks->views.entries[1].lower = NULL; - /* set first entry */ - pwks->views.entries[2].defined = MI_FALSE; - pwks->views.entries[2].first_view = 0; - pwks->views.entries[2].last_view = 65534; - pwks->views.entries[2].higher = &(pwks->views.entries[0]); - pwks->views.entries[2].lower = &(pwks->views.entries[1]); - /* set free entries */ - pwks->views.free = &(pwks->views.entries[3]); - for (i = 3; i < MIWKS_MAX_ORD_VIEWS - 1; i++) { - pwks->views.entries[i].defined = MI_FALSE; - pwks->views.entries[i].first_view = 0; - pwks->views.entries[i].last_view = 0; - pwks->views.entries[i].higher = &(pwks->views.entries[i - 1]); - pwks->views.entries[i].lower = &(pwks->views.entries[i + 1]); - } - /* redefine the higher value for the first free entry */ - pwks->views.entries[3].higher = NULL; - /* now define the last free entry */ - i = MIWKS_MAX_ORD_VIEWS - 1; - pwks->views.entries[i].defined = MI_FALSE; - pwks->views.entries[i].first_view = 0; - pwks->views.entries[i].last_view = 0; - pwks->views.entries[i].higher = &(pwks->views.entries[i - 1]); - pwks->views.entries[i].lower = NULL; - /* predefined views are set in the priority list later */ - - pwks->postedStructs.numStructs = 0; - pwks->postedStructs.postruct = NULL; - - prend = (ddRendererPtr) xalloc(sizeof(ddRendererStr)); - if (prend == NULL) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - pwks->pRend = prend; - - /* initialize the renderer */ - /* initialize the default pipeline context, if necessary, - and set this into the renderer */ - prend->pPC = NULL; - - /* initialize to 0, just in case we hit an alloc error and - call deletewks before finishing creation - */ - for (i = MI_FIRSTTABLETYPE; i <= PEXMaxTableType; i++) - prend->lut[i] = 0; - - for (i=0; i< (int) DD_MAX_FILTERS; i++) - prend->lut[i] = 0; - - for (i=0; i< MIWKS_NUM_PICK_DEVICES; i++) - pwks->devices[i].path = 0; - - /* expect a valid drawable */ - MI_SETDRAWEXAMPLE(pInitInfo->pDrawable, &(prend->drawExample)); - - prend->rendId = pWKS->id; - prend->pDrawable = pInitInfo->pDrawable; - prend->drawableId = pInitInfo->drawableId; - prend->curPath = puCreateList(DD_ELEMENT_REF); - prend->clipList = 0; - if (!prend->curPath) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - prend->clipList = puCreateList(DD_DEVICE_RECT); - if (!prend->clipList) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - prend->state = PEXIdle; - - /* add later: make sure that the drawable is OK for the luts */ - MIWKS_SETLUT(pInitInfo->pMarkerLUT, prend->lut[PEXMarkerBundleLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pTextLUT, prend->lut[PEXTextBundleLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pLineLUT, prend->lut[PEXLineBundleLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pIntLUT, prend->lut[PEXInteriorBundleLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pEdgeLUT, prend->lut[PEXEdgeBundleLUT], pWKS); - /* view table done later */ - MIWKS_SETLUT(pInitInfo->pColourLUT, prend->lut[PEXColourLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pDepthCueLUT, prend->lut[PEXDepthCueLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pLightLUT, prend->lut[PEXLightLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pColourAppLUT, prend->lut[PEXColourApproxLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pPatternLUT, prend->lut[PEXPatternLUT], pWKS); - MIWKS_SETLUT(pInitInfo->pFontLUT, prend->lut[PEXTextFontLUT], pWKS); - - MIWKS_SETNS(pInitInfo->pHighInclSet, prend->ns[(int) DD_HIGH_INCL_NS], pWKS); - MIWKS_SETNS(pInitInfo->pHighExclSet, prend->ns[(int) DD_HIGH_EXCL_NS], pWKS); - MIWKS_SETNS(pInitInfo->pInvisInclSet, prend->ns[(int) DD_INVIS_INCL_NS], pWKS); - MIWKS_SETNS(pInitInfo->pInvisExclSet, prend->ns[(int) DD_INVIS_EXCL_NS], pWKS); - /* These are for Renderer Picking, not used for Wks */ - MIWKS_SETNS(0, prend->ns[(int) DD_PICK_INCL_NS], pWKS); - MIWKS_SETNS(0, prend->ns[(int) DD_PICK_EXCL_NS], pWKS); - - - prend->hlhsrMode = PEXHlhsrOff; - prend->npcSubvolume = NPCInit; - - prend->viewport.useDrawable = MI_TRUE; - prend->viewport.minval.x = 0.0; - prend->viewport.minval.y = 0.0; - prend->viewport.minval.z = 0.0; - prend->viewport.maxval.x = prend->pDrawable->width; - prend->viewport.maxval.y = prend->pDrawable->height; - prend->viewport.maxval.z = 1.0; - /* don't really use renderer dynamics */ - prend->tablesMask = 0; - prend->namesetsMask = 0; - prend->attrsMask = 0; - prend->tablesChanges = 0; - prend->namesetsChanges = 0; - prend->attrsChanges = 0; - prend->immediateMode = FALSE; - - prend->pDDContext = NULL; - - /* new flags added for 5.1 need to be initialized */ - prend->backgroundColour.colourType = PEXIndexedColour; - prend->backgroundColour.colour.indexed.index = 0; - prend->clearI = FALSE; - prend->clearZ = TRUE; - prend->echoMode = PEXNoEcho; - prend->echoColour.colourType = PEXIndexedColour; - prend->echoColour.colour.indexed.index = 0; - - - pwks->displayUpdate = PEXVisualizeEach; - pwks->visualState = PEXCorrect; - pwks->displaySurface = PEXEmpty; - pwks->viewUpdate = PEXNotPending; - pwks->deltaviewMask = 0; - pwks->wksUpdate = PEXNotPending; - pwks->wksMask = 0; - - pwks->hlhsrUpdate = PEXNotPending; - - pwks->bufferUpdate = PEXNotPending; - pwks->curBufferMode = pwks->reqBufferMode = pInitInfo->bufferMode; - pwks->hasDoubleBuffer = MI_FALSE; - - pwks->reqNpcSubvolume = NPCInit; - - pwks->reqviewport.useDrawable = MI_TRUE; - pwks->reqviewport.minval.x = 0.0; - pwks->reqviewport.minval.y = 0.0; - pwks->reqviewport.minval.z = 0.0; - pwks->reqviewport.maxval.x = prend->pDrawable->width; - pwks->reqviewport.maxval.y = prend->pDrawable->height; - pwks->reqviewport.maxval.z = 1.0; - - /* - * pos: ordered structure list for posted structures. the first pos - * is a dummy - */ - pos = (ddOrdStruct *) xalloc(sizeof(ddOrdStruct)); - if (pos == NULL) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - pos->pstruct = 0; - pos->priority = 0; - pos->next = NULL; - pwks->postedStructs.postruct = pos; - pwks->postedStructs.numStructs = 0; - - /* - * create the view tables as PEX lookup tables use the wks id as the - * lut id. don't put the workstation on the view table's reference - * list, we don't want the LUT procedure to generate any picture - * redraws this also prevents any nasty side effects when the - * resource is deleted - */ - - /* requested view */ - /* first create the resource structure that has the table id and type */ - if (!(view = (diLUTHandle) xalloc(sizeof(ddLUTResource)))) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - view->id = pWKS->id; - view->lutType = PEXViewLUT; - - if (err43 = CreateLUT(pInitInfo->pDrawable, view)) { - deletewks(pwks, pWKS); - return (err43); - } - pwks->reqViewTable = view; - - /* current view */ - /* first create the resource structure that has the table id and type */ - if (!(view = (diLUTHandle) xalloc(sizeof(ddLUTResource)))) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - view->id = pWKS->id; - view->lutType = PEXViewLUT; - - if (err43 = CreateLUT(pInitInfo->pDrawable, view)) { - deletewks(pwks, pWKS); - return (err43); - } - prend->lut[PEXViewLUT] = view; - - /* - * add an entry for each predefined view note that this assumes that - * view 0 is defined to the PEX default values as required for PHIGS - * wks - */ - if ((MILUT_HEADER(view))->tableInfo.numPredefined) { - for (i = (MILUT_HEADER(view))->tableInfo.predefinedMin; - i <= (MILUT_HEADER(view))->tableInfo.predefinedMax; i++) { - err3 = mi_add_ord_view(&pwks->views, (ddUSHORT)i); - } - } - /* WksDynamics */ - for (i = 0; i < (int) MAX_DYNAMIC; i++) - pwks->dynamics[i] = mi_dynamics[type][i]; - - /* call level III procedure to create dd parts of renderer */ - if (err3 = InitRenderer(prend)) { - deletewks(pwks, pWKS); - return (err3); - } - - /* Pick device */ - if (!init_pick_flag) { - initialize_pick_devices(); - init_pick_flag = MI_TRUE; - } - for (i = 0; i < MIWKS_NUM_PICK_DEVICES; i++) { - pwks->devices[i] = pick_devices[i]; - if (!(pwks->devices[i].path = puCreateList(DD_PICK_PATH))) { - deletewks(pwks, pWKS); - return (BadAlloc); - } - } - - - /* do stuff here to set up hlhsr mode */ - - /* do stuff here to set up buffer mode */ - ChangeDoubleBuffers (pwks); - - return (Success); -} /* CreatePhigsWks */ - -static void -deletewks(pwks, pWKS) - miWksPtr pwks; - diWKSHandle pWKS; -{ - register ddRendererPtr prend; - register int i; - ddOrdStruct *pos, *posn; - - if (pwks == NULL) return; - prend = pwks->pRend; - if (prend) { - register int i; - for (i = MI_FIRSTTABLETYPE; i <= PEXMaxTableType; i++) { - if (prend->lut[i]) { - if (i != PEXViewLUT) - err43 = UpdateLUTRefs(prend->lut[i], (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, REMOVE); - else - - /* - * FreeLUT frees the resource handle structure and the - * dd struct if there are no outstanding refs to the LUT - */ - FreeLUT(prend->lut[i], pWKS->id); - prend->lut[i] = 0; - } - } - for (i = 0; i < (int) DD_MAX_FILTERS; i++) { - if (prend->ns[i]) - err43 = UpdateNSRefs(prend->ns[i], (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, REMOVE); - } - - if (prend->curPath) { - puDeleteList(prend->curPath); - prend->curPath = 0; } - if (prend->clipList) { - puDeleteList(prend->clipList); - prend->clipList = 0; } - - if (prend->pDDContext) { - DeleteDDContext(prend->pDDContext); - prend->pDDContext = 0; } - - if (prend->pPC) { - xfree(prend->pPC); /* allocated in one chunk */ - prend->pPC = 0;} - - xfree(prend); - pwks->pRend = 0; - } - - if (pwks->reqViewTable) { - FreeLUT(pwks->reqViewTable, pWKS->id); - pwks->reqViewTable; } - if (pwks->pwksList) { - puDeleteList(pwks->pwksList); - pwks->reqViewTable; } - - /* unpost all the structures */ - if (pwks->postedStructs.postruct) { - pos = pwks->postedStructs.postruct->next; /* first element is a dummy */ - while (pos) { - /* take the wks out of the structs wks lists */ - err4 = UpdateStructRefs( pos->pstruct, (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, REMOVE); - posn = pos; - pos = posn->next; - xfree(posn); - } - pwks->postedStructs.numStructs = 0; - pwks->postedStructs.postruct->next = 0; - xfree(pwks->postedStructs.postruct); - pwks->postedStructs.postruct = 0; - } - - /* pick devices */ - for (i = 0; i < MIWKS_NUM_PICK_DEVICES; i++) { - - /* - * paths are empty on initialization, but remember that structure - * reference count are updated when the path changes - */ - path_update_struct_refs(pwks->devices[i].path, (diResourceHandle) NULL, - PICK_RESOURCE, REMOVE); - - if (pwks->devices[i].path) { - puDeleteList(pwks->devices[i].path); - pwks->devices[i].path = 0; } - if (pwks->devices[i].inclusion) { - err43 = UpdateNSRefs(pwks->devices[i].inclusion, - (diResourceHandle) NULL, PICK_RESOURCE, REMOVE); - pwks->devices[i].inclusion = 0; } - if (pwks->devices[i].exclusion) { - err43 = UpdateNSRefs(pwks->devices[i].exclusion, - (diResourceHandle) NULL, PICK_RESOURCE, REMOVE); - pwks->devices[i].exclusion = 0; } - } - - xfree(pwks); - pWKS->deviceData = NULL; - return; -} /* deletewks */ - -#define CHECK_DELETE( pddwks, handle ) \ - if ((((pddwks)->freeFlag) == MI_TRUE) && (((pddwks)->refCount) <= 0 )) \ - { deletewks( pddwks, handle ); \ - xfree((char *)(handle)); \ - } - -/*++ - | - | Function Name: FreePhigsWks - | - | Function Description: - | Handles the PEXFreePhigsWKS request. - | - | Note(s): - | - --*/ - -ddpex4rtn -FreePhigsWks(pWKS, WKSid) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddResourceId WKSid; /* phigs workstation resource id */ -/* out */ -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nFreePhigsWks\n"); -#endif - - pWKS->id = PEXAlreadyFreed; - pwks->freeFlag = MI_TRUE; - CHECK_DELETE(pwks, pWKS); - - return (Success); -} /* FreePhigsWks */ - -/*++ - | - | Function Name: InquireWksInfo - | - | Function Description: - | Handles the PEXGetWKSInfo request. - | - | Note(s): - | - --*/ - -/* depends on 'mask' being defined */ -#define WKS_CHECK_BITMASK( bitIndex ) \ - if (mask[((bitIndex)/32)] & (((unsigned long)1) << ((bitIndex) % 32))) - -/* depends on 'mask' and needbytes being there */ -#define COUNTBYTES( type, bytes ) \ - WKS_CHECK_BITMASK( type ) \ - needbytes += (bytes) - -static XID ulNULL = 0; - -#define PLUTID( plut ) \ - (plut)==NULL ? &ulNULL : &(plut)->id - -#define PNSID( pns ) \ - (pns)==NULL ? &ulNULL : &(pns)->id - -ddpex4rtn -InquireWksInfo(pWKS, mask, pNumValues, pBuffer) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddBitmask mask[2];/* item mask */ -/* out */ - ddULONG *pNumValues; /* number of items returned */ - ddBufferPtr pBuffer;/* workstation information */ -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddULONG needbytes; - int sshort, sulong, sbyte, sushort, sfloat, spexNpcSubvolume, spexViewport; - ddPointer pbyte; - -#ifdef DDTEST - ErrorF("\nInquireWksInfo\n"); -#endif - - *pNumValues = 0; - - /* calculate the number of bytes needed to return the info */ - needbytes = 0; - - COUNTBYTES(PEXPWDisplayUpdate, 4); - COUNTBYTES(PEXPWVisualState, 4); - COUNTBYTES(PEXPWDisplaySurface, 4); - COUNTBYTES(PEXPWViewUpdate, 4); - COUNTBYTES(PEXPWDefinedViews, (4 + 4 * pwks->views.defined_views)); - COUNTBYTES(PEXPWWksUpdate, 4); - COUNTBYTES(PEXPWReqNpcSubvolume, 24); - COUNTBYTES(PEXPWCurNpcSubvolume, 24); - COUNTBYTES(PEXPWReqWksViewport, 20); - COUNTBYTES(PEXPWCurWksViewport, 20); - COUNTBYTES(PEXPWHlhsrUpdate, 4); - COUNTBYTES(PEXPWReqHlhsrMode, 4); - COUNTBYTES(PEXPWCurHlhsrMode, 4); - COUNTBYTES(PEXPWDrawable, 4); - COUNTBYTES(PEXPWMarkerBundle, 4); - COUNTBYTES(PEXPWTextBundle, 4); - COUNTBYTES(PEXPWLineBundle, 4); - COUNTBYTES(PEXPWInteriorBundle, 4); - COUNTBYTES(PEXPWEdgeBundle, 4); - COUNTBYTES(PEXPWColourTable, 4); - COUNTBYTES(PEXPWDepthCueTable, 4); - COUNTBYTES(PEXPWLightTable, 4); - COUNTBYTES(PEXPWColourApproxTable, 4); - COUNTBYTES(PEXPWPatternTable, 4); - COUNTBYTES(PEXPWTextFontTable, 4); - COUNTBYTES(PEXPWHighlightIncl, 4); - COUNTBYTES(PEXPWHighlightExcl, 4); - COUNTBYTES(PEXPWInvisibilityIncl, 4); - COUNTBYTES(PEXPWInvisibilityExcl, 4); - COUNTBYTES(PEXPWPostedStructures, (4 + 8 * pwks->postedStructs.numStructs)); - COUNTBYTES(PEXPWNumPriorities, 4); - COUNTBYTES(PEXPWBufferUpdate, 4); - COUNTBYTES(PEXPWCurBufferMode, 4); - COUNTBYTES(PEXPWReqBufferMode, 4); - - PU_CHECK_BUFFER_SIZE(pBuffer, needbytes); - - /* let's remember a few sizes */ - sshort = sizeof(ddSHORT); - ASSURE(sshort == 2); - sbyte = sizeof(ddBYTE); - ASSURE(sbyte == 1); - sulong = sizeof(ddULONG); - ASSURE(sulong == 4); - sushort = sizeof(ddUSHORT); - ASSURE(sushort == 2); - sfloat = sizeof(ddFLOAT); - ASSURE(sfloat == 4); - spexNpcSubvolume = sizeof(ddNpcSubvolume); - ASSURE(spexNpcSubvolume == 24); - spexViewport = sizeof(ddViewport); - ASSURE(spexViewport == 20); - - pbyte = pBuffer->pBuf; - - /* return the info in the format encoded for the reply */ - - /* - Took out the micopy usage cause it was a real brain dead way - to do this. Note that this stuff NEVER checks the buffer size, - maybe I'll add this someday - JSH - */ - WKS_CHECK_BITMASK(PEXPWDisplayUpdate) { - PACK_CARD32(pwks->displayUpdate, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWVisualState) { - PACK_CARD32(pwks->visualState, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWDisplaySurface) { - PACK_CARD32(pwks->displaySurface, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWViewUpdate) { - PACK_CARD32(pwks->viewUpdate, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWDefinedViews) { - /* returns in order, highest priority view first */ - ddOrdView *indexer; - - (*pNumValues) += pwks->views.defined_views; - PACK_CARD32(pwks->views.defined_views, pbyte); - indexer = pwks->views.highest; - do { - if (indexer->defined) { - PACK_CARD32(indexer->first_view, pbyte); - } - indexer = indexer->lower; - } while (indexer != NULL); - } - WKS_CHECK_BITMASK(PEXPWWksUpdate) { - PACK_CARD32(pwks->wksUpdate, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWReqNpcSubvolume) { - PACK_STRUCT(ddNpcSubvolume, &(pwks->reqNpcSubvolume), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWCurNpcSubvolume) { - PACK_STRUCT(ddNpcSubvolume, &(pwks->pRend->npcSubvolume), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWReqWksViewport) { - PACK_STRUCT(ddViewport, &(pwks->reqviewport), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWCurWksViewport) { - PACK_STRUCT(ddViewport, &(pwks->pRend->viewport), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWHlhsrUpdate) { - PACK_CARD32(pwks->hlhsrUpdate, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWReqHlhsrMode) { - PACK_CARD32(pwks->reqhlhsrMode, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWCurHlhsrMode) { - PACK_CARD32(pwks->pRend->hlhsrMode, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWDrawable) { - PACK_CARD32(pwks->pRend->drawableId, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWMarkerBundle) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXMarkerBundleLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWTextBundle) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXTextBundleLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWLineBundle) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXLineBundleLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWInteriorBundle) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXInteriorBundleLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWEdgeBundle) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXEdgeBundleLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWColourTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXColourLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWDepthCueTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXDepthCueLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWLightTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXLightLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWColourApproxTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXColourApproxLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWPatternTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXPatternLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWTextFontTable) { - PACK_CARD32(*(PLUTID(pwks->pRend->lut[PEXTextFontLUT])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWHighlightIncl) { - PACK_CARD32(*(PNSID(pwks->pRend->ns[(int) DD_HIGH_INCL_NS])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWHighlightExcl) { - PACK_CARD32(*(PNSID(pwks->pRend->ns[(int) DD_HIGH_EXCL_NS])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWInvisibilityIncl) { - PACK_CARD32(*(PNSID(pwks->pRend->ns[(int) DD_INVIS_INCL_NS])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWInvisibilityExcl) { - PACK_CARD32(*(PNSID(pwks->pRend->ns[(int) DD_INVIS_EXCL_NS])), pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWPostedStructures) { - register ddOrdStruct *pos; - - PACK_CARD32(pwks->postedStructs.numStructs, pbyte); - pos = pwks->postedStructs.postruct; - while (pos->next) { - PACK_CARD32(pos->next->pstruct->id, pbyte); - PACK_FLOAT(pos->next->priority, pbyte); - pos = pos->next; - } - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWNumPriorities) { - - /* - * return 0 for now - should implement num_priorities as part - * of the wks - */ - PACK_CARD32( 0, pbyte); - (*pNumValues)++; - } - - WKS_CHECK_BITMASK( PEXPWBufferUpdate ) - { - PACK_CARD32( pwks->bufferUpdate, pbyte); - (*pNumValues)++; - } - - WKS_CHECK_BITMASK(PEXPWReqBufferMode) { - PACK_CARD32( pwks->reqBufferMode, pbyte); - (*pNumValues)++; - } - WKS_CHECK_BITMASK(PEXPWCurBufferMode) { - PACK_CARD32( pwks->curBufferMode, pbyte); - (*pNumValues)++; - } - pBuffer->dataSize = needbytes; - ASSURE(needbytes == (pbyte - pBuffer->pBuf)); - - return (Success); -} /* InquireWksInfo */ - -/*++ - | - | Function Name: InquireWksDynamics - | - | Function Description: - | Handles the PEXGetDynamics request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireWksDynamics(pDrawable, pValues) -/* in */ - DrawablePtr pDrawable; /* drawable */ -/* out */ - ddWksDynamics *pValues;/* dynamics information */ -{ - ddBYTE *pdtable; - int type; - -#ifdef DDTEST - ErrorF("\nInquireWksDynamics\n"); -#endif - - MI_WHICHDRAW(pDrawable, type); - - pdtable = mi_dynamics[type]; - pValues->viewRep = pdtable[(int) VIEW_REP_DYNAMIC]; - pValues->markerBundle = pdtable[(int) MARKER_BUNDLE_DYNAMIC]; - pValues->textBundle = pdtable[(int) TEXT_BUNDLE_DYNAMIC]; - pValues->lineBundle = pdtable[(int) LINE_BUNDLE_DYNAMIC]; - pValues->interiorBundle = pdtable[(int) INTERIOR_BUNDLE_DYNAMIC]; - pValues->edgeBundle = pdtable[(int) EDGE_BUNDLE_DYNAMIC]; - pValues->colourTable = pdtable[(int) COLOUR_TABLE_DYNAMIC]; - pValues->patternTable = pdtable[(int) PATTERN_TABLE_DYNAMIC]; - pValues->wksTransform = pdtable[(int) WKS_TRANSFORM_DYNAMIC]; - pValues->highlightFilter = pdtable[(int) HIGH_FILTER_DYNAMIC]; - pValues->invisFilter = pdtable[(int) INVIS_FILTER_DYNAMIC]; - pValues->hlhsrMode = pdtable[(int) HLHSR_MODE_DYNAMIC]; - pValues->strModify = pdtable[(int) STR_MODIFY_DYNAMIC]; - pValues->postStr = pdtable[(int) POST_STR_DYNAMIC]; - pValues->unpostStr = pdtable[(int) UNPOST_STR_DYNAMIC]; - pValues->deleteStr = pdtable[(int) DELETE_STR_DYNAMIC]; - pValues->refModify = pdtable[(int) REF_MODIFY_DYNAMIC]; - pValues->bufferModify = pdtable[(int) BUFFER_MODIFY_DYNAMIC]; - pValues->lightTable = pdtable[(int) BUFFER_MODIFY_DYNAMIC]; - pValues->depthCueTable = pdtable[(int) BUFFER_MODIFY_DYNAMIC]; - pValues->colourApproxTable = pdtable[(int) BUFFER_MODIFY_DYNAMIC]; - - return (Success); -} /* InquireWksDynamics */ - -/*++ - | - | Function Name: InquireViewRep - | - | Function Description: - | Handles the PEXGetViewRep request. - | - | Note(s): - | - --*/ - -ddpex4rtn -InquireViewRep(pWKS, index, pUpdate, pRequested, pCurrent) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddTableIndex index; /* view table index */ -/* out */ - ddUSHORT *pUpdate;/* (pending/notpending) */ - ddViewRep *pRequested; /* requested view */ - ddViewRep *pCurrent; /* current view */ -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddUSHORT status; - ddBuffer buffer; - -#ifdef DDTEST - ErrorF("\nInquireViewRep\n"); -#endif - - *pUpdate = pwks->viewUpdate; - buffer.bufSize = 0; - buffer.dataSize = 0; - buffer.pBuf = NULL; - buffer.pHead = NULL; - if (err43 = InquireLUTEntry(pwks->reqViewTable, index, PEXSetValue, &status, &buffer)) - return (err43); - pRequested->index = index; - mibcopy(buffer.pBuf, &(pRequested->view), sizeof(ddViewEntry)); - if (err43 = InquireLUTEntry(pwks->pRend->lut[PEXViewLUT], index, PEXSetValue, &status, &buffer)) - return (err43); - pCurrent->index = index; - mibcopy(buffer.pBuf, &(pCurrent->view), sizeof(ddViewEntry)); - xfree(buffer.pHead); - return (Success); -} /* InquireViewRep */ - -/*++ - | - | Function Name: RedrawStructures - | - | Function Description: - | Handles the PEXRedrawAllStructures request. - | - | Note(s): - | - --*/ - -ddpex4rtn -RedrawStructures(pWKS) -/* in */ - diWKSHandle pWKS; /* workstation handle */ -/* out */ -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - register DrawablePtr pDraw = pwks->pRend->pDrawable; - - -#ifdef DDTEST - ErrorF("\nRedrawStructures\n"); -#endif - - if ( (pDraw == NULL) - || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - if (pDraw->class == InputOnly) /* from dix dispatch.c */ - return (BadMatch); - else if (!pwks->usingDoubleBuffer) {/* pixmap: fill the rectangle ???? */ - - GCPtr pGC; - extern GCPtr CreateScratchGC(); - extern int ChangeGC(); - extern void ValidateGC(); - xRectangle xrect; - ddUSHORT status; - miColourEntry *pLUT; - unsigned long gcmask, colourindex; - - /* - * get background colour and convert it to an X pixel use - * default entry (0) in colourApprox LUT for the conversion - */ - InquireLUTEntryAddress( PEXColourLUT, pwks->pRend->lut[PEXColourLUT], 0, - &status, &pLUT); - miColourtoIndex(pwks->pRend, 0, &pLUT->entry, &colourindex); - - pGC = CreateScratchGC(pDraw->pScreen, pDraw->depth); - gcmask = GCForeground; - ChangeGC(pGC, gcmask, &colourindex); - ValidateGC(pDraw, pGC); - xrect.x = 0; - xrect.y = 0; - xrect.width = pDraw->width; - xrect.height = pDraw->height; - (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &xrect); - FreeScratchGC(pGC); - pwks->displaySurface = PEXEmpty; - } - - /* - * If any attributes are set to Pending, make the requested values - * current and reset to NotPending - for the following - */ - - if (pwks->viewUpdate == PEXPending) { - register ddUSHORT i, maxviews; - ddUSHORT status; - ddBuffer buffer; - - buffer.bufSize = sizeof(ddViewEntry); - buffer.dataSize = 0; - buffer.pHead = buffer.pBuf = (ddPointer) xalloc(sizeof(ddViewEntry)); - - if (!buffer.pBuf) return (BadAlloc); /* we're out of memory! */ - - /* - * loop to check each entry to see if it is pending assume - * they are not consecutive entries and set them one at a - * time - */ - maxviews = MIWKS_MAX_VIEWS; - for (i = 0; i < maxviews; i++) { - if (pwks->deltaviewMask & (1L << i)) { - - if (err43 = InquireLUTEntry( pwks->reqViewTable, i, - PEXSetValue, &status, &buffer)) - return (err43); /* we're out of memory! */ - - if (err43 = SetLUTEntries( pwks->pRend->lut[PEXViewLUT], - i, 1, buffer.pBuf)) - return (err43); /* we're out of memory! */ - - /* - * make sure it is in the list of defined - * views - */ - err43 = mi_add_ord_view(&pwks->views, i); - if (err43) return (err43); /* we're out of memory! */ - } - } - pwks->deltaviewMask = 0; - xfree(buffer.pBuf); - pwks->viewUpdate = PEXNotPending; - } - - if (pwks->wksUpdate == PEXPending) { - if (pwks->wksMask & WKS_WINDOW_MASK) { - pwks->pRend->npcSubvolume = pwks->reqNpcSubvolume; - pwks->pRend->attrsChanges |= PEXDynNpcSubvolume; - } - - if (pwks->wksMask & WKS_VIEWPORT_MASK) { - pwks->pRend->viewport = pwks->reqviewport; - pwks->pRend->attrsChanges |= PEXDynViewport; - } - - pwks->wksMask = 0; - pwks->wksUpdate = PEXNotPending; - } - - if (pwks->hlhsrUpdate == PEXPending) { - pwks->pRend->hlhsrMode = pwks->reqhlhsrMode; - pwks->hlhsrUpdate = PEXNotPending; - pwks->pRend->attrsChanges |= PEXDynHlhsrMode; - /* do stuff here to effect change in hlhsr mode */ - } - - if (pwks->bufferUpdate == PEXPending) { - pwks->curBufferMode = pwks->reqBufferMode; - pwks->bufferUpdate = PEXNotPending; - /* do stuff here to effect change in buffer mode */ - ChangeDoubleBuffers (pwks); - } - err = miTraverse(pWKS); - - SwapDoubleBuffers (pwks); - - /* Set visual_state to Correct */ - pwks->visualState = PEXCorrect; - /* display Surface is set in miTraverse */ - - return (err); -} /* RedrawStructures */ - - -/*++ - | - | Function Name: UpdateWks - | - | Function Description: - | Handles the PEXUpdateWorkstation request. - | - | Note(s): - | - --*/ - -ddpex4rtn -UpdateWks(pWKS) -/* in */ - diWKSHandle pWKS; /* workstation handle */ -/* out */ -{ - /* If visual_state is Deferred or Simulated, call RedrawAll */ - if (((miWksPtr) pWKS->deviceData)->visualState != PEXCorrect) { - return (RedrawStructures(pWKS)); - } - return (Success); -} /* UpdateWks */ - -/*++ - | - | Function Name: RedrawClipRegion - | - | Function Description: - | Handles the PEXRedrawClipRegion request. - | - | Note(s): - | - --*/ - -ddpex4rtn -RedrawClipRegion(pWKS, numRects, pRects) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddULONG numRects; /* number of rectangles in list */ - ddDeviceRect *pRects; /* list of rectangles */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nRedrawClipRegion\n"); -#endif - - /* - * set the clip list in the renderer first, empty the clip list - */ - pwks->pRend->clipList->numObj = 0; - if (puAddToList((ddPointer) pRects, numRects, pwks->pRend->clipList) - == MI_ALLOCERR) - return (BadAlloc); - - pwks->pRend->attrsChanges |= PEXDynClipList; - - /* now redraw picture without updating any state */ - miTraverse(pWKS); /* ignore errors */ - - - /* - * The clip list must be emptied so that subsequent workstation - * updates redraw the entire display surface. - */ - - pwks->pRend->clipList->numObj = 0; - - return (Success); -} /* RedrawClipRegion */ - -/*++ - | - | Function Name: ExecuteDeferred - | - | Function Description: - | Handles the PEXExecutedDeferredActions request. - | - | Note(s): - There is no definition in PHIGS or PEX of what this - is supposed to do. The PHIGS people we have talked - to agree with this. Therefore, we have implemented - it as a no-op. - | - --*/ - -ddpex4rtn -ExecuteDeferred(pWKS) -/* in */ - diWKSHandle pWKS; /* workstation handle */ -/* out */ -{ - -#ifdef DDTEST - ErrorF("\nExecuteDeferred\n"); -#endif - - return (Success); -} /* ExecuteDeferred */ - -/*++ - | - | Function Name: SetViewPriority - | - | Function Description: - | Handles the PEXSetViewPriority request. - | - | Note(s): - move index1 to priority relative to index2 - | - --*/ - -ddpex4rtn -SetViewPriority(pWKS, index1, index2, priority) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddTableIndex index1; /* view index */ - ddTableIndex index2; /* view index */ - ddUSHORT priority; /* (higher/lower) */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddOrdView *entry1, *entry2; - -#ifdef DDTEST - ErrorF("\nSetViewPriority\n"); -#endif - - if ((priority != PEXHigher) && (priority != PEXLower)) - return (BadValue); - - entry1 = mi_find_ord_view(&pwks->views, index1); - entry2 = mi_find_ord_view(&pwks->views, index2); - - if ((entry1 == NULL) || (entry2 == NULL)) - return (BadValue); /* a view is not defined */ - - if (index1 == index2) - return (Success); - - if (priority == PEXLower) { - /* don't do anything if index1 is already next lowest */ - if (entry2->lower != entry1) { - /* take entry1 out of its position */ - entry1->higher->lower = entry1->lower; - entry1->lower->higher = entry1->higher; - /* put entry1 before entry2->lower */ - entry1->lower = entry2->lower; - entry2->lower->higher = entry1; - /* put entry1 after entry2 */ - entry2->lower = entry1; - entry1->higher = entry2; - } - } else { /* PEXHigher */ - /* don't do anything if index1 is already next highest */ - if (entry2->higher != entry1) { - /* take entry1 out of its position */ - entry1->higher->lower = entry1->lower; - entry1->lower->higher = entry1->higher; - /* put entry1 after entry2->higher */ - entry1->higher = entry2->higher; - entry2->higher->lower = entry1; - /* put entry1 before entry2 */ - entry2->higher = entry1; - entry1->lower = entry2; - } - } - - return (Success); -} /* SetViewPriority */ - -/*++ - | - | Function Name: SetDisplayUpdateMode - | - | Function Description: - | Handles the PEXSetDisplayUpdateMode request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetDisplayUpdateMode(pWKS, mode) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddSHORT mode; /* display update mode */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - register int type, i; - -#ifdef DDTEST - ErrorF("\nSetDisplayUpdateMode\n"); -#endif - - if ((pwks->pRend->pDrawable == NULL) || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - /* todo: put drawtype in wks header */ - - MI_WHICHDRAW(pwks->pRend->pDrawable, type); - - /* - * make sure this mode is supported by the drawable in this - * implementation - */ - for (i = 0; i < SI_UPDATE_NUM; i++) { - if (mode == miDisplayUpdateModeET[type][i].index) { - pwks->displayUpdate = mode; - SetDoubleDrawable (pwks); - if (mode == PEXVisualizeEach) - - /* - * you may want to do this if mode = - * PEXWhenever, too - */ - { - /* regen the picture if it isn't correct */ - if (pwks->visualState != PEXCorrect) { - if (err4 = RedrawStructures(pWKS)) - return (err4); - pwks->visualState = PEXCorrect; - } - } - return (Success); - } - } - - return (BadValue); -} /* SetDisplayUpdateMode */ - -/* get_view gets the view transforms from the view table and - * it returns the composit transform and the clipping info - * it calculates the composite view transform if the vomFlag is true - */ -static int -get_view(view_table, view_index, clipflag, clips, vom, vomFlag) - diLUTHandle view_table; - ddTableIndex view_index; - ddUSHORT *clipflag; - ddNpcSubvolume *clips; - ddFLOAT vom[4][4]; - ddBYTE vomFlag; -{ - ddBuffer buffer; - ddUSHORT status; - ddFLOAT orient[4][4]; - ddFLOAT map[4][4]; - - /* get view rep */ - buffer.pHead = buffer.pBuf = NULL; - buffer.dataSize = buffer.bufSize = 0; - err = InquireLUTEntry(view_table, view_index, PEXSetValue, &status, &buffer); - if (err != Success) - return (err); - - mibcopy(&(((ddViewEntry *) buffer.pBuf)->clipLimits), - clips, sizeof(ddNpcSubvolume)); - *clipflag = ((ddViewEntry *) buffer.pBuf)->clipFlags; - - if (vomFlag) { - mibcopy((((ddViewEntry *) buffer.pBuf)->orientation), - orient, 16 * sizeof(ddFLOAT)); - mibcopy((((ddViewEntry *) buffer.pBuf)->mapping), - map, 16 * sizeof(ddFLOAT)); - miMatMult(vom, orient, map); - } - xfree(buffer.pHead); - return (Success); -} - -/* no check for z when using drawable */ -#define PT_IN_LIMIT(prend, lim, pt) \ - ( (pt)->x >= (lim)->minval.x && (pt)->x <= (lim)->maxval.x \ - && (pt)->y >= (lim)->minval.y && (pt)->y <= (lim)->maxval.y \ - && (pt)->z >= (lim)->minval.z && (pt)->z <= (lim)->maxval.z ) - -/*++ - | - | Function Name: MapDcWc - | - | Function Description: - | Handles the PEXMapDCtoWC request. - | - | Note(s): - | - --*/ - -ddpex4rtn -MapDcWc(pWKS, numPoints, pDCpoints, pRetPoints, pWCpoints, pView) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddULONG numPoints; /* number of coords */ - ddDeviceCoord *pDCpoints; /* list of device coords */ -/* out */ - ddULONG *pRetPoints; /* number of coords returned */ - ddCoord3D *pWCpoints; /* list of world coords */ - ddUSHORT *pView; /* view index */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddFLOAT npc_dc_xform[4][4]; - ddFLOAT npc_to_wc_xform[4][4]; - ddUSHORT clipFlags; - ddNpcSubvolume clipLimits; - ddDeviceCoord *pDCpoint; - ddCoord3D *pWCpoint; - ddCoord4D pt4d1, pt4d2; - register int i; - ddTableIndex view = 0; - int ptcount = 0, tmpcount = 0; - ddOrdView *poview; - ddBOOL last_view; - -#ifdef DDTEST - ErrorF("\nMapDcWc\n"); -#endif - - *pView = 0; - *pRetPoints = 0; - - /* - * transforms: wc_to_npc_xform = [view orient][view map] - * npc_to_wc_xform = inverse(wc_to_npc_xform) - * npc_to_dc_xform = [Sx 0 0 0] - * S=Scale [0 Sy 0 0] - * T=Translate [0 0 Sz 0] - * [Tx Ty Tz 1] - * dc_to_npc_xform = inverse(npc_to_dc_xform) - * wc_point = [npc_to_wc_xform][npc_point] - * npc_point = * [dc_to_npc_xform][dc_point] - * (dc_point is a 4d column vector of the - * given dc with w=1.0) - */ - miBldViewport_xform(pwks->pRend, pwks->pRend->pDrawable, - npc_dc_xform, NULL); - miMatInverse(npc_dc_xform); - - /* - * go through each defined view and find the one which has the most - * points in it and the highest priority - */ - for (last_view = 0, poview = pwks->views.lowest; !last_view; poview = poview->higher) { - if (poview->defined) { - err = get_view(pwks->pRend->lut[PEXViewLUT], poview->first_view, &clipFlags, - &clipLimits, npc_to_wc_xform, MI_FALSE); - if (err != Success) - return (err); - - for (i = 0, pWCpoint = pWCpoints, pDCpoint = pDCpoints; i < numPoints; i++, pDCpoint++) { - pt4d1.x = pDCpoint->x; - pt4d1.y = pDCpoint->y; - pt4d1.z = pDCpoint->z; - pt4d1.w = 1.0; - miTransformPoint(&pt4d1, npc_dc_xform, &pt4d2); - if (PT_IN_LIMIT(pwks->pRend, &clipLimits, &pt4d2)) - tmpcount++; - } - - /* - * use this view if it has more points. if it has - * same number then this view has higher priority - */ - if (tmpcount >= ptcount) { - view = poview->first_view; - ptcount = tmpcount; - } - } - last_view = (poview == pwks->views.highest); - } - - err = get_view(pwks->pRend->lut[PEXViewLUT], view, &clipFlags, &clipLimits, - npc_to_wc_xform, MI_TRUE); - if (err != Success) - return (err); - miMatInverse(npc_to_wc_xform); - - for (i = 0, pWCpoint = pWCpoints, pDCpoint = pDCpoints; i < numPoints; i++, pDCpoint++) { - pt4d1.x = pDCpoint->x; - pt4d1.y = pDCpoint->y; - pt4d1.z = pDCpoint->z; - pt4d1.w = 1.0; - miTransformPoint(&pt4d1, npc_dc_xform, &pt4d2); - if (PT_IN_LIMIT(pwks->pRend, &clipLimits, &pt4d2)) { - miTransformPoint(&pt4d2, npc_to_wc_xform, &pt4d1); - pWCpoint->x = pt4d1.x; - pWCpoint->y = pt4d1.y; - pWCpoint->z = pt4d1.z; - pWCpoint++; - (*pRetPoints)++; - } - } - - *pView = view; - return (Success); -} /* MapDcWc */ - -/*++ - | - | Function Name: MapWcDc - | - | Function Description: - | Handles the PEXMapWCtoDC request. - | - | Note(s): - | - --*/ - -ddpex4rtn -MapWcDc(pWKS, numPoints, pWCpoints, view, pRetPoints, pDCpoints) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddULONG numPoints; /* number of coords */ - ddCoord3D *pWCpoints; /* list of world coords */ - ddTableIndex view; /* view index */ -/* out */ - ddULONG *pRetPoints; /* number of coords returned */ - ddDeviceCoord *pDCpoints; /* list of device coords */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddFLOAT wc_to_npc_xform[4][4]; - ddFLOAT npc_to_dc_xform[4][4]; - ddUSHORT clipFlags; - ddNpcSubvolume clipLimits; - ddDeviceCoord *pDCpoint; - ddCoord3D *pWCpoint; - ddCoord4D pt4d1, pt4d2; - register int i; - -#ifdef DDTEST - ErrorF("\nMapWcDc\n"); -#endif - - *pRetPoints = 0; - - /* - * transforms: wc_to_npc_xform = [view orient][view map] - * npc_point = [wc_to_npc_xform][wc_point] - * (wc_point is a 4d column vector of the - * given wc with w=1.0) - * npc_to_dc_xform = [Sx 0 0 0] - * S=Scale [0 Sy 0 0] - * T=Translate [0 0 Sz 0] - * [Tx Ty Tz 1] - * dc_point = [npc_to_dc_xform][npc_point] - */ - miBldViewport_xform(pwks->pRend, pwks->pRend->pDrawable, - npc_to_dc_xform, NULL); - - err = get_view(pwks->pRend->lut[PEXViewLUT], view, &clipFlags, &clipLimits, wc_to_npc_xform, MI_TRUE); - if (err != Success) - return (err); - - for (i = 0, pWCpoint = pWCpoints, pDCpoint = pDCpoints; i < numPoints; i++, pWCpoint++) { - pt4d1.x = pWCpoint->x; - pt4d1.y = pWCpoint->y; - pt4d1.z = pWCpoint->z; - pt4d1.w = 1.0; - miTransformPoint(&pt4d1, wc_to_npc_xform, &pt4d2); - if (PT_IN_LIMIT(pwks->pRend, &clipLimits, &pt4d2)) { - miTransformPoint(&pt4d2, npc_to_dc_xform, &pt4d1); - pDCpoint->x = pt4d1.x; - pDCpoint->y = pt4d1.y; - pDCpoint->z = pt4d1.z; - pDCpoint++; - (*pRetPoints)++; - } - } - - return (Success); -} /* MapWcDc */ - -/*++ - | - | Function Name: SetViewRep - | - | Function Description: - | Handles the PEXSetViewRep request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetViewRep(pWKS, pView) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddViewRep *pView; /* view rep */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nSetViewRep\n"); -#endif - - /* set the requested tables */ - if (err43 = SetLUTEntries(pwks->reqViewTable, pView->index, 1, (ddPointer) & (pView->view))) - return (err43); - - if (VISUALIZE_NOW(pwks, VIEW_REP_DYNAMIC)) { - /* set the current tables */ - if (err43 = SetLUTEntries(pwks->pRend->lut[PEXViewLUT], pView->index, 1, - (ddPointer) & (pView->view))) - return (err43); - - /* set view as defined in view priority list */ - err43 = mi_add_ord_view(&pwks->views, pView->index); - if (err43) - return (err43); - - pwks->viewUpdate = PEXNotPending; - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(WKS_TRANSFORM_DYNAMIC, pwks->pwksList); - } else { - - /* - * set mask to show which entry is pending NOTE: mask is only - * big enough for tables <= 32 entries our table only has 6 - * entries right now - */ - pwks->deltaviewMask |= (1L << pView->index); - - pwks->viewUpdate = PEXPending; - pwks->visualState = PEXDeferred; - } - - return (Success); -} /* SetViewRep */ - -/*++ - | - | Function Name: SetWksWindow - | - | Function Description: - | Handles the PEXSetWKSWindow request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetWksWindow(pWKS, pNpcSubvolume) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddNpcSubvolume *pNpcSubvolume; /* window volume */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nSetWksWindow\n"); -#endif - - pwks->reqNpcSubvolume = *pNpcSubvolume; - - if (VISUALIZE_NOW(pwks, WKS_TRANSFORM_DYNAMIC)) { - pwks->pRend->npcSubvolume = *pNpcSubvolume; - pwks->pRend->attrsChanges |= PEXDynNpcSubvolume; - - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(WKS_TRANSFORM_DYNAMIC, pwks->pwksList); - } else { - /* don't update display */ - pwks->wksUpdate = PEXPending; - pwks->visualState = PEXDeferred; - pwks->wksMask |= WKS_WINDOW_MASK; - } - return (Success); -} /* SetWksWindow */ - -/*++ - | - | Function Name: SetWksViewport - | - | Function Description: - | Handles the PEXSetWKSViewport request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetWksViewport(pWKS, pViewport) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddViewport *pViewport; /* viewport */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nSetWksViewport\n"); -#endif - - if ((pwks->pRend->pDrawable == NULL) || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - if (pViewport->useDrawable) { - pwks->reqviewport.minval.x = 0.0; - pwks->reqviewport.minval.y = 0.0; - pwks->reqviewport.minval.z = 0.0; - pwks->reqviewport.maxval.x = pwks->pRend->pDrawable->width; - pwks->reqviewport.maxval.y = pwks->pRend->pDrawable->height; - pwks->reqviewport.maxval.z = 1.0; - } else - pwks->reqviewport = *pViewport; - - if (VISUALIZE_NOW(pwks, WKS_TRANSFORM_DYNAMIC)) { - pwks->pRend->viewport = *pViewport; - pwks->pRend->attrsChanges |= PEXDynViewport; - - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(WKS_TRANSFORM_DYNAMIC, pwks->pwksList); - } else { - /* don't update display */ - pwks->wksUpdate = PEXPending; - pwks->visualState = PEXDeferred; - pwks->wksMask |= WKS_VIEWPORT_MASK; - } - - return (Success); -} /* SetWksViewport */ - -/*++ - | - | Function Name: SetHlhsrMode - | - | Function Description: - | Handles the PEXSetHLHSRMode request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetHlhsrMode(pWKS, mode) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddEnumTypeIndex mode; /* hlhsr mode */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - register int i, type; - -#ifdef DDTEST - ErrorF("\nSetHlhsrMode\n"); -#endif - - if ((pwks->pRend->pDrawable == NULL) || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - MI_WHICHDRAW(pwks->pRend->pDrawable, type); - - /* - * make sure this mode is supported by the drawable in this - * implementation - */ - for (i = 0; i < SI_HLHSR_NUM; i++) { - if (mode == miHlhsrModeET[type][i].index) { - pwks->reqhlhsrMode = mode; - if (WKSIMMEDIATE(pwks, HLHSR_MODE_DYNAMIC)) - { - pwks->pRend->hlhsrMode = mode; - pwks->pRend->attrsChanges |= PEXDynHlhsrMode; - } - /* hlhsrUpdate doesn't change */ - /* do stuff here to effect change in hlhsr mode */ - else { - /* don't update display */ - pwks->hlhsrUpdate = PEXPending; - pwks->visualState = PEXDeferred; - } - return (Success); - } - } - - return (BadValue); -} /* SetHlhsrMode */ - -/*++ - | - | Function Name: SetBufferMode - | - | Function Description: - | Handles the PEXSetBufferMode request. - | - | Note(s): - | - --*/ - -ddpex4rtn -SetBufferMode(pWKS, mode) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - ddUSHORT mode; /* buffer mode */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - register int type; - -#ifdef DDTEST - ErrorF("\nSetBufferMode\n"); -#endif - - if ((pwks->pRend->pDrawable == NULL) || (pwks->pRend->drawableId == PEXAlreadyFreed)) - return (BadDrawable); - - MI_WHICHDRAW(pwks->pRend->pDrawable, type); - - /* - * make sure this mode is supported by the drawable in this - * implementation - */ - if ((mode == PEXSingleBuffered) || (mode == PEXDoubleBuffered)) { - pwks->reqBufferMode = mode; - if (WKSIMMEDIATE(pwks, BUFFER_MODIFY_DYNAMIC)) - { - pwks->curBufferMode = mode; - /* bufferUpdate doesn't change */ - /* do stuff here to effect change in buffer mode */ - ChangeDoubleBuffers (pwks); - } - else { - /* don't update display */ - pwks->bufferUpdate = PEXPending; - pwks->visualState = PEXDeferred; - } - return (Success); - } else - return (BadValue); -} /* SetBufferMode */ - -static int -miAddStructToOrdList(resource, preflist, prity) - diStructHandle resource; - listofOrdStruct *preflist; - ddFLOAT prity; -{ - listofOrdStruct *plist = preflist; - register ddOrdStruct *postruct, *pbefore, *pnew, *pnext; - -#ifdef DDTEST - ErrorF("\tmiAddStructToOrdList \n"); -#endif - err = MI_SUCCESS; - - /* - * check to see if it's in the list already and find out where it - * goes in the list if it's in the list, set its priority to the new - * priority - */ - pnew = NULL; /* set this to point to the struct already in - * the list */ - pbefore = NULL; /* set this to point to where the struct - * belongs inthe list */ - postruct = preflist->postruct; /* the first element is a dummy */ - - /* - * loop until the end of the list OR the resource is found in the - * list and where it belongs in the list is known - */ - while (postruct->next && (!pnew || !pbefore)) { - pnext = postruct->next; - if ((prity < pnext->priority) && !pbefore) - pbefore = postruct; - if (pnext->pstruct == resource) { - pnew = pnext; /* remember the old one */ - postruct->next = pnext->next; /* take it out of the - * list */ - err = MI_EXISTERR; - } else - postruct = pnext; - } - if (!pbefore) - pbefore = postruct; /* the last element in the list */ - - /* now add it to the list */ - if (!pnew) { - if ((pnew = (ddOrdStruct *) xalloc(sizeof(ddOrdStruct))) == NULL) - return (MI_ALLOCERR); - else - plist->numStructs++; /* increment only if it's new - * to the list */ - } - pnew->pstruct = resource; - pnew->priority = prity; - - pnew->next = pbefore->next; - pbefore->next = pnew; - - return (err); -} /* miAddStructToOrdList */ - -static void -miRemoveStructFromOrdList(resource, preflist) - diStructHandle resource; - listofOrdStruct *preflist; -{ - register ddOrdStruct *postruct, *pnew; - -#ifdef DDTEST - ErrorF("\tmiRemoveStructFromOrdList \n"); -#endif - - pnew = NULL; /* set this to point to the struct already in - * the list */ - postruct = preflist->postruct; /* the first element is a dummy */ - - /* - * loop until the end of the list OR the resource is found in the - * list - */ - while (postruct->next && !pnew) { - if (postruct->next->pstruct == resource) - pnew = postruct->next; - else - postruct = postruct->next; - } - if (pnew) { - postruct->next = pnew->next; - xfree(pnew); - preflist->numStructs--; - } - return; -} /* miRemoveStructFromOrdList */ - -ddBOOL -miGetStructurePriority(pWKS, pStruct, ppriority) - diWKSHandle pWKS; /* workstation handle */ - diStructHandle pStruct;/* structure handle */ - ddFLOAT *ppriority; /* structure priority */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - listofOrdStruct *plist = &pwks->postedStructs; - register ddOrdStruct *postruct, *pnext; - - postruct = plist->postruct; /* the first element is a dummy */ - *ppriority = 0; - - while (postruct->next) { - pnext = postruct->next; - if (pnext->pstruct == pStruct) { - *ppriority = pnext->priority; - return (MI_TRUE); - } else - postruct = pnext; - } - return (MI_FALSE); -} - -/*++ - | - | Function Name: PostStructure - | - | Function Description: - | Handles the PEXPostStructure request. - | - | Note(s): - | - --*/ - -ddpex4rtn -PostStructure(pWKS, pStruct, priority) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - diStructHandle pStruct;/* structure handle */ - ddFLOAT priority; /* structure priority */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nPostStructure %d\n", pStruct->id); -#endif - - if ((err = miAddStructToOrdList(pStruct, &(pwks->postedStructs), - priority)) == MI_ALLOCERR) - return (BadAlloc); - - if (err == MI_SUCCESS) {/* the structure was added */ - /* add wks to structures list */ - if (err4 = UpdateStructRefs(pStruct, (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, ADD)) - return (err4); - } - /* else the structure was already posted it now has a new priority */ - - /* do stuff to see if picture needs to be changed */ - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(POST_STR_DYNAMIC, pwks->pwksList); - - return (Success); -} /* PostStructure */ - -/*++ - | - | Function Name: UnpostStructure - | - | Function Description: - | Handles the PEXUnpostStructure request. - | - | Note(s): - | - --*/ - -ddpex4rtn -UnpostStructure(pWKS, pStruct) -/* in */ - diWKSHandle pWKS; /* workstation handle */ - diStructHandle pStruct;/* structure handle */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - -#ifdef DDTEST - ErrorF("\nUnpostStructure\n"); -#endif - - /* take the wks out of the structs wks lists */ - if (err4 = UpdateStructRefs(pStruct, (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, REMOVE)) - return (err4); /* unlikely */ - - if (!pwks) return (Success); /* workstation already freed */ - - /* now, remove the structure from the wks posted list */ - miRemoveStructFromOrdList(pStruct, &(pwks->postedStructs)); - - /* do stuff to see if picture needs to be changed */ - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(UNPOST_STR_DYNAMIC, pwks->pwksList); - - return (Success); -} /* UnpostStructure */ - -/*++ - | - | Function Name: UnpostAllStructures - | - | Function Description: - | Handles the PEXUnpostAllStructures request. - | - | Note(s): - don't use UnpostStructure because this follows the list of posted structures - and removes each one as it goes, instead of having UnpostStructure remove - them. - | - --*/ - -ddpex4rtn -UnpostAllStructures(pWKS) -/* in */ - diWKSHandle pWKS; /* workstation handle */ -/* out */ -{ - miWksPtr pwks = (miWksPtr) pWKS->deviceData; - ddOrdStruct *pos, *posn; - -#ifdef DDTEST - ErrorF("\nUnpostAllStructures\n"); -#endif - - if (!pwks) return (Success); - - /* don't forget that the first pos is a dummy */ - pos = pwks->postedStructs.postruct; - posn = pos->next; - pos->next = NULL; - while (posn) { - - /* - * take the wks out of the posted structs and childrens wks - * lists - */ - err4 = UpdateStructRefs(posn->pstruct, (diResourceHandle) pWKS, - WORKSTATION_RESOURCE, REMOVE); - - pos = posn; - posn = pos->next; - xfree(pos); - } - pwks->postedStructs.numStructs = 0; - - /* do stuff to see if picture needs to be changed */ - PU_EMPTY_LIST(pwks->pwksList); - puAddToList((ddPointer) & pWKS, (ddULONG) 1, pwks->pwksList); - - miDealWithDynamics(UNPOST_STR_DYNAMIC, pwks->pwksList); - return (Success); -} /* UnpostAllStructures */ - -/*++ - | - | Function Name: InquireWksPostings - | - | Function Description: - | Handles the PEXGetWKSPostings request. - | - | Note(s): - | - --*/ - -extern ddpex4rtn get_wks_postings(); - -ddpex4rtn -InquireWksPostings(pStruct, pBuffer) -/* in */ - diStructHandle pStruct;/* structure handle */ -/* out */ - ddBufferPtr pBuffer;/* list of workstation ids */ -{ - -#ifdef DDTEST - ErrorF("\nInquireWksPostings\n"); -#endif - - return (get_wks_postings(pStruct, pBuffer)); -} /* InquireWksPostings */ - -/*++ - | - | Function Name: UpdateWksRefs - | - | Function Description: - | only for pick measure reference count - | - | Note(s): - | - --*/ - -void -UpdateWksRefs(pWKS, pResource, which, action) - diWKSHandle pWKS; - diResourceHandle pResource; /* pick measure resource */ - ddResourceType which; - ddAction action; -{ - register miWksPtr pwks = (miWksPtr) pWKS->deviceData; - - /* only pick measure counts are used here */ - if (action == ADD) - pwks->refCount++; - else if (pwks->refCount > 0) - pwks->refCount--; - - CHECK_DELETE(pwks, pWKS); - - return; -} /* UpdateWksRefs */ - -ddpex4rtn -mi_add_ord_view(plist, view) - listofOrdView *plist; - ddUSHORT view; -{ - ddOrdView *free1, *free2, *indexer; - - indexer = plist->highest->lower; - do { - if ((indexer->first_view == view) && - (indexer->last_view == view)) { - /* view is already in the list */ - if (!indexer->defined) { - plist->defined_views++; - indexer->defined = MI_TRUE; - } - return (Success); - } - if ((indexer->first_view <= view) && - (indexer->last_view >= view)) { - MIWKS_NEW_OV_ENTRY(plist, free1); - if (free1 == NULL) { - /* bad news, no more free entries */ - return (BadValue); - } - plist->defined_views++; - free1->defined = MI_TRUE; - free1->first_view = view; - free1->last_view = view; - if (indexer->first_view == view) { /* new entry goes in - * front */ - free1->higher = indexer->higher; - free1->lower = indexer; - indexer->higher = free1; - free1->higher->lower = free1; - indexer->first_view++; - ASSURE(indexer->first_view <= indexer->last_view); - } else if (indexer->last_view == view) { /* new entry goes on - * back */ - free1->higher = indexer; - free1->lower = indexer->lower; - indexer->lower = free1; - free1->lower->higher = free1; - indexer->last_view--; - ASSURE(indexer->first_view <= indexer->last_view); - } else {/* new entry goes in middle - need to split - * the range. the end of the range goes into - * a new entry. ranges are always not defined - * views, so all views in that new entry are - * still undefined */ - MIWKS_NEW_OV_ENTRY(plist, free2); - free2->defined = MI_FALSE; - free2->first_view = view + 1; - free2->last_view = - indexer->last_view; - indexer->last_view = view - 1; - free1->higher = indexer; - free1->lower = free2; - free2->higher = free1; - free2->lower = indexer->lower; - indexer->lower = free1; - free2->lower->higher = free2; - } - return (Success); - } - indexer = indexer->lower; - } while (indexer != plist->lowest); - /* reached end of list: should never get here */ - return (BadValue); - -} - -ddOrdView * -mi_find_ord_view(plist, view) - listofOrdView *plist; - ddUSHORT view; -{ -/* finds only defined views */ - ddOrdView *indexer; - - indexer = plist->highest; - do { - if (indexer->defined && (indexer->first_view == view)) - return (indexer); - - indexer = indexer->lower; - } while (indexer != NULL); - /* view is not defined */ - return (NULL); -} - -void -initialize_pick_devices() -{ - register int i; - - for (i = 0; i < MIWKS_NUM_PICK_DEVICES; i++) { - pick_devices[i].type = i + 1; - pick_devices[i].status = PEXNoPick; - /* don't put the path in here - create it for the wks devices */ - pick_devices[i].path = (listofObj *) NULL; - pick_devices[i].pathOrder = PEXTopPart; - pick_devices[i].inclusion = (diNSHandle) NULL; - pick_devices[i].exclusion = (diNSHandle) NULL; - - if (!i) - MIWKS_PD_DATA_REC_1(&pick_devices[i]) = 0; - else - MIWKS_PD_DATA_REC_2(&pick_devices[i]) = 0; - - pick_devices[i].pet = PEXEchoPrimitive; - pick_devices[i].echoVolume = viewportInit; - pick_devices[i].echoSwitch = PEXNoEcho; - } -} Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile:3.14 xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile:3.14 Mon Apr 23 12:17:08 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile Sat Feb 28 21:41:55 2004 @@ -1,101 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:10 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/Imakefile,v 3.14 2001/04/23 16:17:08 tsi Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM or the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDdpexCDebugFlags -#define PexDdpexCDebugFlags ServerCDebugFlags -#endif - -XCOMM -D defines for ddpex: -XCOMM DDTEST turns on some fprintf(stderr...)s for debugging -XCOMM PEX_DEFAULT_FONTPATH defines the default path to PEX fonts - - DEFINES = PexDdpexDefines -CDEBUGFLAGS = PexDdpexCDebugFlags - - PEXSERVINC = ../../../include -DDPEXINCLUDE = ../include - -INCLUDES = -I. \ - -I$(DDPEXINCLUDE) \ - -I$(XINCLUDESRC) \ - -I$(PEXSERVINC) \ - -I$(SERVERSRC)/include - -SRCS = miFont.c \ - miLUT.c \ - miLineLUT.c \ - miMarkLUT.c \ - miTextLUT.c \ - miEdgeLUT.c \ - miIntLUT.c \ - miPattLUT.c \ - miFontLUT.c \ - miViewLUT.c \ - miColrLUT.c \ - miClrApLUT.c \ - miLightLUT.c \ - miDCueLUT.c \ - miNS.c \ - miUtils.c \ - miMisc.c - -OBJS = miFont.o \ - miLUT.o \ - miLineLUT.o \ - miMarkLUT.o \ - miTextLUT.o \ - miEdgeLUT.o \ - miIntLUT.o \ - miPattLUT.o \ - miFontLUT.o \ - miViewLUT.o \ - miColrLUT.o \ - miClrApLUT.o \ - miLightLUT.o \ - miDCueLUT.o \ - miNS.o \ - miUtils.o \ - miMisc.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ddpexs,$(OBJS)) - -LintLibraryTarget(dps, $(SRCS)) -NormalLintTarget($(SRCS)) - -SpecialCObjectRule(miMisc,$(ICONFIGFILES),$(EXT_DEFINES)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c:1.9 Fri Dec 14 14:57:37 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c Sat Feb 28 21:41:55 2004 @@ -1,221 +0,0 @@ -/* $Xorg: miClrApLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miClrApLUT.c,v 1.9 2001/12/14 19:57:37 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXColourApproxLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddColourApproxEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miColourApproxEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexColourApproxEntry - -#define LUT_REND_DYN_BIT PEXDynColourApproxContents - -#define LUT_START_INDEX 0 -#define LUT_DEFAULT_INDEX 0 -#define LUT_0_DEFINABLE_ENTRIES 6 -#define LUT_0_NUM_PREDEFINED 0 -#define LUT_0_PREDEFINED_MIN 0 -#define LUT_0_PREDEFINED_MAX 0 - -#define LUT_TABLE_START(pheader) (pheader)->plut.colourApprox - -#define DYNAMIC COLOUR_APPROX_TABLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -/* there are no predefined entries, but define 1 entry for default */ -static DD_LUT_ENTRY_STR pdeColourApproxEntry[1]; -#define LUT_PDE_ENTRIES pdeColourApproxEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeColourApproxEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE ColourApproxLUT_free -#define LUT_INQ_PREDEF ColourApproxLUT_inq_predef -#define LUT_INQ_ENTRIES ColourApproxLUT_inq_entries -*/ -#define LUT_COPY ColourApproxLUT_copy -#define LUT_INQ_INFO ColourApproxLUT_inq_info -#define LUT_INQ_IND ColourApproxLUT_inq_ind -#define LUT_INQ_ENTRY ColourApproxLUT_inq_entry -#define LUT_SET_ENTRIES ColourApproxLUT_set_entries -#define LUT_DEL_ENTRIES ColourApproxLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS ColourApproxLUT_inq_entry_address -#define LUT_CREATE ColourApproxLUT_create -#define LUT_ENTRY_CHECK ColourApproxLUT_entry_check -#define LUT_COPY_PEX_MI ColourApproxLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX ColourApproxLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK ColourApproxLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - if (pentry == NULL) - mibcopy(&(LUT_DEFAULT_VALUES), *ppbuf, sizeof(PEX_LUT_ENTRY_STR)); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - mibcopy(&(LUT_DEFAULT_VALUES), *ppbuf, sizeof(PEX_LUT_ENTRY_STR)); - else - mibcopy(&pentry->entry, *ppbuf, sizeof(PEX_LUT_ENTRY_STR)); - - *ppbuf += sizeof(PEX_LUT_ENTRY_STR); - - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - mibcopy(*ppsrc, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - *ppsrc += sizeof(PEX_LUT_ENTRY_STR); - - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - extern miEnumType miColourApproxTypeET[][SI_CLR_APPROX_TYPE_NUM]; - extern miEnumType miColourApproxModelET[][SI_CLR_APPROX_MODEL_NUM]; - - if (((*ppPexEntry)->approxType < miColourApproxTypeET[pheader->drawType][0].index) || - ((*ppPexEntry)->approxType > miColourApproxTypeET[pheader->drawType][SI_CLR_APPROX_TYPE_NUM - 1].index)) - return(BadValue); - if (((*ppPexEntry)->approxModel < miColourApproxModelET[pheader->drawType][0].index) || - ((*ppPexEntry)->approxModel > miColourApproxModelET[pheader->drawType][SI_CLR_APPROX_MODEL_NUM - 1].index)) - return(BadValue); - if (((*ppPexEntry)->dither != PEXOff) && ((*ppPexEntry)->dither != PEXOn)) - return(BadValue); - - (*ppPexEntry)++; - return(Success); -} - -void -ColourApproxLUT_init_pde() -{ - /* Having default values for this makes absolutely no sense. - * There is no way for this to know what colors are defined in - * the coloramp, and therefor no way to know how to map to them. - * This is provided only because something has to be done, but - * the likelyhood of this turning out correct colors is small. - * The client side MUST set at least one entry in this table - * for correct functionality. - * These are the sample values in the protocol spec. - * They assume a 6x6x6 color cube beginning at location 16. - */ - pdeColourApproxEntry [0].approxType = PEXColourSpace; - pdeColourApproxEntry [0].approxModel = PEXColourApproxRGB; - pdeColourApproxEntry [0].max1 = 5; - pdeColourApproxEntry [0].max2 = 5; - pdeColourApproxEntry [0].max3 = 5; - pdeColourApproxEntry [0].dither = PEXOff; - pdeColourApproxEntry [0].mult1 = 1; - pdeColourApproxEntry [0].mult2 = 6; - pdeColourApproxEntry [0].mult3 = 36; - pdeColourApproxEntry [0].weight1 = 1.0; - pdeColourApproxEntry [0].weight2 = 1.0; - pdeColourApproxEntry [0].weight3 = 1.0; - pdeColourApproxEntry [0].basePixel = 16; -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c:1.9 Fri Dec 14 14:57:37 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c Sat Feb 28 21:41:55 2004 @@ -1,299 +0,0 @@ -/* $Xorg: miColrLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miColrLUT.c,v 1.9 2001/12/14 19:57:37 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXColourLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddColourSpecifier -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miColourEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexColourSpecifier - -#define LUT_REND_DYN_BIT PEXDynColourTableContents - -#define LUT_START_INDEX 0 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 256 -#define LUT_0_NUM_PREDEFINED 8 -#define LUT_0_PREDEFINED_MIN 0 -#define LUT_0_PREDEFINED_MAX 7 - -#define LUT_TABLE_START(pheader) (pheader)->plut.colour - -#define DYNAMIC COLOUR_TABLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeColourEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeColourEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); - -/* predefined entry 1 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 1 -#define LUT_DEFAULT_VALUES pdeColourEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE ColourLUT_free -#define LUT_INQ_PREDEF ColourLUT_inq_predef -#define LUT_INQ_ENTRIES ColourLUT_inq_entries -*/ -#define LUT_COPY ColourLUT_copy -#define LUT_INQ_INFO ColourLUT_inq_info -#define LUT_INQ_IND ColourLUT_inq_ind -#define LUT_INQ_ENTRY ColourLUT_inq_entry -#define LUT_SET_ENTRIES ColourLUT_set_entries -#define LUT_DEL_ENTRIES ColourLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS ColourLUT_inq_entry_address -#define LUT_CREATE ColourLUT_create -#define LUT_ENTRY_CHECK ColourLUT_entry_check -#define LUT_COPY_PEX_MI ColourLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX ColourLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK ColourLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->colour, pb, pdev_entry->colourType); - - pb += colour_type_sizes[(int)pdev_entry->colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - pentry->entry.colourType = ((PEX_LUT_ENTRY_STR *)ps)->colourType; - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.colour), pentry->entry.colourType); - - ps += colour_type_sizes[(int)pentry->entry.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - - -void -ColourLUT_init_pde() -{ - /* black */ - pdeColourEntry[0].colourType = PEXRgbFloatColour; - pdeColourEntry[0].colour.rgbFloat.red = 0.0; - pdeColourEntry[0].colour.rgbFloat.green = 0.0; - pdeColourEntry[0].colour.rgbFloat.blue = 0.0; - /* white */ - pdeColourEntry[1].colourType = PEXRgbFloatColour; - pdeColourEntry[1].colour.rgbFloat.red = 1.0; - pdeColourEntry[1].colour.rgbFloat.green = 1.0; - pdeColourEntry[1].colour.rgbFloat.blue = 1.0; - /* red */ - pdeColourEntry[2].colourType = PEXRgbFloatColour; - pdeColourEntry[2].colour.rgbFloat.red = 1.0; - pdeColourEntry[2].colour.rgbFloat.green = 0.0; - pdeColourEntry[2].colour.rgbFloat.blue = 0.0; - /* green */ - pdeColourEntry[3].colourType = PEXRgbFloatColour; - pdeColourEntry[3].colour.rgbFloat.red = 0.0; - pdeColourEntry[3].colour.rgbFloat.green = 1.0; - pdeColourEntry[3].colour.rgbFloat.blue = 0.0; - /* blue */ - pdeColourEntry[4].colourType = PEXRgbFloatColour; - pdeColourEntry[4].colour.rgbFloat.red = 0.0; - pdeColourEntry[4].colour.rgbFloat.green = 0.0; - pdeColourEntry[4].colour.rgbFloat.blue = 1.0; - /* yellow */ - pdeColourEntry[5].colourType = PEXRgbFloatColour; - pdeColourEntry[5].colour.rgbFloat.red = 1.0; - pdeColourEntry[5].colour.rgbFloat.green = 1.0; - pdeColourEntry[5].colour.rgbFloat.blue = 0.0; - /* cyan */ - pdeColourEntry[6].colourType = PEXRgbFloatColour; - pdeColourEntry[6].colour.rgbFloat.red = 0.0; - pdeColourEntry[6].colour.rgbFloat.green = 1.0; - pdeColourEntry[6].colour.rgbFloat.blue = 1.0; - /* magenta */ - pdeColourEntry[7].colourType = PEXRgbFloatColour; - pdeColourEntry[7].colour.rgbFloat.red = 1.0; - pdeColourEntry[7].colour.rgbFloat.green = 0.0; - pdeColourEntry[7].colour.rgbFloat.blue = 1.0; -} - -#include "miLUTProcs.ci" - -/* utility proc used to get highlight colour - * the highlight colour is the last entry in - * the table, i.e. the one with the highest index - */ -void -inq_last_colour_entry( pLUT, pColour ) - diLUTHandle pLUT; - ddColourSpecifier *pColour; -{ - miLUTHeader *pheader; - ddTableIndex high_index = 0; - ddColourSpecifier *high_entry = (ddColourSpecifier *)NULL; - miColourEntry *pEntry; - register int i; - - if (pLUT) - { - pheader = MILUT_HEADER(pLUT); - /* since this supports sparse tables, - * we don't know which entry is the last one. - * so, we have to do a search. a linear search - * is done. this should be optimized if the table - * is very large. - */ - for (i = 0, pEntry = pheader->plut.colour; - i < MILUT_ALLOC_ENTS(pheader); i++, pEntry++) - { - if (pEntry->entry_info.status != MILUT_UNDEFINED) - if (pEntry->entry_info.index > high_index) - { - high_index = pEntry->entry_info.index; - high_entry = &pEntry->entry; - } - } - } - if (high_entry) - *pColour = *high_entry; - else - { - /* hot pink */ - pColour->colourType = PEXRgbFloatColour; - pColour->colour.rgbFloat.red = 1.0; - pColour->colour.rgbFloat.green = 0.41; - pColour->colour.rgbFloat.blue = 0.71; - } - return; -} Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c:1.9 Fri Dec 14 14:57:37 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c Sat Feb 28 21:41:55 2004 @@ -1,236 +0,0 @@ -/* $Xorg: miDCueLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miDCueLUT.c,v 1.9 2001/12/14 19:57:37 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXDepthCueLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddDepthCueEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miDepthCueEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexDepthCueEntry - -#define LUT_REND_DYN_BIT PEXDynDepthCueTableContents - -#define LUT_START_INDEX 0 -#define LUT_DEFAULT_INDEX 0 -#define LUT_0_DEFINABLE_ENTRIES 6 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 0 -#define LUT_0_PREDEFINED_MAX 0 - -#define LUT_TABLE_START(pheader) (pheader)->plut.depthCue - -#define DYNAMIC DEPTH_CUE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeDepthCueEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeDepthCueEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeDepthCueEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE DepthCueLUT_free -#define LUT_INQ_PREDEF DepthCueLUT_inq_predef -#define LUT_INQ_ENTRIES DepthCueLUT_inq_entries -*/ -#define LUT_COPY DepthCueLUT_copy -#define LUT_INQ_INFO DepthCueLUT_inq_info -#define LUT_INQ_IND DepthCueLUT_inq_ind -#define LUT_INQ_ENTRY DepthCueLUT_inq_entry -#define LUT_SET_ENTRIES DepthCueLUT_set_entries -#define LUT_DEL_ENTRIES DepthCueLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS DepthCueLUT_inq_entry_address -#define LUT_CREATE DepthCueLUT_create -#define LUT_ENTRY_CHECK DepthCueLUT_entry_check -#define LUT_COPY_PEX_MI DepthCueLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX DepthCueLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK DepthCueLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - DD_LUT_ENTRY_STR *pdev_entry; - ddPointer pb = *ppbuf; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->depthCueColour.colour, - pb, pdev_entry->depthCueColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->depthCueColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.depthCueColour.colour), - pentry->entry.depthCueColour.colourType); - - ps += colour_type_sizes[(int)pentry->entry.depthCueColour.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - - /* mode: Off or On */ - if (((*ppPexEntry)->mode != PEXOff) && ((*ppPexEntry)->mode != PEXOn)) - return(BadValue); - /* frontPlane: must be in NPC */ - if (((*ppPexEntry)->frontPlane < 0.0) || ((*ppPexEntry)->frontPlane > 1.0)) - return(BadValue); - /* backPlane: must be in NPC */ - if (((*ppPexEntry)->backPlane < 0.0) || ((*ppPexEntry)->backPlane > 1.0)) - return(BadValue); - /* frontScaling: must be in NPC */ - if (((*ppPexEntry)->frontScaling < 0.0) || ((*ppPexEntry)->frontScaling > 1.0)) - return(BadValue); - /* backScaling: must be in NPC */ - if (((*ppPexEntry)->backScaling < 0.0) || ((*ppPexEntry)->backScaling > 1.0)) - return(BadValue); - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->depthCueColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->depthCueColour.colourType]; - - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - - -void -DepthCueLUT_init_pde() -{ - pdeDepthCueEntry[0].mode = PEXOff; - pdeDepthCueEntry[0].frontPlane = 1.0; - pdeDepthCueEntry[0].backPlane = 0.0; - pdeDepthCueEntry[0].frontScaling = 1.0; - pdeDepthCueEntry[0].backScaling = 0.5; - MILUT_INIT_COLOUR(pdeDepthCueEntry[0].depthCueColour); -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c:1.9 Fri Dec 14 14:57:37 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c Sat Feb 28 21:41:55 2004 @@ -1,267 +0,0 @@ -/* $Xorg: miEdgeLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miEdgeLUT.c,v 1.9 2001/12/14 19:57:37 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXEdgeBundleLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddEdgeBundleEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miEdgeBundleEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexEdgeBundleEntry - -#define LUT_REND_DYN_BIT PEXDynEdgeBundleContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 20 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.edge - -#define DYNAMIC EDGE_BUNDLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -static DD_LUT_ENTRY_STR pdeEdgeBundleEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeEdgeBundleEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->real_entry = *(pdeentry) - - -/* predefined entry 0 is set to the default values */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeEdgeBundleEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - (pentry)->real_entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE EdgeBundleLUT_free -#define LUT_INQ_PREDEF EdgeBundleLUT_inq_predef -#define LUT_INQ_ENTRIES EdgeBundleLUT_inq_entries -*/ -#define LUT_COPY EdgeBundleLUT_copy -#define LUT_INQ_INFO EdgeBundleLUT_inq_info -#define LUT_INQ_IND EdgeBundleLUT_inq_ind -#define LUT_INQ_ENTRY EdgeBundleLUT_inq_entry -#define LUT_SET_ENTRIES EdgeBundleLUT_set_entries -#define LUT_DEL_ENTRIES EdgeBundleLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS EdgeBundleLUT_inq_entry_address -#define LUT_CREATE EdgeBundleLUT_create -#define LUT_ENTRY_CHECK EdgeBundleLUT_entry_check -#define LUT_COPY_PEX_MI EdgeBundleLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX EdgeBundleLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK EdgeBundleLUT_mod_call_back -#define LUT_REALIZE_ENTRY EdgeBundleLUT_realize_entry - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - if (valueType == PEXRealizedValue) - pdev_entry = &pentry->real_entry; - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->edgeColour.colour, - pb, pdev_entry->edgeColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->edgeColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.edgeColour.colour), - pentry->entry.edgeColour.colourType); - - LUT_REALIZE_ENTRY( pheader, pentry ); - - ps += colour_type_sizes[(int)pentry->entry.edgeColour.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - - /* edges: PEXOff or PEXOn */ - if (((*ppPexEntry)->edges != PEXOff) && ((*ppPexEntry)->edges != PEXOn)) - return(BadValue); - - /* edgeType: any value OK. use edge type 1 if it's not supported */ - /* edgeWidth: any value is OK, it is used as a scale */ - - /* colours only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->edgeColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->edgeColour.colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - -/* realize entry */ -ddpex43rtn -LUT_REALIZE_ENTRY( pheader, pEntry ) - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pEntry; -{ - extern miEnumType miSurfaceEdgeTypeET[][SI_EDGE_NUM]; - - /* edges: PEXOff or PEXOn */ - pEntry->real_entry.edges = pEntry->entry.edges; - - /* edgeType: any value OK. use edge type 1 if it's not supported */ - if ( (pEntry->entry.edgeType < - miSurfaceEdgeTypeET[pheader->drawType][0].index) || - (pEntry->entry.edgeType > - miSurfaceEdgeTypeET[pheader->drawType][SI_EDGE_NUM - 1].index) ) - pEntry->real_entry.edgeType = 1; - else - pEntry->real_entry.edgeType = pEntry->entry.edgeType; - - /* edgeWidth: any value is OK, it is multiplied by the nomimal - * edge width and the nearest supported size is used - * The realized value is the scale for inquiry, not the size - */ - pEntry->real_entry.edgeWidth = pEntry->entry.edgeWidth; - - /* colourType: its an error if an unsupported colour type was - * specified. For supported colour types, should mapped colour - * be returned?? - */ - pEntry->real_entry.edgeColour = pEntry->entry.edgeColour; - -} - -void -EdgeBundleLUT_init_pde() -{ - pdeEdgeBundleEntry[0].edges = PEXOff; - pdeEdgeBundleEntry[0].edgeType = PEXSurfaceEdgeSolid; - pdeEdgeBundleEntry[0].edgeWidth = 1.0; - MILUT_INIT_COLOUR(pdeEdgeBundleEntry[0].edgeColour); -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c:3.7 xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c:3.7 Fri Dec 14 14:57:37 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c Sat Feb 28 21:41:55 2004 @@ -1,892 +0,0 @@ -/* $Xorg: miFont.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miFont.c,v 3.7 2001/12/14 19:57:37 dawes Exp $ */ - -#include "miFont.h" -#include "miLUT.h" -#include "miWks.h" -#include "PEX.h" -#include "PEXErr.h" -#include "pexExtract.h" -#include "pexUtils.h" -#include "pexos.h" - - -extern void CopyISOLatin1Lowered(); -extern ErrorCode LoadPEXFontFile(); -extern int pex_get_matching_names(); - -extern diFontHandle defaultPEXFont; - -/* Level 4/3 Shared Resources */ -/* PEX Font Procedures */ - -/* get_lowered_truncated_entry takes a directory entry, strips off the .phont - * suffix, and puts in all in lower case ISO Latin 1. If the entry doesn't - * have a .phont suffix, 0 is returned. - */ -int -get_lowered_truncated_entry(before, after) -char *before; /* in */ -char *after; /* out */ -{ - char *suffix_ptr; - - suffix_ptr = before + strlen(before) - strlen(".phont"); - if (strncmp(suffix_ptr, ".phont", strlen(".phont")) != 0) - return 0; - - CopyISOLatin1Lowered((unsigned char *)after, (unsigned char *)before, - strlen(before) - strlen(".phont")); - - return 1; -} - -/*++ - | - | Function Name: OpenPEXFont - | - | Function Description: - | Handles the PEXOpenFont request. - | - --*/ -ddpex43rtn -OpenPEXFont(strLen, pName, pFont) -/* in */ - ddULONG strLen; /* length of name */ - ddUCHAR *pName; /* font name */ - diFontHandle pFont; /* font handle - we fill in device_data */ -/* out */ -{ - miFontHeader *font; - register int i; - Ch_stroke_data **ch_data; - ddpex43rtn err = Success; - - font = (miFontHeader *)xalloc((unsigned long)(sizeof(miFontHeader))); - if (font == NULL) return (BadAlloc); - pFont->deviceData = (ddPointer)font; - font->lutRefCount = 0; - font->freeFlag = MI_FALSE; - font->properties = 0; - font->font_info.numProps = 0; - font->ch_data = 0; - font->num_ch = 0; - font->top = 0.0; - font->bottom = 0.0; - font->max_width = 0.0; - - err = LoadPEXFontFile(strLen, pName, pFont); - if (err != Success) { - xfree(font); - return (err); } - - /* - * Now, make a pass from the first glyph to the last glyph, seeing if - * all are defined. - */ - font->font_info.allExist = 1; - ch_data = font->ch_data + font->font_info.firstGlyph; - for ( i = font->font_info.firstGlyph; - i < font->num_ch && font->font_info.allExist; - i++, ch_data++ ) - if (*ch_data == NULL || (*ch_data)->strokes.numLists <= 0) { - font->font_info.allExist = 0; - break; } - - - /* For now, let the default glyph be an asterisk */ - font->font_info.defaultGlyph = (CARD16)'*'; - - /* It's a stroke font */ - font->font_info.strokeFont = 1; - - return (Success); - -} /* OpenPEXFont */ - -/*++ - | - | Function Name: FreePEXFont - | - | Function Description: - | Deletes all storage used by the font. - | - --*/ -static void -really_free_font(pFont) - diFontHandle pFont; /* font handle */ -{ - miFontHeader *font = (miFontHeader *) pFont->deviceData; - register Ch_stroke_data **ch_data, *firstChar = 0; - int j; - - if (font->properties) - xfree((char *) font->properties); - - if (font->ch_data) { - for (j = 0, ch_data = font->ch_data; j < font->num_ch; j++, ch_data++) { - if (*ch_data != NULL) { - MI_FREELISTHEADER(&((*ch_data)->strokes)); - if (!firstChar) firstChar = *ch_data; } } - - xfree((char *) (firstChar)); - xfree((char *) (font->ch_data)); - } - - xfree((char *) font); - xfree((char *) pFont); - -} - - -ddpex43rtn -FreePEXFont(pFont, Fid) -/* in */ - diFontHandle pFont; /* font handle */ - ddResourceId Fid; /* font resource id */ -/* out */ -{ - miFontHeader *font = (miFontHeader *) pFont->deviceData; - - if (pFont == defaultPEXFont) return (Success); - - font->freeFlag = MI_TRUE; - pFont->id = PEXAlreadyFreed; - - if (font->lutRefCount == 0) - really_free_font(pFont); - - return (Success); -} - -/*++ - | - | Function Name: QueryPEXFont - | - | Function Description: - | Handles the PEXQueryFont request. - | - | Input Description: - | diFontHandle pFont; font handle - | - | Output Description: - | ddBufferPtr pBuffer; buffer with fontinfo - | - --*/ -ddpex43rtn -QueryPEXFont(pFont, pBuffer) - diFontHandle pFont; /* font handle */ - ddBufferPtr pBuffer; /* font info */ -{ - miFontHeader *font = (miFontHeader *)pFont->deviceData; - ddPointer pbuf; - ddULONG data_size; - - data_size = sizeof(pexFontInfo) + - font->font_info.numProps * sizeof(pexFontProp); - - PU_CHECK_BUFFER_SIZE(pBuffer, data_size); - pbuf = pBuffer->pBuf; - - /* copy actual font info into buffer */ - memcpy( (char *)pbuf, (char *)&(font->font_info), sizeof(pexFontInfo)); - pbuf += sizeof(pexFontInfo); - - /* copy property info into buffer */ - if (font->font_info.numProps > 0) - PACK_LISTOF_STRUCT( font->font_info.numProps, pexFontProp, - font->properties, pbuf); - - pBuffer->dataSize = data_size; - - return (Success); - -} /* QueryPEXFont */ - -/*++ - | - | Function Name: ListPEXFonts - | - | Function Description: - | Handles the PEXListFonts request. - | - --*/ -ddpex43rtn -ListPEXFonts(patLen, pPattern, maxNames, pNumNames, pBuffer) -/* in */ - ddUSHORT patLen; /* number of chars in pattern */ - ddUCHAR *pPattern; /* pattern */ - ddUSHORT maxNames; /* maximum number of names to return */ -/* out */ - ddULONG *pNumNames;/* number of names in reply */ - ddBufferPtr pBuffer; /* list of names */ -{ - - ddPointer pbuf; - ddULONG total_space, n; - char **names; /* a list of strings */ - CARD16 *valCARD16; - int i; - - if (!pex_get_matching_names(patLen, pPattern, maxNames, &n, &names)) - return (BadAlloc); - - /* figure out how much space is needed by these strings */ - total_space = 0; - for (i = 0; i < n; i++) { - total_space += 2 + strlen(names[i]) + PADDING(2 + strlen(names[i])); - } - - PU_CHECK_BUFFER_SIZE(pBuffer, total_space); - - pbuf = pBuffer->pBuf; - for (i = 0; i < n; i++) { - valCARD16 = (CARD16 *)pbuf; - *valCARD16 = strlen(names[i]); - pbuf += sizeof(CARD16); - memcpy( (char *)pbuf, names[i], (int)(strlen(names[i]))); - pbuf += strlen(names[i]) + PADDING(2 + strlen(names[i])); - xfree(names[i]); - } - xfree(names); - - *pNumNames = n; - pBuffer->dataSize = total_space; - return (Success); -} - -/*++ - | - | Function Name: ListPEXFontsPlus - | - | Function Description: - | Handles the PEXListFontsWithInfo request. - | - --*/ - -/* we don't ever expect to have more than this number of properties per font - but let's not create any bugs we don't have to, so this is just a - guestimate, not an enforced maximum -*/ -#define EST_MAX_FONT_PROPS 10 - -ddpex43rtn -ListPEXFontsPlus(patLen, pPattern, maxNames, pNumNames, pBuffer) -/* in */ - ddUSHORT patLen; /* number of chars in pattern */ - ddUCHAR *pPattern; /* pattern */ - ddUSHORT maxNames; /* maximum number of names to return */ -/* out */ - ddULONG *pNumNames;/* number of names in reply */ - ddBufferPtr pBuffer; /* font names and info */ -{ - - ddPointer pBuf; - ddULONG guess_size = 0, n; - char **names; /* a list of strings */ - int i, j, len; - ddpex43rtn err = Success; - ddFontResource ddFont; - miFontHeader fontData; - Ch_stroke_data **ch_data; - - /* lookup names */ - if (!pex_get_matching_names(patLen, pPattern, maxNames, &n, &names)) - return (BadAlloc); - - /* guess at a large number of bytes for the reply, and make sure - we have this many (can always realloc later) */ - for (i=0; ipBuf; - pBuffer->dataSize = 0; - for (i = 0; i < n; i++) { - len = strlen(names[i]); - PACK_CARD16(len, pBuf); - PACK_LISTOF_STRUCT(len, CARD8, names[i], pBuf); - SKIP_PADDING(pBuf, PADDING(sizeof(CARD16) + len)); - pBuffer->dataSize += sizeof(CARD16) + len + - PADDING(sizeof(CARD16) + len); - } - - - /* read in the font info, write it into the reply buffer */ - ddFont.deviceData = (ddPointer)&(fontData); - fontData.properties = 0; - PACK_CARD32(n, pBuf); - pBuffer->dataSize += sizeof(CARD32); - for (i = 0; i < n; i++) { - - err = LoadPEXFontFile( (ddULONG)(strlen(names[i])), - (ddUCHAR *)(names[i]), - (diFontHandle)&ddFont); - if (err) goto free_names; - - pBuffer->dataSize += sizeof(pexFontInfo) - + sizeof(pexFontProp) * fontData.font_info.numProps; - if (PU_BUF_TOO_SMALL(pBuffer, pBuffer->dataSize)) - if (puBuffRealloc(pBuffer, pBuffer->dataSize) != Success) - goto free_names; - - /* - * Now, make a pass from the first glyph to the last glyph, seeing if - * all are defined. - */ - fontData.font_info.allExist = 1; - ch_data = fontData.ch_data + fontData.font_info.firstGlyph; - for (j = fontData.font_info.firstGlyph; - j < fontData.num_ch && fontData.font_info.allExist; - j++, ch_data++ ) - if (*ch_data == NULL || (*ch_data)->strokes.numLists <= 0) { - fontData.font_info.allExist = 0; - break; } - - /* For now, let the default glyph be an asterisk */ - fontData.font_info.defaultGlyph = (CARD16)'*'; - - /* It's a stroke font */ - fontData.font_info.strokeFont = 1; - - PACK_STRUCT(pexFontInfo, &(fontData.font_info), pBuf); - if (fontData.font_info.numProps > 0) { - PACK_LISTOF_STRUCT( fontData.font_info.numProps, pexFontProp, - fontData.properties, pBuf); - xfree(fontData.properties); - fontData.properties = 0; } - - if (fontData.ch_data) { - for ( j=0, ch_data = fontData.ch_data; - j< fontData.num_ch; - j++, ch_data++) { - if (*ch_data) { - MI_FREELISTHEADER(& ((*ch_data)->strokes)); - xfree((char *)(*ch_data)); } } - xfree((char *) (fontData.ch_data)); } - - xfree(names[i]); - } - - xfree(names); - - *pNumNames = n; - pBuffer->pBuf = pBuf; - return (Success); - -free_names: - for (i = 0; i < n; i++) xfree(names[i]); - xfree(names); - pBuffer->dataSize = 0; - if (err) return(err); - return(BadAlloc); -} /* ListPEXFontsPlus */ - -/* - * Given the extremes of all of the character sets used in composing - * an ISTRING, and given the extremes of the ISTRING itself, along - * with path, expansion and alignment, calculate the correct - * concatenation point and alignment point. The updated extreme values - * are returned. - */ -void -micalc_cpt_and_align(meta_font, extent_xmin, extent_xmax, - extent_ymin, extent_ymax, path, exp, pAlignment, cpt, align) -Meta_font *meta_font; -float *extent_xmin, *extent_xmax; -float *extent_ymin, *extent_ymax; -ddUSHORT path; -ddTextAlignmentData *pAlignment; -ddFLOAT exp; -register pexCoord2D *cpt; -register pexCoord2D *align; -{ - - register float xmin = *extent_xmin, - xmax = *extent_xmax, - ymin = *extent_ymin, - ymax = *extent_ymax; - pexCoord2D temp; - - /* some of the necessary info may not be calculated yet */ - switch (path) { - case PEXPathRight: - if (xmin < 0) { - temp.x = xmax; - xmax = xmin; - xmin = temp.x; - } - cpt->x = xmax; - ymin = meta_font->bottom; - ymax = meta_font->top; - break; - - case PEXPathLeft: - if (xmax <= 0.0) - cpt->x = xmin; - else - cpt->x = xmax; - ymin = meta_font->bottom; - ymax = meta_font->top; - break; - - case PEXPathUp: - if (ymin < 0.0) { - temp.y = ymax; - ymax = ymin + meta_font->bottom; - ymin = temp.y + meta_font->bottom; - } else { - ymin = meta_font->bottom; - ymax += meta_font->bottom; - } - cpt->y = ymax; - xmax = meta_font->width * 0.5 * exp; - xmin = - xmax; - break; - - case PEXPathDown: - if (ymax > 0.0) { - temp.y = ymax; - ymax = ymin; - ymin = temp.y; - } else { - ymin += meta_font->top; - ymax = meta_font->top; - } - cpt->y = ymin; - xmax = meta_font->width * 0.5 * exp; - xmin = - xmax; - break; - } - - /* now do the vertical stuff */ - switch (path) { - - case PEXPathRight : - case PEXPathLeft : - - switch (pAlignment->vertical) { - case PEXValignNormal : - case PEXValignBase : - cpt->y = 0.0; - align->y = ymin - meta_font->bottom; - break; - case PEXValignBottom : - cpt->y = align->y = ymin; - break; - case PEXValignTop : - cpt->y = align->y = ymax; - break; - case PEXValignCap : - cpt->y = FONT_COORD_CAP; - align->y = ymax - (meta_font->top - FONT_COORD_CAP); - break; - case PEXValignHalf : - cpt->y = align->y = FONT_COORD_HALF; - break; - } - - break; - - case PEXPathUp : - case PEXPathDown : - switch (pAlignment->vertical) { - - case PEXValignBase : - align->y = ymin - meta_font->bottom; - break; - case PEXValignBottom : - align->y = ymin; - break; - case PEXValignTop : - align->y = ymax; - break; - case PEXValignCap : - align->y = ymax - (meta_font->top - FONT_COORD_CAP); - break; - case PEXValignHalf : - align->y = FONT_COORD_HALF + 0.5*(ymin - meta_font->bottom); - break; - - case PEXValignNormal : - if (path == PEXPathUp) { - /* for PathUp, NORMAL == BASE */ - align->y = ymin - meta_font->bottom; - } else { /* path == PEXPathDown */ - align->y = ymax; - } - break; - } - - break; - } - - /* now do the horizontal stuff */ - switch (path) { - - case PEXPathRight: - - switch (pAlignment->horizontal) { - case PEXHalignNormal : - case PEXHalignLeft : - align->x = xmin; - break; - case PEXHalignCenter : - align->x = 0.5 * (xmin + xmax); - break; - case PEXHalignRight : - align->x = xmax; - break; - } - break; - - case PEXPathLeft: - - switch (pAlignment->horizontal) { - case PEXHalignLeft : - if (xmax <= 0.0) - align->x = xmin; - else - align->x = xmax + xmin; - break; - - case PEXHalignCenter : - align->x = 0.5 * (xmin + xmax); - break; - - case PEXHalignNormal : - case PEXHalignRight : - align->x = (xmax > 0.0 ? 0.0 : xmax); - break; - } - break; - - case PEXPathUp: - case PEXPathDown: - - switch (pAlignment->horizontal) { - case PEXHalignLeft : - align->x = cpt->x = xmin; - break; - case PEXHalignNormal : - case PEXHalignCenter : - align->x = cpt->x = 0.5 * (xmin + xmax); - break; - case PEXHalignRight : - align->x = cpt->x = xmax; - break; - } - break; - - } - - *extent_xmin = xmin; - *extent_xmax = xmax; - *extent_ymin = ymin; - *extent_ymax = ymax; -} - - - -/*++ - | - | Function Name: QueryPEXTextExtents - | - | Function Description: - | Handles the PEXQueryTextExtents request. - | - | Note(s): - | - --*/ -ddpex43rtn -QueryPEXTextExtents(resource, resourceType, fontIndex, path, expansion, - spacing, height, pAlignment, numStrings, pStrings, pBuffer) -/* in */ - ddPointer resource; /* what it is depends on next arg */ - ddResourceType resourceType; /* renderer, wks, or lut */ - ddUSHORT fontIndex; /* index into font table */ - ddUSHORT path; /* text path */ - ddFLOAT expansion; /* character expansion */ - ddFLOAT spacing; /* character spacing */ - ddFLOAT height; /* character height */ - ddTextAlignmentData *pAlignment; /* text alignment */ - ddULONG numStrings; /* num strings */ - ddPointer pStrings; /* list of ISTRINGS */ -/* out */ - ddBufferPtr pBuffer; /* extent info */ -{ - diLUTHandle fontTable; - register ddPointer ptr; - pexMonoEncoding *mono_enc; - int i, fragnum, charnum, some_characters, signum; - CARD32 numFragments, charval; - diFontHandle font_handle; - miFontHeader *font; - pexExtentInfo *extent; - Ch_stroke_data *char_data; - ddFLOAT sp = spacing * FONT_COORD_HEIGHT; - Meta_font meta_font; - pexCoord2D cur, end, cpt, align; - float xmin, xmax, ymin, ymax; - float ht_scale = height / FONT_COORD_HEIGHT; - extern unsigned long PEXFontType; - miTextFontEntry *miFontTable; - ddTextFontEntry *fontEntry; - ddpex43rtn err; - ddUSHORT status; - - switch (resourceType) { - case WORKSTATION_RESOURCE : { - miWksPtr pwks = (miWksPtr)(((diWKSHandle)resource)->deviceData); - fontTable = pwks->pRend->lut[PEXTextFontLUT]; - break; - - case LOOKUP_TABLE_RESOURCE : - fontTable = (diLUTHandle )resource; - if (fontTable->lutType != PEXTextFontLUT) return (BadMatch); - break; - - case RENDERER_RESOURCE : - fontTable = ((ddRendererPtr )resource)->lut[PEXTextFontLUT]; - break; - - default: return(BadValue); - } - - } - - - /* get ddTextFontEntry member */ - err = InquireLUTEntryAddress( PEXTextFontLUT, fontTable, fontIndex, - &status, (ddPointer *)(&miFontTable)); - if (err != Success) return(err); - fontEntry = &miFontTable->entry; - - PU_CHECK_BUFFER_SIZE(pBuffer, numStrings * sizeof(pexExtentInfo)); - pBuffer->dataSize = numStrings * sizeof(pexExtentInfo); - - - /* signum is used later on to encapsulate addition vs. subtraction */ - if (path == PEXPathRight || path == PEXPathUp) - signum = 1; - else - signum = -1; - - ptr = pStrings; - extent = (pexExtentInfo *)pBuffer->pBuf; - - /* for each ISTRING */ - for (i = 0; i < numStrings; i++, extent++) { - - meta_font.top = -1.0e20; - meta_font.bottom = 1.0e20; - meta_font.width = 1.0e-20; - - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = 0.0; - cur.x = end.x = cur.y = end.y = 0.0; - - some_characters = 0; /* make TRUE when a valid character is found */ - - numFragments = *(CARD32 *)ptr; - ptr += sizeof(CARD32); - - /* for each MONO_ENCODING fragment within the ISTRING */ - for (fragnum = 0; fragnum < numFragments; fragnum++) { - - mono_enc = (pexMonoEncoding *)ptr; - ptr += sizeof(pexMonoEncoding); - - if (mono_enc->characterSet < 1 || - mono_enc->characterSet > fontEntry->numFonts) - mono_enc->characterSet = 1; - - font_handle = fontEntry->fonts[mono_enc->characterSet - 1]; - - /* this is the font that this MONO_ENCODING would be rendered - * with, thus we use it to base our extents on */ - font = (miFontHeader *)(font_handle->deviceData); - - /* bump up ISTRINGS extremes if appropriate */ - if (font->top > meta_font.top) - meta_font.top = font->top; - if (font->bottom < meta_font.bottom) - meta_font.bottom = font->bottom; - if (font->max_width > meta_font.width) - meta_font.width = font->max_width; - - /* for each character within the MONO_ENCODING */ - for (charnum = 0; charnum < mono_enc->numChars; charnum++) { - - switch (mono_enc->characterSetWidth) { - case PEXCSByte : - charval = (CARD32)(*(CARD8 *)ptr); - ptr += sizeof(CARD8); - break; - case PEXCSShort : - charval = (CARD32)(*(CARD16 *)ptr); - ptr += sizeof(CARD16); - break; - case PEXCSLong : - charval = *(CARD32 *)ptr; - ptr += sizeof(CARD32); - break; - } - - if ( (charval < font->font_info.firstGlyph) - || (charval > font->font_info.lastGlyph) - || !(font->ch_data[(int)charval])) /* undefined char */ - if (font->font_info.defaultGlyph == 0 && - font->font_info.firstGlyph > 0) /* no default */ - /* no extent info is calculated for undefined indices - * in charsets where there is no default glyph */ - continue; - else - charval = font->font_info.defaultGlyph; - - some_characters = 1; - char_data = font->ch_data[(int)charval]; - - switch (path) { - - case PEXPathRight : - case PEXPathLeft : - end.x = cur.x + signum * char_data->right * expansion; - if (cur.x > xmax) xmax = cur.x; - if (cur.x < xmin) xmin = cur.x; - if (end.x > xmax) xmax = end.x; - if (end.x < xmin) xmin = end.x; - cur.x = end.x + signum * sp; - break; - - case PEXPathUp : - case PEXPathDown : - end.y = cur.y + signum * (meta_font.top - - meta_font.bottom); - if (cur.y > ymax) ymax = cur.y; - if (cur.y < ymin) ymin = cur.y; - if (end.y > ymax) ymax = end.y; - if (end.y < ymin) ymin = end.y; - cur.y = end.y + signum * sp; - break; - - } - } - - ptr += PADDING(mono_enc->numChars * - ((mono_enc->characterSetWidth == PEXCSByte) - ? sizeof(CARD8) - : ((mono_enc->characterSetWidth == PEXCSShort) - ? sizeof(CARD16) - : sizeof(CARD32)))); - - - } /* for each MONO_ENCODING */ - - if (some_characters) { - - micalc_cpt_and_align( &meta_font, &xmin, &xmax, &ymin, &ymax, - path, expansion, pAlignment, &cpt, &align); - - } else { - /* no valid characters */ - xmin = xmax = ymin = ymax = 0.0; - cpt.x = cpt.y = align.x = align.y = 0.0; - } - - extent->lowerLeft.x = ht_scale * (xmin - align.x); - extent->lowerLeft.y = ht_scale * (ymin - align.y); - extent->upperRight.x = ht_scale * (xmax - align.x); - extent->upperRight.y = ht_scale * (ymax - align.y); - extent->concatpoint.x = ht_scale * (cpt.x - align.x); - extent->concatpoint.y = ht_scale * (cpt.y - align.y); - - } /* for each ISTRING */ - - return (Success); -} /* QueryPEXTextExtents */ - - -/*++ - | - | Function Name: UpdateFontRefs - | - | Function Description: - | The font resource knows how many LUTs are referencing it. If - | that number drops to zero, and FreePEXFont has already been - | called, then we really release the storage used by the font. - | - | Note(s): - | - --*/ -ddpex43rtn -UpdateFontRefs(pFont, pResource, action) -/* in */ - diFontHandle pFont; /* font handle */ - diLUTHandle pResource;/* lut handle */ - ddAction action; /* add or remove */ -/* out */ -{ - - miFontHeader *font = (miFontHeader *) pFont->deviceData; - - if (action == ADD) font->lutRefCount++; - else font->lutRefCount--; - - if ((font->freeFlag == MI_TRUE) && (font->lutRefCount == 0)) - really_free_font (pFont); - - return (Success); -} /* UpdateFontRefs */ - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c:1.9 Fri Dec 14 14:57:38 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c Sat Feb 28 21:41:55 2004 @@ -1,232 +0,0 @@ -/* $Xorg: miFontLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miFontLUT.c,v 1.9 2001/12/14 19:57:38 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern diFontHandle defaultPEXFont; -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXTextFontLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddTextFontEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miTextFontEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexTextFontEntry - -#define LUT_REND_DYN_BIT PEXDynTextFontTableContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 2 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.font - -/* no DYNAMIC */ - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeTextFontEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeTextFontEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeTextFontEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE TextFontLUT_free -#define LUT_INQ_PREDEF TextFontLUT_inq_predef -#define LUT_INQ_ENTRIES TextFontLUT_inq_entries -*/ -#define LUT_COPY TextFontLUT_copy -#define LUT_INQ_INFO TextFontLUT_inq_info -#define LUT_INQ_IND TextFontLUT_inq_ind -#define LUT_INQ_ENTRY TextFontLUT_inq_entry -#define LUT_SET_ENTRIES TextFontLUT_set_entries -#define LUT_DEL_ENTRIES TextFontLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS TextFontLUT_inq_entry_address -#define LUT_CREATE TextFontLUT_create -#define LUT_ENTRY_CHECK TextFontLUT_entry_check -#define LUT_COPY_PEX_MI TextFontLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX TextFontLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK TextFontLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - mibcopy(pdev_entry->fonts, pb, pdev_entry->numFonts * sizeof(pexFont)); - - pb += pdev_entry->numFonts * sizeof(pexFont); - - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - diFontHandle *psfonts, *pdfonts; - register int j; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - for (psfonts = (diFontHandle *)ps, pdfonts = pentry->entry.fonts, j = 0; - j < pentry->entry.numFonts; j++, psfonts++, pdfonts++) - *pdfonts = *psfonts; - for (; j < MILUT_MAX_CS_PER_ENTRY; j++, pdfonts++) - *pdfonts = defaultPEXFont; - - *ppsrc = (ddPointer)psfonts; - - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - - /* numFonts: imp. dep limitation */ - if ((*ppPexEntry)->numFonts > MILUT_MAX_CS_PER_ENTRY) - return(BadValue); - /* dipex should have looked up font id's and made them handles - * and would have found any bad ids */ - - pe += sizeof(PEX_LUT_ENTRY_STR) + - (*ppPexEntry)->numFonts * sizeof(pexFont); - - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - - -void -TextFontLUT_init_pde() -{ - register int i; - - pdeTextFontEntry[0].numFonts = 1; - pdeTextFontEntry[0].fonts[0] = defaultPEXFont; - /* fill in the rest of this with this font, since we want 'undefined' - * character sets to default to the default font (0) in the font group. */ - for (i = 1; i < MILUT_MAX_CS_PER_ENTRY; i++) - pdeTextFontEntry[0].fonts[i] = defaultPEXFont; -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c:1.9 Fri Dec 14 14:57:38 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c Sat Feb 28 21:41:55 2004 @@ -1,439 +0,0 @@ -/* $Xorg: miIntLUT.c,v 1.4 2001/02/09 02:04:12 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miIntLUT.c,v 1.9 2001/12/14 19:57:38 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* useful definition when testing */ -typedef struct { - pexEnumTypeIndex interiorStyle; - INT16 interiorStyleIndex; - pexEnumTypeIndex reflectionModel; - pexEnumTypeIndex surfaceInterp; - pexEnumTypeIndex bfInteriorStyle; - INT16 bfInteriorStyleIndex; - pexEnumTypeIndex bfReflectionModel; - pexEnumTypeIndex bfSurfaceInterp; - pexSurfaceApprox surfaceApprox; - pexColourSpecifier surfaceColour; - pexIndexedColour index1; - pexReflectionAttr reflectionAttr; - pexIndexedColour index2; - pexColourSpecifier bfSurfaceColour; - pexIndexedColour index3; - pexReflectionAttr bfReflectionAttr; - pexIndexedColour index4; -} bogus_pexInteriorBundleEntry; - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXInteriorBundleLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddInteriorBundleEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miInteriorBundleEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexInteriorBundleEntry - -#define LUT_REND_DYN_BIT PEXDynInteriorBundleContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 20 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.interior - -#define DYNAMIC INTERIOR_BUNDLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeInteriorBundleEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeInteriorBundleEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->real_entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeInteriorBundleEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - (pentry)->real_entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE InteriorBundleLUT_free -#define LUT_INQ_PREDEF InteriorBundleLUT_inq_predef -#define LUT_INQ_ENTRIES InteriorBundleLUT_inq_entries -*/ -#define LUT_COPY InteriorBundleLUT_copy -#define LUT_INQ_INFO InteriorBundleLUT_inq_info -#define LUT_INQ_IND InteriorBundleLUT_inq_ind -#define LUT_INQ_ENTRY InteriorBundleLUT_inq_entry -#define LUT_SET_ENTRIES InteriorBundleLUT_set_entries -#define LUT_DEL_ENTRIES InteriorBundleLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS InteriorBundleLUT_inq_entry_address -#define LUT_CREATE InteriorBundleLUT_create -#define LUT_ENTRY_CHECK InteriorBundleLUT_entry_check -#define LUT_COPY_PEX_MI InteriorBundleLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX InteriorBundleLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK InteriorBundleLUT_mod_call_back -#define LUT_REALIZE_ENTRY InteriorBundleLUT_realize_entry - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - if (valueType == PEXRealizedValue) - pdev_entry = &pentry->real_entry; - else - pdev_entry = &pentry->entry; - - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - pb += sizeof(PEX_LUT_ENTRY_STR); - - /* surface colour */ - mibcopy(&pdev_entry->surfaceColour, pb, sizeof(pexColourSpecifier)); - pb += sizeof(pexColourSpecifier); - MILUT_COPY_COLOUR(&pdev_entry->surfaceColour.colour, - pb, pdev_entry->surfaceColour.colourType); - pb += colour_type_sizes[(int)pdev_entry->surfaceColour.colourType]; - - /* refl attrs */ - mibcopy(&pdev_entry->reflectionAttr, pb, sizeof(pexReflectionAttr)); - pb += sizeof(pexReflectionAttr); - MILUT_COPY_COLOUR(&pdev_entry->reflectionAttr.specularColour.colour, - pb, pdev_entry->reflectionAttr.specularColour.colourType); - pb += colour_type_sizes[(int)pdev_entry->reflectionAttr.specularColour.colourType]; - - /* bf surface colour */ - mibcopy(&pdev_entry->bfSurfaceColour, pb, sizeof(pexColourSpecifier)); - pb += sizeof(pexColourSpecifier); - MILUT_COPY_COLOUR(&pdev_entry->bfSurfaceColour.colour, - pb, pdev_entry->bfSurfaceColour.colourType); - pb += colour_type_sizes[(int)pdev_entry->bfSurfaceColour.colourType]; - - /* bf refl attrs */ - mibcopy(&pdev_entry->bfReflectionAttr, pb, sizeof(pexReflectionAttr)); - pb += sizeof(pexReflectionAttr); - MILUT_COPY_COLOUR(&pdev_entry->bfReflectionAttr.specularColour.colour, - pb, pdev_entry->bfReflectionAttr.specularColour.colourType); - pb += colour_type_sizes[(int)pdev_entry->bfReflectionAttr.specularColour.colourType]; - - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddSHORT colourType; - ddPointer psrc = *ppsrc; - - mibcopy(psrc, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - psrc += sizeof(PEX_LUT_ENTRY_STR); - - pentry->entry.surfaceColour.colourType = colourType = - ((pexColourSpecifier *)psrc)->colourType; - psrc += sizeof(pexColourSpecifier); - MILUT_COPY_COLOUR(psrc, &(pentry->entry.surfaceColour.colour), colourType); - psrc += colour_type_sizes[(int)colourType]; - - mibcopy(psrc, &(pentry->entry.reflectionAttr), sizeof(pexReflectionAttr)); - psrc += sizeof(pexReflectionAttr); - - colourType = pentry->entry.reflectionAttr.specularColour.colourType; - MILUT_COPY_COLOUR(psrc, &(pentry->entry.reflectionAttr.specularColour.colour), - colourType); - psrc += colour_type_sizes[(int)colourType]; - - pentry->entry.bfSurfaceColour.colourType = colourType = - ((pexColourSpecifier *)psrc)->colourType; - psrc += sizeof(pexColourSpecifier); - MILUT_COPY_COLOUR(psrc, &(pentry->entry.bfSurfaceColour.colour), colourType); - psrc += colour_type_sizes[(int)colourType]; - - mibcopy(psrc, &(pentry->entry.bfReflectionAttr), sizeof(pexReflectionAttr)); - psrc += sizeof(pexReflectionAttr); - - colourType = pentry->entry.bfReflectionAttr.specularColour.colourType; - MILUT_COPY_COLOUR(psrc, &(pentry->entry.bfReflectionAttr.specularColour.colour), - colourType); - psrc += colour_type_sizes[(int)colourType]; - - LUT_REALIZE_ENTRY( pheader, pentry ); - - *ppsrc = psrc; - - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer ps; - ddSHORT colourType; - - /* interiorStyle: any value OK. use style 1 if it's not supported */ - /* interiorStyleIndex: any value OK. this is used for patterns - * and hatches which aren't supported */ - /* reflectionModel: any value OK. use method 1 if it's not supported */ - /* surfaceInterp: any value OK. use method 1 if it's not supported */ - /* same as above for bf values */ - - /* surfaceApprox: any value OK. use method 1 if it's not supported */ - /* front and back reflection attrs: any values OK */ - - /* colours: only accept supported colour types */ - ps = (ddPointer)(*ppPexEntry + 1); - colourType = ((pexColourSpecifier *)ps)->colourType; - if (MI_BADCOLOURTYPE(colourType)) - return(PEXERR(PEXColourTypeError)); - - ps += sizeof(pexColourSpecifier) + colour_type_sizes[(int)colourType]; - colourType = ((pexReflectionAttr *)ps)->specularColour.colourType; - if (MI_BADCOLOURTYPE(colourType)) - return(PEXERR(PEXColourTypeError)); - - ps += sizeof(pexReflectionAttr) + colour_type_sizes[(int)colourType]; - colourType = ((pexColourSpecifier *)ps)->colourType; - if (MI_BADCOLOURTYPE(colourType)) - return(PEXERR(PEXColourTypeError)); - - ps += sizeof(pexColourSpecifier) + colour_type_sizes[(int)colourType]; - colourType = ((pexReflectionAttr *)ps)->specularColour.colourType; - if (MI_BADCOLOURTYPE(colourType)) - return(PEXERR(PEXColourTypeError)); - - ps += sizeof(pexReflectionAttr) + colour_type_sizes[(int)colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)ps; - - return(Success); -} - -/* realize entry */ -ddpex43rtn -LUT_REALIZE_ENTRY( pheader, pEntry ) - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pEntry; -{ - extern miEnumType miInteriorStyleET[][SI_INT_NUM]; - extern miEnumType miReflectionModelET[][SI_REFLECT_NUM]; - extern miEnumType miSurfaceInterpMethodET[][SI_SURF_INTERP_NUM]; - extern miEnumType miSurfaceApproxMethodET[][SI_SURF_APPROX_NUM]; - - /* interiorStyle: any value OK. use interior style 1 if it's not supported */ - if ( (pEntry->entry.interiorStyle < - miInteriorStyleET[pheader->drawType][0].index) || - (pEntry->entry.interiorStyle > - miInteriorStyleET[pheader->drawType][SI_INT_NUM - 1].index) ) - pEntry->real_entry.interiorStyle = 1; - else - pEntry->real_entry.interiorStyle = pEntry->entry.interiorStyle; - - /* interiorStyleIndex: any value OK. it's only for patterns & hatches - * which are supported */ - pEntry->real_entry.interiorStyleIndex = pEntry->entry.interiorStyleIndex; - - /* reflectionModel: any value OK. use model 1 if it's not supported */ - if ( (pEntry->entry.reflectionModel < - miReflectionModelET[pheader->drawType][0].index) || - (pEntry->entry.reflectionModel > - miReflectionModelET[pheader->drawType][SI_REFLECT_NUM - 1].index) ) - pEntry->real_entry.reflectionModel = 1; - else - pEntry->real_entry.reflectionModel = pEntry->entry.reflectionModel; - - /* surfaceInterp: any value OK. use model 1 if it's not supported */ - if ( (pEntry->entry.surfaceInterp < - miSurfaceInterpMethodET[pheader->drawType][0].index) || - (pEntry->entry.surfaceInterp > - miSurfaceInterpMethodET[pheader->drawType][SI_SURF_INTERP_NUM - 1].index) ) - pEntry->real_entry.surfaceInterp = 1; - else - pEntry->real_entry.surfaceInterp = pEntry->entry.surfaceInterp; - - /* bfinteriorStyle: any value OK. use style 1 if it's not supported */ - if ( (pEntry->entry.bfInteriorStyle < - miInteriorStyleET[pheader->drawType][0].index) || - (pEntry->entry.bfInteriorStyle > - miInteriorStyleET[pheader->drawType][SI_INT_NUM - 1].index) ) - pEntry->real_entry.bfInteriorStyle = 1; - else - pEntry->real_entry.bfInteriorStyle = pEntry->entry.bfInteriorStyle; - - /* bfInteriorStyleIndex: any value OK. it's only for patterns & hatches - * which are supported */ - pEntry->real_entry.bfInteriorStyleIndex = pEntry->entry.bfInteriorStyleIndex; - - /* bfReflectionModel: any value OK. use model 1 if it's not supported */ - if ( (pEntry->entry.bfReflectionModel < - miReflectionModelET[pheader->drawType][0].index) || - (pEntry->entry.bfReflectionModel > - miReflectionModelET[pheader->drawType][SI_REFLECT_NUM - 1].index) ) - pEntry->real_entry.bfReflectionModel = 1; - else - pEntry->real_entry.bfReflectionModel = pEntry->entry.bfReflectionModel; - - /* bfSurfaceInterp: any value OK. use model 1 if it's not supported */ - if ( (pEntry->entry.bfSurfaceInterp < - miSurfaceInterpMethodET[pheader->drawType][0].index) || - (pEntry->entry.bfSurfaceInterp > - miSurfaceInterpMethodET[pheader->drawType][SI_SURF_INTERP_NUM - 1].index) ) - pEntry->real_entry.bfSurfaceInterp = 1; - else - pEntry->real_entry.bfSurfaceInterp = pEntry->entry.bfSurfaceInterp; - - /* surfaceApprox: any value OK. use model 1 if it's not supported */ - if ( (pEntry->entry.surfaceApprox.approxMethod < - miSurfaceApproxMethodET[pheader->drawType][0].index) || - (pEntry->entry.surfaceApprox.approxMethod > - miSurfaceApproxMethodET[pheader->drawType][SI_SURF_APPROX_NUM - 1].index) ) - pEntry->real_entry.surfaceApprox.approxMethod = 1; - else - pEntry->real_entry.surfaceApprox.approxMethod = - pEntry->entry.surfaceApprox.approxMethod; - - pEntry->real_entry.surfaceApprox.uTolerance = pEntry->entry.surfaceApprox.uTolerance; - pEntry->real_entry.surfaceApprox.vTolerance = pEntry->entry.surfaceApprox.vTolerance; - - /* front and back reflection attrs: any values OK (includes colours) */ - pEntry->real_entry.reflectionAttr = pEntry->entry.reflectionAttr; - pEntry->real_entry.bfReflectionAttr = pEntry->entry.bfReflectionAttr; - - /* colourType: its an error if an unsupported colour type was - * specified. For supported colour types, should mapped colour - * be returned?? - */ - pEntry->real_entry.surfaceColour = pEntry->entry.surfaceColour; - pEntry->real_entry.bfSurfaceColour = pEntry->entry.bfSurfaceColour; - -} -void -InteriorBundleLUT_init_pde() -{ - pdeInteriorBundleEntry[0].interiorStyle = PEXInteriorStyleHollow; - pdeInteriorBundleEntry[0].interiorStyleIndex = 1; - pdeInteriorBundleEntry[0].reflectionModel = PEXReflectionNoShading; - pdeInteriorBundleEntry[0].surfaceInterp = PEXSurfaceInterpNone; - pdeInteriorBundleEntry[0].bfInteriorStyle = PEXInteriorStyleHollow; - pdeInteriorBundleEntry[0].bfInteriorStyleIndex = 1; - pdeInteriorBundleEntry[0].bfReflectionModel = PEXReflectionNoShading; - pdeInteriorBundleEntry[0].bfSurfaceInterp = PEXSurfaceInterpNone; - pdeInteriorBundleEntry[0].surfaceApprox.approxMethod = 1; - pdeInteriorBundleEntry[0].surfaceApprox.uTolerance = 1.0; - pdeInteriorBundleEntry[0].surfaceApprox.vTolerance = 1.0; - MILUT_INIT_COLOUR(pdeInteriorBundleEntry[0].surfaceColour); - pdeInteriorBundleEntry[0].bfSurfaceColour = - pdeInteriorBundleEntry[0].surfaceColour; - pdeInteriorBundleEntry[0].reflectionAttr.ambient = 1.0; - pdeInteriorBundleEntry[0].reflectionAttr.diffuse = 1.0; - pdeInteriorBundleEntry[0].reflectionAttr.specular = 1.0; - pdeInteriorBundleEntry[0].reflectionAttr.specularConc = 0.0; - pdeInteriorBundleEntry[0].reflectionAttr.transmission = 0.0; - MILUT_INIT_COLOUR(pdeInteriorBundleEntry[0].reflectionAttr.specularColour); - pdeInteriorBundleEntry[0].bfReflectionAttr = - pdeInteriorBundleEntry[0].reflectionAttr; -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c:1.11 xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c:1.11 Fri Dec 14 14:57:38 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c Sat Feb 28 21:41:55 2004 @@ -1,839 +0,0 @@ -/* $Xorg: miLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUT.c,v 1.11 2001/12/14 19:57:38 dawes Exp $ */ - -#include "miLUT.h" -#include "pexUtils.h" -#include "PEX.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* General Lookup Table Procedures */ - -/* A flag to know if predefined entries are initialized. - * Most of them can't be automatically initialized because - * they contain unions, so they are set dynamically - * The flag is initialized in ddpexInit() - */ -int predef_initialized; - -/* used by other LUT modules */ -unsigned colour_type_sizes[] = { - sizeof(ddIndexedColour), - sizeof(ddRgbFloatColour), - sizeof(ddCieColour), - sizeof(ddHsvColour), - sizeof(ddHlsColour), - sizeof(ddRgb8Colour), - sizeof(ddRgb16Colour) -}; - -static void InitializePDEs(); - -static unsigned entry_size[] = { - 0, /* dummy so table type indexes into table */ - sizeof(miLineBundleEntry), /* line bundle */ - sizeof(miMarkerBundleEntry), /* marker bundle */ - sizeof(miTextBundleEntry), /* text bundle */ - sizeof(miInteriorBundleEntry),/* interior bundle */ - sizeof(miEdgeBundleEntry), /* edge bundle */ - sizeof(miPatternEntry), /* pattern table */ - sizeof(miTextFontEntry), /* font table */ - sizeof(miColourEntry), /* colour table */ - sizeof(miViewEntry), /* view table */ - sizeof(miLightEntry), /* light table */ - sizeof(miDepthCueEntry), /* depth cue table */ - sizeof(miColourApproxEntry), /* colour approx table */ -}; - -/*++ - | - | Function Name: CreateLUT - | - | Function Description: - | Handles the PEXCreateLookupTable request. - | - | Note(s): - dipex checks for bad id, drawable, table type - | - --*/ - -/* create procs are called through this table instead of through - * ops table in lut header. - */ -extern ddpex43rtn LineBundleLUT_create(), - MarkerBundleLUT_create(), - TextBundleLUT_create(), - InteriorBundleLUT_create(), - EdgeBundleLUT_create(), - PatternLUT_create(), - TextFontLUT_create(), - ColourLUT_create(), - ViewLUT_create(), - LightLUT_create(), - DepthCueLUT_create(), - ColourApproxLUT_create(); - -miOpsTableType createLUTtable[] = { - LineBundleLUT_create, - MarkerBundleLUT_create, - TextBundleLUT_create, - InteriorBundleLUT_create, - EdgeBundleLUT_create, - PatternLUT_create, - TextFontLUT_create, - ColourLUT_create, - ViewLUT_create, - LightLUT_create, - DepthCueLUT_create, - ColourApproxLUT_create, -}; - -ddpex43rtn -CreateLUT(pDrawable, pLUT) -/* in */ - DrawablePtr pDrawable;/* pointer to example drawable */ - diLUTHandle pLUT; /* lut handle */ -/* out */ -{ - register miLUTHeader *pheader; - ddUSHORT LUTtype = pLUT->lutType; - ddpex43rtn err; - -#ifdef DDTEST - ErrorF( "\nCreateLUT %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - pLUT->deviceData = NULL; - - if ((pheader = (miLUTHeader *) xalloc(sizeof(miLUTHeader))) == NULL) - return (BadAlloc); - - /* the id and table type are already in the di resource structure */ - pheader->freeFlag = MI_FALSE; - - /* set drawable example and type which supports this drawable */ - MI_SETDRAWEXAMPLE(pDrawable, &(pheader->drawExample)); - MI_WHICHDRAW(pDrawable, pheader->drawType); - - if (!(pheader->wksRefList = puCreateList(DD_WKS))) - { - xfree( pheader); - return (BadAlloc); - } - - if (!(pheader->rendRefList = puCreateList(DD_RENDERER))) - { - puDeleteList(pheader->wksRefList); - xfree(pheader); - return (BadAlloc); - } - - /* - * now create the predefined entries. for now, - * predefined entries don't depend on the drawable type. If they every - * do, make the pde vars a 2-d array - the first dimension based on - * drawable type and the second one the entries for that drawable type. - * (see InquireEnumTypeInfo for an example of this) - */ - if (!predef_initialized) - { - InitializePDEs(); - predef_initialized = 1; - } - - err = Success; - err = createLUTtable[LUTtype-1](pLUT, pheader); - if (err != Success) - { - MILUT_DESTROY_HEADER(pheader); - } - - return(err); - -} /* CreateLUT */ - - -/*++ - | - | Function Name: FreeLUT - | - | Function Description: - | Frees all of the storage for the lookup table if no resource is using - | it, otherwise it sets the free flag in the structure. This is - | registered with the resource id and handle by diPEX with AddResource. - | - | Note(s): - dipex checks for bad id - | - --*/ - -ddpex43rtn -FreeLUT(pLUT, LUTid) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddResourceId LUTid; /* lookup table resource id */ -/* out */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - -#ifdef DDTEST - ErrorF( "\nFreeLUT %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - pheader->freeFlag = MI_TRUE; - pLUT->id = PEXAlreadyFreed; - MILUT_CHECK_DESTROY(pLUT, pheader); - - return (Success); -} /* FreeLUT */ - -/*++ - | - | Function Name: CopyLUT - | - | Function Description: - | Handles the PEXCopyLookupTable request. - | - | Note(s): - dipex checks for bad ids - | - --*/ - -#define COMPARE_DRAWABLE_EXAMPLES(Ex1, Ex2, Op) \ - ((Ex1).type Op (Ex2).type) \ -&& ((Ex1).depth Op (Ex2).depth) \ -&& ((Ex1).rootDepth Op (Ex2).rootDepth) - -ddpex43rtn -CopyLUT(pSrcLUT, pDestLUT) -/* in */ - diLUTHandle pSrcLUT; /* source lookup table */ - diLUTHandle pDestLUT; /* destination lookup table */ -/* out */ -{ - MILUT_DEFINE_HEADER(pSrcLUT, srcHeader); - MILUT_DEFINE_HEADER(pDestLUT, destHeader); - -#ifdef DDTEST - ErrorF( "\nCopyLUT src %d type %d\n", pSrcLUT->id, pSrcLUT->lutType); - ErrorF( "\nCopyLUT dest %d type %d\n", pDestLUT->id, pDestLUT->lutType); -#endif - - if (pSrcLUT->lutType != pDestLUT->lutType) - return (BadMatch); - - /* compare the drawable examples. */ -/* - * Here's one way - * - * if (! (COMPARE_DRAWABLE_EXAMPLES(srcHeader->drawExample, - * destHeader->drawExample,==)) - * - * (see the macro definition above; it compares most of the struct members) - * but the one below is more restrictive, I think (it probably means both - * drawables are on the same framebuffer) and is likely safe for now. - */ - if (srcHeader->drawExample.rootVisual != destHeader->drawExample.rootVisual) - return (BadMatch); - - return(srcHeader->ops[MILUT_REQUEST_OP(PEX_CopyLookupTable)] - (pSrcLUT, pDestLUT)); -} /* CopyLUT */ - -/*++ - | - | Function Name: InquireLUTInfo - | - | Function Description: - | Handles the PEXGetTableInfo request. - | - | Note(s): - dipex checks for bad drawable id and type - | - --*/ -extern ddpex43rtn LineBundleLUT_inq_info(), - MarkerBundleLUT_inq_info(), - TextBundleLUT_inq_info(), - InteriorBundleLUT_inq_info(), - EdgeBundleLUT_inq_info(), - PatternLUT_inq_info(), - TextFontLUT_inq_info(), - ColourLUT_inq_info(), - ViewLUT_inq_info(), - LightLUT_inq_info(), - DepthCueLUT_inq_info(), - ColourApproxLUT_inq_info(); - -miOpsTableType inq_info_LUTtable[] = { - LineBundleLUT_inq_info, - MarkerBundleLUT_inq_info, - TextBundleLUT_inq_info, - InteriorBundleLUT_inq_info, - EdgeBundleLUT_inq_info, - PatternLUT_inq_info, - TextFontLUT_inq_info, - ColourLUT_inq_info, - ViewLUT_inq_info, - LightLUT_inq_info, - DepthCueLUT_inq_info, - ColourApproxLUT_inq_info, -}; - - -ddpex43rtn -InquireLUTInfo(pDrawable, LUTtype, pLUTinfo) -/* in */ - DrawablePtr pDrawable;/* pointer to example drawable */ - ddUSHORT LUTtype; /* lookup table type */ -/* out */ - ddTableInfo *pLUTinfo; /* table information */ -{ - -#ifdef DDTEST - ErrorF( "\nInquireLUTInfo type %d\n", LUTtype); -#endif - - return (inq_info_LUTtable[LUTtype-1](pDrawable, pLUTinfo)); -} /* InquireLUTInfo */ - - -/*++ - | - | Function Name: InquireLUTPredEntries - | - | Function Description: - | Handles the PEXGetPredefinedEntries request. - | - | Note(s): - dipex checks for bad drawable and type - | - --*/ - -ddpex43rtn -InquireLUTPredEntries(pDrawable, LUTtype, start, count, pNumEntries, pBuffer) -/* in */ - DrawablePtr pDrawable; /* pointer to example drawable */ - ddUSHORT LUTtype; /* table type */ - ddTableIndex start; /* start index */ - ddUSHORT count; /* number of entries to return */ /* out */ - ddULONG *pNumEntries; /* number of entries */ - ddBufferPtr pBuffer; /* table entries */ -{ - ddLUTResource lut; - ddpex43rtn err43; - unsigned long hdrSiz = pBuffer->pBuf - pBuffer->pHead; - unsigned long dataSiz = 0; - int reply_size = entry_size[LUTtype] * count; - int i; - ddUSHORT status; - -#ifdef DDTEST - ErrorF( "\nInquireLUTPredEntries type %d\n", LUTtype); -#endif - - *pNumEntries = 0; - pBuffer->dataSize = 0; - - /* - * reply_size is an upper-bound on the size of the stuff that - * will actually be returned, so once we do this, InquireLUTEntry - * shouldn't have to reallocate the buffer - */ - PU_CHECK_BUFFER_SIZE(pBuffer, reply_size); - - /* - * CreateLUT and InquireLUTEntries have a lot of smarts about - * predefined entries and default entries, so use them. - */ - lut.id = 0; - lut.lutType = LUTtype; - if ((err43 = CreateLUT(pDrawable, &lut)) != Success) - return (err43); - - /* see if start and count are in range of predefined entries - * or if entry 0 is requested for table which doesn't use 0 - */ -#if 0 - if (( start < MILUT_PREMIN(MILUT_HEADER(&lut)) ) || - ( (start + count - 1) > MILUT_PREMAX(MILUT_HEADER(&lut)) ) || - ( !start && MILUT_START_INDEX(MILUT_HEADER(&lut)) )) - { - MILUT_DESTROY_HEADER((miLUTHeader *) lut.deviceData); - return(BadValue); - } -#endif - - for (i = 0; i < count; i++) - { - /* call get entry op instead of calling InquireLUTEntry */ - err43 = MILUT_HEADER(&lut)->ops[MILUT_REQUEST_OP(PEX_GetTableEntry)] - (&lut, i + start, PEXSetValue, &status, pBuffer); - - if (err43 != Success) - { - /* reset data buffer pointer */ - pBuffer->pBuf = pBuffer->pHead + hdrSiz; - pBuffer->dataSize = 0; - return (err43); - } - - /* - * move data buffer pointer to put next entry after the one just - * gotten - */ - dataSiz += pBuffer->dataSize; - pBuffer->pBuf = pBuffer->pHead + hdrSiz + dataSiz; - } - - /* reset data buffer pointer */ - pBuffer->pBuf = pBuffer->pHead + hdrSiz; - pBuffer->dataSize = dataSiz; - *pNumEntries = count; - - MILUT_DESTROY_HEADER((miLUTHeader *) lut.deviceData); - - return (Success); -} /* InquireLUTPredEntries */ - - -/*++ - | - | Function Name: InquireLUTIndices - | - | Function Description: - | Handles the PEXGetDefinedIndices request. - | - | Note(s): - dipex checks for bad lut - | - --*/ - -ddpex43rtn -InquireLUTIndices(pLUT, pNumIndices, pBuffer) -/* in */ - diLUTHandle pLUT; /* lut handle */ -/* out */ - ddULONG *pNumIndices; /* number of indices in list */ - ddBufferPtr pBuffer; /* list of table indices */ -{ -#ifdef DDTEST - ErrorF( "\nInquireLUTIndices %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - *pNumIndices = 0; - return(MILUT_HEADER(pLUT)->ops[MILUT_REQUEST_OP(PEX_GetDefinedIndices)] - (pLUT, pNumIndices, pBuffer)); -} /* InquireLUTIndices */ - - - -/*++ - | - | Function Name: InquireLUTEntry - | - | Function Description: - | Handles the PEXGetTableEntry request. - | - | Note(s): - dipex checks for bad lut - | - --*/ - -ddpex43rtn -InquireLUTEntry(pLUT, index, valueType, pStatus, pBuffer) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex index; /* index of entry to get */ - ddUSHORT valueType; /* SET or REALIZED */ -/* out */ - ddUSHORT *pStatus; /* entry status */ - ddBufferPtr pBuffer; /* table entry */ -{ -#ifdef DDTEST - ErrorF( "\nInquireLUTEntry %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - *pStatus = PEXDefaultEntry; - pBuffer->dataSize = 0; - - /* see if entry 0 is requested for table which doesn't use 0 */ - if (!index && MILUT_START_INDEX(MILUT_HEADER(pLUT))) - return(BadValue); - - if ((valueType != PEXRealizedValue) && (valueType != PEXSetValue)) - return(BadValue); - - return(MILUT_HEADER(pLUT)->ops[MILUT_REQUEST_OP(PEX_GetTableEntry)] - (pLUT, index, valueType, pStatus, pBuffer)); -} /* InquireLUTEntry */ - - -/*++ - | - | Function Name: InquireLUTEntries - | - | Function Description: - | Handles the PEXGetTableEntries request. - | - | Note(s): - dipex checks for bad lut - | - --*/ - -ddpex43rtn -InquireLUTEntries(pLUT, start, count, valueType, pNumEntries, pBuffer) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex start; /* index of first entry to get */ - ddUSHORT count; /* number of entries requested */ - ddUSHORT valueType; /* SET or REALIZED */ -/* out */ - ddULONG *pNumEntries; /* number of entries in list */ - ddBufferPtr pBuffer; /* list of table entries */ -{ - unsigned long hdrSiz = pBuffer->pBuf - pBuffer->pHead; - unsigned long dataSiz = 0; - int reply_size = entry_size[MILUT_TYPE(pLUT)] * count; - int i; - ddUSHORT status; - ddpex43rtn err; - - /* - * reply_size is an upper-bound on the size of the stuff that - * will actually be returned, so once we do this, InquireLUTEntry - * shouldn't have to reallocate the buffer - */ - - *pNumEntries = 0; - PU_CHECK_BUFFER_SIZE(pBuffer, reply_size); - - /* see if entry 0 is requested for table which doesn't use 0 - * or if start + count is greater than 65535 - */ - if ((!start && MILUT_START_INDEX(MILUT_HEADER(pLUT))) || - ((ddULONG)(start + count) > MILUT_MAX_INDEX)) - return(BadValue); - - if ((valueType != PEXRealizedValue) && (valueType != PEXSetValue)) - return(BadValue); - - for (i = 0; i < count; i++) - { - /* call get entry op instead of calling InquireLUTEntry */ - err = MILUT_HEADER(pLUT)->ops[MILUT_REQUEST_OP(PEX_GetTableEntry)] - (pLUT, i + start, valueType, &status, pBuffer); - - if (err != Success) - { - /* reset data buffer pointer */ - pBuffer->pBuf = pBuffer->pHead + hdrSiz; - pBuffer->dataSize = 0; - return (err); - } - - /* - * move data buffer pointer to put next entry after the one just - * gotten - */ - dataSiz += pBuffer->dataSize; - pBuffer->pBuf = pBuffer->pHead + hdrSiz + dataSiz; - } - - /* reset data buffer pointer */ - pBuffer->pBuf = pBuffer->pHead + hdrSiz; - pBuffer->dataSize = dataSiz; - *pNumEntries = count; - - return (Success); -} /* InquireLUTEntries */ - - -/*++ - | - | Function Name: SetLUTEntries - | - | Function Description: - | Handles the PEXSetTableEntries request. - | - | Note(s): - | - --*/ - -ddpex43rtn -SetLUTEntries(pLUT, start, numEntries, pEntries) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex start; /* index of first entry to set */ - ddUSHORT numEntries; /* number of entries to set */ - ddPointer pEntries; /* list of entries */ -{ - -#ifdef DDTEST - ErrorF( "\nSetLUTEntries %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - /* see if entry 0 is requested for table which doesn't use 0 - * or if start + count is greater than 65535 - */ - if ((!start && MILUT_START_INDEX(MILUT_HEADER(pLUT))) || - ((ddULONG)(start + numEntries) > MILUT_MAX_INDEX)) - return(BadValue); - - return(MILUT_HEADER(pLUT)->ops[MILUT_REQUEST_OP(PEX_SetTableEntries)] - (pLUT, start, numEntries, pEntries)); -} /* SetLUTEntries */ - - -/*++ - | - | Function Name: DeleteLUTEntries - | - | Function Description: - | Handles the PEXDeleteTableEntries request. - | - | Note(s): - | - --*/ - -#define SETSTATUS( ptr, value ) \ - for ( i=start; ientry_info.status = (value) - -ddpex43rtn -DeleteLUTEntries(pLUT, start, numEntries) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddUSHORT start; /* index of first entry to delete */ - ddUSHORT numEntries; /* number of entries in range */ -/* out */ -{ - -#ifdef DDTEST - ErrorF( "\nDeleteLUTEntries %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - /* see if start + count is greater than 65535 - * or if entry 0 is requested for table which doesn't use 0 - */ - if (( (ddULONG)(numEntries + start) > MILUT_MAX_INDEX ) || - ( !start && MILUT_START_INDEX(MILUT_HEADER(pLUT)) )) - return(BadValue); - - return(MILUT_HEADER(pLUT)->ops[MILUT_REQUEST_OP(PEX_DeleteTableEntries)] - (pLUT, start, numEntries)); -} /* DeleteLUTEntries */ - - -/*++ - | - | Function Name: UpdateLUTRefs - | - | Function Description: - | A utility procedure for updating the cross-reference lists in the - | lookup table. The lookup table has two lists, one for renderers and - | one for workstations. These lists tell which resources are using the - | table. Deletes the resource if it's been freed and is not referenced. - | - | Note(s): - | - --*/ - -ddpex43rtn -UpdateLUTRefs(pLUT, pResource, which, action) -/* in */ - diLUTHandle pLUT; /* lut handle */ - diResourceHandle pResource;/* workstation or renderer handle */ - ddResourceType which; /* workstation or renderer */ - ddAction action; /* add or remove */ -/* out */ -{ - register miLUTHeader *pheader = (miLUTHeader *) pLUT->deviceData; - -#ifdef DDTEST - ErrorF( "\nUpdateLUTRefs %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - switch (which) - { - case WORKSTATION_RESOURCE: - if (action == ADD) - { - if (puAddToList((ddPointer) &pResource, (ddULONG) 1, pheader->wksRefList) == MI_ALLOCERR) - return (BadAlloc); - } else - puRemoveFromList((ddPointer) &pResource, pheader->wksRefList); - break; - - case RENDERER_RESOURCE: - if (action == ADD) - { - if (puAddToList((ddPointer) &pResource, (ddULONG) 1, pheader->rendRefList) == MI_ALLOCERR) - return (BadAlloc); - } else - puRemoveFromList((ddPointer) &pResource, pheader->rendRefList); - break; - - default: /* better not get here */ - return (BadValue); - break; - } - - MILUT_CHECK_DESTROY(pLUT, pheader); - return (Success); -} /* UpdateLUTRefs */ - -/*++ - | - | Function Name: MatchLUTDrawable - | - | Function Description: - | A utility procedure for comparing a drawable with the - drawable example of an LUT. Returns BadMatch if they - are not compatible. - | - | Note(s): - | - --*/ - -ddpex43rtn -MatchLUTDrawable(pLUT, pDrawable) - diLUTHandle pLUT; - DrawablePtr pDrawable; -{ - register miLUTHeader *pheader = (miLUTHeader *) pLUT->deviceData; - - if ( (pheader->drawExample.type == pDrawable->type) && - (pheader->drawExample.depth == pDrawable->depth) && - (pheader->drawExample.rootDepth == pDrawable->pScreen->rootDepth) && - (pheader->drawExample.rootVisual == pDrawable->pScreen->rootVisual) ) - return(Success); - else - return(BadMatch); -} - -static void -InitializePDEs() -{ -extern void LineBundleLUT_init_pde(); -extern void MarkerBundleLUT_init_pde(); -extern void TextBundleLUT_init_pde(); -extern void InteriorBundleLUT_init_pde(); -extern void EdgeBundleLUT_init_pde(); -extern void PatternLUT_init_pde(); -extern void TextFontLUT_init_pde(); -extern void ColourLUT_init_pde(); -extern void ViewLUT_init_pde(); -extern void LightLUT_init_pde(); -extern void DepthCueLUT_init_pde(); -extern void ColourApproxLUT_init_pde(); - - LineBundleLUT_init_pde(); - MarkerBundleLUT_init_pde(); - TextBundleLUT_init_pde(); - InteriorBundleLUT_init_pde(); - EdgeBundleLUT_init_pde(); - PatternLUT_init_pde(); - TextFontLUT_init_pde(); - ColourLUT_init_pde(); - ViewLUT_init_pde(); - LightLUT_init_pde(); - DepthCueLUT_init_pde(); - ColourApproxLUT_init_pde(); -} - -extern ddpex43rtn LineBundleLUT_inq_entry_address(), - MarkerBundleLUT_inq_entry_address(), - TextBundleLUT_inq_entry_address(), - InteriorBundleLUT_inq_entry_address(), - EdgeBundleLUT_inq_entry_address(), - PatternLUT_inq_entry_address(), - TextFontLUT_inq_entry_address(), - ColourLUT_inq_entry_address(), - ViewLUT_inq_entry_address(), - LightLUT_inq_entry_address(), - DepthCueLUT_inq_entry_address(), - ColourApproxLUT_inq_entry_address(); - -miOpsTableType inq_entry_address_LUTtable[] = { - LineBundleLUT_inq_entry_address, - MarkerBundleLUT_inq_entry_address, - TextBundleLUT_inq_entry_address, - InteriorBundleLUT_inq_entry_address, - EdgeBundleLUT_inq_entry_address, - PatternLUT_inq_entry_address, - TextFontLUT_inq_entry_address, - ColourLUT_inq_entry_address, - ViewLUT_inq_entry_address, - LightLUT_inq_entry_address, - DepthCueLUT_inq_entry_address, - ColourApproxLUT_inq_entry_address, -}; - -ddpex43rtn -InquireLUTEntryAddress(LUTtype, pLUT, index, pStatus, ppEntry) -/* in */ - ddUSHORT LUTtype; /* lookup table type */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex index; /* index of entry to get */ -/* out */ - ddUSHORT *pStatus; /* entry status */ - ddPointer *ppEntry; /* table entry */ -{ -#ifdef DDTEST - ErrorF( "\nInquireLUTEntryAddress %d type \n", LUTtype); -#endif - - return(inq_entry_address_LUTtable[LUTtype-1] - (LUTtype, pLUT, index, pStatus, ppEntry)); -} /* InquireLUTEntryAddress */ - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUTProcs.ci diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUTProcs.ci:1.2 xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUTProcs.ci:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUTProcs.ci:1.2 Fri Dec 14 14:57:38 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miLUTProcs.ci Sat Feb 28 21:41:55 2004 @@ -1,662 +0,0 @@ -/* $Xorg: miLUTProcs.ci,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution - of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#ifndef MILUT_PROCS_CI -#define MILUT_PROCS_CI - -#include "pexUtils.h" - -/* this file is a template for defining the lut procedures */ -/* it uses a bunch of macros (blah) but allows easier porting */ -/* the following macros must be defined in the file which includes - * this one before this file is included: - * LUT_TYPE the table type - * LUT_TABLE_START pointer to the first entry in the table - * LUT_PDE_ENTRIES the beginning of the predefined entries table - * LUT_SET_PDE_ENTRY macro which sets an entry to a predefined - * value - * LUT_SET_DEFAULT_VALUES macro which sets an entry to the default - * values - * data structure names: - * DD_LUT_ENTRY_STR devPriv data structure def - * MI_LUT_ENTRY_STR table entry data structure def - * PEX_LUT_ENTRY_STR pex data structure def - * renderer dynamics changes bit: - * LUT_REND_DYN_BIT - * table info: - * LUT_START_INDEX - * LUT_DEFAULT_INDEX - * table info dependent on drawable type (SI only supports one type): - * LUT_0_DEFINABLE_ENTRIES - * LUT_0_NUM_PREDEFINED - * LUT_0_PREDEFINED_MIN - * LUT_0_PREDEFINED_MAX - * - * procedure definition flags: - * define the ones whose definitions you want to use from this file - * procedure definition names: - * define the names of the procedures to use for the lut - */ - -extern ddpex4rtn miDealWithDynamics(); /* in level4/miDynamics.c */ - -/* get pointer to first legal entry in the table */ -#define FIRST_ENTRY( pheader ) \ - LUT_TABLE_START(pheader) - -#define SET_TABLE_INFO( drawType, pInfo ) \ - switch(drawType) { \ - case MI_DRAWABLE0: \ - (pInfo)->definableEntries = \ - LUT_0_DEFINABLE_ENTRIES; \ - (pInfo)->numPredefined = \ - LUT_0_NUM_PREDEFINED; \ - (pInfo)->predefinedMin = \ - LUT_0_PREDEFINED_MIN; \ - (pInfo)->predefinedMax = \ - LUT_0_PREDEFINED_MAX; \ - break; } - -/* the following procedure definitions are useful for all SI lut types */ -/* replace them in the mi*LUT.c files if these are not appropriate */ - -/* don't use special procs for these - use the general ones called - * directly by diPEX */ - -#ifdef LUT_USE_FREE -extern ddpex43rtn FreeLUT(); -#define LUT_FREE FreeLUT -#endif /* LUT_USE_FREE */ - -#ifdef LUT_USE_INQ_PREDEF -extern ddpex43rtn InquireLUTPredEntries(); -#define LUT_INQ_PREDEF InquireLUTPredEntries -#endif /* LUT_USE_INQ_PREDEF */ - -#ifdef LUT_USE_INQ_ENTRIES -extern ddpex43rtn InquireLUTEntries(); -#define LUT_INQ_ENTRIES InquireLUTEntries -#endif /* LUT_USE_INQ_ENTRIES */ - -/* - The default entry: uninitialized, non-static, this scratch - structure is kept around so that we can fill it with default - data and return its address from routines like those made - from LUT_INQ_ENTRY_ADDRESS - */ -static MI_LUT_ENTRY_STR def_entry; - - - -#ifdef LUT_USE_COPY -ddpex43rtn -LUT_COPY (pSrcLUT, pDestLUT) -/* in */ - diLUTHandle pSrcLUT; /* source lookup table */ - diLUTHandle pDestLUT; /* destination lookup table */ -/* out */ -{ - MILUT_DEFINE_HEADER(pSrcLUT, srcHeader); - MILUT_DEFINE_HEADER(pDestLUT, destHeader); - MI_LUT_ENTRY_STR *pentry; - ddpex43rtn err; - register int i; - -#ifdef DDTEST - ErrorF( "\ncopy src lut %d type %d\n", pSrcLUT->id, pSrcLUT->lutType); - ErrorF( "\ncopy dest lut %d type %d\n", pDestLUT->id, pDestLUT->lutType); -#endif - - /* set all entries to undefined */ - pentry = LUT_TABLE_START(destHeader); - MILUT_SET_STATUS(pentry, MILUT_ALLOC_ENTS(destHeader), MILUT_UNDEFINED, MI_FALSE); - - /* copy entries */ - mibcopy(LUT_TABLE_START(srcHeader), LUT_TABLE_START(destHeader), - sizeof(MI_LUT_ENTRY_STR) * MILUT_ALLOC_ENTS(srcHeader)); - - MILUT_NUM_ENTS(destHeader) = MILUT_NUM_ENTS(srcHeader); - - err = destHeader->ops[MILUT_REQUEST_OP(milut_mod_call_back)](pDestLUT, - MILUT_START_INDEX(destHeader), MILUT_DEF_ENTS(destHeader), MILUT_COPY_MOD); - /* check err here if your call back proc can return an error */ - - return (err); -} -#endif /* LUT_USE_COPY */ - -#ifdef LUT_USE_INQ_INFO -ddpex43rtn -LUT_INQ_INFO (pDrawable, pLUTinfo) -/* in */ - DrawablePtr pDrawable;/* pointer to example drawable */ -/* out */ - ddTableInfo *pLUTinfo; /* table information */ -{ - ddSHORT drawtype; - -#ifdef DDTEST - ErrorF( "\ninquire info, table type %d \n", LUT_TYPE ); -#endif - - MI_WHICHDRAW(pDrawable, drawtype); - SET_TABLE_INFO( drawtype, pLUTinfo ); - - return (Success); -} -#endif /* LUT_USE_INQ_INFO */ - -#ifdef LUT_USE_INQ_IND -ddpex43rtn -LUT_INQ_IND (pLUT, pNumIndices, pBuffer) -/* in */ - diLUTHandle pLUT; /* lut handle */ -/* out */ - ddULONG *pNumIndices; /* number of indices in list */ - ddBufferPtr pBuffer; /* list of table indices */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - register ddUSHORT macks; /* number of definable entries */ - register ddTableIndex *pb; - MI_LUT_ENTRY_STR *pentry; - -#ifdef DDTEST - ErrorF( "\n inquire indices lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - PU_CHECK_BUFFER_SIZE(pBuffer,MILUT_NUM_ENTS(pheader) * sizeof(ddTableIndex)); - *pNumIndices = MILUT_NUM_ENTS(pheader); - pBuffer->dataSize = *pNumIndices * sizeof(ddTableIndex); - pb = (ddTableIndex *)(pBuffer->pBuf); - - pentry = FIRST_ENTRY(pheader); - - for ( macks = MILUT_DEF_ENTS(pheader); - macks > 0; macks--, pentry++ ) - if (pentry->entry_info.status != MILUT_UNDEFINED) - *pb++ = pentry->entry_info.index; - - return (Success); -} -#endif /* LUT_USE_INQ_IND */ - -#ifdef LUT_USE_INQ_ENTRY -ddpex43rtn -LUT_INQ_ENTRY (pLUT, index, valueType, pStatus, pBuffer) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex index; /* index of entry to get */ - ddUSHORT valueType; /* SET or REALIZED */ -/* out */ - ddUSHORT *pStatus; /* entry status */ - ddBufferPtr pBuffer; /* table entry */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - MI_LUT_ENTRY_STR *pentry, *plast; - ddPointer pb; - -#ifdef DDTEST - ErrorF( "\ninquire entry lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - PU_CHECK_BUFFER_SIZE(pBuffer, sizeof(PEX_LUT_ENTRY_STR)); - - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - - MILUT_GET_ENTRY(index, pentry, plast); - - if ((pentry == NULL) || (pentry->entry_info.status == MILUT_UNDEFINED)) - { - *pStatus = PEXDefaultEntry; - pentry = FIRST_ENTRY(pheader); - MILUT_GET_ENTRY(MILUT_DEFAULT_INDEX(pheader), pentry, plast); - if (pentry == NULL) - { - /* default entry doesn't exist - get the default values */ - LUT_SET_DEFAULT_VALUES(&def_entry); - pentry = &def_entry; - } - else if (pentry->entry_info.status == MILUT_UNDEFINED) - { - /* default entry is undefined - get default values */ - LUT_SET_DEFAULT_VALUES(&def_entry); - pentry = &def_entry; - } - } else - *pStatus = PEXDefinedEntry; - - pb = pBuffer->pBuf; - - pheader->ops[MILUT_REQUEST_OP(milut_copy_mi_to_pex)](pheader, valueType, pentry, &pb); - - pBuffer->dataSize = pb - pBuffer->pBuf; - - return (Success); -} -#endif /* LUT_USE_INQ_ENTRY */ - -#ifdef LUT_USE_SET_ENTRIES -ddpex43rtn -LUT_SET_ENTRIES (pLUT, start, numEntries, pEntries) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex start; /* index of first entry to set */ - ddUSHORT numEntries; /* number of entries to set */ - ddPointer pEntries; /* list of entries */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - MI_LUT_ENTRY_STR *pentry, *plast, *psave; - PEX_LUT_ENTRY_STR *psrc; - register int i; - int freecount1 = 0, freecount2; - ddpex43rtn err; - ddPointer ps; - -#ifdef DDTEST - ErrorF( "\nset entries lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - psrc = (PEX_LUT_ENTRY_STR *) pEntries; - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - - /* check for a place to put the entries and check them for errors */ - /* this is set up to work for tables with contiguous index - * values most efficiently. it will work for sparse tables, too - */ - for (i = start; i < (start + numEntries); i++) - { - /* starting at current pentry, see if entry 'i' is after it */ - psave = pentry; - MILUT_GET_ENTRY(i, pentry, plast); - - if (!pentry) - { - /* make sure the entry wasn't before pentry - * by starting at the beginning and looking until where - * pentry was (psave) - */ - pentry = FIRST_ENTRY(pheader); - MILUT_GET_ENTRY(i, pentry, psave); - if (!pentry) - { - /* no entry defined with this index - * put one in by looking for the first - * undefined entry. this has no intelligence - * about it - */ - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - freecount2 = freecount1; - while ((pentry < plast) && - ((pentry->entry_info.status != MILUT_UNDEFINED) || freecount2)) - { - if (pentry->entry_info.status == MILUT_UNDEFINED) - freecount2--; - pentry++; - } - if (pentry == plast) - /* couldn't find a place for it */ - return(BadAlloc); - else - /* keep count of free places found so far */ - freecount1++; - } - } - /* check the entry and increment the source pointer */ - if ((err = pheader->ops[MILUT_REQUEST_OP(milut_entry_check)](pheader, &psrc)) != Success) - return(err); - } - - psrc = (PEX_LUT_ENTRY_STR *) pEntries; - for (i = start; i < (start + numEntries); i++) - { - /* starting at current pentry, see if entry 'i' is after it */ - psave = pentry; - MILUT_GET_ENTRY(i, pentry, plast); - - if (!pentry) - { - /* make sure the entry wasn't before pentry - * by starting at the beginning and looking until where - * pentry was (psave) - */ - pentry = FIRST_ENTRY(pheader); - MILUT_GET_ENTRY(i, pentry, psave); - if (!pentry) - { - /* no entry defined with this index - * put one in by looking for the first - * undefined entry. this has no intelligence - * about it - */ - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - while ((pentry < plast) && - (pentry->entry_info.status != MILUT_UNDEFINED)) - pentry++; - if (pentry == plast) - /* this shouldn't happen since it was - * checked above, but just in case.. - * this is where one of those ASSURE - * tests can be useful - */ - return(BadAlloc); - } - } - - if (pentry->entry_info.status == MILUT_UNDEFINED) - MILUT_NUM_ENTS(pheader)++; - pentry->entry_info.status = MILUT_DEFINED; - pentry->entry_info.index = i; - - ps = (ddPointer)psrc; - pheader->ops[MILUT_REQUEST_OP(milut_copy_pex_to_mi)](pheader, &ps, pentry); - - psrc = (PEX_LUT_ENTRY_STR *)ps; - } - - err = pheader->ops[MILUT_REQUEST_OP(milut_mod_call_back)](pLUT, - start, numEntries, MILUT_SET_MOD); - - /* check err here if your call back proc can return an error */ - - return (err); -} -#endif /* LUT_USE_SET_ENTRIES */ - -#ifdef LUT_USE_DEL_ENTRIES -ddpex43rtn -LUT_DEL_ENTRIES (pLUT, start, numEntries) -/* in */ - diLUTHandle pLUT; /* lut handle */ - ddUSHORT start; /* index of first entry to delete */ - ddUSHORT numEntries; /* number of entries in range */ -/* out */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - MI_LUT_ENTRY_STR *pentry, *plast, *psave; - ddpex43rtn err; - -#ifdef DDTEST - ErrorF( "\ndelete entries lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - - /* invoke the call back before deleting the entries and changing - start and numEntries - */ - err = pheader->ops[MILUT_REQUEST_OP(milut_mod_call_back)](pLUT, - start, numEntries, MILUT_DEL_MOD); - - /* loop through and set each entry to undefined - * this works most efficiently if the entries are stored - * in the lut contiguously since MILUT_GET_ENTRY starts - * where pentry points then searches forward colour_approxarly - */ - for (; numEntries > 0; start++, numEntries--) - { - psave = pentry; - MILUT_GET_ENTRY(start, pentry, plast); - - if (!pentry) - { - /* make sure the entry wasn't before pentry */ - pentry = FIRST_ENTRY(pheader); - MILUT_GET_ENTRY(start, pentry, psave); - } - - if (pentry) - { - if (pentry->entry_info.status != MILUT_UNDEFINED) - { - MILUT_NUM_ENTS(pheader)--; - pentry->entry_info.status = MILUT_UNDEFINED; - } - } - else - pentry = psave; - } - - /* check err here if your call back proc can return an error */ - - return (err); -} -#endif /* LUT_USE_DEL_ENTRIES */ - -#ifdef LUT_USE_INQ_ENTRY_ADDRESS -ddpex43rtn -LUT_INQ_ENTRY_ADDRESS (LUTtype, pLUT, index, pStatus, ppEntry) -/* in */ - ddUSHORT LUTtype; /* lookup table type use this if pLUT is NULL */ - diLUTHandle pLUT; /* lut handle */ - ddTableIndex index; /* index of entry to get */ -/* out */ - ddUSHORT *pStatus; /* entry status */ - ddPointer *ppEntry; /* table entry */ -{ - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pentry, *plast; - -#ifdef DDTEST - ErrorF( "\ninquire entry address lut type %d\n", LUTtype); -#endif - - pentry = NULL; - - if (!pLUT) - { - /* get the default values */ - LUT_SET_DEFAULT_VALUES(&def_entry); - *ppEntry = (ddPointer)&def_entry; - return (Success); - } - - pheader = MILUT_HEADER(pLUT); - pentry = FIRST_ENTRY(pheader); - plast = pentry + MILUT_DEF_ENTS(pheader); - - MILUT_GET_ENTRY(index, pentry, plast); - if ((pentry == NULL) || (pentry->entry_info.status == MILUT_UNDEFINED)) - { - /* get the default entry */ - *pStatus = PEXDefaultEntry; - pentry = FIRST_ENTRY(pheader); - MILUT_GET_ENTRY(MILUT_DEFAULT_INDEX(pheader), pentry, plast); - if (pentry == NULL) - { - /* default entry doesn't exist - get the default values */ - LUT_SET_DEFAULT_VALUES(&def_entry); - *ppEntry = (ddPointer)&def_entry; - } - else if (pentry->entry_info.status == MILUT_UNDEFINED) - { - /* default entry is undefined - get default values */ - LUT_SET_DEFAULT_VALUES(&def_entry); - *ppEntry = (ddPointer)&def_entry; - } - else /* the default entry is good */ - *ppEntry = (ddPointer)pentry; - } else /* the entry was found and is defined */ - { - *pStatus = PEXDefinedEntry; - *ppEntry = (ddPointer)pentry; - } - - return (Success); -} -#endif /* LUT_USE_INQ_ENTRY_ADDRESS */ - -#ifdef LUT_USE_MOD_CALL_BACK -ddpex43rtn -LUT_MOD_CALL_BACK(pLUT, start, numEntries, mod) - diLUTHandle pLUT; - ddTableIndex start; /* index of first entry to set */ - ddUSHORT numEntries; /* number of entries to set */ - ddUSHORT mod; /* modification: copy, set, delete */ -{ - MILUT_DEFINE_HEADER(pLUT, pheader); - register int i; - ddRendererPtr *pprend; - diWKSHandle *phandle; - miWksPtr pwks; - ddpex43rtn err; - - /* set change flags in renderer so ValidateRenderer will - * know to update the ddContext with changes - * add to here and calls to hardware, etc. to realize - * modifications - */ - pprend = (ddRendererPtr *)pheader->rendRefList->pList; - for (i=0; irendRefList->numObj; i++, pprend++) - (*pprend)->tablesChanges |= LUT_REND_DYN_BIT; - - /* for view luts: this wks list only identifies the wks for - * which this is the current view. The wks is not included - * in the list of the requested view lut - */ - if (pheader->wksRefList->numObj) - { - phandle = (diWKSHandle *)pheader->wksRefList->pList; - for (i=0; iwksRefList->numObj; i++, phandle++) - { - pwks = (miWksPtr)((*phandle)->deviceData); - pwks->pRend->tablesChanges |= LUT_REND_DYN_BIT; - } - } - - err = Success; - -#ifdef DYNAMIC - if (pheader->wksRefList->numObj) - err = miDealWithDynamics( DYNAMIC, pheader->wksRefList ); -#endif /* DYNAMIC */ - - return( err ); -} -#endif /* LUT_USE_MOD_CALL_BACK */ - - -#ifdef LUT_USE_CREATE -ddpex43rtn -LUT_CREATE (pLUT, pheader) -/* in */ - diLUTHandle pLUT; /* lut handle */ - miLUTHeader *pheader; /* lut header */ -/* out */ -{ - register int i; - MI_LUT_ENTRY_STR *pentry; - DD_LUT_ENTRY_STR *pdeentry; - -#ifdef DDTEST - ErrorF( "\ncreate lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - - MILUT_START_INDEX(pheader) = LUT_START_INDEX; - MILUT_DEFAULT_INDEX(pheader) = LUT_DEFAULT_INDEX; - MILUT_NUM_ENTS(pheader) = 0; - SET_TABLE_INFO( pheader->drawType, &(pheader->tableInfo) ); - - if (MILUT_ALLOC_ENTS(pheader) == 0) - { - LUT_TABLE_START(pheader) = NULL; - } - else if ( (LUT_TABLE_START(pheader) = (MI_LUT_ENTRY_STR *) - xalloc(MILUT_ALLOC_ENTS(pheader) * sizeof(MI_LUT_ENTRY_STR)) ) - == NULL) - { - MILUT_DESTROY_HEADER(pheader); - return(BadAlloc); - } - - pentry = LUT_TABLE_START(pheader); - MILUT_SET_STATUS(pentry, MILUT_ALLOC_ENTS(pheader), MILUT_UNDEFINED, MI_TRUE); - - /* if there are predefined entries, put them in */ - if (MILUT_PRENUM(pheader)) - { - pentry = LUT_TABLE_START(pheader) + MILUT_PREMIN(pheader); - pdeentry = &(LUT_PDE_ENTRIES); - - for (i=MILUT_PREMIN(pheader); - i<=MILUT_PREMAX(pheader); i++, pentry++, pdeentry++) - { - pentry->entry_info.status = MILUT_PREDEFINED; - pentry->entry_info.index = i; - LUT_SET_PDE_ENTRY(pentry, pdeentry); - pheader->numDefined++; - } - } - - pheader->ops[MILUT_REQUEST_OP(PEX_CreateLookupTable)] = LUT_CREATE; - pheader->ops[MILUT_REQUEST_OP(PEX_CopyLookupTable)] = LUT_COPY; - pheader->ops[MILUT_REQUEST_OP(PEX_FreeLookupTable)] = LUT_FREE; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableInfo)] = LUT_INQ_INFO; - pheader->ops[MILUT_REQUEST_OP(PEX_GetPredefinedEntries)] = LUT_INQ_PREDEF; - pheader->ops[MILUT_REQUEST_OP(PEX_GetDefinedIndices)] = LUT_INQ_IND; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableEntry)] = LUT_INQ_ENTRY; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableEntries)] = LUT_INQ_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(PEX_SetTableEntries)] = LUT_SET_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(PEX_DeleteTableEntries)] = LUT_DEL_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(milut_InquireEntryAddress)] = LUT_INQ_ENTRY_ADDRESS; - pheader->ops[MILUT_REQUEST_OP(milut_entry_check)] = LUT_ENTRY_CHECK; - pheader->ops[MILUT_REQUEST_OP(milut_copy_pex_to_mi)] = LUT_COPY_PEX_MI; - pheader->ops[MILUT_REQUEST_OP(milut_copy_mi_to_pex)] = LUT_COPY_MI_PEX; - pheader->ops[MILUT_REQUEST_OP(milut_mod_call_back)] = LUT_MOD_CALL_BACK; - - pLUT->deviceData = (ddPointer) pheader; - return (Success); -} -#endif /* LUT_USE_CREATE */ - -#endif /* MILUT_PROCS_CI */ Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c Sat Feb 28 21:41:55 2004 @@ -1,253 +0,0 @@ -/* $Xorg: miLightLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLightLUT.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXLightLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddLightEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miLightEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexLightEntry - -#define LUT_REND_DYN_BIT PEXDynLightTableContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 16 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.light - -#define DYNAMIC LIGHT_TABLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeLightEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeLightEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - if ((pentry)->entry.lightType == PEXLightWcsSpot) \ - (pentry)->cosSpreadAngle = \ - cos((double)(pentry)->entry.spreadAngle); \ - else (pentry)->cosSpreadAngle = 0.0 - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeLightEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES - - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE LightLUT_free -#define LUT_INQ_PREDEF LightLUT_inq_predef -#define LUT_INQ_ENTRIES LightLUT_inq_entries -*/ -#define LUT_COPY LightLUT_copy -#define LUT_INQ_INFO LightLUT_inq_info -#define LUT_INQ_IND LightLUT_inq_ind -#define LUT_INQ_ENTRY LightLUT_inq_entry -#define LUT_SET_ENTRIES LightLUT_set_entries -#define LUT_DEL_ENTRIES LightLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS LightLUT_inq_entry_address -#define LUT_CREATE LightLUT_create -#define LUT_ENTRY_CHECK LightLUT_entry_check -#define LUT_COPY_PEX_MI LightLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX LightLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK LightLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->lightColour.colour, - pb, pdev_entry->lightColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->lightColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.lightColour.colour), - pentry->entry.lightColour.colourType); - - ps += colour_type_sizes[(int)pentry->entry.lightColour.colourType]; - if (pentry->entry.lightType == PEXLightWcsSpot) - pentry->cosSpreadAngle = cos((double)pentry->entry.spreadAngle); - else pentry->cosSpreadAngle = 0.0; - - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - extern miEnumType miLightTypeET[][SI_LIGHT_NUM]; - ddPointer pe = (ddPointer)*ppPexEntry; - - /* lightType: only use supported lights */ - if (((*ppPexEntry)->lightType < miLightTypeET[pheader->drawType][0].index) || - ((*ppPexEntry)->lightType > miLightTypeET[pheader->drawType][SI_LIGHT_NUM - 1].index)) - return(BadValue); - /* direction: any value OK. */ - /* point: any value OK. */ - /* concentration: any value OK. */ - /* spreadAngle: must be in range [0,pi] */ - if ((*ppPexEntry)->lightType == PEXLightWcsSpot) - if (((*ppPexEntry)->spreadAngle < 0.0) || - ((*ppPexEntry)->spreadAngle > MI_PI)) - return(BadValue); - /* attenuaton1: any value OK. */ - /* attenuaton2: any value OK. */ - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->lightColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + colour_type_sizes[(int)(*ppPexEntry)->lightColour.colourType]; - - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - -void -LightLUT_init_pde() -{ - pdeLightEntry[0].lightType = PEXLightAmbient; - pdeLightEntry[0].direction.x = 0.0; - pdeLightEntry[0].direction.y = 0.0; - pdeLightEntry[0].direction.z = 0.0; - pdeLightEntry[0].point.x = 0.0; - pdeLightEntry[0].point.y = 0.0; - pdeLightEntry[0].point.z = 0.0; - pdeLightEntry[0].concentration = 0.0; - pdeLightEntry[0].spreadAngle = 0.0; - pdeLightEntry[0].attenuation1 = 0.0; - pdeLightEntry[0].attenuation2 = 0.0; - pdeLightEntry[0].lightColour.colourType = PEXRgbFloatColour; - pdeLightEntry[0].lightColour.colour.rgbFloat.red = 1.0; - pdeLightEntry[0].lightColour.colour.rgbFloat.green = 1.0; - pdeLightEntry[0].lightColour.colour.rgbFloat.blue = 1.0; -} - -#include "miLUTProcs.ci" - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c Sat Feb 28 21:41:55 2004 @@ -1,284 +0,0 @@ -/* $Xorg: miLineLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miLineLUT.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXLineBundleLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddLineBundleEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miLineBundleEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexLineBundleEntry - -#define LUT_REND_DYN_BIT PEXDynLineBundleContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 20 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.line - -#define DYNAMIC LINE_BUNDLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeLineBundleEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeLineBundleEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->real_entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeLineBundleEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - (pentry)->real_entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE LineBundleLUT_free -#define LUT_INQ_PREDEF LineBundleLUT_inq_predef -#define LUT_INQ_ENTRIES LineBundleLUT_inq_entries -*/ -#define LUT_COPY LineBundleLUT_copy -#define LUT_INQ_INFO LineBundleLUT_inq_info -#define LUT_INQ_IND LineBundleLUT_inq_ind -#define LUT_INQ_ENTRY LineBundleLUT_inq_entry -#define LUT_SET_ENTRIES LineBundleLUT_set_entries -#define LUT_DEL_ENTRIES LineBundleLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS LineBundleLUT_inq_entry_address -#define LUT_CREATE LineBundleLUT_create -#define LUT_ENTRY_CHECK LineBundleLUT_entry_check -#define LUT_COPY_PEX_MI LineBundleLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX LineBundleLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK LineBundleLUT_mod_call_back -#define LUT_REALIZE_ENTRY LineBundleLUT_realize_entry - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - if (valueType == PEXRealizedValue) - pdev_entry = &pentry->real_entry; - else - pdev_entry = &pentry->entry; - - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->lineColour.colour, - pb, pdev_entry->lineColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->lineColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.lineColour.colour), - pentry->entry.lineColour.colourType); - - LUT_REALIZE_ENTRY( pheader, pentry ); - - ps += colour_type_sizes[(int)pentry->entry.lineColour.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - /* lineType: any value OK. use line type 1 if it's not supported */ - /* polylineInterp: any value OK. use method 1 if it's not supported */ - /* curveApprox: any value OK. use method 1 if it's not supported */ - /* lineWidth: any value is OK, the nearest supported value is used */ - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->lineColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->lineColour.colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - -/* realize entry */ -ddpex43rtn -LUT_REALIZE_ENTRY( pheader, pEntry ) - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pEntry; -{ - extern miEnumType miLineTypeET[][SI_LINE_NUM]; - extern miEnumType miPolylineInterpMethodET[][SI_LINE_INTERP_NUM]; - extern miEnumType miCurveApproxMethodET[][SI_CURVE_APPROX_NUM]; - - /* lineType: any value OK. use line type 1 if it's not supported */ - if ( (pEntry->entry.lineType < - miLineTypeET[pheader->drawType][0].index) || - (pEntry->entry.lineType > - miLineTypeET[pheader->drawType][SI_LINE_NUM - 1].index) ) - pEntry->real_entry.lineType = 1; - else - pEntry->real_entry.lineType = pEntry->entry.lineType; - - /* polylineInterp: any value OK. use method 1 if it's not supported */ - if ( (pEntry->entry.polylineInterp < - miPolylineInterpMethodET[pheader->drawType][0].index) || - (pEntry->entry.polylineInterp > - miPolylineInterpMethodET[pheader->drawType][SI_LINE_INTERP_NUM - 1].index) ) - pEntry->real_entry.polylineInterp = 1; - else - pEntry->real_entry.polylineInterp = pEntry->entry.polylineInterp; - - /* curveApprox: any value OK. use method 1 if it's not supported */ - if ( (pEntry->entry.curveApprox.approxMethod < - miCurveApproxMethodET[pheader->drawType][0].index) || - (pEntry->entry.curveApprox.approxMethod > - miCurveApproxMethodET[pheader->drawType][SI_CURVE_APPROX_NUM - 1].index) ) - pEntry->real_entry.curveApprox.approxMethod = 1; - else - pEntry->real_entry.curveApprox.approxMethod = pEntry->entry.curveApprox.approxMethod; - pEntry->real_entry.curveApprox.tolerance = - pEntry->entry.curveApprox.tolerance; - - /* lineWidth: any value is OK, it is multiplied by the nomimal - * line width and the nearest supported size is used - * The realized value is the scale for inquiry, not the size. - */ - pEntry->real_entry.lineWidth = pEntry->entry.lineWidth; - - /* colourType: its an error if an unsupported colour type was - * specified. For supported colour types, should mapped colour - * be returned?? - */ - pEntry->real_entry.lineColour = pEntry->entry.lineColour; - return(Success); -} - -void -LineBundleLUT_init_pde() -{ - pdeLineBundleEntry[0].lineType = PEXLineTypeSolid; - pdeLineBundleEntry[0].polylineInterp = PEXPolylineInterpNone; - pdeLineBundleEntry[0].curveApprox.approxMethod = 1; - pdeLineBundleEntry[0].curveApprox.tolerance = 1.0; - pdeLineBundleEntry[0].lineWidth = 1.0; - MILUT_INIT_COLOUR(pdeLineBundleEntry[0].lineColour); -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c Sat Feb 28 21:41:55 2004 @@ -1,262 +0,0 @@ -/* $Xorg: miMarkLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miMarkLUT.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXMarkerBundleLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddMarkerBundleEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miMarkerBundleEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexMarkerBundleEntry - -#define LUT_REND_DYN_BIT PEXDynMarkerBundleContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 20 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.marker - -#define DYNAMIC MARKER_BUNDLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeMarkerBundleEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeMarkerBundleEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->real_entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeMarkerBundleEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - (pentry)->real_entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE MarkerBundleLUT_free -#define LUT_INQ_PREDEF MarkerBundleLUT_inq_predef -#define LUT_INQ_ENTRIES MarkerBundleLUT_inq_entries -*/ -#define LUT_COPY MarkerBundleLUT_copy -#define LUT_INQ_INFO MarkerBundleLUT_inq_info -#define LUT_INQ_IND MarkerBundleLUT_inq_ind -#define LUT_INQ_ENTRY MarkerBundleLUT_inq_entry -#define LUT_SET_ENTRIES MarkerBundleLUT_set_entries -#define LUT_DEL_ENTRIES MarkerBundleLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS MarkerBundleLUT_inq_entry_address -#define LUT_CREATE MarkerBundleLUT_create -#define LUT_ENTRY_CHECK MarkerBundleLUT_entry_check -#define LUT_COPY_PEX_MI MarkerBundleLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX MarkerBundleLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK MarkerBundleLUT_mod_call_back -#define LUT_REALIZE_ENTRY MarkerBundleLUT_realize_entry - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - if (valueType == PEXRealizedValue) - pdev_entry = &pentry->real_entry; - else - pdev_entry = &pentry->entry; - - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->markerColour.colour, - pb, pdev_entry->markerColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->markerColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.markerColour.colour), - pentry->entry.markerColour.colourType); - - LUT_REALIZE_ENTRY( pheader, pentry ); - - ps += colour_type_sizes[(int)pentry->entry.markerColour.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - /* markerType: any value OK. use marker type 3 if it's not supported */ - /* markerScale: any value is OK, it is multiplied by the nominal - * marker size (see imp dep constants) and the supported size - * nearest to that is used - */ - - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->markerColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->markerColour.colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - -/* realize entry */ -ddpex43rtn -LUT_REALIZE_ENTRY( pheader, pEntry ) - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pEntry; -{ - extern miEnumType miMarkerTypeET[][SI_MARKER_NUM]; - - /* markerType: any value OK. use marker type 3 if it's not supported */ - if ( (pEntry->entry.markerType < - miMarkerTypeET[pheader->drawType][0].index) || - (pEntry->entry.markerType > - miMarkerTypeET[pheader->drawType][SI_MARKER_NUM - 1].index) ) - pEntry->real_entry.markerType = 3; - else - pEntry->real_entry.markerType = pEntry->entry.markerType; - - /* markerScale: any value is OK, it is multiplied by the nomimal - * marker size and the nearest supported size is used - * The realized value is the scale for inquiry, not the size - */ - pEntry->real_entry.markerScale = pEntry->entry.markerScale; - - /* colourType: its an error if an unsupported colour type was - * specified. For supported colour types, should mapped colour - * be returned?? - but don't know which colour approx - * values to use. could use default. - */ - pEntry->real_entry.markerColour = pEntry->entry.markerColour; - return(Success); -} - -void -MarkerBundleLUT_init_pde() -{ - pdeMarkerBundleEntry[0].markerType = PEXMarkerAsterisk; - pdeMarkerBundleEntry[0].markerScale = 1.0; - MILUT_INIT_COLOUR(pdeMarkerBundleEntry[0].markerColour); -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c Sat Feb 28 21:41:55 2004 @@ -1,874 +0,0 @@ -/* $Xorg: miMisc.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miMisc.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "mipex.h" -#include "miInfo.h" -#include "pexUtils.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* pex device dependent initialization */ -ddpex43rtn -ddpexInit() -{ - extern int predef_initialized; /* in miLUT.c */ - extern ddBOOL pcflag; /* in miRender.c */ - extern ddBOOL init_pick_flag; /* in miWks.c */ - - predef_initialized = 0; - pcflag = MI_FALSE; - init_pick_flag = MI_FALSE; - - return (Success); -} - -/* pex device dependent reset */ -/* - This function is called during server reset. - It should free any buffers and initialize any device-specific - data that must be done during server reset. - - The PEX-ME allocates no buffers and so this function does - not much. It is provided as an aid to porting. It is - called from the dipex routine PEXResetProc -*/ -void -ddpexReset() -{ - /* YOUR CODE HERE */ -} - -/* define the imp dep info and enum type info */ - -/* Theoretically, all of this info could depend on the drawable of the - * workstation, so put everything into arrays based on the drawable. - * There is an imp dep drawable type value defined in mi.h which is - * determined by the implementation based on the workstations drawable. - * The MI_MAXDRAWABLES is the number of imp dep defined drawable types - * used for PEX. In the SI, its value is 1. - */ - -/* also, these values are all hard coded for the SI (using #defines - * in miInfo.h). You may want to - * inquire into a library that you are porting to for these values. - * To do this, replace the code in the procedures below to retrieve - * the value from your library instead of from the table. - */ - -/* imp dep constants */ - -/* These values are in two arrays that can be accessed by - * the PEXID constant value. One array has the values which are - * type CARD32. The other is for FLOAT values. - * SI_NUM_INT_IMPS and SI_NUM_FLOAT_IMPS specify how many values - * there are of each - */ - -/* add one to number of ints because imps start at 1 */ -static ddULONG intImpDeps[MI_MAXDRAWABLES][SI_NUM_INT_IMPS + 1] = { - 0, /* dummy */ - SI_DITHERING_SUPPORTED, - SI_MAX_EDGE_WIDTH, - SI_MAX_LINE_WIDTH, - SI_MAX_MARKER_SIZE, - SI_MAX_MODEL_CLIP_PLANES, - SI_MAX_NAME_SET_NAMES, - SI_MAX_NON_AMBIENT_LIGHTS, - SI_MAX_NURB_ORDER, - SI_MAX_TRIM_CURVE_ORDER, - SI_MIN_EDGE_WIDTH, - SI_MIN_LINE_WIDTH, - SI_MIN_MARKER_SIZE, - SI_NOM_EDGE_WIDTH, - SI_NOM_LINE_WIDTH, - SI_NOM_MARKER_SIZE, - SI_SUPP_EDGE_WIDTHS, - SI_SUPP_LINE_WIDTHS, - SI_SUPP_MARKER_SIZES, - SI_BEST_COLOUR_APPROX_VALUES, - SI_TRANSPARENCY_SUPPORTED, - SI_DOUBLE_BUFFERING_SUPPORTED, - SI_MAX_HITS_EVENT_SUPPORTED -}; - -#define FLOAT_INDEX(n) (n) - (SI_NUM_INT_IMPS + 1) - -static ddFLOAT floatImpDeps[MI_MAXDRAWABLES][SI_NUM_FLOAT_IMPS] = { - SI_CHROM_RED_U, - SI_CHROM_RED_V, - SI_LUM_RED, - SI_CHROM_GREEN_U, - SI_CHROM_GREEN_V, - SI_LUM_GREEN, - SI_CHROM_BLUE_U, - SI_CHROM_BLUE_V, - SI_LUM_BLUE, - SI_CHROM_WHITE_U, - SI_CHROM_WHITE_V, - SI_LUM_WHITE -}; - -/*++ - | - | Function Name: InquireImpDepConstants - | - | Function Description: - | Handles the PEXGetImpDepConstants request. - | - | Note(s): - | - --*/ - -ddpex43rtn -InquireImpDepConstants(pDrawable, numNames, pNames, pBuffer) -/* in */ - DrawablePtr pDrawable;/* drawable */ - ddULONG numNames; /* number of names */ - ddUSHORT *pNames; /* list of names */ -/* out */ - ddBufferPtr pBuffer; /* list of constants */ - -{ - - register short i; - register ddULONG dsize; - - register union - { - ddULONG *C32; - ddFLOAT *F32; - } pbuf; - - register ddUSHORT *pname; - register int drawType; - - pBuffer->dataSize = 0; - - dsize = numNames * sizeof(ddULONG); - PU_CHECK_BUFFER_SIZE(pBuffer, dsize); - - pBuffer->dataSize = dsize; - MI_WHICHDRAW(pDrawable, drawType); - - /* process each inquiry request in the list */ - - for (i = 0, pname = pNames, pbuf.C32 = (ddULONG *) (pBuffer->pBuf); - i < numNames; i++, pname++, pbuf.C32++) - { - - /* - * use a switch here for each constant type if you don't hard code - * the values (e.g. you want to call into a library to get the - * values) - */ - if ((int) *pname < SI_NUM_INT_IMPS) - *pbuf.C32 = intImpDeps[drawType][(int) *pname]; - else - *pbuf.F32 = floatImpDeps[drawType][(int)FLOAT_INDEX(*pname)]; - - } /* for (i=0, pname = pNames... */ - - return (Success); - -} /* InquireImpDepConstants */ - -/* now enumerated type info */ - -/* again, these can theoretically vary depending on the drawable type - * and arrays bases on the imp dep drawable type are used again - */ - -/* some of these are accessed in other code to make sure that only valid - * enum types are used, so they are not declared static - * the defined constants used with these are in miInfo.h - * TODO: make proceures to check for valid ets to call instead of - * declaring these global - */ - -miEnumType miMarkerTypeET[MI_MAXDRAWABLES][SI_MARKER_NUM] = { - {{1, SI_MARKER_1}, - {2, SI_MARKER_2}, - {3, SI_MARKER_3}, - {4, SI_MARKER_4}, - {5, SI_MARKER_5}} -}; - -miEnumType miATextStyleET[MI_MAXDRAWABLES][SI_ATEXT_NUM] = { - {{1, SI_ATEXT_1}, - {2, SI_ATEXT_2}} -}; - -miEnumType miInteriorStyleET[MI_MAXDRAWABLES][SI_INT_NUM] = { - {{1, SI_INT_1}, - {2, SI_INT_2}, - {5, SI_INT_5}} -}; - -/* hatches are not supported but put in a dummy */ -miEnumType miHatchStyleET[MI_MAXDRAWABLES][SI_HATCH_NUM + 1] = { - {{0, ""}} -}; - -miEnumType miLineTypeET[MI_MAXDRAWABLES][SI_LINE_NUM] = { - {{1, SI_LINE_1}, - {2, SI_LINE_2}, - {3, SI_LINE_3}, - {4, SI_LINE_4}} -}; - -miEnumType miSurfaceEdgeTypeET[MI_MAXDRAWABLES][SI_EDGE_NUM] = { - {{1, SI_EDGE_1}, - {2, SI_EDGE_2}, - {3, SI_EDGE_3}, - {4, SI_EDGE_4}} -}; - -miEnumType miPickDeviceTypeET[MI_MAXDRAWABLES][SI_PICK_DEVICE_NUM] = { - {{1, SI_PICK_DEVICE_1}, - {2, SI_PICK_DEVICE_2}} -}; - -miEnumType miPickOneMethodET[MI_MAXDRAWABLES][SI_PICK_ONE_NUM] = { - {{1, SI_PICK_ONE_LAST}} -}; - -miEnumType miPickAllMethodET[MI_MAXDRAWABLES][SI_PICK_ALL_NUM] = { - {{1, SI_PICK_ALL_ALL}} -}; - -miEnumType miPolylineInterpMethodET[MI_MAXDRAWABLES][SI_LINE_INTERP_NUM] = { - {{1, SI_LINE_INTERP_1}} -}; - -miEnumType miCurveApproxMethodET[MI_MAXDRAWABLES][SI_CURVE_APPROX_NUM] = { - {{1, SI_CURVE_APPROX_1}, - {2, SI_CURVE_APPROX_2}, - {3, SI_CURVE_APPROX_3}, - {4, SI_CURVE_APPROX_4}, - {6, SI_CURVE_APPROX_6}, - {7, SI_CURVE_APPROX_7}} -}; - -miEnumType miReflectionModelET[MI_MAXDRAWABLES][SI_REFLECT_NUM] = { - {{1, SI_REFLECT_1}, - {2, SI_REFLECT_2}, - {3, SI_REFLECT_3}, - {4, SI_REFLECT_4}} -}; - -miEnumType miSurfaceInterpMethodET[MI_MAXDRAWABLES][SI_SURF_INTERP_NUM] = { - {{1, SI_SURF_INTERP_1}} -}; - -miEnumType miSurfaceApproxMethodET[MI_MAXDRAWABLES][SI_SURF_APPROX_NUM] = { - {{1, SI_SURF_APPROX_1}, - {2, SI_SURF_APPROX_2}, - {3, SI_SURF_APPROX_3}, - {4, SI_SURF_APPROX_4}, - {6, SI_SURF_APPROX_6}, - {7, SI_SURF_APPROX_7}} -}; - -miEnumType miTrimCurveApproxMethodET[MI_MAXDRAWABLES][SI_TRIM_CURVE_NUM] = { - {{1, SI_TRIM_CURVE_1}, - {2, SI_TRIM_CURVE_2}} -}; - -miEnumType miModelClipOperatorET[MI_MAXDRAWABLES][SI_MODEL_CLIP_NUM] = { - {{1, SI_MODEL_CLIP_1}, - {2, SI_MODEL_CLIP_2}} -}; - -miEnumType miLightTypeET[MI_MAXDRAWABLES][SI_LIGHT_NUM] = { - {{1, SI_LIGHT_1}, - {2, SI_LIGHT_2}, - {3, SI_LIGHT_3}, - {4, SI_LIGHT_4}} -}; - -miEnumType miColourTypeET[MI_MAXDRAWABLES][SI_COLOUR_NUM] = { - {{0, SI_COLOUR_0}, - {1, SI_COLOUR_1}} -}; - -miEnumType miFloatFormatET[MI_MAXDRAWABLES][SI_FLOAT_NUM] = { - {{1, SI_FLOAT_1}, - {2, SI_FLOAT_2}} -}; - -miEnumType miHlhsrModeET[MI_MAXDRAWABLES][SI_HLHSR_NUM] = { - {{1, SI_HLHSR_1}} -}; - -miEnumType miPromptEchoTypeET[MI_MAXDRAWABLES][SI_PET_NUM] = { - {{1, SI_PET_1}} -}; - -miEnumType miDisplayUpdateModeET[MI_MAXDRAWABLES][SI_UPDATE_NUM] = { - {{1, SI_UPDATE_1}, - {2, SI_UPDATE_2}, - {3, SI_UPDATE_3}, - {4, SI_UPDATE_4}, - {5, SI_UPDATE_5}} -}; - -miEnumType miColourApproxTypeET[MI_MAXDRAWABLES][SI_CLR_APPROX_TYPE_NUM] = { - {{1, SI_CLR_APPROX_TYPE_1}, - {2, SI_CLR_APPROX_TYPE_2}} -}; - -miEnumType miColourApproxModelET[MI_MAXDRAWABLES][SI_CLR_APPROX_MODEL_NUM] = { - {{1, SI_CLR_APPROX_MODEL_1}} -}; - -/* put in a dummy */ -miEnumType miGDPET[MI_MAXDRAWABLES][SI_GDP_NUM + 1] = { - {{0, ""}} -}; - -/* put in a dummy */ -miEnumType miGDP3ET[MI_MAXDRAWABLES][SI_GDP3_NUM + 1] = { - {{0, ""}} -}; - -/* put in a dummy */ -miEnumType miGSEET[MI_MAXDRAWABLES][SI_GSE_NUM + 1] = { - {{0, ""}} -}; - -miEnumType miEscapeET[MI_MAXDRAWABLES][SI_ESCAPE_NUM] = { - {{1, SI_ESCAPE_1}} -}; - -miEnumType miRenderingColourModelET[MI_MAXDRAWABLES][SI_REND_COLOUR_NUM] = { - {{1, SI_REND_COLOUR_1}} -}; - -miEnumType miParametricSurfaceCharsET[MI_MAXDRAWABLES][SI_P_SURF_CHAR_NUM] = { - {{1, SI_P_SURF_CHAR_1}, - {2, SI_P_SURF_CHAR_2}, - {3, SI_P_SURF_CHAR_3}} -}; - -/* useful macros for putting et info into buffer */ -#define PUT_BUF32(buf, value) \ - *(buf).C32++ = (value); - -#define PUT_BUF16(buf, value) \ - *(buf).C16++ = (value); - -#define PUT_BUF8(buf, value) \ - *(buf).C8++ = (value); - -#define PADDING(n) ( (n)&3 ? (4 - ((n)&3)) : 0) - -/* be sure k is defined before using this */ -/* size is the size of the string - * extra is 2 if the case is PEXETBoth, it's 0 for PEXETMnemonic - * this macro is not used for PEXETIndex - */ -#define PUT_STR(buf, string, size, extra) \ - { \ - PUT_BUF16(buf, size); \ - for (k=0; k < size; k++) \ - PUT_BUF8(buf, string[k]); \ - k = PADDING( size + 2 + extra ); \ - while (k) { \ - PUT_BUF8( buf, 0 ); \ - k--; \ - } } - -/* macro to count space needed for et info */ -#define COUNT_ET( num, pet ) \ - count+=4; /* space for returned num value */ \ - switch (itemMask) \ - { \ - case PEXETIndex: /* return index values only */ \ - count += (num << 1); \ - /* add pad if necessary */ \ - if (num & 1) \ - count+=2; \ - break; \ - \ - case PEXETMnemonic: /* return mnemonics only */ \ - for (j=0; jname); \ - /* then pads for string (and its length) */\ - count += PADDING(strlen((pet)->name) + 2);\ - } \ - break; \ - \ - case PEXETBoth: /* return index and mnemonic */ \ - for (j=0; jname); \ - /* then pads for string */ \ - count += PADDING( strlen((pet)->name) );\ - } \ - break; \ - \ - } /* switch (itemMask) */ - -/* macro to put hard coded et info into buffer */ -#define GET_ET( num, pet ) \ - /* always increment the list count and return the number of types */\ - (*pNumLists)++; \ - PUT_BUF32(pbuf, (num)); \ - /* now put in the index and/or mnemonic */ \ - switch (itemMask) \ - { \ - case PEXETIndex: /* return index values only */ \ - for (j=0; j<(num); j++, pet++) \ - PUT_BUF16(pbuf, (pet)->index); \ - /* add pad if necessary */ \ - if ((num) & 1) \ - PUT_BUF16(pbuf, 0); \ - break; \ - \ - case PEXETMnemonic: /* return mnemonics only */ \ - for (j=0; j<(num); j++, pet++) \ - { \ - size = strlen( (pet)->name ); \ - /* PUT_STR pads end of string */ \ - PUT_STR(pbuf, (pet)->name, size, 0); \ - } \ - break; \ - \ - case PEXETBoth: /* return index and mnemonic */ \ - for (j=0; j<(num); j++, pet++) \ - { \ - size = strlen( (pet)->name ); \ - PUT_BUF16(pbuf, (pet)->index); \ - /* PUT_STR pads end of string */ \ - PUT_STR(pbuf, (pet)->name, size, 2); \ - } \ - break; \ - \ - } /* switch (itemMask) */ - -#define DO_ET(num, pet) \ - if ( counting ) \ - { \ - COUNT_ET( num, pet ); \ - } \ - else \ - { \ - GET_ET( num, pet ) \ - } - -/*++ - | - | Function Name: InquireEnumTypeInfo - | - | Function Description: - | Handles the PEXGetEnumTypeInfo request. - | - | Note(s): - | - --*/ - -ddpex43rtn -InquireEnumTypeInfo(pDrawable, itemMask, numEnumTypes, pEnumTypeList, pNumLists, pBuffer) -/* in */ - DrawablePtr pDrawable; - ddBitmask itemMask; - ddULONG numEnumTypes; - ddUSHORT *pEnumTypeList; -/* out */ - ddULONG *pNumLists; - ddBufferPtr pBuffer; -{ - register union - { - ddULONG *C32; - ddUSHORT *C16; - ddBYTE *C8; - } pbuf; - - register int drawType; - register ddUSHORT *ptype; - register unsigned i, - j, - k; - ddUSHORT size; - short counting; - int count; - ddULONG num; - miEnumType *pet; - - MI_WHICHDRAW(pDrawable, drawType); - - *pNumLists = 0; - count = 0; - pBuffer->dataSize = 0; - - /* - * loop twice. the first time, count buffer size needed second time, - * fill the buffer - */ - for (counting = 1; counting >= 0; counting--) - { - - /* - * be sure to put this here in case the buffer is realloc'd after the - * first time throught - */ - pbuf.C32 = (ddULONG *) pBuffer->pBuf; - for (i = numEnumTypes, ptype = pEnumTypeList; i > 0; i--, ptype++) - { - /* process each enum request */ - - /* - * this is all hard coded (in miInfo.h) for the SI replace as - * needed if you don't want it hard coded - */ - switch (*ptype) - { - case PEXETMarkerType: - num = SI_MARKER_NUM; - pet = &miMarkerTypeET[drawType][0]; - DO_ET(num, pet); - break; - - case PEXETATextStyle: - num = SI_ATEXT_NUM; - pet = miATextStyleET[drawType]; - DO_ET(num, pet); - break; - - case PEXETInteriorStyle: - num = SI_INT_NUM; - pet = miInteriorStyleET[drawType]; - DO_ET(num, pet); - break; - - case PEXETHatchStyle: - num = SI_HATCH_NUM; - pet = miHatchStyleET[drawType]; - DO_ET(num, pet); - break; - - case PEXETLineType: - num = SI_LINE_NUM; - pet = miLineTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETSurfaceEdgeType: - num = SI_EDGE_NUM; - pet = miSurfaceEdgeTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETPickDeviceType: - num = SI_PICK_DEVICE_NUM; - pet = miPickDeviceTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETPolylineInterpMethod: - num = SI_LINE_INTERP_NUM; - pet = miPolylineInterpMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETCurveApproxMethod: - num = SI_CURVE_APPROX_NUM; - pet = miCurveApproxMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETReflectionModel: - num = SI_REFLECT_NUM; - pet = miReflectionModelET[drawType]; - DO_ET(num, pet); - break; - - case PEXETSurfaceInterpMethod: - num = SI_SURF_INTERP_NUM; - pet = miSurfaceInterpMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETSurfaceApproxMethod: - num = SI_SURF_APPROX_NUM; - pet = miSurfaceApproxMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETModelClipOperator: - num = SI_MODEL_CLIP_NUM; - pet = miModelClipOperatorET[drawType]; - DO_ET(num, pet); - break; - - case PEXETLightType: - num = SI_LIGHT_NUM; - pet = miLightTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETColourType: - num = SI_COLOUR_NUM; - pet = miColourTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETFloatFormat: - num = SI_FLOAT_NUM; - pet = miFloatFormatET[drawType]; - DO_ET(num, pet); - break; - - case PEXETHlhsrMode: - num = SI_HLHSR_NUM; - pet = miHlhsrModeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETPromptEchoType: - num = SI_PET_NUM; - pet = miPromptEchoTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETDisplayUpdateMode: - num = SI_UPDATE_NUM; - pet = miDisplayUpdateModeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETColourApproxType: - - /* - * The colour approximation type is based on the depth of the - * drawable - > 8 bits implies indexed otherwise colorspace - */ - num = SI_CLR_APPROX_TYPE_NUM; - pet = miColourApproxTypeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETColourApproxModel: - num = SI_CLR_APPROX_MODEL_NUM; - pet = miColourApproxModelET[drawType]; - DO_ET(num, pet); - break; - - case PEXETGDP: - num = SI_GDP_NUM; - pet = miGDPET[drawType]; - DO_ET(num, pet); - break; - - case PEXETGDP3: - num = SI_GDP3_NUM; - pet = miGDP3ET[drawType]; - DO_ET(num, pet); - break; - - case PEXETGSE: - num = SI_GSE_NUM; - pet = miGSEET[drawType]; - DO_ET(num, pet); - break; - - case PEXETTrimCurveApproxMethod: - num = SI_TRIM_CURVE_NUM; - pet = miTrimCurveApproxMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETRenderingColourModel: - num = SI_REND_COLOUR_NUM; - pet = miRenderingColourModelET[drawType]; - DO_ET(num, pet); - break; - - case PEXETParaSurfCharacteristics: - num = SI_P_SURF_CHAR_NUM; - pet = miParametricSurfaceCharsET[drawType]; - DO_ET(num, pet); - break; - - case PEXETEscape: - num = SI_ESCAPE_NUM; - pet = miEscapeET[drawType]; - DO_ET(num, pet); - break; - - case PEXETPickOneMethod: - num = SI_PICK_ONE_NUM; - pet = miPickOneMethodET[drawType]; - DO_ET(num, pet); - break; - - case PEXETPickAllMethod: - num = SI_PICK_ALL_NUM; - pet = miPickAllMethodET[drawType]; - DO_ET(num, pet); - break; - - } /* switch (*ptype) */ - - } /* for (i=0, ptype = pEnumTypeList) */ - - if (counting) - { - PU_CHECK_BUFFER_SIZE(pBuffer, count); - } - } /* for (counting >= 0) */ - - pBuffer->dataSize = count; - return (Success); -} /* InquireEnumTypeInfo */ - -/************************************************************************* - * macro for MatchRendererTargets. - */ - -/* 30 is arbitrary constant */ -#define ADD_TRIPLET(d,t,v) { int diff; \ - if ((pexBuffer->dataSize + sizeof(pexRendererTarget)) > \ - pexBuffer->bufSize){\ - diff = (unsigned long)p - (unsigned long)pexBuffer->pBuf; \ - puBuffRealloc(pexBuffer,pexBuffer->bufSize + \ - 30*sizeof(pexRendererTarget)); \ - p = (pexRendererTarget *)(((unsigned long)pexBuffer->pBuf) +diff);\ - } \ - p->depth = (d); \ - p->type = (t); \ - p->visualID = (v); \ - pexBuffer->dataSize += sizeof(pexRendererTarget); \ - p++; nTargets++; \ - if (nTargets >= maxTriplets) return (Success); \ - } -/*++ - | - | Function Name: MatchRendererTargets - | - | Function Description: - | Handles Match Renderer Taregets Request. - | Given a visualID, depth & drawable type, tell whether PEX will - | render into it. Real life: PEX does not do all drawables. - | - | Note(s): - | - --*/ - - -ddpex43rtn -MatchRendererTargets(pDraw, depth, drawType, visualID, maxTriplets, pexBuffer) - DrawablePtr pDraw; - int depth; - int drawType; - VisualID visualID; - int maxTriplets; - ddBuffer *pexBuffer; -{ - int i; - int nTargets = 0; - - register ScreenPtr pScreen; - int idepth, ivisual; - DepthPtr pDepth; - - pexRendererTarget *p = (pexRendererTarget *)pexBuffer->pBuf; - -/* - * Code originally lifted from CreateWindow (x11/server/dix/window.c) - */ - pScreen = pDraw->pScreen; - - for(idepth = 0; idepth < pScreen->numDepths; idepth++) { - - pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; - - /* - * if depth is wild carded, then we need to walk them all. - */ - if ((depth == pDepth->depth) || (depth == 0)) { - - for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) { - - /* if visual is a match or it's wildcarded then do it */ - if ((visualID == pDepth->vids[ivisual]) || (visualID == 0)) { - /* - * Here is the moment of truth, this is just going to say - * that everything is available for PEX rendering. It is possible - * that vendors will want to create a global table that hangs - * around. That way they can be qualified in ddpexInit(). - * If compiled with -DMULTIBUFFER it assumes that mutli buffers - * are fair game. - */ - if ((drawType == PEXWindow) || (drawType == PEXDontCare)) - ADD_TRIPLET(pDepth->depth, PEXWindow, pDepth->vids[ivisual] ); - if ((drawType == PEXPixmap) || (drawType == PEXDontCare)) - ADD_TRIPLET(pDepth->depth, PEXPixmap, pDepth->vids[ivisual] ); -#ifdef MULTIBUFFER - if ((drawType == PEXBuffer) || (drawType == PEXDontCare)) - ADD_TRIPLET(pDepth->depth, PEXBuffer, pDepth->vids[ivisual] ); -#endif - } - } - } - } - return (Success); -} Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c:1.10 xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c:1.10 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c Sat Feb 28 21:41:55 2004 @@ -1,450 +0,0 @@ -/* $Xorg: miNS.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miNS.c,v 1.10 2001/12/14 19:57:39 dawes Exp $ */ - -#include "mipex.h" -#include "miNS.h" -#include "miWks.h" -#include "PEXErr.h" -#include "pexUtils.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Name Set Procedures */ - -/* DELETE_DD_NS is used to delete just the dd part of a resource */ - -/* CHECK_DELETE is used to see if the resource has been freed and is - * no longer being used. If so, then the entire resource storage is - * freed, including the ddNSResource part - */ - -#define DELETE_DD_NS( phead ) \ - puDeleteList((phead)->wksRefList); \ - puDeleteList((phead)->rendRefList); \ - xfree(phead) - -#define CHECK_DELETE(pns,phead) \ - if ( (phead)->freeFlag && !((phead)->refCount) && \ - !((phead)->wksRefList->numObj) && !((phead)->rendRefList->numObj) ) \ - { \ - DELETE_DD_NS( phead ); \ - xfree(pns); \ - } -static ddpex4rtn dynerr; -extern ddpex4rtn miDealWithNSDynamics(); - -/*++ - | - | Function Name: CreateNameSet - | - | Function Description: - | Handles the PEXCreateNameSet request. - | - | Note(s): - | - --*/ - -ddpex43rtn -CreateNameSet(pNS) -/* in */ - diNSHandle pNS; /* name set handle */ -/* out */ -{ - miNSHeader *pheader; - -#ifdef DDTEST - ErrorF( "\nCreateNameSet \n"); -#endif - - pNS->deviceData = NULL; - - if ((pheader = (miNSHeader *) xalloc(sizeof(miNSHeader))) == NULL) - { - pNS->deviceData = NULL; - return (BadAlloc); - } - if (!(pheader->wksRefList = puCreateList(DD_WKS))) - { - xfree(pheader); - return (BadAlloc); - } - - if (!(pheader->rendRefList = puCreateList(DD_RENDERER))) - { - puDeleteList(pheader->wksRefList); - xfree(pheader); - return (BadAlloc); - } - - pheader->nameCount = 0; - pheader->refCount = 0; - pheader->freeFlag = MI_FALSE; - MINS_EMPTY_NAMESET(pheader->names); - - pNS->deviceData = (ddPointer) pheader; - return (Success); -} /* CreateNameSet */ - - -static void -mins_rend_changes(pNS, pheader) - diNSHandle pNS; - miNSHeader *pheader; -{ - register int i; - ddRendererPtr *pprend; - - pprend = (ddRendererPtr *)pheader->rendRefList->pList; - for (i=0; irendRefList->numObj; i++, pprend++) - { - if ((pNS == (*pprend)->ns[DD_HIGH_INCL_NS]) || - (pNS == (*pprend)->ns[DD_HIGH_EXCL_NS])) - (*pprend)->namesetsChanges |= PEXDynHighlightNamesetContents; - else - if ((pNS == (*pprend)->ns[DD_INVIS_INCL_NS]) || - (pNS == (*pprend)->ns[DD_INVIS_EXCL_NS])) - (*pprend)->namesetsChanges |= PEXDynInvisibilityNamesetContents; - } -} - -static void -mins_wks_changes(pNS, pheader) - diNSHandle pNS; - miNSHeader *pheader; -{ - register int i; - diWKSHandle *phandle; - miWksPtr pwks; - - if (pheader->wksRefList->numObj) - { - phandle = (diWKSHandle *)pheader->wksRefList->pList; - for (i=0; iwksRefList->numObj; i++, phandle++) - { - pwks = (miWksPtr)((*phandle)->deviceData); - if ((pNS == pwks->pRend->ns[DD_HIGH_INCL_NS]) || - (pNS == pwks->pRend->ns[DD_HIGH_EXCL_NS])) - pwks->pRend->namesetsChanges |= PEXDynHighlightNamesetContents; - else if ((pNS == pwks->pRend->ns[DD_INVIS_INCL_NS]) || - (pNS == pwks->pRend->ns[DD_INVIS_EXCL_NS])) - pwks->pRend->namesetsChanges |= PEXDynInvisibilityNamesetContents; - } - } -} - -/*++ - | - | Function Name: CopyNameSet - | - | Function Description: - | Handles the PEXCopyNameSet request. - | - | Note(s): - both name set handles assumed to be valid - | - --*/ - -ddpex43rtn -CopyNameSet(pSrcNS, pDestNS) -/* in */ - diNSHandle pSrcNS; /* pointer to source name set */ - diNSHandle pDestNS; /* pointer to destination name set */ -/* out */ -{ - miNSHeader *psource = (miNSHeader *) pSrcNS->deviceData; - miNSHeader *pdest = (miNSHeader *) pDestNS->deviceData; - -#ifdef DDTEST - ErrorF( "\nCopyNameSet \n"); -#endif - - MINS_COPY_NAMESET(psource->names, pdest->names); - pdest->nameCount = psource->nameCount; - - mins_wks_changes(pDestNS, pdest); - mins_rend_changes(pDestNS, pdest); - - dynerr = miDealWithNSDynamics(pDestNS); - return (Success); -} /* CopyNameSet */ - -/*++ - | - | Function Name: FreeNameSet - | - | Function Description: - | Deletes all of the storage used by the name set if there are no resources - | using it, otherwise it sets the free flag in the name set. This function - | is registered with the resource id and handle by diPEX with AddResource. - | - | Note(s): - | - --*/ - -ddpex43rtn -FreeNameSet(pNS, NSid) -/* in */ - diNSHandle pNS; /* name set handle */ - ddResourceId NSid; /* name set resource id */ -/* out */ -{ - miNSHeader *pheader = (miNSHeader *) pNS->deviceData; - -#ifdef DDTEST - ErrorF( "\nFreeNameSet \n"); -#endif - - pheader->freeFlag = MI_TRUE; - pNS->id = PEXAlreadyFreed; - CHECK_DELETE(pNS, pheader); - - return (Success); -} /* FreeNameSet */ - -/*++ - | - | Function Name: InquireNameSet - | - | Function Description: - | Handles the PEXGetNameSet request. - | - | Note(s): - | - --*/ - -ddpex43rtn -InquireNameSet(pNS, pNumNames, pBuffer) -/* in */ - diNSHandle pNS; /* name set handle */ -/* out */ - ddULONG *pNumNames;/* number of names in list */ - ddBufferPtr pBuffer; /* list of names */ -{ - register short i; - register ddULONG *pbuf; - miNSHeader *pheader = (miNSHeader *) pNS->deviceData; - ddULONG dsize; - -#ifdef DDTEST - ErrorF( "\nInquireNameSet \n"); -#endif - - *pNumNames = 0; - dsize = pheader->nameCount * sizeof(ddULONG); - - PU_CHECK_BUFFER_SIZE(pBuffer, dsize); - - *pNumNames = pheader->nameCount; - pBuffer->dataSize = dsize; - - if (!pheader->nameCount) - return(Success); - - pbuf = (ddULONG *)pBuffer->pBuf; - for (i = MINS_MIN_NAME; i <= MINS_MAX_NAME; i++) - if ( MINS_IS_NAME_IN_SET(i, pheader->names) ) - *pbuf++ = i; - - return (Success); -} /* InquireNameSet */ - -/*++ - | - | Function Name: ChangeNameSet - | - | Function Description: - | Handles the PEXChangeNameSet request. - | - | Note(s): - | - --*/ - -ddpex43rtn -ChangeNameSet(pNS, action, numNames, pNames) -/* in */ - diNSHandle pNS; /* name set handle */ - ddUSHORT action; /* (add/remove/replace) */ - ddUSHORT numNames; /* number of names in list */ - ddULONG *pNames; /* list of names */ -/* out */ -{ - miNSHeader *pheader = (miNSHeader *) pNS->deviceData; - ddULONG *pn; - -#ifdef DDTEST - ErrorF( "\nChangeNameSet \n"); -#endif - - switch (action) - { - case PEXNSReplace: - -#ifdef DDTEST - ErrorF( "\tREPLACE\n"); -#endif - pheader->nameCount = 0; - MINS_EMPTY_NAMESET(pheader->names); - /* continue to add */ - - case PEXNSAdd: - -#ifdef DDTEST - ErrorF( "\tADD\n"); -#endif - - /* ignores any values that are out of range */ - for (pn = pNames; numNames > 0; numNames--, pn++) - if ( MINS_VALID_NAME(*pn) && - !MINS_IS_NAME_IN_SET(*pn, pheader->names) ) - { - pheader->nameCount++; - MINS_ADD_TO_NAMESET(*pn, pheader->names); - } - break; - - case PEXNSRemove: - -#ifdef DDTEST - ErrorF( "\tREMOVE\n"); -#endif - - for (pn = pNames; numNames > 0; numNames--, pn++) - if ( MINS_VALID_NAME(*pn) && - MINS_IS_NAME_IN_SET(*pn, pheader->names) ) - { - pheader->nameCount--; - MINS_REMOVE_FROM_NAMESET(*pn, pheader->names); - } - break; - - default: - /* better not get here */ - return (BadValue); - break; - } - - mins_wks_changes(pNS, pheader); - mins_rend_changes(pNS, pheader); - - /* update the picture if necessary */ - dynerr = miDealWithNSDynamics(pNS); - return (Success); -} /* ChangeNameSet */ - -/*++ - | - | Function Name: UpdateNSRefs - | - | Function Description: - | Utility function to update a cross-reference list in the name set. Each - | name set has two lists, one for workstations and one for renderers. The - | lists are of handles of the resources which are using the name set. - | - | Note(s): - | - --*/ - -ddpex43rtn -UpdateNSRefs(pNS, pResource, which, action) -/* in */ - diNSHandle pNS; /* name set handle */ - diResourceHandle pResource;/* workstation or renderer handle */ - ddResourceType which; /* wks renderer or pick device */ - ddAction action; /* add or remove */ -/* out */ -{ - miNSHeader *pheader = (miNSHeader *) pNS->deviceData; - -#ifdef DDTEST - ErrorF( "\nUpdateNSRefs \n"); -#endif - - switch (which) - { - case WORKSTATION_RESOURCE: - if (action == ADD) - { - if (puAddToList((ddPointer) & pResource, (ddULONG) 1, - pheader->wksRefList) == MI_ALLOCERR) - return (BadAlloc); - } else - puRemoveFromList((ddPointer) & pResource, pheader->wksRefList); - break; - - case SEARCH_CONTEXT_RESOURCE: - case PICK_RESOURCE: - if (action == ADD) - pheader->refCount++; - else - if (pheader->refCount) - pheader->refCount--; - break; - - case RENDERER_RESOURCE: - - if (action == ADD) - { - if (puAddToList((ddPointer) & pResource, (ddULONG) 1, - pheader->rendRefList)) - return (BadAlloc); - } else - puRemoveFromList((ddPointer) & pResource, pheader->rendRefList); - - break; - - default: /* better not get here */ - return (BadValue); - break; - } - CHECK_DELETE(pNS, pheader); - return (Success); -} /* UpdateNSRefs */ - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c Sat Feb 28 21:41:55 2004 @@ -1,437 +0,0 @@ -/* $Xorg: miPattLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miPattLUT.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -/* pattern tables don't have to be implemented. define PEX_PATTERN_LUT - * here if they are - */ -/* PEX-SI officially doesn't implement pattern tables, but the - * API doesn't handle it correctly yet if they aren't implemented, - * so pretend that they are - */ -#define PEX_PATTERN_LUT - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXPatternLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddPatternEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miPatternEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexPatternEntry - -#define LUT_REND_DYN_BIT PEXDynPatternTableContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 0 -#define LUT_0_NUM_PREDEFINED 0 -#define LUT_0_PREDEFINED_MIN 0 -#define LUT_0_PREDEFINED_MAX 0 - -#define LUT_TABLE_START(pheader) (pheader)->plut.pattern - -#define DYNAMIC PATTERN_TABLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ - -#define PDE_NUMX 1 -#define PDE_NUMY 1 - -#if LUT_0_NUM_PREDEFINED -static DD_LUT_ENTRY_STR pdePatternEntry[LUT_0_NUM_PREDEFINED]; -static ddIndexedColour pdeColours[PDE_NUMX][PDE_NUMY] = {}; -#else /* use dummies so things compile */ -static DD_LUT_ENTRY_STR pdePatternEntry[1]; -static ddIndexedColour pdeColours[PDE_NUMX][PDE_NUMY] = {1}; -#endif /* LUT_0_NUM_PREDEFINED */ - -#define LUT_PDE_ENTRIES pdePatternEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->entry.colours.indexed = (ddIndexedColour *)xalloc( \ - (pentry)->entry.numx * (pentry)->entry.numy * sizeof(colour_type_sizes[(int)(pentry)->entry.colourType])); \ - mibcopy((pdeentry)->colours.indexed, (pentry)->entry.colours.indexed, \ - (pentry)->entry.numx * (pentry)->entry.numy * sizeof(colour_type_sizes[(int)(pentry)->entry.colourType])) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdePatternEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry.numx = 0; \ - (pentry)->entry.numy = 0 - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -/* if pattern tables are implemented, use these procedures in - * miLUTProcs.h; the other procs are defined below. - * if pattern tables aren't implemented, then the create proc - * returns an error and so there won't be a pattern table - * (dipex will get bad XID for other requests on the table) - */ -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -/* #define LUT_USE_COPY */ -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -/* #define LUT_USE_CREATE */ -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE PatternLUT_free -#define LUT_INQ_PREDEF PatternLUT_inq_predef -#define LUT_INQ_ENTRIES PatternLUT_inq_entries -*/ -#define LUT_COPY PatternLUT_copy -#define LUT_INQ_INFO PatternLUT_inq_info -#define LUT_INQ_IND PatternLUT_inq_ind -#define LUT_INQ_ENTRY PatternLUT_inq_entry -#define LUT_SET_ENTRIES PatternLUT_set_entries -#define LUT_DEL_ENTRIES PatternLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS PatternLUT_inq_entry_address -#define LUT_CREATE PatternLUT_create -#define LUT_ENTRY_CHECK PatternLUT_entry_check -#define LUT_COPY_PEX_MI PatternLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX PatternLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK PatternLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - mibcopy(pdev_entry->colours.indexed, pb, - pdev_entry->numx * pdev_entry->numy * colour_type_sizes[(int)pdev_entry->colourType]); - - pb += pdev_entry->numx * pdev_entry->numy * colour_type_sizes[(int)pdev_entry->colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - ddULONG xy1, xy2; - ddSHORT colourType; - - xy1 = pentry->entry.numx * pentry->entry.numy; - colourType = pentry->entry.colourType; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - xy2 = pentry->entry.numx * pentry->entry.numy; - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - if ((xy1 * colour_type_sizes[(int)colourType]) < - (xy2 * colour_type_sizes[(int)pentry->entry.colourType])) - { - pentry->entry.colours.indexed = (ddIndexedColour *)xrealloc( - pentry->entry.colours.indexed, - xy2 * colour_type_sizes[(int)pentry->entry.colourType]); - if (!pentry->entry.colours.indexed) - return(BadAlloc); - } - - mibcopy(ps, pentry->entry.colours.indexed, - xy2 * colour_type_sizes[(int)pentry->entry.colourType]); - - ps += xy2 * colour_type_sizes[(int)pentry->entry.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - ddULONG xy; - - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->colourType)) - return(PEXERR(PEXColourTypeError)); - - xy = (*ppPexEntry)->numx * (*ppPexEntry)->numy; - - pe += sizeof(PEX_LUT_ENTRY_STR) + - xy * colour_type_sizes[(int)(*ppPexEntry)->colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - - return(Success); -} - -void -PatternLUT_init_pde() -{ -#ifdef PEX_PATTERN_LUT -#if LUT_0_NUM_PREDEFINED - pdePatternEntry[0].colourType = PEXIndexedColour; - pdePatternEntry[0].numx = PDE_NUMX; - pdePatternEntry[0].numy = PDE_NUMY; - pdePatternEntry[0].colours.indexed = &pdeColours[0][0]; -#endif /* LUT_0_NUM_PREDEFINED */ -#endif /* PEX_PATTERN_LUT */ -} - -#include "miLUTProcs.ci" - -ddpex43rtn -LUT_COPY (pSrcLUT, pDestLUT) -/* in */ - diLUTHandle pSrcLUT; /* source lookup table */ - diLUTHandle pDestLUT; /* destination lookup table */ -/* out */ -{ - MILUT_DEFINE_HEADER(pSrcLUT, srcHeader); - MILUT_DEFINE_HEADER(pDestLUT, destHeader); - register int i; - MI_LUT_ENTRY_STR *pDestEntry; - MI_LUT_ENTRY_STR *pSrcEntry; - ddpex43rtn err; - ddIndexedColour *psaveColours; - ddULONG xy; - ddSHORT saveType; - -#ifdef DDTEST - ErrorF( "\ncopy src lut %d type %d\n", pSrcLUT->id, pSrcLUT->lutType); - ErrorF( "\ncopy dest lut %d type %d\n", pDestLUT->id, pDestLUT->lutType); -#endif - - /* set all entries to undefined */ - pDestEntry = LUT_TABLE_START(destHeader); - MILUT_SET_STATUS(pDestEntry, MILUT_ALLOC_ENTS(destHeader), MILUT_UNDEFINED, MI_FALSE); - - /* copy entries */ - pDestEntry = LUT_TABLE_START(destHeader); - pSrcEntry = LUT_TABLE_START(srcHeader); - - for (i = MILUT_START_INDEX(srcHeader); i < MILUT_ALLOC_ENTS(srcHeader); i++) - { - xy = pDestEntry->entry.numx * pDestEntry->entry.numy; - psaveColours = pDestEntry->entry.colours.indexed; - saveType = pDestEntry->entry.colourType; - - mibcopy(pSrcEntry, pDestEntry, sizeof(miPatternEntry)); - - /* copy colours */ - pDestEntry->entry.colours.indexed = psaveColours; - if ( (xy * colour_type_sizes[(int)saveType]) < - (pSrcEntry->entry.numx * pSrcEntry->entry.numy * - colour_type_sizes[(int)pSrcEntry->entry.colourType]) ) - { - pDestEntry->entry.colours.indexed = - (ddIndexedColour *)xrealloc(pDestEntry->entry.colours.indexed, - (pSrcEntry->entry.numx * pSrcEntry->entry.numy * - colour_type_sizes[(int)pSrcEntry->entry.colourType])); - if (!pDestEntry->entry.colours.indexed) - return(BadAlloc); - } - mibcopy( pSrcEntry->entry.colours.indexed, pDestEntry->entry.colours.indexed, - (pSrcEntry->entry.numx * pSrcEntry->entry.numy * - colour_type_sizes[(int)pSrcEntry->entry.colourType]) ); - pSrcEntry++; - pDestEntry++; - } - - MILUT_NUM_ENTS(destHeader) = MILUT_NUM_ENTS(srcHeader); - - err = Success; - -#ifdef DYNAMIC - if (destHeader->wksRefList->numObj) - err = miDealWithDynamics( DYNAMIC, destHeader->wksRefList ); -#endif /* DYNAMIC */ - - err = destHeader->ops[MILUT_REQUEST_OP(milut_mod_call_back)](pDestLUT, - MILUT_START_INDEX(destHeader), MILUT_DEF_ENTS(destHeader), - MILUT_COPY_MOD); - /* check err here if your call back proc can return an error */ - if (err != Success) return(err); - - return (err); -} - -ddpex43rtn -LUT_CREATE (pLUT, pheader) -/* in */ - diLUTHandle pLUT; /* lut handle */ - miLUTHeader *pheader; /* lut header */ -/* out */ -{ - register int i; - MI_LUT_ENTRY_STR *pentry; - DD_LUT_ENTRY_STR *pdeentry; - -#ifdef DDTEST - ErrorF( "\ncreate lut %d type %d\n", pLUT->id, pLUT->lutType); -#endif - -#ifndef PEX_PATTERN_LUT - return(PEXERR(PEXLookupTableError)); -#else - - MILUT_START_INDEX(pheader) = LUT_START_INDEX; - MILUT_DEFAULT_INDEX(pheader) = LUT_DEFAULT_INDEX; - MILUT_NUM_ENTS(pheader) = 0; - SET_TABLE_INFO( pheader->drawType, &(pheader->tableInfo) ); - - if (MILUT_ALLOC_ENTS(pheader) == 0) - { - LUT_TABLE_START(pheader) = NULL; - } - else if ((LUT_TABLE_START(pheader) = (MI_LUT_ENTRY_STR *) - xalloc(MILUT_ALLOC_ENTS(pheader) * sizeof(MI_LUT_ENTRY_STR))) - == NULL) - { - MILUT_DESTROY_HEADER(pheader); - return(BadAlloc); - } - - pentry = LUT_TABLE_START(pheader); - MILUT_SET_STATUS(pentry, MILUT_ALLOC_ENTS(pheader), MILUT_UNDEFINED, MI_TRUE); - - pentry = LUT_TABLE_START(pheader); - for (i=0; ientry.numx=0; pentry->entry.numy=0; - pentry->entry.colourType=0; - pentry->entry.colours.indexed = (ddIndexedColour *)NULL; - } - - /* if there are predefined entries, put them in */ - if (MILUT_PRENUM(pheader)) - { - pentry = LUT_TABLE_START(pheader) + MILUT_PREMIN(pheader); - pdeentry = &(LUT_PDE_ENTRIES); - - for (i=MILUT_PREMIN(pheader); - i<=MILUT_PREMAX(pheader); i++, pentry++, pdeentry++) - { - pentry->entry_info.status = MILUT_PREDEFINED; - pentry->entry_info.index = i; - pentry->entry = *pdeentry; - pentry->entry.colours.indexed = (ddIndexedColour *)xalloc( - pentry->entry.numx * pentry->entry.numy * sizeof(colour_type_sizes[(int)pentry->entry.colourType])); - mibcopy(pdeentry->colours.indexed, pentry->entry.colours.indexed, - pentry->entry.numx * pentry->entry.numy * sizeof(colour_type_sizes[(int)pentry->entry.colourType])); - pheader->numDefined++; - } - } - - pheader->ops[MILUT_REQUEST_OP(PEX_CreateLookupTable)] = LUT_CREATE; - pheader->ops[MILUT_REQUEST_OP(PEX_CopyLookupTable)] = LUT_COPY; - pheader->ops[MILUT_REQUEST_OP(PEX_FreeLookupTable)] = LUT_FREE; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableInfo)] = LUT_INQ_INFO; - pheader->ops[MILUT_REQUEST_OP(PEX_GetPredefinedEntries)] = LUT_INQ_PREDEF; - pheader->ops[MILUT_REQUEST_OP(PEX_GetDefinedIndices)] = LUT_INQ_IND; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableEntry)] = LUT_INQ_ENTRY; - pheader->ops[MILUT_REQUEST_OP(PEX_GetTableEntries)] = LUT_INQ_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(PEX_SetTableEntries)] = LUT_SET_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(PEX_DeleteTableEntries)] = LUT_DEL_ENTRIES; - pheader->ops[MILUT_REQUEST_OP(milut_InquireEntryAddress)] = LUT_INQ_ENTRY_ADDRESS; - pheader->ops[MILUT_REQUEST_OP(milut_entry_check)] = LUT_ENTRY_CHECK; - pheader->ops[MILUT_REQUEST_OP(milut_copy_pex_to_mi)] = LUT_COPY_PEX_MI; - pheader->ops[MILUT_REQUEST_OP(milut_copy_mi_to_pex)] = LUT_COPY_MI_PEX; - - pLUT->deviceData = (ddPointer) pheader; - return (Success); -#endif /* PEX_PATTERN_LUT */ -} - Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c:1.9 Fri Dec 14 14:57:39 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c Sat Feb 28 21:41:55 2004 @@ -1,261 +0,0 @@ -/* $Xorg: miTextLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miTextLUT.c,v 1.9 2001/12/14 19:57:39 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXTextBundleLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddTextBundleEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miTextBundleEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexTextBundleEntry - -#define LUT_REND_DYN_BIT PEXDynTextBundleContents - -#define LUT_START_INDEX 1 -#define LUT_DEFAULT_INDEX 1 -#define LUT_0_DEFINABLE_ENTRIES 20 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 1 -#define LUT_0_PREDEFINED_MAX 1 - -#define LUT_TABLE_START(pheader) (pheader)->plut.text - -#define DYNAMIC TEXT_BUNDLE_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeTextBundleEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeTextBundleEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - (pentry)->real_entry = *(pdeentry) - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeTextBundleEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - (pentry)->real_entry = LUT_DEFAULT_VALUES - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE TextBundleLUT_free -#define LUT_INQ_PREDEF TextBundleLUT_inq_predef -#define LUT_INQ_ENTRIES TextBundleLUT_inq_entries -*/ -#define LUT_COPY TextBundleLUT_copy -#define LUT_INQ_INFO TextBundleLUT_inq_info -#define LUT_INQ_IND TextBundleLUT_inq_ind -#define LUT_INQ_ENTRY TextBundleLUT_inq_entry -#define LUT_SET_ENTRIES TextBundleLUT_set_entries -#define LUT_DEL_ENTRIES TextBundleLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS TextBundleLUT_inq_entry_address -#define LUT_CREATE TextBundleLUT_create -#define LUT_ENTRY_CHECK TextBundleLUT_entry_check -#define LUT_COPY_PEX_MI TextBundleLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX TextBundleLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK TextBundleLUT_mod_call_back -#define LUT_REALIZE_ENTRY TextBundleLUT_realize_entry - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - if (valueType == PEXRealizedValue) - pdev_entry = &pentry->real_entry; - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(&pdev_entry->textColour.colour, - pb, pdev_entry->textColour.colourType); - - pb += colour_type_sizes[(int)pdev_entry->textColour.colourType]; - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - ps+= sizeof(PEX_LUT_ENTRY_STR); - - MILUT_COPY_COLOUR(ps, &(pentry->entry.textColour.colour), - pentry->entry.textColour.colourType); - - LUT_REALIZE_ENTRY( pheader, pentry ); - - ps += colour_type_sizes[(int)pentry->entry.textColour.colourType]; - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - ddPointer pe = (ddPointer)*ppPexEntry; - - /* textFont: any value OK. this is an index into the font table */ - - /* textPrecision: must be String, Char, or Stroke */ - if (((*ppPexEntry)->textPrecision != PEXStringPrecision) && - ((*ppPexEntry)->textPrecision != PEXCharPrecision) && - ((*ppPexEntry)->textPrecision != PEXStrokePrecision)) - return(BadValue); - - /* charExpansion: any value OK. use closest magnitude if it's not supported */ - /* charSpacing: any value is OK */ - - /* colours: only accept supported colour types */ - if (MI_BADCOLOURTYPE((*ppPexEntry)->textColour.colourType)) - return(PEXERR(PEXColourTypeError)); - - pe += sizeof(PEX_LUT_ENTRY_STR) + - colour_type_sizes[(int)(*ppPexEntry)->textColour.colourType]; - *ppPexEntry = (PEX_LUT_ENTRY_STR *)pe; - return(Success); -} - -/* realize entry */ -ddpex43rtn -LUT_REALIZE_ENTRY( pheader, pEntry ) - miLUTHeader *pheader; - MI_LUT_ENTRY_STR *pEntry; -{ - /* textPrecision: realized value can only be determined at - * traversal time since it depends on the font used and on - * the string being rendered. it looks like it will probably - * only differ if a font group has X and PEX fonts in it. - * PEX-SI does not support X fonts in a font group, so this - * should be correct for PEX-SI. - */ - /* charExpansion: use closest supported magnitude. - * will be based on imp dep values, but they aren't in - * spec yet, so just put magnitude for now. - * todo: define values even though they aren't returned by - * inqimpdepconstants yet. - */ - pEntry->real_entry = pEntry->entry; - pEntry->real_entry.charExpansion = ABS(pEntry->entry.charExpansion); -} - -void -TextBundleLUT_init_pde() -{ - pdeTextBundleEntry[0].textFontIndex = 1; - pdeTextBundleEntry[0].textPrecision = PEXStringPrecision; - pdeTextBundleEntry[0].charExpansion = 1.0; - pdeTextBundleEntry[0].charSpacing = 0.0; - MILUT_INIT_COLOUR(pdeTextBundleEntry[0].textColour); -} - -#include "miLUTProcs.ci" Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c:1.9 Fri Dec 14 14:57:40 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c Sat Feb 28 21:41:55 2004 @@ -1,628 +0,0 @@ -/* $Xorg: miUtils.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miUtils.c,v 1.9 2001/12/14 19:57:40 dawes Exp $ */ - -#include "mipex.h" -#include "PEX.h" -#include "PEXprotost.h" -#include "ddpex3.h" -#include "miRender.h" -#include "miWks.h" -#include "pexos.h" - - -/*++ - | - | Function Name: miMatIdent - | - | Function Description: - | initializes 4x4 matrices to identity. - | - --*/ - -void -miMatIdent(m) - ddFLOAT m[4][4]; -{ - int i, j; - - for (i=0; i<4; i++) { - for (j=0; j<4; j++) { - m[i][j] = ((i==j) ? 1.0 : 0.0); - } - } -} - -/*++ - | - | Function Name: miMatCopy - | - | Function Description: - | copies 4x4 mat - | - --*/ - -void -miMatCopy(src, dest) - ddFLOAT src[4][4]; - ddFLOAT dest[4][4]; -{ - int i, j; - - for (i=0; i<4; i++) { - for (j=0; j<4; j++) { - dest[i][j] = src[i][j]; - } - } -} - -/*++ - | - | Function Name: miMatTranspose - | - | Function Description: - | transposes 4x4 matrices. - | - --*/ - -void -miMatTranspose(m) - ddFLOAT m[4][4]; -{ - int i, j; - ddFLOAT t; - - for (i=1; i<4; i++) { - for (j=0; jnumLists, vinput->type); - - DD_VertPointSize(vinput->type, point_size); - - pddlist = vinput->ddList; - for (i = 0; i < vinput->numLists; i++) { - - vert_count = pddlist->numPoints; - ErrorF(" num points, list %d: %d", i, vert_count); - - /* - * - */ - pt = (char *)pddlist->pts.p4Dpt; - - for (j = 0; j < vert_count; j++) { - - if (DD_IsVertFloat(vinput->type)) { - - if (DD_IsVert2D(vinput->type)) - ErrorF(" x %f, y %f \n", - ((ddCoord4D *)pt)->x, - ((ddCoord4D *)pt)->y ); - - else if (DD_IsVert3D(vinput->type)) - ErrorF(" x %f, y %f, z %f \n", - ((ddCoord4D *)pt)->x, - ((ddCoord4D *)pt)->y, - ((ddCoord4D *)pt)->z ); - - else - ErrorF(" x %f, y %f, z %f \n", - ((ddCoord4D *)pt)->x, - ((ddCoord4D *)pt)->y, - ((ddCoord4D *)pt)->z, - ((ddCoord4D *)pt)->w ); - - - } else { - - if (DD_IsVert2D(vinput->type)) - ErrorF(" x %d, y %d \n", - ((ddCoord3DS *)pt)->x, - ((ddCoord3DS *)pt)->y ); - - else if (DD_IsVert3D(vinput->type)) - ErrorF(" x %d, y %d, z %d \n", - ((ddCoord3DS *)pt)->x, - ((ddCoord3DS *)pt)->y, - ((ddCoord3DS *)pt)->z ); - - } - - pt += point_size; - - } - /* Now, ski to next input list */ - pddlist++; - } -} - -/*++ - | - | Function Name: miTransformVector - | - | Function Description: Transform a 3D point by the 3x3 - | portion of a 4x4 matrix - | Added 4/8/91 by JSH. - | - --*/ -void -miTransformVector (p3, matrix, xp3) -/* in */ -ddVector3D *p3; -ddFLOAT matrix[4][4]; -/* out */ -ddVector3D *xp3; -{ - - xp3->x = matrix[0][0]*p3->x; - xp3->x += matrix[0][1]*p3->y; - xp3->x += matrix[0][2]*p3->z; - - xp3->y = matrix[1][0]*p3->x; - xp3->y += matrix[1][1]*p3->y; - xp3->y += matrix[1][2]*p3->z; - - xp3->z = matrix[2][0]*p3->x; - xp3->z += matrix[2][1]*p3->y; - xp3->z += matrix[2][2]*p3->z; - -} - -/*++ - | - | Function Name: miTransformPoint - | - | Function Description: Transform a 4D point by a 4x4 matrix - | - --*/ -void -miTransformPoint (p4, matrix, xp4) -/* in */ -ddCoord4D *p4; -ddFLOAT matrix[4][4]; -/* out */ -ddCoord4D *xp4; -{ - - xp4->x = matrix[0][0]*p4->x; - xp4->x += matrix[0][1]*p4->y; - xp4->x += matrix[0][2]*p4->z; - xp4->x += matrix[0][3]*p4->w; - - xp4->y = matrix[1][0]*p4->x; - xp4->y += matrix[1][1]*p4->y; - xp4->y += matrix[1][2]*p4->z; - xp4->y += matrix[1][3]*p4->w; - - xp4->z = matrix[2][0]*p4->x; - xp4->z += matrix[2][1]*p4->y; - xp4->z += matrix[2][2]*p4->z; - xp4->z += matrix[2][3]*p4->w; - - xp4->w = matrix[3][0]*p4->x; - xp4->w += matrix[3][1]*p4->y; - xp4->w += matrix[3][2]*p4->z; - xp4->w += matrix[3][3]*p4->w; -} - -/*++ - | - | Function Name: miMatInverse - | - | Function Description: - | miMatInverse - a fairly robust matrix inversion routine - | inverts a 4x4 matrix. - | - | TODO: If the matrix is singular, call a more robust routine (SVD) - | to find a solution. See Numerical Recipes in C - | - | - --*/ - -void -miMatInverse( a ) - ddFLOAT a[4][4]; -{ - short index[4][2], ipivot[4]; - float pivot[4]; - short row, colum; - float themax; - short i, j, k, l; - - for (j = 0; j < 4; j++) - ipivot[j] = 0; - - for (i = 0; i < 4; i++) { /* do matrix inversion */ - themax = 0.0; - for (j = 0; j < 4; j++) { /* search for pivot element */ - if (ipivot[j] == 1) - continue; - for (k = 0; k < 4; k++) { - if (ipivot[k] == 1) - continue; - /* what does this mean? is it another singular case? - if (ipivot[k] > 1) - TODO: - */ - if (fabs(themax) < fabs(a[j][k])) { - row = j; - colum = k; - themax = a[j][k]; - } - } - } - if (MI_NEAR_ZERO(themax)) { - /* input matrix is singular, return the an identity matrix */ - MI_MAT_IDENTITY( a, 4 ); - /* TODO: restore matix 'a' and call SVD routine */ - return; - } - ipivot[colum] += 1; - if (row != colum) { /* interchange rows to put */ - for (l = 0; l < 4; l++) { - themax = a[row][l]; - a[row][l] = a[colum][l]; - a[colum][l] = themax; - } - } - index[i][0] = row; - index[i][1] = colum; - pivot[i] = a[colum][colum]; -#ifndef NDEBUG - if ((pivot[i] < 1.0e-6) && (pivot[i] > -1.0e-6) ) { - /* input matrix is singular, return the an identity matrix */ - MI_MAT_IDENTITY( a, 4 ); - /* TODO: restore matix 'a' and call SVD routine */ - } -#endif - /* the following isn't needed if we have SVD routine */ - if (MI_NEAR_ZERO(pivot[i])) { - pivot[i] = MI_ZERO_TOLERANCE; - } - a[colum][colum] = 1.0; /* divide pivot row by pivot element */ - for (l = 0; l < 4; l++) - a[colum][l] /= pivot[i]; - for (j = 0; j < 4; j++) - if (j != colum) { - themax = a[j][colum]; - a[j][colum] = 0.0; - for (l = 0; l < 4; l++) - a[j][l] -= a[colum][l] * themax; - } - } - - for (i = 0; i < 4; i++) { /* interchange columns */ - l = 4 - 1 - i; - if (index[l][0] != index[l][1]) { - row = index[l][0]; - colum = index[l][1]; - for (k = 0; k < 4; k++) { - themax = a[k][row]; - a[k][row] = a[k][colum]; - a[k][colum] = themax; - } - } - } - /* determinant is - - (row == column)?1:(-1) * pivot[0] * pivot[1] * pivot[2] * pivot[3] - - if needed*/ -} - -/*++ - | - | Function Name: miMatInverseTranspose - | - | Function Description: - | miMatInverseTranspose - compute the inverse transpose of a matrix. - | - --*/ - -void -miMatInverseTranspose( m ) - ddFLOAT m[4][4]; -{ - miMatInverse( m ); - miMatTranspose( m ); -} - -/*++ - | - | Function Name: LostXResource - | - | Function Description: - | General purpose procedure to inform ddpex when an X - | resource is deleted. - | - | Note(s): - | - --*/ - -void -LostXResource( pPEXResource, PEXtype, Xtype ) - diResourceHandle pPEXResource; - ddResourceType PEXtype; - ddXResourceType Xtype; -{ - /* the only case known to use this is when a drawable is - * deleted and a workstation is using the drawable - */ - if ( (PEXtype == WORKSTATION_RESOURCE) && (Xtype == X_DRAWABLE_RESOURCE) ) - { - register miWksPtr pwks = (miWksPtr)((diWKSHandle)pPEXResource)->deviceData; - - pwks->pRend->pDrawable = NULL; - pwks->pRend->drawableId = PEXAlreadyFreed; - } - /* no else should ever happen */ - return; -} - -/*++ - | - | Function Name: mi_set_filters - | - | Function Description: - | sets the filter flags in the ddcontext - | - | Note(s): - | - --*/ - -void -mi_set_filters(pRend, pddc, namesets) - ddRendererPtr pRend; - miDDContext *pddc; - ddBitmask namesets; -{ - ddUSHORT isempty; - ddUSHORT incl_match, excl_match; - ddUSHORT invert_incl_match, invert_excl_match; - ddNamePtr pnames; - - /* TODO: look at bitmask to smartly change filter_flags - * instead of always reseting everything - */ - pddc->Dynamic->filter_flags = 0; - MINS_IS_NAMESET_EMPTY(pddc->Dynamic->currentNames, isempty); - - /* do search first */ - if (pRend->render_mode == MI_REND_SEARCHING) - { - /* filters pass if they are empty, regardless of - * whether there are names in the current name set - */ - pnames = pddc->Static.search.norm_inclusion; - MINS_IS_NAMESET_EMPTY( pnames, incl_match ); - - pnames = pddc->Static.search.norm_exclusion; - MINS_IS_NAMESET_EMPTY( pnames, excl_match ); - - if (incl_match && excl_match) { - /* norm list is empty, then all elements pass, - * so fake it to pass - */ - incl_match = 1; - excl_match = 0; - } else { - /* norm list is not empty */ - pnames = pddc->Static.search.norm_inclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, incl_match); - pnames = pddc->Static.search.norm_exclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, excl_match); - } - - pnames = pddc->Static.search.invert_inclusion; - MINS_IS_NAMESET_EMPTY( pnames, invert_incl_match ); - - pnames = pddc->Static.search.invert_exclusion; - MINS_IS_NAMESET_EMPTY( pnames, invert_excl_match ); - - if (invert_incl_match && invert_excl_match) { - /* invert list is empty, then all elements rejected, - * so fake it to reject - */ - invert_incl_match = 0; - invert_excl_match = 1; - } else { - /* invert list is not empty */ - pnames = pddc->Static.search.invert_inclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, invert_incl_match); - pnames = pddc->Static.search.invert_exclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, invert_excl_match); - } - if ((incl_match && !excl_match) && - !(invert_incl_match && !invert_excl_match)) - MI_DDC_SET_DETECTABLE(pddc); - } - - /* now, go on to other filters */ - if (isempty) - /* current name set is empty. no filters pass */ - return; - - /* highlight */ - if ( pRend->ns[DD_HIGH_INCL_NS] ) - { - pnames = ((miNSHeader *)pRend->ns[DD_HIGH_INCL_NS]->deviceData)->names; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, incl_match); - if ( pRend->ns[DD_HIGH_EXCL_NS] ) - { - pnames = ((miNSHeader *)pRend->ns[DD_HIGH_EXCL_NS]->deviceData)->names; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, excl_match); - } - else - excl_match = 0; - if (incl_match && !excl_match) - MI_DDC_SET_HIGHLIGHT(pddc); - } - /* else inclusion set is empty; filter does not pass */ - - /* invisibility */ - if ( pRend->ns[DD_INVIS_INCL_NS] ) - { - pnames = ((miNSHeader *)pRend->ns[DD_INVIS_INCL_NS]->deviceData)->names; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, incl_match); - if ( pRend->ns[DD_INVIS_EXCL_NS] ) - { - pnames = ((miNSHeader *)pRend->ns[DD_INVIS_EXCL_NS]->deviceData)->names; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, excl_match); - } - else - excl_match = 0; - if (incl_match && !excl_match) - MI_DDC_SET_INVISIBLE(pddc); - } - /* else inclusion set is empty; filter does not pass */ - - if (pRend->render_mode == MI_REND_PICKING) - { - pnames = pddc->Static.pick.inclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, incl_match); - pnames = pddc->Static.pick.exclusion; - MINS_MATCH_NAMESETS(pnames, pddc->Dynamic->currentNames, excl_match); - if (incl_match && !excl_match) - MI_DDC_SET_DETECTABLE(pddc); - } - - if (pRend->render_mode == MI_REND_DRAWING) - MI_DDC_SET_DETECTABLE(pddc); - - return; -} Index: xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c diff -u xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c:1.9 xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c:removed --- xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c:1.9 Fri Dec 14 14:57:40 2001 +++ xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c Sat Feb 28 21:41:55 2004 @@ -1,262 +0,0 @@ -/* $Xorg: miViewLUT.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1990, 1991 by Sun Microsystems, Inc. -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ddpex/mi/shared/miViewLUT.c,v 1.9 2001/12/14 19:57:40 dawes Exp $ */ - -#include "miLUT.h" -#include "miWks.h" -#include "miInfo.h" -#include "PEXErr.h" -#include "PEXprotost.h" -#include "pexos.h" - - -extern void miMatMult(); - -/* Level 4 Shared Resources */ -/* Lookup Table Procedures */ - -extern unsigned colour_type_sizes[]; /* in miLUT.c */ - -/* definitions used by miLUTProcs.ci */ -#define LUT_TYPE PEXViewLUT - -/* devPriv data structure */ -#define DD_LUT_ENTRY_STR ddViewEntry -/* table entry data structure */ -#define MI_LUT_ENTRY_STR miViewEntry -/* pex data */ -#define PEX_LUT_ENTRY_STR pexViewEntry - -#define LUT_REND_DYN_BIT PEXDynViewTableContents - -#define LUT_START_INDEX 0 -#define LUT_DEFAULT_INDEX 0 -/* LUT_0_DEFINABLE_ENTRIES value is also defined in miWks.h */ -#define LUT_0_DEFINABLE_ENTRIES 6 -#define LUT_0_NUM_PREDEFINED 1 -#define LUT_0_PREDEFINED_MIN 0 -#define LUT_0_PREDEFINED_MAX 0 - -#define LUT_TABLE_START(pheader) (pheader)->plut.view - -#define DYNAMIC VIEW_REP_DYNAMIC - -/* predefined entries table: change this to work with your devPriv data */ -static DD_LUT_ENTRY_STR pdeViewEntry[LUT_0_NUM_PREDEFINED]; -#define LUT_PDE_ENTRIES pdeViewEntry[0] -#define LUT_SET_PDE_ENTRY(pentry, pdeentry) \ - (pentry)->entry = *(pdeentry); \ - miMatMult((pentry)->vom, (pentry)->entry.orientation, (pentry)->entry.mapping); \ - (pentry)->inv_flag = MI_FALSE - -/* predefined entry 0 is set to the default values - * change the XXX_DEFAULT_YYY macros below to use something else - * if you don't want the default values defined in the pde table - */ -#define PDE_DEFAULT_ENTRY_NUM 0 -#define LUT_DEFAULT_VALUES pdeViewEntry[PDE_DEFAULT_ENTRY_NUM] -#define LUT_SET_DEFAULT_VALUES(pentry) \ - (pentry)->entry = LUT_DEFAULT_VALUES; \ - miMatMult((pentry)->vom, (pentry)->entry.orientation, (pentry)->entry.mapping); \ - (pentry)->inv_flag = MI_FALSE - -/* which procedure definitions in miLUTProcs.h to use and their names - * take out USE flags if you're defining those procs in here - * but leave the name definitions - */ - -#define LUT_USE_FREE -#define LUT_USE_INQ_PREDEF -#define LUT_USE_INQ_ENTRIES -#define LUT_USE_COPY -#define LUT_USE_INQ_INFO -#define LUT_USE_INQ_IND -#define LUT_USE_INQ_ENTRY -#define LUT_USE_SET_ENTRIES -#define LUT_USE_DEL_ENTRIES -#define LUT_USE_INQ_ENTRY_ADDRESS -#define LUT_USE_CREATE -#define LUT_USE_MOD_CALL_BACK - -/* these three are redefined in miLUTProcs.h -#define LUT_FREE ViewLUT_free -#define LUT_INQ_PREDEF ViewLUT_inq_predef -#define LUT_INQ_ENTRIES ViewLUT_inq_entries -*/ -#define LUT_COPY ViewLUT_copy -#define LUT_INQ_INFO ViewLUT_inq_info -#define LUT_INQ_IND ViewLUT_inq_ind -#define LUT_INQ_ENTRY ViewLUT_inq_entry -#define LUT_SET_ENTRIES ViewLUT_set_entries -#define LUT_DEL_ENTRIES ViewLUT_del_entries -#define LUT_INQ_ENTRY_ADDRESS ViewLUT_inq_entry_address -#define LUT_CREATE ViewLUT_create -#define LUT_ENTRY_CHECK ViewLUT_entry_check -#define LUT_COPY_PEX_MI ViewLUT_copy_pex_to_mi -#define LUT_COPY_MI_PEX ViewLUT_copy_mi_to_pex -#define LUT_MOD_CALL_BACK ViewLUT_mod_call_back - -/* copy from an mi entry to a pex entry and increment ppbuf */ -ddpex43rtn -LUT_COPY_MI_PEX ( pheader, valueType, pentry, ppbuf ) - miLUTHeader *pheader; - ddUSHORT valueType; - MI_LUT_ENTRY_STR *pentry; - ddPointer *ppbuf; -{ - ddPointer pb = *ppbuf; - DD_LUT_ENTRY_STR *pdev_entry; - - if (pentry == NULL) - pdev_entry = &(LUT_DEFAULT_VALUES); - else if (pentry->entry_info.status == MILUT_UNDEFINED) - pdev_entry = &(LUT_DEFAULT_VALUES); - else - pdev_entry = &pentry->entry; - - mibcopy(pdev_entry, pb, sizeof(PEX_LUT_ENTRY_STR)); - - pb+= sizeof(PEX_LUT_ENTRY_STR); - - *ppbuf = pb; - return(Success); -} - -/* copy from a pex entry to an mi entry and increment ppsrc */ -ddpex43rtn -LUT_COPY_PEX_MI ( pheader, ppsrc, pentry ) - miLUTHeader *pheader; - ddPointer *ppsrc; - MI_LUT_ENTRY_STR *pentry; -{ - ddPointer ps = *ppsrc; - - mibcopy(ps, &(pentry->entry), sizeof(PEX_LUT_ENTRY_STR)); - - miMatMult(pentry->vom, pentry->entry.orientation, pentry->entry.mapping); - pentry->inv_flag = MI_FALSE; - - ps+= sizeof(PEX_LUT_ENTRY_STR); - *ppsrc = ps; - return(Success); -} - -/* check for bad values and increment ppPexEntry */ - -ddpex43rtn -LUT_ENTRY_CHECK (pheader, ppPexEntry) - miLUTHeader *pheader; - PEX_LUT_ENTRY_STR **ppPexEntry; -{ - /* orientation, mapping, clipFlags: no error for these */ - /* correct clipLimits: XMAX > XMIN, YMAX > YMIN, ZMAX >= ZMIN, plus in NPC */ - if (((*ppPexEntry)->clipLimits.minval.x >= (*ppPexEntry)->clipLimits.maxval.x) || - ((*ppPexEntry)->clipLimits.minval.y >= (*ppPexEntry)->clipLimits.maxval.y) || - ((*ppPexEntry)->clipLimits.minval.z > (*ppPexEntry)->clipLimits.maxval.z) || - ((*ppPexEntry)->clipLimits.minval.x < 0.0) || - ((*ppPexEntry)->clipLimits.maxval.x > 1.0) || - ((*ppPexEntry)->clipLimits.minval.y < 0.0) || - ((*ppPexEntry)->clipLimits.maxval.y > 1.0) || - ((*ppPexEntry)->clipLimits.minval.z < 0.0) || - ((*ppPexEntry)->clipLimits.maxval.z > 1.0)) - return(BadValue); - - (*ppPexEntry)++; - return(Success); -} - -void -ViewLUT_init_pde() -{ - pdeViewEntry[0].clipFlags = (PEXClipXY | PEXClipBack | PEXClipFront); - pdeViewEntry[0].clipLimits.minval.x = 0.0; - pdeViewEntry[0].clipLimits.minval.y = 0.0; - pdeViewEntry[0].clipLimits.minval.z = 0.0; - pdeViewEntry[0].clipLimits.maxval.x = 1.0; - pdeViewEntry[0].clipLimits.maxval.y = 1.0; - pdeViewEntry[0].clipLimits.maxval.z = 1.0; - - pdeViewEntry[0].orientation[0][0] = 1.0; - pdeViewEntry[0].orientation[0][1] = 0.0; - pdeViewEntry[0].orientation[0][2] = 0.0; - pdeViewEntry[0].orientation[0][3] = 0.0; - pdeViewEntry[0].orientation[1][0] = 0.0; - pdeViewEntry[0].orientation[1][1] = 1.0; - pdeViewEntry[0].orientation[1][2] = 0.0; - pdeViewEntry[0].orientation[1][3] = 0.0; - pdeViewEntry[0].orientation[2][0] = 0.0; - pdeViewEntry[0].orientation[2][1] = 0.0; - pdeViewEntry[0].orientation[2][2] = 1.0; - pdeViewEntry[0].orientation[2][3] = 0.0; - pdeViewEntry[0].orientation[3][0] = 0.0; - pdeViewEntry[0].orientation[3][1] = 0.0; - pdeViewEntry[0].orientation[3][2] = 0.0; - pdeViewEntry[0].orientation[3][3] = 1.0; - - pdeViewEntry[0].mapping[0][0] = 1.0; - pdeViewEntry[0].mapping[0][1] = 0.0; - pdeViewEntry[0].mapping[0][2] = 0.0; - pdeViewEntry[0].mapping[0][3] = 0.0; - pdeViewEntry[0].mapping[1][0] = 0.0; - pdeViewEntry[0].mapping[1][1] = 1.0; - pdeViewEntry[0].mapping[1][2] = 0.0; - pdeViewEntry[0].mapping[1][3] = 0.0; - pdeViewEntry[0].mapping[2][0] = 0.0; - pdeViewEntry[0].mapping[2][1] = 0.0; - pdeViewEntry[0].mapping[2][2] = 1.0; - pdeViewEntry[0].mapping[2][3] = 0.0; - pdeViewEntry[0].mapping[3][0] = 0.0; - pdeViewEntry[0].mapping[3][1] = 0.0; - pdeViewEntry[0].mapping[3][2] = 0.0; - pdeViewEntry[0].mapping[3][3] = 1.0; -} - -#include "miLUTProcs.ci" - - Index: xc/programs/Xserver/PEX5/dipex/Imakefile diff -u xc/programs/Xserver/PEX5/dipex/Imakefile:1.1.1.2 xc/programs/Xserver/PEX5/dipex/Imakefile:removed --- xc/programs/Xserver/PEX5/dipex/Imakefile:1.1.1.2 Tue Jan 16 17:34:30 2001 +++ xc/programs/Xserver/PEX5/dipex/Imakefile Sat Feb 28 21:41:55 2004 @@ -1,16 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:12 cpqbld Exp $ -XCOMM This is only used on NT where we do not know how to jump over this dir - -#ifdef Win32Architecture - -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - - SUBDIRS = dispatch swap objects - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - -#endif Index: xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile diff -u xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile:3.13 xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile:3.13 Wed Jan 17 17:12:36 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile Sat Feb 28 21:41:55 2004 @@ -1,71 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:12 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/dipex/dispatch/Imakefile,v 3.13 2001/01/17 22:12:36 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium. -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems, -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PexDipexCDebugFlags -#define PexDipexCDebugFlags ServerCDebugFlags -#endif - -RDR_STUBS = -DRENDER_CMDS -ST_STUBS = -DSTORE_CMDS -DIPEXDEFINES = PexDipexDefines - - CDEBUGFLAGS = PexDipexCDebugFlags - DEFINES = $(DIPEXDEFINES) - - LINTLIBS = ../../../dix/llib-ldix.ln \ - ../../../os/llib-los.ln \ - ../../ddpex/mi/level4/llib-ldp4.ln \ - ../../ddpex/mi/shared/llib-ldps.ln \ - ../swap/llib-ldsw.ln \ - ../objects/llib-lobj.ln - - PEXSRVINC = ../../include - INCLUDES = -I$(PEXSRVINC) -I$(XINCLUDESRC) -I$(SERVERSRC)/include - - -SRCS = dipexParse.c dipexExt.c pexDump.c pexError.c dipexBuf.c pexUtils.c - -OBJS = dipexParse.o dipexExt.o pexDump.o pexError.o dipexBuf.o pexUtils.o - -PEX_DI_LIBNAME = libdidipex.a - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(didipex,$(OBJS)) - -LintLibraryTarget(dsp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/dipex/dispatch/dipexBuf.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/dipexBuf.c:3.7 xc/programs/Xserver/PEX5/dipex/dispatch/dipexBuf.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/dipexBuf.c:3.7 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/dipexBuf.c Sat Feb 28 21:41:55 2004 @@ -1,79 +0,0 @@ -/* $Xorg: dipexBuf.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "ddpex.h" - -ddBuffer *pPEXBuffer; - -#define INIT_PEX_BUFFER_SIZE 1024 - -ddBuffer * -diInitPEXBuffer() -{ - ddBuffer *temp; - if (!(temp = (ddBuffer *)xalloc((unsigned long)(sizeof(ddBuffer))))) - return (0); - if (!(temp->pHead =(ddPointer)xalloc((unsigned long)(INIT_PEX_BUFFER_SIZE)))) - { - xfree(temp); - return (0); - } - temp->bufSize = (ddULONG)INIT_PEX_BUFFER_SIZE; - temp->dataSize = 0; - temp->pBuf = temp->pHead; - return (temp); -} - - -void diFreePEXBuffer(buffer) - ddBuffer *buffer; -{ - xfree(buffer->pHead); - xfree(buffer); -} - Index: xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c:3.22 xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c:3.22 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c Sat Feb 28 21:41:55 2004 @@ -1,333 +0,0 @@ -/* $Xorg: dipexExt.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/dispatch/dipexExt.c,v 3.22 2001/12/14 19:57:41 dawes Exp $ */ - -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "PEXproto.h" -#include "misc.h" -#include "os.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "dixstruct.h" -#include "resource.h" -#include "pexUtils.h" -#include "pexos.h" - -#define LOCAL_FLAG -#define _DIPEXEXT_ -#include "dipex.h" -#include "pexSwap.h" -#undef _DIPEXEXT_ -#undef LOCAL_FLAG - - -unsigned long add_pad_of[] = {0, 3, 2, 1}; - -unsigned int ColourSpecSizes[] = { - sizeof(CARD32), /* PEXIndexedColour */ - 3 * sizeof(PEXFLOAT), /* PEXRgbFloatColour */ - 3 * sizeof(PEXFLOAT), /* PEXCieFloatColour */ - 3 * sizeof(PEXFLOAT), /* PEXHsvFloatColour */ - 3 * sizeof(PEXFLOAT), /* PEXHlsFloatColour */ - sizeof(CARD32), /* PEXRgb8Colour */ - 2 * sizeof(CARD32), /* PEXRgb16Colour */ -}; - -extern ddpex43rtn ddpexInit(); - -extern ddBuffer *pPEXBuffer; -extern ddBuffer *diInitPEXBuffer(); -extern RequestFunction PEXRequest[]; -extern void SwapCARD32(); -extern void SwapCARD16(); -static int DeletePexClient(); - -/* - ****************************************************************************** - * - * Function: PexExtensionInit - * - ****************************************************************************** - */ -void -PexExtensionInit() -{ - ExtensionEntry *AddExtension(); - ExtensionEntry *PextEntry = 0; - int ProcPEXDispatch(); - void PEXResetProc(); - extern int DeleteStructure(), FreeSearchContext(), FreeRenderer(), - FreePickMeasure(), dipexFreePhigsWks(), FreePipelineContext(), - FreeNameSet(), FreeLUT(), FreePEXFont(), FreeWksDrawable(); - extern ddpex43rtn OpenPEXFont(); - dipexFont *pPEXFont; - - PEXStructType = CreateNewResourceType (DeleteStructure); - PEXSearchType = CreateNewResourceType (FreeSearchContext); - PEXRendType = CreateNewResourceType (FreeRenderer); - PEXPickType = CreateNewResourceType (FreePickMeasure); - PEXWksType = CreateNewResourceType (dipexFreePhigsWks); - PEXPipeType = CreateNewResourceType (FreePipelineContext); - PEXNameType = CreateNewResourceType (FreeNameSet); - PEXLutType = CreateNewResourceType (FreeLUT); - PEXFontType = CreateNewResourceType (FreePEXFont); - PEXContextType = CreateNewResourceType (DeletePexClient); - - PEXClass = CreateNewResourceClass(); - PEXWksDrawableType - = CreateNewResourceType (FreeWksDrawable); - - if (!PEXStructType || !PEXSearchType || !PEXRendType || !PEXWksDrawableType - || !PEXWksType || !PEXPipeType || !PEXNameType || !PEXFontType - || !PEXLutType || !PEXPickType || !PEXClass || !PEXContextType ) { - ErrorF("PEXExtensionInit: Could not create PEX resource types\n"); - return; - } - - /* - Init buffer for varying-sized replies from ddpex - */ - pPEXBuffer = diInitPEXBuffer(); - - if (!pPEXBuffer) { - ErrorF("PEXExtensionInit: failed to alloc buffer\n"); - return; } - - /* - * Init any device dependent stuff - */ - - if (ddpexInit()) { - ErrorF("PEXExtensionInit: Couldn't init ddPEX!\n"); - /* this isn't needed for the SI since ddpexInit won't fail - in the SI but maybe some vendors versions might... - */ - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; - return; - } - - /* - * Open up the default font - */ - pPEXFont=(dipexFont *)xalloc((unsigned long)(sizeof(dipexFont))); - if (!pPEXFont) { - ErrorF("PEXExtensionInit: Memory error--could not allocate default PEX font\n"); - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; - return; - } - - pPEXFont->refcnt = 1; - pPEXFont->ddFont.id = FakeClientID(0); - - defaultPEXFont = &(pPEXFont->ddFont); - - if ( OpenPEXFont( (ddULONG)(strlen(DEFAULT_PEX_FONT_NAME)), - (ddUCHAR *)(DEFAULT_PEX_FONT_NAME), - pPEXFont) != Success) { - char *errmsg; - char *static_message = - "PEXExtensionInit: Couldn't open default PEX font file "; - - errmsg = (char *) xalloc(strlen(static_message) + - strlen(DEFAULT_PEX_FONT_NAME) + - 2 /* 1 byte for space between strings, - * 1 byte for null */ - ); - if (errmsg) { - sprintf(errmsg, "%s %s", static_message, DEFAULT_PEX_FONT_NAME); - ErrorF(errmsg); - xfree(errmsg); - } - ErrorF("\n"); - - xfree(pPEXFont); - defaultPEXFont = 0; - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; - return; - } - - /* - * Note that fonts resources are stored with the type (dipexFont *), - * and they are referenced sometimes in the DD layer as diFontHandle - * (which is a pointer to a ddFontResource). Since the first part - * of the dipexFont structure consists of a ddFontResource, this - * works. Even though it is ugly, it's best not to start changing - * all of the font code at this time (right before a public release), - * and hopefully, it will get cleaned up for PEX 6.0. - */ - - if (!AddResource( pPEXFont->ddFont.id, PEXFontType, - (pointer)(pPEXFont))) { - ErrorF("PEXExtensionInit: Couldn't add default PEX font resource.\n"); - xfree(pPEXFont); - defaultPEXFont = 0; - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; - return; - } - - PextEntry = AddExtension( PEX_NAME_STRING, PEXNumberEvents, (PEXMaxError+1), - ProcPEXDispatch, ProcPEXDispatch, - PEXResetProc, StandardMinorOpcode); - if (!PextEntry) { - ErrorF("PEXExtensionInit: AddExtensions failed\n"); - xfree(pPEXFont); - defaultPEXFont = 0; - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; - return; - } - - PexReqCode = PextEntry->base; - PexErrorBase = PextEntry->errorBase; - PexEventBase = PextEntry->eventBase; - EventSwapVector[PexEventBase + PEXMaxHitsReached] = - (EventSwapPtr)SwapPEXMaxHitsReachedEvent; - -} - - -/* - ****************************************************************************** - * - * Function: InitPexClient - * - ****************************************************************************** - */ -pexContext * -InitPexClient(client) -ClientPtr client; -{ - pexContext *cntxtPtr; - XID pexId; - - /* Allocate space for the context table */ - cntxtPtr = (pexContext *) xalloc( (unsigned long)(sizeof( pexContext ) - + sizeof(pexSwap)) ); - cntxtPtr->swap = (pexSwap *)(cntxtPtr+1); /* this is silly */ - - /* Create the resource id */ - pexId = PEXID( client, PEXCONTEXTTABLE ); - - /* Add the connection context as a resource */ - if (!AddResource (pexId, PEXContextType, (pointer)cntxtPtr)) { - unsigned short temp; - temp = MinorOpcodeOfRequest(client); - SendErrorToClient( client, (unsigned) PexReqCode, - (temp), (unsigned long)0, (int) (BadAlloc)); - xfree((pointer)cntxtPtr); - return(0); } - - /* setup the default proc vectors */ - cntxtPtr->pexRequest = PEXRequest; - cntxtPtr->pexSwapReply = 0; - cntxtPtr->pexSwapRequestOC = 0; - cntxtPtr->pexSwapReplyOC = 0; - cntxtPtr->swap->ConvertCARD16 = SwapCARD16; - cntxtPtr->swap->ConvertCARD32 = SwapCARD32; - cntxtPtr->swap->ConvertFLOAT = 0; - - /* save the client ptr */ - cntxtPtr->client = client; - - return( cntxtPtr ); - -} - -/* - ****************************************************************************** - * - * Function: static DeletePexClient - * - * On Entry: Client quitting, Pex resources need to be freed - * - * On Exit: Pex client resources freed. - * - * Notes: - * - ****************************************************************************** - */ - -static int DeletePexClient(value, pexId) -pointer value; -XID pexId; -{ - pexContext *cntxtPtr = (pexContext *)value; - - /* Free space allocated for the client context */ - if (cntxtPtr) xfree( (pointer)cntxtPtr ); - -} - - -void PEXResetProc() -{ - extern ddpex43rtn FreePEXFont(); - extern void ddpexReset(); - diFontHandle temp = defaultPEXFont; - - defaultPEXFont = 0; /* force free */ - FreeResource(temp->id, RT_NONE); - - ddpexReset(); - diFreePEXBuffer(pPEXBuffer); - pPEXBuffer = NULL; -} - - -ErrorCode -PEXGenericResourceRequest (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexReq *strmPtr; -{ } - Index: xc/programs/Xserver/PEX5/dipex/dispatch/dipexParse.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/dipexParse.c:1.9 xc/programs/Xserver/PEX5/dipex/dispatch/dipexParse.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/dipexParse.c:1.9 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/dipexParse.c Sat Feb 28 21:41:55 2004 @@ -1,135 +0,0 @@ -/* $Xorg: dipexParse.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "X.h" -#include "PEXproto.h" -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "dix.h" -#include "pexError.h" -#include "pexSwap.h" - - -extern RequestFunction set_tables[]; -extern pexContext * InitPexClient(); - -/*++ pexErrorHandler - --*/ - -ErrorCode -pexErrorHandler(client, err) - ClientPtr client; - ErrorCode err; -{ - ErrorF( "PEX Error %d Detected. Continuing...\n", err); -/* - * The following code is snitched from Dispatch - if (client->noClientException != Success) - CloseDownClient(client); - else - Oops(client, 0, err); -*/ -/* - * used to do this - */ - return(err); - -} /* end-pexErrorHandler() */ - - -/*++ ProcPEXDispatch - */ - -ProcPEXDispatch( client ) -ClientPtr client; -{ - XID pexId; - pexContext *cntxtPtr; - CARD8 op; - ErrorCode err = Success; - - REQUEST( xReq ); - - pexId = PEXID( client, PEXCONTEXTTABLE ); - cntxtPtr = (pexContext *)LookupIDByType(pexId, PEXContextType); - - if( !cntxtPtr ) { - - if (!(cntxtPtr = InitPexClient(client))) return (BadAlloc); - - } - - op = ((pexReq *)stuff)->opcode; - - if ((op >= PEX_GetExtensionInfo) && (op <= PEXMaxRequest)) { - - if (!(err = set_tables[op](cntxtPtr, stuff))) { - cntxtPtr->current_req = (pexReq *)stuff; - err = cntxtPtr->pexRequest[ op ]( cntxtPtr, stuff ); } - - } else { - err = BadRequest; - } - - return( err ); - -} - - -/*++ PEXRequestUnused -- stub for unimplemented requests - --*/ -ErrorCode -PEXRequestUnused(context) -pexContext *context; -{ -ErrorCode err = PEX_ERROR_CODE(BadRequest); -return ( err ); - -} /* end-PEXRequestUnused */ Index: xc/programs/Xserver/PEX5/dipex/dispatch/pexDump.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/pexDump.c:1.9 xc/programs/Xserver/PEX5/dipex/dispatch/pexDump.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/pexDump.c:1.9 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/pexDump.c Sat Feb 28 21:41:55 2004 @@ -1,190 +0,0 @@ -/* $Xorg: pexDump.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* - * File: pexDump.c - * - * Module(s): - * PEXDumpScruc - * PEXDumpBlock - * Notes: - * - */ - -/* some compilers don't like files that don't have any real code - * in them, as is the case with this file if DUMP_ON is not - * defined. The following static is to appease such compilers. - */ -static int foo; - -#ifdef DUMP_ON - -#include "X.h" -#include "PEXproto.h" -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "dix.h" -#include "pexSwap.h" -#include "dipex.h" - -#include "pexStruct.h" - -PEXDumpBlock( block ) -struct structureBlock *block; -{ -int i; -struct genericElement *cmd; -char *curCmd; - - ErrorF( "\n\nDump of block: %8.8x\n", block ); - ErrorF( "prev, next: %8.8x %8.8x\n", block->prev, block->next ); - ErrorF( "element size: %d next free: %d\n", - block->elementSize, block->nextFree ); - - curCmd = block->elements; - - while( 1 ) - { - - cmd = ( struct genericElement * )curCmd; - - switch( cmd->opcode ) - { - - case OP_POLYLINE3D: - { - struct elPolyline3D *pl; - - pl = ( struct elPolyline3D * )cmd; - - ErrorF( "Polyline vertex count = %d\n", - pl->count ); - curCmd += sizeof( struct elPolyline3D ) + - ( pl->count - 1 ) * sizeof( struct point3d ); - - for( i = 0; i < pl->count; i++ ) - { - ErrorF( "%d ( %f %f %f )\n", - i, - pl->points[i].x, - pl->points[i].y, - pl->points[i].z - ); - } - ErrorF( "\n" ); - } - break; - - case 0: - { - struct elEndBlock *end; - - end = ( struct elEndBlock * )cmd; - ErrorF( "End Block, next: %8.8x\n", end->next ); - - return; - } - break; - - default: - ErrorF( "--WARNING unrecognized opcode found--\n" ); - ErrorF( "--the rest of this block is assumed HOSED--\n" ); - return; - break; - - } /* switch( cmd->opcode ) */ - - } /* while( 1 ) */ - -} /* function PEXDumpBlock */ - - - -PEXDumpStructure( context, id ) -pexContext *context; -int id; -{ -struct phigsStructure *str; -struct structureBlock *block; - - - str = PEXLookupStruc( context, id ); - if( str == 0 ) - { - ErrorF( "no structure with id: %d %8.8x\n", id, id ); - return; - } - - ErrorF( "dump of structure: %d %8.8x\n", id, id ); - ErrorF( " at address: %8.8x\n", str ); - ErrorF( " previous, next: %8.8x %8.8x\n", - str->prev, str->next); - ErrorF( " first, last block: %8.8x %8.8x\n", - str->firstBlock, str->lastBlock ); - ErrorF( " edit block, element: %8.8x %8.8x\n", - str->editBlock, str->editElement ); - ErrorF( " search block, element: %8.8x %8.8x \n", - str->searchBlock, str->searchElement ); - ErrorF( " element count: %d\n", str->elementCount ); - ErrorF( " curElement: %d\n", str->curElement ); - ErrorF( " edit Mode: %d\n", str->editMode ); - - - block = str->firstBlock; - while( block ) - { - PEXDumpBlock( block ); - block = block->next; - } - -} - -#endif /* DUMP_ON */ - Index: xc/programs/Xserver/PEX5/dipex/dispatch/pexError.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/pexError.c:1.2 xc/programs/Xserver/PEX5/dipex/dispatch/pexError.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/pexError.c:1.2 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/pexError.c Sat Feb 28 21:41:55 2004 @@ -1,57 +0,0 @@ -/* $Xorg: pexError.c,v 1.4 2001/02/09 02:04:13 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/*++ PEXerror.c - --*/ - -/* some compilers don't like files that don't have any real code - * in them. The following static is to appease such compilers. - */ -static int foo; - Index: xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c diff -u xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c:3.8 xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c:removed --- xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c:3.8 Fri Dec 14 14:57:41 2001 +++ xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c Sat Feb 28 21:41:55 2004 @@ -1,780 +0,0 @@ -/* $Xorg: pexUtils.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and The Open Group. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/dispatch/pexUtils.c,v 3.8 2001/12/14 19:57:41 dawes Exp $ */ - -#include "ddpex.h" -#include "pexUtils.h" -#include "PEX.h" -#include "misc.h" -#include "pexos.h" - - -/*++ - | - | Function Name: puBufferRealloc - | - | Function Description: - | increses the size of the buffer provided by diPEX. - | - | Input Description: - ddBufferPtr pBuffer; - ddULONG minSize; - | - | Output Description: - ddBufferPtr pBuffer; - | - | Note(s): - | For now only does increase to min size given (in bytes). Maybe - | it should make buffer size multiple of 2? - | - --*/ - -int -puBuffRealloc(pBuffer, minSize) - ddBufferPtr pBuffer; - ddULONG minSize; -{ - ddPointer newbuf; - int hsiz = PU_BUF_HDR_SIZE(pBuffer); - - minSize += hsiz; - - if ((newbuf = (ddPointer) xrealloc( (pointer)(pBuffer->pHead), - (unsigned long)minSize)) - == NULL) - { - pBuffer->dataSize = 0; - return (BadAlloc); - } - pBuffer->pHead = newbuf; - pBuffer->bufSize = minSize; - pBuffer->pBuf = (ddPointer) ((char *) pBuffer->pHead) + hsiz; - return (Success); -} - -/****** STUFF FOR MANAGING LISTOFOBJ *************/ -/* listofObj is a generic structure defined in ddpex.h for storing - * a list of items in. The enum 'ddtype' specifies the possible items - * that a listofObj can hold. The following routines are used to manage the - * lists. These lists can be used by dipex, ddpex, or both. They are - * NOT intended to be completely opaque objects! dipex or ddpex can - * manipulate the lists themselves, without using any of these routines. - * The routines are provided as a convenience. However, since dipex does - * use them, they must be provided and must behave as expected. - * The lists are maintained as an array. The array is reallocated if it - * is not large enough. Array is used instead of a linked list because - * a list of items can be easily copied into the array as a chunk and - * the chunk can be easily traversed by incrementing a pointer to it. - * One time when the array may be a disadvantage over linked lists - * is if the array is not large enough and has to be realloced. Then - * the current contents are copied into the new array. It should be - * an efficient copy since the system realloc routined does this, however - * it is a copy. The size of the array is tunable (see object_array_sizes - * below) and may be adjusted for better performance. - * Also, when an item is removed, the end of the list - * is moved up one slot (copied) to fill in where the item is taken - * out. This should be evaluated to determine if it's effect on system - * performance is significant enough to change the method used. - * An alternative way to implement the lists would be to use a list of - * pointers to the items. This may or may not be better. - */ - -/* the arrays are lists of the following elements - * this provides the size of on element - * this list is indexed by the list type - */ -static unsigned long obj_struct_sizes[] = { - sizeof(ddElementRef), - sizeof(ddHalfSpace), - sizeof(ddPickPath), - sizeof(ddRendererPtr), - sizeof(diWKSHandle), - sizeof(diNSHandle), - sizeof(diStructHandle), - sizeof(ddDeviceRect), - sizeof(ddULONG), - sizeof(ddUSHORT), - sizeof(ddPointer) -}; - -/* sizes of chunks that arrays in the lists are allocated and grow in - * are specified here - * separate sizes are defined for each obj type so allocations - * for the arrays can be tuned individually - * this list is indexed by the list type - */ -/* here is my philosophy for setting these sizes. This is based on my - * uneducated ideas of what the clients may do, not on any real - * evaluation of what happens. - * element ref: used for current path in the renderer. Could be a long - * list if the (client) structure network is large - * half space: for model clip volume. I'm not sure how this will be - * used, so I'll leave it kind of small - maybe the clients - * don't know how to use it either (boo, hiss, bad assumption) - * pick path: for the initial pick path. Could be large for large structure - * network - * renderer pointer: used by PC, LUT, NS for lists of renderers which - * reference them. I don't expect any one of these resources to be - * shared by many renderers, so this is very small. - * wks handle: used by LUT, NS, Structures for cross-reference list. - * Since structure networks could be large and a single structre - * may be indirectly posted to a workstation multiple times, - * this is largish. - * name set handle: I don't remember - * structure handle: used by other structures for ancestors and descendants - * lists (a.k.a. parents & children). Since this only keeps - * track one level above or below the structure, it probably won't - * get very large, but it will probably have several entries. - * device rect: for the clip list. I think this is used for window - * clipping (?), so it may get large. - * index: is used for list state in the pc. 10 lights is a lot - * list of list: used for doing list of pick path for PickAll - * You can adjust these any way you'd like. Maybe you want them all to be - * built in small chunks so not so much (possibly unused) memory is - * laying around and are willing to take the performance hit whenever - * the array needs to be reallocated. - */ - -static unsigned long obj_array_sizes[] = { - 50, /* element ref */ - 10, /* half space */ - 50, /* pick path */ - 5, /* renderer pointer */ - 30, /* wks handle */ - 10, /* name set handle */ - 20, /* structure handle */ - 30, /* device rect */ - 10, /* name */ - 10, /* index */ - 50 /* list of list */ -}; - -#define PU_CHECK_LIST( plist ) if (!plist) return( PU_BAD_LIST ) - -/* - * XXX - calls FatalError if passed a pList which has had the objects - * allocated right after the header - */ - -#define PU_GROW_LIST( plist, atleast ) \ -{ \ - register int newmax; \ - ddPointer pList; \ - \ - newmax = obj_array_sizes[(int)(plist->type)] + plist->maxObj; \ - if (newmax < (atleast)) \ - newmax = (atleast); \ - if (plist->pList == (ddPointer) (plist + 1)) \ - FatalError("PU_GROW_LIST passed a pList which has had the objects"\ - "allocated right after the header"); \ - pList = (ddPointer)xrealloc( (pointer)(plist->pList), \ - (unsigned long)(newmax * obj_struct_sizes[(int)(plist->type)] )); \ - if (!pList ) return( BadAlloc ); \ - \ - plist->maxObj = (ddLONG)newmax; \ - plist->pList = pList; \ -} - -#define PU_ELREF_COMPARE( p1, p2 ) \ - ( (p1)->structure == (p2)->structure ) && \ - ( (p1)->offset == (p2)->offset ) - -#define PU_SPACE_COMPARE( p1, p2 ) \ - ( (p1)->point.x == (p2)->point.x ) && \ - ( (p1)->point.y == (p2)->point.y ) && \ - ( (p1)->point.z == (p2)->point.z ) && \ - ( (p1)->vector.x == (p2)->vector.x ) && \ - ( (p1)->vector.y == (p2)->vector.y ) && \ - ( (p1)->vector.z == (p2)->vector.z ) - -#define PU_PATH_COMPARE( p1, p2 ) \ - ( (p1)->structure == (p2)->structure ) && \ - ( (p1)->offset == (p2)->offset ) && \ - ( (p1)->pickid == (p2)->pickid ) - -#define PU_HANDLE_COMPARE( p1, p2 ) \ - ( *(p1) == *(p2) ) - -#define PU_RECT_COMPARE( p1, p2 ) \ - ( (p1)->xmin == (p2)->xmin ) && \ - ( (p1)->xmax == (p2)->xmax ) && \ - ( (p1)->ymin == (p2)->ymin ) && \ - ( (p1)->ymax == (p2)->ymax ) - -#define PU_NAME_COMPARE( p1, p2 ) \ - ( *(p1) == *(p2) ) - -#define PU_INDEX_COMPARE( p1, p2 ) \ - ( *(p1) == *(p2) ) - -#define PU_LIST_COMPARE( p1, p2 ) \ - ( *(p1) == *(p2) ) - -/* - Returns the number of bytes needed to create a list of this type - */ -int -puCountList( type, at_least_num ) -ddListType type; -int at_least_num; -{ - return(sizeof(listofObj) + at_least_num * obj_struct_sizes[(int)type] ); -} /* puCountList */ - -/* - Initializes fields in listofObj - */ -void -puInitList( pList, type, maxEntries) -listofObj *pList; -ddListType type; -ddULONG maxEntries; -{ - pList->type = type; - pList->numObj = 0; - pList->maxObj = maxEntries; - if (maxEntries == 0) pList->pList = 0; - else pList->pList = (ddPointer)(pList + 1); /* allocated in one chunk */ - -} - -listofObj * -puCreateList( type ) -ddListType type; -{ - listofObj *pList; - - /* allocate in two chunks */ - pList = (listofObj *)xalloc( sizeof(listofObj) ); - if ( !pList ) return NULL; - - pList->type = type; - pList->numObj = 0; - pList->maxObj = obj_array_sizes[(int)type]; - - if (!pList->maxObj) - pList->pList = (ddPointer) NULL; - else - pList->pList = (ddPointer) xalloc (pList->maxObj * obj_struct_sizes[(int)type]); - - if (!pList->pList) - { - xfree (pList); - return NULL; - } - - return( pList ); -} /* puCreateList */ - -void -puDeleteList( pList ) -listofObj *pList; -{ - if ( pList ) - { - if (pList->pList && pList->pList != (ddPointer) (pList + 1)) - xfree ((pointer) pList->pList); - xfree( (pointer)pList ); - } - return; -} /* puDeleteList */ - -/* notice that this macro depends on i, plist, pi, and pl being defined */ -#define PU_COMPARE_LOOP( compare_macro ) \ - for ( i=0; inumObj; i++, pl++ ) \ - if ( compare_macro ) \ - return( PU_TRUE ) - -/* see if an item is in the list. return TRUE if it is, else return FALSE - */ -short -puInList( pitem, plist ) - ddPointer pitem; - listofObj *plist; -{ - register int i; - - if (!plist) return( PU_FALSE ); - if (!plist->numObj) return(PU_FALSE); - - switch ( plist->type ) - { - case DD_ELEMENT_REF: - { - ddElementRef *pi = (ddElementRef *)pitem; - ddElementRef *pl = (ddElementRef *)plist->pList; - - PU_COMPARE_LOOP( PU_ELREF_COMPARE( pi, pl ) ); - } - break; - - case DD_HALF_SPACE: - { - ddHalfSpace *pi = (ddHalfSpace *)pitem; - ddHalfSpace *pl = (ddHalfSpace *)plist->pList; - - PU_COMPARE_LOOP( PU_SPACE_COMPARE( pi, pl ) ); - } - break; - - case DD_PICK_PATH: - { - ddPickPath *pi = (ddPickPath *)pitem; - ddPickPath *pl = (ddPickPath *)plist->pList; - - PU_COMPARE_LOOP( PU_PATH_COMPARE( pi, pl ) ); - } - break; - - case DD_RENDERER: - case DD_WKS: - case DD_NS: - case DD_STRUCT: - { - ddPointer *pi = (ddPointer *)pitem; - ddPointer *pl = (ddPointer *)plist->pList; - - PU_COMPARE_LOOP( PU_HANDLE_COMPARE( pi, pl ) ); - } - break; - - case DD_DEVICE_RECT: - { - ddDeviceRect *pi = (ddDeviceRect *)pitem; - ddDeviceRect *pl = (ddDeviceRect *)plist->pList; - - PU_COMPARE_LOOP( PU_RECT_COMPARE( pi, pl ) ); - } - break; - - case DD_NAME: - { - ddULONG *pi = (ddULONG *)pitem; - ddULONG *pl = (ddULONG *)plist->pList; - - PU_COMPARE_LOOP( PU_NAME_COMPARE( pi, pl ) ); - } - break; - - case DD_INDEX: - { - ddUSHORT *pi = (ddUSHORT *)pitem; - ddUSHORT *pl = (ddUSHORT *)plist->pList; - - PU_COMPARE_LOOP( PU_INDEX_COMPARE( pi, pl ) ); - } - break; - - case DD_LIST_OF_LIST: - { - listofObj **pi = (listofObj **)pitem; - listofObj **pl = (listofObj **)plist->pList; - - PU_COMPARE_LOOP( PU_LIST_COMPARE( pi, pl ) ); - } - break; - - default: - return( PU_FALSE ); - } - - return( PU_FALSE ); -} /* puInList */ - -/* add numItems items to the end of the list. - * duplicates the item if it's already in the list - * returns Success (0) if successful - * returns BadAlloc error if not - */ -short -puAddToList( pitem, numItems, plist ) - ddPointer pitem; - ddULONG numItems; - listofObj *plist; -{ - ddPointer pi2; - - PU_CHECK_LIST( plist ); - - if ( !numItems ) - return( Success ); - - /* macro returns error if can't allocate space */ - if ( plist->numObj + numItems > plist->maxObj ) - PU_GROW_LIST( plist, plist->numObj + numItems ); - - pi2 = &(plist->pList[ obj_struct_sizes[(int)(plist->type)] * plist->numObj ]); - /* JSH - assuming copy may overlap */ - memmove( (char *)pi2, (char *)pitem, (int)(numItems * obj_struct_sizes[(int)(plist->type)]) ); - - plist->numObj += numItems; - - return( Success ); -} /* puAddToList */ - -/* notice that this macro depends on vars i, numObj, pi, and pl to be defined */ -#define PU_REMOVE_LOOP( compare_macro ) \ - for ( i=0; inumObj--; \ - } \ - } - -/* to remove the last element */ -#define PU_REMOVE_LAST_ELEMENT( plist ) \ - (plist)->numObj-- - -/* removes first occurence of pitem found in list */ -short -puRemoveFromList( pitem, plist ) - ddPointer pitem; - listofObj *plist; -{ - register unsigned long i; - register unsigned long numObj = plist->numObj; - - PU_CHECK_LIST( plist ); - - if ( !numObj ) - return( Success ); - - switch ( plist->type ) - { - case DD_ELEMENT_REF: - { - ddElementRef *pi = (ddElementRef *)pitem; - ddElementRef *pl = (ddElementRef *)plist->pList; - - PU_REMOVE_LOOP( PU_ELREF_COMPARE( pi, pl ) ); - - } - break; - - case DD_HALF_SPACE: - { - ddHalfSpace *pi = (ddHalfSpace *)pitem; - ddHalfSpace *pl = (ddHalfSpace *)plist->pList; - - PU_REMOVE_LOOP( PU_SPACE_COMPARE( pi, pl ) ); - } - break; - - case DD_PICK_PATH: - { - ddPickPath *pi = (ddPickPath *)pitem; - ddPickPath *pl = (ddPickPath *)plist->pList; - - PU_REMOVE_LOOP( PU_PATH_COMPARE( pi, pl ) ); - } - break; - - case DD_RENDERER: - case DD_WKS: - case DD_NS: - case DD_STRUCT: - { - ddPointer *pi = (ddPointer *)pitem; - ddPointer *pl = (ddPointer *)plist->pList; - PU_REMOVE_LOOP( PU_HANDLE_COMPARE( pi, pl ) ); - } - break; - - case DD_DEVICE_RECT: - { - ddDeviceRect *pi = (ddDeviceRect *)pitem; - ddDeviceRect *pl = (ddDeviceRect *)plist->pList; - - PU_REMOVE_LOOP( PU_RECT_COMPARE( pi, pl ) ); - } - break; - - case DD_NAME: - { - ddULONG *pi = (ddULONG *)pitem; - ddULONG *pl = (ddULONG *)plist->pList; - - PU_REMOVE_LOOP( PU_NAME_COMPARE( pi, pl ) ); - } - break; - - case DD_INDEX: - { - ddUSHORT *pi = (ddUSHORT *)pitem; - ddUSHORT *pl = (ddUSHORT *)plist->pList; - - PU_REMOVE_LOOP( PU_INDEX_COMPARE( pi, pl ) ); - } - break; - - case DD_LIST_OF_LIST: - { - listofObj **pi = (listofObj **)pitem; - listofObj **pl = (listofObj **)plist->pList; - - PU_REMOVE_LOOP( PU_LIST_COMPARE( pi, pl ) ); - - } - break; - - default: - return( PU_BAD_LIST ); - } - - return( Success ); -} /* puRemoveFromList */ - -/* this macro assumes that pldest has enough memory */ -/* JSH - assuming copy may overlap */ -#define PU_COPY_LIST_ELEMENTS( plsrc, pldest, bytes ) \ - memmove( (char *)(pldest), (char *)(plsrc), (int)(bytes) ) - -short -puCopyList( psrc, pdest ) - listofObj *psrc; - listofObj *pdest; -{ - /* both lists must exist */ - if ( !psrc || !pdest ) - return( PU_BAD_LIST ); - - /* and must be the same type */ - if ( !(psrc->type == pdest->type) ) - return( PU_BAD_LIST ); - - if ( !psrc->numObj ) - { - pdest->numObj = 0; - return( Success ); - } - - if ( psrc->numObj > pdest->maxObj ) - PU_GROW_LIST( pdest , psrc->numObj ); - - PU_COPY_LIST_ELEMENTS( psrc->pList, pdest->pList, - obj_struct_sizes[(int)(psrc->type)] * psrc->numObj ); - - pdest->numObj = psrc->numObj; - - return( Success ); -} /* puCopyList */ - - -/* merges two lists into one list without duplicates */ -short -puMergeLists( psrc1, psrc2, pdest ) - listofObj *psrc1; - listofObj *psrc2; - listofObj *pdest; -{ - register int i,si; - ddPointer pi; - listofObj *ptemp; - - if ((pdest==psrc1 && psrc1->numObj) || - (pdest==psrc2 && psrc2->numObj)) - { - ptemp = puCreateList( psrc1->type ); - if (!ptemp) - return(BadAlloc); - } - else - ptemp = pdest; - - /* all lists must exist */ - if ( !psrc1 || !psrc2 || !ptemp ) - return( PU_BAD_LIST ); - - /* and must be the same type */ - if ( !((psrc1->type == psrc2->type) && (psrc2->type == ptemp->type)) ) - return( PU_BAD_LIST ); - - /* just for kicks, let's make sure the destination list is empty */ - ptemp->numObj = 0; - - /* put the first list into the destination */ - if ( psrc1->numObj ) - { - pi = psrc1->pList; - si = obj_struct_sizes[(int)(psrc1->type)]; - for ( i=0; inumObj; i++, pi+=si ) - /* if the item is not already in the list , add it */ - if ( !puInList( pi, ptemp ) ) - if ( puAddToList( pi, (ddULONG)1, ptemp ) ) - return( BadAlloc ); - } - - /* now for the second list */ - if ( psrc2->numObj ) - { - pi = psrc2->pList; - si = obj_struct_sizes[(int)(psrc2->type)]; - for ( i=0; inumObj; i++, pi+=si ) - /* if the item is not already in the list , add it */ - if ( !puInList( pi, ptemp ) ) - if ( puAddToList( pi, (ddULONG)1, ptemp ) ) - return( BadAlloc ); - } - - if (ptemp != pdest) - { - if ( puCopyList( ptemp, pdest ) != Success ) - return(BadAlloc); - puDeleteList( ptemp ); - } - return( Success ); -} /* puMergeLists */ - -#ifdef DDTEST -short -printlist( plist ) - listofObj *plist; -{ - register int i; - - PU_CHECK_LIST( plist ); - - ErrorF("\nLIST type: %d, size: %d, num: %d", - plist->type, plist->maxObj, plist->numObj ); - - switch ( plist->type ) - { - case DD_ELEMENT_REF: - { - ddElementRef *pl=(ddElementRef *)plist->pList; - - ErrorF(" ELEMENT REF\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("structure: %d offset: %d\n", - pl->structure, pl->offset ); - } - break; - - case DD_HALF_SPACE: - { - ddHalfSpace *pl=(ddHalfSpace *)plist->pList; - - ErrorF(" HALF SPACE\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("point: %f %f %f vector: %f %f %f\n", - pl->point.x, pl->point.y, pl->point.z, - pl->vector.x, pl->vector.y, pl->vector.z); - } - break; - - case DD_PICK_PATH: - { - ddPickPath *pl=(ddPickPath *)plist->pList; - - ErrorF(" PICK PATH\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("structure: %d offset: %d pick id: %d\n", - pl->structure, pl->offset, pl->pickid ); - } - break; - - case DD_RENDERER: - case DD_WKS: - case DD_NS: - case DD_STRUCT: - { - ddPointer *pl=(ddPointer *)plist->pList; - - ErrorF(" HANDLE\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("handle: %d \n", *pl); - } - break; - - case DD_DEVICE_RECT: - { - ddDeviceRect *pl=(ddDeviceRect *)plist->pList; - - ErrorF(" DEVICE RECT\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("xmin: %d xmax: %d ymin: %d ymax: %d\n", - pl->xmin, pl->xmax, pl->ymin, pl->ymax ); - } - break; - - case DD_NAME: - { - ddULONG *pl=(ddULONG *)plist->pList; - - ErrorF(" NAME\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("name: %d \n", *pl); - } - break; - - case DD_INDEX: - { - ddUSHORT *pl=(ddUSHORT *)plist->pList; - - ErrorF(" INDEX\n"); - for ( i=0; inumObj; i++, pl++ ) - ErrorF("index: %d \n", *pl); - } - break; - - default: - return( PU_BAD_LIST ); - } -} /* printlist */ -#endif - Index: xc/programs/Xserver/PEX5/dipex/objects/Imakefile diff -u xc/programs/Xserver/PEX5/dipex/objects/Imakefile:3.16 xc/programs/Xserver/PEX5/dipex/objects/Imakefile:removed --- xc/programs/Xserver/PEX5/dipex/objects/Imakefile:3.16 Wed Jan 17 17:12:37 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/Imakefile Sat Feb 28 21:41:55 2004 @@ -1,74 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:13 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/dipex/objects/Imakefile,v 3.16 2001/01/17 22:12:37 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PassCDebugFlags -#define PassCDebugFlags -#endif - -#ifndef PexDipexCDebugFlags -#define PexDipexCDebugFlags ServerCDebugFlags -#endif - - CDEBUGFLAGS = PexDipexCDebugFlags - DEFINES = PexDipexDefines - LINTLIBS = ../../../dix/llib-ldix.ln \ - ../../../os/llib-los.ln \ - ../../ddpex/mi/level4/llib-ldp4.ln \ - ../../ddpex/mi/shared/llib-ldps.ln - - - PEXSRVINC = ../../include - INCLUDES = -I. -I$(PEXSRVINC) -I$(XINCLUDESRC) -I$(SERVERSRC)/include - - -SRCS = pexRndr.c pexFont.c pexLut.c pexNs.c pexStr.c \ - pexPhigs.c pexInfo.c pexSc.c pexPick.c pexPc.c pexRndrPick.c -XCOMM pexTM.c pexAccBuf.c - -OBJS = pexRndr.o pexFont.o pexLut.o pexNs.o pexStr.o \ - pexPhigs.o pexInfo.o pexSc.o pexPick.o pexPc.o pexRndrPick.o -XCOMM pexTM.o pexAccBuf.o - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(diobpex,$(OBJS)) - -LintLibraryTarget(obj,$(SRCS)) -NormalLintTarget($(SRCS)) - -#ifdef HPArchitecture -SpecialCObjectRule(hpext, $(IRULESRC)/$(MACROFILE), $(EXT_DEFINES)) -#endif - -DependTarget() Index: xc/programs/Xserver/PEX5/dipex/objects/pexAccBuf.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexAccBuf.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexAccBuf.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexAccBuf.c:3.8 Fri Dec 14 14:57:42 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexAccBuf.c Sat Feb 28 21:41:55 2004 @@ -1,142 +0,0 @@ -/* $Xorg: pexAccBuf.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -*/ - - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pexLookup.h" - - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - - - -/*++ PEXAccumulateBuffer - --*/ -ErrorCode -PEXAccumulateBuffer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexAccumulateBufferReq *strmPtr; -{ - ErrorCode err = Success; - - CHECK_FP_FORMAT (strmPtr->fpFormat); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - - err = AccumulateBuffer(prend->pDrawable, strmPtr->src_weight, - strmPtr->dst_weight); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXAccumulateBuffer() */ - -/*++ PEXAllocAccumBuffer - --*/ -ErrorCode -PEXAllocAccumBuffer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexAllocAccumBufferReq *strmPtr; -{ - ErrorCode err = Success; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - - err = AllocAccumBuffer(prend->pDrawable ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXAllocAccumBuffer() */ - -/*++ PEXFreeAccumBuffer - --*/ -ErrorCode -PEXFreeAccumBuffer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreeAccumBufferReq *strmPtr; -{ - ErrorCode err = Success; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - - err = FreeAccumBuffer(prend->pDrawable ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXFreeAccumBuffer() */ - -/*++ PEXLoadAccumBuffer - --*/ -ErrorCode -PEXLoadAccumBuffer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexLoadAccumBufferReq *strmPtr; -{ - ErrorCode err = Success; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - - err = LoadAccumBuffer(prend->pDrawable ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXLoadAccumBuffer() */ - -/*++ PEXReturnAccumBuffer - --*/ -ErrorCode -PEXReturnAccumBuffer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexReturnAccumBufferReq *strmPtr; -{ - ErrorCode err = Success; - - CHECK_FP_FORMAT (strmPtr->fpFormat); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - - err = ReturnAccumBuffer(prend->pDrawable, strmPtr->scale); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXReturnAccumBuffer() */ - -/*++ - * - * End of File - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexFont.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexFont.c:3.9 xc/programs/Xserver/PEX5/dipex/objects/pexFont.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexFont.c:3.9 Fri Dec 14 14:57:43 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexFont.c Sat Feb 28 21:41:55 2004 @@ -1,301 +0,0 @@ -/* $Xorg: pexFont.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexFont.c,v 3.9 2001/12/14 19:57:43 dawes Exp $ */ - - -/*++ pexFont.c - * PEXOpenFont - * PEXCloseFont - * PEXQueryFont - * PEXListFonts - * PEXListFontsWithInfo - * PEXQueryTextExtents - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "dipex.h" -#include "pexLookup.h" -#define NEED_OS_LIMITS -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -static dipexFont *FindPEXFontEntry(); - -/*++ PEXOpenFont - * - * DESCRIPTION: - * - * This request loads the specified PEX font, if necessary, and associates - * identifier f_id with it. The font name should use the ISO Latin-1 encoding, - * and upper/lower case does not matter. PEXfonts are not associated with a - * particular screen, and can be used with any renderer or PHIGS workstation - * resources. - --*/ -ErrorCode -PEXOpenFont (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexOpenFontReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode FreePEXFont (); - unsigned char fName[PATH_MAX]; - dipexFont *dif; - extern void CopyISOLatin1Lowered(); - - /* oh, who cares if it's already been opened under this id */ - if (!LegalNewID(strmPtr->font, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->font,cntxtPtr); - - if (strmPtr->numBytes > PATH_MAX - 1) - PEX_ERR_EXIT(BadLength,0,cntxtPtr); - - /* has this server already loaded this font */ - CopyISOLatin1Lowered( fName, (unsigned char *)(strmPtr+1), - (int)(strmPtr->numBytes)); - - dif = FindPEXFontEntry(fName); - - if (dif) { - if (dif->refcnt > 0) { - dif->refcnt += 1; } - } else { - - dif = (dipexFont *) xalloc ((unsigned long)sizeof(dipexFont)); - if (!dif) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - dif->ddFont.id = strmPtr->font; - dif->refcnt = 1; - - err = OpenPEXFont( (ddULONG)(strmPtr->numBytes), - (ddUCHAR *)(strmPtr + 1), &(dif->ddFont)); - if (err) { - xfree((pointer)dif); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - /* - * Note that fonts resources are stored with the type (dipexFont *), - * and they are referenced sometimes in the DD layer as diFontHandle - * (which is a pointer to a ddFontResource). Since the first part - * of the dipexFont structure consists of a ddFontResource, this - * works. Even though it is ugly, it's best not to start changing - * all of the font code at this time (right before a public release), - * and hopefully, it will get cleaned up for PEX 6.0. - */ - - ADDRESOURCE(strmPtr->font, PEXFontType, dif); - - } - - return(err); - -} /* end-PEXOpenFont() */ - -static dipexFont * -FindPEXFontEntry(fname) -unsigned char *fname; -{ - return (0); /* stub */ -} - -/*++ PEXCloseFont - --*/ -ErrorCode -PEXCloseFont (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCloseFontReq *strmPtr; -{ - ErrorCode err = Success; - diFontHandle pf = 0; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXFontError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_PEXFONT(strmPtr->id, pf); - - FreeResource(strmPtr->id, RT_NONE); - - return(err); - -} /* end-PEXCloseFont() */ - -/*++ PEXQueryFont - --*/ -ErrorCode -PEXQueryFont( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexQueryFontReq *strmPtr; -{ - ErrorCode err = Success; - diFontHandle pf = 0; - extern ddBuffer *pPEXBuffer; - - LU_PEXFONT(strmPtr->font, pf); - - SETUP_INQ(pexQueryFontReply); - - err = QueryPEXFont (pf, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexQueryFontReply); - reply->lengthFontInfo = pPEXBuffer->dataSize; - WritePEXBufferReply(pexQueryFontReply); - } - return( err ); - -} /* end-PEXQueryFont() */ - -/*++ PEXListFonts - --*/ -ErrorCode -PEXListFonts( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexListFontsReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBuffer *pPEXBuffer; - CARD32 numStrings; - - SETUP_INQ(pexListFontsReply); - - err = ListPEXFonts( strmPtr->numChars, (CARD8 *)(strmPtr+1), - strmPtr->maxNames, &numStrings, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexListFontsReply); - reply->numStrings = numStrings; - WritePEXBufferReply(pexListFontsReply); - } - return( err ); - -} /* end-PEXListFonts() */ - -/*++ PEXListFontsWithInfo - --*/ -ErrorCode -PEXListFontsWithInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexListFontsWithInfoReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBuffer *pPEXBuffer; - CARD32 numStrings; - - SETUP_INQ(pexListFontsWithInfoReply); - - err = ListPEXFontsPlus( strmPtr->numChars, (CARD8 *)(strmPtr+1), - strmPtr->maxNames, &numStrings, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexListFontsWithInfoReply); - reply->numStrings = numStrings; - WritePEXBufferReply(pexListFontsWithInfoReply); - } - return( err ); - -} /* end-PEXListFontsWithInfo() */ - -/*++ PEXQueryTextExtents - --*/ -ErrorCode -PEXQueryTextExtents( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexQueryTextExtentsReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBuffer *pPEXBuffer; - diResourceHandle ptr; - ddResourceType what; - - if (! (ptr = (diResourceHandle) LookupIDByType (strmPtr->id, PEXLutType))) - if (! (ptr = (diResourceHandle) LookupIDByType (strmPtr->id, PEXWksType))) - if (! (ptr = (diResourceHandle) LookupIDByType (strmPtr->id, PEXRendType))) - PEX_ERR_EXIT(BadValue,strmPtr->id,cntxtPtr) - else what = RENDERER_RESOURCE; - else what = WORKSTATION_RESOURCE; - else { - what = LOOKUP_TABLE_RESOURCE; - if (((ddLUTResource *)ptr)->lutType != PEXTextFontLUT) { - PEX_ERR_EXIT(BadMatch,strmPtr->id,cntxtPtr); - } - } - - SETUP_INQ(pexQueryTextExtentsReply); - - err = QueryPEXTextExtents( ptr, what, strmPtr->fontGroupIndex, - strmPtr->textPath, strmPtr->charExpansion, - strmPtr->charSpacing, strmPtr->charHeight, - &(strmPtr->textAlignment), strmPtr->numStrings, - (ddPointer)(strmPtr + 1), pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexQueryTextExtentsReply); - WritePEXBufferReply(pexQueryTextExtentsReply); - } - return( err ); - -} /* end-PEXQueryTextExtents() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c:1.9 xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c:1.9 Fri Dec 14 14:57:43 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c Sat Feb 28 21:41:55 2004 @@ -1,282 +0,0 @@ -/* $Xorg: pexInfo.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexInfo.c,v 1.9 2001/12/14 19:57:43 dawes Exp $ */ - - -/*++ pexInfo.c - * - * Contents: PEXGetExtensionInfo - * PEXGetEnumeratedTypeInfo - * PEXGetImpDepConstants - * PEXMatchRendererTargets - * PEXEscape - * PEXEscapeWithReply - * - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pex_site.h" -#include "PEX.h" -#include "dipex.h" -#include "pexError.h" -#include "pexLookup.h" -#include "pexExtract.h" -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - -/*++ PEXGetExtensionInfo - * - * The client_protocol_major_version and the - * client_protocol_minor_version indicate what - * version of the protocol the client expects the - * server to implement. - --*/ - -ErrorCode -PEXGetExtensionInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetExtensionInfoReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBuffer *pPEXBuffer; - pexGetExtensionInfoReply *reply = - (pexGetExtensionInfoReply *)pPEXBuffer->pHead; - - reply->majorVersion = PEX_PROTO_MAJOR; - reply->minorVersion = PEX_PROTO_MINOR; - reply->release = PEX_RELEASE_NUMBER; - reply->lengthName = strlen(PEX_VENDOR); - reply->length = LWORDS(reply->lengthName); - reply->subsetInfo = PEX_SUBSET; - memcpy( (char *)(reply+1), PEX_VENDOR, (int)(reply->lengthName)); - - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof(pexGetExtensionInfoReply) + reply->lengthName, - reply); - - return( err ); - -} /* end-PEXGetExtensionInfo() */ - -/*++ PEXGetEnumeratedTypeInfo - --*/ - -ErrorCode -PEXGetEnumeratedTypeInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetEnumeratedTypeInfoReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr d; - extern ddBuffer *pPEXBuffer; - ddULONG numLists; - - LU_DRAWABLE (strmPtr->drawable, d); - - SETUP_INQ(pexGetEnumeratedTypeInfoReply); - - err = InquireEnumTypeInfo( d, strmPtr->itemMask, strmPtr->numEnums, - (ddUSHORT *)(strmPtr+1), &numLists, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetEnumeratedTypeInfoReply); - reply->numLists = numLists; - WritePEXBufferReply(pexGetEnumeratedTypeInfoReply); - } - return( err ); - -} /* end-PEXGetEnumeratedTypeInfo() */ - -/*++ PEXGetImpDepConstants - --*/ - -ErrorCode -PEXGetImpDepConstants( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetImpDepConstantsReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr d; - extern ddBuffer *pPEXBuffer; - - LU_DRAWABLE (strmPtr->drawable, d); - - SETUP_INQ(pexGetImpDepConstantsReply); - - err = InquireImpDepConstants( d, strmPtr->numNames, - (ddUSHORT *)(strmPtr+1), pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetImpDepConstantsReply); - WritePEXBufferReply(pexGetImpDepConstantsReply); - } - return( err ); - -} /* end-PEXGetImpDepConstants() */ - -ErrorCode -PEXMatchRendererTargets( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexMatchRendererTargetsReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr d; - extern ddBuffer *pPEXBuffer; - - LU_DRAWABLE (strmPtr->drawable, d); - - /* no way to check visualID besides doing the work of Match */ - - SETUP_INQ(pexMatchRendererTargetsReply); - - err = MatchRendererTargets(d, (int)strmPtr->depth, (int)strmPtr->type, - (VisualID)strmPtr->visualID, - (int)strmPtr->maxTriplets, pPEXBuffer ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexMatchRendererTargetsReply); - WritePEXBufferReply(pexMatchRendererTargetsReply); - } - return( err ); - -} /* end-PEXMatchRendererTargets() */ - -ErrorCode -PEXQueryColorApprox( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexQueryColorApproxReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr d; - extern ddBuffer *pPEXBuffer; - - LU_DRAWABLE (strmPtr->drawable, d); - - SETUP_INQ(pexQueryColorApproxReply); - - /* - Call to query color approximation routine goes here - */ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexQueryColorApproxReply); - WritePEXBufferReply(pexQueryColorApproxReply); - } - return( err ); - -} /* end-PEXQueryColorApprox() */ - - -ErrorCode -PEXEscape( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEscapeReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - pexEscapeSetEchoColourData *ptr; - CARD8 *pcs; - - - /* Support the one Registered Escape, Set Echo Color */ - switch (strmPtr->escapeID) { - case PEXEscapeSetEchoColour: { - ptr = (pexEscapeSetEchoColourData *)(strmPtr + 1); - pcs = (CARD8 *)(ptr+1); - - LU_RENDERER(ptr->rdr, prend); - EXTRACT_COLOUR_SPECIFIER(prend->echoColour,pcs); - break; - } - - default: - err = BadValue; - break; - } - - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXEscape() */ - - -ErrorCode -PEXEscapeWithReply( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEscapeWithReplyReq *strmPtr; -{ - ErrorCode err = Success; - - /* Do nothing here, Escape with Reply is not implemented in SI - */ - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXEscapeWithReply() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexLut.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexLut.c:3.9 xc/programs/Xserver/PEX5/dipex/objects/pexLut.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexLut.c:3.9 Fri Dec 14 14:57:43 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexLut.c Sat Feb 28 21:41:55 2004 @@ -1,504 +0,0 @@ -/* $Xorg: pexLut.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexLut.c,v 3.9 2001/12/14 19:57:43 dawes Exp $ */ - - -/*++ - * PEXCreateLookupTable - * PEXCopyLookupTable - * PEXFreeLookupTable - * PEXGetTableInfo - * PEXGetPredefinedEntries - * PEXGetDefinedIndices - * PEXGetTableEntry - * PEXGetTableEntries - * PEXSetTableEntries - * PEXDeleteTableEntries - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pex_site.h" -#include "pexLookup.h" -#include "pexos.h" - - -#define VALID_TABLETYPE(type) ((type > 0) && (type <= PEXMaxTableType)) - - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - - -/*++ PEXCreateLookupTable - --*/ -ErrorCode -PEXCreateLookupTable (cntxtPtr, strmPtr) -pexContext *cntxtPtr; /* context pointer */ -pexCreateLookupTableReq *strmPtr; /* stream pointer */ -{ - ErrorCode freeLUT (); - ErrorCode err = Success; - DrawablePtr pdraw = 0; - diLUTHandle lutptr = 0; - - if (!VALID_TABLETYPE(strmPtr->tableType)) - PEX_ERR_EXIT(BadValue,strmPtr->tableType,cntxtPtr); - - if (!LegalNewID(strmPtr->lut, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->lut,cntxtPtr); - - LU_DRAWABLE(strmPtr->drawableExample, pdraw); - - lutptr = (diLUTHandle) xalloc ((unsigned long)sizeof(ddLUTResource)); - if (!lutptr) PEX_ERR_EXIT (BadAlloc,0,cntxtPtr); - lutptr->id = strmPtr->lut; - lutptr->lutType = strmPtr->tableType; - - err = CreateLUT( pdraw, lutptr); - if (err) { - xfree((pointer)lutptr); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - ADDRESOURCE (strmPtr->lut, PEXLutType, lutptr); - - return( err ); - -} /* end-PEXCreateLookupTable() */ - -/*++ PEXCopyLookupTable - --*/ -ErrorCode -PEXCopyLookupTable (cntxtPtr, strmPtr) -pexContext *cntxtPtr; /* Context Pointer */ -pexCopyLookupTableReq *strmPtr; /* Stream Pointer */ -{ - diLUTHandle lsrc, ldest; - ErrorCode err = Success; - - LU_TABLE(strmPtr->src, lsrc); - LU_TABLE(strmPtr->dst, ldest); - - err = CopyLUT (lsrc, ldest); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return (err); - -} /* end-PEXCopyLookupTable() */ - -/*++ PEXFreeLookupTable - --*/ -ErrorCode -PEXFreeLookupTable (cntxtPtr, strmPtr) -pexContext *cntxtPtr; /* Context Pointer */ -pexFreeLookupTableReq *strmPtr; /* Stream Pointer */ -{ - ErrorCode err = Success; - diLUTHandle l = 0; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXLookupTableError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_TABLE(strmPtr->id, l); - - FreeResource(strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreeLookupTable() */ - -/*++ PEXGetTableInfoReq - --*/ - -ErrorCode -PEXGetTableInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetTableInfoReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr pdraw; - extern ddBufferPtr pPEXBuffer; - pexGetTableInfoReply *reply = (pexGetTableInfoReply *)(pPEXBuffer->pHead); - - if (!VALID_TABLETYPE(strmPtr->tableType)) - PEX_ERR_EXIT(BadValue,strmPtr->tableType,cntxtPtr); - - LU_DRAWABLE(strmPtr->drawableExample, pdraw); - - SETUP_INQ(pexGetTableInfoReply); - - err = InquireLUTInfo( pdraw, strmPtr->tableType, - (pexTableInfo *)&(reply->definableEntries)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = 0; - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof(pexGetTableInfoReply) + reply->length, - reply); - return( err ); - -} /* end-PEXGetTableInfo() */ - -/*++ PEXGetPredefinedEntries - --*/ - -ErrorCode -PEXGetPredefinedEntries( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetPredefinedEntriesReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBufferPtr pPEXBuffer; - DrawablePtr pdraw = 0; - ddULONG numEntries = (ddULONG)(strmPtr->count); - - if (!VALID_TABLETYPE(strmPtr->tableType)) - PEX_ERR_EXIT(BadValue,strmPtr->tableType,cntxtPtr); - - LU_DRAWABLE(strmPtr->drawableExample, pdraw); - - SETUP_INQ(pexGetPredefinedEntriesReply); - - err = InquireLUTPredEntries( pdraw, strmPtr->tableType, - strmPtr->start, strmPtr->count, - &numEntries, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetPredefinedEntriesReply); - reply->numEntries = numEntries; - WritePEXBufferReply(pexGetPredefinedEntriesReply); - } - return( err ); - -} /* end-PEXGetPredefinedEntries() */ - -/*++ PEXGetDefinedIndices - --*/ - -ErrorCode -PEXGetDefinedIndices( cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetDefinedIndicesReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf; - extern ddBufferPtr pPEXBuffer; - ddULONG numIndices = 0; - - LU_TABLE(strmPtr->id, pf); - - SETUP_INQ(pexGetDefinedIndicesReply); - - err = InquireLUTIndices( pf, &numIndices, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetDefinedIndicesReply); - reply->numIndices = numIndices; - WritePEXBufferReply(pexGetDefinedIndicesReply); - } - return( err ); - -} /* end-PEXGetDefinedIndices() */ - -/*++ PEXGetTableEntry - --*/ - -ErrorCode -PEXGetTableEntry( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetTableEntryReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf; - extern ddBufferPtr pPEXBuffer; - ddUSHORT status; - - LU_TABLE(strmPtr->lut, pf); - - SETUP_INQ(pexGetTableEntryReply); - - err = InquireLUTEntry( pf, strmPtr->index, strmPtr->valueType, - &status, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* - * If this is a font table, we have to convert font handles to font ids. - */ - - if (pf->lutType == PEXTextFontLUT) { - int i; - pexTextFontEntry *ptfe = (pexTextFontEntry *)(pPEXBuffer->pBuf); - pexFont *ptr = (pexFont *)(ptfe + 1); - for (i=0; inumFonts; i++, ptr++) - *ptr = ((diFontHandle) *ptr)->id; - } - - { - SETUP_VAR_REPLY(pexGetTableEntryReply); - reply->status = status; - reply->tableType = pf->lutType; - WritePEXBufferReply(pexGetTableEntryReply); - } - return( err ); - -} /* end-PEXGetTableEntry() */ - -/*++ PEXGetTableEntries - --*/ -ErrorCode -PEXGetTableEntries( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetTableEntriesReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf; - ddULONG numEntries; - extern ddBuffer *pPEXBuffer; - - LU_TABLE(strmPtr->lut, pf); - - SETUP_INQ(pexGetTableEntriesReply); - - err = InquireLUTEntries( pf, strmPtr->start, strmPtr->count, - strmPtr->valueType, &numEntries, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* - * If this is a font table, we have to convert font handles to font ids. - */ - - if (pf->lutType == PEXTextFontLUT) { - int i, j; - pexTextFontEntry *ptfe = (pexTextFontEntry *)(pPEXBuffer->pBuf); - for (i=0; icount; i++) { - pexFont *ptr = (pexFont *)(ptfe + 1); - for (j=0; jnumFonts; j++, ptr++) - *ptr = ((diFontHandle) *ptr)->id; - ptfe = (pexTextFontEntry *) ptr; - } - } - - { - SETUP_VAR_REPLY(pexGetTableEntriesReply); - reply->tableType = pf->lutType; - reply->numEntries = numEntries; - WritePEXBufferReply(pexGetTableEntriesReply); - } - return( err ); - -} /* end-PEXGetTableEntries() */ - -/*++ PEXSetTableEntries - --*/ - -ErrorCode -PEXSetTableEntries( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetTableEntriesReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf = 0; - - LU_TABLE(strmPtr->lut, pf); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - /* - If this is a font table, lookup font id's and stuff pointers into - the that longword, so ddpex gets its handles instead of ids. - */ - if (pf->lutType == PEXTextFontLUT) { - int i, j; - diFontHandle fh; - pexTextFontEntry *ptfe = (pexTextFontEntry *)(strmPtr + 1); - for (i=0; icount; i++) { - pexFont *ptr = (pexFont *)(ptfe + 1); - for (j=0; jnumFonts; j++, ptr++) { - LU_PEXFONT(*ptr, fh); - *ptr = (pexFont) fh; - } - ptfe = (pexTextFontEntry *) ptr; - } - } - - err = SetLUTEntries( pf, strmPtr->start, strmPtr->count, - (ddPointer)(strmPtr + 1)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetTableEntries() */ - -/*++ PEXDeleteTableEntries - --*/ - -ErrorCode -PEXDeleteTableEntries( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexDeleteTableEntriesReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf; - - LU_TABLE(strmPtr->lut, pf); - err = DeleteLUTEntries (pf, strmPtr->start, strmPtr->count); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXDeleteTableEntries() */ - -/*++ PEXChangeTableValues - --*/ -ErrorCode -PEXChangeTableValues (cntxtPtr, strmPtr) -pexContext *cntxtPtr; /* context pointer */ -pexChangeTableValuesReq *strmPtr; /* stream pointer */ -{ - ErrorCode err = Success; - diLUTHandle pf = 0; - - LU_TABLE(strmPtr->lut, pf); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - /* - If this is a font table, lookup font id's and stuff pointers into - the that longword, so ddpex gets its handles instead of ids. - */ - if ( (pf->lutType == PEXTextFontLUT) && - (strmPtr->TableMask == PEXLUTVTextFontGroup) ) - { - int i, j; - diFontHandle fh; - pexTextFontEntry *ptfe = (pexTextFontEntry *)(strmPtr + 1); - pexFont *ptr = (pexFont *)(ptfe + 1); - for (j=0; jnumFonts; j++, ptr++) { - LU_PEXFONT(*ptr, fh); - *ptr = (pexFont) fh; - } - } - - /* call to change table values routine goes here, this is a shell - for this routine but should contain all necessary information - to process the request - - err = ChangeTableValues ( pf, strmPtr->length, strmPtr->index, - strmPtr->TableMask, (ddPointer)(strmPtr + 1)); - */ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangeTableValues() */ - -/*++ PEXGetTableValues - --*/ -ErrorCode -PEXGetTableValues( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetTableValuesReq *strmPtr; -{ - ErrorCode err = Success; - diLUTHandle pf; - ddULONG numValues; - ddUSHORT status; - extern ddBuffer *pPEXBuffer; - - CHECK_FP_FORMAT(strmPtr->fpFormat); - LU_TABLE(strmPtr->lut, pf); - - SETUP_INQ(pexGetTableValuesReply); - - /* Place holder for ddpex interface - err = GetLUTValues( pf, strmPtr->index, strmPtr->TableMask, - strmPtr->valueType, &numValues, &status, pPEXBuffer); - */ - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* - * If this is a font table, we have to convert font handles to font ids. - */ - - if ( (pf->lutType == PEXTextFontLUT) && - (strmPtr->TableMask == PEXLUTVTextFontGroup) ) - { - int i, j; - pexTextFontEntry *ptfe = (pexTextFontEntry *)(pPEXBuffer->pBuf); - pexFont *ptr = (pexFont *)(ptfe + 1); - for (j=0; jnumFonts; j++, ptr++) - *ptr = ((diFontHandle) *ptr)->id; - } - - { - SETUP_VAR_REPLY(pexGetTableValuesReply); - reply->tableType = pf->lutType; - reply->numValues = numValues; - reply->status = status; - WritePEXBufferReply(pexGetTableValuesReply); - } - return( err ); - -} /* end-PEXGetTableValues() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexNs.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexNs.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexNs.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexNs.c:3.8 Fri Dec 14 14:57:43 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexNs.c Sat Feb 28 21:41:55 2004 @@ -1,191 +0,0 @@ -/* $Xorg: pexNs.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexNs.c,v 3.8 2001/12/14 19:57:43 dawes Exp $ */ - - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pexLookup.h" -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - - -/*++ PEXCreateNameSet - --*/ -ErrorCode -PEXCreateNameSet (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateNameSetReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode FreeNameSet (), CreateNameSet (); - diNSHandle nsptr; - - if (!LegalNewID(strmPtr->id, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->id,cntxtPtr); - - - nsptr = (diNSHandle) xalloc ((unsigned long)sizeof(ddNSResource)); - if (!nsptr) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - nsptr->id = strmPtr->id; - err = CreateNameSet(nsptr); - if (err) xfree((pointer)nsptr); - - ADDRESOURCE(strmPtr->id, PEXNameType, nsptr); - - return( err ); - -} /* end-PEXCreateNameSet() */ - -/*++ PEXCopyNameSet - --*/ -ErrorCode -PEXCopyNameSet (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyNameSetReq *strmPtr; -{ - ErrorCode err = Success; - diNSHandle nsrc = 0, ndst = 0; - - LU_NAMESET(strmPtr->src, nsrc); - LU_NAMESET(strmPtr->dst, ndst); - - err = CopyNameSet (nsrc, ndst); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyNameSet() */ - -/*++ PEXFreeNameSet - --*/ -ErrorCode -PEXFreeNameSet (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreeNameSetReq *strmPtr; -{ - ErrorCode err = Success; - diNSHandle pns = 0; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXNameSetError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_NAMESET(strmPtr->id, pns); - - FreeResource(strmPtr->id, RT_NONE); - - return(err); - -} /* end-PEXFreeNameSet() */ - -/*++ PEXGetNameSet - --*/ -ErrorCode -PEXGetNameSet( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetNameSetReq *strmPtr; -{ - ErrorCode err = Success; - diNSHandle pns; - extern ddBufferPtr pPEXBuffer; - CARD32 numNames; - - LU_NAMESET(strmPtr->id, pns); - - SETUP_INQ(pexGetNameSetReply); - - err = InquireNameSet (pns, &numNames, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetNameSetReply); - reply->numNames = numNames; - WritePEXBufferReply(pexGetNameSetReply); - } - return( err ); - -} /* end-PEXGetNameSet() */ - -/*++ PEXChangeNameSet - --*/ -ErrorCode -PEXChangeNameSet( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangeNameSetReq *strmPtr; -{ - ErrorCode err = Success; - diNSHandle pns = 0; - - LU_NAMESET(strmPtr->ns, pns); - - err = ChangeNameSet( pns, strmPtr->action, - (strmPtr->length - (sizeof(pexChangeNameSetReq) - / sizeof(pexNameSet))), - (ddULONG *)(strmPtr + 1)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangeNameSet() */ -/*++ - * - * End of File - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexPc.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexPc.c:3.7 xc/programs/Xserver/PEX5/dipex/objects/pexPc.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexPc.c:3.7 Fri Dec 14 14:57:43 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexPc.c Sat Feb 28 21:41:55 2004 @@ -1,1518 +0,0 @@ -/* $Xorg: pexPc.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexPc.c,v 3.7 2001/12/14 19:57:43 dawes Exp $ */ - - -/*++ - * PEXCreatePipelineContext - * PEXCopyPipelineContext - * PEXFreePipelineContext - * PEXGetPipelineContext - * PEXChangePipelineContext - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "dipex.h" -#include "ddpex.h" -#include "pexLookup.h" -#include "pexExtract.h" -#include "pexUtils.h" -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -/* need to do this to return correct ASF_ENABLES bits per Encoding */ -#define ASF_ALL 0x3FFFFFFF - -#define CHK_PEX_BUF(SIZE,INCR,REPLY,TYPE,PTR) {\ - (SIZE)+=(INCR); \ - if (pPEXBuffer->bufSize < (SIZE)) { \ - ErrorCode err = Success; \ - int offset = (int)(((unsigned char *)(PTR)) - ((unsigned char *)(pPEXBuffer->pHead))); \ - err = puBuffRealloc(pPEXBuffer,(ddULONG)(SIZE)); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); \ - (REPLY) = (TYPE *)(pPEXBuffer->pHead); \ - (PTR) = (unsigned char *)(pPEXBuffer->pHead + offset); } \ -} - -#define PADDING(n) ( (n)&3 ? (4 - ((n)&3)) : 0) - -ErrorCode -UpdatePCRefs (pc, pr, action) -ddPCStr *pc; -ddRendererStr *pr; -ddAction action; -{ - if (action == ADD) { - if (puAddToList((ddPointer) &pr, (unsigned long)1, pc->rendRefs) - == BadAlloc) - return (BadAlloc); - } else - puRemoveFromList((ddPointer) &pr, pc->rendRefs); - - return(Success); -} - -static ErrorCode -UpdatePipelineContext (cntxtPtr, pca, itemMask, ptr) -pexContext *cntxtPtr; -ddPCAttr *pca; -CARD32 itemMask[3]; -unsigned char *ptr; -{ - ErrorCode err = Success; - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerType) { - EXTRACT_INT16_FROM_4B (pca->markerType, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerScale) { - EXTRACT_FLOAT (pca->markerScale, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerColour) { - EXTRACT_COLOUR_SPECIFIER (pca->markerColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerBundleIndex) { - EXTRACT_CARD16_FROM_4B (pca->markerIndex, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextFont) { - EXTRACT_CARD16_FROM_4B (pca->textFont, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPrecision) { - EXTRACT_CARD16_FROM_4B (pca->textPrecision, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharExpansion) { - EXTRACT_FLOAT (pca->charExpansion, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharSpacing) { - EXTRACT_FLOAT (pca->charSpacing, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextColour) { - EXTRACT_COLOUR_SPECIFIER (pca->textColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharHeight) { - EXTRACT_FLOAT (pca->charHeight, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharUpVector) { - EXTRACT_FLOAT (pca->charUp.x, ptr); - EXTRACT_FLOAT (pca->charUp.y, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPath) { - EXTRACT_CARD16_FROM_4B (pca->textPath, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextAlignment) { - EXTRACT_CARD16 (pca->textAlignment.vertical, ptr); - EXTRACT_CARD16 (pca->textAlignment.horizontal, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextHeight) { - EXTRACT_FLOAT (pca->atextHeight, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextUpVector) { - EXTRACT_FLOAT (pca->atextUp.x, ptr); - EXTRACT_FLOAT (pca->atextUp.y, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextPath) { - EXTRACT_CARD16_FROM_4B (pca->atextPath, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextAlignment) { - EXTRACT_CARD16 (pca->atextAlignment.vertical, ptr); - EXTRACT_CARD16 (pca->atextAlignment.horizontal, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextStyle) { - EXTRACT_INT16_FROM_4B (pca->atextStyle, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextBundleIndex) { - EXTRACT_CARD16_FROM_4B (pca->textIndex, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineType) { - EXTRACT_INT16_FROM_4B (pca->lineType, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineWidth) { - EXTRACT_FLOAT (pca->lineWidth, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineColour) { - EXTRACT_COLOUR_SPECIFIER (pca->lineColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCurveApproximation) { - EXTRACT_INT16_FROM_4B (pca->curveApprox.approxMethod, ptr); - EXTRACT_FLOAT (pca->curveApprox.tolerance, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPolylineInterp) { - EXTRACT_INT16_FROM_4B (pca->lineInterp,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineBundleIndex) { - EXTRACT_CARD16_FROM_4B (pca->lineIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyle) { - EXTRACT_INT16_FROM_4B (pca->intStyle,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyleIndex) { - EXTRACT_INT16_FROM_4B (pca->intStyleIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceColour) { - EXTRACT_COLOUR_SPECIFIER (pca->surfaceColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflAttr) { - EXTRACT_FLOAT (pca->reflAttr.ambient, ptr); - EXTRACT_FLOAT (pca->reflAttr.diffuse, ptr); - EXTRACT_FLOAT (pca->reflAttr.specular, ptr); - EXTRACT_FLOAT (pca->reflAttr.specularConc, ptr); - EXTRACT_FLOAT (pca->reflAttr.transmission, ptr); - EXTRACT_COLOUR_SPECIFIER (pca->reflAttr.specularColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflModel) { - EXTRACT_INT16_FROM_4B (pca->reflModel,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceInterp) { - EXTRACT_INT16_FROM_4B (pca->surfInterp,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyle) { - EXTRACT_INT16_FROM_4B (pca->bfIntStyle,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyleIndex) { - EXTRACT_INT16_FROM_4B (pca->bfIntStyleIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceColour) { - EXTRACT_COLOUR_SPECIFIER (pca->bfSurfColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflAttr) { - EXTRACT_FLOAT (pca->bfReflAttr.ambient, ptr); - EXTRACT_FLOAT (pca->bfReflAttr.diffuse, ptr); - EXTRACT_FLOAT (pca->bfReflAttr.specular, ptr); - EXTRACT_FLOAT (pca->bfReflAttr.specularConc, ptr); - EXTRACT_FLOAT (pca->bfReflAttr.transmission, ptr); - EXTRACT_COLOUR_SPECIFIER (pca->bfReflAttr.specularColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflModel) { - EXTRACT_INT16_FROM_4B (pca->bfReflModel,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceInterp) { - EXTRACT_INT16_FROM_4B (pca->bfSurfInterp,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceApproximation) { - EXTRACT_INT16_FROM_4B (pca->surfApprox.approxMethod,ptr); - EXTRACT_FLOAT (pca->surfApprox.uTolerance, ptr); - EXTRACT_FLOAT (pca->surfApprox.vTolerance, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCullingMode) { - EXTRACT_CARD16_FROM_4B (pca->cullMode,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCDistinguishFlag) { - EXTRACT_CARD8_FROM_4B (pca->distFlag,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternSize) { - EXTRACT_FLOAT (pca->patternSize.x, ptr); - EXTRACT_FLOAT (pca->patternSize.y, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefPt) { - EXTRACT_FLOAT (pca->patternRefPt.x, ptr); - EXTRACT_FLOAT (pca->patternRefPt.y, ptr); - EXTRACT_FLOAT (pca->patternRefPt.z, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec1) { - EXTRACT_FLOAT (pca->patternRefV1.x, ptr); - EXTRACT_FLOAT (pca->patternRefV1.y, ptr); - EXTRACT_FLOAT (pca->patternRefV1.z, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec2) { - EXTRACT_FLOAT (pca->patternRefV2.x, ptr); - EXTRACT_FLOAT (pca->patternRefV2.y, ptr); - EXTRACT_FLOAT (pca->patternRefV2.z, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorBundleIndex) { - EXTRACT_CARD16_FROM_4B (pca->intIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeFlag) { - EXTRACT_CARD16_FROM_4B (pca->edges,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeType) { - EXTRACT_INT16_FROM_4B (pca->edgeType,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeWidth) { - EXTRACT_FLOAT (pca->edgeWidth,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeColour) { - EXTRACT_COLOUR_SPECIFIER (pca->edgeColour, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCEdgeBundleIndex) { - EXTRACT_CARD16_FROM_4B (pca->edgeIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLocalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) - EXTRACT_FLOAT(pca->localMat[i][j], ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCGlobalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) - EXTRACT_FLOAT(pca->globalMat[i][j], ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClip) { - EXTRACT_CARD16_FROM_4B (pca->modelClip,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClipVolume) { - unsigned long i, numHalfSpaces; - EXTRACT_CARD32 ( numHalfSpaces, ptr); - PU_EMPTY_LIST(pca->modelClipVolume); - /* don't need to do this emptying the list and adding is sufficient - puDeleteList(pca->modelClipVolume); - pca->modelClipVolume = puCreateList(DD_HALF_SPACE); - if (!pca->modelClipVolume) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - */ - puAddToList((ddPointer)ptr, numHalfSpaces, pca->modelClipVolume); - /* skip past list of Half Space */ - for ( i = 0; i < numHalfSpaces; i++) { - SKIP_STRUCT(ptr, 1, ddCoord3D); - SKIP_STRUCT(ptr, 1, ddVector3D); - } - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCViewIndex) { - EXTRACT_CARD16_FROM_4B (pca->viewIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLightState) { - unsigned long i, numskip; - EXTRACT_CARD32(i,ptr); - PU_EMPTY_LIST(pca->lightState); - puAddToList((ddPointer)ptr,i,pca->lightState); - /* skip over CARD16 and pad if any */ - numskip = (i + 1) / 2; - SKIP_PADDING( ptr, numskip * 4); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCDepthCueIndex) { - EXTRACT_CARD16_FROM_4B (pca->depthCueIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSetAsfValues) { - CARD32 asf_enables, asfs; - EXTRACT_CARD32 (asf_enables,ptr); - EXTRACT_CARD32 (asfs,ptr); - pca->asfs = (pca->asfs & ~asf_enables) | (asfs & asf_enables); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPickId) { - EXTRACT_CARD32 (pca->pickId,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCHlhsrIdentifier) { - EXTRACT_CARD32 (pca->hlhsrType,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCNameSet) { - pexNameSet ns; - EXTRACT_CARD32 (ns, ptr); - LU_NAMESET(ns, pca->pCurrentNS); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCColourApproxIndex) { - EXTRACT_CARD16_FROM_4B (pca->colourApproxIndex,ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCRenderingColourModel) { - EXTRACT_INT16_FROM_4B (pca->rdrColourModel, ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCParaSurfCharacteristics) { - EXTRACT_INT16 (pca->psc.type, ptr); - SKIP_PADDING(ptr,2); - switch (pca->psc.type) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - case PEXPSCIsoCurves: { - EXTRACT_CARD16(pca->psc.data.isoCurves.placementType, ptr); - SKIP_PADDING(ptr,2); - EXTRACT_CARD16(pca->psc.data.isoCurves.numUcurves, ptr); - EXTRACT_CARD16(pca->psc.data.isoCurves.numVcurves, ptr); - break; - } - case PEXPSCMcLevelCurves: { - EXTRACT_COORD3D((&(pca->psc.data.mcLevelCurves.origin)),ptr); - EXTRACT_COORD3D((&(pca->psc.data.mcLevelCurves.direction)),ptr); - EXTRACT_CARD16(pca->psc.data.mcLevelCurves.numberIntersections,ptr); - SKIP_PADDING(ptr,2); - pca->psc.data.mcLevelCurves.pPoints = (ddFLOAT *) - xalloc((unsigned long) (sizeof(ddFLOAT) * - pca->psc.data.mcLevelCurves.numberIntersections)); - EXTRACT_STRUCT( pca->psc.data.mcLevelCurves.numberIntersections, - PEXFLOAT, pca->psc.data.mcLevelCurves.pPoints, - ptr); - break; - } - - case PEXPSCWcLevelCurves: { - EXTRACT_COORD3D(&(pca->psc.data.wcLevelCurves.origin),ptr); - EXTRACT_COORD3D(&(pca->psc.data.wcLevelCurves.direction),ptr); - EXTRACT_CARD16(pca->psc.data.wcLevelCurves.numberIntersections,ptr); - SKIP_PADDING(ptr,2); - pca->psc.data.wcLevelCurves.pPoints = (ddFLOAT *) - xalloc((unsigned long) (sizeof(ddFLOAT) * - pca->psc.data.wcLevelCurves.numberIntersections)); - EXTRACT_STRUCT( pca->psc.data.wcLevelCurves.numberIntersections, - PEXFLOAT, pca->psc.data.wcLevelCurves.pPoints, - ptr); - break; - } - - } - } - - return (Success); - -} - - -static -void CopyColourSpecifier (src, dst) -ddColourSpecifier *src, *dst; -{ - dst->colourType = src->colourType; - - switch (dst->colourType) { - case PEXIndexedColour: { - dst->colour.indexed.index = src->colour.indexed.index; - break; - } - - case PEXRgbFloatColour: { - dst->colour.rgbFloat.red = src->colour.rgbFloat.red; - dst->colour.rgbFloat.green = src->colour.rgbFloat.green; - dst->colour.rgbFloat.blue = src->colour.rgbFloat.blue; - break; - } - - case PEXCieFloatColour: { - dst->colour.cieFloat.x = src->colour.cieFloat.x; - dst->colour.cieFloat.y = src->colour.cieFloat.y; - dst->colour.cieFloat.z = src->colour.cieFloat.z; - break; - } - - case PEXHsvFloatColour: { - dst->colour.hsvFloat.hue = src->colour.hsvFloat.hue; - dst->colour.hsvFloat.saturation - = src->colour.hsvFloat.saturation; - dst->colour.hsvFloat.value = src->colour.hsvFloat.value; - break; - } - - case PEXHlsFloatColour: { - dst->colour.hlsFloat.hue = src->colour.hlsFloat.hue; - dst->colour.hlsFloat.lightness = src->colour.hlsFloat.lightness; - dst->colour.hlsFloat.saturation - = src->colour.hlsFloat.saturation; - break; - } - - case PEXRgb8Colour: { - dst->colour.rgb8.red = src->colour.rgb8.red; - dst->colour.rgb8.green = src->colour.rgb8.green; - dst->colour.rgb8.blue = src->colour.rgb8.blue; - break; - } - - case PEXRgb16Colour: { - dst->colour.rgb16.red = src->colour.rgb16.red; - dst->colour.rgb16.green = src->colour.rgb16.green; - dst->colour.rgb16.blue = src->colour.rgb16.blue; - break; - } - } -} - - -/*++ PEXCreatePipelineContext - --*/ -ErrorCode -PEXCreatePipelineContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePipelineContextReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode freePipelineContext(); - ddPCStr *pc; - extern void DefaultPC(); - - if (!LegalNewID(strmPtr->pc, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->pc,cntxtPtr); - - pc = (ddPCStr *)xalloc((unsigned long)(sizeof(ddPCStr) + sizeof(ddPCAttr))); - if (!pc) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - pc->PCid = strmPtr->pc; - pc->rendRefs = puCreateList(DD_RENDERER); - if (!pc->rendRefs) { - xfree((pointer)pc); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - pc->pPCAttr = (ddPCAttr *)(pc+1); - DefaultPC(pc->pPCAttr); - if (!pc->pPCAttr->modelClipVolume || !pc->pPCAttr->lightState) { - puDeleteList(pc->rendRefs); - xfree((pointer)pc); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - - err = UpdatePipelineContext( cntxtPtr, pc->pPCAttr, strmPtr->itemMask, - (unsigned char *)(strmPtr + 1)); - if (err) { - puDeleteList(pc->rendRefs); - puDeleteList(pc->pPCAttr->modelClipVolume); - puDeleteList(pc->pPCAttr->lightState); - xfree((pointer)pc); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - ADDRESOURCE (strmPtr->pc, PEXPipeType, pc); - return (err); - -} /* end-PEXCreatePipelineContext() */ - -/*++ PEXCopyPipelineContext - --*/ -ErrorCode -PEXCopyPipelineContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyPipelineContextReq *strmPtr; -{ - ErrorCode err = Success; - ddPCStr *src, *dst; - - LU_PIPELINECONTEXT(strmPtr->src, src); - LU_PIPELINECONTEXT(strmPtr->dst, dst); - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerType) { - dst->pPCAttr->markerType = src->pPCAttr->markerType; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerScale) { - dst->pPCAttr->markerScale = src->pPCAttr->markerScale; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerColour) { - CopyColourSpecifier( &(src->pPCAttr->markerColour), - &(dst->pPCAttr->markerColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerBundleIndex) { - dst->pPCAttr->markerIndex = src->pPCAttr->markerIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextFont) { - dst->pPCAttr->textFont = src->pPCAttr->textFont; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextPrecision) { - dst->pPCAttr->textPrecision = src->pPCAttr->textPrecision; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharExpansion) { - dst->pPCAttr->charExpansion = src->pPCAttr->charExpansion; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharSpacing) { - dst->pPCAttr->charSpacing = src->pPCAttr->charSpacing; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextColour) { - CopyColourSpecifier( &(src->pPCAttr->textColour), - &(dst->pPCAttr->textColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharHeight) { - dst->pPCAttr->charHeight = src->pPCAttr->charHeight; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharUpVector) { - dst->pPCAttr->charUp.x = src->pPCAttr->charUp.x; - dst->pPCAttr->charUp.y = src->pPCAttr->charUp.y; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextPath) { - dst->pPCAttr->textPath = src->pPCAttr->textPath; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextAlignment) { - dst->pPCAttr->textAlignment.vertical - = src->pPCAttr->textAlignment.vertical; - dst->pPCAttr->textAlignment.horizontal - = src->pPCAttr->textAlignment.horizontal; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextHeight) { - dst->pPCAttr->atextHeight = src->pPCAttr->atextHeight; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextUpVector) { - dst->pPCAttr->atextUp.x = src->pPCAttr->atextUp.x; - dst->pPCAttr->atextUp.y = src->pPCAttr->atextUp.y; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextPath) { - dst->pPCAttr->atextPath = src->pPCAttr->atextPath; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextAlignment) { - dst->pPCAttr->atextAlignment.vertical - = src->pPCAttr->atextAlignment.vertical; - dst->pPCAttr->atextAlignment.horizontal - = src->pPCAttr->atextAlignment.horizontal; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextStyle) { - dst->pPCAttr->atextStyle = src->pPCAttr->atextStyle; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextBundleIndex) { - dst->pPCAttr->textIndex = src->pPCAttr->textIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineType) { - dst->pPCAttr->lineType = src->pPCAttr->lineType; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineWidth) { - dst->pPCAttr->lineWidth = src->pPCAttr->lineWidth; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineColour) { - CopyColourSpecifier( &(src->pPCAttr->lineColour), - &(dst->pPCAttr->lineColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCurveApproximation) { - dst->pPCAttr->curveApprox.approxMethod - = src->pPCAttr->curveApprox.approxMethod; - dst->pPCAttr->curveApprox.tolerance - = src->pPCAttr->curveApprox.tolerance; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPolylineInterp) { - dst->pPCAttr->lineInterp = src->pPCAttr->lineInterp; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineBundleIndex) { - dst->pPCAttr->lineIndex = src->pPCAttr->lineIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorStyle) { - dst->pPCAttr->intStyle = src->pPCAttr->intStyle; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorStyleIndex) { - dst->pPCAttr->intStyleIndex = src->pPCAttr->intStyleIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceColour) { - CopyColourSpecifier( &(src->pPCAttr->surfaceColour), - &(dst->pPCAttr->surfaceColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceReflAttr) { - dst->pPCAttr->reflAttr.ambient = src->pPCAttr->reflAttr.ambient; - dst->pPCAttr->reflAttr.diffuse = src->pPCAttr->reflAttr.diffuse; - dst->pPCAttr->reflAttr.specular = src->pPCAttr->reflAttr.specular; - dst->pPCAttr->reflAttr.specularConc - = src->pPCAttr->reflAttr.specularConc; - dst->pPCAttr->reflAttr.transmission - = src->pPCAttr->reflAttr.transmission; - CopyColourSpecifier( &(src->pPCAttr->reflAttr.specularColour), - &(dst->pPCAttr->reflAttr.specularColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceReflModel) { - dst->pPCAttr->reflModel = src->pPCAttr->reflModel; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceInterp) { - dst->pPCAttr->surfInterp = src->pPCAttr->surfInterp; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfInteriorStyle) { - dst->pPCAttr->bfIntStyle = src->pPCAttr->bfIntStyle; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfInteriorStyleIndex) { - dst->pPCAttr->bfIntStyleIndex = src->pPCAttr->bfIntStyleIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceColour) { - CopyColourSpecifier( &(src->pPCAttr->bfSurfColour), - &(dst->pPCAttr->bfSurfColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceReflAttr) { - dst->pPCAttr->bfReflAttr.ambient = src->pPCAttr->bfReflAttr.ambient; - dst->pPCAttr->bfReflAttr.diffuse = src->pPCAttr->bfReflAttr.diffuse; - dst->pPCAttr->bfReflAttr.specular = src->pPCAttr->bfReflAttr.specular; - dst->pPCAttr->bfReflAttr.specularConc - = src->pPCAttr->bfReflAttr.specularConc; - dst->pPCAttr->bfReflAttr.transmission - = src->pPCAttr->bfReflAttr.transmission; - CopyColourSpecifier( &(src->pPCAttr->bfReflAttr.specularColour), - &(dst->pPCAttr->bfReflAttr.specularColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceReflModel) { - dst->pPCAttr->bfReflModel = src->pPCAttr->bfReflModel; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceInterp) { - dst->pPCAttr->bfSurfInterp = src->pPCAttr->bfSurfInterp; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceApproximation) { - dst->pPCAttr->surfApprox.approxMethod - = src->pPCAttr->surfApprox.approxMethod; - dst->pPCAttr->surfApprox.uTolerance - = src->pPCAttr->surfApprox.uTolerance; - dst->pPCAttr->surfApprox.vTolerance - = src->pPCAttr->surfApprox.vTolerance; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCullingMode) { - dst->pPCAttr->cullMode = src->pPCAttr->cullMode; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCDistinguishFlag) { - dst->pPCAttr->distFlag = src->pPCAttr->distFlag; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternSize) { - dst->pPCAttr->patternSize.x = src->pPCAttr->patternSize.x; - dst->pPCAttr->patternSize.y = src->pPCAttr->patternSize.y; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefPt) { - dst->pPCAttr->patternRefPt.x = src->pPCAttr->patternRefPt.x; - dst->pPCAttr->patternRefPt.y = src->pPCAttr->patternRefPt.y; - dst->pPCAttr->patternRefPt.z = src->pPCAttr->patternRefPt.z; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefVec1) { - dst->pPCAttr->patternRefV1.x = src->pPCAttr->patternRefV1.x; - dst->pPCAttr->patternRefV1.y = src->pPCAttr->patternRefV1.y; - dst->pPCAttr->patternRefV1.z = src->pPCAttr->patternRefV1.z; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefVec2) { - dst->pPCAttr->patternRefV2.x = src->pPCAttr->patternRefV2.x; - dst->pPCAttr->patternRefV2.y = src->pPCAttr->patternRefV2.y; - dst->pPCAttr->patternRefV2.z = src->pPCAttr->patternRefV2.z; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorBundleIndex) { - dst->pPCAttr->intIndex = src->pPCAttr->intIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeFlag) { - dst->pPCAttr->edges = src->pPCAttr->edges; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeType) { - dst->pPCAttr->edgeType = src->pPCAttr->edgeType; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeWidth) { - dst->pPCAttr->edgeWidth = src->pPCAttr->edgeWidth; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeColour) { - CopyColourSpecifier( &(src->pPCAttr->edgeColour), - &(dst->pPCAttr->edgeColour)); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCEdgeBundleIndex) { - dst->pPCAttr->edgeIndex = src->pPCAttr->edgeIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLocalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) - dst->pPCAttr->localMat[i][j] = src->pPCAttr->localMat[i][j]; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCGlobalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) - dst->pPCAttr->globalMat[i][j] = src->pPCAttr->globalMat[i][j]; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCModelClip) { - dst->pPCAttr->modelClip = src->pPCAttr->modelClip; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCModelClipVolume) { - PU_EMPTY_LIST(dst->pPCAttr->modelClipVolume); -/* puDeleteList(dst->pPCAttr->modelClipVolume); - dst->pPCAttr->modelClipVolume = puCreateList(DD_HALF_SPACE); - if (!dst->pPCAttr->modelClipVolume) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); -*/ puCopyList( src->pPCAttr->modelClipVolume, - dst->pPCAttr->modelClipVolume); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCViewIndex) { - dst->pPCAttr->viewIndex = src->pPCAttr->viewIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLightState) { -/* dst->pPCAttr->lightState = src->pPCAttr->lightState; - puDeleteList(dst->pPCAttr->lightState); - dst->pPCAttr->lightState = puCreateList(DD_INDEX); - if (!dst->pPCAttr->lightState) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); -*/ PU_EMPTY_LIST(dst->pPCAttr->lightState); - puCopyList( src->pPCAttr->lightState, dst->pPCAttr->lightState); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCDepthCueIndex) { - dst->pPCAttr->depthCueIndex = src->pPCAttr->depthCueIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSetAsfValues) { - dst->pPCAttr->asfs = src->pPCAttr->asfs; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPickId) { - dst->pPCAttr->pickId = src->pPCAttr->pickId; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCHlhsrIdentifier) { - dst->pPCAttr->hlhsrType = src->pPCAttr->hlhsrType; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCNameSet) { - dst->pPCAttr->pCurrentNS = src->pPCAttr->pCurrentNS; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCColourApproxIndex) { - dst->pPCAttr->colourApproxIndex = src->pPCAttr->colourApproxIndex; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCRenderingColourModel) { - dst->pPCAttr->rdrColourModel = src->pPCAttr->rdrColourModel; - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCParaSurfCharacteristics) { - dst->pPCAttr->psc = src->pPCAttr->psc; - } - - return (Success); - -} /* end-PEXCopyPipelineContext() */ - -ErrorCode -FreePipelineContext (pc, id) -ddPCStr *pc; -pexPC id; -{ - ErrorCode err = Success; - extern ErrorCode UpdateRendRefs(); - int i; - ddRendererStr *pr = (ddRendererStr *)(pc->rendRefs->pList); - - if (!pc) return (Success); - - for (i=0; irendRefs->numObj; i++, pr++) - UpdateRendRefs( pr, pc->PCid, (unsigned long)PIPELINE_CONTEXT_RESOURCE, - (unsigned long)REMOVE); - - puDeleteList(pc->rendRefs); - puDeleteList(pc->pPCAttr->modelClipVolume); - puDeleteList(pc->pPCAttr->lightState); - xfree((pointer)pc); - - return (err); -} - -/*++ PEXFreePipelineContext - --*/ -ErrorCode -PEXFreePipelineContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreePipelineContextReq *strmPtr; -{ - ErrorCode err = Success; - ddPCStr *pc; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXPipelineContextError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_PIPELINECONTEXT(strmPtr->id, pc); - - FreeResource (strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreePipelineContext() */ - -/*++ PEXGetPipelineContext - --*/ -ErrorCode -PEXGetPipelineContext( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetPipelineContextReq *strmPtr; -{ - /* NOTE: See the Protocol Encoding for exact details of the fields - returned by this command. The encoding requires CARD16 and INT16 - to be sent in 4 byte fields (CARD32) for most fields of these - types, hence the use of PACK_CARD32 for these fields. - JSH - */ - - ErrorCode err = Success; - ddPCStr *pc; - ddPCAttr *pca; - extern ddBufferPtr pPEXBuffer; - pexGetPipelineContextReply *reply - = (pexGetPipelineContextReply *)(pPEXBuffer->pHead); - CARD8 *replyPtr = (CARD8 *)(reply); - int size = 0; - int sze = 0; - - LU_PIPELINECONTEXT(strmPtr->pc, pc); - - pca = pc->pPCAttr; - - replyPtr += sizeof(pexGetPipelineContextReply); - CHK_PEX_BUF(size, sizeof(pexGetPipelineContextReply), reply, - pexGetPipelineContextReply, replyPtr); - SETUP_INQ(pexGetPipelineContextReply); - replyPtr = pPEXBuffer->pBuf; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerType) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->markerType, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerScale) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->markerScale, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->markerColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->markerColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCMarkerBundleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->markerIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextFont) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->textFont, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextPrecision) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->textPrecision, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharExpansion) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->charExpansion, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharSpacing) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->charSpacing, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->textColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->textColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharHeight) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->charHeight, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCharUpVector) { - CHK_PEX_BUF(size, 2 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->charUp.x, replyPtr); - PACK_FLOAT ( pca->charUp.y, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextPath) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->textPath, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextAlignment) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD16 ( pca->textAlignment.vertical, replyPtr); - PACK_CARD16 ( pca->textAlignment.horizontal, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextHeight) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->atextHeight, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextUpVector) { - CHK_PEX_BUF(size, 2 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->atextUp.x, replyPtr); - PACK_FLOAT ( pca->atextUp.y, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextPath) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->atextPath, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextAlignment) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD16 ( pca->atextAlignment.vertical, replyPtr); - PACK_CARD16 ( pca->atextAlignment.horizontal, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCAtextStyle) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->atextStyle, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCTextBundleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->textIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineType) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->lineType, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineWidth) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->lineWidth, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->lineColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->lineColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCurveApproximation) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT) + sizeof(CARD32), reply, - pexGetPipelineContextReply, replyPtr); - PACK_CARD32 ( pca->curveApprox.approxMethod, replyPtr); - PACK_FLOAT ( pca->curveApprox.tolerance, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPolylineInterp) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->lineInterp, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLineBundleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->lineIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorStyle) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->intStyle, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorStyleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->intStyleIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->surfaceColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->surfaceColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceReflAttr) { - CHK_PEX_BUF(size, 5 * sizeof(PEXFLOAT) + sizeof(CARD32) - + SIZE_COLOURSPEC(pca->reflAttr.specularColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_FLOAT ( pca->reflAttr.ambient, replyPtr); - PACK_FLOAT ( pca->reflAttr.diffuse, replyPtr); - PACK_FLOAT ( pca->reflAttr.specular, replyPtr); - PACK_FLOAT ( pca->reflAttr.specularConc, replyPtr); - PACK_FLOAT ( pca->reflAttr.transmission, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->reflAttr.specularColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceReflModel) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->reflModel, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceInterp) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->surfInterp, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfInteriorStyle) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->bfIntStyle, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfInteriorStyleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->bfIntStyleIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->bfSurfColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->bfSurfColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceReflAttr) { - CHK_PEX_BUF(size, 5 * sizeof(PEXFLOAT) + sizeof(CARD32) - + SIZE_COLOURSPEC(pca->bfReflAttr.specularColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_FLOAT ( pca->bfReflAttr.ambient, replyPtr); - PACK_FLOAT ( pca->bfReflAttr.diffuse, replyPtr); - PACK_FLOAT ( pca->bfReflAttr.specular, replyPtr); - PACK_FLOAT ( pca->bfReflAttr.specularConc, replyPtr); - PACK_FLOAT ( pca->bfReflAttr.transmission, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->bfReflAttr.specularColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceReflModel) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->bfReflModel, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCBfSurfaceInterp) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->bfSurfInterp, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceApproximation) { - CHK_PEX_BUF(size, sizeof(CARD32) + 2 * sizeof(PEXFLOAT), reply, - pexGetPipelineContextReply, replyPtr); - PACK_CARD32 ( pca->surfApprox.approxMethod, replyPtr); - PACK_FLOAT ( pca->surfApprox.uTolerance, replyPtr); - PACK_FLOAT ( pca->surfApprox.vTolerance, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCCullingMode) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->cullMode, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCDistinguishFlag) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->distFlag, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternSize) { - CHK_PEX_BUF(size, 2 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->patternSize.x, replyPtr); - PACK_FLOAT ( pca->patternSize.y, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefPt) { - CHK_PEX_BUF(size, 3 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->patternRefPt.x, replyPtr); - PACK_FLOAT ( pca->patternRefPt.y, replyPtr); - PACK_FLOAT ( pca->patternRefPt.z, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefVec1) { - CHK_PEX_BUF(size, 3 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->patternRefV1.x, replyPtr); - PACK_FLOAT ( pca->patternRefV1.y, replyPtr); - PACK_FLOAT ( pca->patternRefV1.z, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPatternRefVec2) { - CHK_PEX_BUF(size, 3 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->patternRefV2.x, replyPtr); - PACK_FLOAT ( pca->patternRefV2.y, replyPtr); - PACK_FLOAT ( pca->patternRefV2.z, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCInteriorBundleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->intIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeFlag) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->edges, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeType) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->edgeType, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeWidth) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - PACK_FLOAT ( pca->edgeWidth, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSurfaceEdgeColour) { - CHK_PEX_BUF(size, sizeof(CARD32) + SIZE_COLOURSPEC(pca->edgeColour), - reply, pexGetPipelineContextReply, replyPtr); - PACK_COLOUR_SPECIFIER ( pca->edgeColour, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCEdgeBundleIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->edgeIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLocalTransform) { - int i, j; - CHK_PEX_BUF(size, 16 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - for (i=0; i<4; i++) - for (j=0; j<4; j++) - PACK_FLOAT( pca->localMat[i][j], replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCGlobalTransform) { - int i, j; - CHK_PEX_BUF(size, 16 * sizeof(PEXFLOAT), reply, pexGetPipelineContextReply, - replyPtr); - for (i=0; i<4; i++) - for (j=0; j<4; j++) - PACK_FLOAT( pca->globalMat[i][j], replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCModelClip) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->modelClip, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCModelClipVolume) { - int i; - pexHalfSpace *pphs = (pexHalfSpace *)(pca->modelClipVolume->pList); - CHK_PEX_BUF(size, sizeof(CARD32)+(pca->modelClipVolume->numObj * sizeof(pexHalfSpace)), - reply, pexGetPipelineContextReply, replyPtr); - PACK_CARD32 ( pca->modelClipVolume->numObj, replyPtr); - for (i=0; imodelClipVolume->numObj; i++, pphs++) { - PACK_COORD3D( &pphs->point, replyPtr); - PACK_VECTOR3D( &pphs->vector, replyPtr); - } - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCViewIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->viewIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCLightState) { -/* CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->lightState, replyPtr); -*/ int i; - int sz = pca->lightState->numObj*sizeof(CARD16); - CARD16 *pLS = (CARD16 *)(pca->lightState->pList); - CHK_PEX_BUF(size,sizeof(CARD32)+sz+PADDING(sz), - reply, pexGetPipelineContextReply, replyPtr); - PACK_CARD32(pca->lightState->numObj, replyPtr); - for (i=0; ilightState->numObj; i++, pLS++) { - PACK_CARD16(*pLS, replyPtr); - } - if (pca->lightState->numObj % 2) - SKIP_PADDING(replyPtr,2); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCDepthCueIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->depthCueIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCSetAsfValues) { - CARD32 asf_enables; - CHK_PEX_BUF(size, 2*sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - asf_enables = ASF_ALL; - PACK_CARD32 ( asf_enables, replyPtr); - PACK_CARD32 ( pca->asfs, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCPickId) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->pickId, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCHlhsrIdentifier) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->hlhsrType, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCNameSet) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( GetId(pca->pCurrentNS), replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCColourApproxIndex) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->colourApproxIndex, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCRenderingColourModel) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetPipelineContextReply, - replyPtr); - PACK_CARD32 ( pca->rdrColourModel, replyPtr); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPCParaSurfCharacteristics) { - switch (pca->psc.type) { - case PEXPSCNone: - case PEXPSCImpDep: - sze = 0; - break; - case PEXPSCIsoCurves: - sze = 8; - break; - case PEXPSCMcLevelCurves: - sze = (6 * sizeof(PEXFLOAT)) + 4 + - (pca->psc.data.mcLevelCurves.numberIntersections * - sizeof(PEXFLOAT)) ; - break; - case PEXPSCWcLevelCurves: - sze = (6 * sizeof(PEXFLOAT)) + 4 + - (pca->psc.data.wcLevelCurves.numberIntersections * - sizeof(PEXFLOAT)) ; - break; - default: - sze = 0; - break; - } - - CHK_PEX_BUF(size, sizeof(CARD32)+sze, reply, pexGetPipelineContextReply, - replyPtr); - PACK_INT16(pca->psc.type, replyPtr); - PACK_INT16(sze, replyPtr); - switch (pca->psc.type) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - case PEXPSCIsoCurves: { - PACK_CARD16(pca->psc.data.isoCurves.placementType, replyPtr); - SKIP_PADDING(replyPtr,2); - PACK_CARD16(pca->psc.data.isoCurves.numUcurves, replyPtr); - PACK_CARD16(pca->psc.data.isoCurves.numVcurves, replyPtr); - break; - } - case PEXPSCMcLevelCurves: { - PACK_COORD3D(&(pca->psc.data.mcLevelCurves.origin),replyPtr); - PACK_COORD3D(&(pca->psc.data.mcLevelCurves.direction),replyPtr); - PACK_CARD16(pca->psc.data.mcLevelCurves.numberIntersections,replyPtr); - SKIP_PADDING(replyPtr,2); - PACK_LISTOF_STRUCT(pca->psc.data.mcLevelCurves.numberIntersections, - PEXFLOAT, pca->psc.data.mcLevelCurves.pPoints, - replyPtr); - break; - } - - case PEXPSCWcLevelCurves: { - PACK_COORD3D(&(pca->psc.data.wcLevelCurves.origin),replyPtr); - PACK_COORD3D(&(pca->psc.data.wcLevelCurves.direction),replyPtr); - PACK_CARD16(pca->psc.data.wcLevelCurves.numberIntersections,replyPtr); - SKIP_PADDING(replyPtr,2); - PACK_LISTOF_STRUCT(pca->psc.data.wcLevelCurves.numberIntersections, - PEXFLOAT, pca->psc.data.wcLevelCurves.pPoints, - replyPtr); - break; - } - } - } - - pPEXBuffer->dataSize = (int)replyPtr - (int)(pPEXBuffer->pBuf); - - reply->length = (unsigned long)LWORDS(pPEXBuffer->dataSize); - WritePEXBufferReply(pexGetPipelineContextReply); - - return (err); - -} /* end-PEXGetPipelineContext() */ - -/*++ PEXChangePipelineContext - --*/ -ErrorCode -PEXChangePipelineContext( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangePipelineContextReq *strmPtr; -{ - ErrorCode err = Success; - ddPCStr *pc; - - LU_PIPELINECONTEXT(strmPtr->pc, pc); - - err = UpdatePipelineContext( cntxtPtr, pc->pPCAttr, strmPtr->itemMask, - (unsigned char *)(strmPtr + 1)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangePipelineContext() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c:3.8 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c Sat Feb 28 21:41:55 2004 @@ -1,787 +0,0 @@ -/* $Xorg: pexPhigs.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexPhigs.c,v 3.8 2001/12/14 19:57:44 dawes Exp $ */ - - -/*++ - * PEXCreatePhigsWks - * dipexFreePhigsWks - * PEXFreePhigsWks - * PEXGetWksInfo - * PEXGetDynamics - * PEXGetViewRep - * PEXRedrawAllStructures - * PEXUpdateWorkstations - * PEXExecuteDeferredActions - * PEXSetViewPriority - * PEXSetDisplayUpdateMode - * PEXMapDCtoWC - * PEXSetViewRep - * PEXSetWksWindow - * PEXSetWksViewport - * PEXSetHlhsrMode - * PEXPostStructure - * PEXUnpostStructure - * PEXUnpostAllStructures - * PEXGetWksPostings - * PEXRedrawClipRegion - --*/ - -#include "X.h" -#include "Xproto.h" -#include "PEX.h" -#include "pexError.h" -#include "pex_site.h" -#include "ddpex4.h" -#include "pexLookup.h" -#include "pexos.h" - - -extern LUTAddWksXref(); -extern void LostXResource(); - -static void RemoveWksFromDrawableList(); - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -#define AddLut(lut_id, wks_lut_entry) \ - if (! ((lut) = (diLUTHandle) LookupIDByType ((lut_id), PEXLutType)) ) { \ - err = PEX_ERROR_CODE(PEXLookupTableError); \ - xfree((pointer)pw);\ - PEX_ERR_EXIT(err,(lut_id),cntxtPtr); }\ - wks_lut_entry = lut; - -#define AddNs(ns_id, wks_ns_entry) \ - if (! (ns = (diNSHandle) LookupIDByType ((ns_id), PEXNameType)) ) { \ - err = PEX_ERROR_CODE(PEXNameSetError); \ - xfree((pointer)pw);\ - PEX_ERR_EXIT(err,(ns_id),cntxtPtr); } \ - wks_ns_entry = ns; - - - -/*++ PEXCreatePhigsWks - * - --*/ -ErrorCode -PEXCreatePhigsWks (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePhigsWksReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - dipexWksDrawable *wks_draw = 0; - dipexWksDrawableLink *plink = 0; - ddWksInit tables; - diLUTHandle lut = 0; - diNSHandle ns = 0; - DrawablePtr pdraw = 0; - - if (!LegalNewID(strmPtr->wks, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->wks,cntxtPtr); - - LU_DRAWABLE(strmPtr->drawable, pdraw); - - pw = (dipexPhigsWks *) xalloc ((unsigned long)(sizeof(dipexPhigsWks))); - if (!pw) { - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - pw->did = strmPtr->drawable; - pw->dd_data.id = strmPtr->wks; - pw->dd_data.deviceData = NULL; - - tables.pDrawable = pdraw; - tables.drawableId = strmPtr->drawable; - - /* Line Bundle Table */ - AddLut (strmPtr->lineBundle, tables.pLineLUT); - - /* Marker Bundle Table */ - AddLut (strmPtr->markerBundle, tables.pMarkerLUT); - - /* Text Bundle Table */ - AddLut (strmPtr->textBundle, tables.pTextLUT); - - /* Interior Bundle Table */ - AddLut (strmPtr->interiorBundle, tables.pIntLUT); - - /* Edge Bundle Table */ - AddLut (strmPtr->edgeBundle, tables.pEdgeLUT); - - /* Colour Bundle Table */ - AddLut (strmPtr->colourTable, tables.pColourLUT); - - /* Light Table */ - AddLut (strmPtr->lightTable, tables.pLightLUT); - - /* Colour Bundle Table */ - /* Pattern Bundle Table */ - AddLut (strmPtr->patternTable, tables.pPatternLUT); - - /* Text Font Bundle Table */ - AddLut (strmPtr->textFontTable, tables.pFontLUT); - - /* Depth Cue Bundle Table */ - AddLut (strmPtr->depthCueTable, tables.pDepthCueLUT); - - /* Colour Approx Bundle Table */ - AddLut (strmPtr->colourApproxTable, tables.pColourAppLUT); - - /* Namesets */ - AddNs ( strmPtr->highlightIncl, tables.pHighInclSet); - AddNs ( strmPtr->highlightExcl, tables.pHighExclSet); - AddNs ( strmPtr->invisIncl, tables.pInvisInclSet); - AddNs ( strmPtr->invisExcl, tables.pInvisExclSet); - - /* Double buffering mode */ - tables.bufferMode = strmPtr->bufferMode; - - /* workstation-drawable cross-references */ - if (!LegalNewID(strmPtr->drawable, cntxtPtr->client)) { - - wks_draw = - (dipexWksDrawable *) xalloc ((unsigned long)(sizeof(dipexWksDrawable) - + sizeof(dipexWksDrawableLink))); - if (!wks_draw) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - wks_draw->id = strmPtr->drawable; - wks_draw->x_drawable = pdraw; - wks_draw->wks_list = (dipexWksDrawableLink *)(wks_draw +1); - wks_draw->wks_list->wks = pw; - wks_draw->wks_list->wksid = strmPtr->wks; - wks_draw->wks_list->next = 0; - if (!( AddResource( strmPtr->drawable, PEXWksDrawableType, - (pointer)wks_draw))) { - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); } - } else { - plink = (dipexWksDrawableLink *) - xalloc ((unsigned long)(sizeof(dipexWksDrawableLink))); - if (!plink) { - xfree((pointer)pw); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); } - plink->next = wks_draw->wks_list; - plink->wksid = strmPtr->wks; - wks_draw->wks_list = plink; - } - - - /* ddpex create */ - err = CreatePhigsWks (&tables, &(pw->dd_data)); - if (err) { - RemoveWksFromDrawableList(strmPtr->wks, wks_draw); - xfree((pointer)pw); - PEX_ERR_EXIT(err,0,cntxtPtr); - }; - - ADDRESOURCE(strmPtr->wks, PEXWksType, pw); - - return( err ); - -} /* end-PEXCreatePhigsWks() */ - -/*++ dipexFreePhigsWks - * - --*/ - -static void -RemoveWksFromDrawableList(wksid,drawlist) -pexPhigsWks wksid; -dipexWksDrawable *drawlist; -{ - dipexWksDrawableLink *plink = drawlist->wks_list, *prev = 0; - - while (plink) { - if (plink->wksid == wksid) { - if (prev) { - prev->next = plink->next; - xfree((pointer)plink); - } else { drawlist->wks_list = plink->next; } - plink = 0; - } else { - prev = plink; - plink = plink->next; - } - } - - if (! (drawlist->wks_list) ) { - /* don't do a free--weird side effects in FreeResource - will cause all types associated with this id to be freed */ - drawlist->id = PEXAlreadyFreed; - } - -} -/*++ dipexFreePhigsWks - * - --*/ -ErrorCode -dipexFreePhigsWks (pw, id) -dipexPhigsWks *pw; -pexPhigsWks id; -{ - ErrorCode err = Success; - extern ddpex4rtn FreePhigsWks(); - void RemoveWksFromDrawableList(); - dipexWksDrawable *wks_draw = 0; - - if ((wks_draw = - (dipexWksDrawable *) LookupIDByType(pw->did,PEXWksDrawableType))) { - RemoveWksFromDrawableList(id,wks_draw); - } - - err = FreePhigsWks((diWKSHandle)pw,id); - - return( err ); - -} /* dipexFreePhigsWks() */ - -/*++ PEXFreePhigsWks - --*/ -ErrorCode -PEXFreePhigsWks (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreePhigsWksReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXPhigsWksError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_PHIGSWKS (strmPtr->id, pw); - - FreeResource(strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreePhigsWks() */ - -/*++ PEXGetWksInfo - --*/ -ErrorCode -PEXGetWksInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetWksInfoReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numValues; - - LU_PHIGSWKS(strmPtr->wks, pw); - - SETUP_INQ(pexGetWksInfoReply); - - err = InquireWksInfo( (diWKSHandle)pw, strmPtr->itemMask, &numValues, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetWksInfoReply ); - WritePEXBufferReply(pexGetWksInfoReply); - } - return( err ); - -} /* end-PEXGetWksInfo() */ - -/*++ PEXGetDynamics - --*/ -ErrorCode -PEXGetDynamics( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetDynamicsReq *strmPtr; -{ - ErrorCode err = Success; - DrawablePtr pdraw = 0; - extern ddBuffer *pPEXBuffer; - pexGetDynamicsReply *reply = (pexGetDynamicsReply *)(pPEXBuffer->pHead); - - LU_DRAWABLE(strmPtr->drawable, pdraw); - SETUP_INQ(pexGetDynamicsReply); - - err = InquireWksDynamics (pdraw, (ddWksDynamics *)&(reply->viewRep)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = 0; - WritePEXReplyToClient(cntxtPtr, strmPtr, sizeof(pexGetDynamicsReply), reply); - return( err ); - -} /* end-PEXGetDynamics() */ - -/*++ PEXGetViewRep - --*/ - -ErrorCode -PEXGetViewRep( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetViewRepReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - extern ddBuffer *pPEXBuffer; - pexGetViewRepReply *reply = (pexGetViewRepReply *)(pPEXBuffer->pHead); - pexViewRep *View1, *View2; - unsigned long size = 0; - - LU_PHIGSWKS(strmPtr->wks, pw); - - SETUP_INQ(pexGetViewRepReply); - - if (pPEXBuffer->bufSize < size) { - err = puBuffRealloc(pPEXBuffer, size); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - reply = (pexGetViewRepReply *)(pPEXBuffer->pHead); - } - - View1 = (pexViewRep *)(pPEXBuffer->pBuf); - View2 = View1 + 1; - err = InquireViewRep( (diWKSHandle)pw, strmPtr->index, - &(reply->viewUpdate), View1, View2); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - size = sizeof(pexViewRep); - reply->length = 2 * LWORDS(size); - size = (sizeof(CARD32) * reply->length) + sizeof(pexGetViewRepReply); - WritePEXReplyToClient (cntxtPtr, strmPtr, size, reply); - return( err ); - -} /* end-PEXGetViewRep() */ - -/*++ PEXRedrawAllStructures - --*/ -ErrorCode -PEXRedrawAllStructures( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexRedrawAllStructuresReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->id, pw); - - err = RedrawStructures ((diWKSHandle)pw); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXRedrawAllStructures() */ - -/*++ PEXUpdateWorkstation - --*/ -ErrorCode -PEXUpdateWorkstation (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexUpdateWorkstationReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->id, pw); - - err = UpdateWks((diWKSHandle)pw); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXUpdateWorkstation() */ - -/*++ PEXExecuteDeferredActions - --*/ - -ErrorCode -PEXExecuteDeferredActions( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexExecuteDeferredActionsReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->id, pw); - - err = ExecuteDeferred ((diWKSHandle)pw); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXExecuteDeferredActions() */ - -/*++ PEXSetViewPriority - --*/ -ErrorCode -PEXSetViewPriority( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetViewPriorityReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->wks, pw); - - err = SetViewPriority( (diWKSHandle)pw, strmPtr->index1, strmPtr->index2, - strmPtr->priority); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetViewPriority() */ - -/*++ PEXSetDisplayUpdateMode - --*/ -ErrorCode -PEXSetDisplayUpdateMode( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetDisplayUpdateModeReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->wks, pw); - - err = SetDisplayUpdateMode ((diWKSHandle)pw, strmPtr->displayUpdate); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetDisplayUpdateMode() */ - -/*++ PEXMapDCtoWC - --*/ -ErrorCode -PEXMapDCtoWC( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexMapDCtoWCReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - extern ddBuffer *pPEXBuffer; - pexMapDCtoWCReply *reply; - unsigned long reply_size; - - LU_PHIGSWKS(strmPtr->wks, pw); - - SETUP_INQ(pexMapDCtoWCReply); - - pPEXBuffer->dataSize = strmPtr->numCoords * sizeof(pexCoord3D); - reply_size = pPEXBuffer->dataSize + sizeof(pexMapDCtoWCReply); - if (pPEXBuffer->bufSize < reply_size) - if (err = puBuffRealloc(pPEXBuffer, reply_size)) return (err); - - reply = (pexMapDCtoWCReply *)(pPEXBuffer->pHead); - - err = MapDcWc( (diWKSHandle)pw, strmPtr->numCoords, (pexDeviceCoord *)(strmPtr+1), - &(reply->numCoords), (pexCoord3D *)(pPEXBuffer->pBuf), - &(reply->viewIndex)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = LWORDS(pPEXBuffer->dataSize); - WritePEXBufferReply(pexMapDCtoWCReply); - return (err); - -} /* end-PEXMapDCtoWC() */ - -/*++ PEXMapWCtoDC - --*/ -ErrorCode -PEXMapWCtoDC( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexMapWCtoDCReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - extern ddBuffer *pPEXBuffer; - pexMapWCtoDCReply *reply; - unsigned long reply_size; - - LU_PHIGSWKS(strmPtr->wks, pw); - - SETUP_INQ(pexMapWCtoDCReply); - - pPEXBuffer->dataSize = strmPtr->numCoords * sizeof(pexDeviceCoord); - reply_size = pPEXBuffer->dataSize + sizeof(pexMapWCtoDCReply); - if (pPEXBuffer->bufSize < reply_size) - if (err = puBuffRealloc(pPEXBuffer, reply_size)) return (err); - - reply = (pexMapWCtoDCReply *)(pPEXBuffer->pHead); - - err = MapWcDc( (diWKSHandle)pw, strmPtr->numCoords, - (pexCoord3D *)(strmPtr + 1), strmPtr->index, - &(reply->numCoords), (pexDeviceCoord *)(pPEXBuffer->pBuf)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = LWORDS(pPEXBuffer->dataSize); - WritePEXBufferReply(pexMapWCtoDCReply); - return( err ); - -} /* end-PEXMapWCtoDC() */ - -/*++ PEXSetViewRep - --*/ -ErrorCode -PEXSetViewRep (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetViewRepReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->wks, pw); - CHECK_FP_FORMAT (strmPtr->fpFormat); - - err = SetViewRep ((diWKSHandle)pw, &(strmPtr->viewRep)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetViewRep() */ - -/*++ PEXSetWksWindow - --*/ - -ErrorCode -PEXSetWksWindow( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetWksWindowReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS(strmPtr->wks, pw); - CHECK_FP_FORMAT (strmPtr->fpFormat); - - return (SetWksWindow((diWKSHandle)pw, &(strmPtr->npcSubvolume))); - -} /* end-PEXSetWksWindow() */ - -/*++ PEXSetWksViewport - --*/ - -ErrorCode -PEXSetWksViewport( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetWksViewportReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS (strmPtr->wks, pw); - CHECK_FP_FORMAT (strmPtr->fpFormat); - - return(SetWksViewport ((diWKSHandle)pw, &(strmPtr->viewport))); - -} /* end-PEXSetWksViewport() */ - -/*++ PEXSetHlhsrMode - --*/ - -ErrorCode -PEXSetHlhsrMode( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetHlhsrModeReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS( strmPtr->wks, pw); - - return (SetHlhsrMode((diWKSHandle)pw, strmPtr->mode)); - -} /* end-PEXSetHlhsrMode() */ - - -/*++ PEXSetWksBufferMode - --*/ -ErrorCode -PEXSetWksBufferMode (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetWksBufferModeReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS( strmPtr->wks, pw); - - return (SetBufferMode((diWKSHandle)pw, strmPtr->bufferMode)); -} - - -/*++ PEXPostStructure - --*/ -ErrorCode -PEXPostStructure (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexPostStructureReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - diStructHandle pstr = 0; - - LU_PHIGSWKS (strmPtr->wks, pw); - - LU_STRUCTURE(strmPtr->sid, pstr); - - return (PostStructure ((diWKSHandle)pw, pstr, strmPtr->priority)); - -} /* end-PEXPostStructure() */ - -/*++ PEXUnpostStructure - --*/ - -ErrorCode -PEXUnpostStructure( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexUnpostStructureReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - diStructHandle pstr = 0; - - LU_PHIGSWKS (strmPtr->wks, pw); - - LU_STRUCTURE(strmPtr->sid, pstr); - - return (UnpostStructure ((diWKSHandle)pw, pstr)); - -} /* end-PEXUnpostStructure() */ - -/*++ PEXUnpostAllStructures - --*/ - -ErrorCode -PEXUnpostAllStructures( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexUnpostAllStructuresReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS (strmPtr->id, pw); - - return (UnpostAllStructures ((diWKSHandle)pw)); - -} /* end-PEXUnpostAllStructures() */ -ErrorCode -PEXGetWksPostings( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetWksPostingsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - - LU_STRUCTURE(strmPtr->id, pstr); - - SETUP_INQ(pexGetWksPostingsReply); - - err = InquireWksPostings (pstr, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetWksPostingsReply); - WritePEXBufferReply(pexGetWksPostingsReply); - } - - return( err ); - -} /* end-PEXGetWksPostings() */ - -/*++ PEXRedrawClipRegion - --*/ -ErrorCode -PEXRedrawClipRegion( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexRedrawClipRegionReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - - LU_PHIGSWKS (strmPtr->wks, pw); - - return (RedrawClipRegion( (diWKSHandle)pw, strmPtr->numRects, - (ddDeviceRect *)(strmPtr+1))); -} - -/*++ FreeWksDrawable - --*/ -#define LostDrawable(w) \ - LostXResource((diResourceHandle)(w),WORKSTATION_RESOURCE,X_DRAWABLE_RESOURCE) - -FreeWksDrawable(ptr, id) -dipexWksDrawable *ptr; -Drawable id; -{ - dipexWksDrawableLink *plink = 0, *pnext = 0; - - if (!ptr) return (Success); - - if (ptr->id == PEXAlreadyFreed) { - xfree((pointer)ptr); - return(Success); } - - if (ptr->id != id) { - ErrorF( "Corrupted wks-drawable list: %d %d", id, ptr->id); } else - if (ptr->wks_list) { - LostDrawable(ptr->wks_list->wks); - - /* first link is allocated in the same chunk as the header */ - plink = ptr->wks_list->next; - ptr->wks_list = 0; - while (plink) { - pnext = plink->next; - LostDrawable(plink->wks); - xfree((pointer)plink); - plink = pnext; - } } - - xfree((pointer)ptr); - - return (Success); -} -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexPick.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexPick.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexPick.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexPick.c:3.8 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexPick.c Sat Feb 28 21:41:55 2004 @@ -1,288 +0,0 @@ -/* $Xorg: pexPick.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexPick.c,v 3.8 2001/12/14 19:57:44 dawes Exp $ */ - - -/*++ - * --- Workstation Picking --- - * - * PEXCreatePickMeasure - * PEXFreePickMeasure - * PEXGetPickDevice - * PEXChangePickDevice - * PEXGetPickMeasure - * PEXUpdatePickMeasure - * - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "dipex.h" -#include "PEXprotost.h" -#include "pex_site.h" -#include "ddpex4.h" -#include "pexLookup.h" -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -typedef struct { - pexElementRef *path; - pexNameSet inclusion; - pexNameSet exclusion; - long PET; - pexViewport viewport; - pexSwitch status; - pexSwitch order; - pexSwitch echo_switch; - unsigned char *record; -} dipickdev; - - -/*++ PEXCreatePickMeasure - --*/ -ErrorCode -PEXCreatePickMeasure (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePickMeasureReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode freePickMeasure(); - diPMHandle pmh; - dipexPhigsWks *pw = 0; - extern ErrorCode FreePickMeasure(); - - pmh = (diPMHandle)LookupIDByType(strmPtr->pm, PEXPickType); - if (pmh) PEX_ERR_EXIT(BadIDChoice,strmPtr->pm,cntxtPtr); - - pmh = (diPMHandle) xalloc ((unsigned long)sizeof(ddPMResource)); - if (!pmh) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - LU_PHIGSWKS (strmPtr->wks, pw); - - pmh->id = strmPtr->pm; - err = CreatePickMeasure ((diWKSHandle)pw, strmPtr->devType, pmh); - if (err){ - xfree((pointer)pmh); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - ADDRESOURCE(strmPtr->pm, PEXPickType, pmh); - - return( err ); - -} /* end-PEXCreatePickMeasure() */ - -/*++ PEXFreePickMeasure - --*/ -ErrorCode -PEXFreePickMeasure (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreePickMeasureReq *strmPtr; -{ - diPMHandle pmh = 0; - ErrorCode err = Success; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXPickMeasureError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_PICKMEASURE (strmPtr->id, pmh); - - FreeResource(strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreePickMeasure() */ - -/*++ PEXGetPickDevice - --*/ - -ErrorCode -PEXGetPickDevice( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetPickDeviceReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - extern ddBufferPtr pPEXBuffer; - CARD32 numItems; - - LU_PHIGSWKS(strmPtr->wks, pw); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - SETUP_INQ(pexGetPickDeviceReply); - - err = InquirePickDevice((diWKSHandle)pw, strmPtr->devType, strmPtr->itemMask, - &numItems, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetPickDeviceReply); - WritePEXBufferReply(pexGetPickDeviceReply); - } - return( err ); - -} /* end-PEXGetPickDevice() */ - -/*++ PEXChangePickDevice - --*/ - -ErrorCode -PEXChangePickDevice( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangePickDeviceReq *strmPtr; -{ - ErrorCode err = Success; - dipexPhigsWks *pw = 0; - CARD32 *ptr = (CARD32 *)(strmPtr+1); - - LU_PHIGSWKS(strmPtr->wks, pw); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - if (strmPtr->itemMask & PEXPDPickStatus) ptr++; - - if (strmPtr->itemMask & PEXPDPickPath) { - pexPickElementRef *per; - diStructHandle sh, *psh; - CARD32 i, numRefs = *((CARD32 *)(ptr)); - ptr++; - for (i=0, per = (pexPickElementRef *)ptr; isid,sh); - psh = (diStructHandle *)&(per->sid); - *psh = sh; - } - ptr = (CARD32 *)per; - } - - if (strmPtr->itemMask & PEXPDPickPathOrder) ptr++; - - if (strmPtr->itemMask & PEXPDPickIncl) { - diNSHandle temp; - LU_NAMESET(*ptr, temp); - *ptr = (CARD32)temp; - ptr++; - } - - if (strmPtr->itemMask & PEXPDPickExcl) { - diNSHandle temp; - LU_NAMESET(*ptr, temp); - *ptr = (CARD32)temp; - } - - err = ChangePickDevice( (diWKSHandle)pw, strmPtr->devType, strmPtr->itemMask, - (ddPointer)(strmPtr + 1)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangePickDevice() */ - -/*++ PEXGetPickMeasure - --*/ - -ErrorCode -PEXGetPickMeasure( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetPickMeasureReq *strmPtr; -{ - ErrorCode err = Success; - diPMHandle pmh; - extern ddBufferPtr pPEXBuffer; - CARD32 numItems; - - LU_PICKMEASURE (strmPtr->pm, pmh); - - SETUP_INQ(pexGetPickMeasureReply); - - err = InquirePickMeasure( pmh, strmPtr->itemMask, - &numItems, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetPickMeasureReply); - WritePEXBufferReply(pexGetPickMeasureReply); - } - return( err ); - -} /* end-PEXGetPickMeasure() */ - -/*++ PEXUpdatePickMeasure - --*/ - -ErrorCode -PEXUpdatePickMeasure( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexUpdatePickMeasureReq *strmPtr; -{ - ErrorCode err = Success; - diPMHandle pmh; - - LU_PICKMEASURE (strmPtr->pm, pmh); - - err = UpdatePickMeasure (pmh, strmPtr->numBytes, (ddPointer)(strmPtr + 1)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXUpdatePickMeasure() */ - - -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c:3.8 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c Sat Feb 28 21:41:55 2004 @@ -1,1526 +0,0 @@ -/* $Xorg: pexRndr.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexRndr.c,v 3.8 2001/12/14 19:57:44 dawes Exp $ */ - -/*++ - * PEXCreateRenderer - * PEXFreeRenderer - * PEXChangeRenderer - * PEXGetRendererAttributes - * PEXBeginRendering - * PEXEndRendering - * PEXClearRenderer - * PEXFlushRenderer - * PEXInitRenderer - * PEXBeginStructure - * PEXEndStructure - * PEXRenderElements - * PEXAccumulateState - * PEXRenderNetwork - * PEXRenderOutputCommands - * PEXCopyAlphaToPixmap - * PEXCopyPixmapToAlpha - * PEXCopyPCToPipelineState - * PEXCopyPipelineStateToPC - * PEXCopyZBufferToPixmap - * PEXCopyPixmapToZBuffer - * PEXGetZBuffer - * PEXPutZBuffer - * PEXInitMultiPass - * PEXNextPass - * PEXNextPassWithoutReply ---*/ - -#ifdef min -#undef min -#endif -#ifdef max -#undef max -#endif - - -#include "X.h" -#include "pexError.h" -#include "ddpex3.h" -#include "ddpex4.h" -#include "pexLookup.h" -#include "dipex.h" -#include "pexExtract.h" -#include "pexUtils.h" -#include "pex_site.h" -#include "scrnintstr.h" -#include "pexos.h" - - -#ifndef PEX_BUFFER_CHUNK -#define PEX_BUFFER_CHUNK 1024 -#endif - -#define CHANGELUT(LUT_INDEX, REND_DYN_CHANGE_BIT) { \ - diLUTHandle plut = 0; \ - LU_TABLE((*((CARD32 *)ptr)), plut); \ - SKIP_PADDING(ptr,sizeof(CARD32)); \ - if (prend->lut[LUT_INDEX]) { \ - err = UpdateLUTRefs( prend->lut[LUT_INDEX], \ - (diResourceHandle)(prend),\ - (ddResourceType)RENDERER_RESOURCE, \ - (ddAction)REMOVE); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); } \ - prend->lut[LUT_INDEX] = plut; \ - err = UpdateLUTRefs( prend->lut[LUT_INDEX], \ - (diResourceHandle)(prend), \ - (ddResourceType)RENDERER_RESOURCE, \ - (ddAction)ADD); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); \ - prend->tablesChanges |= REND_DYN_CHANGE_BIT; \ - } - -#define CHANGENS(NS_INDEX, REND_DYN_CHANGE_BIT) { \ - diNSHandle pns = 0; \ - LU_NAMESET(((pexNameSet)(*((CARD32 *)ptr))),pns); \ - SKIP_PADDING(ptr,sizeof(CARD32)); \ - if (prend->ns[(unsigned)(NS_INDEX)]) { \ - err = UpdateNSRefs( prend->ns[(unsigned)(NS_INDEX)], \ - (diResourceHandle)(prend), \ - (ddResourceType)RENDERER_RESOURCE, \ - (ddAction)REMOVE); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); } \ - prend->ns[(unsigned)(NS_INDEX)] = pns; \ - err = UpdateNSRefs( pns, (diResourceHandle)(prend), \ - (ddResourceType)RENDERER_RESOURCE, \ - (ddAction)ADD); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); \ - prend->namesetsChanges |= REND_DYN_CHANGE_BIT; \ - } - - -#define CHK_PEX_BUF(SIZE,INCR,REPLY,TYPE,PTR) { \ - (SIZE)+=(INCR); \ - if (pPEXBuffer->bufSize < (SIZE)) { \ - ErrorCode err = Success; \ - int offset = (int)(((unsigned char *)(PTR)) - ((unsigned char *)(pPEXBuffer->pHead))); \ - err = puBuffRealloc(pPEXBuffer,(ddULONG)(SIZE)); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); \ - (REPLY) = (TYPE *)(pPEXBuffer->pHead); \ - (PTR) = (unsigned char *)(pPEXBuffer->pHead + offset); } \ - } - - - -#define CountOnes(mask, countReturn) \ - { \ - register unsigned long y; \ - y = ((mask) >> 1) &033333333333; \ - y = (mask) - y - ((y >>1) & 033333333333); \ - countReturn = (((y + (y >> 3)) & 030707070707) % 077); \ - } - - -extern ErrorCode UpdatePCRefs(); - - -/*++ PEXCreateRenderer - --*/ -ErrorCode -PEXCreateRenderer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateRendererReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode freeRenderer(); - ddRendererStr *prend = 0; - CARD8 *ptr = (CARD8 *)(strmPtr+1); - XID fakepm, fakeStrID; - diStructHandle fakeStr; - ddPickPath fakeStrpp, sIDpp; - - - if (!LegalNewID(strmPtr->rdr, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->rdr,cntxtPtr); - - prend = (ddRendererStr *) xalloc ((unsigned long)(sizeof(ddRendererStr))); - if (!prend) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - prend->rendId = strmPtr->rdr; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - prend->drawExample.type = prend->pDrawable->type; - prend->drawExample.class = prend->pDrawable->class; - prend->drawExample.depth = prend->pDrawable->depth; - prend->drawExample.rootDepth = prend->pDrawable->pScreen->rootDepth; - prend->drawExample.rootVisual = prend->pDrawable->pScreen->rootVisual; - - prend->state = PEXIdle; - /* renderer dynamics masks are set by ddPEX */ - prend->tablesMask = 0; - prend->namesetsMask = 0; - prend->attrsMask = 0; - /* flags for ddPEX */ - prend->tablesChanges = 0; - prend->namesetsChanges = 0; - prend->attrsChanges = 0; - /* executeOCs table is set by ddPEX */ - - /* Defaults for Lookup Tables and Name Sets */ - prend->lut[PEXMarkerBundleLUT] = 0; prend->lut[PEXTextBundleLUT] = 0; - prend->lut[PEXLineBundleLUT] = 0; prend->lut[PEXInteriorBundleLUT] = 0; - prend->lut[PEXEdgeBundleLUT] = 0; prend->lut[PEXViewLUT] = 0; - prend->lut[PEXColourLUT] = 0; prend->lut[PEXDepthCueLUT] = 0; - prend->lut[PEXLightLUT] = 0; prend->lut[PEXColourApproxLUT] = 0; - prend->lut[PEXPatternLUT] = 0; prend->lut[PEXTextFontLUT] = 0; - prend->ns[(unsigned)DD_HIGH_INCL_NS] = 0; - prend->ns[(unsigned)DD_HIGH_EXCL_NS] = 0; - prend->ns[(unsigned)DD_INVIS_INCL_NS] = 0; - prend->ns[(unsigned)DD_INVIS_EXCL_NS] = 0; - prend->ns[(unsigned)DD_PICK_INCL_NS] = 0; - prend->ns[(unsigned)DD_PICK_EXCL_NS] = 0; - - /* Create the Psuedo Pick Measure. Real values are filled - in with ChangePsuedoPickMeasure called by BeginPickXXX routines - */ - fakepm = FakeClientID(cntxtPtr->client->index); - prend->pickstr.client = cntxtPtr->client; - prend->pickstr.pseudoPM = (diPMHandle) xalloc ((unsigned long)sizeof(ddPMResource)); - if (!prend->pickstr.pseudoPM) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - (prend->pickstr.pseudoPM)->id = fakepm; - err = CreatePseudoPickMeasure (prend); - if (err){ - xfree((pointer)(prend->pickstr.pseudoPM)); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - /* the fakepm resource gets added at the end of this routine now */ - - - /* create listoflist for doing Pick All */ - prend->pickstr.list = puCreateList(DD_LIST_OF_LIST); - prend->immediateMode = TRUE; - - /* create a phony structure to pack OCs into - for doing immediate mode renderer picking - */ - fakeStr = (diStructHandle)xalloc((unsigned long) - sizeof(ddStructResource)); - if (!fakeStr) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - fakeStr->id = -666; - err = CreateStructure(fakeStr); - if (err) { - xfree((pointer)(fakeStr)); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - /* Now create 2 ddPickPaths, one for the fakeStrlist and the other - for maintaining the correspondence between the user supplied - structure ID and the structure handle - */ - - fakeStrpp.structure = fakeStr; - fakeStrpp.offset = 0; - fakeStrpp.pickid = 0; - prend->pickstr.fakeStrlist = puCreateList(DD_PICK_PATH); - err = puAddToList((ddPointer) &fakeStrpp, (ddULONG) 1, prend->pickstr.fakeStrlist); - if (err != Success) return(err); - - sIDpp.structure = fakeStr; - sIDpp.offset = 0; - sIDpp.pickid = 0; - prend->pickstr.sIDlist = puCreateList(DD_PICK_PATH); - err = puAddToList((ddPointer) &sIDpp, (ddULONG) 1, prend->pickstr.sIDlist); - if (err != Success) return(err); - - - if (strmPtr->itemMask & PEXRDPipelineContext) { - ddPCStr *ppc = 0; - LU_PIPELINECONTEXT((*((CARD32 *)ptr)), ppc); - prend->pPC = ppc; - SKIP_PADDING(ptr,sizeof(CARD32)); - err = UpdatePCRefs (ppc, prend, (ddAction)ADD); - if (err != Success) { - xfree((pointer)prend); - PEX_ERR_EXIT(err,0,cntxtPtr); } - } else prend->pPC = 0; - - - prend->curPath = puCreateList(DD_ELEMENT_REF); - if (!(prend->curPath)) { - xfree((pointer)prend); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - if (strmPtr->itemMask & PEXRDCurrentPath) { - unsigned long npaths; - - /* Protocol says ignore this so skip past it in the Request Stream */ - npaths = *(CARD32 *)ptr; - SKIP_PADDING(ptr,sizeof(CARD32)); - SKIP_STRUCT(ptr, npaths, pexElementRef); - } - - if (strmPtr->itemMask & PEXRDMarkerBundle) - CHANGELUT(PEXMarkerBundleLUT, PEXDynMarkerBundle); - - if (strmPtr->itemMask & PEXRDTextBundle) - CHANGELUT(PEXTextBundleLUT, PEXDynTextBundle); - - if (strmPtr->itemMask & PEXRDLineBundle) - CHANGELUT(PEXLineBundleLUT, PEXDynLineBundle); - - if (strmPtr->itemMask & PEXRDInteriorBundle) - CHANGELUT(PEXInteriorBundleLUT, PEXDynInteriorBundle); - - if (strmPtr->itemMask & PEXRDEdgeBundle) - CHANGELUT(PEXEdgeBundleLUT, PEXDynEdgeBundle); - - if (strmPtr->itemMask & PEXRDViewTable) - CHANGELUT(PEXViewLUT, PEXDynViewTable); - - if (strmPtr->itemMask & PEXRDColourTable) - CHANGELUT(PEXColourLUT, PEXDynColourTable); - - if (strmPtr->itemMask & PEXRDDepthCueTable) - CHANGELUT(PEXDepthCueLUT, PEXDynDepthCueTable); - - if (strmPtr->itemMask & PEXRDLightTable) - CHANGELUT(PEXLightLUT, PEXDynLightTable); - - if (strmPtr->itemMask & PEXRDColourApproxTable) - CHANGELUT(PEXColourApproxLUT, PEXDynColourApproxTable); - - if (strmPtr->itemMask & PEXRDPatternTable) - CHANGELUT(PEXPatternLUT, PEXDynPatternTable); - - if (strmPtr->itemMask & PEXRDTextFontTable) - CHANGELUT(PEXTextFontLUT, PEXDynTextFontTable); - - if (strmPtr->itemMask & PEXRDHighlightIncl) - CHANGENS(DD_HIGH_INCL_NS, PEXDynHighlightNameset); - - if (strmPtr->itemMask & PEXRDHighlightExcl) - CHANGENS(DD_HIGH_EXCL_NS, PEXDynHighlightNameset); - - if (strmPtr->itemMask & PEXRDInvisibilityIncl) - CHANGENS(DD_INVIS_INCL_NS, PEXDynInvisibilityNameset); - - if (strmPtr->itemMask & PEXRDInvisibilityExcl) - CHANGENS(DD_INVIS_EXCL_NS, PEXDynInvisibilityNameset); - - if (strmPtr->itemMask & PEXRDRendererState) { - /* Protocol says ignore this it's read-only */ - SKIP_PADDING(ptr,sizeof(CARD32)); - } - - if (strmPtr->itemMask & PEXRDHlhsrMode) { - EXTRACT_INT16_FROM_4B(prend->hlhsrMode,ptr); - } else prend->hlhsrMode = PEXHlhsrOff; /* default */ - - if (strmPtr->itemMask & PEXRDNpcSubvolume) { - EXTRACT_COORD3D(&(prend->npcSubvolume.minval),ptr); - EXTRACT_COORD3D(&(prend->npcSubvolume.maxval),ptr); - } else { /* defaults */ - prend->npcSubvolume.minval.x = 0.0; - prend->npcSubvolume.minval.y = 0.0; - prend->npcSubvolume.minval.z = 0.0; - prend->npcSubvolume.maxval.x = 1.0; - prend->npcSubvolume.maxval.y = 1.0; - prend->npcSubvolume.maxval.z = 1.0; - }; - - - if (strmPtr->itemMask & PEXRDViewport) { - EXTRACT_INT16(prend->viewport.minval.x,ptr); - EXTRACT_INT16(prend->viewport.minval.y,ptr); - EXTRACT_FLOAT(prend->viewport.minval.z,ptr); - EXTRACT_INT16(prend->viewport.maxval.x,ptr); - EXTRACT_INT16(prend->viewport.maxval.y,ptr); - EXTRACT_FLOAT(prend->viewport.maxval.z,ptr); - EXTRACT_CARD8(prend->viewport.useDrawable,ptr); - SKIP_PADDING(ptr,(sizeof(CARD8)+sizeof(CARD16))); - } else { /* default */ - prend->viewport.useDrawable = 1; - prend->viewport.maxval.z = 1.0; - prend->viewport.minval.z = 0.0; - } - - - prend->clipList = puCreateList(DD_DEVICE_RECT); - if (!(prend->clipList)) { - puDeleteList(prend->curPath); - if (prend->pPC) - (void)UpdatePCRefs (prend->pPC, prend, (ddAction)(REMOVE)); - xfree((pointer)prend); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - if (strmPtr->itemMask & PEXRDClipList) { - unsigned long nrects; - EXTRACT_CARD32(nrects,ptr); - puAddToList((ddPointer)ptr, nrects, prend->clipList); - SKIP_STRUCT(ptr, nrects, pexDeviceRect); - }; /* else prend->clipList = 0;*/ /* default */ - - if (strmPtr->itemMask & PEXRDPickInclusion) { - CHANGENS(DD_PICK_INCL_NS, PEXDynPickNameset); - } - - if (strmPtr->itemMask & PEXRDPickExclusion) { - CHANGENS(DD_PICK_EXCL_NS, PEXDynPickNameset); - } - - - prend->pickStartPath = puCreateList(DD_PICK_PATH); - if (!(prend->pickStartPath)) { - xfree((pointer)prend); - PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - } - if (strmPtr->itemMask & PEXRDPickStartPath) { - pexElementRef *per; - diStructHandle sh, *psh; - ddPickPath *ppath, *ppathStart; - CARD32 i, numpaths; - extern ddpex3rtn ValidatePickPath(); - - /* must convert list of Element Ref into Pick Path for internal - storage and use - */ - EXTRACT_CARD32( numpaths, ptr); - ppathStart = (ddPickPath *)xalloc(numpaths * sizeof(ddPickPath)); - ppath = ppathStart; - - for (i=0, per = (pexElementRef *)ptr; istructure,sh); - ppath->structure = sh; - ppath->offset = per->offset; - ppath->pickid = 0; - } - - puAddToList((ddPointer)ppathStart, numpaths, prend->pickStartPath); - err = ValidatePickPath(prend->pickStartPath); - if (err != Success) PEX_ERR_EXIT(err,0,cntxtPtr); - ptr = (unsigned char *)per; - xfree((pointer)ppathStart); - } - - if (strmPtr->itemMask & PEXRDBackgroundColour) { - EXTRACT_COLOUR_SPECIFIER(prend->backgroundColour,ptr); - } - else /* default */ - { - prend->backgroundColour.colourType = PEXIndexedColour; - prend->backgroundColour.colour.indexed.index = 0; - } - - if (strmPtr->itemMask & PEXRDClearI) { - EXTRACT_CARD8_FROM_4B(prend->clearI,ptr); - } - else /* default */ - prend->clearI = xFalse; - - if (strmPtr->itemMask & PEXRDClearZ) { - EXTRACT_CARD8_FROM_4B(prend->clearZ,ptr); - } - else /* default */ - prend->clearZ = xTrue; - - if (strmPtr->itemMask & PEXRDEchoMode) { - EXTRACT_CARD16_FROM_4B(prend->echoMode,ptr); - } - else /* default */ - prend->echoMode = PEXNoEcho; - - /* set the default echoColour */ - prend->echoColour.colourType = PEXIndexedColour; - prend->echoColour.colour.indexed.index = 0; - - err = InitRenderer(prend); - if (err) { - puDeleteList(prend->clipList); - puDeleteList(prend->curPath); - if (prend->pPC) - (void)UpdatePCRefs (prend->pPC, prend, (ddAction)(REMOVE)); - xfree((pointer)prend); - PEX_ERR_EXIT(err,0,cntxtPtr); - }; - - ADDRESOURCE(strmPtr->rdr, PEXRendType, prend); - ADDRESOURCE(fakepm, PEXPickType, prend->pickstr.pseudoPM); - return( err ); - -} /* end-PEXCreateRenderer() */ - -/*++ - freeRenderer - --*/ -ErrorCode -FreeRenderer (prend, id) -ddRendererStr *prend; -pexRenderer id; -{ - ddPickPath *strpp; - ErrorCode err = Success; - CARD32 i; - - if (prend) { - DeleteDDContext(prend->pDDContext); - - puDeleteList(prend->clipList); - puDeleteList(prend->curPath); - puDeleteList(prend->pickStartPath); - puDeleteList(prend->pickstr.list); - strpp = (ddPickPath *)(prend->pickstr.fakeStrlist)->pList; - DeleteStructure(strpp[0].structure, (strpp[0].structure)->id ); - puDeleteList(prend->pickstr.fakeStrlist); - puDeleteList(prend->pickstr.sIDlist); - - if (prend->pPC) (void)UpdatePCRefs(prend->pPC,prend,(ddAction)REMOVE); - for (i = 1; i < PEXMaxTableType+1; i++ ) { - if (prend->lut[i]) { - err = UpdateLUTRefs( prend->lut[i], - (diResourceHandle)(prend), - (ddResourceType)RENDERER_RESOURCE, - (ddAction)REMOVE); - if (err) return(err); - } - } - for (i = 0; i != DD_MAX_FILTERS; i++ ) { - if (prend->ns[(unsigned)i]) { - err = UpdateNSRefs( prend->ns[(unsigned)i], - (diResourceHandle)(prend), - (ddResourceType)RENDERER_RESOURCE, - (ddAction)REMOVE); - if (err) return(err); - } - } - - xfree((pointer)prend); - } - - return( err ); -} - -/*++ PEXFreeRenderer - --*/ - -ErrorCode -PEXFreeRenderer (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreeRendererReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXRendererError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_RENDERER(strmPtr->id, prend); - - FreeResource(strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreeRenderer() */ - -/*++ PEXChangeRenderer - --*/ - -ErrorCode -PEXChangeRenderer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangeRendererReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - CARD8 *ptr = (CARD8 *)(strmPtr+1); - - LU_RENDERER(strmPtr->rdr, prend); - - if (strmPtr->itemMask & PEXRDPipelineContext) { - ddPCStr *ppc = 0, *old_ppc = 0; - old_ppc = prend->pPC; - if (old_ppc) (void)UpdatePCRefs (old_ppc, prend, (ddAction)REMOVE); - LU_PIPELINECONTEXT((*((CARD32 *)ptr)), ppc); - SKIP_PADDING(ptr,sizeof(CARD32)); - err = UpdatePCRefs (ppc, prend, (ddAction)ADD); - if (err != Success) { - xfree((pointer)prend); - PEX_ERR_EXIT(err,0,cntxtPtr); } - prend->pPC = ppc; - }; - - if (strmPtr->itemMask & PEXRDCurrentPath) { - /* Protocol Spec says ignore this field it is read-only */ - CARD32 i; - i = *(CARD32 *)ptr; - SKIP_PADDING(ptr,sizeof(CARD32)); - SKIP_STRUCT(ptr, i, pexElementRef); - } - - if (strmPtr->itemMask & PEXRDMarkerBundle) - CHANGELUT(PEXMarkerBundleLUT, PEXDynMarkerBundle); - - if (strmPtr->itemMask & PEXRDTextBundle) - CHANGELUT(PEXTextBundleLUT, PEXDynTextBundle); - - if (strmPtr->itemMask & PEXRDLineBundle) - CHANGELUT(PEXLineBundleLUT, PEXDynLineBundle); - - if (strmPtr->itemMask & PEXRDInteriorBundle) - CHANGELUT(PEXInteriorBundleLUT, PEXDynInteriorBundle); - - if (strmPtr->itemMask & PEXRDEdgeBundle) - CHANGELUT(PEXEdgeBundleLUT, PEXDynEdgeBundle); - - if (strmPtr->itemMask & PEXRDViewTable) - CHANGELUT(PEXViewLUT, PEXDynViewTable); - - if (strmPtr->itemMask & PEXRDColourTable) - CHANGELUT(PEXColourLUT, PEXDynColourTable); - - if (strmPtr->itemMask & PEXRDDepthCueTable) - CHANGELUT(PEXDepthCueLUT, PEXDynDepthCueTable); - - if (strmPtr->itemMask & PEXRDLightTable) - CHANGELUT(PEXLightLUT, PEXDynLightTable); - - if (strmPtr->itemMask & PEXRDColourApproxTable) - CHANGELUT(PEXColourApproxLUT, PEXDynColourApproxTable); - - if (strmPtr->itemMask & PEXRDPatternTable) - CHANGELUT(PEXPatternLUT, PEXDynPatternTable); - - if (strmPtr->itemMask & PEXRDTextFontTable) - CHANGELUT(PEXTextFontLUT, PEXDynTextFontTable); - - if (strmPtr->itemMask & PEXRDHighlightIncl) - CHANGENS(DD_HIGH_INCL_NS, PEXDynHighlightNameset); - - if (strmPtr->itemMask & PEXRDHighlightExcl) - CHANGENS(DD_HIGH_EXCL_NS, PEXDynHighlightNameset); - - if (strmPtr->itemMask & PEXRDInvisibilityIncl) - CHANGENS(DD_INVIS_INCL_NS, PEXDynInvisibilityNameset); - - if (strmPtr->itemMask & PEXRDInvisibilityExcl) - CHANGENS(DD_INVIS_EXCL_NS, PEXDynInvisibilityNameset); - - if (strmPtr->itemMask & PEXRDRendererState) { - /* Spec says ignore this in Change Renderer */ - SKIP_PADDING(ptr,sizeof(CARD32)); - } - - if (strmPtr->itemMask & PEXRDHlhsrMode) { - EXTRACT_INT16_FROM_4B(prend->hlhsrMode,ptr); - prend->attrsChanges |= PEXDynHlhsrMode; - } - - if (strmPtr->itemMask & PEXRDNpcSubvolume) { - EXTRACT_COORD3D(&(prend->npcSubvolume.minval),ptr); - EXTRACT_COORD3D(&(prend->npcSubvolume.maxval),ptr); - prend->attrsChanges |= PEXDynNpcSubvolume; - } - - if (strmPtr->itemMask & PEXRDViewport) { - EXTRACT_INT16(prend->viewport.minval.x,ptr); - EXTRACT_INT16(prend->viewport.minval.y,ptr); - EXTRACT_FLOAT(prend->viewport.minval.z,ptr); - EXTRACT_INT16(prend->viewport.maxval.x,ptr); - EXTRACT_INT16(prend->viewport.maxval.y,ptr); - EXTRACT_FLOAT(prend->viewport.maxval.z,ptr); - EXTRACT_CARD8(prend->viewport.useDrawable,ptr); - SKIP_PADDING(ptr,(sizeof(CARD8)+sizeof(CARD16))); - prend->attrsChanges |= PEXDynViewport; - }; - - if (strmPtr->itemMask & PEXRDClipList) { - unsigned long nrects; - EXTRACT_CARD32(nrects,ptr); - PU_EMPTY_LIST(prend->clipList); - puAddToList((ddPointer)ptr, nrects, prend->clipList); - prend->attrsChanges |= PEXDynClipList; - SKIP_STRUCT(ptr, nrects, pexDeviceRect); - } - - if (strmPtr->itemMask & PEXRDPickInclusion) { - CHANGENS(DD_PICK_INCL_NS, PEXDynPickNameset); - } - - if (strmPtr->itemMask & PEXRDPickExclusion) { - CHANGENS(DD_PICK_EXCL_NS, PEXDynPickNameset); - } - - if (strmPtr->itemMask & PEXRDPickStartPath) { - pexElementRef *per; - diStructHandle sh, *psh; - ddPickPath *ppath, *ppathStart; - CARD32 i, numpaths; - extern ddpex3rtn ValidatePickPath(); - - /* must convert list of Element Ref into Pick Path for internal - storage and use - */ - EXTRACT_CARD32( numpaths, ptr); - ppathStart = (ddPickPath *)xalloc(numpaths * sizeof(ddPickPath)); - ppath = ppathStart; - - for (i=0, per = (pexElementRef *)ptr; istructure,sh); - ppath->structure = sh; - ppath->offset = per->offset; - ppath->pickid = 0; - } - - PU_EMPTY_LIST(prend->pickStartPath); - puAddToList((ddPointer)ppathStart, numpaths, prend->pickStartPath); - err = ValidatePickPath(prend->pickStartPath); - if (err != Success) PEX_ERR_EXIT(err,0,cntxtPtr); - ptr = (unsigned char *)per; - xfree((pointer)ppathStart); - } - - - if (strmPtr->itemMask & PEXRDBackgroundColour) { - EXTRACT_COLOUR_SPECIFIER(prend->backgroundColour,ptr); - } - - if (strmPtr->itemMask & PEXRDClearI) { - EXTRACT_CARD8_FROM_4B(prend->clearI,ptr); - } - - if (strmPtr->itemMask & PEXRDClearZ) { - EXTRACT_CARD8_FROM_4B(prend->clearZ,ptr); - } - - if (strmPtr->itemMask & PEXRDEchoMode) { - EXTRACT_CARD16_FROM_4B(prend->echoMode,ptr); - prend->attrsChanges |= PEXDynEchoMode; - } - - - return( err ); - -} /* end-PEXChangeRenderer() */ - -/*++ PEXGetRendererAttributes - --*/ -ErrorCode -PEXGetRendererAttributes( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetRendererAttributesReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - extern ddBuffer *pPEXBuffer; - pexGetRendererAttributesReply *reply - = (pexGetRendererAttributesReply *)(pPEXBuffer->pHead); - CARD8 *ptr = 0; - int size = 0; - CARD32 lwords_mask, num_lwords = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - SETUP_INQ(pexGetRendererAttributesReply); - ptr = (CARD8 *) (pPEXBuffer->pBuf); - - lwords_mask = strmPtr->itemMask - & ~(PEXRDNpcSubvolume | PEXRDViewport | PEXRDClipList | - PEXRDBackgroundColour); - CountOnes(lwords_mask, num_lwords); - num_lwords += ((strmPtr->itemMask & PEXRDCurrentPath) - ? (prend->curPath->numObj * sizeof(pexElementRef) / 4) + 1 - : 0); - num_lwords += ((strmPtr->itemMask & PEXRDPickStartPath) - ? (prend->pickStartPath->numObj * sizeof(pexElementRef) / 4) - + 1 : 0); - CHK_PEX_BUF(size, sizeof(pexGetRendererAttributesReply) - + num_lwords * sizeof(CARD32), - reply, pexGetRendererAttributesReply, ptr); - - if (strmPtr->itemMask & PEXRDPipelineContext) - PACK_CARD32(((prend->pPC) ? prend->pPC->PCid : 0), ptr); - - if (strmPtr->itemMask & PEXRDCurrentPath) { - pexStructure sid = 0; - unsigned long i; - ddElementRef *per = (ddElementRef *)(prend->curPath->pList); - PACK_CARD32( prend->curPath->numObj, ptr); - for (i=0; icurPath->numObj; i++, per++) { - /* Begin Structure uses the structure handle field to store the - ID so there is no need to look it up, just assign it - */ - sid = (pexStructure) per->structure; - PACK_CARD32(sid, ptr); - PACK_CARD32(per->offset, ptr); - } - } - - if (strmPtr->itemMask & PEXRDMarkerBundle) - PACK_CARD32( GetId(prend->lut[PEXMarkerBundleLUT]), ptr); - - if (strmPtr->itemMask & PEXRDTextBundle) - PACK_CARD32( GetId(prend->lut[PEXTextBundleLUT]), ptr); - - if (strmPtr->itemMask & PEXRDLineBundle) - PACK_CARD32( GetId(prend->lut[PEXLineBundleLUT]), ptr); - - if (strmPtr->itemMask & PEXRDInteriorBundle) - PACK_CARD32( GetId(prend->lut[PEXInteriorBundleLUT]), ptr); - - if (strmPtr->itemMask & PEXRDEdgeBundle) - PACK_CARD32( GetId(prend->lut[PEXEdgeBundleLUT]), ptr); - - if (strmPtr->itemMask & PEXRDViewTable) - PACK_CARD32( GetId(prend->lut[PEXViewLUT]), ptr); - - if (strmPtr->itemMask & PEXRDColourTable) - PACK_CARD32( GetId(prend->lut[PEXColourLUT]), ptr); - - if (strmPtr->itemMask & PEXRDDepthCueTable) - PACK_CARD32( GetId(prend->lut[PEXDepthCueLUT]), ptr); - - if (strmPtr->itemMask & PEXRDLightTable) - PACK_CARD32( GetId(prend->lut[PEXLightLUT]), ptr); - - if (strmPtr->itemMask & PEXRDColourApproxTable) - PACK_CARD32( GetId(prend->lut[PEXColourApproxLUT]), ptr); - - if (strmPtr->itemMask & PEXRDPatternTable) - PACK_CARD32( GetId(prend->lut[PEXPatternLUT]), ptr); - - if (strmPtr->itemMask & PEXRDTextFontTable) - PACK_CARD32( GetId(prend->lut[PEXTextFontLUT]), ptr); - - if (strmPtr->itemMask & PEXRDHighlightIncl) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_HIGH_INCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDHighlightExcl) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_HIGH_EXCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDInvisibilityIncl) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_INVIS_INCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDInvisibilityExcl) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_INVIS_EXCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDRendererState) PACK_CARD32( prend->state, ptr); - - if (strmPtr->itemMask & PEXRDHlhsrMode) PACK_CARD32( prend->hlhsrMode, ptr); - - if (strmPtr->itemMask & PEXRDNpcSubvolume) { - CHK_PEX_BUF(size, sizeof(pexNpcSubvolume), - reply, pexGetRendererAttributesReply, ptr); - PACK_COORD3D(&(prend->npcSubvolume.minval), ptr); - PACK_COORD3D(&(prend->npcSubvolume.maxval), ptr); - } - - if (strmPtr->itemMask & PEXRDViewport) { - CHK_PEX_BUF(size, sizeof(pexViewport), - reply, pexGetRendererAttributesReply, ptr); - PACK_INT16( prend->viewport.minval.x, ptr); - PACK_INT16( prend->viewport.minval.y, ptr); - PACK_FLOAT( prend->viewport.minval.z, ptr); - PACK_INT16( prend->viewport.maxval.x, ptr); - PACK_INT16( prend->viewport.maxval.y, ptr); - PACK_FLOAT( prend->viewport.maxval.z, ptr); - PACK_CARD8( prend->viewport.useDrawable, ptr); - SKIP_PADDING( ptr, (sizeof(CARD8)+sizeof(CARD16))); - } - - if (strmPtr->itemMask & PEXRDClipList) { - int num_bytes = prend->clipList->numObj * sizeof(pexDeviceRect); - CHK_PEX_BUF(size, sizeof(CARD32) + num_bytes, - reply, pexGetRendererAttributesReply, ptr); - PACK_CARD32(prend->clipList->numObj, ptr); - memcpy( (char *)ptr, (char *)(prend->clipList->pList), num_bytes); - ptr += num_bytes; - } - - if (strmPtr->itemMask & PEXRDPickInclusion) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_PICK_INCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDPickExclusion) - PACK_CARD32( GetId(prend->ns[(unsigned)DD_PICK_EXCL_NS]), ptr); - - if (strmPtr->itemMask & PEXRDPickStartPath) { - /* StartPath is stored as a Pick Path even though the spec - and encoding define it as an Element Ref since the Renderer - Pikcing needs to use it as a Pick Path - */ - pexStructure sid = 0; - unsigned long i; - ddPickPath *per = (ddPickPath *)(prend->pickStartPath->pList); - PACK_CARD32( prend->pickStartPath->numObj, ptr); - for (i=0; ipickStartPath->numObj; i++, per++) { - sid = GetId(per->structure); - PACK_CARD32(sid, ptr); - PACK_CARD32(per->offset, ptr); - } - } - - if (strmPtr->itemMask & PEXRDBackgroundColour) { - CHK_PEX_BUF(size, sizeof(CARD32) - + SIZE_COLOURSPEC(prend->backgroundColour), - reply, pexGetRendererAttributesReply, ptr); - PACK_COLOUR_SPECIFIER(prend->backgroundColour,ptr); - } - - if (strmPtr->itemMask & PEXRDClearI) PACK_CARD32( prend->clearI, ptr); - - if (strmPtr->itemMask & PEXRDClearZ) PACK_CARD32( prend->clearZ, ptr); - - if (strmPtr->itemMask & PEXRDEchoMode) PACK_CARD32( prend->echoMode, ptr); - - - reply->length = (unsigned long)(ptr) - (unsigned long)(pPEXBuffer->pBuf); - reply->length = LWORDS(reply->length); - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof(pexGetRendererAttributesReply) - + sizeof(CARD32) * reply->length, - reply); - - return( err ); - -} /* end-PEXGetRendererAttributes() */ - -/* - * Thexe requests provide support for client-side traversal. - * PEX currently provides only rendering support for client-side - * traversal: no picking and searching in the server for - * client-side or mixed mode structures. - */ - -/*++ PEXBeginRendering - --*/ -ErrorCode -PEXBeginRendering( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexBeginRenderingReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - /* set drawableId = 0 : this helps protect us if we error-return - out of the lookup id, and then later try to RenderOC's on this - renderer with a bad drawable */ - prend->drawableId = 0; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - - err = BeginRendering(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXBeginRendering() */ - -/*++ PEXEndRendering - --*/ -ErrorCode -PEXEndRendering( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEndRenderingReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = EndRendering(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXEndRendering() */ - -/*++ PEXClearRenderer - --*/ -ErrorCode -PEXClearRenderer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexClearRendererReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = ClearRenderer(prend, strmPtr->clearControl); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXClearRenderer() */ - -/*++ PEXFlushRenderer - --*/ -ErrorCode -PEXFlushRenderer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexFlushRendererReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = FlushRenderer(prend, strmPtr->flushFlag); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXFlushRenderer() */ - -/*++ PEXInitRenderer - --*/ -ErrorCode -PEXInitRenderer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexInitRendererReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = InitRenderer(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXInitRenderer() */ - -/*++ PEXBeginStructure - --*/ -ErrorCode -PEXBeginStructure( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexBeginStructureReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = BeginStructure (prend, strmPtr->sid); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXBeginStructure() */ - -/*++ PEXEndStructure - --*/ -ErrorCode -PEXEndStructure( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEndStructureReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->id, prend); - - err = EndStructure (prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXEndStructure() */ - -/*++ PEXRenderNetwork - --*/ -typedef struct { - pexRenderOutputCommandsReq header; - pexExecuteStructure data; -} fakeRenderNetwork; - -static fakeRenderNetwork froc = { - 0, /* reqType */ - PEX_RenderNetwork, /* opcode */ - sizeof(fakeRenderNetwork), /* length */ - SERVER_NATIVE_FP, /* fpFormat */ - 0, /* unused */ - 0, /* rdr */ - 1, /* numCommands */ - PEXOCExecuteStructure, /* elementType */ - sizeof(pexExecuteStructure), /* length */ - 0 /* id */ -}; -/*++ PEXRenderNetwork - --*/ -ErrorCode -PEXRenderNetwork( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexRenderNetworkReq *strmPtr; -{ - ErrorCode err = PEXNYI; - ddRendererStr *prend = 0; - diStructHandle ps = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_STRUCTURE(strmPtr->sid, ps); - - /* set drawableId = 0 : this helps protect us if we error-return - out of the lookup id, and then later try to RenderOC's on this - renderer with a bad drawable */ - prend->drawableId = 0; - - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - - err = BeginRendering(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - froc.header.reqType = strmPtr->reqType; - froc.header.rdr = strmPtr->rdr; - froc.data.id = strmPtr->sid; - err = PEXRenderOutputCommands(cntxtPtr, &(froc.header)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = EndRendering(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXRenderNetwork() */ - - -ErrorCode -PEXRenderElements( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexRenderElementsReq *strmPtr; -{ - ErrorCode err = PEXNYI; - ddRendererStr *prend = 0; - diStructHandle ps = 0; - ddElementRange *range; - - LU_RENDERER(strmPtr->rdr, prend); - LU_STRUCTURE(strmPtr->sid, ps); - - range = (ddElementRange *) &(strmPtr->range); - - err = RenderElements(prend, ps, range ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXRenderElements() */ - - -ErrorCode -PEXAccumulateState( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexAccumulateStateReq *strmPtr; -{ - ErrorCode err = PEXNYI; - ddRendererStr *prend = 0; - ddAccStStr *pAccSt = 0; - pexElementRef *per; - diStructHandle sh, *psh; - CARD32 i; - extern ddpex4rtn ValidateStructurePath(); - - LU_RENDERER(strmPtr->rdr, prend); - - pAccSt = (ddAccStStr *)xalloc((unsigned long)sizeof(ddAccStStr)); - if (!pAccSt) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - pAccSt->numElRefs = strmPtr->numElRefs; - pAccSt->Path = 0; - - per = (pexElementRef *)(strmPtr+1); - for (i = 0 ; i < strmPtr->numElRefs; i++, per++) { - LU_STRUCTURE(per->structure,sh); - psh = (diStructHandle *)&(per->structure); - *psh = sh; - } - - pAccSt->Path = puCreateList(DD_ELEMENT_REF); - if (!(pAccSt->Path)) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - puAddToList((ddPointer)(strmPtr+1), pAccSt->numElRefs, pAccSt->Path); - err = ValidateStructurePath(pAccSt->Path); - if (err != Success) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = AccumulateState(prend, pAccSt ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* clean up */ - puDeleteList(pAccSt->Path); - xfree((pointer)pAccSt); - - return( err ); - -} /* end-PEXAccumulateState() */ - - -ErrorCode -PEXGetRendererDynamics( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetRendererDynamicsReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - extern ddBuffer *pPEXBuffer; - pexGetRendererDynamicsReply *reply - = (pexGetRendererDynamicsReply *)pPEXBuffer->pHead; - - LU_RENDERER(strmPtr->id, prend); - - err = InquireRendererDynamics( prend, &(reply->tables), - &(reply->namesets), &(reply->attributes)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = 0; - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof(pexGetRendererDynamicsReply), reply); - return( err ); - -} /* end-PEXRenderNetwork() */ - -/*++ PEXRenderNetwork - --*/ -ErrorCode -PEXRenderOutputCommands( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexRenderOutputCommandsReq *strmPtr; -{ - CARD32 *curOC; - pexElementInfo *pe; - CARD32 i; - ErrorCode err = Success; - pexOutputCommandError *pErr; - ddRendererStr *prend = 0; - pexStructure *ps; - diStructHandle ph; - - LU_RENDERER(strmPtr->rdr, prend); - CHECK_FP_FORMAT (strmPtr->fpFormat); - - /* - Just in case, check the drawableId. It may have been freed - due to some race condition with client cleanup. - Since unlike phigs workstations resources, renderers don't - do implicit regeneration, we can just check here and we don't - have to do the complicated resource tracking like in pexPhigs.c - */ - LU_DRAWABLE(prend->drawableId, prend->pDrawable); - - for (i = 0, curOC = (CARD32 *)(strmPtr + 1); i < strmPtr->numCommands; - i++, curOC += pe->length ) { - pe = (pexElementInfo *)curOC; - if ((PEXOCAll < pe->elementType ) && (pe->elementType <= PEXMaxOC)) { - if (pe->elementType == PEXOCExecuteStructure) { - ps = &(((pexExecuteStructure *)(pe))->id); - LU_STRUCTURE(*ps, ph); - *ps = (pexStructure)(ph); - } - } - } - - err = RenderOCs(prend, strmPtr->numCommands, (strmPtr+1)); - - /* this line is useless pErr never gets returned from anywhere - if (err) PEX_OC_ERROR(pErr, cntxtPtr); - */ - - return( err ); - -} /* end-PEXRenderOutputCommands() */ - -ErrorCode -UpdateRendRefs ( pr, pc, type, flag) -ddRendererStr *pr; -pexPC pc; -unsigned long type; -unsigned long flag; -{ - -} - -/*++ PEXCopyAlphaToPixmap - --*/ -ErrorCode -PEXCopyAlphaToPixmap( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyAlphaToPixmapReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->pixmap, prend->pDrawable); - - err = CopyAlphaToPixmap(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyAlphaToPixmap() */ - -/*++ PEXCopyPixmapToAlpha - --*/ -ErrorCode -PEXCopyPixmapToAlpha( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyPixmapToAlphaReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->pixmap, prend->pDrawable); - - err = CopyPixmapToAlpha(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyPixmapToAlpha() */ - -/*++ PEXCopyZBufferToPixmap - --*/ -ErrorCode -PEXCopyZBufferToPixmap( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyZBufferToPixmapReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->pixmap, prend->pDrawable); - - err = CopyZBufferToPixmap(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyZBufferToPixmap() */ - -/*++ PEXCopyPixmapToZBuffer - --*/ -ErrorCode -PEXCopyPixmapToZBuffer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyPixmapToZBufferReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->pixmap, prend->pDrawable); - - err = CopyPixmapToZBuffer(prend, prend->pDrawable); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyPixmapToZBuffer() */ - -/*++ PEXCopyPCToPipelineState - --*/ -ErrorCode -PEXCopyPCToPipelineState( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyPCToPipelineStateReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - ddPCStr *ppc = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_PIPELINECONTEXT(strmPtr->pc, ppc); - - err = CopyPCToPipelineState(prend, ppc, strmPtr->itemMask); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyPCToPipelineState() */ - -/*++ PEXCopyPipelineStateToPC - --*/ -ErrorCode -PEXCopyPipelineStateToPC( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyPipelineStateToPCReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - ddPCStr *ppc = 0; - - LU_RENDERER(strmPtr->rdr, prend); - LU_PIPELINECONTEXT(strmPtr->pc, ppc); - - err = CopyPipelineStateToPC(prend, ppc, strmPtr->itemMask); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyPipelineStateToPC() */ - -/*++ PEXGetZBuffer - --*/ -ErrorCode -PEXGetZBuffer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetZBufferReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - extern ddBuffer *pPEXBuffer; - pexSwitch undefinedValues = 0; - ddULONG numValues = 0; - - LU_RENDERER(strmPtr->rdr, prend); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - SETUP_INQ(pexGetZBufferReply); - - err = GetZBuffer(prend, strmPtr->x, strmPtr->y, strmPtr->width, -strmPtr->height, strmPtr->normalizedValues, &numValues, &undefinedValues, -pPEXBuffer); - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetZBufferReply); - reply->numValues = numValues; - reply->undefinedValues = undefinedValues; - WritePEXBufferReply(pexGetZBufferReply); - } - - return( err ); - -} /* end-PEXGetZBuffer() */ - -/*++ PEXPutZBuffer - --*/ -ErrorCode -PEXPutZBuffer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexPutZBufferReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - ddPointer *Zbuffer; - - LU_RENDERER(strmPtr->rdr, prend); - CHECK_FP_FORMAT(strmPtr->fpFormat); - - Zbuffer = (ddPointer *)(strmPtr + 1); - - err = PutZBuffer(prend, strmPtr->x, strmPtr->y, strmPtr->width, -strmPtr->height, strmPtr->normalizedValues, strmPtr->numValues, Zbuffer); - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXGetZBuffer() */ - -/*++ PEXInitMultipass - --*/ -ErrorCode -PEXInitMultipass( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexInitMultipassReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = InitMultipass(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXInitMultipass() */ - -/*++ PEXNextPass - --*/ -ErrorCode -PEXNextPass( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexNextPassReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBuffer *pPEXBuffer; - pexNextPassReply *reply = (pexNextPassReply *)(pPEXBuffer->pHead); - ddRendererStr *prend = 0; - ddLONG count = 0; - - LU_RENDERER(strmPtr->rdr, prend); - SETUP_INQ(pexNextPassReply); - - err = NextPass(prend, strmPtr->multipass_control, &count); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - reply->length = 0; - reply->count = count; - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof(pexNextPassReply) + reply->length, - reply); - return( err ); - -} /* end-PEXNextPass() */ - -/*++ PEXNextPassWoutReply - --*/ -ErrorCode -PEXNextPassWoutReply( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexNextPassReq *strmPtr; -/* uses same structure as PEXNextPass*/ -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - err = NextPassWoutReply(prend, strmPtr->multipass_control ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXNextPassWoutReply() */ - -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexRndrPick.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexRndrPick.c:1.9 xc/programs/Xserver/PEX5/dipex/objects/pexRndrPick.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexRndrPick.c:1.9 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexRndrPick.c Sat Feb 28 21:41:55 2004 @@ -1,311 +0,0 @@ -/* $Xorg: pexRndrPick.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/************************************************************ - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -******************************************************************/ - - - -/*++ - * --- Renderer Picking --- - * PEXBeginPickOne - * PEXEndPickOne - * PEXPickOne - * PEXBeginPickAll - * PEXEndPickAll - * PEXPickAll - --*/ - -#include "X.h" -#define NEED_EVENTS -#include "Xproto.h" -#include "pexError.h" -#include "dipex.h" -#include "PEXprotost.h" -#include "pex_site.h" -#include "ddpex3.h" -#include "ddpex4.h" -#include "pexLookup.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - -/*++ Renderer Picking ++*/ - -ErrorCode -PEXBeginPickOne( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexBeginPickOneReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - pexPickRecord *pr = (pexPickRecord *)(strmPtr+1); - ddPickPath *sIDpp; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - /* this is evil but necessary, use the pickid field of the - sIDlist to store the structure ID that corresponds to the - top level fake structure - */ - sIDpp = (ddPickPath *)(prend->pickstr.sIDlist)->pList; - sIDpp->pickid = strmPtr->sid; - - prend->pickstr.pick_method = strmPtr->method; - prend->pickstr.state = DD_PICK_ONE; - prend->pickstr.server = DD_CLIENT; - - err = ChangePseudoPickMeasure (prend, pr); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* This is set up to use this instead of defining a BeginPickOne */ - err = BeginPicking(prend, prend->pickstr.pseudoPM); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); -} /* end-PEXBeginPickOne() */ - -ErrorCode -PEXEndPickOne( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEndPickOneReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - extern ddBufferPtr pPEXBuffer; - pexEndPickOneReply *reply = (pexEndPickOneReply*)(pPEXBuffer->pHead); - - LU_RENDERER(strmPtr->rdr, prend); - - if (prend->pickstr.state != DD_PICK_ONE) - PEX_ERR_EXIT(PEX_ERROR_CODE(PEXRendererStateError),0,cntxtPtr); - - SETUP_INQ(pexEndPickOneReply); - - err = EndPickOne(prend, pPEXBuffer, &(reply->numPickElRefs), - &(reply->pickStatus), &(reply->betterPick)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = EndPicking(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - reply->length = LWORDS(pPEXBuffer->dataSize); - WritePEXBufferReply(pexEndPickOneReply); - - } - return( err ); -} /* end-PEXEndPickOne() */ - -ErrorCode -PEXPickOne( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexPickOneReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBufferPtr pPEXBuffer; - ddRendererStr *prend = 0; - pexPickRecord *pr = (pexPickRecord *)(strmPtr+1); - pexPickOneReply *reply = (pexPickOneReply*)(pPEXBuffer->pHead); - - /* do stuff same as BeginPickOne */ - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - LU_STRUCTURE(strmPtr->sid, prend->pickstr.strHandle); - - prend->pickstr.pick_method = strmPtr->method; - prend->pickstr.state = DD_PICK_ONE; - prend->pickstr.server = DD_SERVER; - - err = ChangePseudoPickMeasure (prend, pr); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = BeginPicking(prend, prend->pickstr.pseudoPM); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* now call PickOne which does set up and calls the traverser */ - err = PickOne(prend); - - /* now do stuff same as EndPickOne */ - SETUP_INQ(pexPickOneReply); - - err = EndPickOne(prend, pPEXBuffer, &(reply->numPickElRefs), - &(reply->pickStatus), &(reply->betterPick)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = EndPicking(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - reply->length = LWORDS(pPEXBuffer->dataSize); - WritePEXBufferReply(pexPickOneReply); - } - return( err ); -} /* end-PEXPickOne() */ - -ErrorCode -PEXBeginPickAll( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexBeginPickAllReq *strmPtr; -{ - ErrorCode err = Success; - ddRendererStr *prend = 0; - pexPickRecord *pr = (pexPickRecord *)(strmPtr+1); - ddPickPath *sIDpp; - - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - /* this is evil but necessary, use the pickid field of the - sIDlist to store the structure ID that corresponds to the - top level fake structure - */ - sIDpp = (ddPickPath *)(prend->pickstr.sIDlist)->pList; - sIDpp->pickid = strmPtr->sid; - - prend->pickstr.pick_method = strmPtr->method; - prend->pickstr.state = DD_PICK_ALL; - prend->pickstr.server = DD_CLIENT; - prend->pickstr.send_event = strmPtr->sendEvent; - prend->pickstr.max_hits = strmPtr->pickMaxHits; - prend->pickstr.client = cntxtPtr->client; - - err = ChangePseudoPickMeasure (prend, pr); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* This is set up to use this instead of defining a BeginPickOne */ - err = BeginPicking(prend, prend->pickstr.pseudoPM); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); -} /* end-PEXBeginPickAll() */ - -ErrorCode -PEXEndPickAll( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexEndPickAllReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBufferPtr pPEXBuffer; - ddRendererStr *prend = 0; - - LU_RENDERER(strmPtr->rdr, prend); - - if (prend->pickstr.state != DD_PICK_ALL) - PEX_ERR_EXIT(err,0,cntxtPtr); - - SETUP_INQ(pexEndPickAllReply); - - err = EndPickAll(prend, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = EndPicking(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexEndPickAllReply); - WritePEXBufferReply(pexEndPickAllReply); - } - return( err ); -} /* end-PEXEndPickAll() */ - -ErrorCode -PEXPickAll( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexPickAllReq *strmPtr; -{ - ErrorCode err = Success; - extern ddBufferPtr pPEXBuffer; - ddRendererStr *prend = 0; - pexPickRecord *pr = (pexPickRecord *)(strmPtr+1); - - /* do stuff same as BeginPickAll */ - LU_RENDERER(strmPtr->rdr, prend); - LU_DRAWABLE(strmPtr->drawable, prend->pDrawable); - prend->drawableId = strmPtr->drawable; - - prend->pickstr.pick_method = strmPtr->method; - prend->pickstr.state = DD_PICK_ALL; - prend->pickstr.server = DD_SERVER; - prend->pickstr.max_hits = strmPtr->pickMaxHits; - - err = ChangePseudoPickMeasure (prend, pr); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = BeginPicking(prend, prend->pickstr.pseudoPM); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - /* now call PickAll which does set up and calls RenderElements */ - err = PickAll(prend); - - /* now do stuff same as EndPickOne */ - SETUP_INQ(pexPickAllReply); - - err = EndPickAll(prend, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - err = EndPicking(prend); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexPickAllReply); - - WritePEXBufferReply(pexPickAllReply); - } - return( err ); -} /* end-PEXPickAll() */ - - -/**** Renderer Pick Events ****/ - -ErrorCode -PEXMaxHitsReachedNotify(client, rendId) -ClientPtr client; -ddULONG rendId; -{ - pexMaxHitsReachedEvent mhre; - - mhre.type = PexEventBase + PEXMaxHitsReached; - mhre.sequenceNumber = client->sequence; - mhre.rdr = rendId; - - WriteEventsToClient (client, 1, (xEvent *) &mhre); - return(client->noClientException); -} -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexSc.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexSc.c:3.7 xc/programs/Xserver/PEX5/dipex/objects/pexSc.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexSc.c:3.7 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexSc.c Sat Feb 28 21:41:56 2004 @@ -1,571 +0,0 @@ -/* $Xorg: pexSc.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/PEX5/dipex/objects/pexSc.c,v 3.7 2001/12/14 19:57:44 dawes Exp $ */ - - -/*++ - * PEXCreateSearchContext - * PEXCopySearchContext - * PEXFreeSearchContext - * PEXGetSearchContext - * PEXChangeSearchContext - * PEXSearchNetwork - --*/ - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "dipex.h" -#include "PEXproto.h" -#include "pex_site.h" -#include "ddpex4.h" -#include "pexLookup.h" -#include "pexUtils.h" -#include "pexExtract.h" -#include "pexos.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - -#define SC_NS_LIMIT 20 /* arbitrary value */ - -#define CHK_PEX_BUF(SIZE,INCR,REPLY,TYPE,PTR) {\ - (SIZE)+=(INCR); \ - if (pPEXBuffer->bufSize < (SIZE)) { \ - ErrorCode err = Success; \ - int offset = (int)(((unsigned char *)(PTR)) - ((unsigned char *)(pPEXBuffer->pHead))); \ - err = puBuffRealloc(pPEXBuffer,(ddULONG)(SIZE)); \ - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); \ - (REPLY) = (TYPE *)(pPEXBuffer->pHead); \ - (PTR) = (unsigned char *)(pPEXBuffer->pHead + offset); } \ -} - -static ErrorCode -AddToNSPair( incl, excl, pair ) -diNSHandle incl, excl; -listofNSPair *pair; -{ - ddNSPair *ptr; - if (pair->numPairs >= pair->maxPairs) { - pair->maxPairs += SC_NS_LIMIT; - pair->pPairs = (ddNSPair *)xrealloc( (pointer)(pair->pPairs), - (unsigned long)(pair->maxPairs - * sizeof(ddNSPair))); - if (!pair->pPairs) return(BadAlloc); - } - ptr = pair->pPairs + (unsigned long)(pair->numPairs); - ptr->incl = incl; ptr->excl = excl; - pair->numPairs++; - - return( Success ); -} - - -/* - add things to a list which has number things in it and can - fill in up to end before needing to molt; shoe sizes come in quanta of incr - - note arrays of pointers do not point to contiguous structures - */ -static ErrorCode -diAddThingToArray( thing, array, number, end, incr) -unsigned long thing; -unsigned long **array; -int *number; -unsigned long *end; -int incr; -{ - int i = *number; - unsigned long *ptr = *array; - - /* check to see if it's in the array already */ - if ( i ) { - for ( ; i>0; i--, ptr++ ) if (*ptr == thing) - return(BadIDChoice); - }; - - if ((!array) || - ((int)(*array) + *number > (int)end)) { /* need more room in array */ - unsigned long **bigger_array; - bigger_array = - (unsigned long **)xrealloc((pointer)array, - (unsigned long)(sizeof(unsigned long) * - ((int)end - (int)*array + incr))); - if (!bigger_array) return(BadAlloc); - end += incr; - *array = *bigger_array; - }; - - *ptr = thing; - *number++; - return( Success ); -} - -static ErrorCode -diAddThingToList( thing, list, number, end, incr) -unsigned long thing; -unsigned long *list; -int *number; -unsigned long *end; -int incr; -{ - int i = *number; - unsigned long *ptr = list; - - /* check to see if it's in the list already */ - if ( i ) { - for ( ; i>0; i--, ptr++ ) if (*ptr == thing) - return(BadIDChoice); - }; - - if ((!list) || - ((int)(list) + *number > (int)end)) { /* need more room in list */ - unsigned long *bigger_list; - bigger_list = - (unsigned long *)xrealloc((pointer)list, - (unsigned long)(sizeof(unsigned long) * - ((int)end - (int)list + incr))); - if (!bigger_list) return(BadAlloc); - end += incr; - list = bigger_list; - }; - - *ptr = thing; - *number++; - return( Success ); -} - - -static ErrorCode -UpdateSearchContext (cntxtPtr, psc, itemMask, ptr) -pexContext *cntxtPtr; -ddSCStr *psc; -pexBitmask itemMask; -unsigned char *ptr; -{ - ErrorCode err = Success; - - if (itemMask & PEXSCPosition) { - EXTRACT_COORD3D (&(psc->position), ptr); - }; - - if (itemMask & PEXSCDistance) { - EXTRACT_FLOAT (psc->distance, ptr); - }; - - if (itemMask & PEXSCCeiling) { - EXTRACT_CARD16_FROM_4B (psc->ceiling, ptr); - } - - if (itemMask & PEXSCModelClipFlag) { - EXTRACT_CARD8_FROM_4B (psc->modelClipFlag, ptr); - } - - if (itemMask & PEXSCStartPath) { - pexElementRef *per; - diStructHandle sh, *psh; - CARD32 i, numRefs = 0; - extern ddpex4rtn ValidateStructurePath(); - - EXTRACT_CARD32 (numRefs, ptr); - for (i=0, per = (pexElementRef *)ptr; istructure,sh); - psh = (diStructHandle *)&(per->structure); - *psh = sh; - } - if (psc->startPath) puDeleteList(psc->startPath); - psc->startPath = puCreateList(DD_ELEMENT_REF); - if (!(psc->startPath)) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - puAddToList((ddPointer)ptr, numRefs, psc->startPath); - err = ValidateStructurePath(psc->startPath); - if (err != Success) PEX_ERR_EXIT(err,0,cntxtPtr); - ptr = (unsigned char *)per; - }; - - if (itemMask & PEXSCNormalList) { - unsigned long i, len; - pexNameSetPair *pnsp=0; - diNSHandle pi, pe; - EXTRACT_CARD32 (len, ptr); - for (i=0, pnsp = (pexNameSetPair *)ptr; iincl, pi); - LU_NAMESET (pnsp->excl, pe); - err = AddToNSPair(pi, pe, &(psc->normal)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - }; - - ptr = (unsigned char *)pnsp; - }; - - if (itemMask & PEXSCInvertedList) { - unsigned long i, len; - pexNameSetPair *pnsp=0; - diNSHandle pi, pe; - EXTRACT_CARD32 (len, ptr); - for (i=0, pnsp = (pexNameSetPair *)ptr; iincl, pi); - LU_NAMESET (pnsp->excl, pe); - err = AddToNSPair(pi, pe, &(psc->inverted)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - }; - - ptr = (unsigned char *)pnsp; - }; - - return( err ); -} - - -/*++ PEXCreateSearchContext - --*/ -ErrorCode -PEXCreateSearchContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateSearchContextReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode freeSearchContext(); - ddSCStr *psc; - unsigned char *ptr; - - if (!LegalNewID(strmPtr->sc, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->sc,cntxtPtr); - - CHECK_FP_FORMAT (strmPtr->fpFormat); - - psc = (ddSCStr *)xalloc((unsigned long)sizeof(ddSCStr)); - if (!psc) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - psc->id = strmPtr->sc; - psc->normal.numPairs=0; - psc->normal.maxPairs=SC_NS_LIMIT; - psc->normal.pPairs = - (ddNSPair *)xalloc(psc->normal.maxPairs * sizeof(ddNSPair)); - psc->inverted.numPairs=0; - psc->inverted.maxPairs=SC_NS_LIMIT; - psc->inverted.pPairs = - (ddNSPair *)xalloc(psc->inverted.maxPairs * sizeof(ddNSPair)); - - psc->position.x = psc->position.y = psc->position.z = 0.0; - psc->distance = 0.0; - psc->ceiling = 1; - psc->modelClipFlag = xFalse; - - if (strmPtr->itemMask & PEXSCStartPath) - psc->startPath = 0; /* list will be created in UpdateSearchContext */ - else - psc->startPath = puCreateList(DD_ELEMENT_REF); - - ptr = (unsigned char *) (strmPtr + 1); - - - err = UpdateSearchContext(cntxtPtr, psc, strmPtr->itemMask, ptr); - if (err) { - puDeleteList(psc->startPath); - xfree((pointer)psc); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - ADDRESOURCE(strmPtr->sc, PEXSearchType, psc); - return( err ); - -} /* end-PEXCreateSearchContext() */ - -/*++ PEXCopySearchContext - --*/ -ErrorCode -PEXCopySearchContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopySearchContextReq *strmPtr; -{ - ErrorCode err = Success; - ddSCStr *src, *dst; - - LU_SEARCHCONTEXT (strmPtr->src, src); - LU_SEARCHCONTEXT (strmPtr->dst, dst); - - if (strmPtr->itemMask & PEXSCPosition) dst->position = src->position; - - if (strmPtr->itemMask & PEXSCDistance) dst->distance = src->distance; - - if (strmPtr->itemMask & PEXSCCeiling) dst->ceiling = src->ceiling; - - if (strmPtr->itemMask & PEXSCModelClipFlag) - dst->modelClipFlag = src->modelClipFlag; - - if (strmPtr->itemMask & PEXSCStartPath) { - puDeleteList (dst->startPath); - dst->startPath = puCreateList(DD_ELEMENT_REF); - if (!dst->startPath->pList) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - puCopyList(src->startPath, dst->startPath); - }; - - - if (strmPtr->itemMask & PEXSCNormalList) { - xfree((pointer)(dst->normal.pPairs)); - dst->normal.pPairs = - (ddNSPair *) xalloc( (unsigned long)(src->normal.maxPairs * - sizeof(ddNSPair))); - if (! dst->normal.pPairs) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - memcpy( (char *)(dst->normal.pPairs), (char *)(src->normal.pPairs), - (int)(src->normal.numPairs * sizeof(ddNSPair))); - dst->normal.numPairs = src->normal.numPairs; - dst->normal.maxPairs = src->normal.maxPairs; - } - - - if (strmPtr->itemMask & PEXSCInvertedList) { - xfree((pointer)dst->inverted.pPairs); - dst->inverted.pPairs = - (ddNSPair *)xalloc((unsigned long)(src->inverted.maxPairs* - sizeof(ddNSPair))); - if (! dst->inverted.pPairs) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - memcpy( (char *)(dst->inverted.pPairs), (char *)(src->inverted.pPairs), - (int)(src->inverted.numPairs * sizeof(ddNSPair))); - dst->inverted.numPairs = src->inverted.numPairs; - dst->inverted.maxPairs = src->inverted.maxPairs; - } - - return( err ); - -} /* end-PEXCopySearchContext() */ - -ErrorCode -FreeSearchContext (ptr, id) -ddSCStr *ptr; -pexSC id; -{ - if (ptr->inverted.pPairs) xfree ((pointer)(ptr->inverted.pPairs)); - if (ptr->normal.pPairs) xfree ((pointer)(ptr->normal.pPairs)); - puDeleteList(ptr->startPath); - - xfree((pointer)ptr); - - return( Success ); -} - -/*++ PEXFreeSearchContext - --*/ -ErrorCode -PEXFreeSearchContext (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreeSearchContextReq *strmPtr; -{ - ErrorCode err = Success; - ddSCStr *psc; - - if ((strmPtr == NULL) || (strmPtr->id == 0)) { - err = PEX_ERROR_CODE(PEXSearchContextError); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - LU_SEARCHCONTEXT (strmPtr->id, psc); - - FreeResource(strmPtr->id, RT_NONE); - - return( err ); - -} /* end-PEXFreeSearchContext() */ - -/*++ PEXGetSearchContext - --*/ -ErrorCode -PEXGetSearchContext( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetSearchContextReq *strmPtr; -{ - ErrorCode err = Success; - ddSCStr *psc; - extern ddBuffer *pPEXBuffer; - unsigned char *ptr = 0; - pexGetSearchContextReply *reply - = (pexGetSearchContextReply *)(pPEXBuffer->pHead); - int size = 0; - - LU_SEARCHCONTEXT (strmPtr->sc, psc); - - CHK_PEX_BUF(size, sizeof(pexGetSearchContextReply), reply, - pexGetSearchContextReply, ptr); - SETUP_INQ(pexGetSearchContextReply); - ptr = pPEXBuffer->pBuf; - - if (strmPtr->itemMask & PEXSCPosition) { - CHK_PEX_BUF(size, sizeof(pexCoord3D), reply, pexGetSearchContextReply, - ptr); - PACK_COORD3D (&(psc->position), ptr); - }; - - if (strmPtr->itemMask & PEXSCDistance) { - CHK_PEX_BUF(size, sizeof(PEXFLOAT), reply, pexGetSearchContextReply, ptr); - PACK_FLOAT (psc->distance, ptr); - }; - - if (strmPtr->itemMask & PEXSCCeiling) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetSearchContextReply, ptr); - PACK_CARD32 (psc->ceiling, ptr); - } - - if (strmPtr->itemMask & PEXSCModelClipFlag) { - CHK_PEX_BUF(size, sizeof(CARD32), reply, pexGetSearchContextReply, ptr); - PACK_CARD32 (psc->modelClipFlag, ptr); - } - - if (strmPtr->itemMask & PEXSCStartPath) { - pexStructure sid = 0; - unsigned long i; - ddElementRef *per = (ddElementRef *)(psc->startPath->pList); - - CHK_PEX_BUF(size, - psc->startPath->numObj*sizeof(pexElementRef) +sizeof(CARD32), - reply, pexGetSearchContextReply,ptr); - PACK_CARD32(psc->startPath->numObj,ptr); - for (i=0; istartPath->numObj; i++, per++) { - sid = GetId(per->structure); - PACK_CARD32(sid, ptr); - PACK_CARD32(per->offset, ptr); - } - }; - - if (strmPtr->itemMask & PEXSCNormalList) { - int i; - ddNSPair *src; - pexNameSet *dst; - CHK_PEX_BUF(size, psc->normal.numPairs * 2 * sizeof(pexNameSet) + 4, - reply, pexGetSearchContextReply, ptr); - PACK_CARD32(psc->normal.numPairs, ptr); - for (i=0, src = psc->normal.pPairs, dst = (pexNameSet *)ptr; - inormal.numPairs; i++, src++) { - *dst++ = src->incl->id; - *dst++ = src->excl->id; } - ptr = (unsigned char *)dst; - }; - - if (strmPtr->itemMask & PEXSCInvertedList) { - int i; - ddNSPair *src; - pexNameSet *dst; - CHK_PEX_BUF(size, psc->inverted.numPairs * 2 * sizeof(pexNameSet) + 4, - reply, pexGetSearchContextReply, ptr); - PACK_CARD32(psc->inverted.numPairs, ptr); - for (i=0, src = psc->inverted.pPairs, dst = (pexNameSet *)ptr; - iinverted.numPairs; i++, src++) { - *dst++ = src->incl->id; - *dst++ = src->excl->id; } - ptr = (unsigned char *)dst; - }; - - reply->length = size - sizeof(pexGetSearchContextReply); - reply->length = LWORDS(reply->length); - WritePEXReplyToClient( cntxtPtr, strmPtr, - sizeof (pexGetSearchContextReply) + sizeof(CARD32) * reply->length, - reply); - - return( err ); - -} /* end-PEXGetSearchContext() */ - -/*++ PEXChangeSearchContext - --*/ -ErrorCode -PEXChangeSearchContext( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangeSearchContextReq *strmPtr; -{ - ErrorCode err = Success; - ddSCStr *psc; - unsigned char *ptr = (unsigned char *) (strmPtr + 1); - - LU_SEARCHCONTEXT (strmPtr->sc, psc); - - CHECK_FP_FORMAT (strmPtr->fpFormat); - - err = UpdateSearchContext(cntxtPtr, psc, strmPtr->itemMask, ptr); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangeSearchContext() */ - -/*++ PEXSearchNetwork - --*/ -ErrorCode -PEXSearchNetwork( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSearchNetworkReq *strmPtr; -{ - ErrorCode err = Success; - ddSCStr *psc; - extern ddBuffer *pPEXBuffer; - CARD32 numItems; - - LU_SEARCHCONTEXT (strmPtr->id, psc); - - SETUP_INQ(pexSearchNetworkReply); - - err = SearchNetwork (psc, &numItems, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexSearchNetworkReply); - reply->numItems = numItems; - WritePEXBufferReply(pexSearchNetworkReply); - } - return( err ); - -} /* end-PEXSearchNetwork() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexStr.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexStr.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexStr.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexStr.c:3.8 Fri Dec 14 14:57:44 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexStr.c Sat Feb 28 21:41:56 2004 @@ -1,591 +0,0 @@ -/* $Xorg: pexStr.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/*++ - * PEXCreateStructure - * PEXCopyStructure - * PEXDestroyStructures - * PEXGetStructureInfo - * PEXSetStructurePermission - * PEXGetElementInfo - * PEXGetStructuresInNetwork - * PEXGetAncestors - * PEXGetDescendants - * PEXFetchElements - * PEXSetEditingMode - * PEXSetElementPointer - * PEXSetElementPointerAtLabel - * PEXSetElementPointerAtPickID - * PEXElementSearch - * PEXStoreElements - * PEXDeleteElements - * PEXDeleteElementsToLabel - * PEXDeleteBetweenLabels - * PEXCopyElements - * PEXChangeStructureReferences - --*/ -#include "X.h" -#include "PEX.h" -#include "pexError.h" -#include "pex_site.h" -#include "pexLookup.h" -#include "ddpex4.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - -/*++ PEXCreateStructure - --*/ -ErrorCode -PEXCreateStructure (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateStructureReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode DeleteStructure (); - diStructHandle sh; - - if (!LegalNewID(strmPtr->id, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->id,cntxtPtr); - - sh = (diStructHandle)xalloc((unsigned long)sizeof(ddStructResource)); - if (!sh) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - sh->id = strmPtr->id; - err = CreateStructure(sh); - if (err) { - xfree((pointer)sh); - PEX_ERR_EXIT(err,0,cntxtPtr); - } - - ADDRESOURCE(strmPtr->id, PEXStructType, sh); - return( err ); - -} /* end-PEXCreateStructure() */ - -/*++ PEXCopyStructure - --*/ -ErrorCode -PEXCopyStructure (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyStructureReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle sh1, sh2; - - LU_STRUCTURE (strmPtr->src, sh1); - LU_STRUCTURE (strmPtr->dst, sh2); - - err = CopyStructure (sh1, sh2); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyStructure() */ - -/*++ PEXDeleteStructures - --*/ -PEXDestroyStructures (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDestroyStructuresReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle ps = 0; - int i; - pexStructure *pid; - - for ( i = 0, pid = (pexStructure *)(strmPtr+1); - (i < strmPtr->numStructures) && (err == Success); i++, pid++) { - LU_STRUCTURE(*pid, ps); - FreeResource (*pid, RT_NONE); - } - - return (err); - -} /* end-PEXDestroyStructures() */ - -/*++ PEXGetStructureInfo - --*/ -ErrorCode -PEXGetStructureInfo( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetStructureInfoReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - pexGetStructureInfoReply *reply - = (pexGetStructureInfoReply *)(pPEXBuffer->pHead); - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = InquireStructureInfo( strmPtr->fpFormat, pstr, - (ddBitmask)(strmPtr->itemMask), - &(reply->editMode), &(reply->elementPtr), - &(reply->numElements), &(reply->lengthStructure), - &(reply->hasRefs)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = 0; - WritePEXReplyToClient( cntxtPtr, strmPtr,sizeof(pexGetStructureInfoReply), - reply); - return( err ); - -} /* end-PEXGetStructureInfo() */ - -/*++ PEXSetStructurePermission - --*/ -ErrorCode -PEXSetStructurePermission( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetStructurePermissionReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = SetStructurePermission( pstr, strmPtr->permission ); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - return( err ); - -} /* end-PEXSetStructurePermission() */ - -/*++ PEXGetElementInfo - */ -ErrorCode -PEXGetElementInfo (cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetElementInfoReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numInfo; - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexGetElementInfoReply); - - err = InquireElementInfo( pstr, (ddElementRange *)&(strmPtr->range), - &numInfo, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetElementInfoReply); - reply->numInfo = numInfo; - WritePEXBufferReply(pexGetElementInfoReply); - } - return( err ); - -}/* end-PEXGetElementInfo */ - -/*++ PEXGetStructuresInNetwork - --*/ -ErrorCode -PEXGetStructuresInNetwork( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetStructuresInNetworkReq *strmPtr; -{ - ErrorCode err = PEXNOERR; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numStructures; - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexGetStructuresInNetworkReply); - - err = InquireStructureNetwork( pstr, strmPtr->which, &numStructures, - pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetStructuresInNetworkReply); - reply->numStructures = numStructures; - WritePEXBufferReply(pexGetStructuresInNetworkReply); - } - return( err ); - -} /* end-PEXGetStructuresInNetwork() */ - -/*++ PEXGetAncestors - --*/ -ErrorCode -PEXGetAncestors( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetAncestorsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numPaths; - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexGetAncestorsReply); - - err = InquireAncestors( pstr, strmPtr->pathOrder, strmPtr->pathDepth, - &numPaths, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetAncestorsReply); - reply->numPaths = numPaths; - WritePEXBufferReply(pexGetAncestorsReply); - } - return( err ); - -} /* end-PEXGetAncestors() */ - -/*++ PEXGetDescendants - --*/ -ErrorCode -PEXGetDescendants( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexGetDescendantsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numPaths; - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexGetDescendantsReply); - - err = InquireDescendants( pstr, strmPtr->pathOrder, strmPtr->pathDepth, - &numPaths, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexGetDescendantsReply); - reply->numPaths = numPaths; - WritePEXBufferReply(pexGetDescendantsReply); - } - return( err ); - -} /* end-PEXGetDescendants() */ - -/*++ PEXFetchElements - --*/ -ErrorCode -PEXFetchElements( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexFetchElementsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - CARD32 numElements; - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexFetchElementsReply); - - err = InquireElements (pstr, &(strmPtr->range), &numElements, pPEXBuffer); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - { - SETUP_VAR_REPLY(pexFetchElementsReply); - reply->numElements = numElements; - WritePEXBufferReply(pexFetchElementsReply); - } - return( err ); - -} /* end-PEXFetchElements */ - -/*++ PEXSetEditingMode - --*/ -ErrorCode -PEXSetEditingMode( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetEditingModeReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = SetEditMode (pstr, strmPtr->mode); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetEditingMode */ - -/*++ PEXSetElementPointer - --*/ -ErrorCode -PEXSetElementPointer( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetElementPointerReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = SetElementPointer (pstr, &(strmPtr->position)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetElementPointer() */ - -/*++ PEXSetElementPointerAtLabel - --*/ -ErrorCode -PEXSetElementPointerAtLabel( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetElementPointerAtLabelReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = SetElementPointerAtLabel (pstr, strmPtr->label, strmPtr->offset); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetElementPointerAtLabel() */ - -/*++ PEXSetElementPointerAtPickID - --*/ -ErrorCode -PEXSetElementPointerAtPickID( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexSetElementPointerAtPickIDReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = SetElementPointerAtPickID (pstr, strmPtr->pickId, strmPtr->offset); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXSetElementPointerAtLabel() */ - -/*++ PEXElementSearch - --*/ -ErrorCode -PEXElementSearch( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexElementSearchReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - extern ddBuffer *pPEXBuffer; - pexElementSearchReply *reply = - (pexElementSearchReply *)(pPEXBuffer->pHead); - CARD16 *pincl = (CARD16 *)(strmPtr + 1); - - LU_STRUCTURE(strmPtr->sid, pstr); - - SETUP_INQ(pexElementSearchReply); - - err = ElementSearch( pstr, &(strmPtr->position), strmPtr->direction, - strmPtr->numIncls, strmPtr->numExcls, pincl, - pincl + strmPtr->numIncls + (strmPtr->numIncls %2), - &(reply->status), &(reply->foundOffset)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - - reply->length = 0; - WritePEXReplyToClient(cntxtPtr,strmPtr,sizeof(pexElementSearchReply),reply); - return( err ); - -} /* end-PEXElementSearch() */ - -/*++ PEXStoreElements - --*/ -ErrorCode -PEXStoreElements( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexStoreElementsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - int i; - pexElementInfo *pe = 0; - CARD32 *curOC; - pexStructure *ps; - diStructHandle ph; - pexOutputCommandError *pErr; - - LU_STRUCTURE(strmPtr->sid, pstr); - CHECK_FP_FORMAT (strmPtr->fpFormat); - - for (i = 0, curOC = (CARD32 *)(strmPtr + 1); - i < strmPtr->numCommands; - i++, curOC += pe->length ) { - pe = (pexElementInfo *)curOC; - if ((PEXOCAll < pe->elementType ) && (pe->elementType <= PEXMaxOC)) { - if (pe->elementType == PEXOCExecuteStructure) { - ps = &(((pexExecuteStructure *)(pe))->id); - LU_STRUCTURE(*ps, ph); - *ps = (pexStructure)(ph); - } - } - } - - err = StoreElements( pstr, - strmPtr->numCommands,(ddElementInfo *)(strmPtr+1), - &pErr); - - if (err == BadImplementation) PEX_ERR_EXIT(err,0,cntxtPtr) - else if (err) PEX_OC_ERROR(pErr, cntxtPtr); - - return( err ); - -} /* end-PEXStoreElements() */ - -/*++ PEXDeleteElements - --*/ -ErrorCode -PEXDeleteElements( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexDeleteElementsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = DeleteElements( pstr, &(strmPtr->range)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXDeleteElements */ - -/*++ PEXDeleteElementsToLabel - --*/ -ErrorCode -PEXDeleteElementsToLabel( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexDeleteElementsToLabelReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = DeleteToLabel (pstr, &(strmPtr->position), strmPtr->label); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXDeleteElementsToLabel() */ - -/*++ PEXDeleteBetweenLabels - --*/ -ErrorCode -PEXDeleteBetweenLabels( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexDeleteBetweenLabelsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pstr = 0; - - LU_STRUCTURE(strmPtr->sid, pstr); - - err = DeleteBetweenLabels (pstr, strmPtr->label1, strmPtr->label2); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXDeleteBetweenLabels() */ - -/*++ PEXCopyElements - --*/ - -ErrorCode -PEXCopyElements( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexCopyElementsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle ps1, ps2; - - LU_STRUCTURE (strmPtr->src, ps1); - LU_STRUCTURE (strmPtr->dst, ps2); - - err = CopyElements (ps1, &(strmPtr->srcRange), ps2, &(strmPtr->dstPosition)); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXCopyElements() */ - -/*++ Change Structure References - --*/ -ErrorCode -PEXChangeStructureRefs( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -pexChangeStructureRefsReq *strmPtr; -{ - ErrorCode err = Success; - diStructHandle pold = 0, pnew = 0; - - LU_STRUCTURE(strmPtr->old_id, pold); - LU_STRUCTURE(strmPtr->new_id, pnew); - - err = ChangeStructureReferences (pold, pnew); - if (err) PEX_ERR_EXIT(err,0,cntxtPtr); - return( err ); - -} /* end-PEXChangeStructureRefs() */ -/*++ - * - * End of File - * - --*/ Index: xc/programs/Xserver/PEX5/dipex/objects/pexTM.c diff -u xc/programs/Xserver/PEX5/dipex/objects/pexTM.c:3.8 xc/programs/Xserver/PEX5/dipex/objects/pexTM.c:removed --- xc/programs/Xserver/PEX5/dipex/objects/pexTM.c:3.8 Fri Dec 14 14:57:45 2001 +++ xc/programs/Xserver/PEX5/dipex/objects/pexTM.c Sat Feb 28 21:41:56 2004 @@ -1,148 +0,0 @@ -/* $Xorg: pexTM.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -*/ - - -#include "X.h" -#include "Xproto.h" -#include "pexError.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pexLookup.h" - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - - - -/*++ PEXCreateColorMipMapTM - --*/ -ErrorCode -PEXCreateColorMipMapTM (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateColorMipMapTMReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode FreeTM (), CreateColorMipMapTM (); - ddPointer Texel_Array; - ddTextureStr *ptext = 0; - - CHECK_FP_FORMAT (strmPtr->fpFormat); - - if (!LegalNewID(strmPtr->TMid, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->TMid,cntxtPtr); - - ptext = (ddTextureStr *) Xalloc ((unsigned long)(sizeof(ddTextureStr))); - if (!ptext) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - ptext->rendId = strmPtr->TMid; - - Texel_Array = (ddPointer *)(strmPtr + 1); - - err = CreateColorMipMapTM(strmPtr->TMid, strmPtr->TMDimension, - strmPtr->numLevels, strmPtr->texelType, Texel_Array, ptext); - - if (err) Xfree((pointer)ptext); - ADDRESOURCE(strmPtr->TMid, PEXTextureType, ptext); - - return( err ); - -} /* end-PEXCreateColorMipMapTM() */ - - -/*++ PEXCreateColorMipMapTM - --*/ -ErrorCode -PEXCreateColorMipMapfromRes (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateColorMipMapfromResReq *strmPtr; -{ - ErrorCode err = Success; - ErrorCode FreeTM (), CreateColorMipMapfromRes (); - ddPointer Texel_Array_Counts, resource_IDs; - ddTextureStr *ptext = 0; - - CHECK_FP_FORMAT (strmPtr->fpFormat); - - if (!LegalNewID(strmPtr->TMid, cntxtPtr->client)) - PEX_ERR_EXIT(BadIDChoice,strmPtr->TMid,cntxtPtr); - - ptext = (ddTextureStr *) Xalloc ((unsigned long)(sizeof(ddTextureStr))); - if (!ptext) PEX_ERR_EXIT(BadAlloc,0,cntxtPtr); - - ptext->rendId = strmPtr->TMid; - - Texel_Array_Counts = (ddPointer *)(strmPtr + 1); - if (strmPtr->TMDimension == TMDimension3D) - /* if dimension is 3D Texel_Array_Counts are each 8 bytes long - and there are numLevels of them */ - resource_IDs = (ddPointer *)(strmPtr + (strmPtr->numLevels*8)); - else - /* Texel_Array_Counts are each 4 bytes long, still numLevels of them */ - resource_IDs = (ddPointer *)(strmPtr + (strmPtr->numLevels*4)); - - /* leave it to the ddpex layer to decipher the color and alpha - resource IDs lists after it processes the Texel_Array_Counts */ - err = CreateColorMipMapfromRes(strmPtr->TMid, strmPtr->TMDimension, - strmPtr->numLevels, strmPtr->texelType, strmPtr->drawable, - Texel_Array_Counts, resource_IDs, ptext); - - if (err) Xfree((pointer)ptext); - ADDRESOURCE(strmPtr->TMid, PEXTextureType, ptext); - - return( err ); - -} /* end-PEXCreateColorMipMapfromRes() */ - -/*++ PEXFreeTM - --*/ -ErrorCode -PEXFreeTM (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFreeTMReq *strmPtr; -{ - ErrorCode err = Success; - - LU_NAMESET(strmPtr->id, pns); - - FreeResource(strmPtr->id, RT_NONE); - - return(err); - -} /* end-PEXFreeTM() */ - -/*++ - * - * End of File - --*/ Index: xc/programs/Xserver/PEX5/dipex/swap/ConvName.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/ConvName.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/ConvName.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/ConvName.ci:1.2 Fri Dec 14 14:57:45 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/ConvName.ci Sat Feb 28 21:41:56 2004 @@ -1,55 +0,0 @@ -/* $Xorg: ConvName.ci,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "ConvName.h" -#include SWAP_FILE - -#undef SWAP_FUNC_PREFIX -#undef SWAP_FUNC_PEX_PFX - Index: xc/programs/Xserver/PEX5/dipex/swap/ConvName.h diff -u xc/programs/Xserver/PEX5/dipex/swap/ConvName.h:3.3 xc/programs/Xserver/PEX5/dipex/swap/ConvName.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/ConvName.h:3.3 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/ConvName.h Sat Feb 28 21:41:56 2004 @@ -1,56 +0,0 @@ -/* $Xorg: ConvName.h,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define SWAP_FUNC_PREFIX(nm) c##nm -#define SWAP_FUNC_PEX_PFX(nm) cPEX##nm -#else -#define SWAP_FUNC_PREFIX(nm) c/**/nm -#define SWAP_FUNC_PEX_PFX(nm) cPEX/**/nm -#endif Index: xc/programs/Xserver/PEX5/dipex/swap/Convert.c diff -u xc/programs/Xserver/PEX5/dipex/swap/Convert.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/Convert.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/Convert.c:1.9 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/Convert.c Sat Feb 28 21:41:56 2004 @@ -1,137 +0,0 @@ -/* $Xorg: Convert.c,v 1.4 2001/02/09 02:04:14 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "pex_site.h" -#include "dipex.h" - - -extern void SwapIEEEToVax(); -extern void SwapVaxToIEEE(); -extern void ConvertIEEEToVax(); -extern void ConvertVaxToIEEE(); - -unsigned char temp; /* only used for conversions */ - - -/* Byte swap a long */ -void -SwapCARD32(i) -CARD32 *i; -{ - CARD8 n; - CARD8 *x = (CARD8 *)i; - - n = x[0]; - x[0] = x[3]; - x[3] = n; - n = x[1]; - x[1] = x[2]; - x[2] = n; - - return; -} - -/* Byte swap a short */ -void -SwapCARD16(i) -CARD16 *i; -{ - CARD8 n; - CARD8 *x = (CARD8 *)i; - - n = x[0]; - x[0] = x[1]; - x[1] = n; - - return; -} - - -/* Byte swap and convert a float */ -void -SwapIEEEToVax(f) -PEXFLOAT *f; -{ - - SwapCARD32((CARD32 *) f); - - ConvertIEEEToVax((PEXFLOAT *)(f)); - -} - - -void -SwapVaxToIEEE(f) -PEXFLOAT *f; -{ - SwapCARD32((CARD32 *) f); - - ConvertVaxToIEEE((PEXFLOAT *)(f)); - -} - - -/* Byte swap a float */ -void -SwapFLOAT (f) -PEXFLOAT *f; -{ - CARD8 n; - CARD8 *x = (CARD8 *)f; - - n = x[0]; - x[0] = x[3]; - x[3] = n; - n = x[1]; - x[1] = x[2]; - x[2] = n; - -} Index: xc/programs/Xserver/PEX5/dipex/swap/Imakefile diff -u xc/programs/Xserver/PEX5/dipex/swap/Imakefile:3.11 xc/programs/Xserver/PEX5/dipex/swap/Imakefile:removed --- xc/programs/Xserver/PEX5/dipex/swap/Imakefile:3.11 Wed Jan 17 17:12:39 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/Imakefile Sat Feb 28 21:41:56 2004 @@ -1,72 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:15 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/dipex/swap/Imakefile,v 3.11 2001/01/17 22:12:39 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PassCDebugFlags -#define PassCDebugFlags -#endif - -#ifndef PexDipexCDebugFlags -#define PexDipexCDebugFlags ServerCDebugFlags -#endif - - CDEBUGFLAGS = PexDipexCDebugFlags - DEFINES = PexDipexDefines - - LINTLIBS = ../../../dix/llib-ldix.ln \ - ../../../os/llib-los.ln \ - ../objects/llib-lobj.ln - - PEXSRVINC = ../../include - INCLUDES = -I. -I$(PEXSRVINC) -I$(XINCLUDESRC) -I$(SERVERSRC)/include - - -SRCS = convUtil.c cOCprim.c uOCprim.c floatconv.c check.c \ - OCattr.c OCcolour.c convReq.c uconvRep.c Convert.c \ - OCTables.c ReqTables.c RepTables.c convEv.c - -OBJS = convUtil.o cOCprim.o uOCprim.o floatconv.o check.o \ - OCattr.o OCcolour.o convReq.o uconvRep.o Convert.o \ - OCTables.o ReqTables.o RepTables.o convEv.o - - -PEX_SW_LIBNAME = libdiswapex.a - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(diswapex,$(OBJS)) - -LintLibraryTarget(dsw,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/PEX5/dipex/swap/OCTables.c diff -u xc/programs/Xserver/PEX5/dipex/swap/OCTables.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/OCTables.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCTables.c:1.9 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCTables.c Sat Feb 28 21:41:56 2004 @@ -1,68 +0,0 @@ -/* $Xorg: OCTables.c,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - Contains Output Commands for PEX - */ - -#include "X.h" -#include "PEXproto.h" -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "dix.h" -#include "dipex.h" -#include "pexSwap.h" - -#define LOCAL_FLAG extern - -/* Swap Convert Functions for OC's in Store Elements or Render OC */ -#include "cOCTables.ci" - -/* Unswap Unconvert Functions for OC's in replies (Fetch Elements) */ -#include "uOCTables.ci" Index: xc/programs/Xserver/PEX5/dipex/swap/OCattr.c diff -u xc/programs/Xserver/PEX5/dipex/swap/OCattr.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/OCattr.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCattr.c:1.9 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCattr.c Sat Feb 28 21:41:56 2004 @@ -1,772 +0,0 @@ -/* $Xorg: OCattr.c,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "pexError.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "ddpex.h" -#include "pexLookup.h" -#include "convertStr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG -#include "OCattr.h" - -/***************************************************************** - * Output Commands - *****************************************************************/ - -/* - OC Conversion routines do not chain to another routine, so that these - conversions may also be used for FetchElements and StoreElements, as - well as RenderOC; - */ - -ErrorCode -SwapPEXMarkerType (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarkerType *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->markerType); - -} - -ErrorCode -SwapPEXMarkerScale (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarkerScale *strmPtr; -{ - SWAP_FLOAT (strmPtr->scale); - -} - -ErrorCode -SwapPEXMarkerColourIndex (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarkerColourIndex *strmPtr; -{ - SWAP_TABLE_INDEX (strmPtr->index); - -} - -ErrorCode -SwapPEXMarkerBundleIndex (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarkerBundleIndex *strmPtr; -{ - SWAP_TABLE_INDEX (strmPtr->index); - -} - -/* -typedef pexMarkerColourIndex pexTextColourIndex; -typedef pexMarkerColourIndex pexSurfaceEdgeColourIndex; -typedef pexMarkerBundleIndex pexTextFontIndex; -typedef pexMarkerBundleIndex pexTextBundleIndex; -typedef pexMarkerBundleIndex pexLineBundleIndex; -typedef pexMarkerBundleIndex pexInteriorStyleIndex; -typedef pexMarkerBundleIndex pexBfInteriorStyleIndex; -typedef pexMarkerBundleIndex pexInteriorBundleIndex; -typedef pexMarkerBundleIndex pexEdgeBundleIndex; -typedef pexMarkerBundleIndex pexViewIndex; -typedef pexMarkerBundleIndex pexDepthCueIndex; -*/ - -ErrorCode -SwapPEXAtextStyle (swapPtr, strmPtr) -pexSwap *swapPtr; -pexAtextStyle *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->style); - -} - -ErrorCode -SwapPEXTextPrecision (swapPtr, strmPtr) -pexSwap *swapPtr; -pexTextPrecision *strmPtr; -{ - SWAP_CARD16 (strmPtr->precision); - -} - -ErrorCode -SwapPEXCharExpansion (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCharExpansion *strmPtr; -{ - SWAP_FLOAT (strmPtr->expansion); - -} - -ErrorCode -SwapPEXCharSpacing (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCharSpacing *strmPtr; -{ - SWAP_FLOAT (strmPtr->spacing); - -} - -ErrorCode -SwapPEXCharHeight (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCharHeight *strmPtr; -{ - SWAP_FLOAT (strmPtr->height); - -} - -/* typedef pexCharHeight pexAtextHeight;*/ - -ErrorCode -SwapPEXCharUpVector (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCharUpVector *strmPtr; -{ - SWAP_VECTOR2D (strmPtr->up); - -} - -/* typedef pexCharUpVector pexAtextUpVector; */ - -ErrorCode -SwapPEXTextPath (swapPtr, strmPtr) -pexSwap *swapPtr; -pexTextPath *strmPtr; -{ - SWAP_CARD16 (strmPtr->path); - -} - -/* typedef pexTextPath pexAtextPath;*/ - -ErrorCode -SwapPEXTextAlignment (swapPtr, strmPtr) -pexSwap *swapPtr; -pexTextAlignment *strmPtr; -{ - SWAP_TEXT_ALIGN_DATA (strmPtr->alignment); - -} - -/* typedef pexTextAlignment pexAtextAlignment;*/ - -ErrorCode -SwapPEXLineType (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLineType *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->lineType); - -} - -ErrorCode -SwapPEXLineWidth (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLineWidth *strmPtr; -{ - SWAP_FLOAT (strmPtr->width); - -} - -ErrorCode -SwapPEXLineColourIndex (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLineColourIndex *strmPtr; -{ - SWAP_TABLE_INDEX (strmPtr->index); - -} - -ErrorCode -SwapPEXCurveApproximation (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCurveApproximation *strmPtr; -{ - - SWAP_CURVE_APPROX (strmPtr->approx); - -} - -ErrorCode -SwapPEXPolylineInterp (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolylineInterp *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->polylineInterp); - -} - -ErrorCode -SwapPEXInteriorStyle (swapPtr, strmPtr) -pexSwap *swapPtr; -pexInteriorStyle *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->interiorStyle); - -} - -/* typedef pexInteriorStyle pexBfInteriorStyle;*/ - -ErrorCode -SwapPEXSurfaceColourIndex (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceColourIndex *strmPtr; -{ - SWAP_TABLE_INDEX (strmPtr->index); - -} - -/* typedef pexSurfaceColourIndex pexBfSurfaceColourIndex;*/ -/* typedef pexSurfaceColour pexBfSurfaceColour;*/ - -ErrorCode -SwapPEXSurfaceReflModel (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceReflModel *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->reflectionModel); - -} - - -/* typedef pexSurfaceReflModel pexBfSurfaceReflModel;*/ - -ErrorCode -SwapPEXSurfaceInterp (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceInterp *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->surfaceInterp); - -} - - -/* typedef pexSurfaceInterp pexBfSurfaceInterp;*/ - -ErrorCode -SwapPEXSurfaceApproximation (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceApproximation *strmPtr; -{ - - SwapSurfaceApprox (swapPtr, &(strmPtr->approx)); -} - -ErrorCode -SwapPEXCullingMode (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCullingMode *strmPtr; -{ - SWAP_CULL_MODE (strmPtr->cullMode); - -} - -ErrorCode -SwapPEXDistinguishFlag (swapPtr, strmPtr) -pexSwap *swapPtr; -pexDistinguishFlag *strmPtr; -{ - SWAP_CARD16 (strmPtr->distinguish); - -} - -ErrorCode -SwapPEXPatternSize (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPatternSize *strmPtr; -{ - SWAP_COORD2D (strmPtr->size); - -} - -ErrorCode -SwapPEXPatternRefPt (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPatternRefPt *strmPtr; -{ - SWAP_COORD2D (strmPtr->point); - -} - -ErrorCode -SwapPEXPatternAttr (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPatternAttr *strmPtr; -{ - SWAP_COORD3D (strmPtr->refPt); - SWAP_VECTOR3D (strmPtr->vector1); - SWAP_VECTOR3D (strmPtr->vector2); - -} - -ErrorCode -SwapPEXSurfaceEdgeFlag (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceEdgeFlag *strmPtr; -{ - -} - -ErrorCode -SwapPEXSurfaceEdgeType (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceEdgeType *strmPtr; -{ - SWAP_ENUM_TYPE_INDEX (strmPtr->edgeType); - -} - -ErrorCode -SwapPEXSurfaceEdgeWidth (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceEdgeWidth *strmPtr; -{ - SWAP_FLOAT (strmPtr->width); - -} - -ErrorCode -SwapPEXSetAsfValues (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSetAsfValues *strmPtr; -{ - SWAP_ASF_ATTR (strmPtr->attribute); - -} - -ErrorCode -SwapPEXLocalTransform (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLocalTransform *strmPtr; -{ - SWAP_COMPOSITION (strmPtr->compType); - SWAP_MATRIX (strmPtr->matrix); - -} - -ErrorCode -SwapPEXLocalTransform2D (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLocalTransform2D *strmPtr; -{ - SWAP_COMPOSITION (strmPtr->compType); - SWAP_MATRIX_3X3 (strmPtr->matrix3X3); - -} - -ErrorCode -SwapPEXGlobalTransform (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGlobalTransform *strmPtr; -{ - SWAP_MATRIX (strmPtr->matrix); - -} - -ErrorCode -SwapPEXGlobalTransform2D (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGlobalTransform2D *strmPtr; -{ - SWAP_MATRIX_3X3 (strmPtr->matrix3X3); - -} - -ErrorCode -SwapPEXModelClip (swapPtr, strmPtr) -pexSwap *swapPtr; -pexModelClip *strmPtr; -{ - -} - -ErrorCode -SwapPEXRestoreModelClip (swapPtr, strmPtr) -pexSwap *swapPtr; -pexRestoreModelClip *strmPtr; -{ - -} - - -ErrorCode -SwapPEXPickId (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPickId *strmPtr; -{ - SWAP_CARD32 (strmPtr->pickId); - -} - -ErrorCode -SwapPEXHlhsrIdentifier (swapPtr, strmPtr) -pexSwap *swapPtr; -pexHlhsrIdentifier *strmPtr; -{ - SWAP_CARD32 (strmPtr->hlhsrID); - -} - - -ErrorCode -SwapPEXExecuteStructure (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExecuteStructure *strmPtr; -{ - SWAP_STRUCTURE (strmPtr->id); - -} - -ErrorCode -SwapPEXLabel (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLabel *strmPtr; -{ - SWAP_CARD32 (strmPtr->label); - -} - -ErrorCode -SwapPEXApplicationData (swapPtr, strmPtr) -pexSwap *swapPtr; -pexApplicationData *strmPtr; -{ - SWAP_CARD16 (strmPtr->numElements); - -} - - ErrorCode -SwapPEXGse (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGse *strmPtr; -{ - SWAP_CARD32 (strmPtr->id); - SWAP_CARD16 (strmPtr->numElements); - -} - -ErrorCode -SwapPEXRenderingColourModel (swapPtr, strmPtr) -pexSwap *swapPtr; -pexRenderingColourModel *strmPtr; -{ - SWAP_INT16(strmPtr->model); -} - -ErrorCode -SwapPEXOCUnused (swapPtr, strmPtr) -pexSwap *swapPtr; -pexElementInfo *strmPtr; -{ -} - - -/***************************************************************** - * utilities * - *****************************************************************/ - -unsigned char * -SwapCoord4DList(swapPtr, ptr, num) -pexSwap *swapPtr; -pexCoord4D *ptr; -CARD32 num; -{ - pexCoord4D *pc; - int i; - for (i=0, pc = (pexCoord4D *)ptr; iformat.indexed); - ptr += sizeof(pexIndexedColour); - break; } - - case PEXRgbFloatColour: {SWAP_RGB_FLOAT_COLOUR(pc->format.rgbFloat); - ptr += sizeof(pexRgbFloatColour); - break; } - - case PEXCieFloatColour: {SWAP_CIE_COLOUR(pc->format.cieFloat); - ptr += sizeof(pexCieColour); - break; } - - case PEXHsvFloatColour: {SWAP_HSV_COLOUR(pc->format.hsvFloat); - ptr += sizeof(pexHsvColour); - break; } - - case PEXHlsFloatColour: {SWAP_HLS_COLOUR(pc->format.hlsFloat); - ptr += sizeof(pexHlsColour); - break; } - - case PEXRgb16Colour: {SWAP_RGB16_COLOUR(pc->format.rgb16); - ptr += sizeof(pexRgb16Colour); - break; } - case PEXRgb8Colour: {ptr += sizeof(pexRgb8Colour); - break; } - - } - return(ptr); -} - - - -void -SwapHalfSpace(swapPtr, ph) -pexSwap *swapPtr; -pexHalfSpace *ph; -{ - SWAP_COORD3D (ph->point); - SWAP_VECTOR3D (ph->vector); -} - -void -SwapHalfSpace2D(swapPtr, ph) -pexSwap *swapPtr; -pexHalfSpace2D *ph; -{ - SWAP_COORD2D (ph->point); - SWAP_VECTOR2D (ph->vector); -} - -unsigned char * -SwapOptData(swapPtr, po, vertexAttribs, colourType) -pexSwap *swapPtr; -unsigned char *po; -pexBitmaskShort vertexAttribs; -pexColourType colourType; -{ - if (vertexAttribs & PEXGAColour) { - switch (colourType) { - - case PEXIndexedColour: { - pexIndexedColour *pc = (pexIndexedColour *)po; - SWAP_INDEXED_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - case PEXRgbFloatColour: { - pexRgbFloatColour *pc = (pexRgbFloatColour *)po; - SWAP_RGB_FLOAT_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - case PEXCieFloatColour: { - pexCieColour *pc = (pexCieColour *)po; - SWAP_CIE_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - case PEXHsvFloatColour: { - pexHsvColour *pc = (pexHsvColour *)po; - SWAP_HSV_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - case PEXHlsFloatColour: { - pexHlsColour *pc = (pexHlsColour *)po; - SWAP_HLS_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - case PEXRgb8Colour: { - pexRgb8Colour *pc = (pexRgb8Colour *)po; - po = (unsigned char *)(pc+1); break; } - - case PEXRgb16Colour: { - pexRgb16Colour *pc = (pexRgb16Colour *)po; - SWAP_RGB16_COLOUR((*pc)); - po = (unsigned char *)(pc+1); break; } - - } - }; - - if (vertexAttribs & PEXGANormal) { - pexCoord3D *pn = (pexCoord3D *)po; - SWAP_VECTOR3D((*pn)); - po = (unsigned char *)(pn+1); - }; - - if (vertexAttribs & PEXGAEdges) { - CARD16 *pe = (CARD16 *)po; - SWAP_CARD16((*pe)); - po = (unsigned char *)(pe+2); /* padding too */ - }; - - return (po); -} - - -unsigned char * -SwapVertex(swapPtr, pv, vertexAttribs, colourType) -pexSwap *swapPtr; -pexVertex *pv; -pexBitmaskShort vertexAttribs; -pexColourType colourType; -{ - CARD8 *ptr; - SWAP_COORD3D ((pv->point)); - - ptr = SwapOptData( swapPtr, (unsigned char *)(pv+1), vertexAttribs, - colourType); - return (ptr); - -} - -void -SwapTextAlignmentData(swapPtr, ptr) -pexSwap *swapPtr; -pexTextAlignmentData *ptr; -{ - SWAP_TEXT_V_ALIGNMENT (ptr->vertical); - SWAP_TEXT_H_ALIGNMENT (ptr->horizontal); -} - - -SwapIndexedColourList(swapPtr, ptr, num) -pexSwap *swapPtr; -pexIndexedColour *ptr; -CARD32 num; -{ - int i; - for (i=0; i<(num); i++, ptr++){ - SWAP_INDEXED_COLOUR((*ptr)); - } -} - -SwapRgbFloatColourList(swapPtr, ptr, num) -pexSwap *swapPtr; -pexRgbFloatColour *ptr; -CARD32 num; -{ - int i; - pexRgbFloatColour *pc = ptr; - for (i=0; i<(num); i++, pc++){ - SWAP_RGB_FLOAT_COLOUR((*pc)); - } -} - - -void -SwapSurfaceApprox(swapPtr, ptr) -pexSwap *swapPtr; -pexSurfaceApprox *ptr; -{ - SWAP_ENUM_TYPE_INDEX (ptr->approxMethod); - SWAP_FLOAT (ptr->uTolerance); - SWAP_FLOAT (ptr->vTolerance); -} - - -unsigned char * -SwapTrimCurve(swapPtr, pTC) -pexSwap *swapPtr; -pexTrimCurve *pTC; -{ - int i; - pexCoord3D *pc; - PEXFLOAT *pf = 0; - unsigned char *ptr = 0; - SWAP_CARD16 (pTC->order); - SWAP_INT16 (pTC->approxMethod); - SWAP_FLOAT (pTC->tolerance); - SWAP_FLOAT (pTC->tMin); - SWAP_FLOAT (pTC->tMax); - - /* curveType, numKnots and numCoord are swapped by the calling routines */ - - for (i=0, pf = (PEXFLOAT *)(pTC+1); inumKnots; i++, pf++) - SWAP_FLOAT((*pf)); - - ptr = (unsigned char *)pf; - if (pTC->type == PEXRational) - ptr = SwapCoord3DList(swapPtr, (pexCoord3D *)ptr, pTC->numCoord); - else - ptr = SwapCoord2DList(swapPtr, (pexCoord2D *)ptr, pTC->numCoord); - - return ptr; -} Index: xc/programs/Xserver/PEX5/dipex/swap/OCattr.h diff -u xc/programs/Xserver/PEX5/dipex/swap/OCattr.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/OCattr.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCattr.h:1.2 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCattr.h Sat Feb 28 21:41:56 2004 @@ -1,108 +0,0 @@ -/* $Xorg: OCattr.h,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -LOCAL_FLAG ErrorCode - SwapPEXMarkerType (), - SwapPEXMarkerScale (), - SwapPEXMarkerColourIndex (), - SwapPEXMarkerBundleIndex (), - SwapPEXAtextStyle (), - SwapPEXTextPrecision (), - SwapPEXCharExpansion (), - SwapPEXCharSpacing (), - SwapPEXCharHeight (), - SwapPEXCharUpVector (), - SwapPEXTextPath (), - SwapPEXTextAlignment (), - SwapPEXLineType (), - SwapPEXLineWidth (), - SwapPEXLineColourIndex (), - SwapPEXCurveApproximation (), - SwapPEXPolylineInterp (), - SwapPEXInteriorStyle (), - SwapPEXSurfaceColourIndex (), - SwapPEXSurfaceReflModel (), - SwapPEXSurfaceInterp (), - SwapPEXSurfaceApproximation (), - SwapPEXCullingMode (), - SwapPEXDistinguishFlag (), - SwapPEXPatternSize (), - SwapPEXPatternRefPt (), - SwapPEXPatternAttr (), - SwapPEXSurfaceEdgeFlag (), - SwapPEXSurfaceEdgeType (), - SwapPEXSurfaceEdgeWidth (), - SwapPEXSetAsfValues (), - SwapPEXLocalTransform (), - SwapPEXLocalTransform2D (), - SwapPEXGlobalTransform (), - SwapPEXGlobalTransform2D (), - SwapPEXModelClip (), - SwapPEXRestoreModelClip (), - SwapPEXPickId (), - SwapPEXHlhsrIdentifier (), - SwapPEXExecuteStructure (), - SwapPEXLabel (), - SwapPEXApplicationData (), - SwapPEXGse (), - SwapPEXRenderingColourModel (), - SwapPEXOCUnused (); - -LOCAL_FLAG unsigned char * SwapCoord4DList (); -LOCAL_FLAG unsigned char * SwapCoord3DList (); -LOCAL_FLAG unsigned char * SwapCoord2DList (); -LOCAL_FLAG unsigned char * SwapColour (); -LOCAL_FLAG unsigned char * SwapOptData(); -LOCAL_FLAG unsigned char * SwapVertex(); -LOCAL_FLAG unsigned char * SwapTrimCurve(); - -LOCAL_FLAG void - SwapSurfaceApprox(), - SwapHalfSpace (), - SwapHalfSpace2D (); - Index: xc/programs/Xserver/PEX5/dipex/swap/OCcolour.c diff -u xc/programs/Xserver/PEX5/dipex/swap/OCcolour.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/OCcolour.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCcolour.c:1.9 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCcolour.c Sat Feb 28 21:41:56 2004 @@ -1,79 +0,0 @@ -/* $Xorg: OCcolour.c,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - Swapping and float conversion routines. - - Variations on a theme by CITI. - */ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "convertStr.h" - -/* - colour OCs for Requests - */ -#define SWAP_FILE "OCcolour.ci" -#include "ConvName.ci" -#undef SWAP_FILE - -/* - colour OCs for Replies - */ -#define SWAP_FILE "OCcolour.ci" -#include "UconvName.ci" -#undef SWAP_FILE - Index: xc/programs/Xserver/PEX5/dipex/swap/OCcolour.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/OCcolour.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/OCcolour.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCcolour.ci:1.2 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCcolour.ci Sat Feb 28 21:41:56 2004 @@ -1,78 +0,0 @@ -/* $Xorg: OCcolour.ci,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#undef LOCAL_FLAG -#define LOCAL_FLAG extern -#include "OCprim.h" -#undef LOCAL_FLAG -#define LOCAL_FLAG -#include "OCcolour.h" - -ErrorCode -SWAP_FUNC_PEX_PFX(MarkerColour) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarkerColour *strmPtr; -{ - - SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, &(strmPtr->colourSpec)); -} - - - -ErrorCode -SWAP_FUNC_PEX_PFX(SurfaceReflAttr) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSurfaceReflAttr *strmPtr; -{ - - SWAP_FUNC_PREFIX(SwapReflectionAttr) (swapPtr, &(strmPtr->reflectionAttr)); - -} - -/* typedef pexSurfaceReflAttr pexBfSurfaceReflAttr;*/ - Index: xc/programs/Xserver/PEX5/dipex/swap/OCcolour.h diff -u xc/programs/Xserver/PEX5/dipex/swap/OCcolour.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/OCcolour.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCcolour.h:1.2 Fri Dec 14 14:57:46 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCcolour.h Sat Feb 28 21:41:56 2004 @@ -1,54 +0,0 @@ -/* $Xorg: OCcolour.h,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -LOCAL_FLAG ErrorCode - SWAP_FUNC_PEX_PFX(MarkerColour) (), - SWAP_FUNC_PEX_PFX(SurfaceReflAttr) (); - - Index: xc/programs/Xserver/PEX5/dipex/swap/OCprim.h diff -u xc/programs/Xserver/PEX5/dipex/swap/OCprim.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/OCprim.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/OCprim.h:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/OCprim.h Sat Feb 28 21:41:56 2004 @@ -1,87 +0,0 @@ -/* $Xorg: OCprim.h,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapFacet) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapColourSpecifier) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapReflectionAttr) (); - -LOCAL_FLAG void - SWAP_FUNC_PREFIX(SwapMonoEncoding) (); - -LOCAL_FLAG ErrorCode - SWAP_FUNC_PREFIX(PEXModelClipVolume) (), - SWAP_FUNC_PREFIX(PEXModelClipVolume2D) (), - SWAP_FUNC_PREFIX(PEXLightState) (), - SWAP_FUNC_PREFIX(PEXAddToNameSet) (), - SWAP_FUNC_PREFIX(PEXMarker) (), - SWAP_FUNC_PREFIX(PEXMarker2D) (), - SWAP_FUNC_PREFIX(PEXPolyline) (), - SWAP_FUNC_PREFIX(PEXPolyline2D) (), - SWAP_FUNC_PREFIX(PEXPolylineSet) (), - SWAP_FUNC_PREFIX(PEXNurbCurve) (), - SWAP_FUNC_PREFIX(PEXFillArea) (), - SWAP_FUNC_PREFIX(PEXFillArea2D) (), - SWAP_FUNC_PREFIX(PEXExtFillArea) (), - SWAP_FUNC_PREFIX(PEXFillAreaSet) (), - SWAP_FUNC_PREFIX(PEXFillAreaSet2D) (), - SWAP_FUNC_PREFIX(PEXExtFillAreaSet) (), - SWAP_FUNC_PREFIX(PEXTriangleStrip) (), - SWAP_FUNC_PREFIX(PEXQuadrilateralMesh) (), - SWAP_FUNC_PREFIX(PEXSOFAS) (), - SWAP_FUNC_PREFIX(PEXNurbSurface) (), - SWAP_FUNC_PREFIX(PEXCellArray) (), - SWAP_FUNC_PREFIX(PEXCellArray2D) (), - SWAP_FUNC_PREFIX(PEXExtCellArray) (), - SWAP_FUNC_PREFIX(PEXGdp) (), - SWAP_FUNC_PREFIX(PEXGdp2D) (), - SWAP_FUNC_PEX_PFX(Text) (), - SWAP_FUNC_PEX_PFX(Text2D) (), - SWAP_FUNC_PEX_PFX(AnnotationText) (), - SWAP_FUNC_PEX_PFX(AnnotationText2D) (), - SWAP_FUNC_PEX_PFX(ParaSurfCharacteristics) (), - SWAP_FUNC_PREFIX(PEXNoop) (); Index: xc/programs/Xserver/PEX5/dipex/swap/RepTables.c diff -u xc/programs/Xserver/PEX5/dipex/swap/RepTables.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/RepTables.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/RepTables.c:1.9 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/RepTables.c Sat Feb 28 21:41:56 2004 @@ -1,67 +0,0 @@ -/* $Xorg: RepTables.c,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - Contains tables of Replies for PEX - */ - -#include "X.h" -#include "PEXproto.h" -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "dix.h" -#include "dipex.h" -#include "pexSwap.h" - -#define LOCAL_FLAG extern - -/* Reply Swap Functions */ -#define SWAP_FILE "Replies.ci" -#include "UconvName.ci" -#undef SWAP_FILE Index: xc/programs/Xserver/PEX5/dipex/swap/Replies.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/Replies.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/Replies.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/Replies.ci:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/Replies.ci Sat Feb 28 21:41:56 2004 @@ -1,162 +0,0 @@ -/* $Xorg: Replies.ci,v 1.4 2001/02/09 02:04:15 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - Contains tables of replies for PEX - */ - -#define LOCAL_FLAG extern -#include "uconvRep.h" - -ReplyFunction SWAP_FUNC_PREFIX(PEXReply)[] = { -/* 0 */ SWAP_FUNC_PREFIX(NoReply), /*RequestUnused*/ -/* 1 */ SWAP_FUNC_PREFIX(ConvertGetExtensionInfoReply), -/* 2 */ SWAP_FUNC_PREFIX(ConvertGetEnumeratedTypeInfoReply), -/* 3 */ SWAP_FUNC_PREFIX(ConvertGetImpDepConstantsReply), -/* 4 */ SWAP_FUNC_PREFIX(NoReply), /*CreateLookupTable*/ -/* 5 */ SWAP_FUNC_PREFIX(NoReply), /*CopyLookupTable*/ -/* 6 */ SWAP_FUNC_PREFIX(NoReply), /*FreeLookupTable*/ -/* 7 */ SWAP_FUNC_PREFIX(ConvertGetTableInfoReply), -/* 8 */ SWAP_FUNC_PREFIX(ConvertGetPredefinedEntriesReply), -/* 9 */ SWAP_FUNC_PREFIX(ConvertGetDefinedIndicesReply), -/* 10 */ SWAP_FUNC_PREFIX(ConvertGetTableEntryReply), -/* 11 */ SWAP_FUNC_PREFIX(ConvertGetTableEntriesReply), -/* 12 */ SWAP_FUNC_PREFIX(NoReply), /*SetTableEntries*/ -/* 13 */ SWAP_FUNC_PREFIX(NoReply), /*DeleteTableEntries*/ -/* 14 */ SWAP_FUNC_PREFIX(NoReply), /*CreatePipelineContext*/ -/* 15 */ SWAP_FUNC_PREFIX(NoReply), /*CopyPipelineContext*/ -/* 16 */ SWAP_FUNC_PREFIX(NoReply), /*FreePipelineContext*/ -/* 17 */ SWAP_FUNC_PREFIX(ConvertGetPipelineContextReply), -/* 18 */ SWAP_FUNC_PREFIX(NoReply), /*ChangePipelineContext*/ -/* 19 */ SWAP_FUNC_PREFIX(NoReply), /*CreateRenderer*/ -/* 20 */ SWAP_FUNC_PREFIX(NoReply), /*FreeRenderer*/ -/* 21 */ SWAP_FUNC_PREFIX(NoReply), /*ChangeRenderer*/ -/* 22 */ SWAP_FUNC_PREFIX(ConvertGetRendererAttributesReply), -/* 23 */ SWAP_FUNC_PREFIX(ConvertGetRendererDynamicsReply), -/* 24 */ SWAP_FUNC_PREFIX(NoReply), /*BeginRendering*/ -/* 25 */ SWAP_FUNC_PREFIX(NoReply), /*EndRendering*/ -/* 26 */ SWAP_FUNC_PREFIX(NoReply), /*BeginStructure*/ -/* 27 */ SWAP_FUNC_PREFIX(NoReply), /*EndStructure*/ -/* 28 */ SWAP_FUNC_PREFIX(NoReply), /*RenderOutputCommands*/ -/* 29 */ SWAP_FUNC_PREFIX(NoReply), /*RenderNetwork*/ -/* 30 */ SWAP_FUNC_PREFIX(NoReply), /*CreateStructure*/ -/* 31 */ SWAP_FUNC_PREFIX(NoReply), /*CopyStructure*/ -/* 32 */ SWAP_FUNC_PREFIX(NoReply), /*DestroyStructures*/ -/* 33 */ SWAP_FUNC_PREFIX(ConvertGetStructureInfoReply), -/* 34 */ SWAP_FUNC_PREFIX(ConvertGetElementInfoReply), -/* 35 */ SWAP_FUNC_PREFIX(ConvertGetStructuresInNetworkReply), -/* 36 */ SWAP_FUNC_PREFIX(ConvertGetAncestorsReply), -/* 37 */ SWAP_FUNC_PREFIX(ConvertGetAncestorsReply),/*GetDescendants*/ -/* 38 */ SWAP_FUNC_PREFIX(ConvertFetchElementsReply), -/* 39 */ SWAP_FUNC_PREFIX(NoReply), /*SetEditingMode*/ -/* 40 */ SWAP_FUNC_PREFIX(NoReply), /*SetElementPointer*/ -/* 41 */ SWAP_FUNC_PREFIX(NoReply), /*SetElementPointerAtLabel*/ -/* 42 */ SWAP_FUNC_PREFIX(ConvertElementSearchReply), -/* 43 */ SWAP_FUNC_PREFIX(NoReply), /*StoreElements*/ -/* 44 */ SWAP_FUNC_PREFIX(NoReply), /*DeleteElements*/ -/* 45 */ SWAP_FUNC_PREFIX(NoReply), /*DeleteElementsToLabel*/ -/* 46 */ SWAP_FUNC_PREFIX(NoReply), /*DeleteElementsBetweenLabels*/ -/* 47 */ SWAP_FUNC_PREFIX(NoReply), /*CopyElements*/ -/* 48 */ SWAP_FUNC_PREFIX(NoReply), /*ChangeStructureRefs*/ -/* 49 */ SWAP_FUNC_PREFIX(NoReply), /*CreateNameSet*/ -/* 50 */ SWAP_FUNC_PREFIX(NoReply), /*CopyNameSet*/ -/* 51 */ SWAP_FUNC_PREFIX(NoReply), /*FreeNameSet*/ -/* 52 */ SWAP_FUNC_PREFIX(ConvertGetNameSetReply), -/* 53 */ SWAP_FUNC_PREFIX(NoReply), /*ChangeNameSet*/ -/* 54 */ SWAP_FUNC_PREFIX(NoReply), /*CreateSearchContext*/ -/* 55 */ SWAP_FUNC_PREFIX(NoReply), /*CopySearchContext*/ -/* 56 */ SWAP_FUNC_PREFIX(NoReply), /*FreeSearchContext*/ -/* 57 */ SWAP_FUNC_PREFIX(ConvertGetSearchContextReply), -/* 58 */ SWAP_FUNC_PREFIX(NoReply), /*ChangeSearchContext*/ -/* 59 */ SWAP_FUNC_PREFIX(ConvertSearchNetworkReply), -/* 60 */ SWAP_FUNC_PREFIX(NoReply), /*CreatePhigsWks*/ -/* 61 */ SWAP_FUNC_PREFIX(NoReply), /*FreePhigsWks*/ -/* 62 */ SWAP_FUNC_PREFIX(ConvertGetWksInfoReply), -/* 63 */ SWAP_FUNC_PREFIX(ConvertGetDynamicsReply), -/* 64 */ SWAP_FUNC_PREFIX(ConvertGetViewRepReply), -/* 65 */ SWAP_FUNC_PREFIX(NoReply), /*RedrawAllStructures*/ -/* 66 */ SWAP_FUNC_PREFIX(NoReply), /*UpdateWorkstation*/ -/* 67 */ SWAP_FUNC_PREFIX(NoReply), /*RedrawClipRegion*/ -/* 68 */ SWAP_FUNC_PREFIX(NoReply), /*ExecuteDeferredActions*/ -/* 69 */ SWAP_FUNC_PREFIX(NoReply), /*SetViewPriority*/ -/* 70 */ SWAP_FUNC_PREFIX(NoReply), /*SetDisplayUpdateMode*/ -/* 71 */ SWAP_FUNC_PREFIX(ConvertMapDCtoWCReply), -/* 72 */ SWAP_FUNC_PREFIX(ConvertMapWCtoDCReply), -/* 73 */ SWAP_FUNC_PREFIX(NoReply), /*SetViewRep*/ -/* 74 */ SWAP_FUNC_PREFIX(NoReply), /*SetWksWindow*/ -/* 75 */ SWAP_FUNC_PREFIX(NoReply), /*SetWksViewport*/ -/* 76 */ SWAP_FUNC_PREFIX(NoReply), /*SetHlhsrMode*/ -/* 77 */ SWAP_FUNC_PREFIX(NoReply), /*SetWksBufferMode*/ -/* 78 */ SWAP_FUNC_PREFIX(NoReply), /*PostStructure*/ -/* 79 */ SWAP_FUNC_PREFIX(NoReply), /*UnpostStructure*/ -/* 80 */ SWAP_FUNC_PREFIX(NoReply), /*UnpostAllStructures*/ -/* 81 */ SWAP_FUNC_PREFIX(ConvertGetWksPostingsReply), -/* 82 */ SWAP_FUNC_PREFIX(ConvertGetPickDeviceReply), -/* 83 */ SWAP_FUNC_PREFIX(NoReply), /*ChangePickDevice*/ -/* 84 */ SWAP_FUNC_PREFIX(NoReply), /*CreatePickMeasure*/ -/* 85 */ SWAP_FUNC_PREFIX(NoReply), /*FreePickMeasure*/ -/* 86 */ SWAP_FUNC_PREFIX(ConvertGetPickMeasureReply), -/* 87 */ SWAP_FUNC_PREFIX(NoReply), /*UpdatePickMeasure*/ -/* 88 */ SWAP_FUNC_PREFIX(NoReply), /*OpenFont*/ -/* 89 */ SWAP_FUNC_PREFIX(NoReply), /*CloseFont*/ -/* 90 */ SWAP_FUNC_PREFIX(ConvertQueryFontReply), -/* 91 */ SWAP_FUNC_PREFIX(ConvertListFontsReply), -/* 92 */ SWAP_FUNC_PREFIX(ConvertListFontsWithInfoReply), -/* 93 */ SWAP_FUNC_PREFIX(ConvertQueryTextExtentsReply), -/* 94 */ SWAP_FUNC_PREFIX(ConvertMatchRendererTargetsReply), -/* 95 */ SWAP_FUNC_PREFIX(NoReply), /*Escape*/ -/* 96 */ SWAP_FUNC_PREFIX(EscapeWithReplyReply), /*EscapeWithReply*/ -/* 97 */ SWAP_FUNC_PREFIX(NoReply), /*RenderElements*/ -/* 98 */ SWAP_FUNC_PREFIX(NoReply), /*AccumulateState*/ -/* 99 */ SWAP_FUNC_PREFIX(NoReply), /*BeginPickOne*/ -/* 100 */ SWAP_FUNC_PREFIX(ConvertEndPickOneReply), -/* 101 */ SWAP_FUNC_PREFIX(ConvertPickOneReply), -/* 102 */ SWAP_FUNC_PREFIX(NoReply), /*BeginPickAll*/ -/* 103 */ SWAP_FUNC_PREFIX(ConvertEndPickAllReply), -/* 104 */ SWAP_FUNC_PREFIX(ConvertPickAllReply) -}; Index: xc/programs/Xserver/PEX5/dipex/swap/ReqTables.c diff -u xc/programs/Xserver/PEX5/dipex/swap/ReqTables.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/ReqTables.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/ReqTables.c:1.9 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/ReqTables.c Sat Feb 28 21:41:56 2004 @@ -1,70 +0,0 @@ -/* $Xorg: ReqTables.c,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - Contains tables of Requests for PEX - */ - -#include "X.h" -#include "PEXproto.h" -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "dix.h" -#include "dipex.h" -#include "pexSwap.h" - -#define LOCAL_FLAG extern - -/* Not-swapped Requests */ -#include "Requests.h" - -/* Request Swap Functions */ -#define SWAP_FILE "Requests.ci" -#include "ConvName.ci" -#undef SWAP_FILE Index: xc/programs/Xserver/PEX5/dipex/swap/Requests.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/Requests.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/Requests.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/Requests.ci:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/Requests.ci Sat Feb 28 21:41:56 2004 @@ -1,159 +0,0 @@ -/* $Xorg: Requests.ci,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/****************************************************************** - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#include "convReq.h" - -RequestFunction SWAP_FUNC_PREFIX(PEXRequest)[] = { -/* 0 */ SWAP_FUNC_PREFIX(PEXRequestUnused), -/* 1 */ SWAP_FUNC_PREFIX(PEXGetExtensionInfo), -/* 2 */ SWAP_FUNC_PREFIX(PEXGetEnumeratedTypeInfo), -/* 3 */ SWAP_FUNC_PREFIX(PEXGetImpDepConstants), -/* 4 */ SWAP_FUNC_PREFIX(PEXCreateLookupTable), -/* 5 */ SWAP_FUNC_PREFIX(PEXCopyLookupTable), -/* 6 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreeLookupTable*/ -/* 7 */ SWAP_FUNC_PREFIX(PEXGetTableInfo), -/* 8 */ SWAP_FUNC_PREFIX(PEXGetPredefinedEntries), -/* 9 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*GetDefinedIndices*/ -/* 10 */ SWAP_FUNC_PREFIX(PEXGetTableEntry), -/* 11 */ SWAP_FUNC_PREFIX(PEXGetTableEntries), -/* 12 */ SWAP_FUNC_PREFIX(PEXSetTableEntries), -/* 13 */ SWAP_FUNC_PREFIX(PEXDeleteTableEntries), -/* 14 */ SWAP_FUNC_PREFIX(PEXCreatePipelineContext), -/* 15 */ SWAP_FUNC_PREFIX(PEXCopyPipelineContext), -/* 16 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreePipelineContext*/ -/* 17 */ SWAP_FUNC_PREFIX(PEXGetPipelineContext), -/* 18 */ SWAP_FUNC_PREFIX(PEXChangePipelineContext), -/* 19 */ SWAP_FUNC_PREFIX(PEXCreateRenderer), -/* 20 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreeRenderer*/ -/* 21 */ SWAP_FUNC_PREFIX(PEXChangeRenderer), -/* 22 */ SWAP_FUNC_PREFIX(PEXGetRendererAttributes), -/* 23 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*GetRendererDynamics*/ -/* 24 */ SWAP_FUNC_PREFIX(PEXBeginRendering), -/* 25 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*EndRendering*/ -/* 26 */ SWAP_FUNC_PREFIX(PEXBeginStructure), -/* 27 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*EndStructure*/ -/* 28 */ SWAP_FUNC_PREFIX(PEXRenderOutputCommands), -/* 29 */ SWAP_FUNC_PREFIX(PEXRenderNetwork), -/* 30 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*CreateStructure*/ -/* 31 */ SWAP_FUNC_PREFIX(PEXCopyStructure), -/* 32 */ SWAP_FUNC_PREFIX(PEXDestroyStructures), -/* 33 */ SWAP_FUNC_PREFIX(PEXGetStructureInfo), -/* 34 */ SWAP_FUNC_PREFIX(PEXGetElementInfo), -/* 35 */ SWAP_FUNC_PREFIX(PEXGetStructuresInNetwork), -/* 36 */ SWAP_FUNC_PREFIX(PEXGetAncestors), -/* 37 */ SWAP_FUNC_PREFIX(PEXGetAncestors), /*GetDescendants*/ -/* 38 */ SWAP_FUNC_PREFIX(PEXFetchElements), -/* 39 */ SWAP_FUNC_PREFIX(PEXSetEditingMode), -/* 40 */ SWAP_FUNC_PREFIX(PEXSetElementPointer), -/* 41 */ SWAP_FUNC_PREFIX(PEXSetElementPointerAtLabel), -/* 42 */ SWAP_FUNC_PREFIX(PEXElementSearch), -/* 43 */ SWAP_FUNC_PREFIX(PEXStoreElements), -/* 44 */ SWAP_FUNC_PREFIX(PEXDeleteElements), -/* 45 */ SWAP_FUNC_PREFIX(PEXDeleteElementsToLabel), -/* 46 */ SWAP_FUNC_PREFIX(PEXDeleteBetweenLabels), -/* 47 */ SWAP_FUNC_PREFIX(PEXCopyElements), -/* 48 */ SWAP_FUNC_PREFIX(PEXChangeStructureRefs), -/* 49 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*CreateNameSet*/ -/* 50 */ SWAP_FUNC_PREFIX(PEXCopyNameSet), -/* 51 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreeNameSet*/ -/* 52 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*GetNameSet*/ -/* 53 */ SWAP_FUNC_PREFIX(PEXChangeNameSet), -/* 54 */ SWAP_FUNC_PREFIX(PEXCreateSearchContext), -/* 55 */ SWAP_FUNC_PREFIX(PEXCopySearchContext), -/* 56 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreeSearchContext*/ -/* 57 */ SWAP_FUNC_PREFIX(PEXGetSearchContext), -/* 58 */ SWAP_FUNC_PREFIX(PEXChangeSearchContext), -/* 59 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*SearchNetwork*/ -/* 60 */ SWAP_FUNC_PREFIX(PEXCreatePhigsWks), -/* 61 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreePhigsWks*/ -/* 62 */ SWAP_FUNC_PREFIX(PEXGetWksInfo), -/* 63 */ SWAP_FUNC_PREFIX(PEXGetDynamics), -/* 64 */ SWAP_FUNC_PREFIX(PEXGetViewRep), -/* 65 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*RedrawAllStructures*/ -/* 66 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*UpdateWorkstation*/ -/* 67 */ SWAP_FUNC_PREFIX(PEXRedrawClipRegion), -/* 68 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*ExecuteDeferredActions*/ -/* 69 */ SWAP_FUNC_PREFIX(PEXSetViewPriority), -/* 70 */ SWAP_FUNC_PREFIX(PEXSetDisplayUpdateMode), -/* 71 */ SWAP_FUNC_PREFIX(PEXMapDCtoWC), -/* 72 */ SWAP_FUNC_PREFIX(PEXMapWCtoDC), -/* 73 */ SWAP_FUNC_PREFIX(PEXSetViewRep), -/* 74 */ SWAP_FUNC_PREFIX(PEXSetWksWindow), -/* 75 */ SWAP_FUNC_PREFIX(PEXSetWksViewport), -/* 76 */ SWAP_FUNC_PREFIX(PEXSetHlhsrMode), -/* 77 */ SWAP_FUNC_PREFIX(PEXSetWksBufferMode), -/* 78 */ SWAP_FUNC_PREFIX(PEXPostStructure), -/* 79 */ SWAP_FUNC_PREFIX(PEXUnpostStructure), -/* 80 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*UnpostAllStructures*/ -/* 81 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*GetWksPostings*/ -/* 82 */ SWAP_FUNC_PREFIX(PEXGetPickDevice), -/* 83 */ SWAP_FUNC_PREFIX(PEXChangePickDevice), -/* 84 */ SWAP_FUNC_PREFIX(PEXCreatePickMeasure), -/* 85 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*FreePickMeasure*/ -/* 86 */ SWAP_FUNC_PREFIX(PEXGetPickMeasure), -/* 87 */ SWAP_FUNC_PREFIX(PEXUpdatePickMeasure), -/* 88 */ SWAP_FUNC_PREFIX(PEXOpenFont), -/* 89 */ SWAP_FUNC_PREFIX(PEXGenericResourceRequest), /*CloseFont*/ -/* 90 */ SWAP_FUNC_PREFIX(PEXQueryFont), -/* 91 */ SWAP_FUNC_PREFIX(PEXListFonts), -/* 92 */ SWAP_FUNC_PREFIX(PEXListFontsWithInfo), -/* 93 */ SWAP_FUNC_PREFIX(PEXQueryTextExtents), -/* 94 */ SWAP_FUNC_PREFIX(PEXMatchRendererTargets), -/* 95 */ SWAP_FUNC_PREFIX(PEXEscape), -/* 96 */ SWAP_FUNC_PREFIX(PEXEscapeWithReply), -/* 97 */ SWAP_FUNC_PREFIX(PEXRenderElements), -/* 98 */ SWAP_FUNC_PREFIX(PEXAccumulateState), -/* 99 */ SWAP_FUNC_PREFIX(PEXBeginPickOne), -/* 100 */ SWAP_FUNC_PREFIX(PEXEndPickOne), -/* 101 */ SWAP_FUNC_PREFIX(PEXPickOne), -/* 102 */ SWAP_FUNC_PREFIX(PEXBeginPickAll), -/* 103 */ SWAP_FUNC_PREFIX(PEXEndPickAll), -/* 104 */ SWAP_FUNC_PREFIX(PEXPickAll) -}; - -#undef SWAP_FUNC_PREFIX - Index: xc/programs/Xserver/PEX5/dipex/swap/Requests.h diff -u xc/programs/Xserver/PEX5/dipex/swap/Requests.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/Requests.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/Requests.h:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/Requests.h Sat Feb 28 21:41:56 2004 @@ -1,269 +0,0 @@ -/* $Xorg: Requests.h,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/****************************************************************** - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#ifdef SWAP_FUNC_PREFIX -#undef SWAP_FUNC_PREFIX -#endif -#define SWAP_FUNC_PREFIX(nm) nm - -LOCAL_FLAG ErrorCode - SWAP_FUNC_PREFIX(PEXRequestUnused) (), - SWAP_FUNC_PREFIX(PEXGetExtensionInfo) (), - SWAP_FUNC_PREFIX(PEXGetEnumeratedTypeInfo) (), - SWAP_FUNC_PREFIX(PEXGetImpDepConstants) (), - SWAP_FUNC_PREFIX(PEXCreateLookupTable) (), - SWAP_FUNC_PREFIX(PEXCopyLookupTable) (), - SWAP_FUNC_PREFIX(PEXFreeLookupTable) (), - SWAP_FUNC_PREFIX(PEXGetTableInfo) (), - SWAP_FUNC_PREFIX(PEXGetPredefinedEntries) (), - SWAP_FUNC_PREFIX(PEXGetDefinedIndices) (), - SWAP_FUNC_PREFIX(PEXGetTableEntry) (), - SWAP_FUNC_PREFIX(PEXGetTableEntries) (), - SWAP_FUNC_PREFIX(PEXSetTableEntries) (), - SWAP_FUNC_PREFIX(PEXDeleteTableEntries) (), - SWAP_FUNC_PREFIX(PEXCreatePipelineContext) (), - SWAP_FUNC_PREFIX(PEXCopyPipelineContext) (), - SWAP_FUNC_PREFIX(PEXFreePipelineContext) (), - SWAP_FUNC_PREFIX(PEXGetPipelineContext) (), - SWAP_FUNC_PREFIX(PEXChangePipelineContext) (), - SWAP_FUNC_PREFIX(PEXCreateRenderer) (), - SWAP_FUNC_PREFIX(PEXFreeRenderer) (), - SWAP_FUNC_PREFIX(PEXChangeRenderer) (), - SWAP_FUNC_PREFIX(PEXGetRendererAttributes) (), - SWAP_FUNC_PREFIX(PEXGetRendererDynamics) (), - SWAP_FUNC_PREFIX(PEXBeginRendering) (), - SWAP_FUNC_PREFIX(PEXEndRendering) (), - SWAP_FUNC_PREFIX(PEXBeginStructure) (), - SWAP_FUNC_PREFIX(PEXEndStructure) (), - SWAP_FUNC_PREFIX(PEXRenderOutputCommands) (), - SWAP_FUNC_PREFIX(PEXRenderNetwork) (), - SWAP_FUNC_PREFIX(PEXCreateStructure) (), - SWAP_FUNC_PREFIX(PEXCopyStructure) (), - SWAP_FUNC_PREFIX(PEXDestroyStructures) (), - SWAP_FUNC_PREFIX(PEXGetStructureInfo) (), - SWAP_FUNC_PREFIX(PEXGetElementInfo) (), - SWAP_FUNC_PREFIX(PEXGetStructuresInNetwork) (), - SWAP_FUNC_PREFIX(PEXGetAncestors) (), - SWAP_FUNC_PREFIX(PEXGetDescendants) (), - SWAP_FUNC_PREFIX(PEXFetchElements) (), - SWAP_FUNC_PREFIX(PEXSetEditingMode) (), - SWAP_FUNC_PREFIX(PEXSetElementPointer) (), - SWAP_FUNC_PREFIX(PEXSetElementPointerAtLabel) (), - SWAP_FUNC_PREFIX(PEXElementSearch) (), - SWAP_FUNC_PREFIX(PEXStoreElements) (), - SWAP_FUNC_PREFIX(PEXDeleteElements) (), - SWAP_FUNC_PREFIX(PEXDeleteElementsToLabel) (), - SWAP_FUNC_PREFIX(PEXDeleteBetweenLabels) (), - SWAP_FUNC_PREFIX(PEXCopyElements) (), - SWAP_FUNC_PREFIX(PEXChangeStructureRefs) (), - SWAP_FUNC_PREFIX(PEXCreateNameSet) (), - SWAP_FUNC_PREFIX(PEXCopyNameSet) (), - SWAP_FUNC_PREFIX(PEXFreeNameSet) (), - SWAP_FUNC_PREFIX(PEXGetNameSet) (), - SWAP_FUNC_PREFIX(PEXChangeNameSet) (), - SWAP_FUNC_PREFIX(PEXCreateSearchContext) (), - SWAP_FUNC_PREFIX(PEXCopySearchContext) (), - SWAP_FUNC_PREFIX(PEXFreeSearchContext) (), - SWAP_FUNC_PREFIX(PEXGetSearchContext) (), - SWAP_FUNC_PREFIX(PEXChangeSearchContext) (), - SWAP_FUNC_PREFIX(PEXSearchNetwork) (), - SWAP_FUNC_PREFIX(PEXCreatePhigsWks) (), - SWAP_FUNC_PREFIX(PEXFreePhigsWks) (), - SWAP_FUNC_PREFIX(PEXGetWksInfo) (), - SWAP_FUNC_PREFIX(PEXGetDynamics) (), - SWAP_FUNC_PREFIX(PEXGetViewRep) (), - SWAP_FUNC_PREFIX(PEXRedrawAllStructures) (), - SWAP_FUNC_PREFIX(PEXUpdateWorkstation) (), - SWAP_FUNC_PREFIX(PEXRedrawClipRegion) (), - SWAP_FUNC_PREFIX(PEXExecuteDeferredActions) (), - SWAP_FUNC_PREFIX(PEXSetViewPriority) (), - SWAP_FUNC_PREFIX(PEXSetDisplayUpdateMode) (), - SWAP_FUNC_PREFIX(PEXMapDCtoWC) (), - SWAP_FUNC_PREFIX(PEXMapWCtoDC) (), - SWAP_FUNC_PREFIX(PEXSetViewRep) (), - SWAP_FUNC_PREFIX(PEXSetWksWindow) (), - SWAP_FUNC_PREFIX(PEXSetWksViewport) (), - SWAP_FUNC_PREFIX(PEXSetHlhsrMode) (), - SWAP_FUNC_PREFIX(PEXSetWksBufferMode) (), - SWAP_FUNC_PREFIX(PEXPostStructure) (), - SWAP_FUNC_PREFIX(PEXUnpostStructure) (), - SWAP_FUNC_PREFIX(PEXUnpostAllStructures) (), - SWAP_FUNC_PREFIX(PEXGetWksPostings) (), - SWAP_FUNC_PREFIX(PEXGetPickDevice) (), - SWAP_FUNC_PREFIX(PEXChangePickDevice) (), - SWAP_FUNC_PREFIX(PEXCreatePickMeasure) (), - SWAP_FUNC_PREFIX(PEXFreePickMeasure) (), - SWAP_FUNC_PREFIX(PEXGetPickMeasure) (), - SWAP_FUNC_PREFIX(PEXUpdatePickMeasure) (), - SWAP_FUNC_PREFIX(PEXOpenFont) (), - SWAP_FUNC_PREFIX(PEXCloseFont) (), - SWAP_FUNC_PREFIX(PEXQueryFont) (), - SWAP_FUNC_PREFIX(PEXListFonts) (), - SWAP_FUNC_PREFIX(PEXListFontsWithInfo) (), - SWAP_FUNC_PREFIX(PEXQueryTextExtents) (), - SWAP_FUNC_PREFIX(PEXMatchRendererTargets) (), - SWAP_FUNC_PREFIX(PEXEscape) (), - SWAP_FUNC_PREFIX(PEXEscapeWithReply) (), - SWAP_FUNC_PREFIX(PEXRenderElements) (), - SWAP_FUNC_PREFIX(PEXAccumulateState) (), - SWAP_FUNC_PREFIX(PEXBeginPickOne) (), - SWAP_FUNC_PREFIX(PEXEndPickOne) (), - SWAP_FUNC_PREFIX(PEXPickOne) (), - SWAP_FUNC_PREFIX(PEXBeginPickAll) (), - SWAP_FUNC_PREFIX(PEXEndPickAll) (), - SWAP_FUNC_PREFIX(PEXPickAll) (); - -RequestFunction SWAP_FUNC_PREFIX(PEXRequest)[] = { -/* 0 */ SWAP_FUNC_PREFIX(PEXRequestUnused), -/* 1 */ SWAP_FUNC_PREFIX(PEXGetExtensionInfo), -/* 2 */ SWAP_FUNC_PREFIX(PEXGetEnumeratedTypeInfo), -/* 3 */ SWAP_FUNC_PREFIX(PEXGetImpDepConstants), -/* 4 */ SWAP_FUNC_PREFIX(PEXCreateLookupTable), -/* 5 */ SWAP_FUNC_PREFIX(PEXCopyLookupTable), -/* 6 */ SWAP_FUNC_PREFIX(PEXFreeLookupTable), -/* 7 */ SWAP_FUNC_PREFIX(PEXGetTableInfo), -/* 8 */ SWAP_FUNC_PREFIX(PEXGetPredefinedEntries), -/* 9 */ SWAP_FUNC_PREFIX(PEXGetDefinedIndices), -/* 10 */ SWAP_FUNC_PREFIX(PEXGetTableEntry), -/* 11 */ SWAP_FUNC_PREFIX(PEXGetTableEntries), -/* 12 */ SWAP_FUNC_PREFIX(PEXSetTableEntries), -/* 13 */ SWAP_FUNC_PREFIX(PEXDeleteTableEntries), -/* 14 */ SWAP_FUNC_PREFIX(PEXCreatePipelineContext), -/* 15 */ SWAP_FUNC_PREFIX(PEXCopyPipelineContext), -/* 16 */ SWAP_FUNC_PREFIX(PEXFreePipelineContext), -/* 17 */ SWAP_FUNC_PREFIX(PEXGetPipelineContext), -/* 18 */ SWAP_FUNC_PREFIX(PEXChangePipelineContext), -/* 19 */ SWAP_FUNC_PREFIX(PEXCreateRenderer), -/* 20 */ SWAP_FUNC_PREFIX(PEXFreeRenderer), -/* 21 */ SWAP_FUNC_PREFIX(PEXChangeRenderer), -/* 22 */ SWAP_FUNC_PREFIX(PEXGetRendererAttributes), -/* 23 */ SWAP_FUNC_PREFIX(PEXGetRendererDynamics), -/* 24 */ SWAP_FUNC_PREFIX(PEXBeginRendering), -/* 25 */ SWAP_FUNC_PREFIX(PEXEndRendering), -/* 26 */ SWAP_FUNC_PREFIX(PEXBeginStructure), -/* 27 */ SWAP_FUNC_PREFIX(PEXEndStructure), -/* 28 */ SWAP_FUNC_PREFIX(PEXRenderOutputCommands), -/* 29 */ SWAP_FUNC_PREFIX(PEXRenderNetwork), -/* 30 */ SWAP_FUNC_PREFIX(PEXCreateStructure), -/* 31 */ SWAP_FUNC_PREFIX(PEXCopyStructure), -/* 32 */ SWAP_FUNC_PREFIX(PEXDestroyStructures), -/* 33 */ SWAP_FUNC_PREFIX(PEXGetStructureInfo), -/* 34 */ SWAP_FUNC_PREFIX(PEXGetElementInfo), -/* 35 */ SWAP_FUNC_PREFIX(PEXGetStructuresInNetwork), -/* 36 */ SWAP_FUNC_PREFIX(PEXGetAncestors), -/* 37 */ SWAP_FUNC_PREFIX(PEXGetDescendants), -/* 38 */ SWAP_FUNC_PREFIX(PEXFetchElements), -/* 39 */ SWAP_FUNC_PREFIX(PEXSetEditingMode), -/* 40 */ SWAP_FUNC_PREFIX(PEXSetElementPointer), -/* 41 */ SWAP_FUNC_PREFIX(PEXSetElementPointerAtLabel), -/* 42 */ SWAP_FUNC_PREFIX(PEXElementSearch), -/* 43 */ SWAP_FUNC_PREFIX(PEXStoreElements), -/* 44 */ SWAP_FUNC_PREFIX(PEXDeleteElements), -/* 45 */ SWAP_FUNC_PREFIX(PEXDeleteElementsToLabel), -/* 46 */ SWAP_FUNC_PREFIX(PEXDeleteBetweenLabels), -/* 47 */ SWAP_FUNC_PREFIX(PEXCopyElements), -/* 48 */ SWAP_FUNC_PREFIX(PEXChangeStructureRefs), -/* 49 */ SWAP_FUNC_PREFIX(PEXCreateNameSet), -/* 50 */ SWAP_FUNC_PREFIX(PEXCopyNameSet), -/* 51 */ SWAP_FUNC_PREFIX(PEXFreeNameSet), -/* 52 */ SWAP_FUNC_PREFIX(PEXGetNameSet), -/* 53 */ SWAP_FUNC_PREFIX(PEXChangeNameSet), -/* 54 */ SWAP_FUNC_PREFIX(PEXCreateSearchContext), -/* 55 */ SWAP_FUNC_PREFIX(PEXCopySearchContext), -/* 56 */ SWAP_FUNC_PREFIX(PEXFreeSearchContext), -/* 57 */ SWAP_FUNC_PREFIX(PEXGetSearchContext), -/* 58 */ SWAP_FUNC_PREFIX(PEXChangeSearchContext), -/* 59 */ SWAP_FUNC_PREFIX(PEXSearchNetwork), -/* 60 */ SWAP_FUNC_PREFIX(PEXCreatePhigsWks), -/* 61 */ SWAP_FUNC_PREFIX(PEXFreePhigsWks), -/* 62 */ SWAP_FUNC_PREFIX(PEXGetWksInfo), -/* 63 */ SWAP_FUNC_PREFIX(PEXGetDynamics), -/* 64 */ SWAP_FUNC_PREFIX(PEXGetViewRep), -/* 65 */ SWAP_FUNC_PREFIX(PEXRedrawAllStructures), -/* 66 */ SWAP_FUNC_PREFIX(PEXUpdateWorkstation), -/* 67 */ SWAP_FUNC_PREFIX(PEXRedrawClipRegion), -/* 68 */ SWAP_FUNC_PREFIX(PEXExecuteDeferredActions), -/* 69 */ SWAP_FUNC_PREFIX(PEXSetViewPriority), -/* 70 */ SWAP_FUNC_PREFIX(PEXSetDisplayUpdateMode), -/* 71 */ SWAP_FUNC_PREFIX(PEXMapDCtoWC), -/* 72 */ SWAP_FUNC_PREFIX(PEXMapWCtoDC), -/* 73 */ SWAP_FUNC_PREFIX(PEXSetViewRep), -/* 74 */ SWAP_FUNC_PREFIX(PEXSetWksWindow), -/* 75 */ SWAP_FUNC_PREFIX(PEXSetWksViewport), -/* 76 */ SWAP_FUNC_PREFIX(PEXSetHlhsrMode), -/* 77 */ SWAP_FUNC_PREFIX(PEXSetWksBufferMode), -/* 78 */ SWAP_FUNC_PREFIX(PEXPostStructure), -/* 79 */ SWAP_FUNC_PREFIX(PEXUnpostStructure), -/* 80 */ SWAP_FUNC_PREFIX(PEXUnpostAllStructures), -/* 81 */ SWAP_FUNC_PREFIX(PEXGetWksPostings), -/* 82 */ SWAP_FUNC_PREFIX(PEXGetPickDevice), -/* 83 */ SWAP_FUNC_PREFIX(PEXChangePickDevice), -/* 84 */ SWAP_FUNC_PREFIX(PEXCreatePickMeasure), -/* 85 */ SWAP_FUNC_PREFIX(PEXFreePickMeasure), -/* 86 */ SWAP_FUNC_PREFIX(PEXGetPickMeasure), -/* 87 */ SWAP_FUNC_PREFIX(PEXUpdatePickMeasure), -/* 88 */ SWAP_FUNC_PREFIX(PEXOpenFont), -/* 89 */ SWAP_FUNC_PREFIX(PEXCloseFont), -/* 90 */ SWAP_FUNC_PREFIX(PEXQueryFont), -/* 91 */ SWAP_FUNC_PREFIX(PEXListFonts), -/* 92 */ SWAP_FUNC_PREFIX(PEXListFontsWithInfo), -/* 93 */ SWAP_FUNC_PREFIX(PEXQueryTextExtents), -/* 94 */ SWAP_FUNC_PREFIX(PEXMatchRendererTargets), -/* 95 */ SWAP_FUNC_PREFIX(PEXEscape), -/* 96 */ SWAP_FUNC_PREFIX(PEXEscapeWithReply), -/* 97 */ SWAP_FUNC_PREFIX(PEXRenderElements), -/* 98 */ SWAP_FUNC_PREFIX(PEXAccumulateState), -/* 99 */ SWAP_FUNC_PREFIX(PEXBeginPickOne), -/* 100 */ SWAP_FUNC_PREFIX(PEXEndPickOne), -/* 101 */ SWAP_FUNC_PREFIX(PEXPickOne), -/* 102 */ SWAP_FUNC_PREFIX(PEXBeginPickAll), -/* 103 */ SWAP_FUNC_PREFIX(PEXEndPickAll), -/* 104 */ SWAP_FUNC_PREFIX(PEXPickAll) -}; - -#undef SWAP_FUNC_PREFIX - Index: xc/programs/Xserver/PEX5/dipex/swap/SwapConv.h diff -u xc/programs/Xserver/PEX5/dipex/swap/SwapConv.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/SwapConv.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/SwapConv.h:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/SwapConv.h Sat Feb 28 21:41:56 2004 @@ -1,58 +0,0 @@ -/* $Xorg: SwapConv.h,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef SWAPCONV_H -#define SWAPCONV_H 1 - -#define SWAPINT(A) if (swapPtr->ConvertCARD32) swapPtr->ConvertCARD32(&(A)) - -#define SWAPSHORT(A) if (swapPtr->ConvertCARD16) swapPtr->ConvertCARD16(&(A)) - -#define SWAPFLOAT(A) if (swapPtr->ConvertFLOAT) swapPtr->ConvertFLOAT(&(A)) - -#endif /* SWAPCONV_H */ Index: xc/programs/Xserver/PEX5/dipex/swap/UconvName.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/UconvName.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/UconvName.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/UconvName.ci:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/UconvName.ci Sat Feb 28 21:41:56 2004 @@ -1,53 +0,0 @@ -/* $Xorg: UconvName.ci,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "UconvName.h" -#include SWAP_FILE - -#undef SWAP_FUNC_PREFIX -#undef SWAP_FUNC_PEX_PFX Index: xc/programs/Xserver/PEX5/dipex/swap/UconvName.h diff -u xc/programs/Xserver/PEX5/dipex/swap/UconvName.h:3.3 xc/programs/Xserver/PEX5/dipex/swap/UconvName.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/UconvName.h:3.3 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/UconvName.h Sat Feb 28 21:41:56 2004 @@ -1,55 +0,0 @@ -/* $Xorg: UconvName.h,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define SWAP_FUNC_PREFIX(nm) u##nm -#define SWAP_FUNC_PEX_PFX(nm) uPEX##nm -#else -#define SWAP_FUNC_PREFIX(nm) u/**/nm -#define SWAP_FUNC_PEX_PFX(nm) uPEX/**/nm -#endif Index: xc/programs/Xserver/PEX5/dipex/swap/cOCTables.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/cOCTables.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/cOCTables.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/cOCTables.ci:1.2 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/cOCTables.ci Sat Feb 28 21:41:56 2004 @@ -1,245 +0,0 @@ -/* $Xorg: cOCTables.ci,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ -/* Automatically generated OC table - */ -/****************************************************************** - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#include "X.h" -#include "PEX.h" -#include "PEXprotost.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pexSwap.h" - -#if defined (__STDC__) -#define SWAP_OC_PREFIX(t) cPEX##t -#else -#define SWAP_OC_PREFIX(t) cPEX/**/t -#endif - -extern ErrorCode - SwapPEXOCUnused (), - SwapPEXMarkerType (), - SwapPEXMarkerScale (), - SwapPEXMarkerColourIndex (), - SWAP_OC_PREFIX(MarkerColour) (), - SwapPEXMarkerBundleIndex (), - SwapPEXTextPrecision (), - SwapPEXCharExpansion (), - SwapPEXCharSpacing (), - SwapPEXCharHeight (), - SwapPEXCharUpVector (), - SwapPEXTextPath (), - SwapPEXTextAlignment (), - SwapPEXAtextStyle (), - SwapPEXLineType (), - SwapPEXLineWidth (), - SwapPEXCurveApproximation (), - SwapPEXPolylineInterp (), - SwapPEXInteriorStyle (), - SWAP_OC_PREFIX(SurfaceReflAttr) (), - SwapPEXSurfaceReflModel (), - SwapPEXSurfaceInterp (), - SwapPEXSurfaceApproximation (), - SwapPEXCullingMode (), - SwapPEXDistinguishFlag (), - SwapPEXPatternSize (), - SwapPEXPatternRefPt (), - SwapPEXPatternAttr (), - SwapPEXSurfaceEdgeFlag (), - SwapPEXSurfaceEdgeType (), - SwapPEXSetAsfValues (), - SwapPEXLocalTransform (), - SwapPEXLocalTransform2D (), - SwapPEXGlobalTransform (), - SwapPEXGlobalTransform2D (), - SwapPEXModelClip (), - SWAP_OC_PREFIX(ModelClipVolume) (), - SWAP_OC_PREFIX(ModelClipVolume2D) (), - SwapPEXRestoreModelClip (), - SWAP_OC_PREFIX(LightState) (), - SwapPEXPickId (), - SwapPEXHlhsrIdentifier (), - SWAP_OC_PREFIX(ParaSurfCharacteristics) (), - SWAP_OC_PREFIX(AddToNameSet) (), - SwapPEXExecuteStructure (), - SwapPEXLabel (), - SwapPEXApplicationData (), - SwapPEXGse (), - SWAP_OC_PREFIX(Marker) (), - SWAP_OC_PREFIX(Marker2D) (), - SWAP_OC_PREFIX(Text) (), - SWAP_OC_PREFIX(Text2D) (), - SWAP_OC_PREFIX(AnnotationText) (), - SWAP_OC_PREFIX(AnnotationText2D) (), - SWAP_OC_PREFIX(Polyline) (), - SWAP_OC_PREFIX(Polyline2D) (), - SWAP_OC_PREFIX(PolylineSet) (), - SWAP_OC_PREFIX(NurbCurve) (), - SWAP_OC_PREFIX(FillArea) (), - SWAP_OC_PREFIX(FillArea2D) (), - SWAP_OC_PREFIX(ExtFillArea) (), - SWAP_OC_PREFIX(FillAreaSet) (), - SWAP_OC_PREFIX(FillAreaSet2D) (), - SWAP_OC_PREFIX(ExtFillAreaSet) (), - SWAP_OC_PREFIX(TriangleStrip) (), - SWAP_OC_PREFIX(QuadrilateralMesh) (), - SWAP_OC_PREFIX(SOFAS) (), - SWAP_OC_PREFIX(NurbSurface) (), - SWAP_OC_PREFIX(CellArray) (), - SWAP_OC_PREFIX(CellArray2D) (), - SWAP_OC_PREFIX(ExtCellArray) (), - SWAP_OC_PREFIX(Gdp) (), - SWAP_OC_PREFIX(Gdp2D) (), - SwapPEXRenderingColourModel(); - -OCFunction SWAP_OC_PREFIX(OutputCmd) [] = { - SwapPEXOCUnused, - SwapPEXMarkerType, - SwapPEXMarkerScale, - SwapPEXMarkerColourIndex, - SWAP_OC_PREFIX(MarkerColour), - SwapPEXMarkerBundleIndex, - SwapPEXMarkerBundleIndex, /* TextFontIndex */ - SwapPEXTextPrecision, - SwapPEXCharExpansion, - SwapPEXCharSpacing, - SwapPEXMarkerColourIndex, /* TextColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* TextColour */ - SwapPEXCharHeight, - SwapPEXCharUpVector, - SwapPEXTextPath, - SwapPEXTextAlignment, - SwapPEXCharHeight, /* AtextHeight */ - SwapPEXCharUpVector, /* AtextUpVector */ - SwapPEXTextPath, /* AtextPath */ - SwapPEXTextAlignment, /* AtextAlignment */ - SwapPEXAtextStyle, - SwapPEXMarkerBundleIndex, /* TextBundleIndex */ - SwapPEXLineType, - SwapPEXLineWidth, - SwapPEXMarkerColourIndex, /* LineColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* LineColour */ - SwapPEXCurveApproximation, - SwapPEXPolylineInterp, - SwapPEXMarkerBundleIndex, /* LineBundleIndex */ - SwapPEXInteriorStyle, - SwapPEXMarkerBundleIndex, /* InteriorStyleIndex */ - SwapPEXMarkerColourIndex, /* SurfaceColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* SurfaceColour */ - SWAP_OC_PREFIX(SurfaceReflAttr), - SwapPEXSurfaceReflModel, - SwapPEXSurfaceInterp, - SwapPEXInteriorStyle, /* BfInteriorStyle */ - SwapPEXMarkerBundleIndex, /* BfInteriorStyleIndex */ - SwapPEXMarkerColourIndex, /* BfSurfaceColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* BfSurfaceColour */ - SWAP_OC_PREFIX(SurfaceReflAttr), /* BfSurfaceReflAttr */ - SwapPEXSurfaceReflModel, /* BfSurfaceReflModel */ - SwapPEXSurfaceInterp, /* BfSurfaceInterp */ - SwapPEXSurfaceApproximation, - SwapPEXCullingMode, - SwapPEXDistinguishFlag, - SwapPEXPatternSize, - SwapPEXPatternRefPt, - SwapPEXPatternAttr, - SwapPEXMarkerBundleIndex, /* InteriorBundleIndex */ - SwapPEXSurfaceEdgeFlag, - SwapPEXSurfaceEdgeType, - SwapPEXLineWidth, /* SurfaceEdgeWidth */ - SwapPEXMarkerColourIndex, /* SurfaceEdgeColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* SurfaceEdgeColour */ - SwapPEXMarkerBundleIndex, /* EdgeBundleIndex */ - SwapPEXSetAsfValues, - SwapPEXLocalTransform, - SwapPEXLocalTransform2D, - SwapPEXGlobalTransform, - SwapPEXGlobalTransform2D, - SwapPEXModelClip, - SWAP_OC_PREFIX(ModelClipVolume), - SWAP_OC_PREFIX(ModelClipVolume2D), - SwapPEXRestoreModelClip, - SwapPEXMarkerBundleIndex, /* ViewIndex */ - SWAP_OC_PREFIX(LightState), - SwapPEXMarkerBundleIndex, /* DepthCueIndex */ - SwapPEXPickId, - SwapPEXHlhsrIdentifier, - SwapPEXMarkerBundleIndex, /* ColourApproxIndex */ - SwapPEXRenderingColourModel, /* RenderingColourModel */ - SWAP_OC_PREFIX(ParaSurfCharacteristics), - SWAP_OC_PREFIX(AddToNameSet), - SWAP_OC_PREFIX(AddToNameSet), /* RemoveFromNameSet */ - SwapPEXExecuteStructure, - SwapPEXLabel, - SwapPEXApplicationData, - SwapPEXGse, - SWAP_OC_PREFIX(Marker), - SWAP_OC_PREFIX(Marker2D), - SWAP_OC_PREFIX(Text), - SWAP_OC_PREFIX(Text2D), - SWAP_OC_PREFIX(AnnotationText), - SWAP_OC_PREFIX(AnnotationText2D), - SWAP_OC_PREFIX(Polyline), - SWAP_OC_PREFIX(Polyline2D), - SWAP_OC_PREFIX(PolylineSet), - SWAP_OC_PREFIX(NurbCurve), - SWAP_OC_PREFIX(FillArea), - SWAP_OC_PREFIX(FillArea2D), - SWAP_OC_PREFIX(ExtFillArea), - SWAP_OC_PREFIX(FillAreaSet), - SWAP_OC_PREFIX(FillAreaSet2D), - SWAP_OC_PREFIX(ExtFillAreaSet), - SWAP_OC_PREFIX(TriangleStrip), - SWAP_OC_PREFIX(QuadrilateralMesh), - SWAP_OC_PREFIX(SOFAS), - SWAP_OC_PREFIX(NurbSurface), - SWAP_OC_PREFIX(CellArray), - SWAP_OC_PREFIX(CellArray2D), - SWAP_OC_PREFIX(ExtCellArray), - SWAP_OC_PREFIX(Gdp), - SWAP_OC_PREFIX(Gdp2D) -}; - -#undef SWAP_OC_PREFIX Index: xc/programs/Xserver/PEX5/dipex/swap/cOCprim.c diff -u xc/programs/Xserver/PEX5/dipex/swap/cOCprim.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/cOCprim.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/cOCprim.c:1.9 Fri Dec 14 14:57:47 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/cOCprim.c Sat Feb 28 21:41:56 2004 @@ -1,839 +0,0 @@ -/* $Xorg: cOCprim.c,v 1.4 2001/02/09 02:04:16 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* - Contains swap routines for certain OCs and utility routines. - The difference between this file and its companion uOCprim.c - are subtle, having to do with, for example, whether or not - you have to swap strmPtr->numPoints before or after you will - need to use it to know how many points to convert. - */ - -/* All such packet interdependencies should be handled in these two - files: cOCprim.c and uOCprim.c - */ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "convertStr.h" - -#define LOCAL_FLAG extern -#include "convUtil.h" -#include "OCattr.h" -#undef LOCAL_FLAG - -#include "ConvName.h" -#define LOCAL_FLAG -#include "OCprim.h" - - -#ifndef PADDING -#define PADDING(n) ( (n)%4 ? (4 - (n)%4) : 0) -#endif - - -unsigned char * -SWAP_FUNC_PREFIX(SwapFacet) (swapPtr, facetMask, vertexMask, colourType, ptr) -pexSwap *swapPtr; -CARD16 facetMask; -CARD16 vertexMask; -pexEnumTypeIndex colourType; -unsigned char *ptr; -{ - CARD32 numVerts; - CARD32 i; - - ptr = SwapOptData (swapPtr, ptr, facetMask, colourType); - - SWAP_CARD32((*((CARD32 *)ptr))); - numVerts = *((CARD32 *)ptr); - ptr += sizeof(CARD32); - - for (i=0; icolourType); - ptr = (unsigned char *)(pc+1); - ptr = SwapColour (swapPtr, (pexColour *)ptr, pc->colourType); - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapReflectionAttr) (swapPtr, p_data) -pexSwap *swapPtr; -pexReflectionAttr *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_FLOAT (p_data->ambient); - SWAP_FLOAT (p_data->diffuse); - SWAP_FLOAT (p_data->specular); - SWAP_FLOAT (p_data->specularConc); - SWAP_FLOAT (p_data->transmission); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->specularColour)); - - return (ptr); -} - -void -SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, pME, num) -pexSwap *swapPtr; -pexMonoEncoding *pME; -CARD32 num; -{ - CARD16 i, j; - int bytes; - - for (i=0; icharacterSet); - SWAP_CARD16(pME->numChars); - - switch (pME->characterSetWidth) { - case PEXCSByte: - bytes = pME->numChars; - break; - case PEXCSShort: { - CARD16 *ptr = (CARD16 *)(pME+1); - for (j=0; jnumChars; j++, ptr++) SWAP_CARD16((*ptr)); - bytes = pME->numChars * sizeof(CARD16); - break; - } - - case PEXCSLong: { - CARD32 *ptr = (CARD32 *)(pME+1); - for (j=0; jnumChars; j++, ptr++) SWAP_CARD32((*ptr)); - bytes = pME->numChars * sizeof(CARD32); - break; - } - - } - pME = (pexMonoEncoding *) ((char *) (pME + 1) + - bytes + PADDING (bytes)); - - } - -} - - - -/* The rest are OC's */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXModelClipVolume) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexModelClipVolume *strmPtr; -{ - int i; - pexHalfSpace *ph; - - SWAP_ENUM_TYPE_INDEX (strmPtr->modelClipOperator); - SWAP_CARD16 (strmPtr->numHalfSpaces); - - for (i=0, ph=(pexHalfSpace *)(strmPtr+1); inumHalfSpaces; i++,ph++) - SwapHalfSpace(swapPtr, ph); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXModelClipVolume2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexModelClipVolume2D *strmPtr; -{ - int i; - pexHalfSpace2D *ph; - - SWAP_ENUM_TYPE_INDEX (strmPtr->modelClipOperator); - SWAP_CARD16 (strmPtr->numHalfSpaces); - - for (i=0,ph=(pexHalfSpace2D *)(strmPtr+1);inumHalfSpaces; i++,ph++) - SwapHalfSpace2D(swapPtr, ph); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXLightState) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLightState *strmPtr; -{ - int i, numE, numD; - CARD16 *light; - - SWAP_CARD16 (strmPtr->numEnable); - SWAP_CARD16 (strmPtr->numDisable); - - numE = strmPtr->numEnable; - numD = strmPtr->numDisable; - - for (i=0, light = (CARD16 *)(strmPtr+1); ihead.length) - sizeof(pexAddToNameSet)) - /sizeof(pexName)); - - for (i=0, pn=(pexName *)(strmPtr+1); ihead.length) - sizeof(pexMarker)) - /sizeof(pexCoord3D)); - - SwapCoord3DList(swapPtr, pc, num); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXMarker2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarker2D *strmPtr; -{ - CARD32 num; - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexMarker2D)) - /sizeof(pexCoord2D)); - - SwapCoord2DList(swapPtr, pc, num); -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolyline) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolyline *strmPtr; -{ - CARD32 num; - pexCoord3D *pc = (pexCoord3D *)(strmPtr+1); - - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexPolyline)) - /sizeof(pexCoord3D)); - - SwapCoord3DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolyline2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolyline2D *strmPtr; -{ - CARD32 num; - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexPolyline2D)) - /sizeof(pexCoord2D)); - - SwapCoord2DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolylineSet) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolylineSet *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexVertex *pv; - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numLists); - - pj = (CARD32 *)(strmPtr+1); - for (i=0; inumLists; i++, pj = (CARD32 *)pv) { - - SWAP_CARD32 ((*pj)); - k = *pj++; - for (j=0, pv = (pexVertex *)pj; jvertexAttribs, strmPtr->colourType); - } - - } -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXNurbCurve) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNurbCurve *strmPtr; -{ - int i; - PEXFLOAT *pf; - - SWAP_CARD16 (strmPtr->curveOrder); - SWAP_COORD_TYPE (strmPtr->coordType); - SWAP_FLOAT (strmPtr->tmin); - SWAP_FLOAT (strmPtr->tmax); - SWAP_CARD32 (strmPtr->numKnots); - SWAP_CARD32 (strmPtr->numPoints); - - for (i=0, pf=(PEXFLOAT *)(strmPtr+1); inumKnots; i++, pf++) - SWAP_FLOAT((*pf)); - - if (strmPtr->coordType == PEXRational) - SwapCoord4DList(swapPtr, (pexCoord4D *)pf, strmPtr->numPoints); - else - SwapCoord3DList(swapPtr, (pexCoord3D *)pf, strmPtr->numPoints); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillArea) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillArea *strmPtr; -{ - CARD32 num; - pexCoord3D *pc = (pexCoord3D *)(strmPtr+1); - - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexFillArea)) - /sizeof(pexCoord3D)); - - SWAP_CARD16 (strmPtr->shape); - - SwapCoord3DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillArea2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillArea2D *strmPtr; -{ - CARD32 num; - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexFillArea2D)) - /sizeof(pexCoord2D)); - - SWAP_CARD16 (strmPtr->shape); - - SwapCoord2DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXExtFillArea) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExtFillArea *strmPtr; -{ - - SWAP_CARD16 (strmPtr->shape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - - SWAP_FUNC_PREFIX(SwapFacet)( swapPtr, strmPtr->facetAttribs, - strmPtr->vertexAttribs, strmPtr->colourType, - (CARD8 *)(strmPtr+1)); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillAreaSet) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillAreaSet *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexCoord3D *pc; - - SWAP_CARD16 (strmPtr->shape); - SWAP_CARD32 (strmPtr->numLists); - - pj = (CARD32 *)(strmPtr+1); - - for (i=0; inumLists; i++, pj = (CARD32 *)pc ) { - - SWAP_CARD32 ((*pj)); - k = *pj++; - for (j=0, pc = (pexCoord3D *)pj; jshape); - SWAP_CARD32 (strmPtr->numLists); - pj = (CARD32 *)(strmPtr+1); - - for (i=0; inumLists; i++, pj = (CARD32 *)pc ) { - - SWAP_CARD32 ((*pj)); - k = *pj++; - for (j=0, pc = (pexCoord2D *)pj; jshape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numLists); - - ptr = SwapOptData (swapPtr, (CARD8 *) (strmPtr+1), - strmPtr->facetAttribs, strmPtr->colourType); - - - for (i=0, pj = (CARD32 *)ptr; inumLists; i++, pj = (CARD32 *)pv) { - SWAP_CARD32 ((*pj)); - k = *pj++; - for (j=0, pv = (pexVertex *)pj; jvertexAttribs, - strmPtr->colourType); - } - - } - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXTriangleStrip) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexTriangleStrip *strmPtr; -{ - CARD32 i; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numVertices); - - for (i=0; i<(strmPtr->numVertices-2); i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->facetAttribs, - strmPtr->colourType); - - for (i=0; inumVertices; i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, strmPtr->vertexAttribs, - strmPtr->colourType); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXQuadrilateralMesh) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexQuadrilateralMesh *strmPtr; -{ - int i; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->mPts); - SWAP_CARD16 (strmPtr->nPts); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - - for (i=0; i<((strmPtr->mPts -1) * (strmPtr->nPts -1)); i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->facetAttribs, - strmPtr->colourType); - - for (i=0; i<(strmPtr->mPts * strmPtr->nPts); i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, strmPtr->vertexAttribs, - strmPtr->colourType); - -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXSOFAS) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSOFAS *strmPtr; -{ - CARD16 i, j, k; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - CARD16 numListsofLists, numLists, numitems; - - SWAP_CARD16 (strmPtr->shape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->FAS_Attributes); - SWAP_CARD16 (strmPtr->vertexAttributes); - SWAP_CARD16 (strmPtr->edgeAttributes); - SWAP_CARD16 (strmPtr->numFAS); - SWAP_CARD16 (strmPtr->numVertices); - SWAP_CARD16 (strmPtr->numEdges); - SWAP_CARD16 (strmPtr->numContours); - - for (i=0; inumFAS; i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->FAS_Attributes, - strmPtr->colourType); - - for (i=0; inumVertices; i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, - strmPtr->vertexAttributes, strmPtr->colourType); - - ptr += ((int)(((strmPtr->numEdges * strmPtr->edgeAttributes) + 3) / 4)) * 4; - - - numListsofLists = strmPtr->numFAS; - for (i=0; i < numListsofLists; i++){ - SWAP_CARD16 ((*((CARD16 *)ptr))); - numLists = *(CARD16 *)ptr; - ptr += sizeof(CARD16); - for (j=0; j < numLists; j++) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - numitems = *(CARD16 *)ptr; - ptr += sizeof(CARD16); - for (k=0; k < numitems; k++) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - } - } - } -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXNurbSurface) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNurbSurface *strmPtr; -{ - CARD32 i, j, k; - PEXFLOAT *pf; - unsigned char *ptr; - CARD32 numPoints, numKnots; - CARD32 numSublists; - CARD16 curveType; - pexTrimCurve *pTC = 0; - - SWAP_COORD_TYPE (strmPtr->type); - SWAP_CARD16 (strmPtr->uOrder); - SWAP_CARD16 (strmPtr->vOrder); - SWAP_CARD32 (strmPtr->numUknots); - SWAP_CARD32 (strmPtr->numVknots); - SWAP_CARD16 (strmPtr->mPts); - SWAP_CARD16 (strmPtr->nPts); - SWAP_CARD32 (strmPtr->numLists); - - for (i=0, pf=(PEXFLOAT *)(strmPtr+1); inumUknots; i++, pf++) - SWAP_FLOAT((*pf)); - - for (i=0; inumVknots; i++, pf++) - SWAP_FLOAT((*pf)); - - ptr = (unsigned char *)pf; - if (strmPtr->type == PEXRational) - ptr = SwapCoord4DList( swapPtr, (pexCoord4D *)ptr, - (CARD32)(strmPtr->mPts*strmPtr->nPts)); - else - ptr = SwapCoord3DList( swapPtr, (pexCoord3D *)ptr, - (CARD32)(strmPtr->mPts*strmPtr->nPts)); - - for (i=0; inumLists; i++) { - SWAP_CARD32((*((CARD32 *)ptr))); - numSublists = *((CARD32 *)ptr); /* num trim curves */ - ptr+=4; - for (j=0; jtype); - SWAP_CARD32(pTC->numKnots); - SWAP_CARD32(pTC->numCoord); - ptr = SwapTrimCurve(swapPtr, pTC); - } - } -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCellArray) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCellArray *strmPtr; -{ - int i; - CARD16 *pc; - - SWAP_COORD3D (strmPtr->point1); - SWAP_COORD3D (strmPtr->point2); - SWAP_COORD3D (strmPtr->point3); - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); - - for (i=0, pc=(CARD16 *)(strmPtr+1); i<(strmPtr->dx * strmPtr->dy); i++, pc++) - SWAP_CARD16((*((CARD16 *)pc))); - -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCellArray2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCellArray2D *strmPtr; -{ - int i; - CARD16 *pc; - - SWAP_COORD2D (strmPtr->point1); - SWAP_COORD2D (strmPtr->point2); - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); - - for (i=0, pc=(CARD16 *)(strmPtr+1); i<(strmPtr->dx * strmPtr->dy); i++, pc++) - SWAP_CARD16((*pc)); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXExtCellArray) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExtCellArray *strmPtr; -{ - CARD32 i; - unsigned char *ptr; - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_COORD3D (strmPtr->point1); - SWAP_COORD3D (strmPtr->point2); - SWAP_COORD3D (strmPtr->point3); - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); - - for ( i=0, ptr = (unsigned char *)(strmPtr+1); - i < strmPtr->dx * strmPtr->dy; - i++) { - ptr = SwapColour(swapPtr, (pexColour *)ptr, strmPtr->colourType); - } - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGdp) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGdp *strmPtr; -{ - pexCoord3D *pc = (pexCoord3D *)(strmPtr+1); - - SWAP_CARD32 (strmPtr->gdpId); - SWAP_CARD32 (strmPtr->numPoints); - SWAP_CARD32 (strmPtr->numBytes); - - SwapCoord3DList(swapPtr, pc, strmPtr->numPoints); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGdp2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGdp2D *strmPtr; -{ - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - SWAP_CARD32 (strmPtr->gdpId); - SWAP_CARD32 (strmPtr->numPoints); - SWAP_CARD32 (strmPtr->numBytes); - - SwapCoord2DList(swapPtr, pc, strmPtr->numPoints); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(Text) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexText *strmPtr; -{ - SWAP_COORD3D (strmPtr->origin); - SWAP_VECTOR3D (strmPtr->vector1); - SWAP_VECTOR3D (strmPtr->vector2); - SWAP_CARD16 (strmPtr->numEncodings); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); -} - -ErrorCode -SWAP_FUNC_PEX_PFX(Text2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexText2D *strmPtr; -{ - SWAP_COORD2D (strmPtr->origin); - SWAP_CARD16 (strmPtr->numEncodings); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(AnnotationText) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexAnnotationText *strmPtr; -{ - SWAP_COORD3D (strmPtr->origin); - SWAP_COORD3D (strmPtr->offset); - SWAP_CARD16 (strmPtr->numEncodings); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(AnnotationText2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexAnnotationText2D *strmPtr; -{ - SWAP_COORD2D (strmPtr->origin); - SWAP_COORD2D (strmPtr->offset); - SWAP_CARD16 (strmPtr->numEncodings); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(ParaSurfCharacteristics) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexParaSurfCharacteristics *strmPtr; -{ - SWAP_CARD16 (strmPtr->length); - SWAP_INT16 (strmPtr->characteristics); - - switch (strmPtr->characteristics) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - - case PEXPSCIsoCurves: { - pexPSC_IsoparametricCurves *ptr = - (pexPSC_IsoparametricCurves *)(strmPtr+1); - SWAP_CARD16(ptr->placementType); - SWAP_CARD16(ptr->numUcurves); - SWAP_CARD16(ptr->numVcurves); - break; - } - - case PEXPSCMcLevelCurves: - case PEXPSCWcLevelCurves: { - pexPSC_LevelCurves *ptr = (pexPSC_LevelCurves *)(strmPtr+1); - PEXFLOAT *pc = (PEXFLOAT *)(ptr+1); - CARD16 i; - SWAP_COORD3D (ptr->origin); - SWAP_VECTOR3D (ptr->direction); - SWAP_CARD16 (ptr->numberIntersections); - for (i=0; inumberIntersections; i++, pc++) { - SWAP_FLOAT(*pc); - } - break; - } - } - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXNoop) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNoop *strmPtr; -{ -} Index: xc/programs/Xserver/PEX5/dipex/swap/check.c diff -u xc/programs/Xserver/PEX5/dipex/swap/check.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/check.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/check.c:1.9 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/check.c Sat Feb 28 21:41:56 2004 @@ -1,357 +0,0 @@ -/* $Xorg: check.c,v 1.7 2001/02/09 02:04:16 xorgcvs Exp $ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "X.h" -#include "Xproto.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "pexError.h" - -/* - Check floating point format for every request and set the - Request and OC tables appropriately. - - Note that the code depends on the fact that every request - that is concerned with floating point format uses the 3rd short - as a floating point specifier; - */ - -extern void SwapFLOAT(); -extern void SwapIEEEToVax(); -extern void SwapVaxToIEEE(); -extern void ConvertIEEEToVax(); -extern void ConvertVaxToIEEE(); -extern OCFunction cPEXOutputCmd[]; -extern OCFunction uPEXOutputCmd[]; -extern RequestFunction PEXRequest[]; -extern RequestFunction cPEXRequest[]; -extern ReplyFunction uPEXReply[]; - -/* define some macros previously taken from swapmacros.h */ -/* byte swap AND COPY a short (given pointer) */ -#define SWAPSHORTC(x, y)\ -((char *) (y))[1] = ((char *) (x))[0];\ -((char *) (y))[0] = ((char *) (x))[1] - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - INT16 fpFormat B16; - CARD16 unused B16; -} checkStdHeader; - - -static PEXFLOAT -NoFloatConv( f ) -PEXFLOAT f; -{ - return (f); -} - -static ErrorCode -NoFloat( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -checkStdHeader *strmPtr; -{ - if (cntxtPtr->client->swapped) { - cntxtPtr->pexRequest = cPEXRequest; - cntxtPtr->pexSwapRequestOC = cPEXOutputCmd; - cntxtPtr->pexSwapReply = uPEXReply; - cntxtPtr->pexSwapReplyOC = uPEXOutputCmd; - cntxtPtr->swap->ConvertFLOAT= 0; - - } else { - cntxtPtr->pexRequest = PEXRequest; - cntxtPtr->pexSwapRequestOC = 0; - cntxtPtr->pexSwapReply = 0; - cntxtPtr->pexSwapReplyOC = 0; - cntxtPtr->swap->ConvertFLOAT= 0; - } - return(Success); -} - - -/* HACK ALERT ON */ -static INT16 lastfp[MAXCLIENTS]; -/* HACK ALERT OFF */ - -static ErrorCode -CheckFloat( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -checkStdHeader *strmPtr; -{ -/* HACK ALERT ON */ -extern INT16 lastfp[MAXCLIENTS]; -/* HACK ALERT OFF */ - - pexEnumTypeIndex fp; - - if (cntxtPtr->client->swapped) { - cntxtPtr->pexRequest = cPEXRequest; - cntxtPtr->pexSwapRequestOC = cPEXOutputCmd; - cntxtPtr->pexSwapReply = uPEXReply; - cntxtPtr->pexSwapReplyOC = uPEXOutputCmd; - SWAPSHORTC(&(strmPtr->fpFormat), &fp); - - if ( fp == SERVER_NATIVE_FP ) { - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapFLOAT; - - } else { - if (fp == PEXDEC_F_Floating) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapVaxToIEEE; - else if (fp == PEXIeee_754_32) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapIEEEToVax; - /* we don't do the other kinds yet */ - else PEX_ERR_EXIT(PEXFloatingPointFormatError,fp,cntxtPtr); - } - - } else { - if ( (fp = strmPtr->fpFormat) == SERVER_NATIVE_FP ) { - cntxtPtr->pexRequest = PEXRequest; - cntxtPtr->pexSwapRequestOC = 0; - cntxtPtr->pexSwapReply = 0; - cntxtPtr->pexSwapReplyOC = 0; - cntxtPtr->swap->ConvertFLOAT= 0; - - } else { - cntxtPtr->pexRequest = cPEXRequest; - cntxtPtr->pexSwapRequestOC = cPEXOutputCmd; - cntxtPtr->pexSwapReply = uPEXReply; - cntxtPtr->pexSwapReplyOC = uPEXOutputCmd; - if (fp == PEXDEC_F_Floating) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)ConvertVaxToIEEE; - else if (fp == PEXIeee_754_32) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)ConvertIEEEToVax; - /* we don't do the other kinds yet */ - else PEX_ERR_EXIT(PEXFloatingPointFormatError,fp,cntxtPtr); - } - - }; - - /* HACK ALERT ON */ - /* set the floating point format for use by HackFloat */ - lastfp[cntxtPtr->client->index] = fp; - /* HACK ALERT OFF */ - - return(Success); -} - -static ErrorCode -HackFloat( cntxtPtr, strmPtr ) -pexContext *cntxtPtr; -checkStdHeader *strmPtr; -{ -extern INT16 lastfp[MAXCLIENTS]; - - pexEnumTypeIndex fp; - - /* This Routine is a HACK to set the cntxtPtr up for any Requests - that need to SWAP Floats but don't have the fpFormat as part of - the request (ie PEXUpdatePickMeasure). Instead of getting the - fp type from the request it will retrieve it from a global array - which stores, on a per client basis the fpFormat of the last - request that had one. - */ - - fp = lastfp[cntxtPtr->client->index]; - if (cntxtPtr->client->swapped) { - cntxtPtr->pexRequest = cPEXRequest; - cntxtPtr->pexSwapRequestOC = cPEXOutputCmd; - cntxtPtr->pexSwapReply = uPEXReply; - cntxtPtr->pexSwapReplyOC = uPEXOutputCmd; - - if ( fp == SERVER_NATIVE_FP ) { - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapFLOAT; - - } else { - if (fp == PEXDEC_F_Floating) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapVaxToIEEE; - else if (fp == PEXIeee_754_32) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)SwapIEEEToVax; - /* we don't do the other kinds yet */ - else PEX_ERR_EXIT(PEXFloatingPointFormatError,fp,cntxtPtr); - } - - } else { - if ( fp == SERVER_NATIVE_FP ) { - cntxtPtr->pexRequest = PEXRequest; - cntxtPtr->pexSwapRequestOC = 0; - cntxtPtr->pexSwapReply = 0; - cntxtPtr->pexSwapReplyOC = 0; - cntxtPtr->swap->ConvertFLOAT= 0; - - } else { - cntxtPtr->pexRequest = cPEXRequest; - cntxtPtr->pexSwapRequestOC = cPEXOutputCmd; - cntxtPtr->pexSwapReply = uPEXReply; - cntxtPtr->pexSwapReplyOC = uPEXOutputCmd; - if (fp == PEXDEC_F_Floating) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)ConvertVaxToIEEE; - else if (fp == PEXIeee_754_32) - cntxtPtr->swap->ConvertFLOAT = (ConvFunction)ConvertIEEEToVax; - /* we don't do the other kinds yet */ - else PEX_ERR_EXIT(PEXFloatingPointFormatError,fp,cntxtPtr); - } - - }; - return(Success); -} - -RequestFunction set_tables[] = { -/* 0 */ NoFloat, /* PEXRequestUnused */ -/* 1 */ NoFloat, /* PEXGetExtensionInfo */ -/* 2 */ NoFloat, /* PEXGetEnumeratedTypeInfo */ -/* 3 */ CheckFloat, /* PEXGetImpDepConstants */ -/* 4 */ NoFloat, /* PEXCreateLookupTable */ -/* 5 */ NoFloat, /* PEXCopyLookupTable */ -/* 6 */ NoFloat, /* PEXFreeLookupTable */ -/* 7 */ NoFloat, /* PEXGetTableInfo */ -/* 8 */ CheckFloat, /* PEXGetPredefinedEntries */ -/* 9 */ NoFloat, /* PEXGetDefinedIndices */ -/* 10 */ CheckFloat, /* PEXGetTableEntry */ -/* 11 */ CheckFloat, /* PEXGetTableEntries */ -/* 12 */ CheckFloat, /* PEXSetTableEntries */ -/* 13 */ NoFloat, /* PEXDeleteTableEntries */ -/* 14 */ CheckFloat, /* PEXCreatePipelineContext */ -/* 15 */ NoFloat, /* PEXCopyPipelineContext */ -/* 16 */ NoFloat, /* PEXFreePipelineContext */ -/* 17 */ CheckFloat, /* PEXGetPipelineContext */ -/* 18 */ CheckFloat, /* PEXChangePipelineContext */ -/* 19 */ CheckFloat, /* PEXCreateRenderer */ -/* 20 */ NoFloat, /* PEXFreeRenderer */ -/* 21 */ CheckFloat, /* PEXChangeRenderer */ -/* 22 */ CheckFloat, /* PEXGetRendererAttributes */ -/* 23 */ NoFloat, /* PEXGetRendererDynamics */ -/* 24 */ NoFloat, /* PEXBeginRendering */ -/* 25 */ NoFloat, /* PEXEndRendering */ -/* 26 */ NoFloat, /* PEXBeginStructure */ -/* 27 */ NoFloat, /* PEXEndStructure */ -/* 28 */ CheckFloat, /* PEXRenderOutputCommands */ -/* 29 */ NoFloat, /* PEXRenderNetwork */ -/* 30 */ NoFloat, /* PEXCreateStructure */ -/* 31 */ NoFloat, /* PEXCopyStructure */ -/* 32 */ NoFloat, /* PEXDestroyStructures */ -/* 33 */ CheckFloat, /* PEXGetStructureInfo */ -/* 34 */ CheckFloat, /* PEXGetElementInfo */ -/* 35 */ NoFloat, /* PEXGetStructuresInNetwork */ -/* 36 */ NoFloat, /* PEXGetAncestors */ -/* 37 */ NoFloat, /* PEXGetDescendants */ -/* 38 */ CheckFloat, /* PEXFetchElements */ -/* 39 */ NoFloat, /* PEXSetEditingMode */ -/* 40 */ NoFloat, /* PEXSetElementPointer */ -/* 41 */ NoFloat, /* PEXSetElementPointerAtLabel */ -/* 42 */ NoFloat, /* PEXElementSearch */ -/* 43 */ CheckFloat, /* PEXStoreElements */ -/* 44 */ NoFloat, /* PEXDeleteElements */ -/* 45 */ NoFloat, /* PEXDeleteElementsToLabel */ -/* 46 */ NoFloat, /* PEXDeleteBetweenLabels */ -/* 47 */ NoFloat, /* PEXCopyElements */ -/* 48 */ NoFloat, /* PEXChangeStructureRefs */ -/* 49 */ NoFloat, /* PEXCreateNameSet */ -/* 50 */ NoFloat, /* PEXCopyNameSet */ -/* 51 */ NoFloat, /* PEXFreeNameSet */ -/* 52 */ NoFloat, /* PEXGetNameSet */ -/* 53 */ NoFloat, /* PEXChangeNameSet */ -/* 54 */ CheckFloat, /* PEXCreateSearchContext */ -/* 55 */ NoFloat, /* PEXCopySearchContext */ -/* 56 */ NoFloat, /* PEXFreeSearchContext */ -/* 57 */ CheckFloat, /* PEXGetSearchContext */ -/* 58 */ CheckFloat, /* PEXChangeSearchContext */ -/* 59 */ NoFloat, /* PEXSearchNetwork */ -/* 60 */ NoFloat, /* PEXCreatePhigsWks */ -/* 61 */ NoFloat, /* PEXFreePhigsWks */ -/* 62 */ CheckFloat, /* PEXGetWksInfo */ -/* 63 */ NoFloat, /* PEXGetDynamics */ -/* 64 */ CheckFloat, /* PEXGetViewRep */ -/* 65 */ NoFloat, /* PEXRedrawAllStructures */ -/* 66 */ NoFloat, /* PEXUpdateWorkstation */ -/* 67 */ NoFloat, /* PEXRedrawClipRegion */ -/* 68 */ NoFloat, /* PEXExecuteDeferredActions */ -/* 69 */ NoFloat, /* PEXSetViewPriority */ -/* 70 */ NoFloat, /* PEXSetDisplayUpdateMode */ -/* 71 */ CheckFloat, /* PEXMapDCtoWC */ -/* 72 */ CheckFloat, /* PEXMapWCtoDC */ -/* 73 */ CheckFloat, /* PEXSetViewRep */ -/* 74 */ CheckFloat, /* PEXSetWksWindow */ -/* 75 */ CheckFloat, /* PEXSetWksViewport */ -/* 76 */ NoFloat, /* PEXSetHlhsrMode */ -/* 77 */ NoFloat, /* PEXSetWksBufferMode */ -/* 78 */ CheckFloat, /* PEXPostStructure */ -/* 79 */ NoFloat, /* PEXUnpostStructure */ -/* 80 */ NoFloat, /* PEXUnpostAllStructures */ -/* 81 */ NoFloat, /* PEXGetWksPostings */ -/* 82 */ CheckFloat, /* PEXGetPickDevice */ -/* 83 */ CheckFloat, /* PEXChangePickDevice */ -/* 84 */ NoFloat, /* PEXCreatePickMeasure */ -/* 85 */ NoFloat, /* PEXFreePickMeasure */ -/* 86 */ NoFloat, /* PEXGetPickMeasure */ -/* 87 */ HackFloat, /* PEXUpdatePickMeasure */ -/* 88 */ NoFloat, /* PEXOpenFont */ -/* 89 */ NoFloat, /* PEXCloseFont */ -/* 90 */ NoFloat, /* PEXQueryFont */ -/* 91 */ NoFloat, /* PEXListFonts */ -/* 92 */ NoFloat, /* PEXListFontsWithInfo */ -/* 93 */ CheckFloat, /* PEXQueryTextExtents */ -/* 94 */ NoFloat, /* PEXMatchRendererTargets */ -/* 95 */ NoFloat, /* PEXEscape */ -/* 96 */ NoFloat, /* PEXEscapeWithReply */ -/* 97 */ NoFloat, /* PEXRenderElements */ -/* 98 */ NoFloat, /* PEXAccumulateState */ -/* 99 */ CheckFloat, /* PEXBeginPickOne */ -/* 100 */ NoFloat, /* PEXEndPickOne */ -/* 101 */ CheckFloat, /* PEXPickOne */ -/* 102 */ CheckFloat, /* PEXBeginPickAll */ -/* 103 */ NoFloat, /* PEXEndPickAll */ -/* 104 */ CheckFloat /* PEXPickAll */ -}; Index: xc/programs/Xserver/PEX5/dipex/swap/convEv.c diff -u xc/programs/Xserver/PEX5/dipex/swap/convEv.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/convEv.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/convEv.c:1.9 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convEv.c Sat Feb 28 21:41:56 2004 @@ -1,62 +0,0 @@ -/* $Xorg: convEv.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/************************************************************ - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -******************************************************************/ - - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "pexError.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "ddpex.h" -#include "pexLookup.h" -#include "convertStr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG extern - - -/**************************************************************** - * EVENTS * - ****************************************************************/ - - - -void -SwapPEXMaxHitsReachedEvent(from, to) -pexMaxHitsReachedEvent *from, *to; -{ - to->type = from->type; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->rdr, to->rdr); -} - - Index: xc/programs/Xserver/PEX5/dipex/swap/convReq.c diff -u xc/programs/Xserver/PEX5/dipex/swap/convReq.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/convReq.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/convReq.c:1.9 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convReq.c Sat Feb 28 21:41:56 2004 @@ -1,2553 +0,0 @@ -/* $Xorg: convReq.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "pexError.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "ddpex.h" -#include "pexLookup.h" -#include "convertStr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG extern -#include "convUtil.h" -#include "ConvName.h" -#include "OCprim.h" -#include "OCcolour.h" -#include "OCattr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG -#include "convReq.h" - -extern RequestFunction PEXRequest[]; - -#define PADDING(n) ( (n)&3 ? (4 - ((n)&3)) : 0) - - -/**************************************************************** - * REQUESTS * - ****************************************************************/ - -#define CALL_REQUEST return(PEXRequest[strmPtr->opcode](cntxtPtr, strmPtr)) - - -ErrorCode -SWAP_FUNC_PREFIX(PEXGenericRequest) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - /* length in 4 bytes quantities */ - /* of whole request, including this header */ - CALL_REQUEST; -} - -/***************************************************************** - * structures that follow request. - *****************************************************************/ - -/* ResourceReq is used for any request which has a resource ID - (or Atom or Time) as its one and only argument. */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGenericResourceRequest) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexResourceReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_CARD32 (strmPtr->id); /* a Structure, Renderer, Font, Pixmap, etc. */ - - CALL_REQUEST; -} - - -/***************************************************************** - * Specific Requests - *****************************************************************/ - - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetExtensionInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetExtensionInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_CARD16 (strmPtr->clientProtocolMajor); - SWAP_CARD16 (strmPtr->clientProtocolMinor); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetEnumeratedTypeInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetEnumeratedTypeInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD32 i; - CARD16 *ptr = (CARD16 *)(strmPtr+1); - - SWAP_CARD16 (strmPtr->length); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_BITMASK (strmPtr->itemMask); - SWAP_CARD32 (strmPtr->numEnums); - - for (i=0; inumEnums; i++, ptr++) - SWAP_CARD16 ((*ptr)); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCreateLookupTable) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateLookupTableReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_DRAWABLE (strmPtr->drawableExample); - SWAP_LOOKUP_TABLE (strmPtr->lut); - SWAP_TABLE_TYPE (strmPtr->tableType); - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopyLookupTable) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyLookupTableReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_LOOKUP_TABLE (strmPtr->src); - SWAP_LOOKUP_TABLE (strmPtr->dst); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreeLookupTableReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetTableInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetTableInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_DRAWABLE (strmPtr->drawableExample); - SWAP_TABLE_TYPE (strmPtr->tableType); - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetPredefinedEntries) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetPredefinedEntriesReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_DRAWABLE (strmPtr->drawableExample); - SWAP_TABLE_TYPE (strmPtr->tableType); - SWAP_TABLE_INDEX (strmPtr->start); - SWAP_CARD16 (strmPtr->count); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexGetDefinedIndicesReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetTableEntry) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetTableEntryReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD16 (strmPtr->valueType); - SWAP_LOOKUP_TABLE (strmPtr->lut); - SWAP_TABLE_INDEX (strmPtr->index); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetTableEntries) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetTableEntriesReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD16 (strmPtr->valueType); - SWAP_LOOKUP_TABLE (strmPtr->lut); - SWAP_TABLE_INDEX (strmPtr->start); - SWAP_CARD16 (strmPtr->count); - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetTableEntries) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetTableEntriesReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - ErrorCode err = Success; - pexTableType ttype; - diLUTHandle lut; - CARD32 num; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_LOOKUP_TABLE (strmPtr->lut); - SWAP_TABLE_INDEX (strmPtr->start); - SWAP_CARD16 (strmPtr->count); - - LU_TABLE(strmPtr->lut, lut); - ttype = lut->lutType; - num = (CARD32)(strmPtr->count); - - SWAP_FUNC_PREFIX(SwapTable) ( swapPtr, ttype, num, - (unsigned char *)(strmPtr+1)); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXDeleteTableEntries) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDeleteTableEntriesReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_LOOKUP_TABLE (strmPtr->lut); - SWAP_TABLE_INDEX (strmPtr->start); - SWAP_CARD16 (strmPtr->count); - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCreatePipelineContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePipelineContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PC (strmPtr->pc); - SWAP_CARD32 (strmPtr->itemMask[0]); - SWAP_CARD32 (strmPtr->itemMask[1]); - - SWAP_FUNC_PREFIX(SwapPipelineContextAttr) ( swapPtr, - (CARD32 *)(strmPtr->itemMask), - (CARD8 *)(strmPtr + 1)); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopyPipelineContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyPipelineContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PC (strmPtr->src); - SWAP_PC (strmPtr->dst); - SWAP_CARD32 (strmPtr->itemMask[0]); - SWAP_CARD32 (strmPtr->itemMask[1]); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreePipelineContextReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetPipelineContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetPipelineContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PC (strmPtr->pc); - SWAP_CARD32 (strmPtr->itemMask[0]); - SWAP_CARD32 (strmPtr->itemMask[1]); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangePipelineContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangePipelineContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PC (strmPtr->pc); - SWAP_CARD32 (strmPtr->itemMask[0]); - SWAP_CARD32 (strmPtr->itemMask[1]); - - SWAP_FUNC_PREFIX(SwapPipelineContextAttr) ( swapPtr, - (CARD32 *)(strmPtr->itemMask), - (CARD8 *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXCreateRenderer) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreateRendererReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_BITMASK (strmPtr->itemMask); - - SWAP_FUNC_PREFIX(SwapRendererAttributes) ( swapPtr, strmPtr->itemMask, - (CARD8 *)(strmPtr+1)); - - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreeRendererReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangeRenderer) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangeRendererReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_RENDERER (strmPtr->rdr); - SWAP_BITMASK (strmPtr->itemMask); - - SWAP_FUNC_PREFIX(SwapRendererAttributes) ( swapPtr, strmPtr->itemMask, - (CARD8 *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetRendererAttributes) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetRendererAttributesReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_RENDERER (strmPtr->rdr); - SWAP_BITMASK (strmPtr->itemMask); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexGetRendererDynamics; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXBeginRendering) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexBeginRenderingReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexEndRenderingReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXBeginStructure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexBeginStructureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - SWAP_CARD32 (strmPtr->sid); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexEndStructureReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXRenderOutputCommands) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexRenderOutputCommandsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_RENDERER (strmPtr->rdr); - SWAP_CARD32 (strmPtr->numCommands); - SwapListOfOutputCommands (cntxtPtr, strmPtr->numCommands, - (CARD32 *) (strmPtr + 1)); - CALL_REQUEST; -} -/* individual output commands may be found in the section "Output Commands" */ - - -ErrorCode -SWAP_FUNC_PREFIX(PEXRenderElements) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexRenderElementsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - SWAP_STRUCTURE (strmPtr->sid); - SwapElementRange (swapPtr, &strmPtr->range); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXAccumulateState) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexAccumulateStateReq *strmPtr; -{ - pexElementRef *pe; - CARD32 i; - - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - SWAP_CARD32 (strmPtr->numElRefs); - - pe = (pexElementRef *)(strmPtr+1); - for (i = 0; i < strmPtr->numElRefs; i++, pe++) - SWAP_ELEMENT_REF (*pe); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXRenderNetwork) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexRenderNetworkReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_STRUCTURE (strmPtr->sid); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexCreateStructureReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopyStructure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyStructureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->src); - SWAP_STRUCTURE (strmPtr->dst); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXDestroyStructures) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDestroyStructuresReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexStructure *ps; - - SWAP_CARD16 (strmPtr->length); - SWAP_CARD32 (strmPtr->numStructures); - - for (i=0, ps=(pexStructure *)(strmPtr+1); inumStructures; i++,ps++) - SWAP_STRUCTURE ((*ps)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetStructureInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetStructureInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD16 (strmPtr->itemMask); - SWAP_STRUCTURE (strmPtr->sid); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetElementInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetElementInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_STRUCTURE (strmPtr->sid); - - SwapElementRange (swapPtr, &strmPtr->range); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetStructuresInNetwork) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetStructuresInNetworkReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD16 (strmPtr->which); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetAncestors) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetAncestorsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD16 (strmPtr->pathOrder); - SWAP_CARD32 (strmPtr->pathDepth); - CALL_REQUEST; -} - -/* typedef pexGetAncestorsReq pexGetDescendantsReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXFetchElements) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexFetchElementsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_STRUCTURE (strmPtr->sid); - - SwapElementRange (swapPtr, &strmPtr->range); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetEditingMode) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetEditingModeReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD16 (strmPtr->mode); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetElementPointer) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetElementPointerReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_ELEMENT_POS (strmPtr->position); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetElementPointerAtLabel) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetElementPointerAtLabelReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD32 (strmPtr->label); - SWAP_INT32 (strmPtr->offset); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXElementSearch) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexElementSearchReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - CARD16 *pc; - - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_ELEMENT_POS (strmPtr->position); - SWAP_CARD32 (strmPtr->direction); - SWAP_CARD32 (strmPtr->numIncls); - SWAP_CARD32 (strmPtr->numExcls); - - pc = (CARD16 *)(strmPtr+1); - for (i=0; i< strmPtr->numIncls; i++, pc++) - SWAP_CARD16((*pc)); - - /* skip pad if there */ - if (strmPtr->numIncls & 0x1) pc++; - - for (i=0; i< strmPtr->numExcls; i++, pc++) - SWAP_CARD16((*pc)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXStoreElements) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexStoreElementsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD32 (strmPtr->numCommands); - SwapListOfOutputCommands (cntxtPtr, strmPtr->numCommands, - (CARD32 *) (strmPtr + 1)); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXDeleteElements) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDeleteElementsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - - SwapElementRange (swapPtr, &strmPtr->range); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXDeleteElementsToLabel) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDeleteElementsToLabelReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_ELEMENT_POS (strmPtr->position); - SWAP_CARD32 (strmPtr->label); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXDeleteBetweenLabels) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexDeleteBetweenLabelsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_CARD32 (strmPtr->label1); - SWAP_CARD32 (strmPtr->label2); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopyElements) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyElementsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->src); - - SwapElementRange (swapPtr, &strmPtr->srcRange); - - SWAP_STRUCTURE (strmPtr->dst); - SWAP_ELEMENT_POS (strmPtr->dstPosition); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangeStructureRefs) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangeStructureRefsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_STRUCTURE (strmPtr->old_id); - SWAP_STRUCTURE (strmPtr->new_id); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexCreateNameSetReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopyNameSet) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopyNameSetReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_NAMESET (strmPtr->src); - SWAP_NAMESET (strmPtr->dst); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreeNameSetReq;*/ - -/* typedef pexResourceReq pexGetNameSetReq; */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangeNameSet) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangeNameSetReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i, num; - pexName *pn; - - SWAP_CARD16 (strmPtr->length); - SWAP_NAMESET (strmPtr->ns); - SWAP_CARD16 (strmPtr->action); - - num = (int)(strmPtr->length - (sizeof(pexChangeNameSetReq)/sizeof(CARD32))); - for (i=0, pn=(pexName *)(strmPtr+1); iswap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_SC (strmPtr->sc); - SWAP_BITMASK (strmPtr->itemMask); - - SWAP_FUNC_PREFIX(SwapSearchContext) ( swapPtr, strmPtr->itemMask, - (unsigned char *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXCopySearchContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCopySearchContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_SC (strmPtr->src); - SWAP_SC (strmPtr->dst); - SWAP_BITMASK (strmPtr->itemMask); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreeSearchContextReq;*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetSearchContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetSearchContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_SC (strmPtr->sc); - SWAP_BITMASK (strmPtr->itemMask); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangeSearchContext) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangeSearchContextReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_SC (strmPtr->sc); - SWAP_BITMASK (strmPtr->itemMask); - - SWAP_FUNC_PREFIX(SwapSearchContext) ( swapPtr, strmPtr->itemMask, - (unsigned char *)(strmPtr+1)); - - CALL_REQUEST; -} - -/* typedef pexResourceReq pexSearchNetworkReq;*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXCreatePhigsWks) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePhigsWksReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_LOOKUP_TABLE (strmPtr->markerBundle); - SWAP_LOOKUP_TABLE (strmPtr->textBundle); - SWAP_LOOKUP_TABLE (strmPtr->lineBundle); - SWAP_LOOKUP_TABLE (strmPtr->interiorBundle); - SWAP_LOOKUP_TABLE (strmPtr->edgeBundle); - SWAP_LOOKUP_TABLE (strmPtr->colourTable); - SWAP_LOOKUP_TABLE (strmPtr->depthCueTable); - SWAP_LOOKUP_TABLE (strmPtr->lightTable); - SWAP_LOOKUP_TABLE (strmPtr->colourApproxTable); - SWAP_LOOKUP_TABLE (strmPtr->patternTable); - SWAP_LOOKUP_TABLE (strmPtr->textFontTable); - SWAP_NAMESET (strmPtr->highlightIncl); - SWAP_NAMESET (strmPtr->highlightExcl); - SWAP_NAMESET (strmPtr->invisIncl); - SWAP_NAMESET (strmPtr->invisExcl); - SWAP_CARD16 (strmPtr->bufferMode); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreePhigsWksReq;*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetWksInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetWksInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_BITMASK (strmPtr->itemMask[0]); - SWAP_BITMASK (strmPtr->itemMask[1]); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetDynamics) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetDynamicsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_DRAWABLE (strmPtr->drawable); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetViewRep) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetViewRepReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_TABLE_INDEX (strmPtr->index); - SWAP_PHIGS_WKS (strmPtr->wks); - CALL_REQUEST; -} - -/* -typedef pexResourceReq pexRedrawAllStructuresReq; - -typedef pexResourceReq pexUpdateWorkstationReq; -*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXRedrawClipRegion) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexRedrawClipRegionReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_CARD32 (strmPtr->numRects); - - SwapDeviceRects (swapPtr, strmPtr->numRects, (pexDeviceRect *)(strmPtr+1)); - CALL_REQUEST; -} - -/* -typedef pexResourceReq pexExecuteDeferredActionsReq; -*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetViewPriority) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetViewPriorityReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_TABLE_INDEX (strmPtr->index1); - SWAP_TABLE_INDEX (strmPtr->index2); - SWAP_CARD16 (strmPtr->priority); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetDisplayUpdateMode) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetDisplayUpdateModeReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_ENUM_TYPE_INDEX (strmPtr->displayUpdate); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXMapDCtoWC) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexMapDCtoWCReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexDeviceCoord *pc; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_CARD32 (strmPtr->numCoords); - - for (i=0, pc=(pexDeviceCoord *)(strmPtr+1); inumCoords; i++,pc++) - SWAP_DEVICE_COORD((*pc)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXMapWCtoDC) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexMapWCtoDCReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexCoord3D *pc; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD16 (strmPtr->index); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_CARD32 (strmPtr->numCoords); - - for ( i=0, pc=(pexCoord3D *)(strmPtr+1); inumCoords; i++, pc++) - SWAP_COORD3D((*pc)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetViewRep) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetViewRepReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - - SwapViewRep (swapPtr, &strmPtr->viewRep); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetWksWindow) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetWksWindowReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - SwapNpcSubvolume (swapPtr, &strmPtr->npcSubvolume); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetWksViewport) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetWksViewportReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - - SwapViewport (swapPtr, &strmPtr->viewport); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetHlhsrMode) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetHlhsrModeReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_ENUM_TYPE_INDEX (strmPtr->mode); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXSetWksBufferMode) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexSetWksBufferModeReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_CARD16 (strmPtr->bufferMode); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPostStructure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexPostStructureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_STRUCTURE (strmPtr->sid); - SWAP_FLOAT (strmPtr->priority); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXUnpostStructure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexUnpostStructureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_STRUCTURE (strmPtr->sid); - CALL_REQUEST; -} - -/* -typedef pexResourceReq pexUnpostAllStructuresReq; - -typedef pexResourceReq pexGetWksPostingsReq; -*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetPickDevice) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetPickDeviceReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_ENUM_TYPE_INDEX (strmPtr->devType); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_BITMASK (strmPtr->itemMask); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXChangePickDevice) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexChangePickDeviceReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_ENUM_TYPE_INDEX (strmPtr->devType); - SWAP_BITMASK (strmPtr->itemMask); - - SWAP_FUNC_PREFIX(SwapPickDevAttr) ( swapPtr, strmPtr->itemMask, - (unsigned char *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXCreatePickMeasure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexCreatePickMeasureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PHIGS_WKS (strmPtr->wks); - SWAP_PICK_MEASURE (strmPtr->pm); - SWAP_ENUM_TYPE_INDEX (strmPtr->devType); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexFreePickMeasureReq;*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetPickMeasure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetPickMeasureReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PICK_MEASURE (strmPtr->pm); - SWAP_BITMASK (strmPtr->itemMask); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXUpdatePickMeasure) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexUpdatePickMeasureReq *strmPtr; -{ - - extern void SwapFLOAT(); - - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_PICK_MEASURE (strmPtr->pm); - SWAP_CARD32 (strmPtr->numBytes); - /* SWAP the input data record for the registered devices */ - if (strmPtr->numBytes == 8) { - unsigned char *ptr = (unsigned char *)(strmPtr+1); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - - } else if (strmPtr->numBytes == 24) { - unsigned char *ptr = (unsigned char *)(strmPtr+1); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } else - return(BadLength); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXBeginPickOne) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexBeginPickOneReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_ENUM_TYPE_INDEX (strmPtr->method); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_INT32 (strmPtr->sid); - - SWAP_FUNC_PREFIX(SwapPickRecord) (swapPtr, - (pexPickRecord *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXEndPickOne) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexEndPickOneReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPickOne) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexPickOneReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_ENUM_TYPE_INDEX (strmPtr->method); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_STRUCTURE (strmPtr->sid); - - SWAP_FUNC_PREFIX(SwapPickRecord) (swapPtr, - (pexPickRecord *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXBeginPickAll) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexBeginPickAllReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_ENUM_TYPE_INDEX (strmPtr->method); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_INT32 (strmPtr->sid); - SWAP_CARD32 (strmPtr->pickMaxHits); - - SWAP_FUNC_PREFIX(SwapPickRecord) (swapPtr, - (pexPickRecord *)(strmPtr+1)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXEndPickAll) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexEndPickAllReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_RENDERER (strmPtr->rdr); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPickAll) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexPickAllReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_ENUM_TYPE_INDEX (strmPtr->method); - SWAP_RENDERER (strmPtr->rdr); - SWAP_DRAWABLE (strmPtr->drawable); - SWAP_CARD32 (strmPtr->pickMaxHits); - - SWAP_FUNC_PREFIX(SwapPickRecord) (swapPtr, - (pexPickRecord *)(strmPtr+1)); - - CALL_REQUEST; -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXOpenFont) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexOpenFontReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_FONT (strmPtr->font); - SWAP_CARD32 (strmPtr->numBytes); - CALL_REQUEST; -} - -/* typedef pexResourceReq pexCloseFontReq;*/ - -ErrorCode -SWAP_FUNC_PREFIX(PEXQueryFont) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexQueryFontReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_FONT (strmPtr->font); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXListFonts) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexListFontsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_CARD16 (strmPtr->maxNames); - SWAP_CARD16 (strmPtr->numChars); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXListFontsWithInfo) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexListFontsWithInfoReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (strmPtr->length); - SWAP_CARD16 (strmPtr->maxNames); - SWAP_CARD16 (strmPtr->numChars); - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXQueryTextExtents) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexQueryTextExtentsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - pexMonoEncoding *pEnc; - CARD32 *numEnc; - int bytes, i; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD16 (strmPtr->textPath); - SWAP_CARD16 (strmPtr->fontGroupIndex); - SWAP_CARD32 (strmPtr->id); - SWAP_FLOAT (strmPtr->charExpansion); - SWAP_FLOAT (strmPtr->charSpacing); - SWAP_FLOAT (strmPtr->charHeight); - - SwapTextAlignmentData(swapPtr, &strmPtr->textAlignment); - - SWAP_CARD32 (strmPtr->numStrings); - - numEnc = (CARD32 *) (strmPtr + 1); - - for (i = 0; i < strmPtr->numStrings; i++) - { - SWAP_CARD32 (*numEnc); - - pEnc = (pexMonoEncoding *) (numEnc + 1); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, pEnc, *numEnc); - - bytes = pEnc->numChars * ((pEnc->characterSetWidth == PEXCSByte) ? - sizeof(CARD8) : ((pEnc->characterSetWidth == PEXCSShort) ? - sizeof(CARD16) : sizeof(CARD32))); - - numEnc = (CARD32 *) ((char *) (pEnc + 1) + bytes + PADDING (bytes)); - } - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGetImpDepConstants) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexGetImpDepConstantsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD16 *ptr = (CARD16 *)(strmPtr+1); - CARD32 i; - - SWAP_CARD16 (strmPtr->length); - SWAP_ENUM_TYPE_INDEX (strmPtr->fpFormat); - SWAP_CARD32 (strmPtr->drawable); - SWAP_CARD32 (strmPtr->numNames); - - for (i=0; inumNames; i++, ptr++) - SWAP_CARD16 ((*ptr)); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXMatchRendererTargets) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexMatchRendererTargetsReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (strmPtr->length); - SWAP_CARD32 (strmPtr->drawable); - SWAP_CARD16 (strmPtr->type); - SWAP_CARD32 (strmPtr->visualID); - SWAP_CARD32 (strmPtr->maxTriplets); - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXEscape) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexEscapeReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (strmPtr->length); - SWAP_CARD32 (strmPtr->escapeID); - - /* do MIT Registered Escapes */ - switch (strmPtr->escapeID) { - case PEXEscapeSetEchoColour: { - pexEscapeSetEchoColourData *psec; - - psec = (pexEscapeSetEchoColourData *)(strmPtr+1); - SWAP_ENUM_TYPE_INDEX (psec->fpFormat); - SWAP_CARD32 (psec->rdr); - SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)(psec+1)); - break; - } - } - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXEscapeWithReply) (cntxtPtr, strmPtr) -pexContext *cntxtPtr; -pexEscapeWithReplyReq *strmPtr; -{ - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (strmPtr->length); - SWAP_CARD16 (strmPtr->escapeID); - - /* do MIT Registered Escapes , none with Replies */ - /* - switch (strmPtr->escapeID) { - } - */ - - - CALL_REQUEST; -} - -ErrorCode -SWAP_FUNC_PEX_PFX(RequestUnused)() -{ - -} - - -/**************************************************************** - * utilities * - ****************************************************************/ -void -SWAP_FUNC_PREFIX(SwapTable)(swapPtr, TType, num, where) -pexSwap *swapPtr; -pexTableType TType; -CARD32 num; -unsigned char *where; -{ - int i; - unsigned char *ptr = where; - - switch (TType) { - case PEXLineBundleLUT: { - for (i=0; inumx); - SWAP_CARD16 (pe->numy); - ptr = SWAP_FUNC_PREFIX(SwapPatternEntry) ( swapPtr, pe, - pe->numx, pe->numy); - }; - break; } - - case PEXTextFontLUT: { - for ( i=0; ifirstGlyph); - SWAP_CARD32 (pfi->lastGlyph); - SWAP_CARD32 (pfi->defaultGlyph); - SWAP_CARD32 (pfi->numProps); - - pfp = (pexFontProp *)(pfi+1); - for (i=0; inumProps; i++) - pfp = (pexFontProp *)(SwapFontProp(swapPtr, pfp)); - - ptr = (CARD8 *)pfp; - return (ptr); -} - - -unsigned char * -SWAP_FUNC_PREFIX(SwapLightEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexLightEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->lightType); - SWAP_VECTOR3D (p_data->direction); - SWAP_COORD3D (p_data->point); - SWAP_FLOAT (p_data->concentration); - SWAP_FLOAT (p_data->spreadAngle); - SWAP_FLOAT (p_data->attenuation1); - SWAP_FLOAT (p_data->attenuation2); - - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->lightColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapLineBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexLineBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->lineType); - SWAP_ENUM_TYPE_INDEX (p_data->polylineInterp); - SWAP_FLOAT (p_data->lineWidth); - SWAP_CURVE_APPROX (p_data->curveApprox); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->lineColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapMarkerBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexMarkerBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->markerType); - SWAP_FLOAT (p_data->markerScale); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->markerColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapTextBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexTextBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_CARD16 (p_data->textFontIndex); - SWAP_CARD16 (p_data->textPrecision); - SWAP_FLOAT (p_data->charExpansion); - SWAP_FLOAT (p_data->charSpacing); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->textColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapInteriorBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexInteriorBundleEntry *p_data; -{ - unsigned char *po; - SWAP_ENUM_TYPE_INDEX (p_data->interiorStyle); - SWAP_INT16 (p_data->interiorStyleIndex); - SWAP_ENUM_TYPE_INDEX (p_data->reflectionModel); - SWAP_ENUM_TYPE_INDEX (p_data->surfaceInterp); - SWAP_ENUM_TYPE_INDEX (p_data->bfInteriorStyle); - SWAP_INT16 (p_data->bfInteriorStyleIndex); - SWAP_ENUM_TYPE_INDEX (p_data->bfReflectionModel); - SWAP_ENUM_TYPE_INDEX (p_data->bfSurfaceInterp); - - SwapSurfaceApprox (swapPtr, &(p_data->surfaceApprox)); - po = (unsigned char *)(p_data+1); - po = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)po); - po = SWAP_FUNC_PREFIX(SwapReflectionAttr) ( swapPtr, - (pexReflectionAttr *)po); - po = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)po); - po = SWAP_FUNC_PREFIX(SwapReflectionAttr) ( swapPtr, - (pexReflectionAttr *)po); - - return (po); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapEdgeBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexEdgeBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->edgeType); - SWAP_FLOAT (p_data->edgeWidth); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->edgeColour)); - - return (ptr); -} - - -unsigned char * -SWAP_FUNC_PREFIX(SwapDepthCueEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexDepthCueEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_FLOAT (p_data->frontPlane); - SWAP_FLOAT (p_data->backPlane); - SWAP_FLOAT (p_data->frontScaling); - SWAP_FLOAT (p_data->backScaling); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->depthCueColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapPatternEntry) (swapPtr, p_data, numx, numy) -pexSwap *swapPtr; -pexPatternEntry *p_data; -CARD16 numx; -CARD16 numy; -{ - int i, max_colours; - pexColour *pc = (pexColour *)(p_data + 1); - - SWAP_COLOUR_TYPE (p_data->colourType); - - max_colours = numx * numy; - for (i=0; icolourType); - - - return ((unsigned char *)pc); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapPipelineContextAttr) (swapPtr, itemMask, p_data) -pexSwap *swapPtr; -CARD32 *itemMask; -CARD8 *p_data; -{ - /* NOTE: See the Protocol Encoding for a desription of these fields - in places where CARD16 or INT16 are packed into a 4 byte field - (essentially a CARD32) for transmission these fields must be - byte swapped as a CARD32. - JSH - */ - - CARD8 *ptr = p_data; - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerScale) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextFont) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPrecision) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharExpansion) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharSpacing) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharHeight) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharUpVector) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPath) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextAlignment) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextHeight) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextUpVector) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextPath) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextAlignment) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineWidth) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCurveApproximation) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPolylineInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflAttr) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflModel) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflAttr) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflModel) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceApproximation) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCullingMode) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCDistinguishFlag) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternSize) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefPt) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec1) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec2) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeFlag) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeWidth) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCEdgeBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLocalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) { - SWAP_FLOAT((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCGlobalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) { - SWAP_FLOAT((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClip) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClipVolume) { - CARD32 i, numHalfSpace; - pexHalfSpace *ph; - SWAP_CARD32 ((*((CARD32 *)ptr))); - numHalfSpace = *((CARD32 *)ptr); - ptr += sizeof(CARD32); - for (i=0, ph = (pexHalfSpace *)ptr; ipickType); - - switch(p_data->pickType) { - case PEXPickDeviceDC_HitBox: { - unsigned char *ptr = (unsigned char *)(p_data+1); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - break; - } - case PEXPickDeviceNPC_HitVolume: { - unsigned char *ptr = (unsigned char *)(p_data+1); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - break; - } - } -} - Index: xc/programs/Xserver/PEX5/dipex/swap/convReq.h diff -u xc/programs/Xserver/PEX5/dipex/swap/convReq.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/convReq.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/convReq.h:1.2 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convReq.h Sat Feb 28 21:41:56 2004 @@ -1,157 +0,0 @@ -/* $Xorg: convReq.h,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -LOCAL_FLAG ErrorCode - SWAP_FUNC_PREFIX(PEXRequestUnused)(), - SWAP_FUNC_PREFIX(PEXGenericRequest) (), - SWAP_FUNC_PREFIX(PEXGenericResourceRequest) (), - SWAP_FUNC_PREFIX(PEXGetExtensionInfo) (), - SWAP_FUNC_PREFIX(PEXGetEnumeratedTypeInfo) (), - SWAP_FUNC_PREFIX(PEXGetImpDepConstants) (), - SWAP_FUNC_PREFIX(PEXCreateLookupTable) (), - SWAP_FUNC_PREFIX(PEXCopyLookupTable) (), - SWAP_FUNC_PREFIX(PEXGetTableInfo) (), - SWAP_FUNC_PREFIX(PEXGetPredefinedEntries) (), - SWAP_FUNC_PREFIX(PEXGetTableEntry) (), - SWAP_FUNC_PREFIX(PEXGetTableEntries) (), - SWAP_FUNC_PREFIX(PEXSetTableEntries) (), - SWAP_FUNC_PREFIX(PEXDeleteTableEntries) (), - SWAP_FUNC_PREFIX(PEXCreatePipelineContext) (), - SWAP_FUNC_PREFIX(PEXCopyPipelineContext) (), - SWAP_FUNC_PREFIX(PEXGetPipelineContext) (), - SWAP_FUNC_PREFIX(PEXChangePipelineContext) (), - SWAP_FUNC_PREFIX(PEXCreateRenderer) (), - SWAP_FUNC_PREFIX(PEXChangeRenderer) (), - SWAP_FUNC_PREFIX(PEXGetRendererAttributes) (), - SWAP_FUNC_PREFIX(PEXBeginRendering) (), - SWAP_FUNC_PREFIX(PEXBeginStructure) (), - SWAP_FUNC_PREFIX(PEXRenderOutputCommands) (), - SWAP_FUNC_PREFIX(PEXRenderNetwork) (), - SWAP_FUNC_PREFIX(PEXCopyStructure) (), - SWAP_FUNC_PREFIX(PEXDestroyStructures) (), - SWAP_FUNC_PREFIX(PEXGetStructureInfo) (), - SWAP_FUNC_PREFIX(PEXGetElementInfo) (), - SWAP_FUNC_PREFIX(PEXGetStructuresInNetwork) (), - SWAP_FUNC_PREFIX(PEXGetAncestors) (), - SWAP_FUNC_PREFIX(PEXFetchElements) (), - SWAP_FUNC_PREFIX(PEXSetEditingMode) (), - SWAP_FUNC_PREFIX(PEXSetElementPointer) (), - SWAP_FUNC_PREFIX(PEXSetElementPointerAtLabel) (), - SWAP_FUNC_PREFIX(PEXElementSearch) (), - SWAP_FUNC_PREFIX(PEXStoreElements) (), - SWAP_FUNC_PREFIX(PEXDeleteElements) (), - SWAP_FUNC_PREFIX(PEXDeleteElementsToLabel) (), - SWAP_FUNC_PREFIX(PEXDeleteBetweenLabels) (), - SWAP_FUNC_PREFIX(PEXCopyElements) (), - SWAP_FUNC_PREFIX(PEXChangeStructureRefs) (), - SWAP_FUNC_PREFIX(PEXCopyNameSet) (), - SWAP_FUNC_PREFIX(PEXChangeNameSet) (), - SWAP_FUNC_PREFIX(PEXCreateSearchContext) (), - SWAP_FUNC_PREFIX(PEXCopySearchContext) (), - SWAP_FUNC_PREFIX(PEXGetSearchContext) (), - SWAP_FUNC_PREFIX(PEXChangeSearchContext) (), - SWAP_FUNC_PREFIX(PEXCreatePhigsWks) (), - SWAP_FUNC_PREFIX(PEXGetWksInfo) (), - SWAP_FUNC_PREFIX(PEXGetDynamics) (), - SWAP_FUNC_PREFIX(PEXGetViewRep) (), - SWAP_FUNC_PREFIX(PEXRedrawClipRegion) (), - SWAP_FUNC_PREFIX(PEXSetViewPriority) (), - SWAP_FUNC_PREFIX(PEXSetDisplayUpdateMode) (), - SWAP_FUNC_PREFIX(PEXMapDCtoWC) (), - SWAP_FUNC_PREFIX(PEXMapWCtoDC) (), - SWAP_FUNC_PREFIX(PEXSetViewRep) (), - SWAP_FUNC_PREFIX(PEXSetWksWindow) (), - SWAP_FUNC_PREFIX(PEXSetWksViewport) (), - SWAP_FUNC_PREFIX(PEXSetHlhsrMode) (), - SWAP_FUNC_PREFIX(PEXSetWksBufferMode) (), - SWAP_FUNC_PREFIX(PEXPostStructure) (), - SWAP_FUNC_PREFIX(PEXUnpostStructure) (), - SWAP_FUNC_PREFIX(PEXGetPickDevice) (), - SWAP_FUNC_PREFIX(PEXChangePickDevice) (), - SWAP_FUNC_PREFIX(PEXCreatePickMeasure) (), - SWAP_FUNC_PREFIX(PEXGetPickMeasure) (), - SWAP_FUNC_PREFIX(PEXUpdatePickMeasure) (), - SWAP_FUNC_PREFIX(PEXOpenFont) (), - SWAP_FUNC_PREFIX(PEXQueryFont) (), - SWAP_FUNC_PREFIX(PEXListFonts) (), - SWAP_FUNC_PREFIX(PEXListFontsWithInfo) (), - SWAP_FUNC_PREFIX(PEXQueryTextExtents) (), - SWAP_FUNC_PREFIX(PEXMatchRendererTargets) (), - SWAP_FUNC_PREFIX(PEXEscape) (), - SWAP_FUNC_PREFIX(PEXEscapeWithReply) (), - SWAP_FUNC_PREFIX(PEXRenderElements) (), - SWAP_FUNC_PREFIX(PEXAccumulateState) (), - SWAP_FUNC_PREFIX(PEXBeginPickOne) (), - SWAP_FUNC_PREFIX(PEXEndPickOne) (), - SWAP_FUNC_PREFIX(PEXPickOne) (), - SWAP_FUNC_PREFIX(PEXBeginPickAll) (), - SWAP_FUNC_PREFIX(PEXEndPickAll) (), - SWAP_FUNC_PREFIX(PEXPickAll) (); - - -LOCAL_FLAG void - SWAP_FUNC_PREFIX(SwapTable)(), - SWAP_FUNC_PREFIX(SwapSearchContext)(), - SWAP_FUNC_PREFIX(SwapPickMeasAttr) (), - SWAP_FUNC_PREFIX(SwapPickDevAttr) (), - SWAP_FUNC_PREFIX(SwapPickRecord) (), - SWAP_FUNC_PREFIX(SwapRendererAttributes) (); - -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapLightEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapLineBundleEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapMarkerBundleEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapTextBundleEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapInteriorBundleEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapEdgeBundleEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapDepthCueEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapPatternEntry) (); -LOCAL_FLAG unsigned char * SWAP_FUNC_PREFIX(SwapPipelineContextAttr) (); - -LOCAL_FLAG CARD8 * SWAP_FUNC_PREFIX(SwapFontInfo) (); - - Index: xc/programs/Xserver/PEX5/dipex/swap/convUtil.c diff -u xc/programs/Xserver/PEX5/dipex/swap/convUtil.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/convUtil.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/convUtil.c:1.9 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convUtil.c Sat Feb 28 21:41:56 2004 @@ -1,231 +0,0 @@ -/* $Xorg: convUtil.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "convertStr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG -#include "convUtil.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG extern -#include "OCattr.h" -#undef LOCAL_FLAG - -/* - Composite Conversions - */ - - -void -SwapViewport(swapPtr, ptr) -pexSwap *swapPtr; -pexViewport *ptr; -{ - SWAP_DEVICE_COORD (ptr->minval); - SWAP_DEVICE_COORD (ptr->maxval); -} - -void -SwapViewEntry(swapPtr, ptr) -pexSwap *swapPtr; -pexViewEntry *ptr; -{ - SWAP_CARD16 (ptr->clipFlags); - - SwapNpcSubvolume (swapPtr, &(ptr->clipLimits)); - - SWAP_MATRIX (ptr->orientation); - SWAP_MATRIX (ptr->mapping); -} - -void -SwapViewRep(swapPtr, ptr) -pexSwap *swapPtr; -pexViewRep *ptr; -{ - SWAP_TABLE_INDEX (ptr->index); - SwapViewEntry (swapPtr, &(ptr->view)); -} - - -void -SwapColourApproxEntry(swapPtr, ptr) -pexSwap *swapPtr; -pexColourApproxEntry *ptr; -{ - SWAP_INT16 (ptr->approxType); - SWAP_INT16 (ptr->approxModel); - SWAP_CARD16 (ptr->max1); - SWAP_CARD16 (ptr->max2); - SWAP_CARD16 (ptr->max3); - SWAP_CARD32 (ptr->mult1); - SWAP_CARD32 (ptr->mult2); - SWAP_CARD32 (ptr->mult3); - SWAP_FLOAT (ptr->weight1); - SWAP_FLOAT (ptr->weight2); - SWAP_FLOAT (ptr->weight3); - SWAP_CARD32 (ptr->basePixel); -} - - -void -SwapDeviceRects(swapPtr, num, ptr) -pexSwap *swapPtr; -CARD32 num; -pexDeviceRect *ptr; -{ - CARD32 i; - pexDeviceRect *pdr = ptr; - for (i=0; ixmin); - SWAP_CARD16(pdr->ymin); - SWAP_CARD16(pdr->xmax); - SWAP_CARD16(pdr->ymax); - } -} - -void -SwapExtentInfo (swapPtr, num, pe) -pexSwap *swapPtr; -CARD32 num; -pexExtentInfo *pe; -{ - CARD32 i; - for (i=0; ilowerLeft.x); - SWAP_FLOAT (pe->lowerLeft.y); - SWAP_FLOAT (pe->upperRight.x); - SWAP_FLOAT (pe->upperRight.y); - SWAP_FLOAT (pe->concatpoint.x); - SWAP_FLOAT (pe->concatpoint.y); - } -} - - -unsigned char * -SwapFontProp (swapPtr, pfp) -pexSwap *swapPtr; -pexFontProp *pfp; -{ - SWAP_CARD32 (pfp->name); - SWAP_CARD32 (pfp->value); - pfp++; - - return (((unsigned char *)pfp)); -} - - -void -SwapElementRange(swapPtr, pe) -pexSwap *swapPtr; -pexElementRange *pe; -{ - SWAP_ELEMENT_POS (pe->position1); - SWAP_ELEMENT_POS (pe->position2); -} - - -void -SwapLocaltransform3ddata(swapPtr, pg) -pexSwap *swapPtr; -pexLocalTransform3DData *pg; -{ - SWAP_CARD16 (pg->composition); - SWAP_MATRIX (pg->matrix); -} - -void -SwapLocalTransform2DData(swapPtr, pg) -pexSwap *swapPtr; -pexLocalTransform2DData *pg; -{ - SWAP_CARD16 (pg->composition); - SWAP_MATRIX_3X3 (pg->matrix); -} - - -void -SwapNpcSubvolume(swapPtr, ps) -pexSwap *swapPtr; -pexNpcSubvolume *ps; -{ - SWAP_COORD3D (ps->minval); - SWAP_COORD3D (ps->maxval); -} - - - -SwapListOfOutputCommands (cntxtPtr, num, oc) -pexContext *cntxtPtr; -CARD32 num; -CARD32 *oc; -{ - pexElementInfo *pe; - int i; - pexSwap *swapPtr = cntxtPtr->swap; - - for (i = 0; i < num; i++) - { - pe = (pexElementInfo *) oc; - SWAP_ELEMENT_INFO (*pe); - if (PEXOCAll < pe->elementType && pe->elementType <= PEXMaxOC) - cntxtPtr->pexSwapRequestOC[pe->elementType](cntxtPtr->swap,pe); - oc += pe->length; - } -} Index: xc/programs/Xserver/PEX5/dipex/swap/convUtil.h diff -u xc/programs/Xserver/PEX5/dipex/swap/convUtil.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/convUtil.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/convUtil.h:1.2 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convUtil.h Sat Feb 28 21:41:56 2004 @@ -1,69 +0,0 @@ -/* $Xorg: convUtil.h,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -LOCAL_FLAG void - SwapElementRange(), - SwapElementRef(), - SwapEnumTypeDesc(), - SwapFormat(), - SwapLocalTransform3DData(), - SwapLocalTransform2DData(), - SwapNpcSubvolume(), - SwapTextAlignmentData(), - SwapViewport(), - SwapViewEntry(), - SwapViewRep(), - SwapFontEntry(), - SwapViewEntry(), - SwapRgbApproxEntry(), - Swapdevicerects(), - SwapExtentInfo(), - SwapIntensityApproxEntry(); - -LOCAL_FLAG unsigned char *SwapFontProp(); - Index: xc/programs/Xserver/PEX5/dipex/swap/convertStr.h diff -u xc/programs/Xserver/PEX5/dipex/swap/convertStr.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/convertStr.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/convertStr.h:1.2 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/convertStr.h Sat Feb 28 21:41:56 2004 @@ -1,200 +0,0 @@ -/* $Xorg: convertStr.h,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef CONVERTSTR_H -#define CONVERTSTR_H 1 - -#include "SwapConv.h" - -extern unsigned char temp; /* only used for conversions */ - -/* - Contains macros to convert pex data structures - */ - - -#define SWAP_CARD32(a) SWAPINT(a) - -#define SWAP_INT32(a) SWAPINT(a) - -#define SWAP_CARD16(a) SWAPSHORT(a) - -#define SWAP_INT16(a) SWAPSHORT(a) - -#define SWAP_FLOAT(a) SWAPFLOAT(a) - -#define SWAP_DRAWABLE(a) SWAP_CARD32(a) -#define SWAP_ASF_ATTR(a) SWAP_CARD32(a) -#define SWAP_BITMASK(a) SWAP_CARD32(a) -#define SWAP_BITMASK_SHORT(a) SWAP_CARD16(a) -#define SWAP_COLOUR_TYPE(a) SWAP_CARD16(a) -#define SWAP_COORD_TYPE(a) SWAP_CARD16(a) -#define SWAP_COMPOSITION(a) SWAP_CARD16(a) -#define SWAP_CULL_MODE(a) SWAP_CARD16(a) -#define SWAP_ENUM_TYPE_INDEX(a) SWAP_INT16(a) -#define SWAP_LOOKUP_TABLE(a) SWAP_CARD32(a) -#define SWAP_NAME(a) SWAP_CARD32(a) -#define SWAP_NAMESET(a) SWAP_CARD32(a) -#define SWAP_PC(a) SWAP_CARD32(a) -#define SWAP_FONT(a) SWAP_CARD32(a) - -#define SWAP_MATRIX(m) {\ - int i, j; \ - for (i=0; i<4; i++) \ - for (j=0; j<4; j++) \ - SWAP_FLOAT((m)[i][j]); } - -#define SWAP_MATRIX_3X3(m) {\ - int i, j; \ - for (i=0; i<3; i++) \ - for (j=0; j<3; j++) \ - SWAP_FLOAT((m)[i][j]); } - - -#define SWAP_PHIGS_WKS(a) SWAP_CARD32(a) -#define SWAP_PICK_MEASURE(a) SWAP_CARD32(a) -#define SWAP_RENDERER(a) SWAP_CARD32(a) -#define SWAP_SC(a) SWAP_CARD32(a) -#define SWAP_STRUCTURE(a) SWAP_CARD32(a) -#define SWAP_TABLE_INDEX(a) SWAP_CARD16(a) -#define SWAP_TABLE_TYPE(a) SWAP_CARD16(a) -#define SWAP_TEXT_H_ALIGNMENT(a) SWAP_CARD16(a) -#define SWAP_TEXT_V_ALIGNMENT(a) SWAP_CARD16(a) -#define SWAP_TYPE_OR_TABLEINDEX(a) SWAP_CARD16(a) - -#define SWAP_STRING(S) SWAP_CARD16 ((S).length) - -#define SWAP_VECTOR2D(V) {\ - SWAP_FLOAT ((V).x);\ - SWAP_FLOAT ((V).y); } - -#define SWAP_VECTOR3D(V) {\ - SWAP_FLOAT ((V).x);\ - SWAP_FLOAT ((V).y);\ - SWAP_FLOAT ((V).z);} - -#define SWAP_COORD2D(a) SWAP_VECTOR2D(a) -#define SWAP_COORD3D(a) SWAP_VECTOR3D(a) - -#define SWAP_COORD4D(V) {\ - SWAP_FLOAT ((V).x);\ - SWAP_FLOAT ((V).y);\ - SWAP_FLOAT ((V).z);\ - SWAP_FLOAT ((V).w);} - -#define SWAP_RGB_FLOAT_COLOUR(C) {\ - SWAP_FLOAT ((C).red);\ - SWAP_FLOAT ((C).green);\ - SWAP_FLOAT ((C).blue); } - -#define SWAP_HSV_COLOUR(C) {\ - SWAP_FLOAT ((C).hue);\ - SWAP_FLOAT ((C).saturation);\ - SWAP_FLOAT ((C).value); } - -#define SWAP_HLS_COLOUR(C) {\ - SWAP_FLOAT ((C).hue);\ - SWAP_FLOAT ((C).lightness);\ - SWAP_FLOAT ((C).saturation); } - -#define SWAP_CIE_COLOUR(a) SWAP_VECTOR3D(a) - -#define SWAP_RGB16_COLOUR(C) {\ - SWAP_CARD16 ((C).red);\ - SWAP_CARD16 ((C).green);\ - SWAP_CARD16 ((C).blue); } - - -#define SWAP_INDEXED_COLOUR(C) SWAP_TABLE_INDEX ((C).index) - -#define SWAP_CURVE_APPROX(S) {\ - SWAP_ENUM_TYPE_INDEX ((S).approxMethod); \ - SWAP_FLOAT ((S).tolerance); } - -#define SWAP_DEVICE_COORD(C) {\ - SWAP_CARD16 ((C).x); \ - SWAP_CARD16 ((C).y);\ - SWAP_FLOAT ((C).z); } - -#define SWAP_ELEMENT_INFO(C) {\ - SWAP_CARD16 ((C).elementType);\ - SWAP_CARD16 ((C).length); } - -#define SWAP_ELEMENT_POS(C) {\ - SWAP_CARD16 ((C).whence);\ - SWAP_INT32 ((C).offset); } - -#define SWAP_ELEMENT_REF(C) {\ - SWAP_STRUCTURE ((C).structure);\ - SWAP_CARD32 ((C).offset); } - -#define SWAP_EDGEOPT(E) SWAP_CARD16 ((E).edge) - -#define SWAP_ENUM_TYPE_DESC(D) {\ - SWAP_ENUM_TYPE_INDEX ((D).index); \ - SWAP_STRING ((D).descriptor); } - -#define SWAP_TEXT_ALIGN_DATA(A) { \ - SWAP_TEXT_H_ALIGNMENT((A).horizontal); \ - SWAP_TEXT_V_ALIGNMENT((A).vertical); } - -#define SWAP_PICK_ELEMENT_REF(P) { \ - SWAP_STRUCTURE ((P).sid); \ - SWAP_CARD32 ((P).offset); \ - SWAP_CARD32 ((P).pickid); } - - -#define SWAP_STRUCT_INFO(S) { \ - SWAP_STRUCTURE((S).sid); \ - SWAP_FLOAT((S).priority);} - -#define SWAP_RENDERER_TARGET(S) { \ - SWAP_CARD16((S).type); \ - SWAP_CARD32((S).visualID); } - -#endif /* CONVERTSTR_H */ Index: xc/programs/Xserver/PEX5/dipex/swap/floatconv.c diff -u xc/programs/Xserver/PEX5/dipex/swap/floatconv.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/floatconv.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/floatconv.c:1.9 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/floatconv.c Sat Feb 28 21:41:56 2004 @@ -1,231 +0,0 @@ -/* $Xorg: floatconv.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - * floatconv.c - Code which converts between ieee and vax float types. - * - * Copyright 1988-1991 - * Center for Information Technology Integration (CITI) - * Information Technology Division - * University of Michigan - * Ann Arbor, Michigan - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby - * granted, provided that the above copyright notice appear in all - * copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the names of - * CITI or THE UNIVERSITY OF MICHIGAN not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS." CITI AND THE UNIVERSITY OF - * MICHIGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL CITI OR THE UNIVERSITY OF MICHIGAN BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include "floatconv.h" - -#define BITMASK(n) ((((unsigned long)1)<>7)+VAX_TO_IEEE_BIAS)<<23; - result |= (((BITMASK(7) & Vaxnum)<<16) | - (((BITMASK(16)<<16) & Vaxnum)>>16)); - result |= ( (0x00008000 & Vaxnum) ? 0x80000000 : 0L); - *VaxnumP = result; - return; -} - -/***************************************************************** - * TAG( ConvertIEEEToVax ) - * - * Function converts IEEE format floating point numbers to Vax floating - * point numbers. - * - * Inputs: - * A floating point number in IEEE format. - * Outputs: - * A floating point number in VAX format. - * Assumptions: - * The number must not be 'out of the bounds' of the floating point - * format which it is being converted to. I have not yet figured a way - * to ensure that the server will not crash after converting some nasty - * floating point number. My guess, however, is that the problems would - * arise in this routine more than the vax to ieee routine. - * - * The routine handles the MAX and MIN cases. I found that the - * MIN_XXXX_NEGATIVE numbers cause floating point exceptions on - * the VAX and the RT. Thus -0.0 is never returned and +0.0 is returned - * instead. - * - * Algorithm: - * brute force BITMASKS and shifts. - */ - -void -ConvertIEEEToVax(IEEEnumR) - PEXFLOAT *IEEEnumR; -{ - register CARD32 IEEEnum = *(CARD32 *)IEEEnumR; - CARD32 *IEEEnumP = (CARD32 *)IEEEnumR; - CARD32 result=0; - - if ((IEEE_SIGN_MASK & IEEEnum)==MAX_IEEE_POSITIVE) - { - *IEEEnumP = MAX_VAX_POSITIVE | - (0x80000000&IEEEnum)>>16; - return; - }; - - if ((IEEE_SIGN_MASK & IEEEnum)==MIN_IEEE_POSITIVE) - { - *IEEEnumP = MIN_VAX_POSITIVE; - return; - }; - - /* - * these bitfields should OR into mutually exclusive fields in - * result field. - */ - - result = ((((BITMASK(8)<<23) & IEEEnum)>>23)+IEEE_TO_VAX_BIAS)<<7; - result |= ((BITMASK(7)<<16)&IEEEnum)>>16; - result |= (BITMASK(16)&IEEEnum)<<16; - result |= (0x80000000&IEEEnum)>>16; - *IEEEnumP = result; - return; -} Index: xc/programs/Xserver/PEX5/dipex/swap/floatconv.h diff -u xc/programs/Xserver/PEX5/dipex/swap/floatconv.h:1.2 xc/programs/Xserver/PEX5/dipex/swap/floatconv.h:removed --- xc/programs/Xserver/PEX5/dipex/swap/floatconv.h:1.2 Fri Dec 14 14:57:48 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/floatconv.h Sat Feb 28 21:41:56 2004 @@ -1,79 +0,0 @@ -/* $Xorg: floatconv.h,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/* - * Copyright 1988-1991 by Sun Microsystems - */ -/* - -Copyright 1988-1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/* - * floatconv.h - Functions and macros to convert between FloatTypes - * - * Copyright 1988 - * Center for Information Technology Integration (CITI) - * Information Technology Division - * University of Michigan - * Ann Arbor, Michigan - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby - * granted, provided that the above copyright notice appear in all - * copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the names of - * CITI or THE UNIVERSITY OF MICHIGAN not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS." CITI AND THE UNIVERSITY OF - * MICHIGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL CITI OR THE UNIVERSITY OF MICHIGAN BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -#ifndef FLOAT_CON_H -#define FLOAT_CON_H - -#include -#include "X.h" -#include "Xproto.h" -#include "dipex.h" - -#ifdef vax /* probably not good enough yet */ -#define MyFloatType DEC_F_Floating -#else -#define MyFloatType Ieee_754_32 -#endif - -extern void ConvertIEEEtoVax(); -extern void ConvertVaxToIEEE(); - -#endif /* FLOAT_CON_H */ Index: xc/programs/Xserver/PEX5/dipex/swap/uOCTables.ci diff -u xc/programs/Xserver/PEX5/dipex/swap/uOCTables.ci:1.2 xc/programs/Xserver/PEX5/dipex/swap/uOCTables.ci:removed --- xc/programs/Xserver/PEX5/dipex/swap/uOCTables.ci:1.2 Fri Dec 14 14:57:49 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/uOCTables.ci Sat Feb 28 21:41:56 2004 @@ -1,245 +0,0 @@ -/* $Xorg: uOCTables.ci,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ -/* Automatically generated OC table - */ -/****************************************************************** - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#include "X.h" -#include "PEX.h" -#include "PEXprotost.h" -#include "PEXproto.h" -#include "dipex.h" -#include "pexSwap.h" - -#if defined (__STDC__) -#define SWAP_OC_PREFIX(t) uPEX##t -#else -#define SWAP_OC_PREFIX(t) uPEX/**/t -#endif - -extern ErrorCode - SwapPEXOCUnused (), - SwapPEXMarkerType (), - SwapPEXMarkerScale (), - SwapPEXMarkerColourIndex (), - SWAP_OC_PREFIX(MarkerColour) (), - SwapPEXMarkerBundleIndex (), - SwapPEXTextPrecision (), - SwapPEXCharExpansion (), - SwapPEXCharSpacing (), - SwapPEXCharHeight (), - SwapPEXCharUpVector (), - SwapPEXTextPath (), - SwapPEXTextAlignment (), - SwapPEXAtextStyle (), - SwapPEXLineType (), - SwapPEXLineWidth (), - SwapPEXCurveApproximation (), - SwapPEXPolylineInterp (), - SwapPEXInteriorStyle (), - SWAP_OC_PREFIX(SurfaceReflAttr) (), - SwapPEXSurfaceReflModel (), - SwapPEXSurfaceInterp (), - SwapPEXSurfaceApproximation (), - SwapPEXCullingMode (), - SwapPEXDistinguishFlag (), - SwapPEXPatternSize (), - SwapPEXPatternRefPt (), - SwapPEXPatternAttr (), - SwapPEXSurfaceEdgeFlag (), - SwapPEXSurfaceEdgeType (), - SwapPEXSetAsfValues (), - SwapPEXLocalTransform (), - SwapPEXLocalTransform2D (), - SwapPEXGlobalTransform (), - SwapPEXGlobalTransform2D (), - SwapPEXModelClip (), - SWAP_OC_PREFIX(ModelClipVolume) (), - SWAP_OC_PREFIX(ModelClipVolume2D) (), - SwapPEXRestoreModelClip (), - SWAP_OC_PREFIX(LightState) (), - SwapPEXPickId (), - SwapPEXHlhsrIdentifier (), - SWAP_OC_PREFIX(ParaSurfCharacteristics) (), - SWAP_OC_PREFIX(AddToNameSet) (), - SwapPEXExecuteStructure (), - SwapPEXLabel (), - SwapPEXApplicationData (), - SwapPEXGse (), - SWAP_OC_PREFIX(Marker) (), - SWAP_OC_PREFIX(Marker2D) (), - SWAP_OC_PREFIX(Text) (), - SWAP_OC_PREFIX(Text2D) (), - SWAP_OC_PREFIX(AnnotationText) (), - SWAP_OC_PREFIX(AnnotationText2D) (), - SWAP_OC_PREFIX(Polyline) (), - SWAP_OC_PREFIX(Polyline2D) (), - SWAP_OC_PREFIX(PolylineSet) (), - SWAP_OC_PREFIX(NurbCurve) (), - SWAP_OC_PREFIX(FillArea) (), - SWAP_OC_PREFIX(FillArea2D) (), - SWAP_OC_PREFIX(ExtFillArea) (), - SWAP_OC_PREFIX(FillAreaSet) (), - SWAP_OC_PREFIX(FillAreaSet2D) (), - SWAP_OC_PREFIX(ExtFillAreaSet) (), - SWAP_OC_PREFIX(TriangleStrip) (), - SWAP_OC_PREFIX(QuadrilateralMesh) (), - SWAP_OC_PREFIX(SOFAS) (), - SWAP_OC_PREFIX(NurbSurface) (), - SWAP_OC_PREFIX(CellArray) (), - SWAP_OC_PREFIX(CellArray2D) (), - SWAP_OC_PREFIX(ExtCellArray) (), - SWAP_OC_PREFIX(Gdp) (), - SWAP_OC_PREFIX(Gdp2D) (), - SwapPEXRenderingColourModel(); - -OCFunction SWAP_OC_PREFIX(OutputCmd) [] = { - SwapPEXOCUnused, - SwapPEXMarkerType, - SwapPEXMarkerScale, - SwapPEXMarkerColourIndex, - SWAP_OC_PREFIX(MarkerColour), - SwapPEXMarkerBundleIndex, - SwapPEXMarkerBundleIndex, /* TextFontIndex */ - SwapPEXTextPrecision, - SwapPEXCharExpansion, - SwapPEXCharSpacing, - SwapPEXMarkerColourIndex, /* TextColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* TextColour */ - SwapPEXCharHeight, - SwapPEXCharUpVector, - SwapPEXTextPath, - SwapPEXTextAlignment, - SwapPEXCharHeight, /* AtextHeight */ - SwapPEXCharUpVector, /* AtextUpVector */ - SwapPEXTextPath, /* AtextPath */ - SwapPEXTextAlignment, /* AtextAlignment */ - SwapPEXAtextStyle, - SwapPEXMarkerBundleIndex, /* TextBundleIndex */ - SwapPEXLineType, - SwapPEXLineWidth, - SwapPEXMarkerColourIndex, /* LineColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* LineColour */ - SwapPEXCurveApproximation, - SwapPEXPolylineInterp, - SwapPEXMarkerBundleIndex, /* LineBundleIndex */ - SwapPEXInteriorStyle, - SwapPEXMarkerBundleIndex, /* InteriorStyleIndex */ - SwapPEXMarkerColourIndex, /* SurfaceColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* SurfaceColour */ - SWAP_OC_PREFIX(SurfaceReflAttr), - SwapPEXSurfaceReflModel, - SwapPEXSurfaceInterp, - SwapPEXInteriorStyle, /* BfInteriorStyle */ - SwapPEXMarkerBundleIndex, /* BfInteriorStyleIndex */ - SwapPEXMarkerColourIndex, /* BfSurfaceColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* BfSurfaceColour */ - SWAP_OC_PREFIX(SurfaceReflAttr), /* BfSurfaceReflAttr */ - SwapPEXSurfaceReflModel, /* BfSurfaceReflModel */ - SwapPEXSurfaceInterp, /* BfSurfaceInterp */ - SwapPEXSurfaceApproximation, - SwapPEXCullingMode, - SwapPEXDistinguishFlag, - SwapPEXPatternSize, - SwapPEXPatternRefPt, - SwapPEXPatternAttr, - SwapPEXMarkerBundleIndex, /* InteriorBundleIndex */ - SwapPEXSurfaceEdgeFlag, - SwapPEXSurfaceEdgeType, - SwapPEXLineWidth, /* SurfaceEdgeWidth */ - SwapPEXMarkerColourIndex, /* SurfaceEdgeColourIndex */ - SWAP_OC_PREFIX(MarkerColour), /* SurfaceEdgeColour */ - SwapPEXMarkerBundleIndex, /* EdgeBundleIndex */ - SwapPEXSetAsfValues, - SwapPEXLocalTransform, - SwapPEXLocalTransform2D, - SwapPEXGlobalTransform, - SwapPEXGlobalTransform2D, - SwapPEXModelClip, - SWAP_OC_PREFIX(ModelClipVolume), - SWAP_OC_PREFIX(ModelClipVolume2D), - SwapPEXRestoreModelClip, - SwapPEXMarkerBundleIndex, /* ViewIndex */ - SWAP_OC_PREFIX(LightState), - SwapPEXMarkerBundleIndex, /* DepthCueIndex */ - SwapPEXPickId, - SwapPEXHlhsrIdentifier, - SwapPEXMarkerBundleIndex, /* ColourApproxIndex */ - SwapPEXRenderingColourModel, /* RenderingColourModel */ - SWAP_OC_PREFIX(ParaSurfCharacteristics), - SWAP_OC_PREFIX(AddToNameSet), - SWAP_OC_PREFIX(AddToNameSet), /* RemoveFromNameSet */ - SwapPEXExecuteStructure, - SwapPEXLabel, - SwapPEXApplicationData, - SwapPEXGse, - SWAP_OC_PREFIX(Marker), - SWAP_OC_PREFIX(Marker2D), - SWAP_OC_PREFIX(Text), - SWAP_OC_PREFIX(Text2D), - SWAP_OC_PREFIX(AnnotationText), - SWAP_OC_PREFIX(AnnotationText2D), - SWAP_OC_PREFIX(Polyline), - SWAP_OC_PREFIX(Polyline2D), - SWAP_OC_PREFIX(PolylineSet), - SWAP_OC_PREFIX(NurbCurve), - SWAP_OC_PREFIX(FillArea), - SWAP_OC_PREFIX(FillArea2D), - SWAP_OC_PREFIX(ExtFillArea), - SWAP_OC_PREFIX(FillAreaSet), - SWAP_OC_PREFIX(FillAreaSet2D), - SWAP_OC_PREFIX(ExtFillAreaSet), - SWAP_OC_PREFIX(TriangleStrip), - SWAP_OC_PREFIX(QuadrilateralMesh), - SWAP_OC_PREFIX(SOFAS), - SWAP_OC_PREFIX(NurbSurface), - SWAP_OC_PREFIX(CellArray), - SWAP_OC_PREFIX(CellArray2D), - SWAP_OC_PREFIX(ExtCellArray), - SWAP_OC_PREFIX(Gdp), - SWAP_OC_PREFIX(Gdp2D) -}; - -#undef SWAP_OC_PREFIX Index: xc/programs/Xserver/PEX5/dipex/swap/uOCprim.c diff -u xc/programs/Xserver/PEX5/dipex/swap/uOCprim.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/uOCprim.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/uOCprim.c:1.9 Fri Dec 14 14:57:49 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/uOCprim.c Sat Feb 28 21:41:56 2004 @@ -1,835 +0,0 @@ -/* $Xorg: uOCprim.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* - Contains swap routines for certain OCs and utility routines. - The difference between this file and its companion cOCprim.c - are subtle, having to do with, for example, whether or not - you have to swap strmPtr->numPoints before or after you will - need to use it to know how many points to convert. - */ - -/* All such packet interdependencies should be handled in these two - files: cOCprim.c and uOCprim.c - */ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "convertStr.h" - -#define LOCAL_FLAG extern -#include "convUtil.h" -#include "OCattr.h" -#undef LOCAL_FLAG - -#include "UconvName.h" -#define LOCAL_FLAG -#include "OCprim.h" - -#ifndef PADDING -#define PADDING(n) ( (n)%4 ? (4 - (n)%4) : 0) -#endif - - -unsigned char * -SWAP_FUNC_PREFIX(SwapFacet) (swapPtr, facetMask, vertexMask, colourType, ptr) -pexSwap *swapPtr; -CARD16 facetMask; -CARD16 vertexMask; -pexEnumTypeIndex colourType; -CARD8 *ptr; -{ - CARD32 numVerts; - CARD32 i; - - ptr = SwapOptData (swapPtr, ptr, facetMask, colourType); - - numVerts = *((CARD32 *)ptr); - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - - for (i=0; icolourType); - SWAP_CARD16 (pc->colourType); - return (ptr); -} - - -unsigned char * -SWAP_FUNC_PREFIX(SwapReflectionAttr) (swapPtr, ptr) -pexSwap *swapPtr; -pexReflectionAttr *ptr; -{ - unsigned char *pret = (unsigned char *)ptr; - - SWAP_FLOAT (ptr->ambient); - SWAP_FLOAT (ptr->diffuse); - SWAP_FLOAT (ptr->specular); - SWAP_FLOAT (ptr->specularConc); - SWAP_FLOAT (ptr->transmission); - pret = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, &(ptr->specularColour)); - return (pret); -} - - -void -SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, pME, num) -pexSwap *swapPtr; -pexMonoEncoding *pME; -CARD32 num; -{ - CARD16 i, j; - int bytes; - - for (i=0; icharacterSet); - switch (pME->characterSetWidth) { - case PEXCSByte: - bytes = pME->numChars; - break; - case PEXCSShort: { - CARD16 *ptr = (CARD16 *)(pME+1); - for (j=0; jnumChars; j++, ptr++) SWAP_CARD16((*ptr)); - bytes = pME->numChars * sizeof(CARD16); - break; - } - - case PEXCSLong: { - CARD32 *ptr = (CARD32 *)(pME+1); - for (j=0; jnumChars; j++, ptr++) SWAP_CARD32((*ptr)); - bytes = pME->numChars * sizeof(CARD32); - break; - } - - } - - SWAP_CARD16(pME->numChars); - pME = (pexMonoEncoding *) ((char *) (pME + 1) + - bytes + PADDING (bytes)); - - } - -} - - -/* The rest are OC's */ - -ErrorCode -SWAP_FUNC_PREFIX(PEXModelClipVolume) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexModelClipVolume *strmPtr; -{ - int i; - pexHalfSpace *ph; - - SWAP_ENUM_TYPE_INDEX (strmPtr->modelClipOperator); - - for (i=0, ph=(pexHalfSpace *)(strmPtr+1); inumHalfSpaces; i++,ph++) - SwapHalfSpace(swapPtr, ph); - - SWAP_CARD16 (strmPtr->numHalfSpaces); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXModelClipVolume2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexModelClipVolume2D *strmPtr; -{ - int i; - pexHalfSpace2D *ph; - - SWAP_ENUM_TYPE_INDEX (strmPtr->modelClipOperator); - - for (i=0, ph=(pexHalfSpace2D *)(strmPtr+1); inumHalfSpaces; i++,ph++) - SwapHalfSpace2D(swapPtr, ph); - - SWAP_CARD16 (strmPtr->numHalfSpaces); -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXLightState) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexLightState *strmPtr; -{ - int i, numE, numD; - CARD16 *light; - - numE = strmPtr->numEnable; - numD = strmPtr->numDisable; - - SWAP_CARD16 (strmPtr->numEnable); - SWAP_CARD16 (strmPtr->numDisable); - - for (i=0, light = (CARD16 *)(strmPtr+1); ihead.length) - sizeof(pexAddToNameSet)) - /sizeof(pexName)); - - for (i=0, pn=(pexName *)(strmPtr+1); ihead.length) - sizeof(pexMarker)) - /sizeof(pexCoord3D)); - - SwapCoord3DList(swapPtr, pc, num); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXMarker2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexMarker2D *strmPtr; -{ - CARD32 num; - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexMarker2D)) - /sizeof(pexCoord2D)); - - SwapCoord2DList(swapPtr, pc, num); - -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolyline) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolyline *strmPtr; -{ - CARD32 num; - pexCoord3D *pc = (pexCoord3D *)(strmPtr+1); - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexPolyline)) - /sizeof(pexCoord3D)); - - SwapCoord3DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolyline2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolyline2D *strmPtr; -{ - CARD32 num; - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexPolyline2D)) - /sizeof(pexCoord2D)); - - SwapCoord2DList(swapPtr, pc, num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXPolylineSet) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexPolylineSet *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexVertex *pv; - - - pj = (CARD32 *)(strmPtr+1); - for (i=0; inumLists; i++, pj = (CARD32 *)pv) { - - k = *pj; - SWAP_CARD32 ((*pj)); - for (j=0, pv = (pexVertex *)(pj + 1); jvertexAttribs, strmPtr->colourType); - } - - } - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numLists); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXNurbCurve) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNurbCurve *strmPtr; -{ - int i; - PEXFLOAT *pf; - - SWAP_CARD16 (strmPtr->curveOrder); - SWAP_COORD_TYPE (strmPtr->coordType); - SWAP_FLOAT (strmPtr->tmin); - SWAP_FLOAT (strmPtr->tmax); - - for (i=0, pf=(PEXFLOAT *)(strmPtr+1); inumKnots; i++, pf++) - SWAP_FLOAT((*pf)); - - if (strmPtr->coordType == PEXRational) - SwapCoord4DList(swapPtr, (pexCoord4D *)pf, strmPtr->numPoints); - else - SwapCoord3DList(swapPtr, (pexCoord3D *)pf, strmPtr->numPoints); - - SWAP_CARD32 (strmPtr->numKnots); - SWAP_CARD32 (strmPtr->numPoints); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillArea) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillArea *strmPtr; -{ - CARD32 num; - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexFillArea)) - /sizeof(pexCoord3D)); - - SWAP_CARD16 (strmPtr->shape); - - SwapCoord3DList(swapPtr, (pexCoord3D *)(strmPtr+1), num); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillArea2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillArea2D *strmPtr; -{ - CARD32 num; - - num = (CARD32)(((sizeof (CARD32) * strmPtr->head.length) - sizeof(pexFillArea2D)) - /sizeof(pexCoord2D)); - - SWAP_CARD16 (strmPtr->shape); - - SwapCoord2DList(swapPtr, (strmPtr+1), num); - - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXExtFillArea) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExtFillArea *strmPtr; -{ - - SWAP_FUNC_PREFIX(SwapFacet)( swapPtr, strmPtr->facetAttribs, - strmPtr->vertexAttribs, strmPtr->colourType, - (CARD8 *)(strmPtr+1)); - - SWAP_CARD16 (strmPtr->shape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - /* SINGLE Facet(facetAttribs, vertexAttribs, colourType) */ - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillAreaSet) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillAreaSet *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexCoord3D *pc; - - pj = (CARD32 *)(strmPtr+1); - - for (i=0; inumLists; i++, pj = (CARD32 *)pc ) { - - k = *pj; - SWAP_CARD32 ((*pj)); - for (j=0, pc = (pexCoord3D *)(pj + 1); jshape); - SWAP_CARD32 (strmPtr->numLists); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXFillAreaSet2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexFillAreaSet2D *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexCoord2D *pc; - - pj = (CARD32 *)(strmPtr+1); - - for (i=0; inumLists; i++, pj = (CARD32 *)pc ) { - - k = *pj; - SWAP_CARD32 ((*pj)); - for (j=0, pc = (pexCoord2D *)(pj + 1); jshape); - SWAP_CARD32 (strmPtr->numLists); -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXExtFillAreaSet) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExtFillAreaSet *strmPtr; -{ - unsigned long i, j, k; - CARD32 *pj; - pexVertex *pv; - unsigned char *ptr = 0; - - ptr = SwapOptData (swapPtr, (CARD8 *) (strmPtr+1), - strmPtr->facetAttribs, strmPtr->colourType); - - for (i=0, pj = (CARD32 *)ptr; inumLists; i++, pj = (CARD32 *)pv) { - k = *pj; - SWAP_CARD32 ((*pj)); - for (j=0, pv = (pexVertex *)(pj + 1); jvertexAttribs, - strmPtr->colourType); - } - - } - - SWAP_CARD16 (strmPtr->shape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numLists); -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXTriangleStrip) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexTriangleStrip *strmPtr; -{ - CARD32 i; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - - - for (i=0; i<(strmPtr->numVertices-2); i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->facetAttribs, - strmPtr->colourType); - - for (i=0; inumVertices; i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, strmPtr->vertexAttribs, - strmPtr->colourType); - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - SWAP_CARD32 (strmPtr->numVertices); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXQuadrilateralMesh) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexQuadrilateralMesh *strmPtr; -{ - int i; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - - - for (i=0; i<((strmPtr->mPts -1) * (strmPtr->nPts -1)); i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->facetAttribs, - strmPtr->colourType); - - for (i=0; i<(strmPtr->mPts * strmPtr->nPts); i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, strmPtr->vertexAttribs, - strmPtr->colourType); - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->mPts); - SWAP_CARD16 (strmPtr->nPts); - SWAP_CARD16 (strmPtr->facetAttribs); - SWAP_CARD16 (strmPtr->vertexAttribs); - -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXSOFAS) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexSOFAS *strmPtr; -{ - CARD16 i, j, k; - unsigned char *ptr = (unsigned char *)(strmPtr+1); - CARD16 numList, numSubList; - - for (i=0; inumFAS; i++) - ptr = SwapOptData( swapPtr, ptr, strmPtr->FAS_Attributes, - strmPtr->colourType); - - for (i=0; inumVertices; i++) - ptr = SwapVertex( swapPtr, (pexVertex *)ptr, - strmPtr->vertexAttributes, strmPtr->colourType); - - ptr += ((int)(((strmPtr->numEdges * strmPtr->edgeAttributes) + 3) / 4)) * 4; - - for (i=0; i < strmPtr->numFAS; i++){ - numList = *((CARD16 *)ptr); - SWAP_CARD16((*ptr)); - ptr += sizeof (CARD16); - for (j=0; j < numList; j++) { - numSubList = *((CARD16 *)ptr); - SWAP_CARD16((*ptr)); - ptr += sizeof (CARD16); - for (k=0; k < numSubList; k++) { - SWAP_CARD16((*ptr)); - ptr += sizeof (CARD16); - } - } - } - SWAP_CARD16 (strmPtr->shape); - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_CARD16 (strmPtr->FAS_Attributes); - SWAP_CARD16 (strmPtr->vertexAttributes); - SWAP_CARD16 (strmPtr->edgeAttributes); - SWAP_CARD16 (strmPtr->numFAS); - SWAP_CARD16 (strmPtr->numVertices); - SWAP_CARD16 (strmPtr->numEdges); - SWAP_CARD16 (strmPtr->numContours); - -} - - -ErrorCode -SWAP_FUNC_PREFIX(PEXNurbSurface) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNurbSurface *strmPtr; -{ - CARD32 i, j, k; - PEXFLOAT *pf; - unsigned char *ptr; - CARD32 numPoints, numKnots; - CARD32 numSublists; - CARD16 curveType; - pexTrimCurve *pTC = 0; - - - for (i=0, pf=(PEXFLOAT *)(strmPtr+1); inumUknots; i++, pf++) - SWAP_FLOAT((*pf)); - - for (i=0; inumVknots; i++, pf++) - SWAP_FLOAT((*pf)); - - ptr = (unsigned char *)pf; - if (strmPtr->type == PEXRational) - ptr = SwapCoord4DList( swapPtr, (pexCoord4D *)ptr, - (CARD32)(strmPtr->mPts*strmPtr->nPts)); - else - ptr = SwapCoord3DList( swapPtr, (pexCoord3D *)ptr, - (CARD32)(strmPtr->mPts*strmPtr->nPts)); - - for (i=0; inumLists; i++) { - numSublists = *((CARD32 *)ptr); /* num trim curves */ - SWAP_CARD32((*((CARD32 *)ptr))); - ptr+=4; - for (j=0; jtype); - SWAP_CARD32(pTC->numKnots); - SWAP_CARD32(pTC->numCoord); - } - } - SWAP_COORD_TYPE (strmPtr->type); - SWAP_CARD16 (strmPtr->uOrder); - SWAP_CARD16 (strmPtr->vOrder); - SWAP_CARD32 (strmPtr->numUknots); - SWAP_CARD32 (strmPtr->numVknots); - SWAP_CARD16 (strmPtr->mPts); - SWAP_CARD16 (strmPtr->nPts); - SWAP_CARD32 (strmPtr->numLists); -} - - - -ErrorCode -SWAP_FUNC_PREFIX(PEXCellArray) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCellArray *strmPtr; -{ - int i; - CARD16 *pc; - - SWAP_COORD3D (strmPtr->point1); - SWAP_COORD3D (strmPtr->point2); - SWAP_COORD3D (strmPtr->point3); - - for (i=0, pc=(CARD16 *)(strmPtr+1); i<(strmPtr->dx * strmPtr->dy); i++, pc++) - SWAP_CARD16((*pc)); - - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXCellArray2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexCellArray2D *strmPtr; -{ - int i; - CARD16 *pc; - - SWAP_COORD2D (strmPtr->point1); - SWAP_COORD2D (strmPtr->point2); - - for (i=0, pc=(CARD16 *)(strmPtr+1); i<(strmPtr->dx * strmPtr->dy); i++, pc++) - SWAP_CARD16((*pc)); - - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXExtCellArray) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexExtCellArray *strmPtr; -{ - CARD32 i; - unsigned char *ptr; - - for ( i=0, ptr = (unsigned char *)(strmPtr+1); - i < strmPtr->dx * strmPtr->dy; - i++) { - ptr = SwapColour(swapPtr, (pexColour *)ptr, strmPtr->colourType); - } - - SWAP_COLOUR_TYPE (strmPtr->colourType); - SWAP_COORD3D (strmPtr->point1); - SWAP_COORD3D (strmPtr->point2); - SWAP_COORD3D (strmPtr->point3); - SWAP_CARD32 (strmPtr->dx); - SWAP_CARD32 (strmPtr->dy); - -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGdp) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGdp *strmPtr; -{ - pexCoord3D *pc = (pexCoord3D *)(strmPtr+1); - SWAP_CARD32 (strmPtr->gdpId); - SWAP_CARD32 (strmPtr->numBytes); - - SwapCoord3DList(swapPtr, pc, strmPtr->numPoints); - - SWAP_CARD32 (strmPtr->numPoints); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXGdp2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexGdp2D *strmPtr; -{ - pexCoord2D *pc = (pexCoord2D *)(strmPtr+1); - - SWAP_CARD32 (strmPtr->gdpId); - SWAP_CARD32 (strmPtr->numBytes); - - SwapCoord2DList(swapPtr, pc, strmPtr->numPoints); - - SWAP_CARD32 (strmPtr->numPoints); -} - -ErrorCode -SWAP_FUNC_PEX_PFX(Text) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexText *strmPtr; -{ - SWAP_COORD3D (strmPtr->origin); - SWAP_VECTOR3D (strmPtr->vector1); - SWAP_VECTOR3D (strmPtr->vector2); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - SWAP_CARD16 (strmPtr->numEncodings); -} - -ErrorCode -SWAP_FUNC_PEX_PFX(Text2D) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexText2D *strmPtr; -{ - SWAP_COORD2D (strmPtr->origin); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - SWAP_CARD16 (strmPtr->numEncodings); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(AnnotationText) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexAnnotationText *strmPtr; -{ - SWAP_COORD3D (strmPtr->origin); - SWAP_COORD3D (strmPtr->offset); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - SWAP_CARD16 (strmPtr->numEncodings); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(AnnotationText2D) (swapPtr, strmPtr) -pexSwap * swapPtr; -pexAnnotationText2D *strmPtr; -{ - SWAP_COORD2D (strmPtr->origin); - SWAP_COORD2D (strmPtr->offset); - SWAP_FUNC_PREFIX(SwapMonoEncoding) (swapPtr, (pexMonoEncoding *)(strmPtr+1), - (CARD32)(strmPtr->numEncodings)); - SWAP_CARD16 (strmPtr->numEncodings); - -} - -ErrorCode -SWAP_FUNC_PEX_PFX(ParaSurfCharacteristics) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexParaSurfCharacteristics *strmPtr; -{ - SWAP_CARD16 (strmPtr->length); - - switch (strmPtr->characteristics) { - case PEXPSCNone: - case PEXPSCImpDep: - break; - - case PEXPSCIsoCurves: { - pexPSC_IsoparametricCurves *ptr = - (pexPSC_IsoparametricCurves *)(strmPtr+1); - SWAP_CARD16(ptr->placementType); - SWAP_CARD16(ptr->numUcurves); - SWAP_CARD16(ptr->numVcurves); - break; - } - - case PEXPSCMcLevelCurves: - case PEXPSCWcLevelCurves: { - pexPSC_LevelCurves *ptr = (pexPSC_LevelCurves *)(strmPtr+1); - PEXFLOAT *pc = (PEXFLOAT *)(ptr+1); - CARD16 i; - SWAP_COORD3D (ptr->origin); - SWAP_VECTOR3D (ptr->direction); - for (i=0; inumberIntersections; i++, pc++) { - SWAP_FLOAT(*pc); - } - SWAP_CARD16 (ptr->numberIntersections); - break; - } - } - - SWAP_INT16 (strmPtr->characteristics); -} - -ErrorCode -SWAP_FUNC_PREFIX(PEXNoop) (swapPtr, strmPtr) -pexSwap *swapPtr; -pexNoop *strmPtr; -{ -} Index: xc/programs/Xserver/PEX5/dipex/swap/uconvRep.c diff -u xc/programs/Xserver/PEX5/dipex/swap/uconvRep.c:1.9 xc/programs/Xserver/PEX5/dipex/swap/uconvRep.c:removed --- xc/programs/Xserver/PEX5/dipex/swap/uconvRep.c:1.9 Fri Dec 14 14:57:49 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/uconvRep.c Sat Feb 28 21:41:56 2004 @@ -1,2172 +0,0 @@ -/* $Xorg: uconvRep.c,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* - Swapping and float conversion routines. - - Variations on a theme by CITI. - */ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "dipex.h" -#include "pexSwap.h" -#include "pex_site.h" -#include "convertStr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG extern -#include "convUtil.h" -#include "UconvName.h" -#include "OCprim.h" -#include "OCcolour.h" -#include "OCattr.h" - -#undef LOCAL_FLAG -#define LOCAL_FLAG -#include "uconvRep.h" - -#define PADDING(n) ( (n)&3 ? (4 - ((n)&3)) : 0) - -/************************************************************* - Replies - - *************************************************************/ - -void -SWAP_FUNC_PREFIX(ConvertGetExtensionInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetExtensionInfoReq *strmPtr; -pexGetExtensionInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->majorVersion); - SWAP_CARD16 (reply->minorVersion); - SWAP_CARD32 (reply->release); - SWAP_CARD32 (reply->lengthName); - SWAP_CARD32 (reply->subsetInfo); -} - -void -SWAP_FUNC_PREFIX(ConvertGetEnumeratedTypeInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetEnumeratedTypeInfoReq *strmPtr; -pexGetEnumeratedTypeInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i, j, pad; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* NOT 0 */ - - switch (strmPtr->itemMask) { - - case PEXETIndex : { - CARD16 *ptr; - /* PEXETIndex =1 per define in PEX.h */ - /* a LISTofLISTofINT16 */ - int numints; - for (i=0, ptr = (CARD16 *)(reply+1); i < reply->numLists; i++) { - numints = *((CARD32 *)ptr); - pad = numints & 1; - SWAP_CARD32(*((CARD32 *)ptr)); - ptr += 2; - for (j=0; j < numints; j++) { - SWAP_CARD16((*ptr)); - ptr++; - } - ptr += pad; - } - - break; - } - - case PEXETMnemonic : { - CARD8 *ptr; - /* PEXETMnemonic =2 per define in PEX.h */ - /* a LISTofLISTofSTRING */ - int numstrings, numbytes; - for (i=0, ptr = (CARD8 *)(reply+1); i < reply->numLists; i++) { - numstrings = *((CARD32 *)ptr); - SWAP_CARD32(*((CARD32 *)ptr)); - ptr += 4; - for (j=0; j < numstrings; j++) { - numbytes = *((CARD16 *)ptr); - SWAP_CARD16(*((CARD16 *)ptr)); - ptr += 2 + numbytes + PADDING(2+numbytes); - } - } - break; - } - - case PEXETBoth : { - CARD8 *ptr; - /* PEXETBOTH =3 per define in PEX.h */ - /* a LISTofLISTofENUM_DESC */ - int numenums, numbytes; - for (i=0, ptr = (CARD8 *)(reply+1); i < reply->numLists; i++) { - numenums = *((CARD32 *)ptr); - SWAP_CARD32(*((CARD32 *)ptr)); - ptr += 4; - for (j=0; j < numenums; j++) { - SWAP_CARD16((*ptr)); - ptr += 2; - numbytes = *((CARD16 *)ptr); - SWAP_CARD16(*((CARD16 *)ptr)); - ptr += 2 + numbytes + PADDING(numbytes); - } - } - break; - } - - default: { /* counts */ - - CARD16 *ptr; - /* swap the counts */ - for (i=0, ptr = (CARD16 *)(reply+1); i < reply->numLists; i++) { - SWAP_CARD32(*((CARD32 *)ptr)); - ptr += 2; - } - break; - } - - } - - SWAP_CARD32 (reply->numLists); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetTableInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetTableInfoReq *strmPtr; -pexGetTableInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->definableEntries); - SWAP_CARD16 (reply->numPredefined); - SWAP_INT16 (reply->predefinedMin); - SWAP_INT16 (reply->predefinedMax); -} - - -void -SWAP_FUNC_PREFIX(ConvertGetPredefinedEntriesReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetPredefinedEntriesReq *strmPtr; -pexGetPredefinedEntriesReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapTable) ( swapPtr, strmPtr->tableType, - reply->numEntries, - (unsigned char *)(reply+1)); - - SWAP_CARD32 (reply->numEntries); -} - -void -SWAP_FUNC_PREFIX(ConvertGetDefinedIndicesReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetDefinedIndicesReq *strmPtr; -pexGetDefinedIndicesReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - CARD16 *ind; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, ind=(CARD16 *)(reply+1); i < reply->numIndices; i++, ind++) - SWAP_CARD16((*ind)); - - SWAP_CARD32 (reply->numIndices); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetTableEntryReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetTableEntryReq *strmPtr; -pexGetTableEntryReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->status); - SWAP_FUNC_PREFIX(SwapTable) ( swapPtr, reply->tableType, (CARD32)1, - (unsigned char *)(reply+1)); - - SWAP_CARD16 (reply->tableType); -} - -void -SWAP_FUNC_PREFIX(ConvertGetTableEntriesReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetTableEntriesReq *strmPtr; -pexGetTableEntriesReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_FUNC_PREFIX(SwapTable) ( swapPtr, reply->tableType, - reply->numEntries, - (unsigned char *)(reply+1)); - SWAP_CARD32 (reply->numEntries); - SWAP_CARD16 (reply->tableType); -} - -void -SWAP_FUNC_PREFIX(ConvertGetPipelineContextReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetPipelineContextReq *strmPtr; -pexGetPipelineContextReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapPipelineContextAttr) ( swapPtr, (strmPtr->itemMask), - (CARD8 *)(reply+1)); -} - -void -SWAP_FUNC_PREFIX(ConvertGetRendererAttributesReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetRendererAttributesReq *strmPtr; -pexGetRendererAttributesReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapRendererAttributes) ( swapPtr, strmPtr->itemMask, - (CARD8 *)(reply+1)); -} - -void -SWAP_FUNC_PREFIX(ConvertGetRendererDynamicsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetRendererDynamicsReq *strmPtr; -pexGetRendererDynamicsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD32 *ptr = (CARD32 *)(reply+1); - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD32 ((*ptr)); ptr++; /* tables */ - SWAP_CARD32 ((*ptr)); ptr++; /* namesets */ - SWAP_CARD32 ((*ptr)); /* attributes */ -} - -void -SWAP_FUNC_PREFIX(ConvertGetStructureInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetStructureInfoReq *strmPtr; -pexGetStructureInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->editMode); - SWAP_CARD32 (reply->elementPtr); - SWAP_CARD32 (reply->numElements); - SWAP_CARD32 (reply->lengthStructure); - SWAP_CARD16 (reply->hasRefs); -} - -void -SWAP_FUNC_PREFIX(ConvertGetElementInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetElementInfoReq *strmPtr; -pexGetElementInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexElementInfo *pe; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, pe=(pexElementInfo *)(reply+1); i < reply->numInfo; i++, pe++) - SWAP_ELEMENT_INFO (*pe); - - SWAP_CARD32 (reply->numInfo); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetStructuresInNetworkReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetStructuresInNetworkReq *strmPtr; -pexGetStructuresInNetworkReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexStructure *ps; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, ps=(pexStructure *)(reply+1); inumStructures; i++, ps++) - SWAP_STRUCTURE ((*ps)); - - SWAP_CARD32 (reply->numStructures); - -} - - -void -SWAP_FUNC_PREFIX(ConvertGetAncestorsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetAncestorsReq *strmPtr; -pexGetAncestorsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD32 i, j, num, *buf; - pexElementRef *pe; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, buf=(CARD32 *)(reply+1); inumPaths; i++) { - num = *buf; - SWAP_CARD32((*buf)); - buf++; - for ( j=0, pe=(pexElementRef *)(buf); jnumPaths); -} - -/* typedef pexGetAncestorsReply pexGetDescendantsReply; */ - -void -SWAP_FUNC_PREFIX(ConvertElementSearchReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexElementSearchReq *strmPtr; -pexElementSearchReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->status); - SWAP_CARD32 (reply->foundOffset); - -} - -void -SWAP_FUNC_PREFIX(ConvertFetchElementsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexFetchElementsReq *strmPtr; -pexFetchElementsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexElementInfo *pe; - CARD32 *curCmd; - int length; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for (i=0, curCmd = (CARD32 *)(reply+1); - inumElements; - i++, curCmd += length) - { - pe = (pexElementInfo *)curCmd; - /* this check must match the one done in mipex.h MI_IS_PEX_OC macro */ - if ((PEXOCAll < pe->elementType) && (pe->elementType <= PEXMaxOC)) - cntxtPtr->pexSwapReplyOC[ pe->elementType ] (swapPtr, pe); - length = pe->length; - SWAP_ELEMENT_INFO (*pe); - } - - SWAP_CARD32 (reply->numElements); -} - -void -SWAP_FUNC_PREFIX(ConvertGetNameSetReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetNameSetReq *strmPtr; -pexGetNameSetReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexName *pn; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, pn=(pexName *)(reply+1); inumNames; i++, pn++) - SWAP_NAME((*pn)); - - SWAP_CARD32 (reply->numNames); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetSearchContextReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetSearchContextReq *strmPtr; -pexGetSearchContextReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapSearchContext)(swapPtr, strmPtr->itemMask, - (unsigned char *)(reply+1)); - -} - -void -SWAP_FUNC_PREFIX(ConvertSearchNetworkReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexSearchNetworkReq *strmPtr; -pexSearchNetworkReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexElementRef *pe; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, pe=(pexElementRef *)(reply+1); inumItems; i++, pe++) - SWAP_ELEMENT_REF((*pe)); - - SWAP_CARD32 (reply->numItems); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetWksInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetWksInfoReq *strmPtr; -pexGetWksInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - unsigned char *ptr; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - ptr = (unsigned char *)(reply+1); - - /* Read the Protocol Encoding, lots of non 4 byte fields here - that are shipped as 4 bytes (effectively CARD32) so they - are swapped as CARD32 - JSH - */ - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWDisplayUpdate) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWVisualState) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWDisplaySurface) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWViewUpdate) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWDefinedViews) { - int len, i; - len = *(int *)ptr; - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr+=sizeof(CARD32); - for (i=0; iitemMask, PEXPWWksUpdate){ - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWReqNpcSubvolume) { - SwapNpcSubvolume(swapPtr, (pexNpcSubvolume *)ptr); - ptr += sizeof(pexNpcSubvolume); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWCurNpcSubvolume) { - SwapNpcSubvolume(swapPtr, (pexNpcSubvolume *)ptr); - ptr += sizeof(pexNpcSubvolume); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWReqWksViewport) { - SwapViewport(swapPtr, (pexViewport *)ptr); - ptr += sizeof(pexViewport); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWCurWksViewport) { - SwapViewport(swapPtr, (pexViewport *)ptr); - ptr += sizeof(pexViewport); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWHlhsrUpdate) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWReqHlhsrMode) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWCurHlhsrMode) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWDrawable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWMarkerBundle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWTextBundle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWLineBundle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWInteriorBundle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWEdgeBundle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWColourTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWDepthCueTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWLightTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWColourApproxTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWPatternTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWTextFontTable) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWHighlightIncl) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWHighlightExcl) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWInvisibilityIncl) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWInvisibilityExcl) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - }; - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWPostedStructures) { - CARD32 len, i; - pexStructureInfo *ps; - - len = *((CARD32 *)ptr); - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - ps = (pexStructureInfo *)ptr; - for (i=0; iitemMask, PEXPWNumPriorities) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWBufferUpdate) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWReqBufferMode) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(strmPtr->itemMask, PEXPWCurBufferMode) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - -} - -void -SWAP_FUNC_PREFIX(ConvertGetDynamicsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetDynamicsReq *strmPtr; -pexGetDynamicsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* 0 */ -} - -void -SWAP_FUNC_PREFIX(ConvertGetViewRepReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetViewRepReq *strmPtr; -pexGetViewRepReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - pexViewRep *pv; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->viewUpdate); - - pv = (pexViewRep *)(reply+1); - - SwapViewRep(swapPtr, pv); /* requested */ - pv++; - SwapViewRep(swapPtr, pv); /* current */ - -} - -void -SWAP_FUNC_PREFIX(ConvertMapDCtoWCReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexMapDCtoWCReq *strmPtr; -pexMapDCtoWCReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexCoord3D *pc; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD16 (reply->viewIndex); - - for ( i=0, pc=(pexCoord3D *)(reply+1); inumCoords; i++, pc++) - SWAP_COORD3D((*pc)); - - SWAP_CARD32 (reply->numCoords); - -} - -void -SWAP_FUNC_PREFIX(ConvertMapWCtoDCReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexMapWCtoDCReq *strmPtr; -pexMapWCtoDCReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i; - pexDeviceCoord *pc; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for (i=0, pc=(pexDeviceCoord *)(reply+1); inumCoords; i++,pc++) - SWAP_DEVICE_COORD((*pc)); - - SWAP_CARD32 (reply->numCoords); - -} - -void -SWAP_FUNC_PREFIX(ConvertGetWksPostingsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetWksPostingsReq *strmPtr; -pexGetWksPostingsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - int i, num; - pexPhigsWks *pi; - - SWAP_CARD16 (reply->sequenceNumber); - - num = (int)((reply->length)/sizeof(pexPhigsWks)); - SWAP_CARD32 (reply->length); /* not 0 */ - - for ( i=0, pi=(pexPhigsWks *)(reply+1); iswap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapPickDevAttr) ( swapPtr, strmPtr->itemMask, - (unsigned char *)(reply+1)); - - -} - -void -SWAP_FUNC_PREFIX(ConvertGetPickMeasureReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetPickMeasureReq *strmPtr; -pexGetPickMeasureReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SWAP_FUNC_PREFIX(SwapPickMeasAttr) ( swapPtr, strmPtr->itemMask, - (unsigned char *)(reply + 1)); - -} - -void -SWAP_FUNC_PREFIX(ConvertEndPickOneReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexEndPickOneReq *strmPtr; -pexEndPickOneReply *reply; -{ - pexPickElementRef *p_data; - CARD32 i; - - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); - SWAP_CARD16 (reply->pickStatus); - - p_data = (pexPickElementRef *)(reply+1); - for (i=0; i < reply->numPickElRefs; i++, p_data++) - SWAP_PICK_ELEMENT_REF((*p_data)); - - SWAP_CARD32 (reply->numPickElRefs); -} - -void -SWAP_FUNC_PREFIX(ConvertPickOneReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexPickOneReq *strmPtr; -pexPickOneReply *reply; -{ - pexPickElementRef *p_data; - CARD32 i; - - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); - SWAP_CARD16 (reply->pickStatus); - - p_data = (pexPickElementRef *)(reply+1); - for (i=0; i < reply->numPickElRefs; i++, p_data++) - SWAP_PICK_ELEMENT_REF((*p_data)); - - SWAP_CARD32 (reply->numPickElRefs); -} - -void -SWAP_FUNC_PREFIX(ConvertEndPickAllReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexEndPickAllReq *strmPtr; -pexEndPickAllReply *reply; -{ - pexPickElementRef *p_data; - CARD32 i, j, num, *buf; - - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); - SWAP_CARD16 (reply->pickStatus); - SWAP_CARD16 (reply->morePicks); - - /* JSH commented out because until the Pick Functionality is - actually written this will seg fault on a NULL pointer - - for ( i=0, buf=(CARD32 *)(reply+1); i < reply->numPicked; i++) { - num = *buf; - SWAP_CARD32((*buf)); - buf++; - for ( j=0, p_data = (pexPickElementRef *)(buf); j < num; j++, p_data++) - SWAP_PICK_ELEMENT_REF((*p_data)); - buf = (CARD32 *)p_data; - } - - */ - SWAP_CARD32 (reply->numPicked); -} - -void -SWAP_FUNC_PREFIX(ConvertPickAllReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexPickAllReq *strmPtr; -pexPickAllReply *reply; -{ - pexPickElementRef *p_data; - CARD32 i, j, num, *buf; - - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); - SWAP_CARD16 (reply->pickStatus); - SWAP_CARD16 (reply->morePicks); - - /* JSH commented out because until the Pick Functionality is - actually written this will seg fault on a NULL pointer - - for ( i=0, buf=(CARD32 *)(reply+1); i < reply->numPicked; i++) { - num = *buf; - SWAP_CARD32((*buf)); - buf++; - for ( j=0, p_data = (pexPickElementRef *)(buf); j < num; j++, p_data++) - SWAP_PICK_ELEMENT_REF((*p_data)); - buf = (CARD32 *)p_data; - } - - */ - SWAP_CARD32 (reply->numPicked); -} - - -void -SWAP_FUNC_PREFIX(ConvertQueryFontReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexQueryFontReq *strmPtr; -pexQueryFontReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD32 (reply->lengthFontInfo); - - SWAP_FUNC_PREFIX(SwapFontInfo) (swapPtr, (pexFontInfo *)(reply+1)); -} - -void -SWAP_FUNC_PREFIX(ConvertListFontsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexListFontsReq *strmPtr; -pexListFontsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_FUNC_PREFIX(SwapStringList) ( swapPtr, reply->numStrings, - (pexString *)(reply+1)); - - SWAP_CARD32 (reply->numStrings); -} - -void -SWAP_FUNC_PREFIX(ConvertListFontsWithInfoReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexListFontsWithInfoReq *strmPtr; -pexListFontsWithInfoReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD32 numInfo; - CARD32 i; - CARD8 *ptr; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - ptr = SWAP_FUNC_PREFIX(SwapStringList) ( swapPtr, reply->numStrings, - (pexString *)(reply+1)); - - SWAP_CARD32 (reply->numStrings); - - numInfo = *((CARD32 *)ptr); - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - - for (i=0; iswap; - CARD32 numInfo; - - numInfo = reply->length / 6; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - SwapExtentInfo (swapPtr, numInfo, (pexExtentInfo *) (reply + 1)); -} - -void -SWAP_FUNC_PREFIX(ConvertGetImpDepConstantsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexGetImpDepConstantsReq *strmPtr; -pexGetImpDepConstantsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD16 *pnames = (CARD16 *)(strmPtr+1); - CARD32 i; - CARD32 *ptr = (CARD32 *)(reply+1); - PEXFLOAT *pf; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - for (i=0; inumNames; i++, pnames++, ptr++) { - switch (*pnames) { - case PEXIDDitheringSupported: - case PEXIDMaxEdgeWidth: - case PEXIDMaxLineWidth: - case PEXIDMaxMarkerSize: - case PEXIDMaxModelClipPlanes: - case PEXIDMaxNameSetNames: - case PEXIDMaxNonAmbientLights: - case PEXIDMaxNURBOrder: - case PEXIDMaxTrimCurveOrder: - case PEXIDMinEdgeWidth: - case PEXIDMinLineWidth: - case PEXIDMinMarkerSize: - case PEXIDNominalEdgeWidth: - case PEXIDNominalLineWidth: - case PEXIDNominalMarkerSize: - case PEXIDNumSupportedEdgeWidths: - case PEXIDNumSupportedLineWidths: - case PEXIDNumSupportedMarkerSizes: - case PEXIDBestColourApproximation: - case PEXIDTransparencySupported: - SWAP_CARD32((*ptr)); - break; - case PEXIDChromaticityRedU: - case PEXIDChromaticityRedV: - case PEXIDLuminanceRed: - case PEXIDChromaticityGreenU: - case PEXIDChromaticityGreenV: - case PEXIDLuminanceGreen: - case PEXIDChromaticityBlueU: - case PEXIDChromaticityBlueV: - case PEXIDLuminanceBlue: - case PEXIDChromaticityWhiteU: - case PEXIDChromaticityWhiteV: - case PEXIDLuminanceWhite: - pf = (PEXFLOAT *)ptr; - SWAP_FLOAT((*pf)); - break; - } - } -} - -void -SWAP_FUNC_PREFIX(ConvertMatchRendererTargetsReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexMatchRendererTargetsReq *strmPtr; -pexMatchRendererTargetsReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - CARD32 i, numTargets; - pexRendererTarget *rd_data; - - numTargets = reply->length / 2; - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - - rd_data = (pexRendererTarget *)(reply + 1); - - for ( i = 0; i < numTargets; i++, rd_data++ ) - SWAP_RENDERER_TARGET((*rd_data)); - -} - -void -SWAP_FUNC_PREFIX(EscapeWithReplyReply) (cntxtPtr, strmPtr, reply) -pexContext *cntxtPtr; -pexEscapeWithReplyReq *strmPtr; -pexEscapeWithReplyReply *reply; -{ - pexSwap *swapPtr = cntxtPtr->swap; - - SWAP_CARD16 (reply->sequenceNumber); - SWAP_CARD32 (reply->length); /* not 0 */ - SWAP_CARD32 (reply->escapeID); - - /* vendor specific stuff goes here */ -} - -void -SWAP_FUNC_PREFIX(NoReply)() -{ - - } - - -/**************************************************************** - * utilities * - ****************************************************************/ - -unsigned char * -SWAP_FUNC_PREFIX(SwapStringList) (swapPtr, numStrings, stringPtr) -pexSwap *swapPtr; -CARD32 numStrings; -pexString *stringPtr; -{ - CARD32 i; - CARD16 j; - CARD8 *ptr = (CARD8 *)stringPtr; - - for (i=0; ilength; - ptr += j + j%2; - } - return (ptr); -} - - -void -SWAP_FUNC_PREFIX(SwapTable)(swapPtr, TType, num, where) -pexSwap *swapPtr; -pexTableType TType; -CARD32 num; -unsigned char *where; -{ - int i; - unsigned char *ptr = where; - CARD32 numFontIDs; - - switch (TType) { - case PEXLineBundleLUT: { - for (i=0; inumx, pe->numy); - SWAP_CARD16 (pe->numx); - SWAP_CARD16 (pe->numy); - }; - break; } - - case PEXTextFontLUT: { - for (i=0; ifirstGlyph); - SWAP_CARD32 (pfi->lastGlyph); - SWAP_CARD32 (pfi->defaultGlyph); - - pfp = (pexFontProp *)(pfi+1); - for (i=0; inumProps; i++) - pfp = (pexFontProp *)(SwapFontProp(swapPtr, pfp)); - - SWAP_CARD32 (pfi->numProps); - - ptr = (CARD8 *)pfp; - return (ptr); -} - - -void -SWAP_FUNC_PREFIX(SwapPickMeasAttr) (swapPtr, im, p_data) -pexSwap *swapPtr; -CARD32 im; -unsigned char *p_data; -{ - unsigned char *ptr = p_data; - - if (im & PEXPMStatus) { - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - if (im & PEXPMPath) { - CARD32 i; - CARD32 numRefs = *((CARD32 *)ptr); - pexPickElementRef *pp; - - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - for (i=0, pp = (pexPickElementRef *)ptr; ilightType); - SWAP_VECTOR3D (p_data->direction); - SWAP_COORD3D (p_data->point); - SWAP_FLOAT (p_data->concentration); - SWAP_FLOAT (p_data->spreadAngle); - SWAP_FLOAT (p_data->attenuation1); - SWAP_FLOAT (p_data->attenuation2); - - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->lightColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapLineBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexLineBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->lineType); - SWAP_ENUM_TYPE_INDEX (p_data->polylineInterp); - SWAP_FLOAT (p_data->lineWidth); - SWAP_CURVE_APPROX (p_data->curveApprox); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->lineColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapMarkerBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexMarkerBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->markerType); - SWAP_FLOAT (p_data->markerScale); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->markerColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapTextBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexTextBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_CARD16 (p_data->textFontIndex); - SWAP_CARD16 (p_data->textPrecision); - SWAP_FLOAT (p_data->charExpansion); - SWAP_FLOAT (p_data->charSpacing); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->textColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapInteriorBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexInteriorBundleEntry *p_data; -{ - unsigned char *po; - SWAP_ENUM_TYPE_INDEX (p_data->interiorStyle); - SWAP_INT16 (p_data->interiorStyleIndex); - SWAP_ENUM_TYPE_INDEX (p_data->reflectionModel); - SWAP_ENUM_TYPE_INDEX (p_data->surfaceInterp); - SWAP_ENUM_TYPE_INDEX (p_data->bfInteriorStyle); - SWAP_INT16 (p_data->bfInteriorStyleIndex); - SWAP_ENUM_TYPE_INDEX (p_data->bfReflectionModel); - SWAP_ENUM_TYPE_INDEX (p_data->bfSurfaceInterp); - - SwapSurfaceApprox (swapPtr, &(p_data->surfaceApprox)); - po = (unsigned char *)(p_data+1); - po = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)po); - po = SWAP_FUNC_PREFIX(SwapReflectionAttr) ( swapPtr, - (pexReflectionAttr *)po); - po = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)po); - po = SWAP_FUNC_PREFIX(SwapReflectionAttr) ( swapPtr, - (pexReflectionAttr *)po); - - return (po); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapEdgeBundleEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexEdgeBundleEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_ENUM_TYPE_INDEX (p_data->edgeType); - SWAP_FLOAT (p_data->edgeWidth); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier)(swapPtr, &(p_data->edgeColour)); - - return (ptr); -} - - -unsigned char * -SWAP_FUNC_PREFIX(SwapDepthCueEntry) (swapPtr, p_data) -pexSwap *swapPtr; -pexDepthCueEntry *p_data; -{ - unsigned char *ptr = (unsigned char *)p_data; - SWAP_FLOAT (p_data->frontPlane); - SWAP_FLOAT (p_data->backPlane); - SWAP_FLOAT (p_data->frontScaling); - SWAP_FLOAT (p_data->backScaling); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) ( swapPtr, - &(p_data->depthCueColour)); - - return (ptr); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapPatternEntry) (swapPtr, p_data, numx, numy) -pexSwap *swapPtr; -pexPatternEntry *p_data; -CARD16 numx; -CARD16 numy; -{ - int i, max_colours; - pexColour *pc = (pexColour *)(p_data + 1); - - max_colours = numx * numy; - for (i=0; icolourType); - - SWAP_COLOUR_TYPE (p_data->colourType); - - return ((unsigned char *)pc); -} - -unsigned char * -SWAP_FUNC_PREFIX(SwapPipelineContextAttr) (swapPtr, itemMask, p_data) -pexSwap *swapPtr; -CARD32 *itemMask; -CARD8 *p_data; -{ - /* NOTE: See the Protocol Encoding for a desription of these fields - in places where CARD16 or INT16 are packed into a 4 byte field - (essentially a CARD32) for transmission these fields must be - byte swapped as a CARD32. - JSH - */ - - CARD8 *ptr = p_data; - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerScale) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCMarkerBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextFont) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPrecision) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharExpansion) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharSpacing) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharHeight) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCharUpVector) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextPath) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextAlignment) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextHeight) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextUpVector) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextPath) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextAlignment) { - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - SWAP_CARD16 ((*((CARD16 *)ptr))); - ptr += sizeof(CARD16); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCAtextStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCTextBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineWidth) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCurveApproximation) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPolylineInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLineBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorStyleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflAttr) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceReflModel) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyle) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfInteriorStyleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflAttr) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceReflModel) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCBfSurfaceInterp) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceApproximation) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCCullingMode) { - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCDistinguishFlag) { - SWAP_CARD32((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternSize) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefPt) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec1) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCPatternRefVec2) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCInteriorBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeFlag) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeType) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeWidth) { - SWAP_FLOAT ((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCSurfaceEdgeColour) { - ptr = SWAP_FUNC_PREFIX(SwapColourSpecifier) (swapPtr, - (pexColourSpecifier *)ptr); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCEdgeBundleIndex) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCLocalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) { - SWAP_FLOAT((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCGlobalTransform) { - int i, j; - for (i=0; i<4; i++) - for (j=0; j<4; j++) { - SWAP_FLOAT((*((PEXFLOAT *)ptr))); - ptr += sizeof(PEXFLOAT); - } - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClip) { - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - } - - CHECK_BITMASK_ARRAY(itemMask, PEXPCModelClipVolume) { - CARD32 i, numHalfSpace; - pexHalfSpace *ph; - numHalfSpace = *((CARD32 *)ptr); - SWAP_CARD32 ((*((CARD32 *)ptr))); - ptr += sizeof(CARD32); - for (i=0, ph = (pexHalfSpace *)ptr; i OCTables.temp - sed -n '/##/!p' OCReduce.sed > OCReduce.temp - awk -f OCTables.awk OCTables.temp $(PEXINCLUDE)/PEX.h | awk -f OCReduce.awk | sed -f OCReduce.temp > cOCTables.ci - -uOCTables.ci: - echo "STUB_NAME " "uPEX" | cat > OCTables.temp - sed -n '/##/!p' OCReduce.sed > OCReduce.temp - awk -f OCTables.awk OCTables.temp $(PEXINCLUDE)/PEX.h | awk -f OCReduce.awk | sed -f OCReduce.temp > uOCTables.ci - -Requests.h: - awk -f ReqTab.awk $(PEXINCLUDE)/PEX.h > Requests.h - -Requests.ci: - awk -f ReqSame.awk Requests.h > Requests.ci - -clean: - rm -f cOCTables.ci uOCTables.ci Requests.h Requests.ci - rm -f cOCTables.temp uOCTables.temp Index: xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.awk diff -u xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.awk:1.2 xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.awk:removed --- xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.awk:1.2 Fri Dec 14 14:57:51 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.awk Sat Feb 28 21:41:56 2004 @@ -1,154 +0,0 @@ -## -# $Xorg: OCReduce.awk,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ -## -## -## Copyright 1996, 1998 The Open Group -## -## Permission to use, copy, modify, distribute, and sell this software and its -## documentation for any purpose is hereby granted without fee, provided that -## the above copyright notice appear in all copies and that both that -## copyright notice and this permission notice appear in supporting -## documentation. -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -## AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## -## Except as contained in this notice, the name of The Open Group shall not be -## used in advertising or otherwise to promote the sale, use or other dealings -## in this Software without prior written authorization from The Open Group. -## -########################################################################### -## Copyright 1990, 1991 by Sun Microsystems, Inc. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## provided that the above copyright notice appear in all copies and that -## both that copyright notice and this permission notice appear in -## supporting documentation, and that the names of Sun Microsystems -## and The Open Group not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -## SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## -########################################################################### -## Usage: -## rm -f temp.dat -## echo "STUB_NAME " | cat > temp.dat -## awk -f OCTables.awk temp.dat /PEX.h | awk -f OCReduce.awk | sed -f OCReduce.sed > -## -BEGIN { } - { - if ($1 ~ /ColourIndex/) { - if ($1 ~ /MarkerColourIndex/ ) { print $0 } - else if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSwapPEXMarkerColourIndex,\t/* " name " */" } - else { - print "\tSwapPEXMarkerColourIndex\t/* " name " */" } } } - else if ($1 ~ /Index\)/) { - if ($1 ~ /MarkerBundleIndex/ ) { print $0 } - else if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSwapPEXMarkerBundleIndex,\t/* " name " */" } - else { - print "\tSwapPEXMarkerBundleIndex\t/* " name " */" } } } - else if ($1 ~ /Colour/) { - if ($1 ~ /MarkerColour/ ) { print $0 } - else if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSWAP_OC_PREFIX(MarkerColour),\t/* " name " */" } - else { - print "\tSWAP_OC_PREFIX(MarkerColour)\t/* " name " */" } } } - else if ( $1 ~ /Bf/) { - if ($2 !~ /\(\)/) { - lh = index($1,"Bf") - rh = index($1,")") - name = substr($1,(lh+2),(rh-lh-2)) - if (($1 ~ /Colour/) && ($1 !~ /Index/) || ($1 ~ /SurfaceReflAttr/)) { - if ($0 ~ /,/) { - print "\tSWAP_OC_PREFIX(" name "),\t/* Bf" name " */" } - else { - print "\tSWAP_OC_PREFIX(" name ")\t/* Bf" name " */" } } - else { - if ($0 ~ /,/) { - print "\tSwapPEX" name ",\t/* Bf" name " */" } - else { - print "\tSwapPEX" name "\t/* Bf" name " */" } } } } - else if ($1 ~ /Atext/) { - if ($1 ~ /Style/) { print $0 } - else if ($2 !~ /\(\)/) { - if (($1 ~ /AtextHeight/) || ($1 ~ /AtextUpVector/)) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+6),(rh-lh-6)) - if ($0 ~ /,/) { - print "\tSwapPEXChar" name ",\t/* Atext" name " */" } - else { - print "\tSwapPEXChar" name "\t/* Atext" name " */" } } - else { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+3),(rh-lh-3)) - if ($0 ~ /,/) { - print "\tSwapPEXT" name ",\t/* At" name " */" } - else { - print "\tSwapPEXT" name "\t/* At" name " */" } } } } - else if ($1 ~ /RemoveFromNameSet/) { - if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSWAP_OC_PREFIX(AddToNameSet),\t/* " name " */" } - else { - print "\tSWAP_OC_PREFIX(AddToNameSet0\t/* " name " */" } } } - else if ($1 ~ /SurfaceEdgeWidth/) { - if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSwapPEXLineWidth,\t/* " name " */" } - else { - print "\tSwapPEXLineWidth\t/* " name " */" } } } - else if ($1 ~ /TCApproximation/) { - if ($2 !~ /\(\)/) { - lh = index($1,"(") - rh = index($1,")") - name = substr($1,(lh+1),(rh-lh-1)) - if ($0 ~ /,/) { - print "\tSwapPEXCurveApproximation,\t/* " name " */" } - else { - print "\tSwapPEXCurveApproximation\t/* " name " */" } } } - else if ($1 ~ /\(All\)/) { - lh = index($0,"SWAP_OC_PREFIX(") - 1 - rh = index($0,")") + 1 - print substr($0,1,lh) "SwapPEXOCUnused" substr($0,rh,(length($0)+1-rh)) } - else print $0 - } -END { } Index: xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.sed diff -u xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.sed:1.2 xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.sed:removed --- xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.sed:1.2 Fri Dec 14 14:57:51 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/util/OCReduce.sed Sat Feb 28 21:41:56 2004 @@ -1,98 +0,0 @@ -## -# $Xorg: OCReduce.sed,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ -## -## Copyright 1996, 1998 The Open Group -## -## Permission to use, copy, modify, distribute, and sell this software and its -## documentation for any purpose is hereby granted without fee, provided that -## the above copyright notice appear in all copies and that both that -## copyright notice and this permission notice appear in supporting -## documentation. -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -## AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## -## Except as contained in this notice, the name of The Open Group shall not be -## used in advertising or otherwise to promote the sale, use or other dealings -## -########################################################################### -## Copyright 1990, 1991 by Sun Microsystems, Inc. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## provided that the above copyright notice appear in all copies and that -## both that copyright notice and this permission notice appear in -## supporting documentation, and that the names of Sun Microsystems -## and The Open Group not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -## SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## -########################################################################### -## Usage: -## rm -f temp.dat -## echo "STUB_NAME " | cat > temp.dat -## awk -f OCTables.awk temp.dat /PEX.h | awk -f OCReduce.awk | sed -f OCReduce.sed > -## -s/SWAP_OC_PREFIX(MarkerType)/SwapPEXMarkerType/g -s/SWAP_OC_PREFIX(MarkerScale)/SwapPEXMarkerScale/g -s/SWAP_OC_PREFIX(MarkerColourIndex)/SwapPEXMarkerColourIndex/g -s/SWAP_OC_PREFIX(MarkerBundleIndex)/SwapPEXMarkerBundleIndex/g -s/SWAP_OC_PREFIX(AtextStyle)/SwapPEXAtextStyle/g -s/SWAP_OC_PREFIX(TextPrecision)/SwapPEXTextPrecision/g -s/SWAP_OC_PREFIX(CharExpansion)/SwapPEXCharExpansion/g -s/SWAP_OC_PREFIX(CharSpacing)/SwapPEXCharSpacing/g -s/SWAP_OC_PREFIX(CharHeight)/SwapPEXCharHeight/g -s/SWAP_OC_PREFIX(CharUpVector)/SwapPEXCharUpVector/g -s/SWAP_OC_PREFIX(TextPath)/SwapPEXTextPath/g -s/SWAP_OC_PREFIX(TextAlignment)/SwapPEXTextAlignment/g -s/SWAP_OC_PREFIX(LineType)/SwapPEXLineType/g -s/SWAP_OC_PREFIX(LineWidth)/SwapPEXLineWidth/g -s/SWAP_OC_PREFIX(LineColourIndex)/SwapPEXLineColourIndex/g -s/SWAP_OC_PREFIX(CurveApproximation)/SwapPEXCurveApproximation/g -s/SWAP_OC_PREFIX(PolylineInterp)/SwapPEXPolylineInterp/g -s/SWAP_OC_PREFIX(InteriorStyle)/SwapPEXInteriorStyle/g -s/SWAP_OC_PREFIX(SurfaceColourIndex)/SwapPEXSurfaceColourIndex/g -s/SWAP_OC_PREFIX(SurfaceReflModel)/SwapPEXSurfaceReflModel/g -s/SWAP_OC_PREFIX(SurfaceInterp)/SwapPEXSurfaceInterp/g -s/SWAP_OC_PREFIX(SurfaceApproximation)/SwapPEXSurfaceApproximation/g -s/SWAP_OC_PREFIX(CullingMode)/SwapPEXCullingMode/g -s/SWAP_OC_PREFIX(DistinguishFlag)/SwapPEXDistinguishFlag/g -s/SWAP_OC_PREFIX(PatternSize)/SwapPEXPatternSize/g -s/SWAP_OC_PREFIX(PatternRefPt)/SwapPEXPatternRefPt/g -s/SWAP_OC_PREFIX(PatternAttr)/SwapPEXPatternAttr/g -s/SWAP_OC_PREFIX(SurfaceEdgeFlag)/SwapPEXSurfaceEdgeFlag/g -s/SWAP_OC_PREFIX(SurfaceEdgeType)/SwapPEXSurfaceEdgeType/g -s/SWAP_OC_PREFIX(SurfaceEdgeWidth)/SwapPEXSurfaceEdgeWidth/g -s/SWAP_OC_PREFIX(SetAsfValues)/SwapPEXSetAsfValues/g -s/SWAP_OC_PREFIX(LocalTransform)/SwapPEXLocalTransform/g -s/SWAP_OC_PREFIX(LocalTransform2D)/SwapPEXLocalTransform2D/g -s/SWAP_OC_PREFIX(GlobalTransform)/SwapPEXGlobalTransform/g -s/SWAP_OC_PREFIX(GlobalTransform2D)/SwapPEXGlobalTransform2D/g -s/SWAP_OC_PREFIX(ModelClip)/SwapPEXModelClip/g -s/SWAP_OC_PREFIX(RestoreModelClip)/SwapPEXRestoreModelClip/g -s/SWAP_OC_PREFIX(LightState)/SwapPEXLightState/g -s/SWAP_OC_PREFIX(PickId)/SwapPEXPickId/g -s/SWAP_OC_PREFIX(HlhsrIdentifier)/SwapPEXHlhsrIdentifier/g -s/SWAP_OC_PREFIX(ExecuteStructure)/SwapPEXExecuteStructure/g -s/SWAP_OC_PREFIX(Label)/SwapPEXLabel/g -s/SWAP_OC_PREFIX(ApplicationData)/SwapPEXApplicationData/g -s/SWAP_OC_PREFIX(Gse)/SwapPEXGse/g -s/SWAP_OC_PREFIX(RenderingColourModel)/SwapPEXRenderingColourModel/g -s/SWAP_OC_PREFIX(OCUnused)/SwapPEXOCUnused/g Index: xc/programs/Xserver/PEX5/dipex/swap/util/OCTables.awk diff -u xc/programs/Xserver/PEX5/dipex/swap/util/OCTables.awk:1.2 xc/programs/Xserver/PEX5/dipex/swap/util/OCTables.awk:removed --- xc/programs/Xserver/PEX5/dipex/swap/util/OCTables.awk:1.2 Fri Dec 14 14:57:51 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/util/OCTables.awk Sat Feb 28 21:41:56 2004 @@ -1,117 +0,0 @@ -# $Xorg: OCTables.awk,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ -## -## Copyright 1996, 1998 The Open Group -## -## Permission to use, copy, modify, distribute, and sell this software and its -## documentation for any purpose is hereby granted without fee, provided that -## the above copyright notice appear in all copies and that both that -## copyright notice and this permission notice appear in supporting -## documentation. -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -## AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## -## Except as contained in this notice, the name of The Open Group shall not be -## used in advertising or otherwise to promote the sale, use or other dealings -## -########################################################################### -## Copyright 1990, 1991 by Sun Microsystems, Inc. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## provided that the above copyright notice appear in all copies and that -## both that copyright notice and this permission notice appear in -## supporting documentation, and that the names of Sun Microsystems -## and The Open Group not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -## SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## -########################################################################### -## Usage: -## rm -f temp.dat -## echo "STUB_NAME " | cat > temp.dat -## awk -f OCTables.awk temp.dat /PEX.h > -## -BEGIN { num=0; i=0; - print "/* Automatically generated OC table" - print " */" - print "/******************************************************************" - print "Copyright 1990, 1991 by Sun Microsystems, Inc. and The Open Group." - print "" - print " All Rights Reserved" - print "" - print "Permission to use, copy, modify, and distribute this software and its " - print "documentation for any purpose and without fee is hereby granted, " - print "provided that the above copyright notice appear in all copies and that" - print "both that copyright notice and this permission notice appear in " - print "supporting documentation, and that the names of Sun Microsystems " - print "and The Open Group not be used in advertising or publicity " - print "pertaining to distribution of the software without specific, written " - print "prior permission. " - print "" - print "SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, " - print "INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT " - print "SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL " - print "DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS," - print "WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION," - print "ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS" - print "SOFTWARE." - print "" - print "******************************************************************/" - print "#include \"X.h\"" - print "#include \"PEX.h\"" - print "#include \"PEXprotost.h\"" - print "#include \"PEXproto.h\"" - print "#include \"dipex.h\"" - print "#include \"pexSwap.h\"\n" } -## -## Look only for lines starting with PEXOC (in PEX.h). -## Name (minus PEXOC) is saved in array for printing at the end -## (signalled by reaching "PEXMaxOC"). This allows us to do the -## extern declarations and the table in one pass. -## - $1 == "#define" { - if ($2 == "PEXMaxOC") { - print "extern ErrorCode" - for (i=0; i<(num-1); i++) { - print "\tSWAP_OC_PREFIX(" str[i] ") ()," } - print "\tSWAP_OC_PREFIX(" str[i] ") ();\n" - print "OCFunction SWAP_OC_PREFIX(OutputCmd) [] = {" - for (i=0; i<(num-1); i++) { - print "\tSWAP_OC_PREFIX(" str[i] ")," } - print "\tSWAP_OC_PREFIX(" str[i] ")" - print "};\n\n#undef SWAP_OC_PREFIX" } - else if (index($2,"PEXOC") == 1) { - str[num] = substr($2,6,(length($2)-5)) - num++ } - } -## -## The next few lines are only for determining the name of the OC_PREFIX -## from the temporary file just made up for this purpose. -## -$1 == "STUB_NAME" { - print "#if defined (__STDC__)" - print "#define SWAP_OC_PREFIX(t)\t" $2 "##t" - print "#else" - print "#define SWAP_OC_PREFIX(t)\t" $2 "/**/t" - print "#endif\n" } -## -## -END { } Index: xc/programs/Xserver/PEX5/dipex/swap/util/ReqSame.awk diff -u xc/programs/Xserver/PEX5/dipex/swap/util/ReqSame.awk:1.2 xc/programs/Xserver/PEX5/dipex/swap/util/ReqSame.awk:removed --- xc/programs/Xserver/PEX5/dipex/swap/util/ReqSame.awk:1.2 Fri Dec 14 14:57:51 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/util/ReqSame.awk Sat Feb 28 21:41:56 2004 @@ -1,117 +0,0 @@ -# $Xorg: ReqSame.awk,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ -## -## Copyright 1996, 1998 The Open Group -## -## Permission to use, copy, modify, distribute, and sell this software and its -## documentation for any purpose is hereby granted without fee, provided that -## the above copyright notice appear in all copies and that both that -## copyright notice and this permission notice appear in supporting -## documentation. -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -## AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## -## Except as contained in this notice, the name of The Open Group shall not be -## used in advertising or otherwise to promote the sale, use or other dealings -## -########################################################################### -## Copyright 1990, 1991 by Sun Microsystems, Inc. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## provided that the above copyright notice appear in all copies and that -## both that copyright notice and this permission notice appear in -## supporting documentation, and that the names of Sun Microsystems -## and The Open Group not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -## SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## -########################################################################### -## Finds names that use the same swapping routine and renames them. -## -## Usage: -## awk -f ReqSame.awk Requests.h > Requests.ci -## -BEGIN { - num = 0; name = ""; lend = 0; oname = ""; rend = 0; D=0 } - $1$2 == "#ifdefSWAP_FUNC_PREFIX" { - D=1 - print "#include \"convReq.h\"" } - D == 0 { - if ($4 ~ /SWAP_FUNC_PREFIX/) { - lend = index($0,"(PEX") - rend = index($0,")") - name = substr($0,(lend+4),(rend-lend-4)) - oname = name - if (name == "FreeLookupTable") { - name = "GenericResourceRequest" } - else if (name == "GetDefinedIndices") { - name = "GenericResourceRequest" } - else if (name == "FreePipelineContext") { - name = "GenericResourceRequest" } - else if (name == "FreeRenderer") { - name = "GenericResourceRequest" } - else if (name == "EndRendering") { - name = "GenericResourceRequest" } - else if (name == "EndStructure") { - name = "GenericResourceRequest" } - else if (name == "CreateStructure") { - name = "GenericResourceRequest" } - else if (name == "GetRendererDynamics") { - name = "GenericResourceRequest" } - else if (name == "CreateNameSet") { - name = "GenericResourceRequest" } - else if (name == "FreeNameSet") { - name = "GenericResourceRequest" } - else if (name == "FreeSearchContext") { - name = "GenericResourceRequest" } - else if (name == "SearchNetwork") { - name = "GenericResourceRequest" } - else if (name == "GetNameSet") { - name = "GenericResourceRequest" } - else if (name == "FreePhigsWks") { - name = "GenericResourceRequest" } - else if (name == "RedrawAllStructures") { - name = "GenericResourceRequest" } - else if (name == "UpdateWorkstation") { - name = "GenericResourceRequest" } - else if (name == "ExecuteDeferredActions") { - name = "GenericResourceRequest" } - else if (name == "UnpostAllStructures") { - name = "GenericResourceRequest" } - else if (name == "GetWksPostings") { - name = "GenericResourceRequest" } - else if (name == "FreePickMeasure") { - name = "GenericResourceRequest" } - else if (name == "CloseFont") { - name = "GenericResourceRequest"} - else if (name == "GetDescendants") { - name = "GetAncestors" } - else { - name = "" - }} - if (name == "") { - print $0 } - else { - print substr($0,1,lend) "PEX" name substr($0,rend,(length($0))) "\t/*" oname "*/" } - name = "" } - - D == 1 { if ($0 ~ /;/) { D=0 } } -END { } Index: xc/programs/Xserver/PEX5/dipex/swap/util/ReqTab.awk diff -u xc/programs/Xserver/PEX5/dipex/swap/util/ReqTab.awk:1.2 xc/programs/Xserver/PEX5/dipex/swap/util/ReqTab.awk:removed --- xc/programs/Xserver/PEX5/dipex/swap/util/ReqTab.awk:1.2 Fri Dec 14 14:57:52 2001 +++ xc/programs/Xserver/PEX5/dipex/swap/util/ReqTab.awk Sat Feb 28 21:41:56 2004 @@ -1,101 +0,0 @@ -# $Xorg: ReqTab.awk,v 1.4 2001/02/09 02:04:17 xorgcvs Exp $ -## -## Copyright 1996, 1998 The Open Group -## -## Permission to use, copy, modify, distribute, and sell this software and its -## documentation for any purpose is hereby granted without fee, provided that -## the above copyright notice appear in all copies and that both that -## copyright notice and this permission notice appear in supporting -## documentation. -## -## The above copyright notice and this permission notice shall be included in -## all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -## AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## -## Except as contained in this notice, the name of The Open Group shall not be -## used in advertising or otherwise to promote the sale, use or other dealings -## -########################################################################### -## Copyright 1990, 1991 by Sun Microsystems, Inc. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## provided that the above copyright notice appear in all copies and that -## both that copyright notice and this permission notice appear in -## supporting documentation, and that the names of Sun Microsystems -## and The Open Group not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -## SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## -########################################################################### -## Usage: -## awk -f ReqTab.awk /PEX.h > -## -BEGIN { num = 0; lend = 0; - print "/* Automatically generated Request table" - print " */" - print "/******************************************************************" - print "Copyright 1990, 1991 by Sun Microsystems, Inc. and The Open Group." - print "" - print " All Rights Reserved" - print "" - print "Permission to use, copy, modify, and distribute this software and its " - print "documentation for any purpose and without fee is hereby granted, " - print "provided that the above copyright notice appear in all copies and that" - print "both that copyright notice and this permission notice appear in " - print "supporting documentation, and that the names of Sun Microsystems " - print "and The Open Group not be used in advertising or publicity " - print "pertaining to distribution of the software without specific, written " - print "prior permission. " - print "" - print "SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, " - print "INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT " - print "SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL " - print "DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS," - print "WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION," - print "ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS" - print "SOFTWARE." - print "" - print "******************************************************************/" - print "#ifdef SWAP_FUNC_PREFIX" - print "#undef SWAP_FUNC_PREFIX" - print "#endif" - print "#define SWAP_FUNC_PREFIX(nm) nm" - } - - $1 == "#define" { - lend = index($2,"PEX_") - if ((lend > 0) && ($2 != "PEX_H") && ($2 !~ /NAME/) && ($2 !~ /PROTO/) && ($2 !~ /BIT/) && ($2 !~ /MASK/)) { - names[num] = substr($2,(lend+4),(length($2)-4)) - num++ } } -END { - num-- - print "\nLOCAL_FLAG ErrorCode" - print "\tSWAP_FUNC_PREFIX(PEXRequestUnused) ()," - for (i=0; i> 5) -#define PEX_MASKWORD(buf, i) buf[PEX_MASKIDX(i)] -#define PEX_BITSET(buf, i) PEX_MASKWORD(buf, i) |= PEX_BITMASK(i) -#define PEX_BITCLEAR(buf, i) PEX_MASKWORD(buf, i) &= ~PEX_BITMASK(i) -#define PEX_GETBIT(buf, i) (PEX_MASKWORD(buf, i) & PEX_BITMASK(i)) - -#define PEXMSGetWksInfo 2 -#define PEXMSPipeline 3 - -/* Pipeline Context */ -#define PEXPCMarkerType 0 -#define PEXPCMarkerScale 1 -#define PEXPCMarkerColour 2 -#define PEXPCMarkerBundleIndex 3 -#define PEXPCTextFont 4 -#define PEXPCTextPrecision 5 -#define PEXPCCharExpansion 6 -#define PEXPCCharSpacing 7 -#define PEXPCTextColour 8 -#define PEXPCCharHeight 9 -#define PEXPCCharUpVector 10 -#define PEXPCTextPath 11 -#define PEXPCTextAlignment 12 -#define PEXPCAtextHeight 13 -#define PEXPCAtextUpVector 14 -#define PEXPCAtextPath 15 -#define PEXPCAtextAlignment 16 -#define PEXPCAtextStyle 17 -#define PEXPCTextBundleIndex 18 -#define PEXPCLineType 19 -#define PEXPCLineWidth 20 -#define PEXPCLineColour 21 -#define PEXPCCurveApproximation 22 -#define PEXPCPolylineInterp 23 -#define PEXPCLineBundleIndex 24 -#define PEXPCInteriorStyle 25 -#define PEXPCInteriorStyleIndex 26 -#define PEXPCSurfaceColour 27 -#define PEXPCSurfaceReflAttr 28 -#define PEXPCSurfaceReflModel 29 -#define PEXPCSurfaceInterp 30 -#define PEXPCBfInteriorStyle 31 - -#define PEXPCBfInteriorStyleIndex 32 -#define PEXPCBfSurfaceColour 33 -#define PEXPCBfSurfaceReflAttr 34 -#define PEXPCBfSurfaceReflModel 35 -#define PEXPCBfSurfaceInterp 36 -#define PEXPCSurfaceApproximation 37 -#define PEXPCCullingMode 38 -#define PEXPCDistinguishFlag 39 -#define PEXPCPatternSize 40 -#define PEXPCPatternRefPt 41 -#define PEXPCPatternRefVec1 42 -#define PEXPCPatternRefVec2 43 -#define PEXPCInteriorBundleIndex 44 -#define PEXPCSurfaceEdgeFlag 45 -#define PEXPCSurfaceEdgeType 46 -#define PEXPCSurfaceEdgeWidth 47 -#define PEXPCSurfaceEdgeColour 48 -#define PEXPCEdgeBundleIndex 49 -#define PEXPCLocalTransform 50 -#define PEXPCGlobalTransform 51 -#define PEXPCModelClip 52 -#define PEXPCModelClipVolume 53 -#define PEXPCViewIndex 54 -#define PEXPCLightState 55 -#define PEXPCDepthCueIndex 56 -#define PEXPCSetAsfValues 57 -#define PEXPCPickId 58 -#define PEXPCHlhsrIdentifier 59 -#define PEXPCNameSet 60 -#define PEXPCColourApproxIndex 61 -#define PEXPCRenderingColourModel 62 -#define PEXPCParaSurfCharacteristics 63 -#define PEXMaxPCIndex 63 - -/* Renderer Bitmasks */ -#define PEXRDPipelineContext (1L<<0) -#define PEXRDCurrentPath (1L<<1) -#define PEXRDMarkerBundle (1L<<2) -#define PEXRDTextBundle (1L<<3) -#define PEXRDLineBundle (1L<<4) -#define PEXRDInteriorBundle (1L<<5) -#define PEXRDEdgeBundle (1L<<6) -#define PEXRDViewTable (1L<<7) -#define PEXRDColourTable (1L<<8) -#define PEXRDDepthCueTable (1L<<9) -#define PEXRDLightTable (1L<<10) -#define PEXRDColourApproxTable (1L<<11) -#define PEXRDPatternTable (1L<<12) -#define PEXRDTextFontTable (1L<<13) -#define PEXRDHighlightIncl (1L<<14) -#define PEXRDHighlightExcl (1L<<15) -#define PEXRDInvisibilityIncl (1L<<16) -#define PEXRDInvisibilityExcl (1L<<17) -#define PEXRDRendererState (1L<<18) -#define PEXRDHlhsrMode (1L<<19) -#define PEXRDNpcSubvolume (1L<<20) -#define PEXRDViewport (1L<<21) -#define PEXRDClipList (1L<<22) -#define PEXRDPickInclusion (1L<<23) -#define PEXRDPickExclusion (1L<<24) -#define PEXRDPickStartPath (1L<<25) -#define PEXRDBackgroundColour (1L<<26) -#define PEXRDClearI (1L<<27) -#define PEXRDClearZ (1L<<28) -#define PEXRDEchoMode (1L<<29) -#define PEXMaxRDShift 29 - -/* Renderer Dynamics Bitmasks */ -/* tables */ -#define PEXDynMarkerBundle (1L<<0) -#define PEXDynTextBundle (1L<<1) -#define PEXDynLineBundle (1L<<2) -#define PEXDynInteriorBundle (1L<<3) -#define PEXDynEdgeBundle (1L<<4) -#define PEXDynViewTable (1L<<5) -#define PEXDynColourTable (1L<<6) -#define PEXDynDepthCueTable (1L<<7) -#define PEXDynLightTable (1L<<8) -#define PEXDynColourApproxTable (1L<<9) -#define PEXDynPatternTable (1L<<10) -#define PEXDynTextFontTable (1L<<11) -#define PEXDynMarkerBundleContents (1L<<16) -#define PEXDynTextBundleContents (1L<<17) -#define PEXDynLineBundleContents (1L<<18) -#define PEXDynInteriorBundleContents (1L<<19) -#define PEXDynEdgeBundleContents (1L<<20) -#define PEXDynViewTableContents (1L<<21) -#define PEXDynColourTableContents (1L<<22) -#define PEXDynDepthCueTableContents (1L<<23) -#define PEXDynLightTableContents (1L<<24) -#define PEXDynColourApproxContents (1L<<25) -#define PEXDynPatternTableContents (1L<<26) -#define PEXDynTextFontTableContents (1L<<27) -/* namesets */ -#define PEXDynHighlightNameset (1L<<0) -#define PEXDynInvisibilityNameset (1L<<1) -#define PEXDynPickNameset (1L<<2) -#define PEXDynHighlightNamesetContents (1L<<16) -#define PEXDynInvisibilityNamesetContents (1L<<17) -#define PEXDynPickNamesetContents (1L<<18) -/* attributes */ -#define PEXDynHlhsrMode (1L<<0) -#define PEXDynNpcSubvolume (1L<<1) -#define PEXDynViewport (1L<<2) -#define PEXDynClipList (1L<<3) -#define PEXDynEchoMode (1L<<4) - -#define PEXElementType (1L<<0) -#define PEXElementSize (1L<<1) -#define PEXElementData (1L<<2) - -/* Search Context Bitmasks */ -#define PEXSCPosition (1L<<0) -#define PEXSCDistance (1L<<1) -#define PEXSCCeiling (1L<<2) -#define PEXSCModelClipFlag (1L<<3) -#define PEXSCStartPath (1L<<4) -#define PEXSCNormalList (1L<<5) -#define PEXSCInvertedList (1L<<6) - -/* Phigs Workstation Attribute Bitmasks */ -#define PEXPWDisplayUpdate 0 -#define PEXPWVisualState 1 -#define PEXPWDisplaySurface 2 -#define PEXPWViewUpdate 3 -#define PEXPWDefinedViews 4 -#define PEXPWWksUpdate 5 -#define PEXPWReqNpcSubvolume 6 -#define PEXPWCurNpcSubvolume 7 -#define PEXPWReqWksViewport 8 -#define PEXPWCurWksViewport 9 -#define PEXPWHlhsrUpdate 10 -#define PEXPWReqHlhsrMode 11 -#define PEXPWCurHlhsrMode 12 -#define PEXPWDrawable 13 -#define PEXPWMarkerBundle 14 -#define PEXPWTextBundle 15 -#define PEXPWLineBundle 16 -#define PEXPWInteriorBundle 17 -#define PEXPWEdgeBundle 18 -#define PEXPWColourTable 19 -#define PEXPWDepthCueTable 20 -#define PEXPWLightTable 21 -#define PEXPWColourApproxTable 22 -#define PEXPWPatternTable 23 -#define PEXPWTextFontTable 24 -#define PEXPWHighlightIncl 25 -#define PEXPWHighlightExcl 26 -#define PEXPWInvisibilityIncl 27 -#define PEXPWInvisibilityExcl 28 -#define PEXPWPostedStructures 29 -#define PEXPWNumPriorities 30 -#define PEXPWBufferUpdate 31 - -#define PEXPWReqBufferMode 32 -#define PEXPWCurBufferMode 33 - -#define PEXMaxPWIndex 33 - -/* Indices for GetDynamics */ -#define PEXPWDViewRep 0 -#define PEXPWDMarkerBundle 1 -#define PEXPWDTextBundle 2 -#define PEXPWDLineBundle 3 -#define PEXPWDInteriorBundle 4 -#define PEXPWDEdgeBundle 5 -#define PEXPWDColourTable 6 -#define PEXPWDPatternTable 7 -#define PEXPWDWksTransform 8 -#define PEXPWDHighlightFilter 9 -#define PEXPWDInvisibilityFilter 10 -#define PEXPWDHlhsrMode 11 -#define PEXPWDStructureModify 12 -#define PEXPWDPostStructure 13 -#define PEXPWDUnpostStructure 14 -#define PEXPWDDeleteStructure 15 -#define PEXPWDReferenceModify 16 -#define PEXPWDBufferModify 17 -#define PEXPWDLightTable 18 -#define PEXPWDDepthCueTable 19 -#define PEXPWDColourApproxTable 20 - -/* Pick Device Bitmasks */ -#define PEXPDPickStatus (1L<<0) -#define PEXPDPickPath (1L<<1) -#define PEXPDPickPathOrder (1L<<2) -#define PEXPDPickIncl (1L<<3) -#define PEXPDPickExcl (1L<<4) -#define PEXPDPickDataRec (1L<<5) -#define PEXPDPickPromptEchoType (1L<<6) -#define PEXPDPickEchoVolume (1L<<7) -#define PEXPDPickEchoSwitch (1L<<8) - -/* Pick Measure Bitmasks */ -#define PEXPMStatus (1L<<0) -#define PEXPMPath (1L<<1) - -/* Errors */ -#define PEXColourTypeError 0 -#define PEXRendererStateError 1 -#define PEXFloatingPointFormatError 2 -#define PEXLabelError 3 -#define PEXLookupTableError 4 -#define PEXNameSetError 5 -#define PEXPathError 6 -#define PEXFontError 7 -#define PEXPhigsWksError 8 -#define PEXPickMeasureError 9 -#define PEXPipelineContextError 10 -#define PEXRendererError 11 -#define PEXSearchContextError 12 -#define PEXStructureError 13 -#define PEXOutputCommandError 14 -#define PEXMaxError 14 - -/* Requests */ -#define PEX_GetExtensionInfo 1 -#define PEX_GetEnumeratedTypeInfo 2 -#define PEX_GetImpDepConstants 3 -#define PEX_CreateLookupTable 4 -#define PEX_CopyLookupTable 5 -#define PEX_FreeLookupTable 6 -#define PEX_GetTableInfo 7 -#define PEX_GetPredefinedEntries 8 -#define PEX_GetDefinedIndices 9 -#define PEX_GetTableEntry 10 -#define PEX_GetTableEntries 11 -#define PEX_SetTableEntries 12 -#define PEX_DeleteTableEntries 13 -#define PEX_CreatePipelineContext 14 -#define PEX_CopyPipelineContext 15 -#define PEX_FreePipelineContext 16 -#define PEX_GetPipelineContext 17 -#define PEX_ChangePipelineContext 18 -#define PEX_CreateRenderer 19 -#define PEX_FreeRenderer 20 -#define PEX_ChangeRenderer 21 -#define PEX_GetRendererAttributes 22 -#define PEX_GetRendererDynamics 23 -#define PEX_BeginRendering 24 -#define PEX_EndRendering 25 -#define PEX_BeginStructure 26 -#define PEX_EndStructure 27 -#define PEX_RenderOutputCommands 28 -#define PEX_RenderNetwork 29 -#define PEX_CreateStructure 30 -#define PEX_CopyStructure 31 -#define PEX_DestroyStructures 32 -#define PEX_GetStructureInfo 33 -#define PEX_GetElementInfo 34 -#define PEX_GetStructuresInNetwork 35 -#define PEX_GetAncestors 36 -#define PEX_GetDescendants 37 -#define PEX_FetchElements 38 -#define PEX_SetEditingMode 39 -#define PEX_SetElementPointer 40 -#define PEX_SetElementPointerAtLabel 41 -#define PEX_ElementSearch 42 -#define PEX_StoreElements 43 -#define PEX_DeleteElements 44 -#define PEX_DeleteElementsToLabel 45 -#define PEX_DeleteBetweenLabels 46 -#define PEX_CopyElements 47 -#define PEX_ChangeStructureRefs 48 -#define PEX_CreateNameSet 49 -#define PEX_CopyNameSet 50 -#define PEX_FreeNameSet 51 -#define PEX_GetNameSet 52 -#define PEX_ChangeNameSet 53 -#define PEX_CreateSearchContext 54 -#define PEX_CopySearchContext 55 -#define PEX_FreeSearchContext 56 -#define PEX_GetSearchContext 57 -#define PEX_ChangeSearchContext 58 -#define PEX_SearchNetwork 59 -#define PEX_CreatePhigsWks 60 -#define PEX_FreePhigsWks 61 -#define PEX_GetWksInfo 62 -#define PEX_GetDynamics 63 -#define PEX_GetViewRep 64 -#define PEX_RedrawAllStructures 65 -#define PEX_UpdateWorkstation 66 -#define PEX_RedrawClipRegion 67 -#define PEX_ExecuteDeferredActions 68 -#define PEX_SetViewPriority 69 -#define PEX_SetDisplayUpdateMode 70 -#define PEX_MapDCtoWC 71 -#define PEX_MapWCtoDC 72 -#define PEX_SetViewRep 73 -#define PEX_SetWksWindow 74 -#define PEX_SetWksViewport 75 -#define PEX_SetHlhsrMode 76 -#define PEX_SetWksBufferMode 77 -#define PEX_PostStructure 78 -#define PEX_UnpostStructure 79 -#define PEX_UnpostAllStructures 80 -#define PEX_GetWksPostings 81 -#define PEX_GetPickDevice 82 -#define PEX_ChangePickDevice 83 -#define PEX_CreatePickMeasure 84 -#define PEX_FreePickMeasure 85 -#define PEX_GetPickMeasure 86 -#define PEX_UpdatePickMeasure 87 -#define PEX_OpenFont 88 -#define PEX_CloseFont 89 -#define PEX_QueryFont 90 -#define PEX_ListFonts 91 -#define PEX_ListFontsWithInfo 92 -#define PEX_QueryTextExtents 93 -#define PEX_MatchRendererTargets 94 -#define PEX_Escape 95 -#define PEX_EscapeWithReply 96 -#define PEX_RenderElements 97 -#define PEX_AccumulateState 98 -#define PEX_BeginPickOne 99 -#define PEX_EndPickOne 100 -#define PEX_PickOne 101 -#define PEX_BeginPickAll 102 -#define PEX_EndPickAll 103 -#define PEX_PickAll 104 -#define PEXMaxRequest 104 - -/* Output Commands */ -#define PEXOCAll 0 -#define PEXOCMarkerType 1 -#define PEXOCMarkerScale 2 -#define PEXOCMarkerColourIndex 3 -#define PEXOCMarkerColour 4 -#define PEXOCMarkerBundleIndex 5 -#define PEXOCTextFontIndex 6 -#define PEXOCTextPrecision 7 -#define PEXOCCharExpansion 8 -#define PEXOCCharSpacing 9 -#define PEXOCTextColourIndex 10 -#define PEXOCTextColour 11 -#define PEXOCCharHeight 12 -#define PEXOCCharUpVector 13 -#define PEXOCTextPath 14 -#define PEXOCTextAlignment 15 -#define PEXOCAtextHeight 16 -#define PEXOCAtextUpVector 17 -#define PEXOCAtextPath 18 -#define PEXOCAtextAlignment 19 -#define PEXOCAtextStyle 20 -#define PEXOCTextBundleIndex 21 -#define PEXOCLineType 22 -#define PEXOCLineWidth 23 -#define PEXOCLineColourIndex 24 -#define PEXOCLineColour 25 -#define PEXOCCurveApproximation 26 -#define PEXOCPolylineInterp 27 -#define PEXOCLineBundleIndex 28 -#define PEXOCInteriorStyle 29 -#define PEXOCInteriorStyleIndex 30 -#define PEXOCSurfaceColourIndex 31 -#define PEXOCSurfaceColour 32 -#define PEXOCSurfaceReflAttr 33 -#define PEXOCSurfaceReflModel 34 -#define PEXOCSurfaceInterp 35 -#define PEXOCBfInteriorStyle 36 -#define PEXOCBfInteriorStyleIndex 37 -#define PEXOCBfSurfaceColourIndex 38 -#define PEXOCBfSurfaceColour 39 -#define PEXOCBfSurfaceReflAttr 40 -#define PEXOCBfSurfaceReflModel 41 -#define PEXOCBfSurfaceInterp 42 -#define PEXOCSurfaceApproximation 43 -#define PEXOCCullingMode 44 -#define PEXOCDistinguishFlag 45 -#define PEXOCPatternSize 46 -#define PEXOCPatternRefPt 47 -#define PEXOCPatternAttr 48 -#define PEXOCInteriorBundleIndex 49 -#define PEXOCSurfaceEdgeFlag 50 -#define PEXOCSurfaceEdgeType 51 -#define PEXOCSurfaceEdgeWidth 52 -#define PEXOCSurfaceEdgeColourIndex 53 -#define PEXOCSurfaceEdgeColour 54 -#define PEXOCEdgeBundleIndex 55 -#define PEXOCSetAsfValues 56 -#define PEXOCLocalTransform 57 -#define PEXOCLocalTransform2D 58 -#define PEXOCGlobalTransform 59 -#define PEXOCGlobalTransform2D 60 -#define PEXOCModelClip 61 -#define PEXOCModelClipVolume 62 -#define PEXOCModelClipVolume2D 63 -#define PEXOCRestoreModelClip 64 -#define PEXOCViewIndex 65 -#define PEXOCLightState 66 -#define PEXOCDepthCueIndex 67 -#define PEXOCPickId 68 -#define PEXOCHlhsrIdentifier 69 -#define PEXOCColourApproxIndex 70 -#define PEXOCRenderingColourModel 71 -#define PEXOCParaSurfCharacteristics 72 -#define PEXOCAddToNameSet 73 -#define PEXOCRemoveFromNameSet 74 -#define PEXOCExecuteStructure 75 -#define PEXOCLabel 76 -#define PEXOCApplicationData 77 -#define PEXOCGse 78 -#define PEXOCMarker 79 -#define PEXOCMarker2D 80 -#define PEXOCText 81 -#define PEXOCText2D 82 -#define PEXOCAnnotationText 83 -#define PEXOCAnnotationText2D 84 -#define PEXOCPolyline 85 -#define PEXOCPolyline2D 86 -#define PEXOCPolylineSet 87 -#define PEXOCNurbCurve 88 -#define PEXOCFillArea 89 -#define PEXOCFillArea2D 90 -#define PEXOCExtFillArea 91 -#define PEXOCFillAreaSet 92 -#define PEXOCFillAreaSet2D 93 -#define PEXOCExtFillAreaSet 94 -#define PEXOCTriangleStrip 95 -#define PEXOCQuadrilateralMesh 96 -#define PEXOCSOFAS 97 -#define PEXOCNurbSurface 98 -#define PEXOCCellArray 99 -#define PEXOCCellArray2D 100 -#define PEXOCExtCellArray 101 -#define PEXOCGdp 102 -#define PEXOCGdp2D 103 -#define PEXOCNoop 104 -#define PEXMaxOC 104 - -#define PEXOCNil 0xffff - -#endif /* PEX.h */ - Index: xc/programs/Xserver/PEX5/include/PEXErr.h diff -u xc/programs/Xserver/PEX5/include/PEXErr.h:1.2 xc/programs/Xserver/PEX5/include/PEXErr.h:removed --- xc/programs/Xserver/PEX5/include/PEXErr.h:1.2 Fri Dec 14 14:57:52 2001 +++ xc/programs/Xserver/PEX5/include/PEXErr.h Sat Feb 28 21:41:56 2004 @@ -1,67 +0,0 @@ -/* $Xorg: PEXErr.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1988,1989,1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1988,1989,1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Sun Microsystems, -and The Open Group, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -#ifndef PEXERRS_H -#define PEXERRS_H - -typedef int ErrorCode; - -#define PEXNOERR 0 - -#ifndef Success -#define Success PEXNOERR -#endif /* Success */ - -#ifndef PEXNYI -#define PEXNYI BadImplementation -#endif /* PEXNYI */ - -#endif /* PEXERRS_H */ - Index: xc/programs/Xserver/PEX5/include/PEXfuncs.h diff -u xc/programs/Xserver/PEX5/include/PEXfuncs.h:1.2 xc/programs/Xserver/PEX5/include/PEXfuncs.h:removed --- xc/programs/Xserver/PEX5/include/PEXfuncs.h:1.2 Fri Dec 14 14:57:53 2001 +++ xc/programs/Xserver/PEX5/include/PEXfuncs.h Sat Feb 28 21:41:56 2004 @@ -1,145 +0,0 @@ -/* $Xorg: PEXfuncs.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ - -#ifndef PEX_FUNCS_H -#define PEX_FUNCS_H - -/* PEX Function Declarations, in alphabetic order. */ - -extern int PEXBeginRendering(); /* in file pex/pex_rend.c */ -extern int PEXBeginStructure(); /* in file pex/pex_rend.c */ -extern int PEXChangeNameSet(); /* in file pex/pex_ns.c */ -extern int PEXChangePickDevice(); /* in file pex/pex_pick.c */ -extern int PEXChangePipelineContext(); /* in file pex/pex_pipe.c */ -extern int PEXChangeRenderer(); /* in file pex/pex_rend.c */ -extern int PEXChangeSearchContext(); /* in file pex/pex_srch.c */ -extern int PEXChangeStructureRefs(); /* in file pex/pex_stru.c */ -extern int PEXCloseFont(); /* in file pex/pex_font.c */ -extern int PEXCopyElements(); /* in file pex/pex_stru.c */ -extern int PEXCopyLookupTable(); /* in file pex/pex_lut.c */ -extern int PEXCopyNameSet(); /* in file pex/pex_ns.c */ -extern int PEXCopyPipelineContext(); /* in file pex/pex_pipe.c */ -extern int PEXCopySearchContext(); /* in file pex/pex_srch.c */ -extern int PEXCopyStructure(); /* in file pex/pex_stru.c */ -extern int PEXCreateLookupTable(); /* in file pex/pex_lut.c */ -extern int PEXCreateNameSet(); /* in file pex/pex_ns.c */ -extern int PEXCreatePhigsWks(); /* in file pex/pex_ws.c */ -extern int PEXCreatePickMeasure(); /* in file pex/pex_pick.c */ -extern int PEXCreatePipelineContext(); /* in file pex/pex_pipe.c */ -extern int PEXCreateRenderer(); /* in file pex/pex_rend.c */ -extern int PEXCreateSearchContext(); /* in file pex/pex_srch.c */ -extern int PEXCreateStructure(); /* in file pex/pex_stru.c */ -extern int PEXDeleteBetweenLabels(); /* in file pex/pex_stru.c */ -extern int PEXDeleteElements(); /* in file pex/pex_stru.c */ -extern int PEXDeleteElementsToLabel(); /* in file pex/pex_stru.c */ -extern int PEXDeleteTableEntries(); /* in file pex/pex_lut.c */ -extern int PEXDestroyLookupTable(); /* in file pex/pex_lut.c */ -extern int PEXDestroyNameSet(); /* in file pex/pex_ns.c */ -extern int PEXDestroyPhigsWks(); /* in file pex/pex_ws.c */ -extern int PEXDestroyPickMeasure(); /* in file pex/pex_pick.c */ -extern int PEXDestroyPipelineContext(); /* in file pex/pex_pipe.c */ -extern int PEXDestroyRenderer(); /* in file pex/pex_rend.c */ -extern int PEXDestroySearchContext(); /* in file pex/pex_srch.c */ -extern int PEXDestroyStructures(); /* in file pex/pex_stru.c */ -extern int PEXElementSearch(); /* in file pex/pex_stru.c */ -extern int PEXEndRendering(); /* in file pex/pex_rend.c */ -extern int PEXEndStructure(); /* in file pex/pex_rend.c */ -extern int PEXExecuteDeferredActions(); /* in file pex/pex_ws.c */ -extern int PEXFetchElements(); /* in file pex/pex_stru.c */ -extern int PEXGetAncestors(); /* in file pex/pex_stru.c */ -extern int PEXGetDefinedIndices(); /* in file pex/pex_lut.c */ -extern int PEXGetDescendants(); /* in file pex/pex_stru.c */ -extern int PEXGetDynamics(); /* in file pex/pex_ws.c */ -extern int PEXGetElementInfo(); /* in file pex/pex_stru.c */ -extern int PEXGetEnumeratedTypeInfo(); /* in file pex/pex_info.c */ -extern int PEXGetExtensionInfo(); /* in file pex/pex_info.c */ -extern int PEXGetImpDepConstants(); /* in file pex/pex_info.c */ -extern int PEXGetNameSet(); /* in file pex/pex_ns.c */ -extern int PEXGetPickDevice(); /* in file pex/pex_pick.c */ -extern int PEXGetPickMeasure(); /* in file pex/pex_pick.c */ -extern int PEXGetPipelineContext(); /* in file pex/pex_pipe.c */ -extern int PEXGetPredefinedEntries(); /* in file pex/pex_lut.c */ -extern int PEXGetRendererAttributes(); /* in file pex/pex_rend.c */ -extern int PEXGetRendererDynamics(); /* in file pex/pex_rend.c */ -extern int PEXGetSearchContext(); /* in file pex/pex_srch.c */ -extern int PEXGetStructureInfo(); /* in file pex/pex_stru.c */ -extern int PEXGetStructuresInNetwork(); /* in file pex/pex_stru.c */ -extern int PEXGetTableEntries(); /* in file pex/pex_lut.c */ -extern int PEXGetTableEntry(); /* in file pex/pex_lut.c */ -extern int PEXGetTableInfo(); /* in file pex/pex_lut.c */ -extern int PEXGetViewRep(); /* in file pex/pex_ws.c */ -extern int PEXGetWksInfo(); /* in file pex/pex_ws.c */ -extern int PEXGetWksPostings(); /* in file pex/pex_ws.c */ -extern int PEXListFonts(); /* in file pex/pex_font.c */ -extern int PEXListFontsWithInfo(); /* in file pex/pex_font.c */ -extern int PEXMapDCtoWC(); /* in file pex/pex_ws.c */ -extern int PEXMapWCtoDC(); /* in file pex/pex_ws.c */ -extern int PEXOpenFont(); /* in file pex/pex_font.c */ -extern int PEXPostStructure(); /* in file pex/pex_ws.c */ -extern int PEXQueryFont(); /* in file pex/pex_font.c */ -extern int PEXQueryTextExtents(); /* in file pex/pex_font.c */ -extern int PEXRedrawAllStructures(); /* in file pex/pex_ws.c */ -extern int PEXRenderNetwork(); /* in file pex/pex_rend.c */ -extern int PEXRenderOutputCommands(); /* in file pex/pex_rend.c */ -extern int PEXSearchNetwork(); /* in file pex/pex_srch.c */ -extern int PEXSetDisplayUpdateMode(); /* in file pex/pex_ws.c */ -extern int PEXSetEditingMode(); /* in file pex/pex_stru.c */ -extern int PEXSetElementPointer(); /* in file pex/pex_stru.c */ -extern int PEXSetElementPointerAtLabel(); /* in file pex/pex_stru.c */ -extern int PEXSetHlhsrMode(); /* in file pex/pex_ws.c */ -extern int PEXSetTableEntries(); /* in file pex/pex_lut.c */ -extern int PEXSetViewPriority(); /* in file pex/pex_ws.c */ -extern int PEXSetViewRep(); /* in file pex/pex_ws.c */ -extern int PEXSetWksViewport(); /* in file pex/pex_ws.c */ -extern int PEXSetWksWindow(); /* in file pex/pex_ws.c */ -extern int PEXStoreElements(); /* in file pex/pex_stru.c */ -extern int PEXUnpostAllStructures(); /* in file pex/pex_ws.c */ -extern int PEXUnpostStructure(); /* in file pex/pex_ws.c */ -extern int PEXUpdatePickMeasure(); /* in file pex/pex_pick.c */ -extern int PEXUpdateWorkstation(); /* in file pex/pex_ws.c */ - -#endif /* PEX_FUNCS_H */ Index: xc/programs/Xserver/PEX5/include/PEXmacs.h diff -u xc/programs/Xserver/PEX5/include/PEXmacs.h:1.2 xc/programs/Xserver/PEX5/include/PEXmacs.h:removed --- xc/programs/Xserver/PEX5/include/PEXmacs.h:1.2 Fri Dec 14 14:57:53 2001 +++ xc/programs/Xserver/PEX5/include/PEXmacs.h Sat Feb 28 21:41:56 2004 @@ -1,55 +0,0 @@ -/* $Xorg: PEXmacs.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ - -#ifndef PEX_MACS_H -#define PEX_MACS_H - -/* Useful macros. */ -#define PEX_SUPPORTS_WS(si) \ - ( !(si) || (si) & 0x2 ) - -#endif /* PEX_MACS_H */ Index: xc/programs/Xserver/PEX5/include/PEXproto.h diff -u xc/programs/Xserver/PEX5/include/PEXproto.h:1.2 xc/programs/Xserver/PEX5/include/PEXproto.h:removed --- xc/programs/Xserver/PEX5/include/PEXproto.h:1.2 Fri Dec 14 14:57:53 2001 +++ xc/programs/Xserver/PEX5/include/PEXproto.h Sat Feb 28 21:41:56 2004 @@ -1,2333 +0,0 @@ -/* $Xorg: PEXproto.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* Definitions for the PEX used by server and c bindings */ - -/* - * This packet-construction scheme makes the following assumptions: - * - * 1. The compiler is able to generate code which addresses one- and two-byte - * quantities. In the worst case, this would be done with bit-fields. If - * bit-fields are used it may be necessary to reorder the request fields in - * this file, depending on the order in which the machine assigns bit fields - * to machine words. There may also be a problem with sign extension, as K+R - * specify that bitfields are always unsigned. - * - * 2. 2- and 4-byte fields in packet structures must be ordered by hand such - * that they are naturally-aligned, so that no compiler will ever insert - * padding bytes. - * - * 3. All packets are hand-padded to a multiple of 4 bytes, for the same reason. - */ - -#ifndef PEXPROTO_H -#define PEXPROTO_H - -/* In the following typedefs, comments appear that say "LISTof Foo( numItems )", - * "CLIST of Foo()", and "SINGLE Foo()". These are used when the protocol - * specifies that a request or reply contains a variable length list of - * (possibly variable types of) objects. - * - * A LISTof list is one for which we have already been given the length. - * The items in the list are of type "Foo". The number of items in the list - * appears parenthetically after the type. ("numItems" in our example.) - * Any other information needed to parse the list is also passed in the - * parentheses. (E.g., "tableType" in a list of table entries.) - * - * A CLISTof list is the same, except that the first 4 bytes of the list - * indicate the number of items in the list. The length may need to be - * byte-swapped. - * - * A SINGLE item of an indeterminate length is indicated in the same - * manner. (E.g., a "SINGLE TableEntry()".) Any other information - * needed to parse the item is also passed in the parentheses. - * (E.g., "itemMask" in a set of pipeline context attributes.) - * - * If no information is given in the parentheses, then the size is - * implicit. - * - * Variable length padding is noted with a comment, with the number - * of bytes of padding required as calculated from the value in - * the parentheses. (number of bytes of padding = n?(3-((n-1)%4):0 , where - * n is the parenthetical value.) - */ -#include "PEXprotost.h" - -/* Matches revision 5.1C */ - -/**************************************************************** - * REPLIES * - ****************************************************************/ -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 majorVersion B16; - CARD16 minorVersion B16; - CARD32 release B32; - CARD32 lengthName B32; - CARD32 subsetInfo B32; - BYTE pad[8]; - /* LISTof CARD8 follows -- Don't swap */ - /* pad */ - } pexGetExtensionInfoReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* NOT 0; this is an extra-large reply*/ - CARD32 numLists B32; - BYTE pad[20]; /* lists of lists begin afterwards */ - /* LISTof CLISTof pexEnumTypeDesc( numLists ) */ - /* pad */ - } pexGetEnumeratedTypeInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof VALUE() */ - } pexGetImpDepConstantsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 escapeID B32; - CARD8 escape_specific[20]; - /* more escape specific data, treat as */ - /* LISTof CARD8( length ) */ - } pexEscapeWithReplyReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; - BYTE pad[24]; - /* LISTof RENDERER_TARGET( ) */ - } pexMatchRendererTargetsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 unused B16; - CARD16 definableEntries B16; - CARD16 numPredefined B16; - CARD16 predefinedMin B16; - CARD16 predefinedMax B16; - BYTE pad[14]; - } pexGetTableInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numEntries B32; - BYTE pad[16]; - /* LISTof TableEntry( numEntries, tableType ) */ - } pexGetPredefinedEntriesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numIndices B32; - BYTE pad[20]; - /* LISTof pexTableIndex( numIndices ) */ - /* pad( numIndices ) */ - } pexGetDefinedIndicesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 status B16; - CARD16 tableType B16; - BYTE pad[20]; - /* SINGLE TableEntry( tableType ) */ - } pexGetTableEntryReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 tableType B16; - CARD16 unused B16; - CARD32 numEntries B32; - BYTE pad[16]; - /* LISTof TableEntry( numEntries, tableType ) */ - } pexGetTableEntriesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 status B16; - CARD16 tableType B16; - CARD32 numValues B32; - BYTE pad[16]; - /* LISTof TableValues( numValues, tableType ) */ - } pexGetTableValuesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE PipelineContextAttributes( itemMask ) */ - } pexGetPipelineContextReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE RendererAttributes( itemMask ) */ - } pexGetRendererAttributesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numValues B16; - pexSwitch undefinedValues; - BYTE pad[19]; - /* Z buffer values go here */ -} pexGetZBufferReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - INT32 count B16; - BYTE pad[20]; -} pexNextPassReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - pexBitmask tables B32; - pexBitmask namesets B32; - pexBitmask attributes B32; - BYTE pad[12]; -} pexGetRendererDynamicsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 editMode B16; - CARD16 unused B16; - CARD32 elementPtr B32; - CARD32 numElements B32; - CARD32 lengthStructure B32; - CARD16 hasRefs B16; - BYTE pad[6]; - } pexGetStructureInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numInfo B32; - BYTE pad[20]; - /* LISTof pexElementInfo( numInfo ) */ - } pexGetElementInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD8 unused[8]; - CARD32 numStructures B32; - BYTE pad[12]; - /* LISTof pexStructure( numStructures ) */ - } pexGetStructuresInNetworkReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD8 unused[12]; - CARD32 numPaths B32; - BYTE pad[8]; - /* LISTof CLISTof pexElementRef( numPaths ) */ - } pexGetAncestorsReply; - -typedef pexGetAncestorsReply pexGetDescendantsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numElements B32; - BYTE pad[20]; - /* LISTof OutputCommand( numElements ) */ - } pexFetchElementsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 status B16; - CARD16 unused B16; - CARD32 foundOffset B32; - BYTE pad[16]; - } pexElementSearchReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numNames B32; - BYTE pad[20]; - /* LISTof pexName( numNames ) */ - } pexGetNameSetReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE SearchContextAttributes( itemMask ) */ - } pexGetSearchContextReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numItems B32; - BYTE pad[16]; - /* LISTof pexElementRef( numItems ) */ - } pexSearchNetworkReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE WksInfo( itemMask ) */ - } pexGetWksInfoReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - pexDynamicType viewRep; - pexDynamicType markerBundle; - pexDynamicType textBundle; - pexDynamicType lineBundle; - pexDynamicType interiorBundle; - pexDynamicType edgeBundle; - pexDynamicType colourTable; - pexDynamicType patternTable; - pexDynamicType wksTransform; - pexDynamicType highlightFilter; - pexDynamicType invisibilityFilter; - pexDynamicType HlhsrMode; - pexDynamicType structureModify; - pexDynamicType postStructure; - pexDynamicType unpostStructure; - pexDynamicType deleteStructure; - pexDynamicType referenceModify; - pexDynamicType bufferModify; - pexDynamicType lightTable; - pexDynamicType depthCueTable; - pexDynamicType colourApproxTable; - CARD8 pad[3]; - } pexGetDynamicsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 4 + 76*fp/4 */ - CARD16 viewUpdate B16; /* Pending, NotPending */ - BYTE pad[22]; - /* SINGLE pexViewRep() requested */ - /* SINGLE pexViewRep() current */ - } pexGetViewRepReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 viewIndex B16; - CARD16 unused B16; - CARD32 numCoords B32; - BYTE pad[16]; - /* LISTof pexCoord3D( numCoords ) */ - } pexMapDCtoWCReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numCoords B32; - BYTE pad[16]; - /* LISTof pexDeviceCoord( numCoords ) */ - } pexMapWCtoDCReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof pexPhigsWksID() */ - } pexGetWksPostingsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE PickDeviceAttributes( itemMask ) */ - } pexGetPickDeviceReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE pexPickMeasureAttributes( itemMask ) */ - } pexGetPickMeasureReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPickElRefs B32; - pexEnumTypeIndex pickStatus B16; - CARD8 betterPick; - BYTE pad[17]; - /* LISTof pexPickElementRef ( numPickElRefs ) */ - } pexEndPickOneReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPickElRefs B32; - pexEnumTypeIndex pickStatus B16; - CARD8 betterPick; - BYTE pad[17]; - /* LISTof pexPickElementRef ( numPickElRefs ) */ - } pexPickOneReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPicked B32; - pexEnumTypeIndex pickStatus B16; - pexEnumTypeIndex morePicks B16; - BYTE pad[16]; - /* LISTof CLISTof pexPickElementRef ( numPicked ) */ - } pexEndPickAllReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPicked B32; - pexEnumTypeIndex pickStatus B16; - pexEnumTypeIndex morePicks B16; - BYTE pad[16]; - /* LISTof CLISTof pexPickElementRef ( numPicked ) */ - } pexPickAllReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 lengthFontInfo B32; - CARD8 pad[20]; - /* SINGLE pexFontInfo() */ - } pexQueryFontReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numStrings B32; - BYTE pad[20]; - /* LISTof pexString( numStrings ) */ - } pexListFontsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numStrings B32; - BYTE pad[20]; - /* LISTof pexString( numStrings ) */ - /* CLISTof pexFontInfo() */ - } pexListFontsWithInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof ExtentInfo() */ - } pexQueryTextExtentsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD8 approxSupported; - CARD8 exhaustiveApprox; - CARD8 unused[2]; - CARD32 numColorApprox; - BYTE pad[16]; - /* List of pexColourApproxEntry */ -} pexQueryColorApproxReply; - -/**************************************************************** - * REQUESTS * - ****************************************************************/ -/* Request structure */ - -typedef struct { - CARD8 reqType; - CARD8 opcode; /* meaning depends on request type */ - CARD16 length B16; - /* length in 4 bytes quantities */ - /* of whole request, including this header */ -} pexReq; - -/***************************************************************** - * structures that follow request. - *****************************************************************/ - -/* ResourceReq is used for any request which has a resource ID - ( or Atom or Time ) as its one and only argument. */ - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - CARD32 id B32; /* a Structure, Renderer, Font, LUT, etc. */ - } pexResourceReq; - - -/***************************************************************** - * Specific Requests - *****************************************************************/ - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - CARD16 clientProtocolMajor B16; - CARD16 clientProtocolMinor B16; -} pexGetExtensionInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - Drawable drawable B32; - pexBitmask itemMask B32; - CARD32 numEnums B32; - /* LISTof CARD16( numEnums ) */ - /* pad( numEnums*2 ) */ -} pexGetEnumeratedTypeInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - Drawable drawable B32; - CARD32 numNames B32; - /* LISTof pexImpDepConstantNames ( numNames ) */ - /* pad */ -} pexGetImpDepConstantsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - Drawable drawable B32; - CARD8 depth; - CARD8 unused; - CARD16 type B16; - CARD32 visualID B32; - CARD32 maxTriplets B32; -} pexMatchRendererTargetsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 + n */ - CARD32 escapeID B32; - /* 4n bytes of additional escape data to skip */ -} pexEscapeReq; - -typedef pexEscapeReq pexEscapeWithReplyReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - Drawable drawableExample B32; - pexLookupTable lut B32; - pexTableType tableType B16; - CARD16 unused B16; -} pexCreateLookupTableReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexLookupTable src B32; - pexLookupTable dst B32; -} pexCopyLookupTableReq; - -typedef pexResourceReq pexFreeLookupTableReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - Drawable drawableExample B32; - pexTableType tableType B16; - CARD16 unused B16; -} pexGetTableInfoReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - Drawable drawableExample B32; - pexTableType tableType B16; - pexTableIndex start B16; - CARD16 count B16; - CARD16 pad B16; -} pexGetPredefinedEntriesReq; - -typedef pexResourceReq pexGetDefinedIndicesReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 valueType B16; - pexLookupTable lut B32; - pexTableIndex index B16; - CARD16 pad B16; -} pexGetTableEntryReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 valueType B16; - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -} pexGetTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -/* LISTof TableEntry( count ) */ -} pexSetTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - pexTableIndex index B16; - pexLookupTable lut B32; - pexBitmask TableMask; /* Lookup Table specific bitmask */ - /* Lookup Table specific list of values */ -} pexChangeTableValuesReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 valueType B16; - pexLookupTable lut B32; - pexTableIndex index B16; - CARD16 unused; - pexBitmask TableMask; /* Lookup Table specific bitmask */ -} pexGetTableValuesReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -} pexDeleteTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ - /* SINGLE PipelineContextAttributes( itemMask ) */ -} pexCreatePipelineContextReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexPC src B32; - pexPC dst B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ -} pexCopyPipelineContextReq; - -typedef pexResourceReq pexFreePipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ -} pexGetPipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ - /* SINGLE PipelineContextAttributes( itemMask ) */ -} pexChangePipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - Drawable drawable B32; - pexBitmask itemMask B32; - /* SINGLE RendererAttributes( itemMask ) */ -} pexCreateRendererReq; - -typedef pexResourceReq pexFreeRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - pexBitmask itemMask B32; - /* SINGLE RendererAttributes( itemMask ) */ -} pexChangeRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - pexBitmask itemMask B32; -} pexGetRendererAttributesReq; - -typedef pexResourceReq pexGetRendererDynamicsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable drawable B32; -} pexBeginRenderingReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexSwitch flushFlag; - BYTE pad[3]; -} pexEndRenderingReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexBitmask clearControl B32; -} pexClearRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexSwitch flushFlag; - BYTE pad[3]; -} pexFlushRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexInitRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable pixmap B32; -} pexCopyAlphaToPixmapReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable pixmap B32; -} pexCopyPixmapToAlphaReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable pixmap B32; -} pexCopyZBufferToPixmapReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable pixmap B32; -} pexCopyPixmapToZBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexRenderer rdr B32; - pexPC pc B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ -} pexCopyPCToPipelineStateReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexRenderer rdr B32; - pexPC pc B32; - pexBitmask itemMask[3]; /* pexBitmask Array */ -} pexCopyPipelineStateToPCReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - pexSwitch normalizedValues; - CARD8 unused; - pexRenderer rdr B32; - INT16 x B16; - INT16 y B16; - CARD16 width B16; - CARD16 height B16; -} pexGetZBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused; - CARD32 numValues B32; - pexRenderer rdr B32; - INT16 x B16; - INT16 y B16; - CARD16 width B16; - CARD16 height B16; - pexSwitch normalizedValues; - CARD8 more_unused[3]; - /* Z buffer values go here */ -} pexPutZBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexInitMultipassReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; - CARD16 multipass_control; - CARD16 unused; -} pexNextPassReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexStructure sid B32; -} pexBeginStructureReq; - -typedef pexResourceReq pexEndStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - CARD32 numCommands B32; - /* LISTof OutputCommand( numCommands ) */ -} pexRenderOutputCommandsReq; -/* individual output commands may be found in the section "Output Commands" */ - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexRenderer rdr B32; - pexStructure sid B32; - pexElementRange range; -} pexRenderElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 + 2n */ - pexRenderer rdr B32; - CARD32 numElRefs B32; - /* LISTof pexElementRef( numElRefs ) */ -} pexAccumulateStateReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexRenderer rdr B32; - Drawable drawable B32; - pexStructure sid B32; -} pexRenderNetworkReq; - -typedef pexResourceReq pexCreateStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure src B32; - pexStructure dst B32; -} pexCopyStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 numStructures B32; - /* LISTof pexStructure( numStructures ) */ -} pexDestroyStructuresReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexEnumTypeIndex fpFormat B16; - CARD16 itemMask B16; - pexStructure sid B32; -} pexGetStructureInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure sid B32; - CARD16 permission B16; - CARD16 unused B16; -} pexSetStructurePermissionReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - pexElementRange range; -} pexGetElementInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure sid B32; - CARD16 which B16; - CARD16 pad B16; -} pexGetStructuresInNetworkReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - CARD16 pathOrder B16; - CARD16 unused B16; - CARD32 pathDepth B32; -} pexGetAncestorsReq; - -typedef pexGetAncestorsReq pexGetDescendantsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - pexElementRange range; -} pexFetchElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure sid B32; - CARD16 mode B16; - CARD16 pad B16; -} pexSetEditingModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - pexElementPos position; -} pexSetElementPointerReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - INT32 label B32; - INT32 offset B32; -} pexSetElementPointerAtLabelReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - INT32 pickId B32; - INT32 offset B32; -} pexSetElementPointerAtPickIDReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexStructure sid B32; - pexElementPos position; - CARD32 direction B32; - CARD32 numIncls B32; - CARD32 numExcls B32; - /* LISTof CARD16( numIncls ) */ - /* pad( numIncls*2 ) */ - /* LISTof CARD16( numExcls ) */ - /* pad( numExcls*2 ) */ -} pexElementSearchReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - CARD32 numCommands B32; - /* LISTof OutputCommand( numCommands ) */ -} pexStoreElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexStructure sid B32; - pexElementRange range; -} pexDeleteElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexStructure sid B32; - pexElementPos position; - INT32 label B32; -} pexDeleteElementsToLabelReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - INT32 label1 B32; - INT32 label2 B32; -} pexDeleteBetweenLabelsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 9 */ - pexStructure src B32; - pexElementRange srcRange; - pexStructure dst B32; - pexElementPos dstPosition; -} pexCopyElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure old_id B32; - pexStructure new_id B32; -} pexChangeStructureRefsReq; - -typedef pexResourceReq pexCreateNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexNameSet src B32; - pexNameSet dst B32; -} pexCopyNameSetReq; - -typedef pexResourceReq pexFreeNameSetReq; - -typedef pexResourceReq pexGetNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexNameSet ns B32; - CARD16 action B16; - CARD16 unused B16; - /* LISTof pexName() */ -} pexChangeNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; - /* SINGLE SearchContextAttributes( itemMask ) */ -} pexCreateSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexSC src B32; - pexSC dst B32; - pexBitmask itemMask B32; -} pexCopySearchContextReq; - -typedef pexResourceReq pexFreeSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; -} pexGetSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; - /* SINGLE SearchContextAttributes( itemMask ) */ -} pexChangeSearchContextReq; - -typedef pexResourceReq pexSearchNetworkReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 19 */ - pexPhigsWks wks B32; - Drawable drawable B32; - pexLookupTable markerBundle B32; - pexLookupTable textBundle B32; - pexLookupTable lineBundle B32; - pexLookupTable interiorBundle B32; - pexLookupTable edgeBundle B32; - pexLookupTable colourTable B32; - pexLookupTable depthCueTable B32; - pexLookupTable lightTable B32; - pexLookupTable colourApproxTable B32; - pexLookupTable patternTable B32; - pexLookupTable textFontTable B32; - pexNameSet highlightIncl B32; - pexNameSet highlightExcl B32; - pexNameSet invisIncl B32; - pexNameSet invisExcl B32; - CARD16 bufferMode B16; - CARD16 pad B16; -} pexCreatePhigsWksReq; - -typedef pexResourceReq pexFreePhigsWksReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexBitmask itemMask[2] B32; -} pexGetWksInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - Drawable drawable B32; -} pexGetDynamicsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexEnumTypeIndex fpFormat B16; - pexTableIndex index B16; - pexPhigsWks wks B32; -} pexGetViewRepReq; - -typedef pexResourceReq pexRedrawAllStructuresReq; - -typedef pexResourceReq pexUpdateWorkstationReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexPhigsWks wks B32; - CARD32 numRects B32; - /* LISTof pexDeviceRect( numRects ) */ -} pexRedrawClipRegionReq; - -typedef pexResourceReq pexExecuteDeferredActionsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexPhigsWks wks B32; - pexTableIndex index1 B16; - pexTableIndex index2 B16; - CARD16 priority B16; - CARD16 pad B16; -} pexSetViewPriorityReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexEnumTypeIndex displayUpdate B16; - CARD16 pad B16; -} pexSetDisplayUpdateModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - CARD32 numCoords B32; - /* LISTof pexDeviceCoord( numCoords ) */ -} pexMapDCtoWCReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 index B16; - pexPhigsWks wks B32; - CARD32 numCoords B32; - /* LISTof pexCoord3D( numCoords ) */ -} pexMapWCtoDCReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 43 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexViewRep viewRep; -} pexSetViewRepReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 9 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexNpcSubvolume npcSubvolume; -} pexSetWksWindowReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 8 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexViewport viewport; -} pexSetWksViewportReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexEnumTypeIndex mode B16; - CARD16 pad B16; -} pexSetHlhsrModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - CARD16 bufferMode B16; - CARD16 pad B16; -} pexSetWksBufferModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexStructure sid B32; - PEXFLOAT priority; -} pexPostStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexStructure sid B32; -} pexUnpostStructureReq; - -typedef pexResourceReq pexUnpostAllStructuresReq; - -typedef pexResourceReq pexGetWksPostingsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex devType B16; - pexPhigsWks wks B32; - pexBitmask itemMask B32; -} pexGetPickDeviceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexEnumTypeIndex devType B16; - CARD16 unused2 B16; - pexBitmask itemMask B32; - /* SINGLE PickDeviceAttributes( itemMask ) */ -} pexChangePickDeviceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexPhigsWks wks B32; - pexPickMeasure pm; - pexEnumTypeIndex devType B16; - CARD16 pad B16; -} pexCreatePickMeasureReq; - -typedef pexResourceReq pexFreePickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPickMeasure pm B32; - pexBitmask itemMask B32; -} pexGetPickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexPickMeasure pm B32; - CARD32 numBytes B32; - /* LISTof CARD8( numBytes ) */ - /* pad( numBytes ) */ -} pexUpdatePickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - INT32 sid B32; - /* SINGLE PickRecord () */ -} pexBeginPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexEndPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - pexStructure sid B32; - /* SINGLE PickRecord () */ -} pexPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - CARD8 sendEvent; - CARD8 unused[3]; - pexRenderer rdr B32; - Drawable drawable B32; - INT32 sid B32; - CARD32 pickMaxHits B32; - /* SINGLE PickRecord () */ -} pexBeginPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexEndPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - CARD32 pickMaxHits B32; - /* SINGLE RendererPickRecord () */ -} pexPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexFont font B32; - CARD32 numBytes B32; - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexOpenFontReq; - -typedef pexResourceReq pexCloseFontReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexFont font B32; -} pexQueryFontReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD16 maxNames B16; - CARD16 numChars B16; - /* LISTof CARD8( numChars ) -- don't swap */ - /* pad( numBytes ) */ -} pexListFontsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD16 unused B16; - CARD16 maxNames B16; - CARD16 numChars B16; - CARD16 pad B16; - /* LISTof CARD8( numChars ) */ - /* pad( numBytes ) */ -} pexListFontsWithInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 textPath B16; - pexTableIndex fontGroupIndex B16; - CARD16 unused B16; - XID id B32; /* renderer, wks, or text font lut */ - PEXFLOAT charExpansion; - PEXFLOAT charSpacing; - PEXFLOAT charHeight; - pexTextAlignmentData textAlignment; - CARD32 numStrings B32; - /* LISTof LISTof MONO_ENCODINGS() */ - /* pad() */ -} pexQueryTextExtentsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused; - Drawable drawable B32; - pexColourApproxEntry ColourApprox; -} pexQueryColorApproxReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex TMDimension B16; - CARD32 TMid B32; - CARD16 numLevels B16; - pexEnumTypeIndex texelType B16; - /* list of array of Texels goes here */ -} pexCreateColorMipMapTMReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex TMDimension B16; - CARD32 TMid B32; - CARD16 numLevels B16; - pexEnumTypeIndex texelType B16; - Drawable drawable B32; - CARD16 lumnanceSelector B16; - CARD16 alphaSelector B16; - /* list of texel array counts - list of color resource IDs - list of alpha resource IDs - */ -} pexCreateColorMipMapfromResReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex unused B16; - Drawable drawable B32; - PEXFLOAT src_weight; - PEXFLOAT dst_weight; -} pexAccumulateBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - Drawable drawable B32; -} pexAllocAccumBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - Drawable drawable B32; -} pexFreeAccumBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - Drawable drawable B32; -} pexLoadAccumBufferReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex unused B16; - Drawable drawable B32; - PEXFLOAT scale; -} pexReturnAccumBufferReq; - -/***************************************************************** - * Output Commands - *****************************************************************/ - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex markerType B16; - CARD16 pad B16; -} pexMarkerType; - -typedef struct { - pexElementInfo head; - PEXFLOAT scale; -} pexMarkerScale; - -typedef struct { - pexElementInfo head; - pexTableIndex index B16; - CARD16 pad B16; -} pexMarkerBundleIndex; - -typedef pexMarkerBundleIndex pexMarkerColourIndex; -typedef pexMarkerBundleIndex pexTextColourIndex; -typedef pexMarkerBundleIndex pexLineColourIndex; -typedef pexMarkerBundleIndex pexSurfaceColourIndex; -typedef pexMarkerBundleIndex pexBfSurfaceColourIndex; -typedef pexMarkerBundleIndex pexSurfaceEdgeColourIndex; - -typedef pexMarkerBundleIndex pexTextFontIndex; - -typedef struct { - pexElementInfo head; - pexColourSpecifier colourSpec; - /* SINGLE COLOUR() */ -} pexMarkerColour; - -typedef pexMarkerColour pexTextColour; -typedef pexMarkerColour pexLineColour; -typedef pexMarkerColour pexSurfaceColour; -typedef pexMarkerColour pexBfSurfaceColour; -typedef pexMarkerColour pexSurfaceEdgeColour; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex style B16; - CARD16 pad B16; -} pexAtextStyle; - -typedef pexMarkerBundleIndex pexTextBundleIndex; -typedef pexMarkerBundleIndex pexLineBundleIndex; -typedef pexMarkerBundleIndex pexInteriorBundleIndex; -typedef pexMarkerBundleIndex pexInteriorStyleIndex; -typedef pexMarkerBundleIndex pexBfInteriorStyleIndex; -typedef pexMarkerBundleIndex pexEdgeBundleIndex; -typedef pexMarkerBundleIndex pexViewIndex; -typedef pexMarkerBundleIndex pexDepthCueIndex; -typedef pexMarkerBundleIndex pexColourApproxIndex; - -typedef struct { - pexElementInfo head; - CARD16 precision B16; - CARD16 pad B16; -} pexTextPrecision; - -typedef struct { - pexElementInfo head; - PEXFLOAT expansion; -} pexCharExpansion; - -typedef struct { - pexElementInfo head; - PEXFLOAT spacing; -} pexCharSpacing; - -typedef struct { - pexElementInfo head; - PEXFLOAT height; -} pexCharHeight; -typedef pexCharHeight pexAtextHeight; - -typedef struct { - pexElementInfo head; - pexVector2D up; -} pexCharUpVector; -typedef pexCharUpVector pexAtextUpVector; - -typedef struct { - pexElementInfo head; - CARD16 path B16; - CARD16 pad B16; -} pexTextPath; -typedef pexTextPath pexAtextPath; - -typedef struct { - pexElementInfo head; - pexTextAlignmentData alignment; -} pexTextAlignment; -typedef pexTextAlignment pexAtextAlignment; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex lineType B16; - CARD16 pad B16; -} pexLineType; - -typedef struct { - pexElementInfo head; - PEXFLOAT width; -} pexLineWidth; -typedef pexLineWidth pexSurfaceEdgeWidth; - -typedef struct { - pexElementInfo head; - pexCurveApprox approx; -} pexCurveApproximation; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex polylineInterp B16; - CARD16 pad B16; -} pexPolylineInterp; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex interiorStyle B16; - CARD16 pad B16; -} pexInteriorStyle; -typedef pexInteriorStyle pexBfInteriorStyle; - -typedef struct { - pexElementInfo head; - pexReflectionAttr reflectionAttr; -} pexSurfaceReflAttr; -typedef pexSurfaceReflAttr pexBfSurfaceReflAttr; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex reflectionModel B16; - CARD16 pad B16; -} pexSurfaceReflModel; -typedef pexSurfaceReflModel pexBfSurfaceReflModel; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex surfaceInterp B16; - CARD16 pad B16; -} pexSurfaceInterp; -typedef pexSurfaceInterp pexBfSurfaceInterp; - -typedef struct { - pexElementInfo head; - pexSurfaceApprox approx; -} pexSurfaceApproximation; - -typedef struct { - pexElementInfo head; - pexCullMode cullMode B16; - CARD16 pad B16; -} pexCullingMode; - -typedef struct { - pexElementInfo head; - pexSwitch distinguish; - BYTE pad[3]; -} pexDistinguishFlag; - -typedef struct { - pexElementInfo head; - pexVector2D size; -} pexPatternSize; - -typedef struct { - pexElementInfo head; - pexCoord2D point; -} pexPatternRefPt; - -typedef struct { - pexElementInfo head; - pexCoord3D refPt; - pexVector3D vector1; - pexVector3D vector2; -} pexPatternAttr; - -typedef struct { - pexElementInfo head; - pexSwitch onoff; - BYTE pad[3]; -} pexSurfaceEdgeFlag; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex edgeType B16; - CARD16 pad B16; -} pexSurfaceEdgeType; - -typedef struct { - pexElementInfo head; - pexAsfAttribute attribute B32; - pexAsfValue source; - BYTE pad[3]; -} pexSetAsfValues; - -typedef struct { - pexElementInfo head; - pexComposition compType; - CARD16 unused B16; - pexMatrix matrix; -} pexLocalTransform; - -typedef struct { - pexElementInfo head; - pexComposition compType; - CARD16 unused B16; - pexMatrix3X3 matrix3X3; -} pexLocalTransform2D; - -typedef struct { - pexElementInfo head; - pexMatrix matrix; -} pexGlobalTransform; - -typedef struct { - pexElementInfo head; - pexMatrix3X3 matrix3X3; -} pexGlobalTransform2D; - -typedef struct { - pexElementInfo head; - pexSwitch onoff; - BYTE pad[3]; -} pexModelClip; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex modelClipOperator B16; - CARD16 numHalfSpaces B16; - /* LISTof pexHalfSpace( numHalfSpaces ) */ -} pexModelClipVolume; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex modelClipOperator B16; - CARD16 numHalfSpaces B16; - /* LISTof pexHalfSpace2D( numHalfSpaces ) */ -} pexModelClipVolume2D; - -typedef struct { - pexElementInfo head; -} pexRestoreModelClip; - -typedef struct { - pexElementInfo head; - CARD16 numEnable B16; - CARD16 numDisable B16; - /* LISTof pexTableIndex( numEnable ) */ - /* pad( ( numEnable )*2 ) */ - /* LISTof pexTableIndex( numDisable ) */ - /* pad( ( numDisable )*2 ) */ -} pexLightState; - -typedef struct { - pexElementInfo head; - CARD32 pickId B32; -} pexPickId; - -typedef struct { - pexElementInfo head; - CARD32 hlhsrID B32; -} pexHlhsrIdentifier; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex model B16; - CARD16 pad B16; -} pexRenderingColourModel; - -typedef struct { - pexElementInfo head; - pexEnumTypeIndex characteristics B16; - CARD16 length B16; - /* SINGLEof PARAMETRIC_SURFACE_CHARACTERISTICS */ -} pexParaSurfCharacteristics; - -typedef struct { - pexElementInfo head; - /* LISTof pexName() */ -} pexAddToNameSet; -typedef pexAddToNameSet pexRemoveFromNameSet; - -typedef struct { - pexElementInfo head; - pexStructure id B32; -} pexExecuteStructure; - -typedef struct { - pexElementInfo head; - INT32 label B32; -} pexLabel; - -typedef struct { - pexElementInfo head; - CARD16 numElements B16; - CARD16 unused B16; - /* LISTof CARD8( numElements ) -- don't swap */ - /* pad( numElements ) */ -} pexApplicationData; - -typedef struct { - pexElementInfo head; - CARD32 id B32; - CARD16 numElements B16; - CARD16 unused B16; - /* LISTof CARD8( numElements ) -- don't swap */ - /* pad( numElements ) */ -} pexGse; - -typedef struct { - pexElementInfo head; - /* LISTof pexCoord3D() */ -} pexMarker; - -typedef struct { - pexElementInfo head; - /* LISTof pexCoord2D() */ -} pexMarker2D; - -typedef struct { - pexElementInfo head; - pexCoord3D origin; - pexVector3D vector1; - pexVector3D vector2; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexText; - -typedef struct { - pexElementInfo head; - pexCoord2D origin; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexText2D; - -typedef struct { - pexElementInfo head; - pexCoord3D origin; - pexCoord3D offset; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexAnnotationText; - -typedef struct { - pexElementInfo head; - pexCoord2D origin; - pexCoord2D offset; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexAnnotationText2D; - -typedef struct { - pexElementInfo head; - /* LISTof pexCoord3D() */ -} pexPolyline; - -typedef struct { - pexElementInfo head; - /* LISTof pexCoord2D() */ -} pexPolyline2D; - -typedef struct { - pexElementInfo head; - pexColourType colourType B16; - pexBitmaskShort vertexAttribs B16; - CARD32 numLists B32; - /* LISTof CLISTof pexVertex( numLists, vertexAttribs, colourType ) */ -} pexPolylineSet; - -typedef struct { - pexElementInfo head; - CARD16 curveOrder B16; - pexCoordType coordType B16; - PEXFLOAT tmin; - PEXFLOAT tmax; - CARD32 numKnots B32; - CARD32 numPoints B32; - /* LISTof FLOAT( numKnots ) */ - /* LISTof {pexCoord3D|pexCoord4D}( numPoints, coordType ) */ -} pexNurbCurve; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 pad; - /* LISTof pexCoord3D() */ -} pexFillArea; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 unused; - /* LISTof pexCoord2D() */ -} pexFillArea2D; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 unused; - pexColourType colourType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused2 B16; - /* SINGLE Facet( facetAttribs, vertexAttribs, colourType ) */ -} pexExtFillArea; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - CARD32 numLists B32; - /* LISTof CLISTof Coord3D( numLists ) */ -} pexFillAreaSet; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - CARD32 numLists B32; - /* LISTof CLISTof Coord2D( numLists ) */ -} pexFillAreaSet2D; - - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - pexColourType colourType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused2 B16; - CARD32 numLists B32; - /* pexOptData( facetAttribs ) */ - /* LISTof CLISTof pexVertex( numLists, vertexAttribs, colourType ) */ -} pexExtFillAreaSet; - -typedef struct { - pexElementInfo head; - pexColourType colourType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused B16; - CARD32 numVertices B32; - /* number of OptData is numVert - 2 */ - /* LISTof pexOptData( facetAttribs, colourType ) */ - /* LISTof pexVertex( numVertices, vertexAttribs, colourType ) */ -} pexTriangleStrip; - -typedef struct { - pexElementInfo head; - pexColourType colourType B16; - CARD16 mPts B16; - CARD16 nPts B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 shape B16; - /* actually, there are (mPts-1)*(nPts-1) opt data entries */ - /* LISTof pexOptData( facetAttribs, colourType ) */ - /* LISTof pexVertex( mPts, nPts, vertexAttribs, colourType ) */ -} pexQuadrilateralMesh; - -typedef struct { - pexElementInfo head; - CARD16 shape B16; - pexColourType colourType B16; - CARD16 FAS_Attributes B16; - CARD16 vertexAttributes B16; - CARD16 edgeAttributes B16; - CARD8 contourHint; - pexSwitch contourCountsFlag; - CARD16 numFAS B16; - CARD16 numVertices B16; - CARD16 numEdges B16; - CARD16 numContours B16; - /* LISTof OPT_DATA( numFAS ) */ - /* LISTof pexVertex( numVertices ) */ - /* LISTof CARD8( numEdges ) */ - /* pad( numEdges ) */ - /* LISTof CLISTof CLISTof CARD16( numFAS, numContours, numEdges ) */ - /* pad */ -} pexSOFAS; - -typedef struct { - pexElementInfo head; - pexCoordType type B16; - CARD16 uOrder B16; - CARD16 vOrder B16; - CARD16 unused B16; - CARD32 numUknots B32; - CARD32 numVknots B32; - CARD16 mPts B16; - CARD16 nPts B16; - CARD32 numLists B32; - /* LISTof FLOAT( numUknots ) */ - /* LISTof FLOAT( numVKnots ) */ - /* LISTof {pexCoord3D|pexCoord4D}( mPts, nPts, surfaceType ) */ - /* LISTof CLISTof pexTrimCurve( numLists ) */ -} pexNurbSurface; - -typedef struct { - pexElementInfo head; - pexCoord3D point1; - pexCoord3D point2; - pexCoord3D point3; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexTableIndex( dx, dy ) */ - /* pad( 2*dx*dy ) */ -} pexCellArray; - -typedef struct { - pexElementInfo head; - pexCoord2D point1; - pexCoord2D point2; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexTableIndex( dx, dy ) */ - /* pad( 2*dx*dy ) */ -} pexCellArray2D; - -typedef struct { - pexElementInfo head; - pexColourType colourType B16; - CARD16 unused B16; - pexCoord3D point1; - pexCoord3D point2; - pexCoord3D point3; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexColourSpecifier( dx, dy ) */ -} pexExtCellArray; - -typedef struct { - pexElementInfo head; - INT32 gdpId B32; - CARD32 numPoints B32; - CARD32 numBytes B32; - /* LISTof pexCoord3D( numPoints ) */ - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexGdp; - -typedef struct { - pexElementInfo head; - INT32 gdpId B32; - CARD32 numPoints B32; - CARD32 numBytes B32; - /* LISTof pexCoord2D( numPoints ) */ - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexGdp2D; - -typedef struct { - pexElementInfo head; -} pexNoop; - -/**************************************************************** - * EVENTS * - ****************************************************************/ -/* Event structure */ - -typedef struct { - BYTE type; /* X_Event */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 rdr B32; - BYTE pad[24]; -} pexMaxHitsReachedEvent; - -#endif /* PEXPROTO_H */ - Index: xc/programs/Xserver/PEX5/include/PEXprotost.h diff -u xc/programs/Xserver/PEX5/include/PEXprotost.h:1.2 xc/programs/Xserver/PEX5/include/PEXprotost.h:removed --- xc/programs/Xserver/PEX5/include/PEXprotost.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/PEXprotost.h Sat Feb 28 21:41:56 2004 @@ -1,612 +0,0 @@ -/* $Xorg: PEXprotost.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEXPROTOSTR_H -#define PEXPROTOSTR_H - -/* Matches revision 5.1C */ - -#include /* defines things like CARD32 */ - - -/* This is FLOAT as defined and used by the Protocol Encoding */ -typedef float PEXFLOAT; - - -typedef CARD32 pexAsfAttribute; -typedef CARD8 pexAsfValue; -typedef CARD32 pexBitmask; -typedef CARD16 pexBitmaskShort; -typedef CARD16 pexCoordType; /* rational, nonrational */ -typedef CARD16 pexComposition; -typedef CARD16 pexCullMode; -typedef BYTE pexDynamicType; -typedef INT16 pexEnumTypeIndex; -typedef XID pexLookupTable; -typedef CARD32 pexName; -typedef XID pexNameSet; -typedef XID pexPC; -typedef XID pexFont; -typedef PEXFLOAT pexMatrix[4][4]; -typedef PEXFLOAT pexMatrix3X3[3][3]; -typedef XID pexPhigsWks; -typedef XID pexPickMeasure; -typedef XID pexRenderer; -typedef XID pexSC; -typedef XID pexStructure; -typedef CARD8 pexSwitch; -typedef CARD16 pexTableIndex; -typedef CARD16 pexTableType; /* could be smaller if it ever helps */ -typedef CARD16 pexTextHAlignment; -typedef CARD16 pexTextVAlignment; -typedef CARD16 pexTypeOrTableIndex; -typedef pexEnumTypeIndex pexColourType; /* ColourType */ - -/* included in others */ -typedef struct { - CARD16 length B16; - /* list of CARD8 -- don't swap */ -} pexString; - -typedef struct { - pexStructure sid B32; - PEXFLOAT priority; -} pexStructureInfo; - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; -} pexVector2D; - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; - PEXFLOAT z; -} pexVector3D; - -/* Coord structures */ - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; -} pexCoord2D; - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; - PEXFLOAT z; -} pexCoord3D; - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; - PEXFLOAT z; - PEXFLOAT w; -} pexCoord4D; - - -/* Colour structures */ -typedef struct { - PEXFLOAT red; - PEXFLOAT green; - PEXFLOAT blue; -} pexRgbFloatColour; - -typedef struct { - PEXFLOAT hue; - PEXFLOAT saturation; - PEXFLOAT value; -} pexHsvColour; - -typedef struct { - PEXFLOAT hue; - PEXFLOAT lightness; - PEXFLOAT saturation; -} pexHlsColour; - -typedef struct { - PEXFLOAT x; - PEXFLOAT y; - PEXFLOAT z; -} pexCieColour; - -typedef struct { - CARD8 red; - CARD8 green; - CARD8 blue; - CARD8 pad; -} pexRgb8Colour; - -typedef struct { - CARD16 red B16; - CARD16 green B16; - CARD16 blue B16; - CARD16 pad B16; -} pexRgb16Colour; - -typedef struct { - pexTableIndex index B16; - CARD16 pad B16; -} pexIndexedColour; - -typedef struct { - union { - pexIndexedColour indexed; - pexRgb8Colour rgb8; - pexRgb16Colour rgb16; - pexRgbFloatColour rgbFloat; - pexHsvColour hsvFloat; - pexHlsColour hlsFloat; - pexCieColour cieFloat; - } format; -} pexColour; - -typedef struct { - PEXFLOAT first; - PEXFLOAT second; - PEXFLOAT third; -} pexFloatColour; - -typedef struct { - pexColourType colourType B16; /* ColourType enumerated type */ - CARD16 unused B16; - /* SINGLE COLOUR(colourType) */ -} pexColourSpecifier; - - -typedef struct { - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT tolerance; -} pexCurveApprox; - -typedef struct { - INT16 x B16; - INT16 y B16; - PEXFLOAT z; -} pexDeviceCoord; - -typedef struct { - INT16 x B16; - INT16 y B16; -} pexDeviceCoord2D; - -typedef struct { - INT16 xmin B16; - INT16 ymin B16; - INT16 xmax B16; - INT16 ymax B16; -} pexDeviceRect; - -typedef struct { - CARD16 elementType B16; - CARD16 length B16; -} pexElementInfo; - -typedef struct { - CARD16 whence B16; - CARD16 unused B16; - INT32 offset B32; -} pexElementPos; - -typedef struct { - pexElementPos position1; - pexElementPos position2; -} pexElementRange; - -typedef struct { - pexStructure structure B32; - CARD32 offset B32; -} pexElementRef; - -typedef struct { - pexCoord2D lowerLeft; - pexCoord2D upperRight; - pexCoord2D concatpoint; -} pexExtentInfo; - -typedef struct { - pexEnumTypeIndex index B16; - pexString descriptor; -} pexEnumTypeDesc; - -typedef struct { - pexCoord3D point; - pexVector3D vector; -} pexHalfSpace; - -typedef struct { - pexNameSet incl; - pexNameSet excl; -} pexNameSetPair; - -typedef struct { - pexCoord2D point; - pexVector2D vector; -} pexHalfSpace2D; - -typedef struct { - CARD16 composition B16; - CARD16 unused B16; - pexMatrix matrix; -} pexLocalTransform3DData; - -typedef struct { - CARD16 composition B16; - CARD16 unused B16; - pexMatrix3X3 matrix; -} pexLocalTransform2DData; - -typedef struct { - pexCoord3D minval; - pexCoord3D maxval; -} pexNpcSubvolume; - -/* an OPT_DATA structure cannot be defined because it has variable content - * and size. An union structure could be used to define a template for - * the data. However, since unions pad to a fixed amount of space and the - * protocol uses variable lengths, this is not appropriate for protocol - * data types. The most correct way of defining this data is to define - * one data structure for every possible combination of color, normal and - * edge data that could be given with a vertex or facet. - */ - -typedef struct { - pexStructure sid B32; - CARD32 offset B32; - CARD32 pickid B32; -} pexPickElementRef; - -/* pexPickPath is the old name of the above strucutre. - This is wrong, since the above is a Pick Element Ref - a Pick Path is a list of Pick Element Refs so naming - this structure pexPickPath was wrong, but it can't just - be changed without effecting lots of other code....... */ - -typedef pexPickElementRef pexPickPath; - -typedef struct { - pexTextVAlignment vertical B16; - pexTextHAlignment horizontal B16; -} pexTextAlignmentData; - -typedef struct { - pexSwitch visibility; - CARD8 unused; - CARD16 order B16; - pexCoordType type B16; - INT16 approxMethod B16; - PEXFLOAT tolerance; - PEXFLOAT tMin; - PEXFLOAT tMax; - CARD32 numKnots B32; - CARD32 numCoord B32; - /* LISTof FLOAT(numKnots) -- length = order + number of coords */ - /* LISTof {pexCoord3D|pexCoord4D}(numCoord) */ -} pexTrimCurve; - -typedef struct { - CARD8 depth; - CARD8 unused; - CARD16 type B16; - CARD32 visualID B32; -} pexRendererTarget; - -typedef struct { - pexEnumTypeIndex pickType B16; - CARD16 unused; - /* SINGLE HITBOX() */ -} pexPickRecord; - -typedef struct { - PEXFLOAT ambient; - PEXFLOAT diffuse; - PEXFLOAT specular; - PEXFLOAT specularConc; - PEXFLOAT transmission; /* 0.0 = opaque, 1.0 = transparent */ - pexColourSpecifier specularColour; - /* SINGLE COLOUR() */ -} pexReflectionAttr; - -typedef struct { - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT uTolerance; - PEXFLOAT vTolerance; -} pexSurfaceApprox; - - -typedef struct { - pexCoord3D point; - /* SINGLE OPT_DATA() */ -} pexVertex; - - -typedef struct { - pexDeviceCoord minval; - pexDeviceCoord maxval; - pexSwitch useDrawable; - BYTE pad[3]; -} pexViewport; - -typedef struct { - CARD16 clipFlags B16; - CARD16 unused B16; - pexNpcSubvolume clipLimits; - pexMatrix orientation; - pexMatrix mapping; -} pexViewEntry; - -typedef struct { - pexTableIndex index B16; - CARD16 unused B16; - pexViewEntry view; -} pexViewRep; - -/* - * typedefs for lookup tables - */ - -typedef struct { - CARD16 definableEntries B16; - CARD16 numPredefined B16; - CARD16 predefinedMin B16; - CARD16 predefinedMax B16; -} pexTableInfo; - -typedef struct { - pexEnumTypeIndex lineType B16; - pexEnumTypeIndex polylineInterp B16; - pexCurveApprox curveApprox; - PEXFLOAT lineWidth; - pexColourSpecifier lineColour; - /* SINGLE COLOUR() */ -} pexLineBundleEntry; - -typedef struct { - pexEnumTypeIndex markerType B16; - INT16 unused B16; - PEXFLOAT markerScale; - pexColourSpecifier markerColour; - /* SINGLE COLOUR() */ -} pexMarkerBundleEntry; - -typedef struct { - CARD16 textFontIndex B16; - CARD16 textPrecision B16; - PEXFLOAT charExpansion; - PEXFLOAT charSpacing; - pexColourSpecifier textColour; - /* SINGLE COLOUR() */ -} pexTextBundleEntry; - - -/* - Note that since an InteriorBundleEntry contains 4 embedded instances of - pexColourSpecifier, a variable-sized item, a data structure cannot be - defined for it. -*/ -typedef struct { - pexEnumTypeIndex interiorStyle B16; - INT16 interiorStyleIndex B16; - pexEnumTypeIndex reflectionModel B16; - pexEnumTypeIndex surfaceInterp B16; - pexEnumTypeIndex bfInteriorStyle B16; - INT16 bfInteriorStyleIndex B16; - pexEnumTypeIndex bfReflectionModel B16; - pexEnumTypeIndex bfSurfaceInterp B16; - pexSurfaceApprox surfaceApprox; - /* SINGLE pexColourSpecifier surfaceColour */ - /* SINGLE pexReflectionAttr reflectionAttr */ - /* SINGLE pexColourSpecifier bfSurfaceColour */ - /* SINGLE pexReflectionAttr bfReflectionAttr */ -} pexInteriorBundleEntry; - -typedef struct { - pexSwitch edges; - CARD8 unused; - pexEnumTypeIndex edgeType B16; - PEXFLOAT edgeWidth; - pexColourSpecifier edgeColour; - /* SINGLE COLOUR() */ -} pexEdgeBundleEntry; - -typedef struct { - pexColourType colourType B16; - CARD16 numx B16; - CARD16 numy B16; - CARD16 unused B16; - /* LISTof Colour(numx, numy) 2D array of colours */ -} pexPatternEntry; - -/* a pexColourEntry is just a pexColourSpecifier -*/ - -typedef struct { - CARD32 numFonts B32; - /* LISTof pexFont( numFonts ) */ -} pexTextFontEntry; - -/* a pexViewEntry is defined above */ - -typedef struct { - pexEnumTypeIndex lightType B16; - INT16 unused B16; - pexVector3D direction; - pexCoord3D point; - PEXFLOAT concentration; - PEXFLOAT spreadAngle; - PEXFLOAT attenuation1; - PEXFLOAT attenuation2; - pexColourSpecifier lightColour; - /* SINGLE COLOUR() */ -} pexLightEntry; - -typedef struct { - pexSwitch mode; - CARD8 unused; - CARD16 unused2 B16; - PEXFLOAT frontPlane; - PEXFLOAT backPlane; - PEXFLOAT frontScaling; - PEXFLOAT backScaling; - pexColourSpecifier depthCueColour; - /* SINGLE COLOUR() */ -} pexDepthCueEntry; - -typedef struct { - INT16 approxType; - INT16 approxModel; - CARD16 max1 B16; - CARD16 max2 B16; - CARD16 max3 B16; - CARD8 dither; - CARD8 unused; - CARD32 mult1 B32; - CARD32 mult2 B32; - CARD32 mult3 B32; - PEXFLOAT weight1; - PEXFLOAT weight2; - PEXFLOAT weight3; - CARD32 basePixel B32; -} pexColourApproxEntry; - - -/* Font structures */ - -typedef struct { - Atom name B32; - CARD32 value B32; -} pexFontProp; - -typedef struct { - CARD32 firstGlyph B32; - CARD32 lastGlyph B32; - CARD32 defaultGlyph B32; - pexSwitch allExist; - pexSwitch strokeFont; - CARD16 unused B16; - CARD32 numProps B32; - /* LISTof pexFontProp(numProps) */ -} pexFontInfo; - - -/* Text Structures */ - -typedef struct { - INT16 characterSet B16; - CARD8 characterSetWidth; - CARD8 encodingState; - CARD16 unused B16; - CARD16 numChars; - /* LISTof CHARACTER( numChars ) */ - /* pad */ -} pexMonoEncoding; - -/* CHARACTER is either a CARD8, a CARD16, or a CARD32 */ - - -/* Parametric Surface Characteristics types */ - -/* type 1 None */ - -/* type 2 Implementation Dependent */ - -typedef struct { - CARD16 placementType B16; - CARD16 unused B16; - CARD16 numUcurves B16; - CARD16 numVcurves B16; -} pexPSC_IsoparametricCurves; /* type 3 */ - -typedef struct { - pexCoord3D origin; - pexVector3D direction; - CARD16 numberIntersections B16; - CARD16 pad B16; - /* LISTof PEXFLOAT( numberIntersections ) */ -} pexPSC_LevelCurves; /* type 4: MC - type 5: WC */ - -/* Pick Device data records */ - -typedef struct { - pexDeviceCoord2D position; - PEXFLOAT distance; -} pexPD_DC_HitBox; /* pick device 1 */ - -typedef pexNpcSubvolume pexPD_NPC_HitVolume; /* pick device 2 */ - - -/* Output Command errors */ - -typedef struct { - CARD8 type; /* 0 */ - CARD8 errorCode; /* 14 */ - CARD16 sequenceNumber B16; - CARD32 resourceId B32; /* renderer or structure */ - CARD16 minorCode B16; - CARD8 majorCode; - CARD8 unused; - CARD16 opcode B16; /* opcode of failed output command */ - CARD16 numCommands B16; /* number successfully done before error */ - BYTE pad[16]; -} pexOutputCommandError; - - -/* Registered PEX Escapes */ - -typedef struct { - INT16 fpFormat B16; - CARD8 unused[2]; - CARD32 rdr B32; /* renderer ID */ - /* SINGLE ColourSpecifier() */ -} pexEscapeSetEchoColourData; - -#endif /* PEXPROTOSTR_H */ Index: xc/programs/Xserver/PEX5/include/ddpex.h diff -u xc/programs/Xserver/PEX5/include/ddpex.h:1.2 xc/programs/Xserver/PEX5/include/ddpex.h:removed --- xc/programs/Xserver/PEX5/include/ddpex.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/ddpex.h Sat Feb 28 21:41:56 2004 @@ -1,677 +0,0 @@ -/* $Xorg: ddpex.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Sun Microsystems, -and The Open Group, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef DDPEX_H -#define DDPEX_H - -#include "X.h" -#include "PEX.h" -#include "pixmapstr.h" -#include "dix.h" -#include "Xprotostr.h" - -/* Basic data types */ -/* Many of the typdefs in this file look like the protocol structures - * This is intentional. The protocol structures specify bit fields - * and the SI ddpex does not use bit fields. Therefore, ddpex uses its - * own data definitions, not the ones used by the protocol. - **************************************************************************** - * THE SIZE AND ALIGNMENT OF THESE STRUCTURES IS EXPECTED MATCH THE PROTOCOL - **************************************************************************** - * This is VERY important. Although ddpex does not use bit fields, it does - * assume that short ints are 16 bits, int/long ints are 32 bits. Pads and - * unused fields have been kept in the ddpex structures so that they match - * the protocol structures exactly, allowing type casting and fast copies - * between the structures. - * ddFLOAT is for server internal floating point representations - */ - -typedef char ddCHAR; -typedef short ddSHORT; -typedef long ddLONG; -typedef float ddFLOAT; - -typedef unsigned char ddUCHAR; -typedef unsigned short ddUSHORT; -typedef unsigned long ddULONG; - -typedef unsigned char *ddPointer; -typedef unsigned char ddBYTE; -typedef unsigned char ddBOOL; - -/* Let the default font that gets opened up be Monospaced Roman */ -#define DEFAULT_PEX_FONT_NAME "Roman_M" - -/* Resource structures passed between dipex and ddpex. Most of the resources - * data is kept in dd structures which are opaque to dipex. Info needed by - * dipex is kept visible to it in these structures - */ -typedef struct { - XID id; - ddPointer deviceData; -} ddWKSResource; - -typedef struct { - XID id; - ddUSHORT lutType; - ddPointer deviceData; -} ddLUTResource; - -typedef ddWKSResource ddStructResource; -typedef ddWKSResource ddNSResource; -typedef ddWKSResource ddFontResource; -typedef ddWKSResource ddPMResource; - -#define GetNSId(HANDLE) HANDLE->id - -#define GetLUTId(HANDLE) HANDLE->id - -typedef ddWKSResource *diWKSHandle; -typedef ddLUTResource *diLUTHandle; -typedef ddStructResource *diStructHandle; -typedef ddNSResource *diNSHandle; -typedef ddFontResource *diFontHandle; -typedef ddPMResource *diPMHandle; -typedef ddPointer diResourceHandle; - -/* PEXprotost.h equivalents */ - -typedef ddULONG ddBitmask; -typedef ddUSHORT ddBitmaskShort; -typedef ddSHORT ddEnumTypeIndex; -typedef XID ddResourceId; -typedef ddBYTE ddSwitch; -typedef ddUSHORT ddTableIndex; - -typedef struct { - ddFLOAT x; - ddFLOAT y; -} ddVector2D; - -typedef struct { - ddFLOAT x; - ddFLOAT y; - ddFLOAT z; -} ddVector3D; - -typedef struct { - ddFLOAT x; - ddFLOAT y; -} ddCoord2D; - -typedef struct { - ddLONG x; - ddLONG y; -} ddCoord2DL; - -typedef xPoint ddCoord2DS; /* must be the same type for compiler's sake */ -/* typedef struct { ddSHORT x; ddSHORT y; } ddCoord2DS; */ - -typedef struct { - ddFLOAT x; - ddFLOAT y; - ddFLOAT z; -} ddCoord3D; - -typedef struct { - ddLONG x; - ddLONG y; - ddLONG z; -} ddCoord3DL; - -typedef struct { - ddSHORT x; - ddSHORT y; - ddSHORT z; -} ddCoord3DS; - -typedef struct { - ddFLOAT x; - ddFLOAT y; - ddFLOAT z; - ddFLOAT w; -} ddCoord4D; - -typedef struct { - ddSHORT x; - ddSHORT y; - ddFLOAT z; -} ddDeviceCoord; - -typedef struct { - ddSHORT xmin; - ddSHORT ymin; - ddSHORT xmax; - ddSHORT ymax; -} ddDeviceRect; - -typedef struct { - ddFLOAT xmin; - ddFLOAT ymin; - ddFLOAT zmin; - ddFLOAT wmin; - ddFLOAT xmax; - ddFLOAT ymax; - ddFLOAT zmax; - ddFLOAT wmax; -} ddListBounds; - -typedef struct { - ddSHORT approxMethod; - ddUSHORT unused; - ddFLOAT tolerance; -} ddCurveApprox; - -typedef struct { - ddSHORT approxMethod; - ddUSHORT unused; - ddFLOAT uTolerance; - ddFLOAT vTolerance; -} ddSurfaceApprox; - -typedef struct { - ddUSHORT vertical; - ddUSHORT horizontal; -} ddTextAlignmentData; - -typedef struct { - ddDeviceCoord minval; - ddDeviceCoord maxval; - ddUCHAR useDrawable; - ddBYTE pad[3]; -} ddViewport; - -typedef struct { - ddCoord2DS position; - ddFLOAT distance; -} ddDC_HitBox; - -typedef struct { - ddCoord3D minval; - ddCoord3D maxval; -} ddNpcSubvolume; - -typedef ddNpcSubvolume ddNPC_HitVolume; - -typedef struct { - ddUSHORT clipFlags; - ddUSHORT unused; - ddNpcSubvolume clipLimits; - ddFLOAT orientation[4][4]; - ddFLOAT mapping[4][4]; -} ddViewEntry; - -typedef struct { - ddUSHORT definableEntries; - ddUSHORT numPredefined; - ddUSHORT predefinedMin; - ddUSHORT predefinedMax; -} ddTableInfo; - - -typedef struct { - diStructHandle structure; /* the structure id is replaced with */ - ddULONG offset; /* the handle */ -} ddElementRef; - -typedef struct { - ddCoord4D orig_point; /* original PEX ref point */ - ddCoord4D point; - ddVector3D orig_vector; /* original PEX ref vector*/ - ddVector3D vector; /* normalized vector */ - ddFLOAT dist; /* Hessian form distance func */ -} ddHalfSpace; - -typedef struct { - diStructHandle structure; /* the structure id is replaced with the */ - ddULONG offset; /* handle by diPEX */ - ddULONG pickid; -} ddPickPath; - -typedef struct { - ddULONG sid; - ddULONG offset; - ddULONG pickid; -} ddPickElementRef; - -typedef struct { - ddUSHORT pickType; - union { - ddDC_HitBox DC_HitBox; - ddNPC_HitVolume NPC_HitVolume; - } hit_box; -} ddPickRecord; - -typedef struct { - ddUSHORT elementType; - ddUSHORT length; -} ddElementInfo; - -/* Colour structures */ -typedef struct { - ddFLOAT red; - ddFLOAT green; - ddFLOAT blue; -} ddRgbFloatColour; - -typedef struct { - ddFLOAT hue; - ddFLOAT saturation; - ddFLOAT value; -} ddHsvColour; - -typedef struct { - ddFLOAT hue; - ddFLOAT lightness; - ddFLOAT saturation; -} ddHlsColour; - -typedef struct { - ddFLOAT x; - ddFLOAT y; - ddFLOAT z; -} ddCieColour; - -typedef struct { - ddUCHAR red; - ddUCHAR green; - ddUCHAR blue; - ddUCHAR pad; -} ddRgb8Colour; - -typedef struct { - ddUSHORT red; - ddUSHORT green; - ddUSHORT blue; - ddUSHORT pad; -} ddRgb16Colour; - -typedef struct { - ddUSHORT index; - ddUSHORT pad; -} ddIndexedColour; - -typedef struct { - ddSHORT colourType; - ddSHORT unused; - union { - ddIndexedColour indexed; - ddRgb8Colour rgb8; - ddRgb16Colour rgb16; - ddRgbFloatColour rgbFloat; - ddCieColour cieFloat; - ddHlsColour hlsFloat; - ddHsvColour hsvFloat; - } colour; -} ddColourSpecifier; - -typedef union { - ddRgb8Colour rgb8; - ddRgb16Colour rgb16; - ddRgbFloatColour rgbFloat; - ddCieColour cieFloat; - ddHlsColour hlsFloat; - ddHsvColour hsvFloat; -} ddDirectColour; - -typedef struct { - ddFLOAT ambient; - ddFLOAT diffuse; - ddFLOAT specular; - ddFLOAT specularConc; - ddFLOAT transmission; /* 0.0 = opaque, 1.0 = transparent */ - ddColourSpecifier specularColour; -} ddReflectionAttr; - -/* end of PEXprotost.h equivalent structures */ - -/* error return values */ -typedef int ddpex4rtn; -typedef int ddpex43rtn; -typedef int ddpex3rtn; -typedef int ddpex2rtn; -typedef int ddpex1rtn; - -/* ddBuffer is used to pass variable length data from ddpex to dipex - * there is a utility called miBuffRealloc which can be used by either - * dipex or ddpex to reallocate space in the buffer. - * The buffer itself is just an array of bytes. The beginning of the - * buffer is pointed to by pHead. ddpex copies the info into the - * buffer beginning at the location pointed to by pBuf. This allows - * dipex to control where in the buffer the data is located. dipex - * sets pBuf, pHead and bufSize before calling the ddpex procedure. - * ddpex copies data into the buffer starting at pBuf and puts the - * number of bytes of data copied into dataSize. ddpex does not change - * pHead, pBuf, or data Size (pBuf continues pointing to the beginning - * of the info ddpex copies to the buffer). ddpex MUST check that the - * buffer is large enough to hold the data (macro DD_BUF_TOO_SMALL is - * useful for this) and should call miBufRealloc to increase the buffer - * size if it's too small. pHead, pBuf and bufSize will be adjusted - * for the realloc correctly in that procedure. - */ -typedef struct { - ddULONG bufSize; /* number of total bytes in buffer */ - ddULONG dataSize; /* number of bytes used by the new data */ - ddPointer pBuf; /* pointer to buffer where new data starts */ - ddPointer pHead; /* pointer to true head of buffer */ -} ddBuffer, *ddBufferPtr; - -/* lists of objects are needed in several places in the SI server. The following - * data structure are intended to be used for those lists. The enum type defines - * what the possible objects in a list are. listofObj defines the list itself. - * The list is an array of objects. Procedures for doing operations on these - * lists are provided in server/dipex/utilities. Declarations of the procedures and - * useful macros are defined in server/include/pexUtils.h. - * dipex and ddpex both use these lists. The lists are not intended - * to be opaque. dipex and ddpex can use them directly, although we've tried - * to use the macros and procedures as much as possible. - * More info is given with the procedures. - */ -typedef enum { - DD_ELEMENT_REF=0, - DD_HALF_SPACE=1, - DD_PICK_PATH=2, - DD_RENDERER=3, - DD_WKS=4, - DD_NS=5, - DD_STRUCT=6, - DD_DEVICE_RECT=7, - DD_NAME=8, - DD_INDEX=9, - DD_LIST_OF_LIST=10, - DD_NUM_TYPES=11 -} ddListType; - -typedef struct { - ddListType type; - ddLONG numObj; - ddLONG misc; - ddLONG maxObj; - ddPointer pList; - /* pList is an array of foos (see ddListType for possible foos) - * it is allocated as an array of footypes and reallocated as needed - * in multiples of a defined size. - * footypes and array sizes are stated explicitely in - * server/dipex/dispatch/pexUtils.c - * yes, this could be a union, but by using a generic char *, - * the list can be handled generically and not have to be - * specified differently for each type if it isn't necessary - */ -} listofObj; - -/* Pipeline Context and Renderer Resource structures: shared by dipex and ddpex */ - -typedef struct { - ddUSHORT placementType; - ddUSHORT numUcurves; - ddUSHORT numVcurves; -} ddPSC_IsoparametricCurves; - -typedef struct { - ddCoord3D origin; - ddVector3D direction; - ddUSHORT numberIntersections; - ddFLOAT *pPoints; -} ddPSC_LevelCurves; - -typedef struct { - ddEnumTypeIndex type; - union { - char none; - char impDep; - ddPSC_IsoparametricCurves isoCurves; - ddPSC_LevelCurves mcLevelCurves; - ddPSC_LevelCurves wcLevelCurves; - } data; -} ddPSurfaceChars; - - -typedef struct { - ddEnumTypeIndex markerType; - ddFLOAT markerScale; - ddColourSpecifier markerColour; - ddUSHORT markerIndex; - ddUSHORT textFont; - ddUSHORT textPrecision; - ddFLOAT charExpansion; - ddFLOAT charSpacing; - ddColourSpecifier textColour; - ddFLOAT charHeight; - ddVector2D charUp; - ddUSHORT textPath; - ddTextAlignmentData textAlignment; - ddFLOAT atextHeight; - ddVector2D atextUp; - ddUSHORT atextPath; - ddTextAlignmentData atextAlignment; - ddEnumTypeIndex atextStyle; - ddUSHORT textIndex; - ddEnumTypeIndex lineType; - ddFLOAT lineWidth; - ddColourSpecifier lineColour; - ddCurveApprox curveApprox; - ddEnumTypeIndex lineInterp; - ddUSHORT lineIndex; - ddEnumTypeIndex intStyle; - ddSHORT intStyleIndex; - ddColourSpecifier surfaceColour; - ddReflectionAttr reflAttr; - ddEnumTypeIndex reflModel; - ddEnumTypeIndex surfInterp; - ddEnumTypeIndex bfIntStyle; - ddSHORT bfIntStyleIndex; - ddColourSpecifier bfSurfColour; - ddReflectionAttr bfReflAttr; - ddEnumTypeIndex bfReflModel; - ddEnumTypeIndex bfSurfInterp; - ddSurfaceApprox surfApprox; - ddUSHORT cullMode; - ddBOOL distFlag; - ddCoord2D patternSize; - ddCoord3D patternRefPt; - ddVector3D patternRefV1; - ddVector3D patternRefV2; - ddUSHORT intIndex; - ddUSHORT edges; - ddEnumTypeIndex edgeType; - ddFLOAT edgeWidth; - ddColourSpecifier edgeColour; - ddUSHORT edgeIndex; - ddFLOAT localMat[4][4]; - ddFLOAT globalMat[4][4]; - ddUSHORT modelClip; - listofObj *modelClipVolume; - ddUSHORT viewIndex; - listofObj *lightState; - ddUSHORT depthCueIndex; - ddUSHORT colourApproxIndex; - ddSHORT rdrColourModel; - ddPSurfaceChars psc; - ddULONG asfs; - ddULONG pickId; - ddULONG hlhsrType; - diNSHandle pCurrentNS; /* handle to name set */ -} ddPCAttr; - -typedef struct { - ddULONG PCid; - listofObj *rendRefs; - ddPCAttr *pPCAttr; -} ddPCStr, *ddPCPtr; - -/* Output Command Procedure Vector used in renderer */ -/* The index of a procedure is the output command number */ -#define OCTABLE_LENGTH (PEXMaxOC+1) -#define SEPROC_VECTOR_LENGTH (PEXMaxOC+1) - -typedef ddpex2rtn (*ocTableType)(); - -typedef struct { - ddBYTE type; /* drawable type: pixmap, window, undrawable_window? */ - ddBYTE class; - ddBYTE depth; - ddBYTE bitsPerPixel; - ddBYTE rootDepth; - ddULONG rootVisual; -} ddDrawableInfo; - -typedef enum { - DD_HIGH_INCL_NS=0, - DD_HIGH_EXCL_NS=1, - DD_INVIS_INCL_NS=2, - DD_INVIS_EXCL_NS=3, - DD_PICK_INCL_NS=4, - DD_PICK_EXCL_NS=5, - DD_MAX_FILTERS=6 -} ddNSFilters; - -/* pick state for Renderer picking */ -#define DD_PICK_ONE 1 -#define DD_PICK_ALL 2 -#define DD_SERVER 1 -#define DD_CLIENT 2 -#define DD_NEITHER 3 - -typedef struct { - ddUSHORT state; /* pick state one or all */ - ddUSHORT server; /* client or server traversal */ - ddSHORT pick_method; - ddBOOL send_event; - ddULONG max_hits; - ddULONG more_hits; - ClientPtr client; /* need to send the event */ - diStructHandle strHandle; /* struct handle for PickOne */ - diPMHandle pseudoPM; /* fake PM for Renderer Pick */ - listofObj *list; /* list of list for pick all */ - listofObj *fakeStrlist; /* list of fake struct handle for - picking */ - listofObj *sIDlist; /* list of IDs, struct handles and - offsets for reverse mapping - BeginStructures when picking */ -} ddRdrPickStr, *ddRdrPickPtr; /* need to send the event */ - -typedef struct { - ddULONG rendId; /* renderer id */ - ddPCPtr pPC; /* pipeline context handle */ - ddDrawableInfo drawExample; /* info from drawable example */ - DrawablePtr pDrawable; /* rendering drawable */ - ddULONG drawableId; /* id of rendering drawable */ - listofObj *curPath; /* current path */ - ddUSHORT state; /* renderer state */ - diLUTHandle lut[PEXMaxTableType+1];/* lookup table handles */ - diNSHandle ns[DD_MAX_FILTERS];/* name set handles */ - ddSHORT hlhsrMode; /* you guessed it */ - ddNpcSubvolume npcSubvolume; - ddViewport viewport; - listofObj *clipList; /* clip list */ - /* Begin 5.1 additions */ - /* pick_inclusion is in ns */ - /* pick_exclusion is in ns */ - listofObj *pickStartPath; /* pick start path */ - ddColourSpecifier backgroundColour; - ddBOOL clearI; - ddBOOL clearZ; - ddUSHORT echoMode; - ddColourSpecifier echoColour; - /* End 5.1 additions */ - ddBitmask tablesMask; /* renderer dynamics */ - ddBitmask namesetsMask; /* renderer dynamics */ - ddBitmask attrsMask; /* renderer dynamics */ - ddBitmask tablesChanges; /* changed attributes */ - ddBitmask namesetsChanges;/* changed attributes */ - ddBitmask attrsChanges; /* changed attributes */ - ocTableType executeOCs[OCTABLE_LENGTH]; - ddBOOL immediateMode; - ddUSHORT render_mode; - ddPointer pDDContext; /* device dependent attribute context */ - ddRdrPickStr pickstr; -} ddRendererStr, *ddRendererPtr; - -typedef struct { - ddULONG numElRefs; /* number of element refs */ - listofObj *Path; /* path */ -} ddAccStStr, *ddAccStPtr; - -/* render_mode values */ -#define MI_REND_DRAWING 0 -#define MI_REND_PICKING 1 -#define MI_REND_SEARCHING 2 - - /* enum type for specifying resources */ -typedef enum { - WORKSTATION_RESOURCE=0, - STRUCTURE_RESOURCE=1, - PARENT_STRUCTURE_RESOURCE=2, - CHILD_STRUCTURE_RESOURCE=3, - SEARCH_CONTEXT_RESOURCE=4, - PICK_RESOURCE=5, - LOOKUP_TABLE_RESOURCE=6, - NAME_SET_RESOURCE=7, - FONT_RESOURCE=8, - RENDERER_RESOURCE=9, - PIPELINE_CONTEXT_RESOURCE=10 -} ddResourceType; - -typedef enum { - ADD=0, - REMOVE=1 -} ddAction; - -typedef enum { - X_WINDOW_RESOURCE=0, - X_DRAWABLE_RESOURCE=1, - X_FONT_RESOURCE=2, - X_PIXMAP_RESOURCE=3, - X_CURSOR_RESOURCE=4, - X_COLORMAP_RESOURCE=5, - X_GCONTEXT_RESOURCE=6, - X_KEYSYM=7 -} ddXResourceType; - -#endif /* DDPEX_H */ Index: xc/programs/Xserver/PEX5/include/ddpex3.h diff -u xc/programs/Xserver/PEX5/include/ddpex3.h:1.2 xc/programs/Xserver/PEX5/include/ddpex3.h:removed --- xc/programs/Xserver/PEX5/include/ddpex3.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/ddpex3.h Sat Feb 28 21:41:56 2004 @@ -1,1100 +0,0 @@ -/* $Xorg: ddpex3.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "ddpex.h" - -#ifndef DDPEX3_H -#define DDPEX3_H - -/* just a reminder of what colours there are - IndexedColour - Rgb8Colour - Rgb16Colour - RgbFloatColour - HsvColour - HlsColour - CieColour -*/ - -/* First, some basic point type definitions */ -/* #define DDPT_FLOAT (0<<0) */ -#define DDPT_SHORT (1<<0) -#define DDPT_2D (1<<1) -#define DDPT_3D (2<<1) -#define DDPT_4D (3<<1) -#define DDPT_NORMAL (1<<3) -#define DDPT_EDGE (1<<4) -#define DDPT_COLOUR (7<<5) -#define DDPT_INDEXEDCOLOUR (1<<5) -#define DDPT_RGB8COLOUR (2<<5) -#define DDPT_RGB16COLOUR (3<<5) -#define DDPT_RGBFLOATCOLOUR (4<<5) -#define DDPT_HSVCOLOUR (5<<5) -#define DDPT_HLSCOLOUR (6<<5) -#define DDPT_CIECOLOUR (7<<5) - -/* - * Now, some access macros - * It is strongly recommended that these macros be used instead - * of accessing the fields directly. - */ -#define DD_IsVertFloat(type) (!((type) & DDPT_SHORT)) -#define DD_IsVertShort(type) ((type) & DDPT_SHORT) -#define DD_IsVert2D(type) (((type) & DDPT_4D) == DDPT_2D) -#define DD_IsVert3D(type) (((type) & DDPT_4D) == DDPT_3D) -#define DD_IsVert4D(type) (((type) & DDPT_4D) == DDPT_4D) -#define DD_IsVertNormal(type) ((type) & DDPT_NORMAL) -#define DD_IsVertEdge(type) ((type) & DDPT_EDGE) -#define DD_IsVertColour(type) ((type) & DDPT_COLOUR) -#define DD_IsVertIndexed(type) (((type) & DDPT_COLOUR) == DDPT_INDEXEDCOLOUR) -#define DD_IsVertRGB8(type) (((type) & DDPT_COLOUR) == DDPT_RGB8COLOUR) -#define DD_IsVertRGB16(type) (((type) & DDPT_COLOUR) == DDPT_RGB16COLOUR) -#define DD_IsVertRGBFLOAT(type) (((type)&DDPT_COLOUR) == DDPT_RGBFLOATCOLOUR) -#define DD_IsVertHSV(type) (((type) & DDPT_COLOUR) == DDPT_HSVCOLOUR) -#define DD_IsVertHLS(type) (((type) & DDPT_COLOUR) == DDPT_HLSCOLOUR) -#define DD_IsVertCIE(type) (((type) & DDPT_COLOUR) == DDPT_CIECOLOUR) - -#define DD_IsVertCoordsOnly(type) \ - !((type & DDPT_COLOUR) || (type & DDPT_EDGE) || (type & DDPT_NORMAL)) - -/* - * These macros are used to change a vertex type - */ -#define DD_SetVertFloat(type) ((type) &= ~DDPT_SHORT) -#define DD_SetVertShort(type) ((type) |= DDPT_SHORT) -#define DD_SetVert2D(type) ((type) = (((type) & ~DDPT_4D) | DDPT_2D)) -#define DD_SetVert3D(type) ((type) = (((type) & ~DDPT_4D) | DDPT_3D)) -#define DD_SetVert4D(type) ((type) = (((type) & ~DDPT_4D) | DDPT_4D)) -#define DD_SetVertNormal(type) ((type) |= DDPT_NORMAL) -#define DD_SetVertEdge(type) ((type) |= DDPT_EDGE) -#define DD_SetVertIndexed(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_INDEXEDCOLOUR)) -#define DD_SetVertRGB8(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_RGB8COLOUR)) -#define DD_SetVertRGB16(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_RGB16COLOUR)) -#define DD_SetVertRGBFLOAT(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_RGBFLOATCOLOUR)) -#define DD_SetVertHSV(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_HSVCOLOUR)) -#define DD_SetVertHLS(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_HLSCOLOUR)) -#define DD_SetVertCIE(type) ((type)=(((type) & ~DDPT_COLOUR) | DDPT_CIECOLOUR)) - -#define DD_UnSetVertFloat(type) ((type) |= DDPT_SHORT) -#define DD_UnSetVertShort(type) ((type) &= ~DDPT_SHORT) -#define DD_UnSetVert2D(type) ((type) &= ~DDPT_4D) -#define DD_UnSetVert3D(type) ((type) &= ~DDPT_4D) -#define DD_UnSetVert4D(type) ((type) &= ~DDPT_4D) -#define DD_UnSetVertCoord(type) ((type) &= ~(DDPT_4D | DDPT_SHORT)) -#define DD_UnSetVertNormal(type) ((type) &= ~DDPT_NORMAL) -#define DD_UnSetVertEdge(type) ((type) &= ~DDPT_EDGE) -#define DD_UnSetColour(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertIndexed(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertRGB8(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertRGB16(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertRGBFLOAT(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertHSV(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertHLS(type) ((type) &= ~DDPT_COLOUR) -#define DD_UnSetVertCIE(type) ((type) &= ~DDPT_COLOUR) - - -/* - * A macro to compute the point size - very usefull when - * walking through a list of points and one isn't concerned - * about the actual details of the point data - */ -#define DD_VertPointSize(type, size) \ - { \ - if (DD_IsVertFloat(type)) { \ - if (DD_IsVert2D(type)) size = sizeof(ddCoord2D); \ - else if (DD_IsVert3D(type)) size = sizeof(ddCoord3D); \ - else size = sizeof(ddCoord4D); \ - } else { \ - if (DD_IsVert2D(type)) size = sizeof(ddCoord2DS); \ - else size = sizeof(ddCoord3DS); \ - } \ - if (DD_IsVertNormal(type)) size += sizeof(ddVector3D); \ - if (DD_IsVertColour(type)) { \ - if (DD_IsVertIndexed(type)) size += sizeof(ddIndexedColour); \ - else if (DD_IsVertRGB8(type)) size += sizeof(ddRgb8Colour); \ - else if (DD_IsVertRGB16(type)) size += sizeof(ddRgb16Colour); \ - else size += sizeof(ddRgbFloatColour); \ - } \ - if (DD_IsVertEdge(type)) size += sizeof(ddULONG); \ - } -/* - * The following macros find offets from the start - * of a structure in bytes to the desired vertex component. - * again, very usefull macros for routines that wish - * to access individual vertex components without necessarily - * knowing all the details of the vertex. Offset is set to -1 - * if the component does not exist in the vertex. - */ - -/* - * Note that the color is always the first component following - * the vertex data. - */ -#define DD_VertOffsetColor(type, offset) \ - { \ - if (!DD_IsVertColour((type))) (offset) = -1; \ - else \ - DD_VertPointSize(((type) & (DDPT_4D | DDPT_SHORT)),(offset));\ - } - -/* - * Note that the edge flag is always the last component in - * a vertex. Thus the offset is the size of the point minus - * the size of the edge field (a ddULONG). - */ -#define DD_VertOffsetEdge(type, offset) \ - { \ - if (!DD_IsVertEdge((type))) (offset) = -1; \ - else { \ - DD_VertPointSize((type), (offset)); \ - (offset) -= sizeof(ddULONG); \ - } \ - } - -/* - * This one is the most complex as the normal is last unless - * there is an edge in which case it preceeds the edge flag. - */ -#define DD_VertOffsetNormal(type, offset) \ - { \ - if (!DD_IsVertNormal((type))) (offset) = -1; \ - else { \ - DD_VertPointSize((type), (offset)); \ - if (DD_IsVertEdge((type))) (offset) -= sizeof(ddULONG); \ - (offset) -= sizeof(ddVector3D); \ - } \ - } - -/* Now create the point types */ -#define DD_2DS_POINT (DDPT_SHORT | DDPT_2D) -#define DD_2D_POINT (DDPT_2D) -#define DD_3DS_POINT (DDPT_SHORT | DDPT_3D) -#define DD_3D_POINT (DDPT_3D) -#define DD_INDEX_POINT (DDPT_3D | DDPT_INDEXEDCOLOUR) -#define DD_INDEX_POINT4D (DDPT_4D | DDPT_INDEXEDCOLOUR) -#define DD_RGB8_POINT (DDPT_3D | DDPT_RGB8COLOUR) -#define DD_RGB8_POINT4D (DDPT_4D | DDPT_RGB8COLOUR) -#define DD_RGB16_POINT (DDPT_3D | DDPT_RGB16COLOUR) -#define DD_RGB16_POINT4D (DDPT_4D | DDPT_RGB16COLOUR) -#define DD_RGBFLOAT_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_POINT (DDPT_3D | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_POINT4D (DDPT_4D | DDPT_RGBFLOATCOLOUR) -#define DD_HSV_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_HSVCOLOUR) -#define DD_HSV_POINT (DDPT_3D | DDPT_HSVCOLOUR) -#define DD_HSV_POINT4D (DDPT_4D | DDPT_HSVCOLOUR) -#define DD_HLS_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_HLSCOLOUR) -#define DD_HLS_POINT (DDPT_3D | DDPT_HLSCOLOUR) -#define DD_HLS_POINT4D (DDPT_4D | DDPT_HLSCOLOUR) -#define DD_CIE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_CIECOLOUR) -#define DD_CIE_POINT (DDPT_3D | DDPT_CIECOLOUR) -#define DD_CIE_POINT4D (DDPT_4D | DDPT_CIECOLOUR) -#define DD_NORM_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL) -#define DD_NORM_POINT (DDPT_3D | DDPT_NORMAL) -#define DD_NORM_POINT4D (DDPT_4D | DDPT_NORMAL) -#define DD_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_EDGE) -#define DD_EDGE_POINT (DDPT_3D | DDPT_EDGE) -#define DD_EDGE_POINT4D (DDPT_4D | DDPT_EDGE) -#define DD_INDEX_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_INDEXEDCOLOUR) -#define DD_INDEX_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_INDEXEDCOLOUR) -#define DD_RGB8_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_RGB8COLOUR) -#define DD_RGB8_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_RGB8COLOUR) -#define DD_RGB16_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_RGB16COLOUR) -#define DD_RGB16_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_RGB16COLOUR) -#define DD_RGBFLOAT_NORM_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_RGBFLOATCOLOUR) -#define DD_HSV_NORM_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_HSVCOLOUR) -#define DD_HSV_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_HSVCOLOUR) -#define DD_HSV_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_HSVCOLOUR) -#define DD_HLS_NORM_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_HLSCOLOUR) -#define DD_HLS_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_HLSCOLOUR) -#define DD_HLS_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_HLSCOLOUR) -#define DD_CIE_NORM_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_CIECOLOUR) -#define DD_CIE_NORM_POINT (DDPT_3D | DDPT_NORMAL | DDPT_CIECOLOUR) -#define DD_CIE_NORM_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_CIECOLOUR) -#define DD_INDEX_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_INDEXEDCOLOUR) -#define DD_INDEX_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_INDEXEDCOLOUR) -#define DD_RGB8_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_RGB8COLOUR) -#define DD_RGB8_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_RGB8COLOUR) -#define DD_RGB16_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_RGB16COLOUR) -#define DD_RGB16_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_RGB16COLOUR) -#define DD_RGBFLOAT_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_HSV_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HSV_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HSV_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HLS_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_HLS_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_HLS_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_CIE_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_CIE_EDGE_POINT (DDPT_3D | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_CIE_EDGE_POINT4D (DDPT_4D | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_NORM_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_EDGE ) -#define DD_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE ) -#define DD_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE ) -#define DD_INDEX_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_INDEXEDCOLOUR) -#define DD_INDEX_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_INDEXEDCOLOUR) -#define DD_RGB8_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGB8COLOUR) -#define DD_RGB8_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGB8COLOUR) -#define DD_RGB16_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGB16COLOUR) -#define DD_RGB16_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGB16COLOUR) -#define DD_RGBFLOAT_NORM_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_RGBFLOAT_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_RGBFLOATCOLOUR) -#define DD_HSV_NORM_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HSV_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HSV_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_HSVCOLOUR) -#define DD_HLS_NORM_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_HLS_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_HLS_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_HLSCOLOUR) -#define DD_CIE_NORM_EDGE_POINT2DS (DDPT_SHORT | DDPT_2D | DDPT_NORMAL | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_CIE_NORM_EDGE_POINT (DDPT_3D | DDPT_NORMAL | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_CIE_NORM_EDGE_POINT4D (DDPT_4D | DDPT_NORMAL | DDPT_EDGE | DDPT_CIECOLOUR) -#define DD_HOMOGENOUS_POINT (DDPT_4D) - -typedef ddUSHORT ddPointType; - -/* - * The point types correspond to the point types in the PEX protocol - */ -typedef struct { - ddCoord3D pt; - ddIndexedColour colour; -} ddIndexPoint; - -typedef struct { - ddCoord3D pt; - ddRgb8Colour colour; -} ddRgb8Point; - -typedef struct { - ddCoord3D pt; - ddRgb16Colour colour; -} ddRgb16Point; - -typedef struct { - ddCoord2DS pt; - ddRgbFloatColour colour; -} ddRgbFloatPoint2DS; - -typedef struct { - ddCoord3D pt; - ddRgbFloatColour colour; -} ddRgbFloatPoint; - -typedef struct { - ddCoord2DS pt; - ddHsvColour colour; -} ddHsvPoint2DS; - -typedef struct { - ddCoord3D pt; - ddHsvColour colour; -} ddHsvPoint; - -typedef struct { - ddCoord2DS pt; - ddHlsColour colour; -} ddHlsPoint2DS; - -typedef struct { - ddCoord3D pt; - ddHlsColour colour; -} ddHlsPoint; - -typedef struct { - ddCoord2DS pt; - ddCieColour colour; -} ddCiePoint2DS; - -typedef struct { - ddCoord3D pt; - ddCieColour colour; -} ddCiePoint; - -typedef struct { - ddCoord2DS pt; - ddVector3D normal; -} ddNormalPoint2DS; - -typedef struct { - ddCoord3D pt; - ddVector3D normal; -} ddNormalPoint; - -typedef struct { - ddCoord2DS pt; - ddULONG edge; -} ddEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddULONG edge; -} ddEdgePoint; - -typedef struct { - ddCoord3D pt; - ddIndexedColour colour; - ddVector3D normal; -} ddIndexNormalPoint; - -typedef struct { - ddCoord3D pt; - ddRgb8Colour colour; - ddVector3D normal; -} ddRgb8NormalPoint; - -typedef struct { - ddCoord3D pt; - ddRgb16Colour colour; - ddVector3D normal; -} ddRgb16NormalPoint; - -typedef struct { - ddCoord2DS pt; - ddRgbFloatColour colour; - ddVector3D normal; -} ddRgbFloatNormalPoint2DS; - -typedef struct { - ddCoord3D pt; - ddRgbFloatColour colour; - ddVector3D normal; -} ddRgbFloatNormalPoint; - -typedef struct { - ddCoord2DS pt; - ddHsvColour colour; - ddVector3D normal; -} ddHsvNormalPoint2DS; - -typedef struct { - ddCoord3D pt; - ddHsvColour colour; - ddVector3D normal; -} ddHsvNormalPoint; - -typedef struct { - ddCoord2DS pt; - ddHlsColour colour; - ddVector3D normal; -} ddHlsNormalPoint2DS; - -typedef struct { - ddCoord3D pt; - ddHlsColour colour; - ddVector3D normal; -} ddHlsNormalPoint; - -typedef struct { - ddCoord2DS pt; - ddCieColour colour; - ddVector3D normal; -} ddCieNormalPoint2DS; - -typedef struct { - ddCoord3D pt; - ddCieColour colour; - ddVector3D normal; -} ddCieNormalPoint; - -typedef struct { - ddCoord3D pt; - ddIndexedColour colour; - ddULONG edge; -} ddIndexEdgePoint; - -typedef struct { - ddCoord3D pt; - ddRgb8Colour colour; - ddULONG edge; -} ddRgb8EdgePoint; - -typedef struct { - ddCoord3D pt; - ddRgb16Colour colour; - ddULONG edge; -} ddRgb16EdgePoint; - -typedef struct { - ddCoord2DS pt; - ddRgbFloatColour colour; - ddULONG edge; -} ddRgbFloatEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddRgbFloatColour colour; - ddULONG edge; -} ddRgbFloatEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddHsvColour colour; - ddULONG edge; -} ddHsvEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddHsvColour colour; - ddULONG edge; -} ddHsvEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddHlsColour colour; - ddULONG edge; -} ddHlsEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddHlsColour colour; - ddULONG edge; -} ddHlsEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddCieColour colour; - ddULONG edge; -} ddCieEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddCieColour colour; - ddULONG edge; -} ddCieEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddVector3D normal; - ddULONG edge; -} ddNormEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddVector3D normal; - ddULONG edge; -} ddNormEdgePoint; - -typedef struct { - ddCoord3D pt; - ddIndexedColour colour; - ddVector3D normal; - ddULONG edge; -} ddIndexNormEdgePoint; - -typedef struct { - ddCoord3D pt; - ddRgb8Colour colour; - ddVector3D normal; - ddULONG edge; -} ddRgb8NormEdgePoint; - -typedef struct { - ddCoord3D pt; - ddRgb16Colour colour; - ddVector3D normal; - ddULONG edge; -} ddRgb16NormEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddRgbFloatColour colour; - ddVector3D normal; - ddULONG edge; -} ddRgbFloatNormEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddRgbFloatColour colour; - ddVector3D normal; - ddULONG edge; -} ddRgbFloatNormEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddHsvColour colour; - ddVector3D normal; - ddULONG edge; -} ddHsvNormEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddHsvColour colour; - ddVector3D normal; - ddULONG edge; -} ddHsvNormEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddHlsColour colour; - ddVector3D normal; - ddULONG edge; -} ddHlsNormEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddHlsColour colour; - ddVector3D normal; - ddULONG edge; -} ddHlsNormEdgePoint; - -typedef struct { - ddCoord2DS pt; - ddCieColour colour; - ddVector3D normal; - ddULONG edge; -} ddCieNormEdgePoint2DS; - -typedef struct { - ddCoord3D pt; - ddCieColour colour; - ddVector3D normal; - ddULONG edge; -} ddCieNormEdgePoint; - -/* - * The point types are internal point types only. - */ - -typedef struct { - ddCoord4D pt; - ddIndexedColour colour; -} ddIndexPoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb8Colour colour; -} ddRgb8Point4D; - -typedef struct { - ddCoord4D pt; - ddRgb16Colour colour; -} ddRgb16Point4D; - -typedef struct { - ddCoord4D pt; - ddRgbFloatColour colour; -} ddRgbFloatPoint4D; - -typedef struct { - ddCoord4D pt; - ddHsvColour colour; -} ddHsvPoint4D; - -typedef struct { - ddCoord4D pt; - ddHlsColour colour; -} ddHlsPoint4D; - -typedef struct { - ddCoord4D pt; - ddCieColour colour; -} ddCiePoint4D; - -typedef struct { - ddCoord4D pt; - ddVector3D normal; -} ddNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddULONG edge; -} ddEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddIndexedColour colour; - ddVector3D normal; -} ddIndexNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb8Colour colour; - ddVector3D normal; -} ddRgb8NormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb16Colour colour; - ddVector3D normal; -} ddRgb16NormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddRgbFloatColour colour; - ddVector3D normal; -} ddRgbFloatNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddHsvColour colour; - ddVector3D normal; -} ddHsvNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddHlsColour colour; - ddVector3D normal; -} ddHlsNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddCieColour colour; - ddVector3D normal; -} ddCieNormalPoint4D; - -typedef struct { - ddCoord4D pt; - ddIndexedColour colour; - ddULONG edge; -} ddIndexEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb8Colour colour; - ddULONG edge; -} ddRgb8EdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb16Colour colour; - ddULONG edge; -} ddRgb16EdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgbFloatColour colour; - ddULONG edge; -} ddRgbFloatEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddHsvColour colour; - ddULONG edge; -} ddHsvEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddHlsColour colour; - ddULONG edge; -} ddHlsEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddCieColour colour; - ddULONG edge; -} ddCieEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddVector3D normal; - ddULONG edge; -} ddNormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddIndexedColour colour; - ddVector3D normal; - ddULONG edge; -} ddIndexNormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb8Colour colour; - ddVector3D normal; - ddULONG edge; -} ddRgb8NormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgb16Colour colour; - ddVector3D normal; - ddULONG edge; -} ddRgb16NormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddRgbFloatColour colour; - ddVector3D normal; - ddULONG edge; -} ddRgbFloatNormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddHsvColour colour; - ddVector3D normal; - ddULONG edge; -} ddHsvNormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddHlsColour colour; - ddVector3D normal; - ddULONG edge; -} ddHlsNormEdgePoint4D; - -typedef struct { - ddCoord4D pt; - ddCieColour colour; - ddVector3D normal; - ddULONG edge; -} ddCieNormEdgePoint4D; - -typedef union { - ddCoord2D *p2Dpt; - ddCoord3D *p3Dpt; - ddCoord2DL *p2DLpt; - ddCoord3DL *p3DLpt; - ddCoord2DS *p2DSpt; - ddCoord3DS *p3DSpt; - ddIndexedColour *pIndexClr; - ddRgb8Colour *pRgb8Clr; - ddRgb16Colour *pRgb16Clr; - ddRgbFloatColour *pRgbFloatClr; - ddHsvColour *pHsvClr; - ddHlsColour *pHlsClr; - ddCieColour *pCieClr; - ddIndexPoint *pIndexpt; - ddRgb8Point *pRgb8pt; - ddRgb16Point *pRgb16pt; - ddRgbFloatPoint *pRgbFloatpt; - ddHsvPoint *pHsvpt; - ddHlsPoint *pHlspt; - ddCiePoint *pCiept; - ddVector3D *pNormal; - ddNormalPoint *pNpt; - ddULONG *pEdge; - ddEdgePoint *pEpt; - ddIndexNormalPoint *pIndexNpt; - ddRgb8NormalPoint *pRgb8Npt; - ddRgb16NormalPoint *pRgb16Npt; - ddRgbFloatNormalPoint *pRgbFloatNpt; - ddHsvNormalPoint *pHsvNpt; - ddHlsNormalPoint *pHlsNpt; - ddCieNormalPoint *pCieNpt; - ddIndexEdgePoint *pIndexEpt; - ddRgb8EdgePoint *pRgb8Ept; - ddRgb16EdgePoint *pRgb16Ept; - ddRgbFloatEdgePoint *pRgbFloatEpt; - ddHsvEdgePoint *pHsvEpt; - ddHlsEdgePoint *pHlsEpt; - ddCieEdgePoint *pCieEpt; - ddNormEdgePoint *pNEpt; - ddIndexNormEdgePoint *pIndexNEpt; - ddRgb8NormEdgePoint *pRgb8NEpt; - ddRgb16NormEdgePoint *pRgb16NEpt; - ddRgbFloatNormEdgePoint *pRgbFloatNEpt; - ddHsvNormEdgePoint *pHsvNEpt; - ddHlsNormEdgePoint *pHlsNEpt; - ddCieNormEdgePoint *pCieNEpt; - ddCoord4D *p4Dpt; - ddIndexPoint4D *pIndexpt4D; - ddRgb8Point4D *pRgb8pt4D; - ddRgb16Point4D *pRgb16pt4D; - ddRgbFloatPoint4D *pRgbFloatpt4D; - ddHsvPoint4D *pHsvpt4D; - ddHlsPoint4D *pHlspt4D; - ddCiePoint4D *pCiept4D; - ddNormalPoint4D *pNpt4D; - ddEdgePoint4D *pEpt4D; - ddIndexNormalPoint4D *pIndexNpt4D; - ddRgb8NormalPoint4D *pRgb8Npt4D; - ddRgb16NormalPoint4D *pRgb16Npt4D; - ddRgbFloatNormalPoint4D *pRgbFloatNpt4D; - ddHsvNormalPoint4D *pHsvNpt4D; - ddHlsNormalPoint4D *pHlsNpt4D; - ddCieNormalPoint4D *pCieNpt4D; - ddIndexEdgePoint4D *pIndexEpt4D; - ddRgb8EdgePoint4D *pRgb8Ept4D; - ddRgb16EdgePoint4D *pRgb16Ept4D; - ddRgbFloatEdgePoint4D *pRgbFloatEpt4D; - ddHsvEdgePoint4D *pHsvEpt4D; - ddHlsEdgePoint4D *pHlsEpt4D; - ddCieEdgePoint4D *pCieEpt4D; - ddNormEdgePoint4D *pNEpt4D; - ddIndexNormEdgePoint4D *pIndexNEpt4D; - ddRgb8NormEdgePoint4D *pRgb8NEpt4D; - ddRgb16NormEdgePoint4D *pRgb16NEpt4D; - ddRgbFloatNormEdgePoint4D *pRgbFloatNEpt4D; - ddHsvNormEdgePoint4D *pHsvNEpt4D; - ddHlsNormEdgePoint4D *pHlsNEpt4D; - ddCieNormEdgePoint4D *pCieNEpt4D; - char *ptr; -} ddPointUnion; - -/* - * Last - create a point header data structure - * - * Note: any changes to this structure MUST also be - * made to the MarkerlistofddPoint structure below. - */ -typedef struct { - ddULONG numPoints; /* number of vertices in list */ - ddULONG maxData; /* allocated data in bytes */ - ddPointUnion pts; /* pointer to vertex data */ -} listofddPoint; - -/* - * Create a parallel structure to listofddPoint for - * pre-initializing Markers. Note that the listofddPoint - * structure and the MarkerlistofddPoint structure MUST always - * match with the exception of the union elememt. - */ -typedef struct { - ddULONG numPoints; /* number of vertices in list */ - ddULONG maxData; /* allocated data in bytes */ - ddCoord2D *pts; -} MarkerlistofddPoint; - -typedef struct { - ddUSHORT order; - ddFLOAT uMin; - ddFLOAT uMax; - ddULONG numKnots; - ddFLOAT *pKnots; - listofddPoint points; -} ddNurbCurve; - -typedef enum { - DD_FACET_NONE=0, /* no facet attributes */ - DD_FACET_INDEX=1, /* facet colour */ - DD_FACET_RGB8=2, /* facet colour */ - DD_FACET_RGB16=3, /* facet colour */ - DD_FACET_RGBFLOAT=4, /* facet colour */ - DD_FACET_HSV=5, /* facet colour */ - DD_FACET_HLS=6, /* facet colour */ - DD_FACET_CIE=7, /* facet colour */ - DD_FACET_NORM=8, /* facet normal */ - DD_FACET_INDEX_NORM=9, /* facet colour & normal */ - DD_FACET_RGB8_NORM=10, /* facet colour & normal */ - DD_FACET_RGB16_NORM=11, /* facet colour & normal */ - DD_FACET_RGBFLOAT_NORM=12, /* facet colour & normal */ - DD_FACET_HSV_NORM=13, /* facet colour & normal */ - DD_FACET_HLS_NORM=14, /* facet colour & normal */ - DD_FACET_CIE_NORM=15 /* facet colour & normal */ -} ddFacetType; - -/* - * A useful macro to determine the size of a facet - * - */ -#define DDFacetSIZE(type, size) \ - switch((type)){ \ - case(DD_FACET_NONE): (size) = 0; \ - break; \ - case(DD_FACET_INDEX): (size) = sizeof(ddIndexedColour); \ - break; \ - case(DD_FACET_RGB8): (size) = sizeof(ddRgb8Colour); \ - break; \ - case(DD_FACET_RGB16): (size) = sizeof(ddRgb16Colour); \ - break; \ - case(DD_FACET_RGBFLOAT): (size) = sizeof(ddRgbFloatColour); \ - break; \ - case(DD_FACET_HSV): (size) = sizeof(ddHsvColour); \ - break; \ - case(DD_FACET_HLS): (size) = sizeof(ddHlsColour); \ - break; \ - case(DD_FACET_CIE): (size) = sizeof(ddCieColour); \ - break; \ - case(DD_FACET_NORM): (size) = sizeof(ddVector3D); \ - break; \ - case(DD_FACET_INDEX_NORM): (size) = sizeof(ddIndexNormal); \ - break; \ - case(DD_FACET_RGB8_NORM): (size) = sizeof(ddRgb8Normal); \ - break; \ - case(DD_FACET_RGB16_NORM): (size) = sizeof(ddRgb16Normal); \ - break; \ - case(DD_FACET_RGBFLOAT_NORM): (size) = sizeof(ddRgbFloatNormal);\ - break; \ - case(DD_FACET_HSV_NORM): (size) = sizeof(ddHsvNormal); \ - break; \ - case(DD_FACET_HLS_NORM): (size) = sizeof(ddHlsNormal); \ - break; \ - case(DD_FACET_CIE_NORM): (size) = sizeof(ddCieNormal); \ - break; \ - default: (size) = -1; \ - } - -/* - * more facet macros for determining type. - */ -#define DD_IsFacetNormal(type) \ -((((int)type)>=((int)DD_FACET_NORM))&&(((int)type)<=((int)DD_FACET_CIE_NORM))) -#define DD_IsFacetColour(type) \ -( ((type) != DD_FACET_NONE) && ((type) != DD_FACET_NORM) ) - -typedef struct { - ddIndexedColour colour; - ddVector3D normal; -} ddIndexNormal; - -typedef struct { - ddRgb8Colour colour; - ddVector3D normal; -} ddRgb8Normal; - -typedef struct { - ddRgb16Colour colour; - ddVector3D normal; -} ddRgb16Normal; - -typedef struct { - ddRgbFloatColour colour; - ddVector3D normal; -} ddRgbFloatNormal; - -typedef struct { - ddHsvColour colour; - ddVector3D normal; -} ddHsvNormal; - -typedef struct { - ddHlsColour colour; - ddVector3D normal; -} ddHlsNormal; - -typedef struct { - ddCieColour colour; - ddVector3D normal; -} ddCieNormal; - -typedef union { - ddPointer pNoFacet; - ddIndexedColour *pFacetIndex; - ddRgb8Colour *pFacetRgb8; - ddRgb16Colour *pFacetRgb16; - ddRgbFloatColour *pFacetRgbFloat; - ddHsvColour *pFacetHsv; - ddHlsColour *pFacetHls; - ddCieColour *pFacetCie; - ddVector3D *pFacetN; - ddIndexNormal *pFacetIndexN; - ddRgb8Normal *pFacetRgb8N; - ddRgb16Normal *pFacetRgb16N; - ddRgbFloatNormal *pFacetRgbFloatN; - ddHsvNormal *pFacetHsvN; - ddHlsNormal *pFacetHlsN; - ddCieNormal *pFacetCieN; -} ddFacetUnion; - -typedef struct { - ddFacetType type; - ddULONG numFacets; /* number of facets in list */ - ddULONG maxData; /* allocated data in bytes */ - ddFacetUnion facets; /* Pointer to facet data */ -} listofddFacet; - -typedef enum { - DD_VERTEX=0, - DD_VERTEX_EDGE=1 -} ddVertIndexType; - -typedef struct { - ddUSHORT index; - ddULONG edge; -} ddVertIndexEdge; - -typedef struct { - ddVertIndexType type; - ddULONG numIndex; - union { - ddUSHORT *pVertIndex; - ddVertIndexEdge *pVertIndexE; - } index; -} listofddIndex; - -typedef struct { - ddUSHORT uOrder; - ddUSHORT vOrder; - ddFLOAT uMin; - ddFLOAT uMax; - ddFLOAT vMin; - ddFLOAT vMax; - ddFLOAT mpts; - ddFLOAT npts; - ddULONG numUKnots; - ddFLOAT *pUKnot; - ddULONG numVKnots; - ddFLOAT *pVKnot; - listofddPoint points; -} ddNurbSurface; - -typedef struct { - ddBYTE visibility; - ddUSHORT order; - ddCurveApprox curveApprox; - ddFLOAT uMin; - ddFLOAT uMax; - ddULONG numKnots; - ddFLOAT *pKnots; - ddPointType pttype; - listofddPoint points; -} ddTrimCurve; - -typedef struct { - ddULONG count; - ddTrimCurve *pTC; -} listofTrimCurve; - -/* for cell arrays */ -typedef struct { - ddSHORT colourType; - union { - ddIndexedColour *pIndex; - ddRgb8Colour *pRgb8; - ddRgb16Colour *pRgb16; - ddRgbFloatColour *pRgbFloat; - ddHsvColour *pHsv; - ddHlsColour *pHls; - ddCieColour *pCie; - } colour; -} listofColour; - -#endif /* DDPEX3_H */ Index: xc/programs/Xserver/PEX5/include/ddpex4.h diff -u xc/programs/Xserver/PEX5/include/ddpex4.h:1.2 xc/programs/Xserver/PEX5/include/ddpex4.h:removed --- xc/programs/Xserver/PEX5/include/ddpex4.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/ddpex4.h Sat Feb 28 21:41:56 2004 @@ -1,154 +0,0 @@ -/* $Xorg: ddpex4.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Sun Microsystems, -and The Open Group, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#include "ddpex.h" - -#ifndef DDPEX4_H -#define DDPEX4_H - -/* structures for ddPEX Level 4 Workstation Support */ - -typedef struct { - DrawablePtr pDrawable; - Drawable drawableId; - diLUTHandle pMarkerLUT; /* handles to LUTs and NS */ - diLUTHandle pTextLUT; - diLUTHandle pLineLUT; - diLUTHandle pIntLUT; - diLUTHandle pEdgeLUT; - diLUTHandle pColourLUT; - diLUTHandle pDepthCueLUT; - diLUTHandle pLightLUT; - diLUTHandle pColourAppLUT; - diLUTHandle pPatternLUT; - diLUTHandle pFontLUT; - diNSHandle pHighInclSet; - diNSHandle pHighExclSet; - diNSHandle pInvisInclSet; - diNSHandle pInvisExclSet; - ddEnumTypeIndex bufferMode; -} ddWksInit; - -typedef struct { - ddBYTE viewRep; - ddBYTE markerBundle; - ddBYTE textBundle; - ddBYTE lineBundle; - ddBYTE interiorBundle; - ddBYTE edgeBundle; - ddBYTE colourTable; - ddBYTE patternTable; - ddBYTE wksTransform; - ddBYTE highlightFilter; - ddBYTE invisFilter; - ddBYTE hlhsrMode; - ddBYTE strModify; - ddBYTE postStr; - ddBYTE unpostStr; - ddBYTE deleteStr; - ddBYTE refModify; - ddBYTE bufferModify; - ddBYTE lightTable; - ddBYTE depthCueTable; - ddBYTE colourApproxTable; -} ddWksDynamics; - -typedef struct { - diNSHandle incl; - diNSHandle excl; -} ddNSPair; - -typedef struct { - ddULONG numPairs; - ddULONG maxPairs; - ddNSPair *pPairs; -} listofNSPair; - -typedef struct { - ddULONG id; - ddUSHORT status; - ddCoord3D position; /* search reference position */ - ddFLOAT distance; /* search distance */ - ddUSHORT ceiling; /* search ceiling */ - ddBOOL modelClipFlag; /* model clip flag */ - listofObj *startPath; /* start path */ - listofNSPair normal; - listofNSPair inverted; -} ddSCStr; - -typedef struct { - ddTableIndex index; - ddUSHORT unused; - ddViewEntry view; -} ddViewRep; - -typedef struct { - ddUSHORT whence; - ddUSHORT unused; - ddLONG offset; -} ddElementPos; - -typedef struct { - ddElementPos position1; - ddElementPos position2; -} ddElementRange; - -typedef struct { - ddSHORT x; - ddSHORT y; -} ddDeviceCoord2D; - -typedef struct { - ddDeviceCoord2D position; - ddFLOAT distance; -} ddPC_DC_HitBox; - -typedef ddNpcSubvolume ddPC_NPC_HitVolume; - -#endif /* DDPEX4_H */ Index: xc/programs/Xserver/PEX5/include/dipex.h diff -u xc/programs/Xserver/PEX5/include/dipex.h:1.5 xc/programs/Xserver/PEX5/include/dipex.h:removed --- xc/programs/Xserver/PEX5/include/dipex.h:1.5 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/dipex.h Sat Feb 28 21:41:56 2004 @@ -1,224 +0,0 @@ -/* $Xorg: dipex.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* Pex server-private include file - */ - -#ifndef DIPEX_H -#define DIPEX_H 1 - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#include "PEX.h" -#include "PEXproto.h" -#include "PEXprotost.h" -#include "pexSwap.h" -#include "gcstruct.h" -#include "dixstruct.h" -#include "ddpex.h" -#include "misc.h" -#include "pixmap.h" - - -#define PEXCONTEXTTABLE 1 -#define PEXID(client, type) ((((client)->index)<= (n) ) || ((n) > PEXMaxOC)) { \ - err = BadValue; \ - PEX_ERR_EXIT(err, (n), cntxtPtr); } - - -#define OC_RANGE(ELTYPE) ((PEXOCAll < (ELTYPE) ) && ( PEXMaxOC >=(ELTYPE))) - -/* these arrays are in dipexExt.c */ - -#ifndef _DIPEXEXT_ -LOCAL_FLAG unsigned long add_pad_of[]; - -LOCAL_FLAG unsigned int ColourSpecSizes[]; -#endif - - -#define PADDED(PB) (PB + add_pad_of[(PB & 3)]); -#define LWORDS(PB) (((PB) + add_pad_of[((*((int *)&(PB))) & 3)])/4); - -#define WritePEXReplyToClient(CONTEXT, PEXREQUEST, DATA_SIZE, DATA) { \ - int num_bytes = (int)(DATA_SIZE); \ - (DATA)->type = X_Reply; \ - (DATA)->sequenceNumber = (CONTEXT)->client->sequence; \ - if ((CONTEXT)->pexSwapReply) \ - (CONTEXT)->pexSwapReply[(CONTEXT)->current_req->opcode]\ - ((CONTEXT), (PEXREQUEST), (DATA)); \ - (void) WriteToClient ((CONTEXT)->client, num_bytes, (char *)(DATA)); } - - -#define WritePEXBufferReply(TYPE) \ - WritePEXReplyToClient( cntxtPtr, strmPtr, \ - sizeof(TYPE) + *((int *)&(pPEXBuffer->dataSize)), \ - reply) - - -#define SETUP_INQ(TYPE) \ - pPEXBuffer->pBuf = (unsigned char *)(pPEXBuffer->pHead+sizeof(TYPE)); \ - pPEXBuffer->dataSize = 0 - - -#define SETUP_VAR_REPLY(TYPE) \ - TYPE *reply = (TYPE *)(pPEXBuffer->pHead); \ - reply->length = LWORDS(pPEXBuffer->dataSize) - - - -/* some dipex types */ - -typedef struct { - ddWKSResource dd_data; - Drawable did; -} dipexPhigsWks; - - -/* - * NOTE: The following structure has it's fields layed out in an - * order dependent way. It is created in the DI as a dipexFont, - * and is sometime referenced in the DD as a ddFontResource. - */ - -typedef struct { - ddFontResource ddFont; - long refcnt; -} dipexFont; - - -/* - Some data structures so that we can keep track of Drawables, - in case they get destroyed (about which destruction we want - notification). - */ -typedef struct _dipexWksDrawableLink { - pexPhigsWks wksid; - dipexPhigsWks *wks; - struct _dipexWksDrawableLink *next; -} dipexWksDrawableLink; - -typedef struct { - Drawable id; - DrawablePtr x_drawable; - dipexWksDrawableLink *wks_list; -} dipexWksDrawable; - - -#define GetId(PTR) (((PTR)) ? (PTR)->id : 0) - - -#undef LOCAL_FLAG - -#endif /* SERVER_PEX_H */ Index: xc/programs/Xserver/PEX5/include/pexError.h diff -u xc/programs/Xserver/PEX5/include/pexError.h:1.2 xc/programs/Xserver/PEX5/include/pexError.h:removed --- xc/programs/Xserver/PEX5/include/pexError.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/pexError.h Sat Feb 28 21:41:56 2004 @@ -1,72 +0,0 @@ -/* $Xorg: pexError.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEX_ERROR_H -#define PEX_ERROR_H - -#define NEED_EVENTS -#include "Xproto.h" -#include "dipex.h" - -#define PEX_ERROR_CODE(error_code) ((error_code) + PexErrorBase) - -#define PEX_ERR_EXIT(error_code, problem, cntxt) { \ - (cntxt)->client->errorValue = problem; \ - return(error_code); } - - -/* output command errors */ - -#define PEX_OC_ERROR(ptr, cntxt) { \ - (ptr)->type = X_Error; \ - (ptr)->sequenceNumber = (cntxt)->client->sequence; \ - (ptr)->majorCode = PexReqCode; \ - (ptr)->minorCode = MinorOpcodeOfRequest((cntxt)->client); \ - WriteEventsToClient((cntxt)->client, 1, (xEvent *)(ptr)); } - -#endif /* PEX_ERROR_H */ Index: xc/programs/Xserver/PEX5/include/pexExtract.h diff -u xc/programs/Xserver/PEX5/include/pexExtract.h:1.2 xc/programs/Xserver/PEX5/include/pexExtract.h:removed --- xc/programs/Xserver/PEX5/include/pexExtract.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/pexExtract.h Sat Feb 28 21:41:56 2004 @@ -1,365 +0,0 @@ -/* $Xorg: pexExtract.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEX_EXTRACT_H -#define PEX_EXTRACT_H 1 - -/** Note that these extract macros, when dealing with data items which - ** require more than a few bytes of storage (the only exceptions being - ** CARD8, CARD16, and CARD32), simply set the destination to point into - ** the packet from which the data is being "extracted". This is - ** legal since the data is in the correct format (PEX format) in - ** that packet. The pointer into the packet is then - ** incremented by the appropriate number of bytes. - **/ - -#define REFER_COORD3D(dstPtr, srcPtr) { \ - (dstPtr) = (ddCoord3D *)(srcPtr); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(pexCoord3D); } - -#define REFER_LISTOF_COORD3D(num, dstPtr, srcPtr) { \ - (dstPtr) = (ddCoord3D *)(srcPtr); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + num * sizeof(pexCoord3D); } - -#define REFER_LISTOF_COORD2D(num, dstPtr, srcPtr) { \ - (dstPtr) = (ddCoord2D *)(srcPtr); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + num * sizeof(pexCoord2D); } - -#define REFER_LISTOF_CARD16(num, dstPtr, srcPtr) { \ - (dstPtr) = (CARD16 *)(srcPtr); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + num * sizeof(CARD16); } - -#define REFER_CARD8(dst, srcPtr) { \ - (dst) = *((CARD8 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD8); } - -#define REFER_CARD16(dst, srcPtr) { \ - (dst) = *((CARD16 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD16); } - -#define REFER_CARD32(dst, srcPtr) { \ - (dst) = *((CARD32 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD32); } - -#define REFER_FLOAT(dst, srcPtr) { \ - (dst) = *((PEXFLOAT *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(PEXFLOAT); } - -/** This is a very general macro which will set the destination pointer to - ** be whatever the src pointer is, typecast to the specified type. The - ** src pointer is then incremented by the size of the specified type - ** multiplied by a factor representing the number of such structures to - ** be skipped over. - **/ - -#define REFER_STRUCT(num, data_type, dstPtr, srcPtr) { \ - (dstPtr) = (data_type *)(srcPtr); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + num * sizeof(data_type); } - - -/* - The next set of macros actually copy the data from a packet - into the destination data structure. -*/ - -#define EXTRACT_COORD3D(dstPtr, srcPtr) { \ - (dstPtr)->x = ((pexCoord3D *)((srcPtr)))->x; \ - (dstPtr)->y = ((pexCoord3D *)(srcPtr))->y; \ - (dstPtr)->z = ((pexCoord3D *)(srcPtr))->z; \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(pexCoord3D); } - -#define EXTRACT_VECTOR3D(dstPtr, srcPtr) { \ - (dstPtr)->x = ((pexVector3D *)((srcPtr)))->x; \ - (dstPtr)->y = ((pexVector3D *)(srcPtr))->y; \ - (dstPtr)->z = ((pexVector3D *)(srcPtr))->z; \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(pexVector3D); } - -#define EXTRACT_LISTOF_COORD3D(num, dstPtr, srcPtr) \ - EXTRACT_STRUCT(num, ddCoord3D, dstPtr, srcPtr) - -#define EXTRACT_COORD2D(dstPtr, srcPtr) { \ - (dstPtr)->x = ((pexCoord2D *)(srcPtr))->x; \ - (dstPtr)->y = ((pexCoord2D *)(srcPtr))->y; \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(pexCoord2D); } - -#define EXTRACT_VECTOR2D(dstPtr, srcPtr) { \ - (dstPtr)->x = ((pexVector2D *)(srcPtr))->x; \ - (dstPtr)->y = ((pexVector2D *)(srcPtr))->y; \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(pexVector2D); } - -#define EXTRACT_LISTOF_COORD2D(num, dstPtr, srcPtr) \ - EXTRACT_STRUCT(num, ddCoord2D, dstPtr, srcPtr) - -/* Takes a CARD8 from a 4 byte Protocol Field */ -#define EXTRACT_CARD8_FROM_4B(dst, srcPtr) { \ - (dst) = (CARD8) (*((CARD32 *)(srcPtr))); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD32); } - -#define EXTRACT_CARD8(dst, srcPtr) { \ - (dst) = *((CARD8 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD8); } - -/* Takes a CARD16 from a 4 byte Protocol Field */ -#define EXTRACT_CARD16_FROM_4B(dst, srcPtr) { \ - (dst) = (CARD16) (*((CARD32 *)(srcPtr))); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD32); } - -/* Takes a INT16 from a 4 byte Protocol Field */ -#define EXTRACT_INT16_FROM_4B(dst, srcPtr) { \ - (dst) = (INT16) (*((CARD32 *)(srcPtr))); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD32); } - -#define EXTRACT_CARD16(dst, srcPtr) { \ - (dst) = *((CARD16 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD16); } - -#define EXTRACT_INT16(dst, srcPtr) { \ - (dst) = *((INT16 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(INT16); } - -#define EXTRACT_CARD32(dst, srcPtr) { \ - (dst) = *((CARD32 *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(CARD32); } - -#define EXTRACT_FLOAT(dst, srcPtr) { \ - (dst) = *((PEXFLOAT *)(srcPtr)); \ - (srcPtr) = ((CARD8 *) (srcPtr)) + sizeof(PEXFLOAT); } - - -#define EXTRACT_COLOUR_SPECIFIER(dst, srcPtr) { \ - EXTRACT_CARD16 ((dst).colourType, (srcPtr));\ - SKIP_PADDING ((srcPtr), 2);\ - switch ((dst).colourType) {\ - case PEXIndexedColour: {\ - EXTRACT_CARD16((dst).colour.indexed.index, (srcPtr));\ - SKIP_PADDING((srcPtr),2);\ - break;\ - }\ - case PEXRgbFloatColour: {\ - EXTRACT_FLOAT((dst).colour.rgbFloat.red,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.rgbFloat.green,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.rgbFloat.blue,(srcPtr));\ - break;\ - }\ - case PEXCieFloatColour: {\ - EXTRACT_FLOAT((dst).colour.cieFloat.x,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.cieFloat.y,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.cieFloat.z,(srcPtr));\ - break;\ - }\ - case PEXHsvFloatColour: {\ - EXTRACT_FLOAT((dst).colour.hsvFloat.hue,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.hsvFloat.saturation,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.hsvFloat.value,(srcPtr));\ - break;\ - }\ - case PEXHlsFloatColour: {\ - EXTRACT_FLOAT((dst).colour.hlsFloat.hue,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.hlsFloat.lightness,(srcPtr));\ - EXTRACT_FLOAT((dst).colour.hlsFloat.saturation,(srcPtr));\ - break;\ - }\ - case PEXRgb8Colour: {\ - EXTRACT_CARD8((dst).colour.rgb8.red,(srcPtr));\ - EXTRACT_CARD8((dst).colour.rgb8.green,(srcPtr));\ - EXTRACT_CARD8((dst).colour.rgb8.blue,(srcPtr));\ - SKIP_PADDING((srcPtr),1);\ - break;\ - }\ - case PEXRgb16Colour: {\ - EXTRACT_CARD16((dst).colour.rgb16.red,(srcPtr));\ - EXTRACT_CARD16((dst).colour.rgb16.green,(srcPtr));\ - EXTRACT_CARD16((dst).colour.rgb16.blue,(srcPtr));\ - SKIP_PADDING((srcPtr),2);\ - break;\ - }\ - }} - -/* JSH - assuming copy may overlap */ -#define EXTRACT_STRUCT(num, data_type, dstPtr, srcPtr) {\ - memmove( (char *)(dstPtr), (char *)(srcPtr), \ - (int)(num * sizeof(data_type)));\ - (srcPtr) = ((CARD8 *) (srcPtr)) + num * sizeof(data_type); } - -/* - The next set of macros actually copy the data from a structure - into the destination reply packet. -*/ - -#define PACK_COORD3D(srcPtr, dstPtr) { \ - ((pexCoord3D *)(dstPtr))->x = (srcPtr)->x; \ - ((pexCoord3D *)(dstPtr))->y = (srcPtr)->y; \ - ((pexCoord3D *)(dstPtr))->z = (srcPtr)->z; \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(pexCoord3D); } - -#define PACK_LISTOF_COORD3D(NUM, SRC, DST) \ - PACK_LISTOF_STRUCT(NUM, pexCoord3D, SRC, DST) - -#define PACK_COORD2D(srcPtr, dstPtr) { \ - ((pexCoord2D *)(dstPtr))->x = (srcPtr)->x; \ - ((pexCoord2D *)(dstPtr))->y = (srcPtr)->y; \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(pexCoord2D); } - -#define PACK_LISTOF_COORD2D(NUM, SRC, DST) \ - PACK_LISTOF_STRUCT(NUM, pexCoord2D, SRC, DST) - -#define PACK_VECTOR3D(srcPtr, dstPtr) { \ - ((pexVector3D *)(dstPtr))->x = (srcPtr)->x; \ - ((pexVector3D *)(dstPtr))->y = (srcPtr)->y; \ - ((pexVector3D *)(dstPtr))->z = (srcPtr)->z; \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(pexCoord3D); } - -#define PACK_VECTOR2D(srcPtr, dstPtr) { \ - ((pexVector2D *)(dstPtr))->x = (srcPtr)->x; \ - ((pexVector2D *)(dstPtr))->y = (srcPtr)->y; \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(pexCoord2D); } - - -#define PACK_CARD8(src, dstPtr) {\ - *((CARD8 *)(dstPtr)) = (CARD8)(src);\ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(CARD8); } - -#define PACK_CARD16(src, dstPtr) { \ - *((CARD16 *)(dstPtr)) = (CARD16)(src); \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(CARD16); } - -#define PACK_INT16(src, dstPtr) { \ - *((INT16 *)(dstPtr)) = (INT16)(src);\ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(INT16); } - -#define PACK_CARD32(src, dstPtr) { \ - *((CARD32 *)(dstPtr)) = (CARD32)(src); \ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(CARD32); } - -#define PACK_FLOAT(src, dstPtr) {\ - *((PEXFLOAT *)(dstPtr)) = (PEXFLOAT)(src);\ - (dstPtr) = ((CARD8 *) (dstPtr)) + sizeof(PEXFLOAT); } - - -#define PACK_COLOUR_SPECIFIER(src, dstPtr) {\ - PACK_CARD16 ((src).colourType, (dstPtr));\ - SKIP_PADDING ((dstPtr), 2);\ - switch ((src).colourType) {\ - case PEXIndexedColour: {\ - PACK_CARD16((src).colour.indexed.index,(dstPtr));\ - SKIP_PADDING((dstPtr),2);\ - break;\ - }\ - case PEXRgbFloatColour: {\ - PACK_FLOAT((src).colour.rgbFloat.red,(dstPtr));\ - PACK_FLOAT((src).colour.rgbFloat.green,(dstPtr));\ - PACK_FLOAT((src).colour.rgbFloat.blue,(dstPtr));\ - break;\ - }\ - case PEXCieFloatColour: {\ - PACK_FLOAT((src).colour.cieFloat.x,(dstPtr));\ - PACK_FLOAT((src).colour.cieFloat.y,(dstPtr));\ - PACK_FLOAT((src).colour.cieFloat.z,(dstPtr));\ - break;\ - }\ - case PEXHsvFloatColour: {\ - PACK_FLOAT((src).colour.hsvFloat.hue,(dstPtr));\ - PACK_FLOAT((src).colour.hsvFloat.saturation,(dstPtr));\ - PACK_FLOAT((src).colour.hsvFloat.value,(dstPtr));\ - break;\ - }\ - case PEXHlsFloatColour: {\ - PACK_FLOAT((src).colour.hlsFloat.hue,(dstPtr));\ - PACK_FLOAT((src).colour.hlsFloat.lightness,(dstPtr));\ - PACK_FLOAT((src).colour.hlsFloat.saturation,(dstPtr));\ - break;\ - }\ - case PEXRgb8Colour: {\ - PACK_CARD8((src).colour.rgb8.red,(dstPtr));\ - PACK_CARD8((src).colour.rgb8.green,(dstPtr));\ - PACK_CARD8((src).colour.rgb8.blue,(dstPtr));\ - SKIP_PADDING((dstPtr),1);\ - break;\ - }\ - case PEXRgb16Colour: {\ - PACK_CARD16((src).colour.rgb16.red,(dstPtr));\ - PACK_CARD16((src).colour.rgb16.green,(dstPtr));\ - PACK_CARD16((src).colour.rgb16.blue,(dstPtr));\ - SKIP_PADDING((dstPtr),2);\ - break;\ - }\ - }} - -/* JSH - assuming copy may overlap */ -#define PACK_STRUCT(data_type,srcPtr,dstPtr) { \ - memmove( (char *)(dstPtr), (char *)(srcPtr), \ - sizeof(data_type)); \ - SKIP_STRUCT(dstPtr, 1, data_type); } - -/* JSH - assuming copy may overlap */ -#define PACK_LISTOF_STRUCT(num,data_type,srcPtr,dstPtr){\ - memmove( (char *)(dstPtr), (char *)(srcPtr), \ - (int)(num * sizeof(data_type))); \ - SKIP_STRUCT(dstPtr, num, data_type); } -/* - Other useful macros - */ - -#define SKIP_PADDING(skipPtr, bytesToSkip) \ - (skipPtr) = ((CARD8 *) (skipPtr)) + bytesToSkip - -#define SKIP_STRUCT(skipPtr, num, data_type) \ - (skipPtr) = (unsigned char *)(((data_type *)skipPtr) + (num)) - -#define SIZE_COLOURSPEC(cs) ColourSpecSizes[cs.colourType] - -/* -###define SIZE_COLOURSPEC(cs) \ - (cs->colourType == PEXIndexedColour)?sizeof(CARD32):\ - ((cs->colourType == PEXRgb8Colour)?sizeof(CARD32):\ - ((cs->colourType == PEXRgb16Colour)?2*sizeof(CARD32):\ - 3*sizeof(PEXFLOAT) ) ) -*/ - -#endif /* PEX_EXTRACT_H */ Index: xc/programs/Xserver/PEX5/include/pexLookup.h diff -u xc/programs/Xserver/PEX5/include/pexLookup.h:1.2 xc/programs/Xserver/PEX5/include/pexLookup.h:removed --- xc/programs/Xserver/PEX5/include/pexLookup.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/pexLookup.h Sat Feb 28 21:41:56 2004 @@ -1,111 +0,0 @@ -/* $Xorg: pexLookup.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEX_LOOKUP_H -#define PEX_LOOKUP_H 1 - -#include "resource.h" -#include "dipex.h" - -/* PEX types */ - -#define LU_PEXFONT(id, ptr) \ - if (! ((ptr) = (diFontHandle) LookupIDByType ((id), PEXFontType)) ) { \ - err = PEX_ERROR_CODE(PEXFontError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_TABLE(id, ptr) \ - if (! ((ptr) = (diLUTHandle) LookupIDByType ((id), PEXLutType)) ) { \ - err = PEX_ERROR_CODE(PEXLookupTableError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_NAMESET(id,ns_handle) \ - if (! (ns_handle = (diNSHandle) LookupIDByType ((id), PEXNameType)) ) { \ - err = PEX_ERROR_CODE(PEXNameSetError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_PHIGSWKS(id,ptr) \ - if (! ((ptr) = (dipexPhigsWks *) LookupIDByType ((id), PEXWksType)) ) { \ - err = PEX_ERROR_CODE(PEXPhigsWksError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_PICKMEASURE(id,ptr) \ - if (! ((ptr) = (diPMHandle) LookupIDByType ((id), PEXPickType)) ) { \ - err = PEX_ERROR_CODE(PEXPickMeasureError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_PIPELINECONTEXT(id,ptr) \ - if (! ((ptr) = (ddPCStr *) LookupIDByType ((id), PEXPipeType)) ) { \ - err = PEX_ERROR_CODE(PEXPipelineContextError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_RENDERER(id, ptr) \ - if (! ((ptr) = (ddRendererStr *)LookupIDByType((id), PEXRendType)) ) { \ - err = PEX_ERROR_CODE(PEXRendererError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_SEARCHCONTEXT(id,ptr) \ - if (! ((ptr) = (ddSCStr *) LookupIDByType ((id), PEXSearchType)) ) { \ - err = PEX_ERROR_CODE(PEXSearchContextError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - -#define LU_STRUCTURE(id,ptr) \ - if (! ((ptr) = (diStructHandle) LookupIDByType ((id), PEXStructType))) {\ - err = PEX_ERROR_CODE(PEXStructureError); \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - - -/* Other useful types */ - -#define LU_DRAWABLE(id,ptr) \ - if (!((ptr) = (DrawablePtr) LookupIDByClass ((id), RC_DRAWABLE))) { \ - err = BadDrawable; \ - PEX_ERR_EXIT(err,(id),cntxtPtr); } - - -#endif Index: xc/programs/Xserver/PEX5/include/pexSwap.h diff -u xc/programs/Xserver/PEX5/include/pexSwap.h:1.2 xc/programs/Xserver/PEX5/include/pexSwap.h:removed --- xc/programs/Xserver/PEX5/include/pexSwap.h:1.2 Fri Dec 14 14:57:54 2001 +++ xc/programs/Xserver/PEX5/include/pexSwap.h Sat Feb 28 21:41:56 2004 @@ -1,78 +0,0 @@ -/* $Xorg: pexSwap.h,v 1.4 2001/02/09 02:04:18 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* - * Swapping information used by both the dipex portions of the - * server and by the archive sections of the api. - */ - -#ifndef PEXSWAP_H -#define PEXSWAP_H 1 - -#include "PEXErr.h" - -typedef void (*ConvFunction)(); -typedef void (*SwapShortFunction)(); -typedef void (*SwapLongFunction)(); -typedef ErrorCode (*OCFunction)(); - -typedef struct { - SwapShortFunction ConvertCARD16; - SwapLongFunction ConvertCARD32; - ConvFunction ConvertFLOAT; -} pexSwap; - -extern void SwapCARD16(); -extern void SwapCARD32(); -extern void SwapFLOAT(); -extern void ConvertFLOAT(); - -/* not sure if this is the right place for this */ -extern void SwapPEXMaxHitsReachedEvent(); - -#endif Index: xc/programs/Xserver/PEX5/include/pexUtils.h diff -u xc/programs/Xserver/PEX5/include/pexUtils.h:1.2 xc/programs/Xserver/PEX5/include/pexUtils.h:removed --- xc/programs/Xserver/PEX5/include/pexUtils.h:1.2 Fri Dec 14 14:57:55 2001 +++ xc/programs/Xserver/PEX5/include/pexUtils.h Sat Feb 28 21:41:56 2004 @@ -1,100 +0,0 @@ -/* $Xorg: pexUtils.h,v 1.4 2001/02/09 02:04:19 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEXUTILS_H -#define PEXUTILS_H - -#include "ddpex.h" - -/* declarations for the utilities in pexUtils.c */ -extern listofObj *puCreateList(); -extern void puDeleteList(); -extern short puInList(); -extern short puAddToList(); -extern short puRemoveFromList(); -extern short puCopyList(); -extern short puMergeLists(); -extern int puBuffRealloc(); -extern void puInitList(); -extern int puCountList(); - -/* useful macros to use with lists */ -#define PU_TRUE 1 -#define PU_FALSE 0 - -#define PU_BAD_LIST -1 /* error returned by list utilities */ - -#define PU_EMPTY_LIST( plist ) \ - (plist)->numObj = 0 - -#define PU_REMOVE_LAST_OBJ( plist ) \ - if ( (plist)->numObj > 0 ) (plist)->numObj-- - -/* useful macros to use with ddBuffer */ -#define PU_BUF_HDR_SIZE(pBuffer) \ - (int) (((char *) pBuffer->pBuf) - ((char *) pBuffer->pHead)) - -#define PU_BUF_TOO_SMALL(pBuffer,minSize) \ - ((minSize) > ((pBuffer->bufSize) - PU_BUF_HDR_SIZE(pBuffer) + 1)) - -#define PU_CHECK_BUFFER_SIZE( pBuffer, size ) \ - if ( PU_BUF_TOO_SMALL((pBuffer), (size)) ) \ - if (puBuffRealloc((pBuffer), (ddULONG)(size)) != Success ) \ - { \ - (pBuffer)->dataSize = 0; \ - return( BadAlloc ); \ - } - -/* - useful macro for ensuring that lists of shorts allocate full longwords - */ -#define MAKE_EVEN(_n) \ - ( (_n)%2 ? (_n)+1 : (_n) ) - - -#endif /* PEXUTILS_H */ Index: xc/programs/Xserver/PEX5/include/pex_site.h diff -u xc/programs/Xserver/PEX5/include/pex_site.h:1.2 xc/programs/Xserver/PEX5/include/pex_site.h:removed --- xc/programs/Xserver/PEX5/include/pex_site.h:1.2 Fri Dec 14 14:57:55 2001 +++ xc/programs/Xserver/PEX5/include/pex_site.h Sat Feb 28 21:41:56 2004 @@ -1,86 +0,0 @@ -/* $Xorg: pex_site.h,v 1.4 2001/02/09 02:04:19 xorgcvs Exp $ */ - -/*********************************************************** - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef PEX_SITE -#define PEX_SITE 1 - - -/* - Server native formats - */ -#define LOCAL_PEX_NAME "X3D-PEX" -#define PEX_VENDOR "X3D-PEX Sample Implementation" -#define PEX_RELEASE_NUMBER 0 -#define PEX_SUBSET PEXCompleteImplementation - -#define SERVER_NATIVE_FP PEXIeee_754_32 -#define OTHER_FP PEXDEC_F_Floating -#define SERVER_SUPPORTED_COLOURS PEXRgbFloatColour - -/* - Server supported formats - */ -#define CHECK_FP_FORMAT(FP) \ - if ((FP != PEXIeee_754_32) && (FP != PEXDEC_F_Floating)) { \ - err = PEX_ERROR_CODE(PEXFloatingPointFormatError); \ - PEX_ERR_EXIT(err,0,cntxtPtr); } - -#define CHECK_COLOUR_FORMAT(C) \ - if (C != SERVER_SUPPORTED_COLOURS) { \ - err = PEX_ERROR_CODE(PEXDirectColourFormatError); \ - PEX_ERR_EXIT(err,0,cntxtPtr); } - - -/* - Font path - */ -#ifdef FONTDIR -#define FONT_DIRECTORY FONTDIR/PEXfonts -#endif - -#endif Index: xc/programs/Xserver/PEX5/include/pexos.h diff -u xc/programs/Xserver/PEX5/include/pexos.h:1.3 xc/programs/Xserver/PEX5/include/pexos.h:removed --- xc/programs/Xserver/PEX5/include/pexos.h:1.3 Wed Jul 25 11:04:59 2001 +++ xc/programs/Xserver/PEX5/include/pexos.h Sat Feb 28 21:41:57 2004 @@ -1,56 +0,0 @@ -/* $XFree86: xc/programs/Xserver/PEX5/include/pexos.h,v 1.3 2001/07/25 15:04:59 dawes Exp $ */ - -/* - * This file contains all external OS/ANSI header includes, prototypes and - * definitions. - */ - -#ifndef _PEXOS_H_ -#define _PEXOS_H_ - -#ifndef XFree86LOADER -#include -#include -#include - -#ifdef NEED_OS_LIMITS -#ifndef X_NOT_POSIX -#ifdef _POSIX_SOURCE -#include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif -#endif /* X_NOT_POSIX */ -#ifndef PATH_MAX -#ifdef WIN32 -#define PATH_MAX 512 -#else -#include -#endif -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif -#endif /* PATH_MAX */ -#endif /* NEED_OS_LIMITS */ - -#ifdef NEED_GETENV - -#include -#include -#endif /* NEED_GETENV */ - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#else -#include "xf86_ansic.h" -#endif - -#endif /* _PEXOS_H_ */ Index: xc/programs/Xserver/PEX5/ospex/Imakefile diff -u xc/programs/Xserver/PEX5/ospex/Imakefile:3.15 xc/programs/Xserver/PEX5/ospex/Imakefile:removed --- xc/programs/Xserver/PEX5/ospex/Imakefile:3.15 Wed Jan 17 17:12:43 2001 +++ xc/programs/Xserver/PEX5/ospex/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,84 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:20 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/programs/Xserver/PEX5/ospex/Imakefile,v 3.15 2001/01/17 22:12:43 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the names of Sun Microsystems -XCOMM and the X Consortium not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define IHaveModules -#include - -#ifndef PassCDebugFlags -#define PassCDebugFlags -#endif - -#ifndef PexDipexCDebugFlags -#define PexDipexCDebugFlags ServerCDebugFlags -#endif - -.SUFFIXES: .o .a - -RDR_STUBS = -DRENDER_CMDS -ST_STUBS = -DSTORE_CMDS - - CDEBUGFLAGS = PexDipexCDebugFlags - FONTDEFINES = -DPEX_DEFAULT_FONTPATH=\"$(FONTDIR)/PEX\" - DEFINES = ExtensionDefines PexDipexDefines $(FONTDEFINES) - - LINTLIBS = ../../../../server/dix/llib-ldix.ln \ - ../../../../server/os/4.2bsd/llib-los.ln \ - ../ddpex/mi/level4/llib-ldp4.ln \ - ../ddpex/mi/shared/llib-ldps.ln \ - ../dipex/swap/llib-ldsw.ln \ - ../dipex/objects/llib-lobj.ln - - PEXSRVINC = ../include -DDPEXINCLUDE = ../ddpex/mi/include - INCLUDES = -I. \ - -I$(PEXSRVINC) \ - -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/include \ - -I$(DDPEXINCLUDE) - - -SRCS = osPexFont.c - -OBJS = osPexFont.o - -PEX_OS_LIBNAME = libospex.a - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) - -LibraryModuleTarget(ospex,$(OBJS)) - -SpecialCObjectRule(osPexFont,$(ICONFIGFILES),NullParameter) - -LintLibraryTarget(osp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - Index: xc/programs/Xserver/PEX5/ospex/osPexFont.c diff -u xc/programs/Xserver/PEX5/ospex/osPexFont.c:3.19 xc/programs/Xserver/PEX5/ospex/osPexFont.c:removed --- xc/programs/Xserver/PEX5/ospex/osPexFont.c:3.19 Fri May 31 14:45:53 2002 +++ xc/programs/Xserver/PEX5/ospex/osPexFont.c Sat Feb 28 21:41:57 2004 @@ -1,688 +0,0 @@ -/* $Xorg: osPexFont.c,v 1.4 2001/02/09 02:04:19 xorgcvs Exp $ */ - -/* - -Copyright 1989, 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Sun Microsystems, -not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/PEX5/ospex/osPexFont.c,v 3.19 2002/05/31 18:45:53 dawes Exp $ */ - -#ifdef WIN32 -#define _WILLWINSOCK_ -#endif - -#include "mipex.h" -#include "miFont.h" -#include "PEXErr.h" -#define XK_LATIN1 -#include "keysymdef.h" -#define NEED_GETENV -#define NEED_OS_LIMITS -#include "pexos.h" - -#ifndef PEX_DEFAULT_FONTPATH -#define PEX_DEFAULT_FONTPATH "/usr/lib/X11/fonts/PEX" -#endif - -#ifndef WIN32 - -#ifndef XFree86LOADER - -#if !defined(X_NOT_POSIX) || defined(SYSV) || defined(__CYGWIN__) || defined(USG) -#include -#else -#include -#ifndef dirent -#define dirent direct -#endif -#endif -typedef struct dirent ENTRY; - -#ifndef FILENAME_MAX -#ifdef MAXNAMLEN -#define FILENAME_MAX MAXNAMLEN -#else -#define FILENAME_MAX 255 -#endif -#endif - -#else /* XFree86LOADER */ - -/* XXX This should be taken care of elsewhere */ -typedef struct _xf86dirent ENTRY; - -#endif /* XFree86LOADER */ - -#define FileName(file) file->d_name - -#else /* WIN32 */ - -#define BOOL wBOOL -#define ATOM wATOM -#include -#undef BOOL -#undef ATOM -#define FileName(file) file.cFileName - -#endif /* WIN32 */ - -extern void CopyISOLatin1Lowered(); -extern int get_lowered_truncated_entry(); - -void ClosePEXFontFile(); -void SetPEXFontFilePtr(); - -extern diFontHandle defaultPEXFont; - -/* - * Unless an environment variable named PEX_FONTPATH is set before the - * server is started up, PEX will look in the path defined in the - * PEX_DEFAULT_FONTPATH compiler constant defined in miFont.h for PEX fonts. - * If environment variable PEX_FONTPATH is defined, then this will - * be used as the path to the fonts . - */ - -static char * -pex_get_font_directory_path() -{ - static int already_determined = 0; - static char *font_dir_path = NULL; - - if (!already_determined) { - if (getenv("PEX_FONTPATH")) { - font_dir_path = - (char *)xalloc((unsigned long)(1+strlen(getenv("PEX_FONTPATH")))); - strcpy(font_dir_path, getenv("PEX_FONTPATH")); - } else { -#ifndef __UNIXOS2__ - font_dir_path = - (char *)xalloc((unsigned long)(1+strlen(PEX_DEFAULT_FONTPATH))); - strcpy(font_dir_path, PEX_DEFAULT_FONTPATH); -#else - char *p = (char*)__XOS2RedirRoot(PEX_DEFAULT_FONTPATH); - font_dir_path = - (char *)xalloc((unsigned long)(1+strlen(p))); - strcpy(font_dir_path, p); -#endif - } - already_determined = 1; - } - - return (font_dir_path); -} - - -/* - * The next two functions (pex_setup_wild_match() and pex_is_matching()) are - * stolen (and slightly modified) from MIT X11R4 fonts/mkfontdir/fontdir.c. - * pex_setup_wild_match() sets up some state about the pattern to match, which - * pex_is_matching() then uses. - */ - - -/* results of this function are used by pex_is_matching() */ - -static void -pex_setup_wild_match(pat, phead, ptail, plen) -char *pat; /* in */ -int *phead, *ptail, *plen; /* out */ -{ - register int head, tail; - register char c, *firstWild; - - *plen = tail = strlen(pat); - for ( firstWild = pat; - ((c = *firstWild) && !((c == XK_asterisk) || (c == XK_question))); - firstWild++) - ; - - head = firstWild - pat; - - while ((c = pat[head]) && (c != XK_asterisk)) - head++; - if (head < tail) - { - while (pat[tail-1] != XK_asterisk) - tail--; - } - *phead = head; - *ptail = tail; -} - -/* returns value greater than 0 if successful. head, tail, and plen - * come from a previous call to pex_setup_wild_match - */ -static int -pex_is_matching(string, pat, head, tail, plen) -register char *string; /* in */ -register char *pat; /* in */ -int head, tail, plen; /* in */ -{ - register int i, l; - int j, m, res; - register char cp, cs; - - res = -1; - for (i = 0; i < head; i++) - { - cp = pat[i]; - if (cp == XK_question) - { - if (!string[i]) - return res; - res = 0; - } - else if (cp != string[i]) - return res; - } - if (head == plen) - return (string[head] ? res : 1); - l = head; - while (++i < tail) - { - /* we just skipped an asterisk */ - j = i; - m = l; - while ((cp = pat[i]) != XK_asterisk) - { - if (!(cs = string[l])) - return 0; - if ((cp != cs) && (cp != XK_question)) - { - m++; - cp = pat[j]; - if (cp == XK_asterisk) - { - if (!string[m]) - return 0; - } - else - { - while ((cs = string[m]) != cp) - { - if (!cs) - return 0; - m++; - } - } - l = m; - i = j; - } - l++; - i++; - } - } - m = strlen(&string[l]); - j = plen - tail; - if (m < j) - return 0; - l = (l + m) - j; - while (cp = pat[i]) - { - if ((cp != string[l]) && (cp != XK_question)) - return 0; - l++; - i++; - } - return 1; -} - -/* - * Caller is responsible for freeing contents of buffer and buffer when - * done with it. - */ -#define ABSOLUTE_MAX_NAMES 200 - -int -pex_get_matching_names(patLen, pPattern, maxNames, numNames, names) -ddUSHORT patLen; /* in */ -ddUCHAR *pPattern; /* in */ -ddUSHORT maxNames; /* in */ -ddULONG *numNames; /* out - number of names found */ -char ***names; /* out - pointer to list of strings */ -{ -#ifdef WIN32 - HANDLE fontdirh; - WIN32_FIND_DATA dir_entry; - char path[MAX_PATH]; -#else - DIR *fontdir; - ENTRY *dir_entry; -#endif - char *pattern; - char entry[PATH_MAX+1]; - int i, head, tail, len, total = 0; - - if (!(pattern = (char *)xalloc((unsigned long)(1 + patLen)))) - return 0; - - CopyISOLatin1Lowered((unsigned char*)pattern, pPattern, patLen); - - if (!(*names = (char **)xalloc((unsigned long)(ABSOLUTE_MAX_NAMES * sizeof(char *))))) - return 0; - -#ifdef WIN32 - sprintf(path, "%s/*.*", pex_get_font_directory_path()); - if ((fontdirh = FindFirstFile(path, &dir_entry)) == INVALID_HANDLE_VALUE) { - xfree(*names); - xfree(pattern); - return 0; - } -#else - if (!(fontdir = opendir(pex_get_font_directory_path()))) { - xfree(*names); - xfree(pattern); - return 0; - } -#endif - - pex_setup_wild_match(pattern, &head, &tail, &len); - -#ifdef WIN32 - do -#else - while (total < maxNames && (dir_entry = readdir(fontdir))) -#endif - { - - if (!get_lowered_truncated_entry(FileName(dir_entry), entry)) - continue; - - if (pex_is_matching(entry, pattern, head, tail, len) > 0) { - - if (!( (*names)[total] = (char *)xalloc((unsigned long)(1 + strlen(entry))))) { - for (i = 0; i < total; i++) - xfree((*names)[i]); - xfree(*names); - xfree(pattern); - return 0; - } - - strcpy((*names)[total], entry); - total++; - } - } -#ifdef WIN32 - while (total < maxNames && FindNextFile(fontdirh, &dir_entry)); -#endif - -#ifdef WIN32 - FindClose(fontdirh); -#else - closedir(fontdir); -#endif - - *numNames = total; - - return 1; -} - -/* - * get_stroke(stroke, fp) extracts the definition of characters - * from the font file. It return -1 if anything goes wrong, 0 if - * everything is OK. - */ - -static int -get_stroke(stroke, fp) - Ch_stroke_data *stroke; - FILE *fp; -{ - listofddPoint *spath; - register int i; - unsigned long closed; /* placeholder, really unused */ - register ddULONG npath; - register miListHeader *hdr = &(stroke->strokes); - - stroke->n_vertices = 0; - npath = hdr->maxLists = hdr->numLists; - hdr->type = DD_2D_POINT; - hdr->ddList = spath = (listofddPoint *) - xalloc((unsigned long)(sizeof(listofddPoint) * npath)); - - if (spath == NULL) - return -1; - - for (i = 0; i < npath; i++, spath++) - spath->pts.p2Dpt = NULL; - - for (i = 0, spath = hdr->ddList; i < npath; i++, spath++) { - - /* for each subpath of the character definition ... */ - - if (fread((char *) &spath->numPoints, - sizeof(spath->numPoints), 1, fp) != 1 || - fread((char *) &closed, sizeof(closed), 1, fp) != 1) - return -1; - - if (spath->numPoints <= 0) - continue; - - spath->maxData = sizeof(ddCoord2D) * spath->numPoints; - - if (!(spath->pts.p2Dpt = (ddCoord2D *) xalloc((unsigned long)(spath->maxData)))) - return -1; - - if (fread((char *)spath->pts.p2Dpt, sizeof(ddCoord2D), - spath->numPoints, fp) != spath->numPoints) - return -1; - - stroke->n_vertices += spath->numPoints; - } - return 0; -} - - - -/* - read in the pex font - */ -ErrorCode -LoadPEXFontFile(length, fontname, pFont) - unsigned length; - char * fontname; - diFontHandle pFont; -{ - char fname[FILENAME_MAX+1]; - FILE *fp; - Font_file_header header; - Property *properties = 0; - Dispatch *table = 0; - miFontHeader *font = (miFontHeader *)(pFont->deviceData); - int found_first, found_it = 0, err = Success, numChars, np; - char *name_to_match; - char lowered_entry[PATH_MAX+1]; -#ifdef WIN32 - HANDLE fontdirh; - WIN32_FIND_DATA dir_entry; - char path[MAX_PATH]; -#else - DIR *fontdir; - ENTRY *dir_entry; -#endif - register int i; - register Ch_stroke_data **ch_font, *ch_stroke = 0; - register Dispatch *tblptr = 0; - register Property *propptr = 0; - register pexFontProp *fpptr = 0; - - if (!(name_to_match = (char *)xalloc((unsigned int)(1 + length)))) - return (PEXERR(PEXFontError)); - - CopyISOLatin1Lowered((unsigned char *)name_to_match, - (unsigned char *)fontname, length); - - /* open up the font directory and look for matching file names */ -#ifdef WIN32 - sprintf(path, "%s/*.*", pex_get_font_directory_path()); - if ((fontdirh = FindFirstFile(path, &dir_entry)) == INVALID_HANDLE_VALUE) - return (PEXERR(PEXFontError)); -#else - if (!(fontdir = opendir(pex_get_font_directory_path()))) - return (PEXERR(PEXFontError)); -#endif - -#ifdef WIN32 - do -#else - while(!found_it && (dir_entry = readdir(fontdir))) -#endif - { - /* strip off .phont and make all lower case */ - if (!get_lowered_truncated_entry(FileName(dir_entry), lowered_entry)) - continue; - - /* does this match what got passed in? */ - if (strcmp(lowered_entry, name_to_match) == 0) - found_it = 1; - } - xfree(name_to_match); -#ifdef WIN32 - while (!found_it && FindNextFile(fontdirh, &dir_entry) && !found_it); -#endif - - if (!found_it) - return (PEXERR(PEXFontError)); - - (void) strcpy(fname, pex_get_font_directory_path()); - (void) strcat(fname, "/"); - (void) strcat(fname, FileName(dir_entry)); - -#ifdef WIN32 - FindClose(fontdirh); -#else - closedir(fontdir); -#endif - - if ((fp = fopen(fname, "r")) == NULL) - return (PEXERR(PEXFontError)); - - /* - * read in the file header. The file header has fields containing the - * num of characters in the font, the extreme values, and number of font - * properties defined, if any. - */ - - tblptr = 0; - if (fread((char *) &header, sizeof(header), 1, fp) != 1) { - (void) ClosePEXFontFile(fp); - return (PEXERR(PEXFontError)); } - - /* Initialize font structure */ - (void) strcpy(font->name, header.name); - font->font_type = FONT_POLYLINES; - font->top = header.top; - font->bottom = header.bottom; - font->num_ch = header.num_ch; - font->font_info.numProps = (CARD32)header.num_props; - font->max_width = header.max_width; - - /* read in the font properties, if any, into font data area */ - if (header.num_props > 0) { - - (void) SetPEXFontFilePtr(fp, START_PROPS); /* Get to props position */ - properties = (Property *) xalloc(header.num_props * sizeof(Property)); - if (properties == NULL) { - (void) ClosePEXFontFile(fp); - return (BadAlloc); } - - if (fread((char *) properties, sizeof(Property), - header.num_props, fp) != header.num_props) { - xfree((char *) properties); - (void) ClosePEXFontFile(fp); - return (PEXERR(PEXFontError)); } - - /* Create space for font properties in the font data area */ - - font->properties = - (pexFontProp *) xalloc( (unsigned long)(header.num_props - * sizeof(pexFontProp))); - if (font->properties == NULL) { - xfree((char *) properties); - (void) ClosePEXFontFile(fp); - return (BadAlloc); } - - np = header.num_props; - for ( i=0, propptr = properties, fpptr = font->properties; - i < np; - i++, propptr++, fpptr++) { - - if (propptr->propname == NULL) { - (header.num_props)--; - continue; } - - fpptr->name = MakeAtom( (char *)propptr->propname, - strlen(propptr->propname), 1); - - if (propptr->propvalue != NULL) - fpptr->value = MakeAtom((char *)propptr->propvalue, - strlen(propptr->propvalue), 1); - else fpptr->value = 0; - } - - /* free up local storage allocated for properties */ - xfree((char *) properties); - } - - /* position file pointer to dispatch data */ - (void) SetPEXFontFilePtr(fp, (long) START_DISPATCH(header.num_props)); - - /* - * read in the distable font, use the offset to see if the - * character is defined or not. The strokes are defined in Phigs style. - * The "center" of the character is not the physical center. It is the - * center defined by the font designer. The actual center is half the - * "right" value. - */ - - table = (Dispatch *)xalloc((unsigned long)(sizeof(Dispatch) *font->num_ch)); - - if (table == NULL) { - (void) ClosePEXFontFile(fp); - return (BadAlloc); } - - if (fread((char *) table, sizeof(Dispatch), font->num_ch, fp) - != font->num_ch) { - xfree((char *) table); - (void) ClosePEXFontFile(fp); - return (PEXERR(PEXFontError)); } - - font->ch_data = - (Ch_stroke_data **) xalloc((unsigned long)(sizeof(Ch_stroke_data *) * - font->num_ch)); - if (font->ch_data == NULL) { - xfree((char *) table); - (void) ClosePEXFontFile(fp); - return (BadAlloc); } - - /* The next loop initializes all ch_data pointers to null; essential - for non-crashing during font clean-up in case of failed font file - read. Also count the number of non-blank chars. - */ - for ( i = 0, ch_font = font->ch_data, tblptr = table, numChars = 0; - i < font->num_ch; - i++, ch_font++, tblptr++) { - *ch_font = NULL; - if (tblptr->offset != 0) numChars++; } - - ch_stroke = (Ch_stroke_data *)xalloc((unsigned long)(numChars * - sizeof(Ch_stroke_data))); - if (!ch_stroke) { - err = BadAlloc; - goto disaster; - } - - /* read in the char data (the font file format should be changed - so that the allocation can be done outside this loop--this - method is inefficient) - */ - for ( i = 0, ch_font = font->ch_data, tblptr = table, found_first = 0; - i < font->num_ch; - i++, ch_font++, tblptr++) { - if (tblptr->offset != 0) { - (*ch_font) = ch_stroke++; - (*ch_font)->strokes.ddList = NULL; - (*ch_font)->center = table[i].center; - (*ch_font)->right = table[i].right; - - (void) SetPEXFontFilePtr(fp, tblptr->offset); - - /* read in the type, number of subpaths, and n_vertices fields */ - if ( (fread(&((*ch_font)->type), - sizeof(Font_path_type), 1, fp) != 1) - || (fread(&((*ch_font)->strokes.numLists), - sizeof(ddULONG),1,fp) != 1) - || (fread(&((*ch_font)->n_vertices), - sizeof(ddULONG), 1, fp) != 1) ) - { - err = PEXERR(PEXFontError); - goto disaster; - } - - (*ch_font)->strokes.maxLists = (*ch_font)->strokes.numLists; - if ((*ch_font)->strokes.numLists > 0) { - - if (get_stroke(*ch_font, fp)) { - err = BadAlloc; - goto disaster; } - - if (!found_first) { - font->font_info.firstGlyph = i; - found_first = 1; } - - font->font_info.lastGlyph = i; } - } - } - - xfree((char *)table); - - (void) ClosePEXFontFile(fp); - - return (Success); - -disaster: - (void) ClosePEXFontFile(fp); - if (table) xfree(table); -#if 0 - if (pFont == defaultPEXFont) defaultPEXFont = 0; /* force free */ -#endif - FreePEXFont((diFontHandle) pFont, pFont->id); - return (err); - -} -void -ClosePEXFontFile(fp) - FILE *fp; -{ - fclose (fp); -} - -void -SetPEXFontFilePtr(fp,where) - FILE *fp; - long where; -{ - (void) fseek(fp, where, SEEK_SET); /* set pointer at "where" bytes - from the beginning of the file */ -} Index: xc/programs/Xserver/XIE/Imakefile diff -u xc/programs/Xserver/XIE/Imakefile:3.17 xc/programs/Xserver/XIE/Imakefile:removed --- xc/programs/Xserver/XIE/Imakefile:3.17 Wed Jan 17 17:12:44 2001 +++ xc/programs/Xserver/XIE/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,73 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:22 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/Imakefile,v 3.17 2001/01/17 22:12:44 dawes Exp $ - -#define IHaveModules -#include - -#define IHaveSubdirs - - - SUBDIRS = dixie mixie -MakeSubdirs($(SUBDIRS)) - -#if DoLoadableServer -MSRCS = xiemodule.c -MOBJS = xiemodule.o - -DONES = \ - dixie/export/DONE \ - dixie/import/DONE \ - dixie/process/DONE \ - dixie/request/DONE \ - mixie/control/DONE \ - mixie/export/DONE \ - mixie/fax/DONE \ - mixie/import/DONE \ - mixie/jpeg/DONE \ - mixie/process/DONE - -SRCS = $(MSRCS) - -OBJS = \ - dixie/export/?*.o \ - dixie/import/?*.o \ - dixie/process/?*.o \ - dixie/request/?*.o \ - mixie/control/?*.o \ - mixie/export/?*.o \ - mixie/fax/?*.o \ - mixie/import/?*.o \ - mixie/jpeg/?*.o \ - mixie/process/?*.o \ - $(MOBJS) - -INCLUDES = -Iinclude -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) - -#if HasParallelMake -MakeMutex($(SUBDIRS) $(OBJS) $(DONES)) -#endif - -#ifndef SCO325 -REQUIREDLIBS = -lm -#endif - -ModuleObjectRule() -DepLibraryModuleTarget(xie,$(SUBDIRS) $(DONES) $(MOBJS),$(OBJS)) -InstallLibraryModule(xie,$(MODULEDIR),extensions) -ForceSubdirs($(SUBDIRS)) - -DependTarget() - -#endif - - -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - -InstallDriverSDKLibraryModule(xie,$(DRIVERSDKMODULEDIR),extensions) Index: xc/programs/Xserver/XIE/xiemodule.c diff -u xc/programs/Xserver/XIE/xiemodule.c:1.7 xc/programs/Xserver/XIE/xiemodule.c:removed --- xc/programs/Xserver/XIE/xiemodule.c:1.7 Tue Jan 25 13:37:37 2000 +++ xc/programs/Xserver/XIE/xiemodule.c Sat Feb 28 21:41:57 2004 @@ -1,43 +0,0 @@ -/* $XFree86: xc/programs/Xserver/XIE/xiemodule.c,v 1.7 2000/01/25 18:37:37 dawes Exp $ */ - -#include "xf86Module.h" -#include "XIE.h" - -static MODULESETUPPROTO(xieSetup); - -extern void XieInit(INITARGS); - -ExtensionModule XieExt = -{ - XieInit, - xieExtName, - NULL, - NULL, - NULL -}; - -static XF86ModuleVersionInfo VersRec = -{ - "xie", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XF86_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0,0,0,0} -}; - -XF86ModuleData xieModuleData = { &VersRec, xieSetup, NULL }; - -static pointer -xieSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - LoadExtension(&XieExt, FALSE); - - /* Need a non-NULL return value to indicate success */ - return (pointer)1; -} - Index: xc/programs/Xserver/XIE/dixie/Imakefile diff -u xc/programs/Xserver/XIE/dixie/Imakefile:3.16 xc/programs/Xserver/XIE/dixie/Imakefile:removed --- xc/programs/Xserver/XIE/dixie/Imakefile:3.16 Wed Jan 17 17:12:47 2001 +++ xc/programs/Xserver/XIE/dixie/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,36 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:23 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/dixie/Imakefile,v 3.16 2001/01/17 22:12:47 dawes Exp $ - -XCOMM build dixie archive - -#define IHaveModules -#include - -SUBDIRS = request import process export -OBJS = request/?*.o import/?*.o process/?*.o export/?*.o -DONES = request/DONE import/DONE process/DONE export/DONE - -#define IHaveSubdirs - - -#if HasParallelMake -MakeMutex($(SUBDIRS) $(OBJS) $(DONES)) -#endif - -#if HasGnuMake || HasBsdMake -$(DONES): $(SUBDIRS) -#endif - -DepLibraryModuleTarget(dixie,$(SUBDIRS) $(DONES),$(OBJS)) - -ForceSubdirs($(SUBDIRS)) - -DependSubdirs($(SUBDIRS)) - -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - Index: xc/programs/Xserver/XIE/dixie/export/Imakefile diff -u xc/programs/Xserver/XIE/dixie/export/Imakefile:3.6 xc/programs/Xserver/XIE/dixie/export/Imakefile:removed --- xc/programs/Xserver/XIE/dixie/export/Imakefile:3.6 Wed Jan 17 17:12:48 2001 +++ xc/programs/Xserver/XIE/dixie/export/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,37 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:23 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/dixie/export/Imakefile,v 3.6 2001/01/17 22:12:48 dawes Exp $ - -XCOMM build device independent export element objects - -#define IHaveModules -#include - -SRCS1 = eclut.c ecphoto.c edraw.c edrawp.c elut.c ephoto.c -OBJS1 = eclut.o ecphoto.o edraw.o edrawp.o elut.o ephoto.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = echist.c ecroi.c eroi.c -OBJS2 = echist.o ecroi.o eroi.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) - LINTLIBS = ../export/llib-lexp.ln ../import/llib-limp.ln \ - ../process/llib-lproc.ln ../request/llib-lreq.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(exp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/dixie/export/echist.c diff -u xc/programs/Xserver/XIE/dixie/export/echist.c:3.5 xc/programs/Xserver/XIE/dixie/export/echist.c:removed --- xc/programs/Xserver/XIE/dixie/export/echist.c:3.5 Fri Dec 14 14:57:57 2001 +++ xc/programs/Xserver/XIE/dixie/export/echist.c Sat Feb 28 21:41:57 2004 @@ -1,202 +0,0 @@ -/* $Xorg: echist.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module echist.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - echist.c -- DIXIE routines for managing the ExportClientHistogram elem. - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/echist.c,v 3.5 2001/12/14 19:57:57 dawes Exp $ */ - -#define _XIEC_ECHIST - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepECHistogram(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec eHistogramVec = { - PrepECHistogram /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ --------------- routine: make an ExportClientHistogram element ------------ -------------------------------------------------------------------------*/ -peDefPtr MakeECHistogram(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportClientHistogram); - ELEMENT_SIZE_MATCH(xieFloExportClientHistogram); - ELEMENT_NEEDS_1_INPUT(src); - - inputs = 1 + (stuff->domainPhototag ? 1 : 0); - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemExportClientHistogram, return(NULL)); - - ped->diVec = &eHistogramVec; - ped->phototag = tag; - ped->flags.export = TRUE; - ped->flags.getData = TRUE; - raw = (xieFloExportClientHistogram *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->notify = stuff->notify; - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportClientHistogram)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - if(raw->domainPhototag) - inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - - return(ped); -} /* end MakeECHistogram */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepECHistogram(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientHistogram *raw = - (xieFloExportClientHistogram *)ped->elemRaw; - inFloPtr ind, inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr outflo = &ped->outFlo; - - /* check notify */ - if(raw->notify != xieValDisable && - raw->notify != xieValFirstData && - raw->notify != xieValNewData) - ValueError(flo,ped,raw->notify, return(FALSE)); - - /* check out process domain */ - if(raw->domainPhototag) { - outFloPtr dom; - - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if((ind->bands = dom->bands) != 1 || IsntDomain(dom->format[0].class)) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } - - /* check and propagate src */ - if (src->bands != 1 || IsntConstrained(src->format[0].class)) - MatchError(flo,ped,return(FALSE)); - inf->bands = 1; - inf->format[0] = src->format[0]; - - /* Don't really have an outflo */ - outflo->bands = 1; - outflo->format[0] = inf->format[0]; - outflo->format[0].class = STREAM; - ped->swapUnits[0] = sizeof(xieTypHistogramData); - - return(TRUE); -} /* end PrepECHistogram */ - -/* end module echist.c */ Index: xc/programs/Xserver/XIE/dixie/export/eclut.c diff -u xc/programs/Xserver/XIE/dixie/export/eclut.c:3.5 xc/programs/Xserver/XIE/dixie/export/eclut.c:removed --- xc/programs/Xserver/XIE/dixie/export/eclut.c:3.5 Fri Dec 14 14:57:57 2001 +++ xc/programs/Xserver/XIE/dixie/export/eclut.c Sat Feb 28 21:41:57 2004 @@ -1,194 +0,0 @@ -/* $Xorg: eclut.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module eclut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - eclut.c -- DIXIE routines for managing the ExportClientLUT element - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/eclut.c,v 3.5 2001/12/14 19:57:57 dawes Exp $ */ - -#define _XIEC_ECLUT - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepECLUT(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec eCLUTVec = { - PrepECLUT /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ---------------- routine: make an export client lut element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeECLUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloExportClientLUT); - ELEMENT_SIZE_MATCH(xieFloExportClientLUT); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemExportClientLUT, return(NULL)) ; - - ped->diVec = &eCLUTVec; - ped->phototag = tag; - ped->flags.getData = TRUE; - ped->flags.export = TRUE; - raw = (xieFloExportClientLUT *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->notify = stuff->notify; - raw->bandOrder = stuff->bandOrder; - cpswapl(stuff->start0, raw->start0); - cpswapl(stuff->start1, raw->start1); - cpswapl(stuff->start2, raw->start2); - cpswapl(stuff->length0, raw->length0); - cpswapl(stuff->length1, raw->length1); - cpswapl(stuff->length2, raw->length2); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportClientLUT)); - - /* assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeECLUT */ - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepECLUT(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientLUT *raw = (xieFloExportClientLUT *)ped->elemRaw; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD32 *start = &(raw->start0); - CARD32 *length = &(raw->length0); - int b; - - if(raw->notify != xieValDisable && /* check notify */ - raw->notify != xieValFirstData && - raw->notify != xieValNewData) - ValueError(flo,ped,raw->notify, return(FALSE)); - - if(raw->bandOrder != xieValLSFirst && /* check band-order */ - raw->bandOrder != xieValMSFirst) - ValueError(flo,ped,raw->bandOrder, return(FALSE)); - - /* Validate and Propagate input attributes to our output */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; ++b) { - if (IsntLut(src->format[b].class)) - FloSourceError(flo,raw->src,raw->elemType, return(FALSE)); - if ( start[b] + length[b] > src->format[b].height ) - MatchError(flo,ped, return(FALSE)); - - dst->format[b] = inf->format[b] = src->format[b]; - ped->swapUnits[b] = LutPitch(dst->format[b].levels); - } - return(TRUE); -} /* end PrepECLUT */ - - -/* end module eclut.c */ Index: xc/programs/Xserver/XIE/dixie/export/ecphoto.c diff -u xc/programs/Xserver/XIE/dixie/export/ecphoto.c:3.6 xc/programs/Xserver/XIE/dixie/export/ecphoto.c:removed --- xc/programs/Xserver/XIE/dixie/export/ecphoto.c:3.6 Fri Dec 14 14:57:57 2001 +++ xc/programs/Xserver/XIE/dixie/export/ecphoto.c Sat Feb 28 21:41:57 2004 @@ -1,702 +0,0 @@ -/* $Xorg: ecphoto.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module ecphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ecphoto.c -- DIXIE routines for managing the ExportClientPhoto element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/ecphoto.c,v 3.6 2001/12/14 19:57:57 dawes Exp $ */ - -#define _XIEC_ECPHOTO - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepECPhoto(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec eCPhotoVec = { - PrepECPhoto /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ---------------- routine: make an import client photo element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeECPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloExportClientPhoto); - ELEMENT_AT_LEAST_SIZE(xieFloExportClientPhoto); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(ePhotoDefRec)))) - FloAllocError(flo,tag,xieElemExportClientPhoto, return(NULL)) ; - - ped->diVec = &eCPhotoVec; - ped->phototag = tag; - ped->flags.getData = TRUE; - ped->flags.export = TRUE; - raw = (xieFloExportClientPhoto *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->notify = stuff->notify; - cpswaps(stuff->encodeTechnique, raw->encodeTechnique); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportClientPhoto)); - - /* copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValEncode,raw->encodeTechnique)) - || !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(ped)); - - /* assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeECPhoto */ - -#undef sparms -#define sparms ((xieTecEncodeUncompressedSingle *)sParms) -#undef rparms -#define rparms ((xieTecEncodeUncompressedSingle *)rParms) - -Bool CopyECPhotoUnSingle(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeG31D *)sParms) -#undef rparms -#define rparms ((xieTecEncodeG31D *)rParms) - -Bool CopyECPhotoG31D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeG32D *)sParms) -#undef rparms -#define rparms ((xieTecEncodeG32D *)rParms) - -Bool CopyECPhotoG32D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if( flo->reqClient->swapped ) { - rparms->radiometric = sparms->radiometric; - rparms->uncompressed = sparms->uncompressed; - rparms->alignEol = sparms->alignEol; - rparms->encodedOrder = sparms->encodedOrder; - cpswapl(sparms->kFactor, rparms->kFactor); - } else - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeG42D *)sParms) -#undef rparms -#define rparms ((xieTecEncodeG42D *)rParms) - -Bool CopyECPhotoG42D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeTIFF2 *)sParms) -#undef rparms -#define rparms ((xieTecEncodeTIFF2 *)rParms) - -Bool CopyECPhotoTIFF2(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeTIFFPackBits *)sParms) -#undef rparms -#define rparms ((xieTecEncodeTIFFPackBits *)rParms) - -Bool CopyECPhotoTIFFPackBits(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeUncompressedTriple *)sParms) -#undef rparms -#define rparms ((xieTecEncodeUncompressedTriple *)rParms) - -#if XIE_FULL -Bool CopyECPhotoUnTriple(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeJPEGBaseline *)sParms) -#undef rparms -#define rparms ((xieTecEncodeJPEGBaseline *)rParms) - -Bool CopyECPhotoJPEGBaseline(TECHNQ_COPY_ARGS) -{ - eTecEncodeJPEGBaselineDefPtr pvt; - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - if( flo->reqClient->swapped ) { - register int n; - swaps(&rparms->lenQtable,n); - swaps(&rparms->lenACtable,n); - swaps(&rparms->lenDCtable,n); - } - if(rparms->lenQtable & 3 || - rparms->lenACtable & 3 || - rparms->lenDCtable & 3) - return(FALSE); - - if(!(ped->techPvt=(pointer)XieMalloc(sizeof(eTecEncodeJPEGBaselineDefRec)))) - FloAllocError(flo, ped->phototag, xieElemExportClientPhoto, return(TRUE)); - - pvt = (eTecEncodeJPEGBaselineDefPtr)ped->techPvt; - pvt->q = (rparms->lenQtable - ? (CARD8 *)rparms + sizeof(xieTecEncodeJPEGBaseline) - : (CARD8 *) NULL); - pvt->a = (rparms->lenACtable - ? (CARD8 *)rparms + sizeof(xieTecEncodeJPEGBaseline) - + rparms->lenQtable - : (CARD8 *) NULL); - pvt->d = (rparms->lenDCtable - ? (CARD8 *)rparms + sizeof(xieTecEncodeJPEGBaseline) - + rparms->lenQtable + rparms->lenACtable - : (CARD8 *) NULL); - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecEncodeJPEGLossless *)sParms) -#undef rparms -#define rparms ((xieTecEncodeJPEGLossless *)rParms) - -#ifdef BEYOND_SI -Bool CopyECPhotoJPEGLossless(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - memcpy((char *)rparms, (char *)sparms, tsize<<2); - - if( flo->reqClient->swapped ) { - register int n; - swaps(&rparms->lenTable,n); - } - return(TRUE); -} -#endif /* BEYOND_SI */ -#endif - -#undef sparms -#undef rparms - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepECPhoto(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientPhoto *raw = (xieFloExportClientPhoto *)ped->elemRaw; - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* Make sure notify value is valid - */ - if(raw->notify != xieValDisable && - raw->notify != xieValFirstData && - raw->notify != xieValNewData) - ValueError(flo,ped,raw->notify, return(FALSE)); - - pvt->congress = FALSE; - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - if (IsntConstrained(src->format[b].class)) - MatchError(flo, ped, return(FALSE)); - dst->format[b] = inf->format[b] = src->format[b]; - } - if(!(ped->techVec->prepfnc(flo, ped, &raw[1]))) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(FALSE)); - - pvt->encodeNumber = raw->encodeTechnique; - pvt->encodeLen = raw->lenParams << 2; - pvt->encodeParms = (pointer)&raw[1]; - - if(ped->inFloLst[IMPORT].srcDef->flags.import) { - /* - * see if import data can leap-frog the import and export elements - */ - if(BuildDecodeFromEncode(flo,ped) && CompareDecode(flo,ped)) { - inFloPtr import = &inf->srcDef->inFloLst[IMPORT]; - - inf->bands = import->bands; - for(b = 0; b < import->bands; ++b) - inf->format[b] = import->format[b]; - pvt->congress = TRUE; - } - if(pvt->decodeParms) - pvt->decodeParms = (pointer)XieFree(pvt->decodeParms); - } - return(TRUE); -} /* end PrepECPhoto */ - - -/*------------------------------------------------------------------------ ------ routines: verify technique parameters against element parameters ---- --------------- and prepare for analysis and execution ---- -------------------------------------------------------------------------*/ - -/* Prep routine for uncompressed single band data */ -Bool PrepECPhotoUnSingle( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeUncompressedSingle *tec) -{ - outFloPtr dst = &ped->outFlo; - CARD32 padmod = tec->scanlinePad * 8; - CARD32 pitch = tec->pixelStride * dst->format[0].width; - BOOL aligned = !(tec->pixelStride & (tec->pixelStride-1)) || - tec->pixelStride == 24; - - if(tec->fillOrder != xieValLSFirst && /* check fill-order */ - tec->fillOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelOrder != xieValLSFirst && /* check pixel-order */ - tec->pixelOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelStride < dst->format[0].depth) /* check pixel-stride */ - return(FALSE); - if(ALIGNMENT == xieValAlignable && /* scanline alignment */ - !tec->scanlinePad && !aligned) - return(FALSE); - if(tec->scanlinePad & (tec->scanlinePad-1) || /* check scanline-pad */ - tec->scanlinePad > 16) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - dst->format[0].stride = tec->pixelStride; - dst->format[0].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - - return(TRUE); -} /* PrepECPhotoUnSingle */ - -Bool PrepECPhotoG31D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG31D *tec) -{ - outFloPtr dst = &ped->outFlo; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoG31D */ - -Bool PrepECPhotoG32D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG32D *tec) -{ - outFloPtr dst = &ped->outFlo; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoG32D */ - -Bool PrepECPhotoG42D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG42D *tec) -{ - outFloPtr dst = &ped->outFlo; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoG42D */ - -Bool PrepECPhotoTIFF2( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeTIFF2 *tec) -{ - outFloPtr dst = &ped->outFlo; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoTIFF2 */ - -Bool PrepECPhotoTIFFPackBits( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeTIFFPackBits *tec) -{ - outFloPtr dst = &ped->outFlo; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - dst->format[0].interleaved = FALSE; - dst->format[0].class = STREAM; - - return(TRUE); -} /* PrepECPhotoTIFFPackBits */ - -#if XIE_FULL -/* Prep routine for uncompressed triple band data */ -Bool PrepECPhotoUnTriple( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeUncompressedTriple *tec) -{ - outFloPtr dst = &ped->outFlo; - int b; - - if(tec->fillOrder != xieValLSFirst && /* check fill-order */ - tec->fillOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelOrder != xieValLSFirst && /* check pixel-order */ - tec->pixelOrder != xieValMSFirst) - return(FALSE); - if(tec->bandOrder != xieValLSFirst && /* check band-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - if (tec->interleave == xieValBandByPixel && /* check inter-band dim */ - (dst->format[0].width != dst->format[1].width || - dst->format[1].width != dst->format[2].width || - dst->format[0].height != dst->format[1].height || - dst->format[1].height != dst->format[2].height)) - return(FALSE); - if (tec->interleave == xieValBandByPixel) { - CARD32 padmod = tec->scanlinePad[0] * 8; - CARD32 pitch = tec->pixelStride[0] * dst->format[0].width; - - if (tec->pixelStride[0] < - dst->format[0].depth + dst->format[1].depth + dst->format[2].depth || - dst->format[0].depth > 16 || - dst->format[1].depth > 16 || - dst->format[2].depth > 16) - return(FALSE); - if(tec->scanlinePad[0] & (tec->scanlinePad[0]-1) || /*check scanln-pad*/ - tec->scanlinePad[0] > 16) - return(FALSE); - - dst->bands = 1; - dst->format[0].interleaved = TRUE; - dst->format[0].class = STREAM; - dst->format[0].stride = tec->pixelStride[0]; - dst->format[0].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - } else { - if(tec->pixelStride[0] < dst->format[0].depth || /* check pixel-stride */ - tec->pixelStride[1] < dst->format[1].depth || - tec->pixelStride[2] < dst->format[2].depth) - return(FALSE); - for (b = 0; b < 3; b++) { - CARD32 padmod = tec->scanlinePad[b] * 8; - CARD32 pitch = tec->pixelStride[b] * dst->format[b].width; - - if(dst->format[b].depth > 16) /* check pixel-depth */ - return(FALSE); - if(tec->scanlinePad[b] & (tec->scanlinePad[b]-1) || /*check scanln-pad*/ - tec->scanlinePad[b] > 16) - return(FALSE); - - dst->format[b].interleaved = FALSE; - dst->format[b].class = STREAM; - dst->format[b].stride = tec->pixelStride[b]; - dst->format[b].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - } - } - - return(TRUE); -} /* PrepECPhotoUnTriple */ - -Bool PrepECPhotoJPEGBaseline( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGBaseline *tec) -{ - outFloPtr dst = &ped->outFlo; - - if (dst->bands == 1) - dst->format[0].interleaved = FALSE; - else { - if(tec->bandOrder != xieValLSFirst && /* check encoding-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - - dst->format[0].interleaved = - dst->format[1].interleaved = - dst->format[2].interleaved = - (tec->interleave == xieValBandByPixel); - - if (tec->interleave == xieValBandByPixel) - dst->bands = 1; - else { - dst->format[1].class = STREAM; - dst->format[2].class = STREAM; - } - } - - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoJPEGBaseline */ - -#ifdef BEYOND_SI -Bool PrepECPhotoJPEGLossless( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGLossless *tec) -{ - outFloPtr dst = &ped->outFlo; - CARD8 pred; - - if ((pred = tec->predictor[0]) != xieValPredictorNone && - pred != xieValPredictorA && - pred != xieValPredictorB && - pred != xieValPredictorC && - pred != xieValPredictorABC && - pred != xieValPredictorABC2 && - pred != xieValPredictorBAC2 && - pred != xieValPredictorAB2) - return(FALSE); - - if (dst->bands == 1) - dst->format[0].interleaved = FALSE; - else { - if(tec->bandOrder != xieValLSFirst && /* check encoding-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - - if ((pred = tec->predictor[1]) != xieValPredictorNone && - pred != xieValPredictorA && - pred != xieValPredictorB && - pred != xieValPredictorC && - pred != xieValPredictorABC && - pred != xieValPredictorABC2 && - pred != xieValPredictorBAC2 && - pred != xieValPredictorAB2) - return(FALSE); - - if ((pred = tec->predictor[2]) != xieValPredictorNone && - pred != xieValPredictorA && - pred != xieValPredictorB && - pred != xieValPredictorC && - pred != xieValPredictorABC && - pred != xieValPredictorABC2 && - pred != xieValPredictorBAC2 && - pred != xieValPredictorAB2) - return(FALSE); - - dst->format[0].interleaved = - dst->format[1].interleaved = - dst->format[2].interleaved = - (tec->interleave == xieValBandByPixel); - - if (tec->interleave == xieValBandByPixel) - dst->bands = 1; - else { - dst->format[1].class = STREAM; - dst->format[2].class = STREAM; - } - } - - dst->format[0].class = STREAM; - - return(TRUE); - -} /* PrepECPhotoJPEGLossless */ -#endif /* BEYOND_SI */ -#endif - -/* end module ecphoto.c */ Index: xc/programs/Xserver/XIE/dixie/export/ecroi.c diff -u xc/programs/Xserver/XIE/dixie/export/ecroi.c:3.5 xc/programs/Xserver/XIE/dixie/export/ecroi.c:removed --- xc/programs/Xserver/XIE/dixie/export/ecroi.c:3.5 Fri Dec 14 14:57:58 2001 +++ xc/programs/Xserver/XIE/dixie/export/ecroi.c Sat Feb 28 21:41:57 2004 @@ -1,180 +0,0 @@ -/* $Xorg: ecroi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module ecroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ecroi.c -- DIXIE routines for managing the ExportClientROI element - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/ecroi.c,v 3.5 2001/12/14 19:57:58 dawes Exp $ */ - -#define _XIEC_ECROI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepECROI(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec eROIVec = { - PrepECROI /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportClientROI element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeECROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportClientROI); - ELEMENT_AT_LEAST_SIZE(xieFloExportClientROI); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemExportClientROI, return(NULL)); - - ped->diVec = &eROIVec; - ped->phototag = tag; - ped->flags.export = TRUE; - ped->flags.getData = TRUE; - raw = (xieFloExportClientROI *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->notify = stuff->notify; - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportClientROI)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeECROI */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepECROI(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientROI *raw = (xieFloExportClientROI *)ped->elemRaw; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - - /* Make sure notify value is valid - */ - if(raw->notify != xieValDisable && - raw->notify != xieValFirstData && - raw->notify != xieValNewData) - ValueError(flo,ped,raw->notify, return(FALSE)); - - /* Validate and Propagate input attributes to our output */ - if (src->bands != 1 || src->format[0].class != RUN_LENGTH) - FloSourceError(flo,raw->src,raw->elemType, return(FALSE)); - - dst->bands = inf->bands = src->bands; - dst->format[0] = inf->format[0] = src->format[0]; - ped->swapUnits[0] = sizeof(xieTypRectangle); - - return(TRUE); -} /* end PrepECROI */ - -/* end module ecroi.c */ Index: xc/programs/Xserver/XIE/dixie/export/edraw.c diff -u xc/programs/Xserver/XIE/dixie/export/edraw.c:3.5 xc/programs/Xserver/XIE/dixie/export/edraw.c:removed --- xc/programs/Xserver/XIE/dixie/export/edraw.c:3.5 Fri Dec 14 14:57:58 2001 +++ xc/programs/Xserver/XIE/dixie/export/edraw.c Sat Feb 28 21:41:57 2004 @@ -1,263 +0,0 @@ -/* $Xorg: edraw.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module edraw.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - edraw.c -- DIXIE routines for managing the ExportDrawable element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/edraw.c,v 3.5 2001/12/14 19:57:58 dawes Exp $ */ - -#define _XIEC_EDRAW - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * more X server includes. - */ -#include -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepEDraw(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec eDrawVec = { - PrepEDraw /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportDrawable element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeEDraw(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inflo; - ELEMENT(xieFloExportDrawable); - ELEMENT_SIZE_MATCH(xieFloExportDrawable); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(eDrawDefRec)))) - FloAllocError(flo,tag,xieElemExportDrawable, return(NULL)); - - ped->diVec = &eDrawVec; - ped->phototag = tag; - ped->flags.export = TRUE; - raw = (xieFloExportDrawable *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswaps(stuff->dstX, raw->dstX); - cpswaps(stuff->dstY, raw->dstY); - cpswapl(stuff->drawable, raw->drawable); - cpswapl(stuff->gc, raw->gc); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportDrawable)); - /* - * assign phototags to inFlos - */ - inflo = ped->inFloLst; - inflo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeEDraw */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepEDraw(floDefPtr flo, peDefPtr ped) -{ - xieFloExportDrawable *raw = (xieFloExportDrawable *) ped->elemRaw; - eDrawDefPtr pvt = (eDrawDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - formatPtr df = &dst->format[0]; - CARD32 f, right_padm1; - /* - * check out drawable and gc - */ - if(!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&(pvt->pDraw),&(pvt->pGC))) - return(FALSE); - /* - * check for: constrained, single-band, and levels matching drawable depth - */ - if(IsntConstrained(src->format[0].class) || - src->bands != 1 || pvt->pDraw->depth != src->format[0].depth) - MatchError(flo,ped, return(FALSE)); - /* - * grab a copy of the input attributes and propagate them to our output - */ - dst->bands = inf->bands = src->bands; - df[0] = inf->format[0] = src->format[0]; - - /* search for the stride and pitch requirements that match our depth - */ - for(f = 0; (f < screenInfo.numPixmapFormats && - df[0].depth != screenInfo.formats[f].depth); ++f); - if(f == screenInfo.numPixmapFormats) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - right_padm1 = screenInfo.formats[f].scanlinePad - 1; - df[0].stride = screenInfo.formats[f].bitsPerPixel; - df[0].pitch = (df[0].width * df[0].stride + right_padm1) & ~right_padm1; - - return(TRUE); -} /* end PrepEDraw */ - -/*------------------------------------------------------------------------ ---- callable version of GetGCAndDrawableAndValidate (from extension.h) --- ---- made callable because the macro version returned standard X errors --- -------------------------------------------------------------------------*/ -Bool DrawableAndGC( - floDefPtr flo, - peDefPtr ped, - Drawable draw_id, - GContext gc_id, - DrawablePtr *draw_ret, - GCPtr *gc_ret) -{ - register ClientPtr client = flo->runClient; - register DrawablePtr draw; - register GCPtr gc; - - if(client->clientGone) AccessError(flo,ped, return(FALSE)); - - if((client->lastDrawableID != draw_id) || - (client->lastGCID != gc_id)) { - if(client->lastDrawableID != draw_id) - draw = (DrawablePtr)LookupIDByClass(draw_id, RC_DRAWABLE); - else - draw = client->lastDrawable; - if(client->lastGCID != gc_id) - gc = (GCPtr)LookupIDByType(gc_id, RT_GC); - else - gc = client->lastGC; - if(draw && gc) { - if((draw->type == UNDRAWABLE_WINDOW) || - (gc->depth != draw->depth) || - (gc->pScreen != draw->pScreen)) - MatchError(flo,ped, return(FALSE)); - - client->lastDrawable = draw; - client->lastDrawableID = draw_id; - client->lastGC = gc; - client->lastGCID = gc_id; - } - } else { - gc = client->lastGC; - draw = client->lastDrawable; - } - if(!draw) { - client->errorValue = draw_id; - DrawableError(flo,ped,draw_id, return(FALSE)); - } - if(!gc) { - client->errorValue = gc_id; - GCError(flo,ped,gc_id, return(FALSE)); - } - if(gc->serialNumber != draw->serialNumber) - ValidateGC(draw, gc); - - *draw_ret = draw; - *gc_ret = gc; - - return(TRUE); -} /* end DrawableAndGC */ - -/* end module edraw.c */ Index: xc/programs/Xserver/XIE/dixie/export/edrawp.c diff -u xc/programs/Xserver/XIE/dixie/export/edrawp.c:3.5 xc/programs/Xserver/XIE/dixie/export/edrawp.c:removed --- xc/programs/Xserver/XIE/dixie/export/edrawp.c:3.5 Fri Dec 14 14:57:58 2001 +++ xc/programs/Xserver/XIE/dixie/export/edrawp.c Sat Feb 28 21:41:57 2004 @@ -1,189 +0,0 @@ -/* $Xorg: edrawp.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module edrawp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - edrawp.c -- DIXIE routines for managing the ExportDrawablePlane element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/edrawp.c,v 3.5 2001/12/14 19:57:58 dawes Exp $ */ - -#define _XIEC_EDRAWP - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * more X server includes. - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepEDrawPlane(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec eDrawPlaneVec = { - PrepEDrawPlane /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ---------------- routine: make an ExportDrawablePlane element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeEDrawPlane(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportDrawablePlane); - ELEMENT_SIZE_MATCH(xieFloExportDrawablePlane); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, - sizeof(eDrawPDefRec)))) - FloAllocError(flo,tag,xieElemExportDrawablePlane, return(NULL)); - - ped->diVec = &eDrawPlaneVec; - ped->phototag = tag; - ped->flags.export = TRUE; - raw = (xieFloExportDrawablePlane *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswaps(stuff->dstX, raw->dstX); - cpswaps(stuff->dstY, raw->dstY); - cpswapl(stuff->drawable, raw->drawable); - cpswapl(stuff->gc, raw->gc); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportDrawablePlane)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeEDrawPlane */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepEDrawPlane(floDefPtr flo, peDefPtr ped) -{ - xieFloExportDrawablePlane *raw = (xieFloExportDrawablePlane *)ped->elemRaw; - eDrawPDefPtr pvt = (eDrawPDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - /* - * check out drawable and gc - */ - if(!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&(pvt->pDraw),&(pvt->pGC))) - return(FALSE); - /* - * check for: constrained, single-band, bitonal image - */ - if( (src->format[0].class != BIT_PIXEL) || (src->bands != 1)) - MatchError(flo,ped, return(FALSE)); - /* - * grab a copy of the input attributes and propagate them to our output - */ - dst->bands = inf->bands = src->bands; - dst->format[0] = inf->format[0] = src->format[0]; - - return(TRUE); -} /* end PrepEDrawplane */ - -/* end module edrawp.c */ Index: xc/programs/Xserver/XIE/dixie/export/elut.c diff -u xc/programs/Xserver/XIE/dixie/export/elut.c:3.5 xc/programs/Xserver/XIE/dixie/export/elut.c:removed --- xc/programs/Xserver/XIE/dixie/export/elut.c:3.5 Fri Dec 14 14:57:59 2001 +++ xc/programs/Xserver/XIE/dixie/export/elut.c Sat Feb 28 21:41:57 2004 @@ -1,250 +0,0 @@ -/* $Xorg: elut.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module elut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - elut.c -- DIXIE routines for managing the ExportLUT element - - Larry Hare -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/elut.c,v 3.5 2001/12/14 19:57:59 dawes Exp $ */ - -#define _XIEC_ELUT - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepELUT(floDefPtr flo, peDefPtr ped); -static Bool DebriefELUT(floDefPtr flo, peDefPtr ped, Bool ok); - -/* - * dixie entry points - */ -static diElemVecRec eLUTVec = { - PrepELUT, - DebriefELUT - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportLUT element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeELUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportLUT); - ELEMENT_SIZE_MATCH(xieFloExportLUT); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(eLUTDefRec)))) - FloAllocError(flo,tag,xieElemExportLUT, return(NULL)); - - ped->diVec = &eLUTVec; - ped->phototag = tag; - ped->flags.export = TRUE; - raw = (xieFloExportLUT *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - raw->merge = stuff->merge; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->lut, raw->lut); - cpswapl(stuff->start0, raw->start0); - cpswapl(stuff->start1, raw->start1); - cpswapl(stuff->start2, raw->start2); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportLUT)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeELUT */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepELUT(floDefPtr flo, peDefPtr ped) -{ - xieFloExportLUT *raw = (xieFloExportLUT *)ped->elemRaw; - eLUTDefPtr pvt = (eLUTDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD32 *start = &(raw->start0); - lutPtr lut; - CARD32 b, oops; - - /* find the LUT resource and bind it to our flo */ - if(!(lut = pvt->lut = (lutPtr) LookupIDByType(raw->lut, RT_LUT))) - LUTError(flo,ped,raw->lut, return(FALSE)); - - ++pvt->lut->refCnt; - if(!raw->merge && ((oops=start[0]) || (oops=start[1]) || (oops=start[2]))) - ValueError(flo, ped, oops, return(FALSE)); - - /* Validate and Propagate input attributes to our output */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; ++b) { - if (IsntLut(src->format[b].class)) - FloSourceError(flo,raw->src,raw->elemType, return(FALSE)); - if (raw->merge) { - if ( (src->format[b].levels != lut->format[b].level) || - (start[b] + src->format[b].height > lut->format[b].length) ) - MatchError(flo, ped, return(FALSE)); - } - dst->format[b] = inf->format[b] = src->format[b]; - } - return(TRUE); -} /* end PrepELUT */ - - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefELUT(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloExportLUT *raw = (xieFloExportLUT *)ped->elemRaw; - eLUTDefPtr pvt = (eLUTDefPtr) ped->elemPvt; - lutPtr lut; - CARD32 b; - - if(!(pvt && (lut = pvt->lut))) return(FALSE); - - if(ok && lut->refCnt > 1) { - - if (raw->merge) { - CARD32 *start = &(raw->start0); - for(b = 0; b < lut->lutCnt; b++) { - int nbytes = LutPitch(lut->format[b].level); - memcpy(lut->strips[b].flink->data + start[b] * nbytes, - ped->outFlo.output[b].flink->data, - ped->outFlo.output[b].flink->length * nbytes); - } /* transient strips freed below */ - } else { - /* free old LUT data */ - for(b = 0; b < lut->lutCnt; b++) - FreeStrips(&lut->strips[b]); - - /* stash our new attributes and data into the LUT */ - lut->lutCnt = ped->outFlo.bands; - for(b = 0; b < lut->lutCnt; ++b) { - lut->format[b].bandOrder = ped->outFlo.format[b].width; /* hack */ - lut->format[b].length = ped->outFlo.format[b].height; /* hack */ - lut->format[b].level = ped->outFlo.format[b].levels; - DebriefStrips(&ped->outFlo.output[b],&lut->strips[b]); - } - } - } - /* free image data that's left over on our outFlo - */ - for(b = 0; b < ped->outFlo.bands; b++) - FreeStrips(&ped->outFlo.output[b]); - - /* unbind ourself from the LUT - */ - if(lut->refCnt > 1) - --lut->refCnt; - else if(LookupIDByType(raw->lut, RT_LUT)) - FreeResourceByType(lut->ID, RT_LUT, RT_NONE); - else - DeleteLUT(lut, lut->ID); - - return(TRUE); -} /* end DebriefELUT */ - -/* end module elut.c */ Index: xc/programs/Xserver/XIE/dixie/export/ephoto.c diff -u xc/programs/Xserver/XIE/dixie/export/ephoto.c:3.6 xc/programs/Xserver/XIE/dixie/export/ephoto.c:removed --- xc/programs/Xserver/XIE/dixie/export/ephoto.c:3.6 Fri Dec 14 14:57:59 2001 +++ xc/programs/Xserver/XIE/dixie/export/ephoto.c Sat Feb 28 21:41:57 2004 @@ -1,598 +0,0 @@ -/* $Xorg: ephoto.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module ephoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ephoto.c -- DIXIE routines for managing the ExportPhotomap element - - Robert NC Shelley && Dean Verheiden -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/ephoto.c,v 3.6 2001/12/14 19:57:59 dawes Exp $ */ - -#define _XIEC_EPHOTO - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * more X server includes. - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include /* For Server Choice function */ -#include - -/* - * routines internal to this module - */ -static Bool CopyEPhotoServerChoice( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeServerChoice *sparms, - xieTecEncodeServerChoice *rparms, - CARD16 tsize); -static Bool PrepEPhoto(floDefPtr flo, peDefPtr ped); -static Bool DebriefEPhoto(floDefPtr flo, peDefPtr ped, Bool ok); - -extern pointer GetImportTechnique(); - -/* - * dixie entry points - */ -static diElemVecRec ePhotoVec = { - PrepEPhoto, - DebriefEPhoto - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportPhotomap element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeEPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportPhotomap); - ELEMENT_AT_LEAST_SIZE(xieFloExportPhotomap); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(ePhotoDefRec)))) - FloAllocError(flo,tag,xieElemExportPhotomap, return(NULL)); - - ped->diVec = &ePhotoVec; - ped->phototag = tag; - ped->flags.export = TRUE; - raw = (xieFloExportPhotomap *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->photomap, raw->photomap); - cpswaps(stuff->encodeTechnique, raw->encodeTechnique); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportPhotomap)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - /* - * copy technique data (if any) - */ - if (raw->encodeTechnique == xieValEncodeServerChoice) { - if (!CopyEPhotoServerChoice(flo, ped, - (xieTecEncodeServerChoice *) &stuff[1], - (xieTecEncodeServerChoice *) &raw[1], - raw->lenParams)) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(ped)); - } else if (!(ped->techVec = FindTechnique(xieValEncode,raw->encodeTechnique)) - || !(ped->techVec->copyfnc(flo,ped,&stuff[1],&raw[1],raw->lenParams,0))) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(ped)); - - return(ped); -} /* end MakeEPhoto */ - -static Bool CopyEPhotoServerChoice( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeServerChoice *sparms, - xieTecEncodeServerChoice *rparms, - CARD16 tsize) -{ - if(tsize == 1) - rparms->preference = sparms->preference; - - return(tsize <= 1); -} - -/* All other technique-specific copy routines are defined in ecphoto.c */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepEPhoto(floDefPtr flo, peDefPtr ped) -{ - xieFloExportPhotomap *raw = (xieFloExportPhotomap *)ped->elemRaw; - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr dst = &ped->outFlo; - xieBoolProc scPrep; - CARD32 b; - - /* find the photomap resource and bind it to our flo - */ - if(!(pvt->map = (photomapPtr) LookupIDByType(raw->photomap, RT_PHOTOMAP))) - PhotomapError(flo,ped,raw->photomap, return(FALSE)); - ++pvt->map->refCnt; - - pvt->congress = FALSE; - if(raw->encodeTechnique == xieValEncodeServerChoice) { - if(!(scPrep = ((xieBoolProc (*)()) - DDInterface[DDServerChoiceIndex]) (flo, ped))) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(FALSE)); - } else { - /* grab a copy of the input attributes and propagate them to our output - */ - outFloPtr src = &inf->srcDef->outFlo; - for(b = 0; b < src->bands; ++b) { - if(IsntCanonic(src->format[b].class)) - MatchError(flo,ped, return(FALSE)); - dst->format[b] = inf->format[b] = src->format[b]; - dst->bands = inf->bands = src->bands; - /* dst->bands will be 1 if we encode TripleBand interleaved BandByPixel */ - } - scPrep = (xieBoolProc)NULL; - } - - /* do technique-specific preparations - */ - if(scPrep) { - if (!(*scPrep)(flo,ped)) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique, - raw->lenParams, return(FALSE)); - } else { - if(!(ped->techVec->prepfnc(flo, ped, &raw[1]))) - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique,raw->lenParams, - return(FALSE)); - - pvt->encodeNumber = raw->encodeTechnique; - pvt->encodeLen = raw->lenParams << 2; - pvt->encodeParms = (pointer)&raw[1]; - - if(!BuildDecodeFromEncode(flo,ped)) - AllocError(flo,ped, return(FALSE)); - - /* see if import data can leap-frog the import and export elements - */ - if(ped->inFloLst[IMPORT].srcDef->flags.import && CompareDecode(flo,ped)) { - inFloPtr import = &inf->srcDef->inFloLst[IMPORT]; - - /* copy smuggled data attributes to our inFlo */ - inf->bands = import->bands; - for(b = 0; b < import->bands; ++b) - inf->format[b] = import->format[b]; - pvt->congress = TRUE; - } - } - return(TRUE); -} /* end PrepEPhoto */ - -/* All technique-specific prep routines are defined in ecphoto.c */ - -Bool BuildDecodeFromEncode(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - /* Based on the encode technique, build a correspoinding decode technique */ - switch(pvt->encodeNumber) { - case xieValEncodeUncompressedSingle: - { - xieTecEncodeUncompressedSingle *etec = - (xieTecEncodeUncompressedSingle *)pvt->encodeParms; - xieTecDecodeUncompressedSingle *dtec; - - if (!(dtec = (xieTecDecodeUncompressedSingle *) - XieMalloc(sizeof(xieTecDecodeUncompressedSingle)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeUncompressedSingle; - pvt->decodeLen = sizeof(xieTecDecodeUncompressedSingle); - pvt->decodeParms = (pointer)dtec; - dtec->fillOrder = etec->fillOrder; - dtec->pixelOrder = etec->pixelOrder; - dtec->pixelStride = etec->pixelStride; - dtec->leftPad = 0; - dtec->scanlinePad = etec->scanlinePad; - } - break; - case xieValEncodeUncompressedTriple: - { - xieTecEncodeUncompressedTriple *etec = - (xieTecEncodeUncompressedTriple *)pvt->encodeParms; - xieTecDecodeUncompressedTriple *dtec; - int i; - - if (!(dtec = (xieTecDecodeUncompressedTriple *) - XieMalloc(sizeof(xieTecDecodeUncompressedTriple)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeUncompressedTriple; - pvt->decodeLen = sizeof(xieTecDecodeUncompressedTriple); - pvt->decodeParms = (pointer)dtec; - dtec->fillOrder = etec->fillOrder; - dtec->pixelOrder = etec->pixelOrder; - dtec->bandOrder = etec->bandOrder; - dtec->interleave = etec->interleave; - for (i = 0; i < 3; i++) { - dtec->leftPad[i] = 0; - dtec->pixelStride[i] = etec->pixelStride[i]; - dtec->scanlinePad[i] = etec->scanlinePad[i]; - } - } - break; - case xieValEncodeG31D: - { - xieTecEncodeG31D *etec = (xieTecEncodeG31D *)pvt->encodeParms; - xieTecDecodeG31D *dtec; - - if (!(dtec = (xieTecDecodeG31D *) - XieMalloc(sizeof(xieTecDecodeG31D)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeG31D; - pvt->decodeLen = sizeof(xieTecDecodeG31D); - pvt->decodeParms = (pointer)dtec; - dtec->normal = TRUE; - dtec->radiometric = etec->radiometric; - dtec->encodedOrder = etec->encodedOrder; - } - break; - case xieValEncodeG32D: - { - xieTecEncodeG32D *etec = (xieTecEncodeG32D *)pvt->encodeParms; - xieTecDecodeG32D *dtec; - - if (!(dtec = (xieTecDecodeG32D *) - XieMalloc(sizeof(xieTecDecodeG32D)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeG32D; - pvt->decodeLen = sizeof(xieTecDecodeG32D); - pvt->decodeParms = (pointer)dtec; - dtec->normal = TRUE; - dtec->radiometric = etec->radiometric; - dtec->encodedOrder = etec->encodedOrder; - } - break; - case xieValEncodeG42D: - { - xieTecEncodeG42D *etec = (xieTecEncodeG42D *)pvt->encodeParms; - xieTecDecodeG42D *dtec; - - if (!(dtec = (xieTecDecodeG42D *) - XieMalloc(sizeof(xieTecDecodeG42D)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeG42D; - pvt->decodeLen = sizeof(xieTecDecodeG42D); - pvt->decodeParms = (pointer)dtec; - dtec->normal = TRUE; - dtec->radiometric = etec->radiometric; - dtec->encodedOrder = etec->encodedOrder; - } - break; - case xieValEncodeJPEGBaseline: - { - xieTecEncodeJPEGBaseline *etec = - (xieTecEncodeJPEGBaseline *)pvt->encodeParms; - xieTecDecodeJPEGBaseline *dtec; - - if (!(dtec = (xieTecDecodeJPEGBaseline *) - XieMalloc(sizeof(xieTecDecodeJPEGBaseline)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeJPEGBaseline; - pvt->decodeLen = sizeof(xieTecDecodeJPEGBaseline); - pvt->decodeParms = (pointer)dtec; - dtec->interleave = etec->interleave; - dtec->upSample = etec->interleave == xieValBandByPixel; - dtec->bandOrder = etec->bandOrder; - } - break; - case xieValEncodeTIFF2: - { - xieTecEncodeTIFF2 *etec = (xieTecEncodeTIFF2 *)pvt->encodeParms; - xieTecDecodeTIFF2 *dtec; - - if (!(dtec = (xieTecDecodeTIFF2 *) - XieMalloc(sizeof(xieTecDecodeTIFF2)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeTIFF2; - pvt->decodeLen = sizeof(xieTecDecodeTIFF2); - pvt->decodeParms = (pointer)dtec; - dtec->normal = TRUE; - dtec->radiometric = etec->radiometric; - dtec->encodedOrder = etec->encodedOrder; - } - break; - case xieValEncodeTIFFPackBits: - { - xieTecEncodeTIFFPackBits *etec = - (xieTecEncodeTIFFPackBits *)pvt->encodeParms; - xieTecDecodeTIFFPackBits *dtec; - - if (!(dtec = (xieTecDecodeTIFFPackBits *) - XieMalloc(sizeof(xieTecDecodeTIFFPackBits)))) - AllocError(flo,ped, return(FALSE)); - pvt->decodeNumber = xieValDecodeTIFFPackBits; - pvt->decodeLen = sizeof(xieTecDecodeTIFFPackBits); - pvt->decodeParms = (pointer)dtec; - dtec->normal = TRUE; - dtec->encodedOrder = etec->encodedOrder; - } - break; - case xieValEncodeJPEGLossless: /* not implemented in SI */ - default: - ImplementationError(flo,ped, return(FALSE)); - } - return(TRUE); -} - -Bool CompareDecode(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - peDefPtr srcped = ped->inFloLst[IMPORT].srcDef; - CARD16 decodeNumber, decodeLen; - pointer decodeParms; - - decodeParms = GetImportTechnique(srcped,&decodeNumber,&decodeLen); - if(decodeNumber != pvt->decodeNumber) - return(FALSE); - - switch (decodeNumber) { - case xieValDecodeUncompressedSingle: - { - xieTecDecodeUncompressedSingle *itec = - (xieTecDecodeUncompressedSingle *)decodeParms; - xieTecDecodeUncompressedSingle *otec = - (xieTecDecodeUncompressedSingle *)pvt->decodeParms; - - return (itec->fillOrder == otec->fillOrder && - itec->pixelOrder == otec->pixelOrder && - itec->pixelStride == otec->pixelStride && - itec->leftPad == otec->leftPad && - itec->pixelStride == otec->pixelStride && - itec->scanlinePad == otec->scanlinePad); - } - break; - case xieValDecodeUncompressedTriple: - { - xieTecDecodeUncompressedTriple *itec = - (xieTecDecodeUncompressedTriple *)decodeParms; - xieTecDecodeUncompressedTriple *otec = - (xieTecDecodeUncompressedTriple *)pvt->decodeParms; - - return (itec->fillOrder == otec->fillOrder && - itec->pixelOrder == otec->pixelOrder && - itec->interleave == otec->interleave && - itec->bandOrder == otec->bandOrder && - itec->leftPad[0] == otec->leftPad[0] && - itec->leftPad[1] == otec->leftPad[1] && - itec->leftPad[2] == otec->leftPad[2] && - itec->pixelStride[0] == otec->pixelStride[0] && - itec->pixelStride[1] == otec->pixelStride[1] && - itec->pixelStride[2] == otec->pixelStride[2] && - itec->scanlinePad[0] == otec->scanlinePad[0] && - itec->scanlinePad[1] == otec->scanlinePad[1] && - itec->scanlinePad[2] == otec->scanlinePad[2]); - } - break; - case xieValDecodeG31D: - case xieValDecodeG32D: - case xieValDecodeG42D: - case xieValDecodeTIFF2: - { - xieTecDecodeG31D *itec = (xieTecDecodeG31D *)decodeParms; - xieTecDecodeG31D *otec = - (xieTecDecodeG31D *)pvt->decodeParms; - - return (itec->normal == otec->normal && - itec->radiometric == otec->radiometric && - itec->encodedOrder == otec->encodedOrder); - } - break; - case xieValDecodeJPEGBaseline: - case xieValDecodeJPEGLossless: - { - xieTecDecodeJPEGBaseline *itec = - (xieTecDecodeJPEGBaseline *)decodeParms; - xieTecDecodeJPEGBaseline *otec = - (xieTecDecodeJPEGBaseline *)pvt->decodeParms; - - return (itec->interleave == otec->interleave && - itec->bandOrder == otec->bandOrder && - itec->upSample == otec->upSample); - } - break; - case xieValDecodeTIFFPackBits: - { - xieTecDecodeTIFFPackBits *itec = - (xieTecDecodeTIFFPackBits *)decodeParms; - xieTecDecodeTIFFPackBits *otec = - (xieTecDecodeTIFFPackBits *)pvt->decodeParms; - - return (itec->normal == otec->normal && - itec->encodedOrder == otec->encodedOrder); - } - break; - default: - return (FALSE); - } -} - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefEPhoto(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloExportPhotomap *raw = (xieFloExportPhotomap *)ped->elemRaw; - ePhotoDefPtr pvt = (ePhotoDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - photomapPtr map; - CARD32 b; - - if(!(pvt && (map = pvt->map))) return(FALSE); - - if(ok && map->refCnt > 1) { - - /* free old compression parameters and image data - */ - if(map->tecParms) - map->tecParms = (pointer)XieFree(map->tecParms); - - if(map->pvtParms) - map->pvtParms = (pointer)XieFree(map->pvtParms); - - for(b = 0; b < map->bands; b++) - FreeStrips(&map->strips[b]); - - /* stash our new attributes and data into the photomap - */ - map->bands = ped->outFlo.bands; - map->dataType = (map->format[0].class & UNCONSTRAINED - ? xieValUnconstrained : xieValConstrained); - map->technique = pvt->decodeNumber; - map->lenParms = pvt->decodeLen; - map->tecParms = pvt->decodeParms; - map->pvtParms = pvt->pvtParms; - map->dataClass = src->bands == 3 ? xieValTripleBand : xieValSingleBand; - for(b = 0; b < map->bands; ++b) { - map->format[b] = ped->outFlo.format[b]; - DebriefStrips(&ped->outFlo.output[b],&map->strips[b]); - } - pvt->decodeParms = NULL; - - if (src->bands == 3 && map->bands == 1) { - /* - * save format for the other bands too, we'll need them when we decode - */ - for(b = 1; b < src->bands; ++b) - map->format[b] = src->format[b]; - } - } - - /* if server choice, free space used to hold fabricated encode parameters */ - if (pvt->serverChose && pvt->encodeParms) - XieFree(pvt->encodeParms); - - /* Free decodeParms if something went afoul before hooking on to photomap */ - if (pvt->decodeParms) - XieFree(pvt->decodeParms); - - /* free image data that's left over on our outFlo - */ - for(b = 0; b < ped->outFlo.bands; b++) - FreeStrips(&ped->outFlo.output[b]); - - /* - unbind ourself from the photomap - */ - if(map->refCnt > 1) - --map->refCnt; - else if(LookupIDByType(raw->photomap, RT_PHOTOMAP)) - FreeResourceByType(map->ID, RT_PHOTOMAP, RT_NONE); - else - DeletePhotomap(map, map->ID); - - return(TRUE); -} /* end DebriefEPhoto */ - -/* end module ephoto.c */ Index: xc/programs/Xserver/XIE/dixie/export/eroi.c diff -u xc/programs/Xserver/XIE/dixie/export/eroi.c:3.5 xc/programs/Xserver/XIE/dixie/export/eroi.c:removed --- xc/programs/Xserver/XIE/dixie/export/eroi.c:3.5 Fri Dec 14 14:57:59 2001 +++ xc/programs/Xserver/XIE/dixie/export/eroi.c Sat Feb 28 21:41:57 2004 @@ -1,213 +0,0 @@ -/* $Xorg: eroi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module eroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - eroi.c -- DIXIE routines for managing the ExportROI element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/export/eroi.c,v 3.5 2001/12/14 19:57:59 dawes Exp $ */ - -#define _XIEC_EROI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepEROI(floDefPtr flo, peDefPtr ped); -static Bool DebriefEROI(floDefPtr flo, peDefPtr ped, Bool ok); - -/* - * dixie entry points - */ -static diElemVecRec eROIVec = -{ - PrepEROI, /* prepare for analysis and execution */ - DebriefEROI /* debrief */ -}; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportROI element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeEROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloExportROI); - ELEMENT_SIZE_MATCH(xieFloExportROI); - ELEMENT_NEEDS_1_INPUT(src); - - if (!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(eROIDefRec)))) - FloAllocError(flo,tag,xieElemExportROI, return(NULL)); - - ped->diVec = &eROIVec; - ped->phototag = tag; - ped->flags.export = TRUE; - raw = (xieFloExportROI *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->roi, raw->roi); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportROI)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[0].srcTag = raw->src; - return ped; -} /* end MakeEROI */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepEROI(floDefPtr flo, peDefPtr ped) -{ - xieFloExportROI *raw = (xieFloExportROI *)ped->elemRaw; - eROIDefPtr pvt = (eROIDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[0]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - roiPtr roi; - - /* grab roi resource */ - if(!(roi = (roiPtr)LookupIDByType(raw->roi, RT_ROI))) - ROIError(flo,ped,raw->roi,return(FALSE)); - - pvt->roi = roi; - roi->refCnt++; - - if (src->bands != 1 || src->format[0].class != RUN_LENGTH) - FloSourceError(flo,raw->src,raw->elemType, return(FALSE)); - - dst->bands = inf->bands = src->bands; - dst->format[0].class = inf->format[0].class = src->format[0].class; - - return TRUE; -} /* end PrepEROI */ - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefEROI(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloExportROI *raw = (xieFloExportROI *)ped->elemRaw; - eROIDefPtr pvt = (eROIDefPtr)ped->elemPvt; - roiPtr roi; - - if(!(pvt && (roi = pvt->roi))) return(FALSE); - - if (ok && roi->refCnt > 1) { - /* - * out with the old, in with the new - */ - FreeStrips(&roi->strips); - DebriefStrips(&ped->outFlo.output[0],&roi->strips); - } - /* free roi data that's left over on our outFlo */ - FreeStrips(&ped->outFlo.output[0]); - - /* unbind ourself from the roi */ - if(roi->refCnt > 1) - --roi->refCnt; - else if(LookupIDByType(raw->roi, RT_ROI)) - FreeResourceByType(roi->ID, RT_ROI, RT_NONE); - else - DeleteROI(roi, roi->ID); - - return TRUE; -} /* end DebriefEROI */ - -/* end module eroi.c */ Index: xc/programs/Xserver/XIE/dixie/import/Imakefile diff -u xc/programs/Xserver/XIE/dixie/import/Imakefile:3.6 xc/programs/Xserver/XIE/dixie/import/Imakefile:removed --- xc/programs/Xserver/XIE/dixie/import/Imakefile:3.6 Wed Jan 17 17:12:50 2001 +++ xc/programs/Xserver/XIE/dixie/import/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,37 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:24 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/dixie/import/Imakefile,v 3.6 2001/01/17 22:12:50 dawes Exp $ - -XCOMM build device independent import element objects - -#define IHaveModules -#include - -SRCS1 = iclut.c icphoto.c idraw.c idrawp.c ilut.c iphoto.c -OBJS1 = iclut.o icphoto.o idraw.o idrawp.o ilut.o iphoto.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = icroi.c iroi.c -OBJS2 = icroi.o iroi.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) - LINTLIBS = ../export/llib-lexp.ln ../import/llib-limp.ln \ - ../process/llib-lproc.ln ../request/llib-lreq.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(imp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/dixie/import/iclut.c diff -u xc/programs/Xserver/XIE/dixie/import/iclut.c:3.5 xc/programs/Xserver/XIE/dixie/import/iclut.c:removed --- xc/programs/Xserver/XIE/dixie/import/iclut.c:3.5 Fri Dec 14 14:58:00 2001 +++ xc/programs/Xserver/XIE/dixie/import/iclut.c Sat Feb 28 21:41:57 2004 @@ -1,226 +0,0 @@ -/* $Xorg: iclut.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module iclut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - iclut.c -- DIXIE routines for managing the ImportClientLUT element - - Dean Verheiden -- AGE Logic, Inc. April 1993 - Ben Fahy -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/iclut.c,v 3.5 2001/12/14 19:58:00 dawes Exp $ */ - -#define _XIEC_ICLUT - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepICLUT(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec iCLUTVec = { - PrepICLUT /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ ---------------- routine: make an import client lut element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeICLUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportClientLUT); - ELEMENT_SIZE_MATCH(xieFloImportClientLUT); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemImportClientLUT,return(NULL)); - - ped->diVec = &iCLUTVec; - ped->phototag = tag; - ped->flags.import = TRUE; - ped->flags.putData = TRUE; - raw = (xieFloImportClientLUT *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - raw->class = stuff->class; - raw->bandOrder = stuff->bandOrder; - cpswapl(stuff->length0, raw->length0); - cpswapl(stuff->length1, raw->length1); - cpswapl(stuff->length2, raw->length2); - cpswapl(stuff->levels0, raw->levels0); - cpswapl(stuff->levels1, raw->levels1); - cpswapl(stuff->levels2, raw->levels2); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportClientLUT)); - - return(ped); -} /* end MakeICLUT */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepICLUT(floDefPtr flo, peDefPtr ped) -{ - xieFloImportClientLUT *raw = (xieFloImportClientLUT *)ped->elemRaw; - inFloPtr inflo = &ped->inFloLst[IMPORT]; - int b; - - /* - * check for data-class, length, and levels errors, and stash attributes - * since this is STREAM data, we only have to record the class and band - * numbers in the inflos. - */ - if(raw->bandOrder != xieValLSFirst && raw->bandOrder != xieValMSFirst) - ValueError(flo,ped,raw->bandOrder, return(FALSE)); - - switch(raw->class) { - case xieValSingleBand : - - if(!raw->length0) - ValueError(flo,ped,0, return(FALSE)); - if(raw->levels0 < 2 || raw->levels0 > MAX_LEVELS(1)) - MatchError(flo,ped, return(FALSE)); - inflo->bands = 1; - break; -#if XIE_FULL - case xieValTripleBand : - if(!raw->length0 || !raw->length1 || !raw->length2) - ValueError(flo,ped,0, return(FALSE)); - if(raw->levels0 < 2 || raw->levels0 > MAX_LEVELS(3) || - raw->levels1 < 2 || raw->levels1 > MAX_LEVELS(3) || - raw->levels2 < 2 || raw->levels2 > MAX_LEVELS(3)) - MatchError(flo,ped, return(FALSE)); - - inflo->bands = 3; - inflo->format[1].band = 1; - inflo->format[2].band = 2; - ped->outFlo.format[1] = inflo->format[1]; - ped->outFlo.format[2] = inflo->format[2]; - ped->outFlo.format[1].levels = raw->levels1; - ped->outFlo.format[2].levels = raw->levels2; - ped->outFlo.format[1].height = raw->length1; - ped->outFlo.format[2].height = raw->length2; - break; -#endif - default : - ValueError(flo,ped,raw->class, return(FALSE)); - } - - inflo->format[0].band = 0; - ped->outFlo.format[0] = inflo->format[0]; - ped->outFlo.format[0].levels = raw->levels0; - ped->outFlo.format[0].height = raw->length0; - - for (b=0; b < inflo->bands; b++) { - formatPtr fmt = &(ped->outFlo.format[b]); - - inflo->format[b].class = STREAM; - ped->swapUnits[b] = LutPitch(fmt->levels); - - fmt->class = LUT_ARRAY; - fmt->interleaved = FALSE; - fmt->width = raw->bandOrder; /* see miclut.c, mppoint crazypixel */ - fmt->depth = 8; - fmt->stride = 8; - fmt->pitch = 8 * fmt->height; - } - - ped->outFlo.bands = inflo->bands; - - return(TRUE); -} /* end PrepICLUT */ - -/* end module iclut.c */ Index: xc/programs/Xserver/XIE/dixie/import/icphoto.c diff -u xc/programs/Xserver/XIE/dixie/import/icphoto.c:3.5 xc/programs/Xserver/XIE/dixie/import/icphoto.c:removed --- xc/programs/Xserver/XIE/dixie/import/icphoto.c:3.5 Fri Dec 14 14:58:00 2001 +++ xc/programs/Xserver/XIE/dixie/import/icphoto.c Sat Feb 28 21:41:57 2004 @@ -1,782 +0,0 @@ -/* $Xorg: icphoto.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module icphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - icphoto.c -- DIXIE routines for managing the ImportClientPhoto element - - Robert NC Shelley, Dean Verheiden -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/icphoto.c,v 3.5 2001/12/14 19:58:00 dawes Exp $ */ - -#define _XIEC_ICPHOTO - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepICPhoto(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec iCPhotoVec = { - PrepICPhoto /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ---------------- routine: make an import client photo element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeICPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportClientPhoto); - ELEMENT_AT_LEAST_SIZE(xieFloImportClientPhoto); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemImportClientPhoto, return(NULL)) ; - - ped->diVec = &iCPhotoVec; - ped->phototag = tag; - ped->flags.import = TRUE; - ped->flags.putData = TRUE; - raw = (xieFloImportClientPhoto *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - raw->notify = stuff->notify; - raw->class = stuff->class; - cpswapl(stuff->width0, raw->width0); - cpswapl(stuff->width1, raw->width1); - cpswapl(stuff->width2, raw->width2); - cpswapl(stuff->height0, raw->height0); - cpswapl(stuff->height1, raw->height1); - cpswapl(stuff->height2, raw->height2); - cpswapl(stuff->levels0, raw->levels0); - cpswapl(stuff->levels1, raw->levels1); - cpswapl(stuff->levels2, raw->levels2); - cpswaps(stuff->decodeTechnique, raw->decodeTechnique); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportClientPhoto)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValDecode, raw->decodeTechnique)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValDecode,raw->decodeTechnique,raw->lenParams, - return(ped)); - - return(ped); -} /* end MakeICPhoto */ - -#undef rparms -#define rparms ((xieTecDecodeUncompressedSingle *)sParms) -#undef cparms -#define cparms ((xieTecDecodeUncompressedSingle *)rParms) - -Bool CopyICPhotoUnSingle(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeUncompressedTriple *)sParms) -#undef cparms -#define cparms ((xieTecDecodeUncompressedTriple *)rParms) - -Bool CopyICPhotoUnTriple(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeG31D *)sParms) -#undef cparms -#define cparms ((xieTecDecodeG31D *)rParms) - -Bool CopyICPhotoG31D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeG32D *)sParms) -#undef cparms -#define cparms ((xieTecDecodeG32D *)rParms) - -Bool CopyICPhotoG32D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeG42D *)sParms) -#undef cparms -#define cparms ((xieTecDecodeG42D *)rParms) - -Bool CopyICPhotoG42D(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeJPEGBaseline *)sParms) -#undef cparms -#define cparms ((xieTecDecodeJPEGBaseline *)rParms) - -Bool CopyICPhotoJPEGBaseline(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#ifdef BEYOND_SI - -#undef rparms -#define rparms ((xieTecDecodeJPEGLossless *)sParms) -#undef cparms -#define cparms ((xieTecDecodeJPEGLossless *)rParms) - -Bool CopyICPhotoJPEGLossless(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} -#endif /* BEYOND_SI */ - -#undef rparms -#define rparms ((xieTecDecodeTIFF2 *)sParms) -#undef cparms -#define cparms ((xieTecDecodeTIFF2 *)rParms) - -Bool CopyICPhotoTIFF2(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - -#undef rparms -#define rparms ((xieTecDecodeTIFFPackBits *)sParms) -#undef cparms -#define cparms ((xieTecDecodeTIFFPackBits *)rParms) - -Bool CopyICPhotoTIFFPackBits(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - /* Nothing to swap for this technique */ - memcpy((char *)cparms, (char *)rparms, tsize<<2); - - return(TRUE); -} - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepICPhoto(floDefPtr flo, peDefPtr ped) -{ - int i; - xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; - inFloPtr inflo = &ped->inFloLst[IMPORT]; - - /* - * check for data-class, dimension, and levels errors, and stash attributes - */ - switch(raw->class) { - case xieValSingleBand : - if(!raw->width0 || !raw->height0 || !raw->levels0) - ValueError(flo,ped,0, return(FALSE)); - if(raw->levels0 > MAX_LEVELS(1)) - MatchError(flo,ped, return(FALSE)); - inflo->bands = 1; - break; - case xieValTripleBand : - if(!raw->width0 || !raw->height0 || !raw->levels0 || - !raw->width1 || !raw->height1 || !raw->levels1 || - !raw->width2 || !raw->height2 || !raw->levels2) - ValueError(flo,ped,0, return(FALSE)); - if(raw->levels0 > MAX_LEVELS(3) || - raw->levels1 > MAX_LEVELS(3) || - raw->levels2 > MAX_LEVELS(3)) - MatchError(flo,ped, return(FALSE)); - inflo->bands = 3; - inflo->format[1].band = 1; - inflo->format[1].width = raw->width1; - inflo->format[1].height = raw->height1; - inflo->format[1].levels = raw->levels1; - inflo->format[2].band = 2; - inflo->format[2].width = raw->width2; - inflo->format[2].height = raw->height2; - inflo->format[2].levels = raw->levels2; - break; - default : - ValueError(flo,ped,raw->class, return(FALSE)); - } - inflo->format[0].band = 0; - inflo->format[0].width = raw->width0; - inflo->format[0].height = raw->height0; - inflo->format[0].levels = raw->levels0; - - for(i = 0; i < inflo->bands; i++) - SetDepthFromLevels(inflo->format[i].levels, inflo->format[i].depth); - - if(!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValDecode,raw->decodeTechnique,raw->lenParams, - return(FALSE)); - - return(TRUE); -} /* end PrepICPhoto */ - - -/*------------------------------------------------------------------------ ------ routines: verify technique parameters against element parameters ---- --------------- and prepare for analysis and execution ---- -------------------------------------------------------------------------*/ - -/* Prep routine for uncompressed single band data */ -Bool PrepICPhotoUnSingle( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeUncompressedSingle *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - CARD32 padmod = tec->scanlinePad * 8; - CARD32 pitch = tec->pixelStride * raw->width0 + tec->leftPad; - BOOL aligned = !(tec->pixelStride & (tec->pixelStride-1)) || - tec->pixelStride == 24; - int i; - - if(tec->fillOrder != xieValLSFirst && /* check fill-order */ - tec->fillOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelOrder != xieValLSFirst && /* check pixel-order */ - tec->pixelOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelStride < inf->format[0].depth) /* check pixel-stride */ - return(FALSE); - if((ALIGNMENT == xieValAlignable && !aligned) || /* alignment & left-pad */ - (ALIGNMENT == xieValAlignable && aligned && - (tec->leftPad % tec->pixelStride || - tec->leftPad % 8))) - return(FALSE); - if(tec->scanlinePad & (tec->scanlinePad-1) || /* check scanline-pad */ - tec->scanlinePad > 16) - return(FALSE); - if(raw->class != xieValSingleBand) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - inf->format[0].stride = tec->pixelStride; - inf->format[0].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); -} /* PrepICPhotoUnSingle */ - -/* Prep routine for uncompressed triple band data */ -Bool PrepICPhotoUnTriple( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeUncompressedTriple *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->fillOrder != xieValLSFirst && /* check fill-order */ - tec->fillOrder != xieValMSFirst) - return(FALSE); - if(tec->pixelOrder != xieValLSFirst && /* check pixel-order */ - tec->pixelOrder != xieValMSFirst) - return(FALSE); - if(tec->bandOrder != xieValLSFirst && /* check band-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - if (tec->interleave == xieValBandByPixel && /* check inter-band dim */ - (inf->format[0].width != inf->format[1].width || - inf->format[1].width != inf->format[2].width || - inf->format[0].height != inf->format[1].height || - inf->format[1].height != inf->format[2].height)) - return(FALSE); - if(raw->class != xieValTripleBand) - return(FALSE); - if (tec->interleave == xieValBandByPlane) { - for (i = 0; i < 3; i++) { - CARD32 padmod = tec->scanlinePad[i] * 8; - CARD32 pitch = tec->pixelStride[i] * inf->format[i].width + - tec->leftPad[i]; - BOOL aligned = !(tec->pixelStride[i] & (tec->pixelStride[i] - 1)); - - if(tec->pixelStride[i] < inf->format[i].depth) /* check pixel-stride */ - return(FALSE); - if(inf->format[i].depth > MAX_DEPTH(3)) /* check pixel-depth */ - return(FALSE); - if((ALIGNMENT == xieValAlignable && !aligned) || /* alignment & left-pad */ - (ALIGNMENT == xieValAlignable && aligned && - (tec->leftPad[i] % tec->pixelStride[i] || - tec->leftPad[i] % 8))) - return(FALSE); - if(tec->scanlinePad[i] & (tec->scanlinePad[i] - 1) || - tec->scanlinePad[i] > 16) /*check scanline-pad*/ - return(FALSE); - inf->format[i].interleaved = FALSE; - inf->format[i].class = STREAM; - inf->format[i].stride = tec->pixelStride[i]; - inf->format[i].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - } - ped->outFlo.bands = inf->bands; - } else { /* xieValBandByPixel */ - CARD32 padmod = tec->scanlinePad[0] * 8; - CARD32 pitch = tec->pixelStride[0] * inf->format[0].width + - tec->leftPad[0]; - CARD32 tdepth = inf->format[0].depth + inf->format[1].depth + - inf->format[2].depth; - BOOL aligned = !(tec->pixelStride[0] & (tec->pixelStride[0] - 1)) || - tec->pixelStride[0] == 24; - - if(inf->format[0].depth > MAX_DEPTH(3) || /* check pixel-depth */ - inf->format[1].depth > MAX_DEPTH(3) || - inf->format[2].depth > MAX_DEPTH(3)) - return(FALSE); - if(tec->pixelStride[0] < tdepth) /* check overall pixel-stride */ - return(FALSE); - if((ALIGNMENT == xieValAlignable && !aligned) || /* alignment & left-pad */ - (ALIGNMENT == xieValAlignable && aligned && - (tec->leftPad[0] % tec->pixelStride[0] || - tec->leftPad[0] % 8))) - return(FALSE); - if(tec->scanlinePad[0] & (tec->scanlinePad[0] - 1) || - tec->scanlinePad[0] > 16) /*check scanline-pad*/ - return(FALSE); - - /* Now, go stomp on band zero values that should be changed */ - inf->bands = 1; - inf->format[0].interleaved = TRUE; - inf->format[0].class = STREAM; - inf->format[0].stride = tec->pixelStride[0]; - inf->format[0].pitch = pitch + (padmod ? Align(pitch,padmod) : 0); - - /* Set up 3 outflows for the one interleaved inflo */ - ped->outFlo.bands = 3; - } - - /* Copy input to output, setting differing output parameters when necessary */ - for (i = 0; i < ped->outFlo.bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - /* Fill in other format parameters based on the number of output levels */ - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); -} /* PrepICPhotoUnTriple */ - -Bool PrepICPhotoG31D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG31D *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - return(TRUE); - -} /* PrepICPhotoG31D */ - -Bool PrepICPhotoG32D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG32D *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoG32D */ - -Bool PrepICPhotoG42D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG42D *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoG42D */ - -Bool PrepICPhotoJPEGBaseline( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeJPEGBaseline *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if (raw->class == xieValSingleBand) - inf->format[0].interleaved = FALSE; - else { - if(tec->bandOrder != xieValLSFirst && /* check encoding-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - - inf->format[0].interleaved = - inf->format[1].interleaved = - inf->format[2].interleaved = - (tec->interleave == xieValBandByPixel); - inf->format[1].class = STREAM; - inf->format[2].class = STREAM; - } - - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - /* - * except if TripleBand Interleaved, we lied: there's only one - * band coming in. We copy the bogus inflos first just because - * we can assume they have been set up suitably by nice general - * purpose code above. :-) - */ - if (raw->class == xieValTripleBand && tec->interleave == xieValBandByPixel) - inf->bands = 1; - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoJPEGBaseline */ - -#ifdef BEYOND_SI -Bool PrepICPhotoJPEGLossless( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeJPEGLossless *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if (raw->class == xieValSingleBand) - inf->format[0].interleaved = FALSE; - else { - if(tec->bandOrder != xieValLSFirst && /* check encoding-order */ - tec->bandOrder != xieValMSFirst) - return(FALSE); - - if(tec->interleave != xieValBandByPixel && /* check interleave */ - tec->interleave != xieValBandByPlane) - return(FALSE); - - inf->format[0].interleaved = - inf->format[1].interleaved = - inf->format[2].interleaved = - (tec->interleave == xieValBandByPixel); - inf->format[1].class = STREAM; - inf->format[2].class = STREAM; - } - - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoJPEGLossless */ -#endif /* BEYOND_SI */ - -Bool PrepICPhotoTIFF2( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeTIFF2 *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoTIFF2 */ - -Bool PrepICPhotoTIFFPackBits( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeTIFFPackBits *tec) -{ - inFloPtr inf = &ped->inFloLst[IMPORT]; - int i; - - if(tec->encodedOrder != xieValLSFirst && /* check encoding-order */ - tec->encodedOrder != xieValMSFirst) - return(FALSE); - - inf->format[0].interleaved = FALSE; - inf->format[0].class = STREAM; - - /* - * determine output attributes from input parameters - */ - ped->outFlo.bands = inf->bands; - for (i = 0; i < inf->bands; i++) { - ped->outFlo.format[i] = inf->format[i]; - ped->outFlo.format[i].interleaved = FALSE; - } - - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo, ped, return(FALSE)); - - return(TRUE); - -} /* PrepICPhotoTIFFPackBits */ - -/* end module icphoto.c */ Index: xc/programs/Xserver/XIE/dixie/import/icroi.c diff -u xc/programs/Xserver/XIE/dixie/import/icroi.c:3.5 xc/programs/Xserver/XIE/dixie/import/icroi.c:removed --- xc/programs/Xserver/XIE/dixie/import/icroi.c:3.5 Fri Dec 14 14:58:01 2001 +++ xc/programs/Xserver/XIE/dixie/import/icroi.c Sat Feb 28 21:41:57 2004 @@ -1,157 +0,0 @@ -/* $Xorg: icroi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module icroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - icroi.c -- DIXIE routines for managing the ImportClientROI element - - Robert NC Shelley, Dean Verheiden -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/icroi.c,v 3.5 2001/12/14 19:58:01 dawes Exp $ */ - -#define _XIEC_ICROI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepICROI(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec iCROIVec = -{ - PrepICROI /* prepare for analysis and execution */ -}; - -/*------------------------------------------------------------------------ ---------------- routine: make an import client roi element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeICROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportClientROI); - ELEMENT_SIZE_MATCH(xieFloImportClientROI); - - if (!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemImportClientROI, return(NULL)) ; - - ped->diVec = &iCROIVec; - ped->phototag = tag; - ped->flags.import = TRUE; - ped->flags.putData = TRUE; - raw = (xieFloImportClientROI *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswapl(stuff->rectangles, raw->rectangles); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportClientROI)); - - return ped; -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepICROI(floDefPtr flo, peDefPtr ped) -{ - inFloPtr inflo = &ped->inFloLst[IMPORT]; - outFloPtr outflo = &ped->outFlo; - - inflo->bands = outflo->bands = 1; - inflo->format[0].class = STREAM; - outflo->format[0].class = RUN_LENGTH; - ped->swapUnits[0] = sizeof(xieTypRectangle); - - return TRUE; -} /* end PrepICROI */ - -/* end module icroi.c */ Index: xc/programs/Xserver/XIE/dixie/import/idraw.c diff -u xc/programs/Xserver/XIE/dixie/import/idraw.c:3.5 xc/programs/Xserver/XIE/dixie/import/idraw.c:removed --- xc/programs/Xserver/XIE/dixie/import/idraw.c:3.5 Fri Dec 14 14:58:01 2001 +++ xc/programs/Xserver/XIE/dixie/import/idraw.c Sat Feb 28 21:41:57 2004 @@ -1,210 +0,0 @@ -/* $Xorg: idraw.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module idraw.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - idraw.c -- DIXIE routines for managing the ImportDrawable element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/idraw.c,v 3.5 2001/12/14 19:58:01 dawes Exp $ */ - -#define _XIEC_IDRAW - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * more X server includes. - */ -#include -#include -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepIDraw(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec iDrawVec = { - PrepIDraw /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ImportDrawable element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeIDraw(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportDrawable); - ELEMENT_SIZE_MATCH(xieFloImportDrawable); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(iDrawDefRec)))) - FloAllocError(flo,tag,xieElemImportDrawable, return(NULL)); - - ped->diVec = &iDrawVec; - ped->phototag = tag; - ped->flags.import = TRUE; - raw = (xieFloImportDrawable *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - raw->notify = stuff->notify; - cpswapl(stuff->drawable, raw->drawable); - cpswaps(stuff->srcX, raw->srcX); - cpswaps(stuff->srcY, raw->srcY); - cpswaps(stuff->width, raw->width); - cpswaps(stuff->height, raw->height); - cpswapl(stuff->fill, raw->fill); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportDrawable)); - - return(ped); -} /* end MakeIDraw */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepIDraw(floDefPtr flo, peDefPtr ped) -{ - xieFloImportDrawable *raw = (xieFloImportDrawable *) ped->elemRaw; - iDrawDefPtr pvt = (iDrawDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr dst = &ped->outFlo; - formatPtr fmt = &inf->format[0]; - DrawablePtr pd; - CARD32 f, padmask; - - if(!(pd = pvt->pDraw = ((DrawablePtr) - LookupIDByClass(raw->drawable, RC_DRAWABLE)))) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - if(!((pd->type == DRAWABLE_WINDOW && ((WindowPtr)pd)->realized) || - pd->type == DRAWABLE_PIXMAP)) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - if(raw->srcX < 0) { - ValueError(flo,ped,raw->srcX, return(FALSE)); - } else if (raw->srcY < 0) { - ValueError(flo,ped,raw->srcY, return(FALSE)); - } else if (raw->srcX + raw->width > pd->width) { - ValueError(flo,ped,raw->width, return(FALSE)); - } else if (raw->srcY + raw->height > pd->height) { - ValueError(flo,ped,raw->height, return(FALSE)); - } - /* find the screen format that matches this drawable and fill in the format - */ - for(f = 0; f < screenInfo.numPixmapFormats - && pd->depth != screenInfo.formats[f].depth; ++f); - if(f == screenInfo.numPixmapFormats) - DrawableError(flo,ped,raw->drawable,return(FALSE)); - padmask = screenInfo.formats[f].scanlinePad - 1; - fmt->interleaved = FALSE; - fmt->band = 0; - fmt->depth = pd->depth; - fmt->width = raw->width; - fmt->height = raw->height; - fmt->levels = 1<depth; - fmt->stride = screenInfo.formats[f].bitsPerPixel; - fmt->pitch = (fmt->stride * raw->width + padmask) & ~padmask; - /* - * set output attributes from input format (stride and pitch may differ) - */ - dst->bands = inf->bands = 1; - dst->format[0] = inf->format[0]; - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - return(TRUE); -} /* end PrepIDraw */ -/* end module idraw.c */ Index: xc/programs/Xserver/XIE/dixie/import/idrawp.c diff -u xc/programs/Xserver/XIE/dixie/import/idrawp.c:3.5 xc/programs/Xserver/XIE/dixie/import/idrawp.c:removed --- xc/programs/Xserver/XIE/dixie/import/idrawp.c:3.5 Fri Dec 14 14:58:01 2001 +++ xc/programs/Xserver/XIE/dixie/import/idrawp.c Sat Feb 28 21:41:57 2004 @@ -1,215 +0,0 @@ -/* $Xorg: idrawp.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module idrawp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - idrawp.c -- DIXIE routines for managing the ImportDrawablePlane element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/idrawp.c,v 3.5 2001/12/14 19:58:01 dawes Exp $ */ - -#define _XIEC_IDRAWP - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * more X server includes. - */ -#include -#include -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepIDrawP(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec iDrawPVec = { - PrepIDrawP /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ImportDrawablePlane element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeIDrawP(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportDrawablePlane); - ELEMENT_SIZE_MATCH(xieFloImportDrawablePlane); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(iDrawDefRec)))) - FloAllocError(flo,tag,xieElemImportDrawablePlane, return(NULL)); - - ped->diVec = &iDrawPVec; - ped->phototag = tag; - ped->flags.import = TRUE; - raw = (xieFloImportDrawablePlane *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - raw->notify = stuff->notify; - cpswapl(stuff->drawable, raw->drawable); - cpswaps(stuff->srcX, raw->srcX); - cpswaps(stuff->srcY, raw->srcY); - cpswaps(stuff->width, raw->width); - cpswaps(stuff->height, raw->height); - cpswapl(stuff->fill, raw->fill); - cpswapl(stuff->bitPlane, raw->bitPlane); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportDrawablePlane)); - - return(ped); -} /* end MakeIDrawP */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepIDrawP(floDefPtr flo, peDefPtr ped) -{ - xieFloImportDrawablePlane *raw = (xieFloImportDrawablePlane *) ped->elemRaw; - iDrawDefPtr pvt = (iDrawDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr dst = &ped->outFlo; - formatPtr fmt = &inf->format[0]; - DrawablePtr pd; - CARD32 f, padmask; - - if(!(pd = pvt->pDraw = ((DrawablePtr) - LookupIDByClass(raw->drawable, RC_DRAWABLE)))) - DrawableError(flo,ped,raw->drawable,return(FALSE)); - - if(!((pd->type == DRAWABLE_WINDOW && ((WindowPtr)pd)->realized) || - pd->type == DRAWABLE_PIXMAP)) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - if(raw->srcX < 0) { - ValueError(flo,ped,raw->srcX, return(FALSE)); - } else if (raw->srcY < 0) { - ValueError(flo,ped,raw->srcY, return(FALSE)); - } else if (raw->srcX + raw->width > pd->width) { - ValueError(flo,ped,raw->width, return(FALSE)); - } else if (raw->srcY + raw->height > pd->height) { - ValueError(flo,ped,raw->height, return(FALSE)); - } else if(!raw->bitPlane || raw->bitPlane & (raw->bitPlane - 1) || - raw->bitPlane >= (1<depth)) - ValueError(flo,ped,raw->bitPlane, return(FALSE)); - - /* find the screen format that matches this drawable and fill in the format - */ - for(f = 0; f < screenInfo.numPixmapFormats - && pd->depth != screenInfo.formats[f].depth; ++f); - if(f == screenInfo.numPixmapFormats) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - padmask = screenInfo.formats[f].scanlinePad - 1; - fmt->interleaved = FALSE; - fmt->band = 0; - fmt->depth = pd->depth; - fmt->width = raw->width; - fmt->height = raw->height; - fmt->levels = 1<depth; - fmt->stride = screenInfo.formats[f].bitsPerPixel; - fmt->pitch = (fmt->stride * raw->width + padmask) & ~padmask; - /* - * set output attributes from input format (stride and pitch may differ) - */ - dst->bands = inf->bands = 1; - dst->format[0] = inf->format[0]; - dst->format[0].levels = 2; - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - return(TRUE); -} /* end PrepIDrawP */ -/* end module idrawp.c */ Index: xc/programs/Xserver/XIE/dixie/import/ilut.c diff -u xc/programs/Xserver/XIE/dixie/import/ilut.c:3.5 xc/programs/Xserver/XIE/dixie/import/ilut.c:removed --- xc/programs/Xserver/XIE/dixie/import/ilut.c:3.5 Fri Dec 14 14:58:01 2001 +++ xc/programs/Xserver/XIE/dixie/import/ilut.c Sat Feb 28 21:41:57 2004 @@ -1,209 +0,0 @@ -/* $Xorg: ilut.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module ilut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ilut.c -- DIXIE routines for managing the ImportLUT element - - Larry Hare -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/ilut.c,v 3.5 2001/12/14 19:58:01 dawes Exp $ */ - -#define _XIEC_ILUT - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepILUT(floDefPtr flo, peDefPtr ped); -static Bool DebriefILUT(floDefPtr flo, peDefPtr ped, Bool ok); - -/* - * dixie entry points - */ -static diElemVecRec iLUTVec = { - PrepILUT, - DebriefILUT - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an import lut element --------------- -------------------------------------------------------------------------*/ -peDefPtr MakeILUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportLUT); - ELEMENT_SIZE_MATCH(xieFloImportLUT); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(iLUTDefRec)))) - FloAllocError(flo,tag,xieElemImportLUT, return(NULL)); - - ped->diVec = &iLUTVec; - ped->phototag = tag; - ped->flags.import = TRUE; - raw = (xieFloImportLUT *)ped->elemRaw; - - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswapl(stuff->lut, raw->lut); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportLUT)); - - return(ped); -} /* end MakeILUT */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepILUT(floDefPtr flo, peDefPtr ped) -{ - xieFloImportLUT *raw = (xieFloImportLUT *)ped->elemRaw; - iLUTDefPtr pvt = (iLUTDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr dst = &ped->outFlo; - formatPtr dfp, ifp; - lutPtr lut; - CARD32 b, nbands; - - /* find the LUT resource and bind it to our flo */ - if( !(lut = (lutPtr) LookupIDByType(raw->lut, RT_LUT)) ) - LUTError(flo,ped,raw->lut, return(FALSE)); - ++lut->refCnt; - pvt->lut = lut; - - if(!lut->lutCnt) - AccessError(flo,ped, return(FALSE)); - - nbands = lut->lutCnt; - if (nbands != 1 && nbands != 3) - ImplementationError(flo,ped,return(FALSE)); - - /* propagate LUT attributes to our output */ - dst->bands = inf->bands = nbands; - for(b = 0, dfp = &(dst->format[0]), ifp = &(inf->format[0]); - b < nbands; b++, dfp++, ifp++) { - dfp->band = ifp->band = b; - dfp->class = ifp->class = LUT_ARRAY; - dfp->levels = ifp->levels = lut->format[b].level; - dfp->height = ifp->height = lut->format[b].length; /* ugly hack */ - dfp->width = ifp->width = lut->format[b].bandOrder; /* ugly hack */ - dfp->interleaved = ifp->interleaved = FALSE; - /* width = 1; depth=8?; stride=8; pitch = 8*height; */ - } - - return(TRUE); -} /* end PrepILUT */ - - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefILUT(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloImportLUT *raw = (xieFloImportLUT *)ped->elemRaw; - iLUTDefPtr pvt = (iLUTDefPtr) ped->elemPvt; - lutPtr lut; - - if(pvt && (lut = pvt->lut)) - if(lut->refCnt > 1) - --lut->refCnt; - else if(LookupIDByType(raw->lut, RT_LUT)) - FreeResourceByType(lut->ID, RT_LUT, RT_NONE); - else - DeleteLUT(lut, lut->ID); - - return(TRUE); -} /* end DebriefILUT */ - -/* end module ilut.c */ Index: xc/programs/Xserver/XIE/dixie/import/iphoto.c diff -u xc/programs/Xserver/XIE/dixie/import/iphoto.c:3.5 xc/programs/Xserver/XIE/dixie/import/iphoto.c:removed --- xc/programs/Xserver/XIE/dixie/import/iphoto.c:3.5 Fri Dec 14 14:58:01 2001 +++ xc/programs/Xserver/XIE/dixie/import/iphoto.c Sat Feb 28 21:41:57 2004 @@ -1,253 +0,0 @@ -/* $Xorg: iphoto.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module iphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - iphoto.c -- DIXIE routines for managing the ImportPhotomap element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/iphoto.c,v 3.5 2001/12/14 19:58:01 dawes Exp $ */ - -#define _XIEC_IPHOTO - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - - -/* - * routines internal to this module - */ -static Bool PrepIPhoto(floDefPtr flo, peDefPtr ped); -static Bool DebriefIPhoto(floDefPtr flo, peDefPtr ped, Bool ok); - -/* - * dixie entry points - */ -static diElemVecRec iPhotoVec = { - PrepIPhoto, - DebriefIPhoto - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an import photomap element --------------- -------------------------------------------------------------------------*/ -peDefPtr MakeIPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloImportPhotomap); - ELEMENT_SIZE_MATCH(xieFloImportPhotomap); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(iPhotoDefRec)))) - FloAllocError(flo,tag,xieElemImportPhotomap, return(NULL)); - - ped->diVec = &iPhotoVec; - ped->phototag = tag; - ped->flags.import = TRUE; - raw = (xieFloImportPhotomap *)ped->elemRaw; - - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswapl(stuff->photomap, raw->photomap); - raw->notify = stuff->notify; - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportPhotomap)); - - return(ped); -} /* end MakeIPhoto */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepIPhoto(floDefPtr flo, peDefPtr ped) -{ - xieFloImportPhotomap *raw = (xieFloImportPhotomap *)ped->elemRaw; - iPhotoDefPtr pvt = (iPhotoDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr dst = &ped->outFlo; - photomapPtr map; - CARD32 b; - - /* find the photomap resource and bind it to our flo */ - if( !(map = (photomapPtr) LookupIDByType(raw->photomap, RT_PHOTOMAP)) ) - PhotomapError(flo,ped,raw->photomap, return(FALSE)); - ++map->refCnt; - - /* Load up a generic structure for importing photos from map and client */ - pvt->map = map; - - if(!map->bands) - AccessError(flo,ped, return(FALSE)); - - /* grab a copy of the input attributes and propagate them to our output */ - inf->bands = map->bands; - - /* copy map formats to inflo format */ - for(b = 0; b < inf->bands; b++) - inf->format[b] = map->format[b]; - - /* also copy them to the outflo format, handling interleave if necessary */ - dst->bands = (map->dataClass == xieValTripleBand)? 3 : - (map->dataClass == xieValSingleBand)? 1 : 0; - - for(b = 0; b < dst->bands; b++) { - dst->format[b] = map->format[b]; - dst->format[b].interleaved = FALSE; - } - /* NOTE: the loop is over dst->bands, not map->bands. This is because - * dst->bands can be 3 when map->bands is 1. The in ephoto.c saves all - * the formats of the inflo in the photomap, so they are available now - * when we need them. interleaved is FALSE by definition because only - * ExportPhotomap elements can *produce* interleaved data. - */ - - if (!UpdateFormatfromLevels(ped)) - ImplementationError(flo, ped, return(FALSE)); - - return(TRUE); -} /* end PrepIPhoto */ - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefIPhoto(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloImportPhotomap *raw = (xieFloImportPhotomap *)ped->elemRaw; - iPhotoDefPtr pvt = (iPhotoDefPtr) ped->elemPvt; - photomapPtr map; - - if(pvt && (map = (photomapPtr)pvt->map)) - if(map->refCnt > 1) - --map->refCnt; - else if(LookupIDByType(raw->photomap, RT_PHOTOMAP)) - FreeResourceByType(map->ID, RT_PHOTOMAP, RT_NONE); - else - DeletePhotomap(map, map->ID); - pvt->map = (photomapPtr)NULL; - - return(TRUE); -} /* end DebriefIPhoto */ - -/*------------------------------------------------------------------------ ------------------- routine: return import-private stuff ----------------- -------------------------------------------------------------------------*/ -photomapPtr GetImportPhotomap(peDefPtr ped) -{ - return(((iPhotoDefPtr)ped->elemPvt)->map); -} - -pointer GetImportTechnique(peDefPtr ped, CARD16 *num_ret, CARD16 *len_ret) -{ - switch(ped->elemRaw->elemType) { - case xieElemImportPhotomap: - { - photomapPtr imap; - - imap = GetImportPhotomap(ped); - *num_ret = imap->technique; - *len_ret = imap->lenParms; - return(imap->tecParms); - } - case xieElemImportClientPhoto: - { - xieFloImportClientPhoto *icp = (xieFloImportClientPhoto*)ped->elemRaw; - *num_ret = icp->decodeTechnique; - *len_ret = icp->lenParams << 2; - return((pointer)&icp[1]); - } - default: - *num_ret = 0; - *len_ret = 0; - return(NULL); - } -} /* GetImportTechnique */ - -/* end module iphoto.c */ Index: xc/programs/Xserver/XIE/dixie/import/iroi.c diff -u xc/programs/Xserver/XIE/dixie/import/iroi.c:3.5 xc/programs/Xserver/XIE/dixie/import/iroi.c:removed --- xc/programs/Xserver/XIE/dixie/import/iroi.c:3.5 Fri Dec 14 14:58:02 2001 +++ xc/programs/Xserver/XIE/dixie/import/iroi.c Sat Feb 28 21:41:57 2004 @@ -1,198 +0,0 @@ -/* $Xorg: iroi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module iroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - iroi.c -- DIXIE routines for managing the ImportROI element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/import/iroi.c,v 3.5 2001/12/14 19:58:02 dawes Exp $ */ - -#define _XIEC_IROI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepIROI(floDefPtr flo, peDefPtr ped); -static Bool DebriefIROI(floDefPtr flo, peDefPtr ped, Bool ok); - -/* - * dixie entry points - */ -static diElemVecRec iROIVec = -{ - PrepIROI, /* prepare for analysis and execution */ - DebriefIROI /* debrief */ -}; - -/*------------------------------------------------------------------------ ------------------ routine: make an ImportROI element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeIROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloImportROI); - ELEMENT_SIZE_MATCH(xieFloImportROI); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, sizeof(iROIDefRec)))) - FloAllocError(flo,tag,xieElemImportROI, return(NULL)); - - ped->diVec = &iROIVec; - ped->phototag = tag; - ped->flags.import = TRUE; - raw = (xieFloImportROI *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswapl(stuff->roi, raw->roi); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloImportROI)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - - return ped; -} /* end MakeIROI */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepIROI(floDefPtr flo, peDefPtr ped) -{ - xieFloImportROI *raw = (xieFloImportROI *)ped->elemRaw; - iROIDefPtr pvt = (iROIDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr dst = &ped->outFlo; - roiPtr roi; - - /* grab roi resource */ - if (!(roi = (roiPtr)LookupIDByType(raw->roi, RT_ROI))) - ROIError(flo,ped,raw->roi,return(FALSE)); - - /* Make sure the roi has been populated */ - if (ListEmpty(&roi->strips)) - AccessError(flo,ped, return(FALSE)); - - roi->refCnt++; - pvt->roi = roi; - - dst->bands = inf->bands = 1; - dst->format[0].class = inf->format[0].class = RUN_LENGTH; - - return TRUE; -} /* end PrepIROI */ - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefIROI(floDefPtr flo, peDefPtr ped, Bool ok) -{ - xieFloImportROI *raw = (xieFloImportROI *)ped->elemRaw; - iROIDefPtr pvt = (iROIDefPtr)ped->elemPvt; - roiPtr roi; - - if(pvt && (roi = pvt->roi)) - if(pvt->roi->refCnt > 1) - --roi->refCnt; - else if(LookupIDByType(raw->roi, RT_ROI)) - FreeResourceByType(pvt->roi->ID, RT_ROI, RT_NONE); - else - DeleteROI(roi, roi->ID); - - return TRUE; -} /* end DebriefIROI */ - -/* end module iroi.c */ Index: xc/programs/Xserver/XIE/dixie/process/Imakefile diff -u xc/programs/Xserver/XIE/dixie/process/Imakefile:3.6 xc/programs/Xserver/XIE/dixie/process/Imakefile:removed --- xc/programs/Xserver/XIE/dixie/process/Imakefile:3.6 Wed Jan 17 17:12:51 2001 +++ xc/programs/Xserver/XIE/dixie/process/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,42 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:25 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/dixie/process/Imakefile,v 3.6 2001/01/17 22:12:51 dawes Exp $ - -XCOMM build device independent processing element objects - -#define IHaveModules -#include - -SRCS1 = pgeom.c ppoint.c -OBJS1 = pgeom.o ppoint.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = parith.c pbandc.c pbande.c pbands.c pblend.c pcfrgb.c pcfromi.c \ - pcnst.c pcomp.c pconv.c pctoi.c pctrgb.c pdither.c phist.c \ - plogic.c pmath.c ppaste.c puncnst.c - -OBJS2 = parith.o pbandc.o pbande.o pbands.o pblend.o pcfrgb.o pcfromi.o \ - pcnst.o pcomp.o pconv.o pctoi.o pctrgb.o pdither.o phist.o \ - plogic.o pmath.o ppaste.o puncnst.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) - LINTLIBS = ../export/llib-lexp.ln ../import/llib-limp.ln \ - ../process/llib-lproc.ln ../request/llib-lreq.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(proc,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/dixie/process/parith.c diff -u xc/programs/Xserver/XIE/dixie/process/parith.c:3.5 xc/programs/Xserver/XIE/dixie/process/parith.c:removed --- xc/programs/Xserver/XIE/dixie/process/parith.c:3.5 Fri Dec 14 14:58:03 2001 +++ xc/programs/Xserver/XIE/dixie/process/parith.c Sat Feb 28 21:41:57 2004 @@ -1,248 +0,0 @@ -/* $Xorg: parith.c,v 1.6 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module parith.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - parith.c -- DIXIE routines for managing the Arithmetic element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/parith.c,v 3.5 2001/12/14 19:58:03 dawes Exp $ */ - -#define _XIEC_PARITH - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepArith(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pArithVec = { - PrepArith /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a arithmetic element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeArith(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - pArithDefPtr pvt; - ELEMENT(xieFloArithmetic); - ELEMENT_SIZE_MATCH(xieFloArithmetic); - ELEMENT_NEEDS_1_INPUT(src1); - inputs = 1 + (stuff->src2 ? 1 : 0) + (stuff->domainPhototag ? 1 :0); - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, - sizeof(pArithDefRec)))) - FloAllocError(flo, tag, xieElemArithmetic, return(NULL)); - - ped->diVec = &pArithVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloArithmetic *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src1, raw->src1); - cpswaps(stuff->src2, raw->src2); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->operator = stuff->operator; - raw->bandMask = stuff->bandMask; - cpswapl(stuff->constant0, raw->constant0); - cpswapl(stuff->constant1, raw->constant1); - cpswapl(stuff->constant2, raw->constant2); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloArithmetic)); - - if(!raw->src2) { - /* - * convert constants - */ - pvt = (pArithDefPtr)ped->elemPvt; - pvt->constant[0] = ConvertFromIEEE(raw->constant0); - pvt->constant[1] = ConvertFromIEEE(raw->constant1); - pvt->constant[2] = ConvertFromIEEE(raw->constant2); - } - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src1; - if(raw->src2) inFlo[SRCt2].srcTag = raw->src2; - if(raw->domainPhototag) inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - - return(ped); -} /* end MakeArith */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepArith(floDefPtr flo, peDefPtr ped) -{ - xieFloArithmetic *raw = (xieFloArithmetic *)ped->elemRaw; - inFloPtr ind, in2, in1 = &ped->inFloLst[SRCt1]; - outFloPtr dom, sr2, sr1 = &in1->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD8 bmask = raw->bandMask; - int b; - - /* make sure input is not bitonal */ - for (b = 0; b < sr1->bands; b++) - if (IsntCanonic(sr1->format[b].class) || - ((bmask & (1<format[b].class == BIT_PIXEL)) - MatchError(flo,ped, return(FALSE)); - - /* check out our second source */ - if(raw->src2) { - in2 = &ped->inFloLst[SRCt2]; - sr2 = &in2->srcDef->outFlo; - if(sr1->bands != sr2->bands) - MatchError(flo,ped, return(FALSE)); - for (b = 0; b < sr1->bands; b++) { - if ((bmask & (1<format[b].class != sr2->format[b].class || - (IsConstrained(sr1->format[b].class) && - sr1->format[b].levels != sr2->format[b].levels)) - MatchError(flo,ped, return(FALSE)); - } - in2->bands = sr2->bands; - } else - sr2 = NULL; - - /* check out our process domain */ - if(raw->domainPhototag) { - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if(IsntDomain(dom->format[0].class) || - (ind->bands = dom->bands) != 1) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } else - dom = NULL; - - /* grab a copy of the input attributes and propagate them to our output */ - dst->bands = in1->bands = sr1->bands; - for(b = 0; b < dst->bands; b++) { - dst->format[b] = in1->format[b] = sr1->format[b]; - if(sr2) - in2->format[b] = sr2->format[b]; - } - - /* check out our operator */ - switch(raw->operator) { - case xieValAdd: - case xieValMax: - case xieValMin: - case xieValSub: - case xieValSubRev: - break; - case xieValDiv: - case xieValDivRev: - case xieValGamma: - case xieValMul: - if(raw->src2) - SourceError(flo,ped, return(FALSE)); - break; - default: OperatorError(flo,ped,raw->operator, return(FALSE)); - } - return( TRUE ); -} /* end PrepArith */ - -/* end module parith.c */ Index: xc/programs/Xserver/XIE/dixie/process/pbandc.c diff -u xc/programs/Xserver/XIE/dixie/process/pbandc.c:3.5 xc/programs/Xserver/XIE/dixie/process/pbandc.c:removed --- xc/programs/Xserver/XIE/dixie/process/pbandc.c:3.5 Fri Dec 14 14:58:03 2001 +++ xc/programs/Xserver/XIE/dixie/process/pbandc.c Sat Feb 28 21:41:57 2004 @@ -1,195 +0,0 @@ -/* $Xorg: pbandc.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pbandc.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pbandc.c -- DIXIE routines for managing the band combine element - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pbandc.c,v 3.5 2001/12/14 19:58:03 dawes Exp $ */ - -#define _XIEC_PBANDC - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepBandCom(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pBandComVec = { - PrepBandCom /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a blend element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeBandCom(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloBandCombine); - ELEMENT_SIZE_MATCH(xieFloBandCombine); - ELEMENT_NEEDS_3_INPUTS(src1,src2,src3); - - if(!(ped = MakePEDef(3, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo, tag, xieElemBandCombine, return(NULL)); - - ped->diVec = &pBandComVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloBandCombine *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src1, raw->src1); - cpswaps(stuff->src2, raw->src2); - cpswaps(stuff->src3, raw->src3); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloBandCombine)); - - /* assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src1; - inFlo[SRCt2].srcTag = raw->src2; - inFlo[SRCt3].srcTag = raw->src3; - - return(ped); -} /* end MakeBandCom */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepBandCom(floDefPtr flo, peDefPtr ped) -{ - inFloPtr in1 = &ped->inFloLst[SRCt1]; - inFloPtr in2 = &ped->inFloLst[SRCt2]; - inFloPtr in3 = &ped->inFloLst[SRCt3]; - inFloPtr inf = in1; - outFloPtr sr1 = &in1->srcDef->outFlo; - outFloPtr sr2 = &in2->srcDef->outFlo; - outFloPtr sr3 = &in3->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* All inputs must be single band */ - if(sr1->bands != 1 || sr2->bands != 1 || sr3->bands != 1) - MatchError(flo,ped, return(FALSE)); - - /* All sources must be either constrained or unconstrained */ - if(IsConstrained(sr1->format[0].class)) { - if(IsntConstrained(sr2->format[0].class) || - IsntConstrained(sr3->format[0].class)) - MatchError(flo,ped, return(FALSE)); - } else { - if(sr1->format[0].class != UNCONSTRAINED || - sr2->format[0].class != UNCONSTRAINED || - sr3->format[0].class != UNCONSTRAINED) - MatchError(flo,ped, return(FALSE)); - } - /* grab a copy of the input attributes and propagate them to our output */ - in1->bands = in2->bands = in3->bands = 1; - dst->bands = xieValMaxBands; - for(b = 0; b < xieValMaxBands; ++inf, ++b) { - dst->format[b] = inf->format[0] = inf->srcDef->outFlo.format[0]; - dst->format[b].band = b; - if(IsConstrained(dst->format[b].class) && - dst->format[b].depth > MAX_DEPTH(xieValMaxBands)) - MatchError(flo,ped, return(FALSE)); - } - return( TRUE ); -} /* end PrepBandCom */ - -/* end module pbandc.c */ Index: xc/programs/Xserver/XIE/dixie/process/pbande.c diff -u xc/programs/Xserver/XIE/dixie/process/pbande.c:3.5 xc/programs/Xserver/XIE/dixie/process/pbande.c:removed --- xc/programs/Xserver/XIE/dixie/process/pbande.c:3.5 Fri Dec 14 14:58:03 2001 +++ xc/programs/Xserver/XIE/dixie/process/pbande.c Sat Feb 28 21:41:57 2004 @@ -1,194 +0,0 @@ -/* $Xorg: pbande.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pbande.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pbande.c -- DIXIE routines for managing the band combine element - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pbande.c,v 3.5 2001/12/14 19:58:03 dawes Exp $ */ - -#define _XIEC_PBANDE - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepBandExt(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pBandExtVec = { - PrepBandExt /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a blend element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeBandExt(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - double *coef; - peDefPtr ped; - inFloPtr inFlo; - pBandExtDefPtr pvt; - ELEMENT(xieFloBandExtract); - ELEMENT_SIZE_MATCH(xieFloBandExtract); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(pBandExtDefRec)))) - FloAllocError(flo, tag, xieElemBandExtract, return(NULL)); - - ped->diVec = &pBandExtVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloBandExtract *)ped->elemRaw; - pvt = (pBandExtDefPtr)ped->elemPvt; - coef = pvt->coef; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->levels, raw->levels); - pvt->bias = ConvertFromIEEE(lswapl(stuff->bias)); - coef[0] = ConvertFromIEEE(lswapl(stuff->constant0)); - coef[1] = ConvertFromIEEE(lswapl(stuff->constant1)); - coef[2] = ConvertFromIEEE(lswapl(stuff->constant2)); - } else { - memcpy((char *)raw, (char *)stuff, sizeof(xieFloBandExtract)); - pvt->bias = ConvertFromIEEE(stuff->bias); - coef[0] = ConvertFromIEEE(stuff->constant0); - coef[1] = ConvertFromIEEE(stuff->constant1); - coef[2] = ConvertFromIEEE(stuff->constant2); - } - /* assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeBandExt */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepBandExt(floDefPtr flo, peDefPtr ped) -{ - xieFloBandExtract *raw = (xieFloBandExtract *)ped->elemRaw; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - - /* verify input attribute compatibility */ - if(src->bands != 3 || - IsntCanonic(src->format[0].class) || - src->format[0].width != src->format[1].width || - src->format[1].width != src->format[2].width || - src->format[0].height != src->format[1].height || - src->format[1].height != src->format[2].height) - MatchError(flo,ped, return(FALSE)); - - inf->bands = 3; - dst->bands = 1; - inf->format[0] = src->format[0]; - inf->format[1] = src->format[1]; - inf->format[2] = src->format[2]; - dst->format[0] = src->format[0]; - if(IsConstrained(src->format[0].class)) { - dst->format[0].levels = raw->levels; - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - } - return TRUE; -} /* end PrepBandExt */ - -/* end module pbande.c */ Index: xc/programs/Xserver/XIE/dixie/process/pbands.c diff -u xc/programs/Xserver/XIE/dixie/process/pbands.c:3.5 xc/programs/Xserver/XIE/dixie/process/pbands.c:removed --- xc/programs/Xserver/XIE/dixie/process/pbands.c:3.5 Fri Dec 14 14:58:03 2001 +++ xc/programs/Xserver/XIE/dixie/process/pbands.c Sat Feb 28 21:41:57 2004 @@ -1,174 +0,0 @@ -/* $Xorg: pbands.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pbands.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pbands.c -- DIXIE routines for managing the band select element - - Robert NC Shelley -- AGE Logic, Inc. September 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pbands.c,v 3.5 2001/12/14 19:58:03 dawes Exp $ */ - -#define _XIEC_PBANDS - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepBandSel(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pBandSelVec = { - PrepBandSel /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a blend element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeBandSel(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloBandSelect); - ELEMENT_SIZE_MATCH(xieFloBandSelect); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo, tag, xieElemBandSelect, return(NULL)); - - ped->diVec = &pBandSelVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloBandSelect *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->bandNumber = stuff->bandNumber; - } else { - memcpy((char *)raw, (char *)stuff, sizeof(xieFloBandSelect)); - } - /* assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeBandSel */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepBandSel(floDefPtr flo, peDefPtr ped) -{ - xieFloBandSelect *raw = (xieFloBandSelect *)ped->elemRaw; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - - if(src->bands != 3 || IsntCanonic(src->format[0].class)) - MatchError(flo,ped, return(FALSE)); - if(raw->bandNumber >= xieValMaxBands) - ValueError(flo,ped,(CARD32)raw->bandNumber, return(FALSE)); - - inf->bands = 3; - dst->bands = 1; - inf->format[0] = src->format[0]; - inf->format[1] = src->format[1]; - inf->format[2] = src->format[2]; - dst->format[0] = src->format[raw->bandNumber]; - dst->format[0].band = 0; - - return( TRUE ); -} /* end PrepBandSel */ - -/* end module pbands.c */ Index: xc/programs/Xserver/XIE/dixie/process/pblend.c diff -u xc/programs/Xserver/XIE/dixie/process/pblend.c:3.5 xc/programs/Xserver/XIE/dixie/process/pblend.c:removed --- xc/programs/Xserver/XIE/dixie/process/pblend.c:3.5 Fri Dec 14 14:58:03 2001 +++ xc/programs/Xserver/XIE/dixie/process/pblend.c Sat Feb 28 21:41:57 2004 @@ -1,258 +0,0 @@ -/* $Xorg: pblend.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pblend.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pblend.c -- DIXIE routines for managing the Blend element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pblend.c,v 3.5 2001/12/14 19:58:03 dawes Exp $ */ - -#define _XIEC_PBLEND - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepBlend(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pBlendVec = { - PrepBlend /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a blend element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeBlend(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs, index; - peDefPtr ped; - inFloPtr inFlo; - pBlendDefPtr pvt; - ELEMENT(xieFloBlend); - ELEMENT_SIZE_MATCH(xieFloBlend); - ELEMENT_NEEDS_1_INPUT(src1); /* Other input either src2 or constant */ - inputs = 1 + (stuff->src2 ? 1 : 0) - + (stuff->alpha ? 1 : 0) - + (stuff->domainPhototag ? 1 : 0); - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, - sizeof(pBlendDefRec)))) - FloAllocError(flo, tag, xieElemBlend, return(NULL)); - - ped->diVec = &pBlendVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloBlend *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src1, raw->src1); - cpswaps(stuff->src2, raw->src2); - cpswaps(stuff->alpha, raw->alpha); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->bandMask = stuff->bandMask; - cpswapl(stuff->constant0, raw->constant0); - cpswapl(stuff->constant1, raw->constant1); - cpswapl(stuff->constant2, raw->constant2); - cpswapl(stuff->alphaConst, raw->alphaConst); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloBlend)); - - /* - * convert constants - */ - pvt = (pBlendDefPtr)ped->elemPvt; - if(!raw->src2) { - pvt->constant[0] = ConvertFromIEEE(raw->constant0); - pvt->constant[1] = ConvertFromIEEE(raw->constant1); - pvt->constant[2] = ConvertFromIEEE(raw->constant2); - index = SRCt1; - } else - index = SRCt2; - - pvt->alphaConst = ConvertFromIEEE(raw->alphaConst); - pvt->aindex = (raw->alpha) ? ++index : 0; - pvt->dindex = (raw->domainPhototag) ? ++index : 0; - - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src1; - if(raw->src2) inFlo[SRCt2].srcTag = raw->src2; - if(raw->alpha) inFlo[pvt->aindex].srcTag = raw->alpha; - if(raw->domainPhototag) inFlo[pvt->dindex].srcTag = raw->domainPhototag; - - return(ped); -} /* end MakeBlend */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepBlend(floDefPtr flo, peDefPtr ped) -{ - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - pBlendDefPtr pvt = (pBlendDefPtr)ped->elemPvt; - inFloPtr ind, ina, in2, in1 = &ped->inFloLst[SRCt1]; - outFloPtr dom, sra, sr2, sr1 = &in1->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int aindex = pvt->aindex, dindex = pvt->dindex, b; - CARD8 bmask = raw->bandMask; - - if (( raw->alpha && pvt->alphaConst <= 0.0) || - (!raw->alpha && (pvt->alphaConst < 0.0 || pvt->alphaConst > 1.0))) - ValueError(flo, ped, raw->alphaConst, return(FALSE)); - - for (b = 0; b < sr1->bands; b++) - if (IsntCanonic(sr1->format[b].class) || - ((bmask & (1<format[b].class == BIT_PIXEL)) - MatchError(flo,ped,return(FALSE)); - - /* check out our second source */ - if(raw->src2) { - in2 = &ped->inFloLst[SRCt2]; - sr2 = &in2->srcDef->outFlo; - if(sr1->bands != sr2->bands) - MatchError(flo,ped, return(FALSE)); - in2->bands = sr2->bands; - for (b = 0; b < sr1->bands; b++) { - if ((bmask & (1<format[b].class != sr2->format[b].class || - (IsConstrained(sr1->format[b].class) && - sr1->format[b].levels != sr2->format[b].levels)) - MatchError(flo,ped, return(FALSE)); - } - } else - sr2 = NULL; - - - /* check out our alpha plane */ - if(aindex) { - ina = &ped->inFloLst[aindex]; - sra = &ina->srcDef->outFlo; - ina->bands = sra->bands; - for (b = 0; b < sra->bands; b++) { - if (IsCanonic(sra->format[b].class)) - ina->format[b] = sra->format[b]; - else - MatchError(flo,ped, return(FALSE)); - } - } - - /* check out our process domain */ - if(dindex) { - ind = &ped->inFloLst[dindex]; - dom = &ind->srcDef->outFlo; - if((ind->bands = dom->bands) != 1 || IsntDomain(dom->format[0].class)) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } - - /* grab a copy of the input attributes and propagate them to our output */ - dst->bands = in1->bands = sr1->bands; - for(b = 0; b < dst->bands; b++) { - dst->format[b] = in1->format[b] = sr1->format[b]; - if(sr2) - in2->format[b] = sr2->format[b]; - } - - return( TRUE ); -} /* end PrepBlend */ - -/* end module pblend.c */ Index: xc/programs/Xserver/XIE/dixie/process/pcfrgb.c diff -u xc/programs/Xserver/XIE/dixie/process/pcfrgb.c:3.6 xc/programs/Xserver/XIE/dixie/process/pcfrgb.c:removed --- xc/programs/Xserver/XIE/dixie/process/pcfrgb.c:3.6 Fri Dec 14 14:58:04 2001 +++ xc/programs/Xserver/XIE/dixie/process/pcfrgb.c Sat Feb 28 21:41:57 2004 @@ -1,400 +0,0 @@ -/* $Xorg: pcfrgb.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pcfrgb.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pcfrgb.c -- DIXIE routines for managing the ConvertFromRGB element - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pcfrgb.c,v 3.6 2001/12/14 19:58:04 dawes Exp $ */ - -#define _XIEC_PCFRGB - -/* - * Include files - */ - - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepPConvertFromRGB(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec pConvertFromRGBVec = { - PrepPConvertFromRGB /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ ------------------- routine: make a ConvertFromRBG element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeConvertFromRGB(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloConvertFromRGB); - ELEMENT_AT_LEAST_SIZE(xieFloConvertFromRGB); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemConvertFromRGB, return(NULL)) ; - - ped->diVec = &pConvertFromRGBVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConvertFromRGB *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswaps(stuff->convert, raw->convert); - cpswaps(stuff->lenParams, raw->lenParams); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConvertFromRGB)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValConvertFromRGB, raw->convert)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValConvertFromRGB,raw->convert,raw->lenParams, - return(ped)); - - /* - * assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - - return(ped); -} /* end MakePConvertFromRGB */ - -/*------------------------------------------------------------------------ ------- routine: copy routine for CIELab and CIEXYZ techniques ----------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecRGBToCIELab *)sParms) -#undef rparms -#define rparms ((xieTecRGBToCIELab *)rParms) - -Bool CopyPConvertFromRGBCIE(TECHNQ_COPY_ARGS) -{ - pTecRGBToCIEDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecRGBToCIEDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertFromRGB, return(TRUE)); - - pvt = (pTecRGBToCIEDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - swap_floats(&pvt->matrix[0], &sparms->matrix00, 9); - cpswaps(sparms->whiteAdjusted, pvt->whiteAdjusted); - cpswaps(sparms->lenParams, pvt->lenWhiteParams); - } else { - copy_floats(&pvt->matrix[0], &sparms->matrix00, 9); - pvt->whiteAdjusted = sparms->whiteAdjusted; - pvt->lenWhiteParams = sparms->lenParams; - } - - if(!(pvt->whiteTec = FindTechnique(xieValWhiteAdjust, pvt->whiteAdjusted)) || - !(TECH_WADJ_FUNC(pvt->whiteTec)(flo, ped, &sparms[1], pvt->whitePoint, - pvt->whiteTec, pvt->lenWhiteParams, - pvt->whiteAdjusted == xieValDefault))) - TechniqueError(flo,ped,xieValWhiteAdjust,pvt->whiteAdjusted, - pvt->lenWhiteParams, return(TRUE)); - - return (TRUE); -} - -/*------------------------------------------------------------------------ ----------- routine: copy routine for YCbCr and YCC techniques ------------ -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecRGBToYCbCr *)sParms) -#undef rparms -#define rparms ((xieTecRGBToYCbCr *)rParms) - -Bool CopyPConvertFromRGBYCbCr(TECHNQ_COPY_ARGS) -{ - pTecRGBToYCbCrDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecRGBToYCbCrDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertFromRGB, return(TRUE)); - - pvt = (pTecRGBToYCbCrDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - cpswapl(sparms->levels0, pvt->levels0); - cpswapl(sparms->levels1, pvt->levels1); - cpswapl(sparms->levels2, pvt->levels2); - swap_floats(&pvt->red, &sparms->lumaRed, 3); - swap_floats(&pvt->bias0, &sparms->bias0, 3); - } else { - pvt->levels0 = sparms->levels0; - pvt->levels1 = sparms->levels1; - pvt->levels2 = sparms->levels2; - copy_floats(&pvt->red, &sparms->lumaRed, 3); - copy_floats(&pvt->bias0, &sparms->bias0, 3); - } - - return (TRUE); -} - -#undef sparms -#define sparms ((xieTecRGBToYCC *)sParms) -#undef rparms -#define rparms ((xieTecRGBToYCC *)rParms) - -Bool CopyPConvertFromRGBYCC(TECHNQ_COPY_ARGS) -{ - pTecRGBToYCCDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecRGBToYCCDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertFromRGB, return(TRUE)); - - pvt = (pTecRGBToYCCDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - cpswapl(sparms->levels0, pvt->levels0); - cpswapl(sparms->levels1, pvt->levels1); - cpswapl(sparms->levels2, pvt->levels2); - swap_floats(&pvt->red, &sparms->lumaRed, 3); - pvt->scale = ConvertFromIEEE(lswapl(sparms->scale)); - } else { - pvt->levels0 = sparms->levels0; - pvt->levels1 = sparms->levels1; - pvt->levels2 = sparms->levels2; - copy_floats(&pvt->red, &sparms->lumaRed, 3); - pvt->scale = ConvertFromIEEE(sparms->scale); - } - - return (TRUE); -} - -#undef sparms -#undef rparms - -/*------------------------------------------------------------------------ --- routine: prep routine for RGB to CIElab and CIEXYZ techniques --------- -------------------------------------------------------------------------*/ - -Bool PrepPConvertFromRGBCIE( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToCIELab *tec) /* same as xieTecRGBToCIEXYZ */ -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pTecRGBToCIEDefPtr pvt = (pTecRGBToCIEDefPtr)ped->techPvt; - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - dst->format[b] = inf->format[b] = src->format[b]; - /* Now, fix up everthing in the destination that will change */ - /* For this element, src may have been CONSTRAINED */ - dst->format[b].class = UNCONSTRAINED; - dst->format[b].depth = sz_RealPixel; - dst->format[b].levels = 0; /* Unconstrained */ - dst->format[b].stride = sz_RealPixel; - dst->format[b].pitch = sz_RealPixel * dst->format[b].width; - } - - return(pvt->whiteTec->prepfnc(flo,ped,pvt->whitePoint)); -} - -/*------------------------------------------------------------------------ --- routine: prep routine for RGB to YCbCr and YCC techniques ------------- -------------------------------------------------------------------------*/ -Bool PrepPConvertFromRGBYCbCr( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToYCbCr *tec) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pTecRGBToYCbCrDefPtr pvt = (pTecRGBToYCbCrDefPtr)ped->techPvt; - CARD32 *levels = &(pvt->levels0); - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - dst->format[b] = inf->format[b] = src->format[b]; - if (IsConstrained(dst->format[b].class)) - dst->format[b].levels = *(levels+b); - } - - if (IsConstrained(dst->format[0].class)) { - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo,ped, return(FALSE)); - } /* else the structure copy was sufficient */ - - return(TRUE); -} - -Bool PrepPConvertFromRGBYCC( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToYCC *tec) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pTecRGBToYCCDefPtr pvt = (pTecRGBToYCCDefPtr)ped->techPvt; - CARD32 *levels = &(pvt->levels0); - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - dst->format[b] = inf->format[b] = src->format[b]; - if (IsConstrained(dst->format[b].class)) - dst->format[b].levels = *(levels+b); - } - - if (IsConstrained(dst->format[0].class)) { - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo,ped, return(FALSE)); - } /* else the structure copy was sufficient */ - - if (pvt->scale < .001) { /* should be about 1.35 or 1.4 */ - ValueError(flo, ped, tec->scale, return(FALSE)); - } - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ - -static Bool PrepPConvertFromRGB(floDefPtr flo, peDefPtr ped) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - xieFloConvertFromRGB *raw = (xieFloConvertFromRGB *)ped->elemRaw; - - /* Input must be triple band and dimensions must match */ - if (IsntCanonic(src->format[0].class) || - src->bands != 3 || - src->format[0].width != src->format[1].width || - src->format[1].width != src->format[2].width || - src->format[0].height != src->format[1].height || - src->format[1].height != src->format[2].height) - MatchError(flo,ped, return(FALSE)); - - /* - ** Technique Prep routine will complete the normal propagation of src - ** attributes, and setup of destination attributes. - */ - - if (!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValConvertFromRGB,raw->convert, - raw->lenParams, return(FALSE)); - - return (TRUE); -} - -/* end module pcfrgb.c */ Index: xc/programs/Xserver/XIE/dixie/process/pcfromi.c diff -u xc/programs/Xserver/XIE/dixie/process/pcfromi.c:3.5 xc/programs/Xserver/XIE/dixie/process/pcfromi.c:removed --- xc/programs/Xserver/XIE/dixie/process/pcfromi.c:3.5 Fri Dec 14 14:58:04 2001 +++ xc/programs/Xserver/XIE/dixie/process/pcfromi.c Sat Feb 28 21:41:57 2004 @@ -1,212 +0,0 @@ -/* $Xorg: pcfromi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pcfromi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pcfromi.c -- DIXIE routines for managing the ConvertFromIndex element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pcfromi.c,v 3.5 2001/12/14 19:58:04 dawes Exp $ */ - -#define _XIEC_PCFROMI -#define _XIEC_PCI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * more X server includes. - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* routines internal to this module - */ -static Bool PrepConvertFromIndex(floDefPtr flo, peDefPtr ped); - -/* dixie entry points - */ -static diElemVecRec pCfromIVec = { - PrepConvertFromIndex - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ConvertFromIndex element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeConvertFromIndex(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloConvertFromIndex); - ELEMENT_AT_LEAST_SIZE(xieFloConvertFromIndex); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped=MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(pCfromIDefRec)))) - FloAllocError(flo,tag,xieElemConvertFromIndex, return(NULL)); - - ped->diVec = &pCfromIVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConvertFromIndex *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->class = stuff->class; - raw->precision = stuff->precision; - cpswapl(stuff->colormap, raw->colormap); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConvertFromIndex)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeConvertFromIndex */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepConvertFromIndex(floDefPtr flo, peDefPtr ped) -{ - xieFloConvertFromIndex *raw = (xieFloConvertFromIndex *)ped->elemRaw; - pCfromIDefPtr pvt = (pCfromIDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCt1]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD32 depth, levels, b; - - /* check client parameters - */ - if((raw->class != xieValSingleBand && - raw->class != xieValTripleBand) || - raw->precision < 1 || raw->precision > 16) - ValueError(flo,ped,raw->precision, return(FALSE)); - - /* grab attributes from colormap, visual, ... - */ - if(!(pvt->cmap = (ColormapPtr) LookupIDByType(raw->colormap, RT_COLORMAP))) - ColormapError(flo,ped,raw->colormap, return(FALSE)); - pvt->precShift = 16 - raw->precision; - pvt->class = pvt->cmap->class; - pvt->visual = pvt->cmap->pVisual; - pvt->pixMsk[0] = pvt->visual->redMask; - pvt->pixMsk[1] = pvt->visual->greenMask; - pvt->pixMsk[2] = pvt->visual->blueMask; - pvt->pixPos[0] = pvt->visual->offsetRed; - pvt->pixPos[1] = pvt->visual->offsetGreen; - pvt->pixPos[2] = pvt->visual->offsetBlue; - pvt->cells = pvt->visual->ColormapEntries; - levels = (pvt->class <= PseudoColor ? pvt->cells : - (pvt->pixMsk[0] | pvt->pixMsk[1] | pvt->pixMsk[2]) + 1); - SetDepthFromLevels(levels,depth); - - if(IsntConstrained(src->format[0].class) - || src->bands > 1 || src->format[0].levels != 1<bands = (raw->class == xieValSingleBand) ? 1 : 3; - inf->bands = src->bands; - for(b = 0; b < dst->bands; b++) { - dst->format[b] = inf->format[0] = src->format[0]; - dst->format[b].band = b; - dst->format[b].levels = (1<precision); - } - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped,return(FALSE)); - - return(TRUE); -} /* end PrepConvertFromIndex */ - -/* end module pcfromi.c */ Index: xc/programs/Xserver/XIE/dixie/process/pcnst.c diff -u xc/programs/Xserver/XIE/dixie/process/pcnst.c:3.6 xc/programs/Xserver/XIE/dixie/process/pcnst.c:removed --- xc/programs/Xserver/XIE/dixie/process/pcnst.c:3.6 Fri Dec 14 14:58:04 2001 +++ xc/programs/Xserver/XIE/dixie/process/pcnst.c Sat Feb 28 21:41:57 2004 @@ -1,311 +0,0 @@ -/* $Xorg: pcnst.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */ -/**** module pcnst.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pcnst..c -- DIXIE routines for managing the Constrain element - - Dean Verheiden -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pcnst.c,v 3.6 2001/12/14 19:58:04 dawes Exp $ */ - -#define _XIEC_PCNST - -/* - * Include files - */ - - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepPConstrain(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec pConstrainVec = { - PrepPConstrain /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ --------------------- routine: make a constrain element ------------------ -------------------------------------------------------------------------*/ -peDefPtr MakeConstrain(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloConstrain); - ELEMENT_AT_LEAST_SIZE(xieFloConstrain); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemConstrain, return(NULL)) ; - - ped->diVec = &pConstrainVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConstrain *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->levels0, raw->levels0); - cpswapl(stuff->levels1, raw->levels1); - cpswapl(stuff->levels2, raw->levels2); - cpswaps(stuff->lenParams, raw->lenParams); - cpswaps(stuff->constrain, raw->constrain); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConstrain)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValConstrain, raw->constrain)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValConstrain,raw->constrain,raw->lenParams, - return(ped)); - - /* - * assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - - return(ped); -} /* end MakePConstrain */ - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for no param techniques ------------- -------------------------------------------------------------------------*/ - -Bool CopyPConstrainStandard(TECHNQ_COPY_ARGS) -{ - return(tsize == 0); -} - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for Clip-Scale technique --------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecClipScale *)sParms) -#undef rparms -#define rparms ((xieTecClipScale *)rParms) - -Bool CopyPConstrainClipScale(TECHNQ_COPY_ARGS) -{ - pCnstDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pCnstDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConstrain, return(TRUE)); - - pvt = (pCnstDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - pvt->input_low[0] = ConvertFromIEEE(lswapl(sparms->inputLow0)); - pvt->input_low[1] = ConvertFromIEEE(lswapl(sparms->inputLow1)); - pvt->input_low[2] = ConvertFromIEEE(lswapl(sparms->inputLow2)); - pvt->input_high[0] = ConvertFromIEEE(lswapl(sparms->inputHigh0)); - pvt->input_high[1] = ConvertFromIEEE(lswapl(sparms->inputHigh1)); - pvt->input_high[2] = ConvertFromIEEE(lswapl(sparms->inputHigh2)); - cpswapl(sparms->outputLow0, pvt->output_low[0]); - cpswapl(sparms->outputLow1, pvt->output_low[1]); - cpswapl(sparms->outputLow2, pvt->output_low[2]); - cpswapl(sparms->outputHigh0, pvt->output_high[0]); - cpswapl(sparms->outputHigh1, pvt->output_high[1]); - cpswapl(sparms->outputHigh2, pvt->output_high[2]); - } else { - pvt->input_low[0] = ConvertFromIEEE(sparms->inputLow0); - pvt->input_low[1] = ConvertFromIEEE(sparms->inputLow1); - pvt->input_low[2] = ConvertFromIEEE(sparms->inputLow2); - pvt->input_high[0] = ConvertFromIEEE(sparms->inputHigh0); - pvt->input_high[1] = ConvertFromIEEE(sparms->inputHigh1); - pvt->input_high[2] = ConvertFromIEEE(sparms->inputHigh2); - pvt->output_low[0] = sparms->outputLow0; - pvt->output_low[1] = sparms->outputLow1; - pvt->output_low[2] = sparms->outputLow2; - pvt->output_high[0] = sparms->outputHigh0; - pvt->output_high[1] = sparms->outputHigh1; - pvt->output_high[2] = sparms->outputHigh2; - } - - return (TRUE); -} -/*------------------------------------------------------------------------ ----------------- routine: prep routine for no param techniques ------------- -------------------------------------------------------------------------*/ -Bool PrepPConstrainStandard( - floDefPtr flo, - peDefPtr ped, - pointer raw, - pointer tec) -{ - return(TRUE); -} -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Clip Scale technique ---------- -------------------------------------------------------------------------*/ -Bool PrepPConstrainClipScale( - floDefPtr flo, - peDefPtr ped, - xieTecClipScale *raw, - xieTecClipScale *tec) -{ - pCnstDefPtr pvt = (pCnstDefPtr)ped->techPvt; - - if (pvt->input_low[0] == pvt->input_high[0] || - pvt->output_low[0] > ped->outFlo.format[0].levels - 1 || - pvt->output_high[0] > ped->outFlo.format[0].levels - 1) - return(FALSE); - if (ped->outFlo.bands > 1) { - if ( pvt->input_low[1] == pvt->input_high[1] || - pvt->output_low[1] > ped->outFlo.format[1].levels - 1 || - pvt->output_high[1] > ped->outFlo.format[1].levels - 1 || - pvt->input_low[2] == pvt->input_high[2] || - pvt->output_low[2] > ped->outFlo.format[2].levels - 1 || - pvt->output_high[2] > ped->outFlo.format[2].levels - 1) - return(FALSE); - } - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ - -static Bool PrepPConstrain( - floDefPtr flo, - peDefPtr ped) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - xieFloConstrain *raw = (xieFloConstrain *)ped->elemRaw; - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - - /* This should be impossible */ - if (IsntCanonic(src->format[b].class)) - ImplementationError(flo, ped, return(FALSE)); - - inf->format[b] = src->format[b]; - - /* Copy outFlo values that are unchanged by constrain */ - dst->format[b].band = b; - dst->format[b].interleaved = src->format[b].interleaved; - dst->format[b].width = src->format[b].width; - dst->format[b].height = src->format[b].height; - } - /* Pull in levels information from the element description */ - if ((dst->format[0].levels = raw->levels0) > MAX_LEVELS(src->bands)) - ValueError(flo,ped,raw->levels0,return(FALSE)); - if (dst->bands > 1) { - if ((dst->format[1].levels = raw->levels1) > MAX_LEVELS(src->bands)) - ValueError(flo,ped,raw->levels1,return(FALSE)); - if ((dst->format[2].levels = raw->levels2) > MAX_LEVELS(src->bands)) - ValueError(flo,ped,raw->levels2,return(FALSE)); - } - /* Set depth, class, stride, and pitch */ - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - /* Take care of any technique parameters */ - if (!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValConstrain,raw->constrain,raw->lenParams, - return(FALSE)); - return (TRUE); -} - -/* end module pcnst.c */ Index: xc/programs/Xserver/XIE/dixie/process/pcomp.c diff -u xc/programs/Xserver/XIE/dixie/process/pcomp.c:3.5 xc/programs/Xserver/XIE/dixie/process/pcomp.c:removed --- xc/programs/Xserver/XIE/dixie/process/pcomp.c:3.5 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pcomp.c Sat Feb 28 21:41:57 2004 @@ -1,277 +0,0 @@ -/* $Xorg: pcomp.c,v 1.6 2001/02/09 02:04:21 xorgcvs Exp $ */ -/**** module pcomp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pcomp.c -- DIXIE routines for managing the compare element - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pcomp.c,v 3.5 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PCOMP - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepCompare(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pCompareVec = { - PrepCompare /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a arithmetic element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeCompare(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - pCompareDefPtr pvt; - ELEMENT(xieFloCompare); - ELEMENT_SIZE_MATCH(xieFloCompare); - ELEMENT_NEEDS_1_INPUT(src1); - inputs = 1 + (stuff->src2 ? 1 : 0) + (stuff->domainPhototag ? 1 :0); - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, - sizeof(pCompareDefRec)))) - FloAllocError(flo, tag, xieElemCompare, return(NULL)); - - ped->diVec = &pCompareVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloCompare *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src1, raw->src1); - cpswaps(stuff->src2, raw->src2); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->operator = stuff->operator; - raw->combine = stuff->combine; - cpswapl(stuff->constant0, raw->constant0); - cpswapl(stuff->constant1, raw->constant1); - cpswapl(stuff->constant2, raw->constant2); - raw->bandMask = stuff->bandMask; - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloCompare)); - - if(!raw->src2) { - /* - * convert constants - */ - pvt = (pCompareDefPtr)ped->elemPvt; - pvt->constant[0] = ConvertFromIEEE(raw->constant0); - pvt->constant[1] = ConvertFromIEEE(raw->constant1); - pvt->constant[2] = ConvertFromIEEE(raw->constant2); - } - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src1; - if(raw->src2) inFlo[SRCt2].srcTag = raw->src2; - if(raw->domainPhototag) inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - - return(ped); -} /* end MakeCompare */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepCompare(floDefPtr flo, peDefPtr ped) -{ - xieFloCompare *raw = (xieFloCompare *)ped->elemRaw; - inFloPtr ind, in2, in1 = &ped->inFloLst[SRCt1]; - outFloPtr dom, sr2, sr1 = &in1->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD8 mask, bandMask = raw->bandMask; - int b; - - /* check out our second source */ - if(raw->src2) { - in2 = &ped->inFloLst[SRCt2]; - sr2 = &in2->srcDef->outFlo; - if(sr1->bands != sr2->bands) - MatchError(flo,ped, return(FALSE)); - for (b = 0, mask = 1; b < sr1->bands; b++, mask <<= 1) { - if (sr1->bands == 3 && raw->combine && (!(mask & bandMask))) - continue; - if (IsntCanonic(sr1->format[b].class) || - sr1->format[b].class != sr2->format[b].class || - (IsConstrained(sr1->format[b].class) && - sr1->format[b].levels != sr2->format[b].levels)) - MatchError(flo,ped, return(FALSE)); - } - in2->bands = sr2->bands; - } else - sr2 = NULL; - - /* check out our process domain */ - if(raw->domainPhototag) { - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if((ind->bands = dom->bands) != 1 || IsntDomain(dom->format[0].class)) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } else - dom = NULL; - - /* grab a copy of the input attributes and propagate them to our inputs */ - in1->bands = sr1->bands; - for(b = 0; b < sr1->bands; b++) { - in1->format[b] = sr1->format[b]; - if(sr2) - in2->format[b] = sr2->format[b]; - } - - /* Determine class of output */ - if (sr1->bands > 1 && !raw->combine) { - if (~(~0<bands) & ~raw->bandMask) /* mask must be for all bands */ - MatchError(flo,ped, return(FALSE)); - dst->bands = sr1->bands; - } else - dst->bands = 1; - - /* In this case, all src bands must have the same dimension */ - if (sr1->bands == 3 && raw->combine && - (((bandMask & 3) == 3 && - (sr1->format[0].width != sr1->format[1].width || - sr1->format[0].height != sr1->format[1].height)) || - ((bandMask & 5) == 5 && - (sr1->format[0].width != sr1->format[2].width || - sr1->format[0].height != sr1->format[2].height)) || - ((bandMask & 6) == 6 && - (sr1->format[1].width != sr1->format[2].width || - sr1->format[1].height != sr1->format[2].height)))) - MatchError(flo,ped, return(FALSE)); - - /* Check the operator */ - if (raw->operator != xieValLT && raw->operator != xieValLE && - raw->operator != xieValEQ && raw->operator != xieValNE && - raw->operator != xieValGT && raw->operator != xieValGE) - OperatorError(flo,ped,raw->operator, return(FALSE)); - - /* - Second check necessary because of protocol . . . must distinguish - between FloMatch errors and FloOperator errors - */ - if (dst->bands > 1 && raw->combine) { - if (raw->operator != xieValEQ && raw->operator != xieValNE) - MatchError(flo,ped, return(FALSE)); - } - - /* Set up destination parameters */ - for(b = 0; b < dst->bands; b++) { - CARD32 bits = sr1->format[b].width; - - dst->format[b].class = BIT_PIXEL; - dst->format[b].band = b; - dst->format[b].interleaved = FALSE; - dst->format[b].depth = 1; - dst->format[b].width = bits; - dst->format[b].height = sr1->format[b].height; - dst->format[b].levels = 2; - dst->format[b].stride = 1; - dst->format[b].pitch = bits + Align(bits,PITCH_MOD); - } - return( TRUE ); -} /* end PrepCompare */ - -/* end module pcomp.c */ Index: xc/programs/Xserver/XIE/dixie/process/pconv.c diff -u xc/programs/Xserver/XIE/dixie/process/pconv.c:3.6 xc/programs/Xserver/XIE/dixie/process/pconv.c:removed --- xc/programs/Xserver/XIE/dixie/process/pconv.c:3.6 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pconv.c Sat Feb 28 21:41:57 2004 @@ -1,301 +0,0 @@ -/* $Xorg: pconv.c,v 1.4 2001/02/09 02:04:21 xorgcvs Exp $ */ -/**** module pconv.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pconv.c -- DIXIE routines for managing the Convolution element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pconv.c,v 3.6 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PCONV - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines internal to this module - */ -static Bool PrepConvolve(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pConvolveVec = { - PrepConvolve /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a convolution element -------------- -------------------------------------------------------------------------*/ -peDefPtr MakeConvolve(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - ConvFloat *pvt; - xieTypFloat *kptr; - int i, numke; - ELEMENT(xieFloConvolve); - ELEMENT_AT_LEAST_SIZE(xieFloConvolve); - ELEMENT_NEEDS_1_INPUT(src); - inputs = 1 + (stuff->domainPhototag ? 1 :0); - - - numke = stuff->kernelSize * stuff->kernelSize; - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, - numke * sizeof(ConvFloat)))) - FloAllocError(flo, tag, xieElemConvolve, return(NULL)); - - ped->diVec = &pConvolveVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConvolve *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->bandMask = stuff->bandMask; - raw->kernelSize = stuff->kernelSize; - cpswaps(stuff->convolve, raw->convolve); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConvolve)); - - /* Copy over and convert the kernel */ - kptr = (xieTypFloat *)&stuff[1]; - pvt = (ConvFloat *)ped->elemPvt; - if (flo->reqClient->swapped) - for (i = 0; i < numke; i++) { - /* can't use *pvt++ = ConvertFromIEEE(lswapl(*kptr++)); */ - /* because lswapl is a macro, and overincrements kptr */ - *pvt++ = ConvertFromIEEE(lswapl(*kptr)); - ++kptr; - } - else - for (i = 0; i < numke; i++) - *pvt++ = ConvertFromIEEE(*kptr++); - /* - * Ensure that the kernel size is odd - */ - if (!(stuff->kernelSize & 1)) - ValueError(flo,ped,(CARD32)raw->kernelSize,return(ped)); - - /* - * copy technique data (if any) - * Note that we must skip past the convolution kernel to get there - */ - if(!(ped->techVec = FindTechnique(xieValConvolve, raw->convolve)) || - !(ped->techVec->copyfnc(flo, ped, (CARD8 *)&stuff[1] + numke * 4, - (CARD8 *)&raw[1] + numke * 4, - raw->lenParams, - raw->convolve == xieValDefault))) - TechniqueError(flo,ped,xieValConvolve,raw->convolve,raw->lenParams, - return(ped)); - - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - if(raw->domainPhototag) inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - - return(ped); -} /* end MakeConv */ - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for Constant technique --------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecConvolveConstant *)sParms) -#undef rparms -#define rparms ((xieTecConvolveConstant *)rParms) - -Bool CopyConvolveConstant(TECHNQ_COPY_ARGS) -{ - pTecConvolveConstantDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if (!(ped->techPvt=(pointer )XieMalloc(sizeof(pTecConvolveConstantDefRec)))) - FloAllocError(flo, ped->phototag, xieElemConvolve, return(TRUE)); - - pvt = (pTecConvolveConstantDefPtr)ped->techPvt; - - if (isDefault || !tsize) { - pvt->constant[0] = pvt->constant[1] = pvt->constant[2] = 0; - } else if( flo->reqClient->swapped ) { - pvt->constant[0] = ConvertFromIEEE(lswapl(sparms->constant0)); - pvt->constant[1] = ConvertFromIEEE(lswapl(sparms->constant1)); - pvt->constant[2] = ConvertFromIEEE(lswapl(sparms->constant2)); - } else { - pvt->constant[0] = ConvertFromIEEE(sparms->constant0); - pvt->constant[1] = ConvertFromIEEE(sparms->constant1); - pvt->constant[2] = ConvertFromIEEE(sparms->constant2); - } - - return (TRUE); -} - -#ifdef BEYOND_SI -/*------------------------------------------------------------------------ ----------------- routine: copy routine for no param techniques ------------- -------------------------------------------------------------------------*/ - -Bool CopyConvolveReplicate(TECHNQ_COPY_ARGS) -{ - return(tsize == 0); -} -#endif /* BEYOND_SI */ - -#undef sparms -#undef rparms - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepConvolve(floDefPtr flo, peDefPtr ped) -{ - xieFloConvolve *raw = (xieFloConvolve *)ped->elemRaw; - inFloPtr ind, in = &ped->inFloLst[SRCtag]; - outFloPtr dom, src = &in->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* check out our process domain */ - if(raw->domainPhototag) { - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if((ind->bands = dom->bands) != 1 || IsntDomain(dom->format[0].class)) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } else - dom = NULL; - - /* grab a copy of the input attributes and propagate them to our output */ - dst->bands = in->bands = src->bands; - - for(b = 0; b < dst->bands; b++) { - if (IsntCanonic(src->format[b].class) || - ((raw->bandMask & (1<format[b].class == BIT_PIXEL)) - MatchError(flo, ped, return(FALSE)); - dst->format[b] = in->format[b] = src->format[b]; - } - - if(!(ped->techVec->prepfnc(flo, ped, raw, &raw[1] + - raw->kernelSize * raw->kernelSize * 4))) - TechniqueError(flo,ped,xieValConvolve,raw->convolve,raw->lenParams, - return(FALSE)); - - return( TRUE ); -} /* end PrepConvolve */ - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for no param techniques ----------- -------------------------------------------------------------------------*/ -Bool PrepConvolveStandard( - floDefPtr flo, - peDefPtr ped, - pointer raw, - pointer tec) -{ - return(TRUE); -} -/* end module pconv.c */ Index: xc/programs/Xserver/XIE/dixie/process/pctoi.c diff -u xc/programs/Xserver/XIE/dixie/process/pctoi.c:3.6 xc/programs/Xserver/XIE/dixie/process/pctoi.c:removed --- xc/programs/Xserver/XIE/dixie/process/pctoi.c:3.6 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pctoi.c Sat Feb 28 21:41:57 2004 @@ -1,420 +0,0 @@ -/* $Xorg: pctoi.c,v 1.4 2001/02/09 02:04:21 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module pctoi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pctoi.c -- DIXIE routines for managing the ConvertToIndex element - - Dean Verheiden && Robert NC Shelley -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pctoi.c,v 3.6 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PCTOI -#define _XIEC_PCI - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * more X server includes. - */ -#include -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - - -/* routines internal to this module - */ -static Bool PrepConvertToIndex(floDefPtr flo, peDefPtr ped); -static Bool DebriefConvertToIndex(floDefPtr flo, peDefPtr ped, Bool ok); - -/* dixie entry points - */ -static diElemVecRec pCtoIVec = { - PrepConvertToIndex, - DebriefConvertToIndex - }; - - -/*------------------------------------------------------------------------ ------------------ routine: make an ExportPhotomap element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeConvertToIndex(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloConvertToIndex); - ELEMENT_AT_LEAST_SIZE(xieFloConvertToIndex); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1,(CARD32)stuff->elemLength<<2,sizeof(pCtoIDefRec)))) - FloAllocError(flo,tag,xieElemConvertToIndex, return(NULL)); - - ped->diVec = &pCtoIVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConvertToIndex *)ped->elemRaw; - /* - * copy the standard client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->notify = stuff->notify; - cpswapl(stuff->colormap, raw->colormap); - cpswapl(stuff->colorList, raw->colorList); - cpswaps(stuff->colorAlloc, raw->colorAlloc); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConvertToIndex)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValColorAlloc,raw->colorAlloc)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, - raw->colorAlloc == xieValDefault))) - TechniqueError(flo,ped,xieValColorAlloc,raw->colorAlloc,raw->lenParams, - return(ped)); - - return(ped); -} /* end MakeConvertToIndex */ - -/*------------------------------------------------------------------------ ------------------------ copy routines for techniques ------------------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecColorAllocAll *)sParms) -#undef rparms -#define rparms ((xieTecColorAllocAll *)rParms) - -Bool CopyCtoIAllocAll(TECHNQ_COPY_ARGS) -{ - pTecCtoIDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if(!(ped->techPvt=(pointer)XieMalloc(sizeof(pTecCtoIDefRec)))) - FloAllocError(flo,ped->phototag,xieElemConvertToIndex, return(TRUE)); - - pvt = (pTecCtoIDefPtr)ped->techPvt; - - pvt->defTech = isDefault; - - if (isDefault) - pvt->fill = 0; /* Not really a good way to pick this so . . . */ - else if( flo->reqClient->swapped ) { - cpswapl(sparms->fill, pvt->fill); - } else - pvt->fill = sparms->fill; - - return(TRUE); -} - -#ifdef BEYOND_SI - -#undef sparms -#define sparms ((xieTecColorAllocMatch *)sParms) -#undef rparms -#define rparms ((xieTecColorAllocMatch *)rParms) - -Bool CopyCtoIAllocMatch(TECHNQ_COPY_ARGS) -{ - pConvertToIndexMatchDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if (!(ped->techPvt=(pointer )XieMalloc(sizeof(pTecConvertToIndexMatchDefRec)))) - AllocError(flo,ped, return(TRUE)); - - pvt = (pConvertToIndexMatchDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - pvt->matchLimit = ConvertFromIEEE(lswapl(sparms->matchLimit)); - pvt->grayLimit = ConvertFromIEEE(lswapl(sparms->grayLimit)); - } else { - pvt->matchLimit = ConvertFromIEEE(sparms->matchLimit); - pvt->grayLimit = ConvertFromIEEE(sparms->grayLimit); - } - return(TRUE); -} - -#undef sparms -#define sparms ((xieTecColorAllocRequantize *)sParms) -#undef rparms -#define rparms ((xieTecColorAllocRequantize *)rParms) - -Bool CopyCtoIAllocRequantize(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if( flo->reqClient->swapped ){ - cpswapl(sparms->maxCells, rparms->maxCells); - } else - rparms->maxCells = sparms->maxCells; - - return(TRUE); -} -#endif /* BEYOND_SI */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepConvertToIndex(floDefPtr flo, peDefPtr ped) -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - pCtoIDefPtr pvt = (pCtoIDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCt1]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - formatPtr sf = &src->format[0]; - formatPtr df = &dst->format[0]; - CARD32 b; - - /* must be constrained and inter-band dimensions must match - */ - if(IsntConstrained(sf[0].class) || - ((src->bands == 3) && (IsntConstrained(sf[1].class) || - IsntConstrained(sf[2].class) || - sf[0].width != sf[1].width || - sf[1].width != sf[2].width || - sf[0].height != sf[1].height || - sf[1].height != sf[2].height))) - MatchError(flo,ped, return(FALSE)); - - /* determine our output attributes from the input (figure out levels later) - */ - df[0] = sf[0]; - dst->bands = 1; - inf->bands = src->bands; - for(b = 0; b < src->bands; ++b) - inf->format[b] = sf[b]; - - /* find the ColorList and Colormap resources - */ - if(raw->colorList) { - if(!(pvt->list = LookupColorList(raw->colorList))) - ColorListError(flo,ped,raw->colorList, return(FALSE)); - if(pvt->list->refCnt != 1) - AccessError(flo,ped, return(FALSE)); - ++pvt->list->refCnt; - } else { - pvt->list = NULL; - } - if(!(pvt->cmap = (ColormapPtr) LookupIDByType(raw->colormap, RT_COLORMAP))) - ColormapError(flo,ped,raw->colormap, return(FALSE)); - - /* grab attributes from colormap, visual, ... - */ - pvt->class = pvt->cmap->class; - pvt->visual = pvt->cmap->pVisual; - pvt->stride = pvt->visual->bitsPerRGBValue; - pvt->cells = pvt->visual->ColormapEntries; - pvt->mask[0] = pvt->visual->redMask; - pvt->mask[1] = pvt->visual->greenMask; - pvt->mask[2] = pvt->visual->blueMask; - pvt->shft[0] = pvt->visual->offsetRed; - pvt->shft[1] = pvt->visual->offsetGreen; - pvt->shft[2] = pvt->visual->offsetBlue; - pvt->dynamic = pvt->cmap->class & DynamicClass; - pvt->graySrc = src->bands == 1; - pvt->preFmt = pvt->doHist = FALSE; - - switch(pvt->class) { - case DirectColor : - case TrueColor : - case StaticColor : - for(b = 0; b < 3; ++b) - pvt->levels[b] = pvt->mask[b] >> pvt->shft[b]; - - /* see if we have a full set of masks (by turning them into levels) - */ - if(pvt->levels[0]++ & pvt->levels[1]++ & pvt->levels[2]++) { - /* see what limitations we have for grayscale images */ - if(pvt->graySrc && !pvt->dynamic && (pvt->levels[0] != pvt->levels[1] || - pvt->levels[1] != pvt->levels[2])) - MatchError(flo,ped, return(FALSE)); - - /* set output levels and depth based on colormap masks - */ - df[0].levels = pvt->levels[0] * pvt->levels[1] * pvt->levels[2]; - SetDepthFromLevels(df[0].levels, pvt->depth); - break; - } /* for StaticColor with no asks, we'll fall thru */ - case PseudoColor : - pvt->levels[1] = pvt->levels[2] = 1; - case GrayScale : - case StaticGray : - /* set output levels and depth based on colormap size - */ - SetDepthFromLevels(pvt->cells, pvt->depth); - df[0].levels = 1<depth; - if((pvt->preFmt = !pvt->graySrc) && pvt->class <= GrayScale) - MatchError(flo,ped, return(FALSE)); - } - /* set output stride and pitch to match the colormap depth - */ - if(!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - /* go do technique-specific stuff - */ - if(!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValColorAlloc,raw->colorAlloc,raw->lenParams, - return(FALSE)); - - /* init the colorlist resource - */ - if(pvt->list) { - ResetColorList(pvt->list, pvt->list->mapPtr); - pvt->list->mapID = raw->colormap; - pvt->list->mapPtr = pvt->cmap; - pvt->list->client = flo->runClient; - } - return(TRUE); -} /* end PrepConvertToIndex */ - -/*------------------------------------------------------------------------ ------------------------- technique prep routines ------------------------ -------------------------------------------------------------------------*/ -Bool PrepCtoIAllocAll( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToIndex *raw, - xieTecColorAllocAll *tec) -{ - pCtoIDefPtr pvt = (pCtoIDefPtr) ped->elemPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - formatPtr fmt = &inf->format[0]; - - if(!(pvt->class & DynamicClass) || !pvt->list) - return(FALSE); /* AllocAll needs a dynamic colormap and a colorlist */ - - /* Check the depth of each band to make sure they're reasonable ... deep - * images have to have sparse histograms to avoid running out of colors - * - * XIE only supports up to 16 bits per band for "non-index" data, - * we will further limit RGB images to a total depth of 31. - */ - if((inf->bands == 1 && fmt[0].depth > 16) || - (inf->bands == 3 && (fmt[0].depth + fmt[1].depth + fmt[2].depth > 31))) - return(FALSE); - - return(TRUE); -} /* end PrepCtoIAllocAll */ - -/*------------------------------------------------------------------------ ----------------------- routine: post execution cleanup ------------------- -------------------------------------------------------------------------*/ -static Bool DebriefConvertToIndex(floDefPtr flo, peDefPtr ped, Bool ok) -{ - pCtoIDefPtr pvt = (pCtoIDefPtr) ped->elemPvt; - colorListPtr lst; - - if(pvt && (lst = pvt->list)) - if(lst->refCnt > 1) { - if(!ok || !lst->cellCnt) - ResetColorList(lst, lst->mapPtr); - --lst->refCnt; - } else if(LookupIDByType(lst->ID, RT_COLORLIST)) { - FreeResourceByType(lst->ID, RT_COLORLIST, RT_NONE); - } else { - DeleteColorList(lst, lst->ID); - } - return(TRUE); -} /* end DebriefConvertToIndex */ - -/* end module pctoi.c */ Index: xc/programs/Xserver/XIE/dixie/process/pctrgb.c diff -u xc/programs/Xserver/XIE/dixie/process/pctrgb.c:3.6 xc/programs/Xserver/XIE/dixie/process/pctrgb.c:removed --- xc/programs/Xserver/XIE/dixie/process/pctrgb.c:3.6 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pctrgb.c Sat Feb 28 21:41:57 2004 @@ -1,527 +0,0 @@ -/* $Xorg: pctrgb.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module pctrgb.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pctrgb.c -- DIXIE routines for managing the ConvertToRGB element - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pctrgb.c,v 3.6 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PCTRGB - -/* - * Include files - */ - - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepPConvertToRGB(floDefPtr flo, peDefPtr ped); - -/* - * dixie element entry points - */ -static diElemVecRec pConvertToRGBVec = { - PrepPConvertToRGB /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ ------------------- routine: make a ConvertToRBG element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeConvertToRGB(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloConvertToRGB); - ELEMENT_AT_LEAST_SIZE(xieFloConvertToRGB); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemConvertToRGB, return(NULL)) ; - - ped->diVec = &pConvertToRGBVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloConvertToRGB *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswaps(stuff->convert, raw->convert); - cpswaps(stuff->lenParams, raw->lenParams); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloConvertToRGB)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValConvertToRGB, raw->convert)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValConvertToRGB,raw->convert,raw->lenParams, - return(ped)); - - /* - * assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakePConvertToRGB */ - -/*------------------------------------------------------------------------ ------- routine: copy routine for CIELab and CIEXYZ techniques ----------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecCIELabToRGB *)sParms) -#undef rparms -#define rparms ((xieTecCIELabToRGB *)rParms) - -Bool CopyPConvertToRGBCIE(TECHNQ_COPY_ARGS) -{ - pTecCIEToRGBDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecCIEToRGBDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertToRGB, return(TRUE)); - - pvt = (pTecCIEToRGBDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - swap_floats(&pvt->matrix[0], &sparms->matrix00, 9); - cpswaps(sparms->whiteAdjusted, pvt->whiteAdjusted); - cpswaps(sparms->lenWhiteParams, pvt->lenWhiteParams); - cpswaps(sparms->gamutCompress, pvt->gamutCompress); - cpswaps(sparms->lenGamutParams, pvt->lenGamutParams); - } else { - copy_floats(&pvt->matrix[0], &sparms->matrix00, 9); - pvt->whiteAdjusted = sparms->whiteAdjusted; - pvt->lenWhiteParams = sparms->lenWhiteParams; - pvt->gamutCompress = sparms->gamutCompress; - pvt->lenGamutParams = sparms->lenGamutParams; - } - - if(!(pvt->whiteTec = FindTechnique(xieValWhiteAdjust, pvt->whiteAdjusted)) || - !(TECH_WADJ_FUNC(pvt->whiteTec)(flo, ped, &sparms[1], pvt->whitePoint, - pvt->whiteTec, pvt->lenWhiteParams, - pvt->whiteAdjusted == xieValDefault))) - TechniqueError(flo,ped,xieValWhiteAdjust, - pvt->whiteAdjusted,pvt->lenWhiteParams, return(TRUE)); - - if(!(pvt->gamutTec = FindTechnique(xieValGamut, pvt->gamutCompress)) || - !(TECH_GAMU_FUNC(pvt->gamutTec)(pvt->lenGamutParams))) - TechniqueError(flo,ped,xieValGamut, - pvt->gamutCompress,pvt->lenGamutParams, return(TRUE)); - - return (TRUE); -} - -/*------------------------------------------------------------------------ ----------- routine: copy routine for YCbCr and YCC techniques ------------ -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecYCbCrToRGB *)sParms) -#undef rparms -#define rparms ((xieTecYCbCrToRGB *)rParms) - -Bool CopyPConvertToRGBYCbCr(TECHNQ_COPY_ARGS) -{ - pTecYCbCrToRGBDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecYCbCrToRGBDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertToRGB, return(TRUE)); - - pvt = (pTecYCbCrToRGBDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - cpswapl(sparms->levels0, pvt->levels0); - cpswapl(sparms->levels1, pvt->levels1); - cpswapl(sparms->levels2, pvt->levels2); - swap_floats(&pvt->red, &sparms->lumaRed, 3); - swap_floats(&pvt->bias0, &sparms->bias0, 3); - cpswaps(sparms->gamutCompress, pvt->gamutCompress); - cpswaps(sparms->lenGamutParams, pvt->lenGamutParams); - } else { - pvt->levels0 = sparms->levels0; - pvt->levels1 = sparms->levels1; - pvt->levels2 = sparms->levels2; - copy_floats(&pvt->red, &sparms->lumaRed, 3); - copy_floats(&pvt->bias0, &sparms->bias0, 3); - pvt->gamutCompress = sparms->gamutCompress; - pvt->lenGamutParams = sparms->lenGamutParams; - } - - if(!(pvt->gamutTec = FindTechnique(xieValGamut, pvt->gamutCompress)) || - !(TECH_GAMU_FUNC(pvt->gamutTec)(pvt->lenGamutParams))) - TechniqueError(flo,ped,xieValGamut, - pvt->gamutCompress,pvt->lenGamutParams, return(TRUE)); - - return (TRUE); -} - -#undef sparms -#define sparms ((xieTecYCCToRGB *)sParms) -#undef rparms -#define rparms ((xieTecYCCToRGB *)rParms) - -Bool CopyPConvertToRGBYCC(TECHNQ_COPY_ARGS) -{ - pTecYCCToRGBDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = (pointer )XieMalloc(sizeof(pTecYCCToRGBDefRec)))) - FloAllocError(flo, ped->phototag,xieElemConvertToRGB, return(TRUE)); - - pvt = (pTecYCCToRGBDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - cpswapl(sparms->levels0, pvt->levels0); - cpswapl(sparms->levels1, pvt->levels1); - cpswapl(sparms->levels2, pvt->levels2); - swap_floats(&pvt->red, &sparms->lumaRed, 3); - pvt->scale = ConvertFromIEEE(lswapl(sparms->scale)); - cpswaps(sparms->gamutCompress, pvt->gamutCompress); - cpswaps(sparms->lenGamutParams, pvt->lenGamutParams); - } else { - pvt->levels0 = sparms->levels0; - pvt->levels1 = sparms->levels1; - pvt->levels2 = sparms->levels2; - copy_floats(&pvt->red, &sparms->lumaRed, 3); - pvt->scale = ConvertFromIEEE(sparms->scale); - pvt->gamutCompress = sparms->gamutCompress; - pvt->lenGamutParams = sparms->lenGamutParams; - } - - if(!(pvt->gamutTec = FindTechnique(xieValGamut, pvt->gamutCompress)) || - !(TECH_GAMU_FUNC(pvt->gamutTec)(pvt->lenGamutParams))) - TechniqueError(flo,ped,xieValGamut, - pvt->gamutCompress,pvt->lenGamutParams, return(TRUE)); - - return (TRUE); -} - -#undef sparms -#undef rparms - -/*------------------------------------------------------------------------ --- routine: copy routine for White Adjust None technique ---------- -------------------------------------------------------------------------*/ -Bool CopyPWhiteAdjustNone( - floDefPtr flo, - peDefPtr ped, - pointer sparms, - double *pvtf, - techVecPtr tv, - CARD16 tsize, - Bool isDefault) -{ - return (tsize == 0); -} - -/*------------------------------------------------------------------------ --- routine: copy routine for White Adjust CIELabShift technique ---------- -------------------------------------------------------------------------*/ -Bool CopyPWhiteAdjustCIELabShift( - floDefPtr flo, - peDefPtr ped, - xieTecWhiteAdjustCIELabShift *sparms, - double *pvtf, - techVecPtr tv, - CARD16 tsize, - Bool isDefault) -{ - VALIDATE_TECHNIQUE_SIZE(tv, tsize, isDefault); - - if( flo->reqClient->swapped ) { - swap_floats(pvtf, &sparms->whitePoint0, 3); - } else { - copy_floats(pvtf, &sparms->whitePoint0, 3); - } - - return (TRUE); -} - -/*------------------------------------------------------------------------ ------------ routine: copy routine for Gamut techniques ------------------- -------------------------------------------------------------------------*/ -Bool CopyPGamut(CARD16 tsize) -{ - return (tsize == 0); -} - -/*------------------------------------------------------------------------ --- routine: prep routine for RGB to CIElab and CIEXYZ techniques --------- -------------------------------------------------------------------------*/ -Bool PrepPConvertToRGBCIE( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecCIELabToRGB *tec) /* same as xieTecCIEXYZToRGB */ -{ - pTecCIEToRGBDefPtr pvt = (pTecCIEToRGBDefPtr)ped->techPvt; - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - if (IsConstrained(src->format[0].class)) - return FALSE; /* must be floats */ - /* Since we know its floats, structure copy sufficient */ - dst->format[b] = inf->format[b] = src->format[b]; - } - - return(pvt->whiteTec->prepfnc(flo,ped,pvt->whitePoint)); -} - -/*------------------------------------------------------------------------ --- routine: prep routine for RGB to YCbCr and YCC techniques ------------- -------------------------------------------------------------------------*/ -Bool PrepPConvertToRGBYCbCr( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecYCbCrToRGB *tec) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pTecYCbCrToRGBDefPtr pvt = (pTecYCbCrToRGBDefPtr)ped->techPvt; - CARD32 *levels = &(pvt->levels0); - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - dst->format[b] = inf->format[b] = src->format[b]; - if (IsConstrained(dst->format[b].class)) - dst->format[b].levels = *(levels+b); - } - - /* Set depth, class, stride, and pitch */ - if (IsConstrained(dst->format[0].class)) { - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo,ped, return(FALSE)); - } /* else the structure copy was sufficient */ - - return(TRUE); -} - -Bool PrepPConvertToRGBYCC( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecYCCToRGB *tec) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pTecYCCToRGBDefPtr pvt = (pTecYCCToRGBDefPtr)ped->techPvt; - CARD32 *levels = &(pvt->levels0); - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - dst->format[b] = inf->format[b] = src->format[b]; - if (IsConstrained(dst->format[b].class)) - dst->format[b].levels = *(levels+b); - } - - /* Set depth, class, stride, and pitch */ - if (IsConstrained(dst->format[0].class)) { - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo,ped, return(FALSE)); - } /* else the structure copy was sufficient */ - - if (pvt->scale < .001) { /* should be about 1.35 or 1.4 */ - ValueError(flo, ped, tec->scale, return(FALSE)); - } - - return(TRUE); -} - -/*------------------------------------------------------------------------ ------- routine: prep routine for White Adjust none technique ------------- -------------------------------------------------------------------------*/ -Bool PrepPWhiteAdjustNone( - floDefPtr flo, - peDefPtr ped, - double *pwp) -{ - return(TRUE); -} - -/*------------------------------------------------------------------------ --- routine: prep routine for White Adjust CIELabShift technique ---------- -------------------------------------------------------------------------*/ -Bool PrepPWhiteAdjustCIELabShift( - floDefPtr flo, - peDefPtr ped, - double *pwp) -{ - return(TRUE); -} - -/*------------------------------------------------------------------------ ------------- routine: prep routine for gamut techniques ------------------ -------------------------------------------------------------------------*/ -Bool PrepPGamut(void) -{ - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ - -static Bool PrepPConvertToRGB(floDefPtr flo, peDefPtr ped) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - xieFloConvertToRGB *raw = (xieFloConvertToRGB *)ped->elemRaw; - - /* Input must be triple band and dimensions must match */ - if (IsntCanonic(src->format[0].class) || - src->bands != 3 || - src->format[0].width != src->format[1].width || - src->format[1].width != src->format[2].width || - src->format[0].height != src->format[1].height || - src->format[1].height != src->format[2].height) - MatchError(flo,ped, return(FALSE)); - - - /* - ** Technique Prep routine will complete the normal propagation of src - ** attributes, and setup of destination attributes. - */ - - if (!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValConvertToRGB, - raw->convert,raw->lenParams, return(FALSE)); - - - return (TRUE); -} - -/*------------------------------------------------------------------------ ----------------------- utility routines for parameters ------------------- -------------------------------------------------------------------------*/ - -void -swap_floats( - double *doubles_out, - xieTypFloat *funny_floats_in, - int cnt) -{ - int m; - for (m = 0; m < cnt; m++) - doubles_out[m] = ConvertFromIEEE(lswapl(funny_floats_in[m])); -} - -void -copy_floats( - double *doubles_out, - xieTypFloat *funny_floats_in, - int cnt) -{ - int m; - for (m = 0; m < cnt; m++) - doubles_out[m] = ConvertFromIEEE(funny_floats_in[m]); -} - -/* end module pctrgb.c */ Index: xc/programs/Xserver/XIE/dixie/process/pdither.c diff -u xc/programs/Xserver/XIE/dixie/process/pdither.c:3.5 xc/programs/Xserver/XIE/dixie/process/pdither.c:removed --- xc/programs/Xserver/XIE/dixie/process/pdither.c:3.5 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pdither.c Sat Feb 28 21:41:57 2004 @@ -1,276 +0,0 @@ -/* $Xorg: pdither.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module pdither.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pdither.c -- DIXIE routines for managing the Dither element - - Larry Hare -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pdither.c,v 3.5 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PDITHER - -/* - * Include files - */ - - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepPDither(floDefPtr flo, peDefPtr ped); -static Bool PrepPDitherStandard(floDefPtr flo, peDefPtr ped, pointer raw, pointer tec); - -/* - * dixie element entry points - */ -static diElemVecRec pDitherVec = { - PrepPDither /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ --------------------- routine: make a dither element ------------------ -------------------------------------------------------------------------*/ -peDefPtr MakeDither(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - ELEMENT(xieFloDither); - ELEMENT_AT_LEAST_SIZE(xieFloDither); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemDither, return(NULL)) ; - - ped->diVec = &pDitherVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloDither *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->bandMask = stuff->bandMask; - cpswapl(stuff->levels0, raw->levels0); - cpswapl(stuff->levels1, raw->levels1); - cpswapl(stuff->levels2, raw->levels2); - cpswaps(stuff->lenParams, raw->lenParams); - cpswaps(stuff->dither, raw->dither); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloDither)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValDither, raw->dither)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, - raw->dither == xieValDefault))) - TechniqueError(flo,ped,xieValDither,raw->dither,raw->lenParams, - return(ped)); - - /* - * assign phototag to inFlo - */ - ped->inFloLst[SRCtag].srcTag = raw->src; - - - return(ped); -} /* end MakePDither */ - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for no Error Diffusion technique -- -------------------------------------------------------------------------*/ - -Bool CopyPDitherErrorDiffusion(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - return(tsize == 0); -} - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for Ordered techniques --------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecDitherOrdered *)sParms) -#undef rparms -#define rparms ((xieTecDitherOrdered *)rParms) - -Bool CopyPDitherOrdered(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if (tsize) - rparms->thresholdOrder = sparms->thresholdOrder; - else - rparms->thresholdOrder = 4; - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for no param techniques ------------- -------------------------------------------------------------------------*/ -static -Bool PrepPDitherStandard( - floDefPtr flo, - peDefPtr ped, - pointer raw, - pointer tec) -{ - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Error Diffusion techniques ---- -------------------------------------------------------------------------*/ -Bool PrepPDitherErrorDiffusion( - floDefPtr flo, - peDefPtr ped, - xieFloDither *raw, - pointer tec) -{ - return PrepPDitherStandard(flo, ped, (pointer) raw, tec); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Ordered technique ------------- -------------------------------------------------------------------------*/ -Bool PrepPDitherOrdered( - floDefPtr flo, - peDefPtr ped, - xieFloDither *raw, - xieTecDitherOrdered *tec) -{ - return PrepPDitherStandard(flo, ped, (pointer) raw, (pointer) tec); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ - -static Bool PrepPDither(floDefPtr flo, peDefPtr ped) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - xieFloDither *raw = (xieFloDither *)ped->elemRaw; - CARD32 *levels = &(raw->levels0); - int b; - - /* grab a copy of the src attributes and propagate them to our input */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < src->bands; b++) { - - dst->format[b] = inf->format[b] = src->format[b]; - - if ((raw->bandMask & (1<format[b].class) && - src->format[b].class == BIT_PIXEL) - MatchError(flo, ped, return(FALSE)); - - if ((dst->format[b].levels = *(levels+b)) > src->format[b].levels) - ValueError(flo,ped,*(levels+b),return(FALSE)); - } - - /* Set depth, class, stride, and pitch */ - if (UpdateFormatfromLevels(ped) == FALSE) - MatchError(flo,ped, return(FALSE)); - - /* Take care of any technique parameters */ - if (!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) - TechniqueError(flo,ped,xieValDither,raw->dither,raw->lenParams, - return(FALSE)); - - return (TRUE); -} - -/* end module pdither.c */ Index: xc/programs/Xserver/XIE/dixie/process/pgeom.c diff -u xc/programs/Xserver/XIE/dixie/process/pgeom.c:3.6 xc/programs/Xserver/XIE/dixie/process/pgeom.c:removed --- xc/programs/Xserver/XIE/dixie/process/pgeom.c:3.6 Fri Dec 14 14:58:05 2001 +++ xc/programs/Xserver/XIE/dixie/process/pgeom.c Sat Feb 28 21:41:57 2004 @@ -1,383 +0,0 @@ -/* $Xorg: pgeom.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module pgeom.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pgeom.c -- DIXIE routines for managing the Geometry element - - Ben Fahy -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pgeom.c,v 3.6 2001/12/14 19:58:05 dawes Exp $ */ - -#define _XIEC_PGEOM - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepGeometry( - floDefPtr flo, - peDefPtr ped); -static Bool CopyGeomNoParams(TECHNQ_COPY_ARGS); - -/* - * dixie entry points - */ -static diElemVecRec pGeometryVec = { - PrepGeometry /* prepare for analysis and execution */ - }; - -/*------------------------------------------------------------------------ ------------------------ routine: make a convolution element -------------- -------------------------------------------------------------------------*/ -peDefPtr MakeGeometry(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - pGeomDefPtr pvt; - xieTypFloat *kptr; - int i; - ELEMENT(xieFloGeometry); - ELEMENT_AT_LEAST_SIZE(xieFloGeometry); - ELEMENT_NEEDS_1_INPUT(src); - inputs = 1; - - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, - sizeof(pGeomDefRec)))) - FloAllocError(flo, tag, xieElemGeometry, return(NULL)); - - ped->diVec = &pGeometryVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloGeometry *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - raw->bandMask = stuff->bandMask; - cpswapl(stuff->width, raw->width); - cpswapl(stuff->height, raw->height); - cpswaps(stuff->sample, raw->sample); - cpswaps(stuff->lenParams, raw->lenParams); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloGeometry)); - - /* Copy over and convert the floating point stuff */ - kptr = (xieTypFloat *)&stuff->a; - pvt = (pGeomDefPtr)ped->elemPvt; - - if (flo->reqClient->swapped) { - for (i = 0; i < 6; ++kptr, ++i) - pvt->coeffs[i] = ConvertFromIEEE(lswapl(*kptr)); - for (i = 0; i < xieValMaxBands; ++kptr, ++i) - pvt->constant[i] = ConvertFromIEEE(lswapl(*kptr)); - } else { - for (i = 0; i < 6; i++) - pvt->coeffs[i] = ConvertFromIEEE(*kptr++); - for (i = 0; i < xieValMaxBands; i++) - pvt->constant[i] = ConvertFromIEEE(*kptr++); - } - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValGeometry, raw->sample)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, - raw->sample == xieValDefault))) - TechniqueError(flo,ped,xieValGeometry,raw->sample,raw->lenParams, - return(ped)); - - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeGeometry */ - -/*------------------------------------------------------------------------ ------------ routine: copy routine for NearestNeighbor technique --------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecGeomNearestNeighbor *)sParms) -#undef rparms -#define rparms ((xieTecGeomNearestNeighbor *)rParms) - -Bool CopyGeomNearestNeighbor(TECHNQ_COPY_ARGS) -{ - pTecGeomNearestNeighborDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if (!(ped->techPvt = XieMalloc(sizeof(pTecGeomNearestNeighborDefRec)))) - FloAllocError(flo, ped->phototag, xieElemGeometry, return(TRUE)); - - pvt = (pTecGeomNearestNeighborDefPtr)ped->techPvt; - - /* - * Nearest Neighbor can be called with no parameters - */ - if (isDefault) - pvt->modify = xieValFavorUp; - else - pvt->modify = sparms->modify; - - return (TRUE); -} - -#if XIE_FULL -/*------------------------------------------------------------------------ ------- routine: copy routine for bilinear interpolation technique -------- -------------------------------------------------------------------------*/ -Bool CopyGeomBilinearInterp(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - return( CopyGeomNoParams(flo, ped, sparms, rparms, tsize, isDefault) ); -} -/*------------------------------------------------------------------------ ------- routine: copy routine for gaussian interpolation technique -------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecGeomGaussian *)sParms) -#undef rparms -#define rparms ((xieTecGeomGaussian *)rParms) - -Bool CopyGeomGaussian(TECHNQ_COPY_ARGS) -{ - pTecGeomGaussianDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - if (!(ped->techPvt=XieMalloc(sizeof(pTecGeomGaussianDefRec)))) - FloAllocError(flo, ped->phototag, xieElemGeometry, return(TRUE)); - - pvt = (pTecGeomGaussianDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - pvt->sigma = ConvertFromIEEE(lswapl(sparms->sigma)); - pvt->normalize = ConvertFromIEEE(lswapl(sparms->normalize)); - } else { - pvt->sigma = ConvertFromIEEE(sparms->sigma); - pvt->normalize = ConvertFromIEEE(sparms->normalize); - } - pvt->radius = sparms->radius; - pvt->simple = sparms->simple; - - if (pvt->radius < 1) - return(FALSE); - - if (pvt->sigma == 0.0) - return(FALSE); /* musn't divide by zero, deary */ - - if (pvt->normalize <= 0.0) - return(FALSE); /* don't want to bother clipping pixels < 0 */ - - return (TRUE); -} -#endif - -/*------------------------------------------------------------------------ ------- routine: copy routine for antialias technique -------- -------------------------------------------------------------------------*/ - -Bool CopyGeomAntiAlias(TECHNQ_COPY_ARGS) -{ - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, isDefault); - - return( CopyGeomNoParams(flo, ped, sparms, rparms, tsize, isDefault) ); -} - -/*------------------------------------------------------------------------ ------------- routine: copy routine for techniques with no params -------- -------------------------------------------------------------------------*/ - -#undef sparms -#undef rparms - -static Bool CopyGeomNoParams(TECHNQ_COPY_ARGS) -{ - return(tsize == 0); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepGeometry(floDefPtr flo, peDefPtr ped) -{ - xieFloGeometry *raw = (xieFloGeometry *)ped->elemRaw; - inFloPtr in = &ped->inFloLst[SRCtag]; - outFloPtr src = &in->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - pGeomDefPtr pvt = (pGeomDefPtr)ped->elemPvt; - CARD32 b, bits; - - /* grab a copy of the input attributes and propagate them to our output */ - dst->bands = in->bands = src->bands; - - for(b = 0; b < dst->bands; b++) { - if (IsntCanonic(src->format[b].class)) - MatchError(flo, ped, return(FALSE)); - - dst->format[b] = in->format[b] = src->format[b]; - pvt->do_band[b] = (dst->bands==1)? 1 : raw->bandMask & (1<do_band[b]) { - dst->format[b].width = raw->width; - dst->format[b].height = raw->height; - } - bits = dst->format[b].width * dst->format[b].stride; - dst->format[b].pitch = bits + Align(bits,PITCH_MOD); - } - - if(!(ped->techVec->prepfnc(flo, ped, raw, &raw[1]))) { - TechniqueError(flo,ped,xieValGeometry,raw->sample,raw->lenParams, - return(FALSE)); - } - - return( TRUE ); -} /* end PrepGeometry */ - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for nearest neighbor -------------- -------------------------------------------------------------------------*/ -Bool PrepGeomNearestNeighbor( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec) -{ - return(TRUE); -} - -#if XIE_FULL -/*------------------------------------------------------------------------ ----------- routine: prep routine for bilinear interpolation -------------- -------------------------------------------------------------------------*/ -Bool PrepGeomBilinearInterp( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec) -{ - return(TRUE); -} -/*------------------------------------------------------------------------ ----------- routine: prep routine for gaussian ---------------------------- -------------------------------------------------------------------------*/ -Bool PrepGeomGaussian( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec) -{ - return(TRUE); -} -#endif - -/*------------------------------------------------------------------------ ----------- routine: prep routine for antialias --------------------------- -------------------------------------------------------------------------*/ -Bool PrepGeomAntiAlias( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec) -{ - return(TRUE); -} - -/* end module pgeom.c */ Index: xc/programs/Xserver/XIE/dixie/process/phist.c diff -u xc/programs/Xserver/XIE/dixie/process/phist.c:3.6 xc/programs/Xserver/XIE/dixie/process/phist.c:removed --- xc/programs/Xserver/XIE/dixie/process/phist.c:3.6 Fri Dec 14 14:58:06 2001 +++ xc/programs/Xserver/XIE/dixie/process/phist.c Sat Feb 28 21:41:57 2004 @@ -1,310 +0,0 @@ -/* $Xorg: phist.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module phist.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - phist.c -- DIXIE routines for managing the MatchHistogram element - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/phist.c,v 3.6 2001/12/14 19:58:06 dawes Exp $ */ - -#define _XIEC_PHIST - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines internal to this module - */ -static Bool PrepMatchHistogram(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pMatchHistogramVec = -{ - PrepMatchHistogram /* prepare for analysis and execution */ -}; - - -/*------------------------------------------------------------------------ ------------------ routine: make a match histogram element ---------------- -------------------------------------------------------------------------*/ -peDefPtr MakeMatchHistogram(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloMatchHistogram); - ELEMENT_AT_LEAST_SIZE(xieFloMatchHistogram); - ELEMENT_NEEDS_1_INPUT(src); - - inputs = 1 + (stuff->domainPhototag ? 1 : 0); - - if (!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo, tag, xieElemMatchHistogram, return(NULL)); - - ped->diVec = &pMatchHistogramVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloMatchHistogram *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - cpswaps(stuff->shape,raw->shape); - cpswaps(stuff->lenParams,raw->lenParams); - } else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloMatchHistogram)); - /* - * copy technique data (if any) - */ - if(!(ped->techVec = FindTechnique(xieValHistogram, raw->shape)) || - !(ped->techVec->copyfnc(flo, ped, &stuff[1], &raw[1], raw->lenParams, 0))) - TechniqueError(flo,ped,xieValHistogram,raw->shape,raw->lenParams, - return(ped)); - - - /* assign phototags to inFlos */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - if(raw->domainPhototag) - inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - return ped; -} /* end MakeMatchHistogram */ - -/*------------------------------------------------------------------------ -------------------- routine: copy routine for Flat technique ------------ -------------------------------------------------------------------------*/ - -Bool CopyPHistogramFlat(TECHNQ_COPY_ARGS) -{ - return (tsize == 0); -} - -/*------------------------------------------------------------------------ ----------------- routine: copy routine for Gaussian technique ----------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecHistogramGaussian *)sParms) -#undef rparms -#define rparms ((xieTecHistogramGaussian *)rParms) - -Bool CopyPHistogramGaussian(TECHNQ_COPY_ARGS) -{ - pTecHistogramGaussianDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = - (pointer )XieMalloc(sizeof(pTecHistogramGaussianDefRec)))) - FloAllocError(flo, ped->phototag, xieElemMatchHistogram, return(TRUE)); - - pvt = (pTecHistogramGaussianDefPtr)ped->techPvt; - - if( flo->reqClient->swapped ) { - pvt->mean = ConvertFromIEEE(lswapl(sparms->mean)); - pvt->sigma = ConvertFromIEEE(lswapl(sparms->sigma)); - } else { - pvt->mean = ConvertFromIEEE(sparms->mean); - pvt->sigma = ConvertFromIEEE(sparms->sigma); - } - - return (TRUE); -} - -/*------------------------------------------------------------------------ --------------- routine: copy routine for Hyperbolic technique ----------- -------------------------------------------------------------------------*/ - -#undef sparms -#define sparms ((xieTecHistogramHyperbolic *)sParms) -#undef rparms -#define rparms ((xieTecHistogramHyperbolic *)rParms) - -Bool CopyPHistogramHyperbolic(TECHNQ_COPY_ARGS) -{ - pTecHistogramHyperbolicDefPtr pvt; - - VALIDATE_TECHNIQUE_SIZE(ped->techVec, tsize, FALSE); - - if (!(ped->techPvt = - (pointer )XieMalloc(sizeof(pTecHistogramHyperbolicDefRec)))) - FloAllocError(flo, ped->phototag, xieElemMatchHistogram, return(TRUE)); - - pvt = (pTecHistogramHyperbolicDefPtr)ped->techPvt; - - pvt->shapeFactor = sparms->shapeFactor; - if( flo->reqClient->swapped ) { - pvt->constant = ConvertFromIEEE(lswapl(sparms->constant)); - } else { - pvt->constant = ConvertFromIEEE(sparms->constant); - } - - return (TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Gaussian technique ------------ -------------------------------------------------------------------------*/ -Bool PrepPHistogramFlat(floDefPtr flo, peDefPtr ped) -{ - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Gaussian technique ------------ -------------------------------------------------------------------------*/ -Bool PrepPHistogramGaussian(floDefPtr flo, peDefPtr ped) -{ - if (((pTecHistogramGaussianDefPtr)ped->techPvt)->sigma <= 0) - return(FALSE); - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prep routine for Hyperbolic technique ---------- -------------------------------------------------------------------------*/ -Bool PrepPHistogramHyperbolic(floDefPtr flo, peDefPtr ped) -{ - double constant = ((pTecHistogramHyperbolicDefPtr)ped->techPvt)->constant; - - if (constant >= -1 && constant <= 0) - return(FALSE); - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepMatchHistogram(floDefPtr flo, peDefPtr ped) -{ - xieFloMatchHistogram *raw = (xieFloMatchHistogram *)ped->elemRaw; - inFloPtr ind, in = &ped->inFloLst[SRCtag]; - outFloPtr src = &in->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - - /* make sure source parameters are legal for MatchHistogram */ - if (IsntConstrained(src->format[0].class) || - src->format[0].class == BIT_PIXEL || - src->bands != 1) - MatchError(flo,ped, return(FALSE)); - - /* check out our process domain */ - if(raw->domainPhototag) { - outFloPtr dom; - - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if((ind->bands = dom->bands) != 1 || IsntDomain(dom->format[0].class)) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } - - /* grab a copy of the input attributes and propagate them to output */ - dst->bands = in->bands = src->bands; - dst->format[0] = in->format[0] = src->format[0]; - - /* Take care of any technique parameters */ - if (!(ped->techVec->prepfnc(flo, ped))) - TechniqueError(flo,ped,xieValHistogram,raw->shape,raw->lenParams, - return(FALSE)); - - return (TRUE); -} /* end PrepMatchHistogram */ - -/* end module phist.c */ Index: xc/programs/Xserver/XIE/dixie/process/plogic.c diff -u xc/programs/Xserver/XIE/dixie/process/plogic.c:3.5 xc/programs/Xserver/XIE/dixie/process/plogic.c:removed --- xc/programs/Xserver/XIE/dixie/process/plogic.c:3.5 Fri Dec 14 14:58:06 2001 +++ xc/programs/Xserver/XIE/dixie/process/plogic.c Sat Feb 28 21:41:57 2004 @@ -1,254 +0,0 @@ -/* $Xorg: plogic.c,v 1.6 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module plogic.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - plogic.c -- DIXIE routines for managing the Logical element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/plogic.c,v 3.5 2001/12/14 19:58:06 dawes Exp $ */ - -#define _XIEC_PLOGIC - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepLogic(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pLogicVec = -{ - PrepLogic /* prepare for analysis and execution */ -}; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a logical element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeLogic(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - pLogicDefPtr pvt; - ELEMENT(xieFloLogical); - ELEMENT_SIZE_MATCH(xieFloLogical); - ELEMENT_NEEDS_1_INPUT(src1); - - inputs = 1 + (stuff->src2 ? 1 : 0) + (stuff->domainPhototag ? 1 :0); - - if (!(ped = - MakePEDef(inputs, (CARD32)stuff->elemLength<<2, sizeof(pLogicDefRec)))) - FloAllocError(flo, tag, xieElemLogical, return(NULL)); - - ped->diVec = &pLogicVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloLogical *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src1, raw->src1); - cpswaps(stuff->src2, raw->src2); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->operator = stuff->operator; - raw->bandMask = stuff->bandMask; - cpswapl(stuff->constant0, raw->constant0); - cpswapl(stuff->constant1, raw->constant1); - cpswapl(stuff->constant2, raw->constant2); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloLogical)); - - if(!raw->src2) { - /* convert constants */ - pvt = (pLogicDefPtr)ped->elemPvt; - pvt->constant[0] = ConvertFromIEEE(raw->constant0); - pvt->constant[1] = ConvertFromIEEE(raw->constant1); - pvt->constant[2] = ConvertFromIEEE(raw->constant2); - } - /* assign phototags to inFlos */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src1; - if (raw->src2) - inFlo[SRCt2].srcTag = raw->src2; - if(raw->domainPhototag) - inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - - return ped; -} /* end MakeLogic */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepLogic(floDefPtr flo, peDefPtr ped) -{ - xieFloLogical *raw = (xieFloLogical *)ped->elemRaw; - inFloPtr ind, in2, in1 = &ped->inFloLst[SRCt1]; - outFloPtr dom, sr2, sr1 = &in1->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - CARD8 bmask = raw->bandMask; - int b; - - if (IsntConstrained(sr1->format[0].class)) - MatchError(flo,ped, return(FALSE)); - - /* Make sure levels are a power of 2 */ - for (b = 0; b < sr1->bands; b++) - if ((bmask & (1<format[b].levels & (sr1->format[b].levels - 1))) - MatchError(flo,ped, return(FALSE)); - - /* check out our second source */ - if(raw->src2) { - in2 = &ped->inFloLst[SRCt2]; - sr2 = &in2->srcDef->outFlo; - if(sr1->bands != sr2->bands) - MatchError(flo,ped, return(FALSE)); - in2->bands = sr2->bands; - for (b = 0; b < sr1->bands; b++) { - if ((bmask & (1<format[b].class != sr2->format[b].class || - sr1->format[b].levels != sr2->format[b].levels) - MatchError(flo,ped, return(FALSE)); - } - } else - sr2 = NULL; - - /* check out our process domain */ - if(raw->domainPhototag) { - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if(IsntDomain(dom->format[0].class) || - (ind->bands = dom->bands) != 1) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } else - dom = NULL; - - /* check out our operator */ - switch(raw->operator) { - case GXclear: /* 0x0 0 */ - case GXand: /* 0x1 src-1 AND src-2 */ - case GXandReverse: /* 0x2 src-1 AND (NOT src-2) */ - case GXcopy: /* 0x3 src-1 */ - case GXandInverted: /* 0x4 (NOT src-1) AND src-2 */ - case GXnoop: /* 0x5 src-2 */ - case GXxor: /* 0x6 src-1 XOR src-2 */ - case GXor: /* 0x7 src-1 OR src-2 */ - case GXnor: /* 0x8 (NOT src-1) AND (NOT src-2) */ - case GXequiv: /* 0x9 (NOT src-1) XOR src-2 */ - case GXinvert: /* 0xa NOT src-2 */ - case GXorInverted: /* 0xd (NOT src-1) OR src-2 */ - case GXorReverse: /* 0xb src-1 OR (NOT src-2) */ - case GXnand: /* 0xe (NOT src-1) OR (NOT src-2) */ - case GXset: /* 0xf 1 */ - case GXcopyInverted: /* 0xc NOT src-1 */ - break; - default: OperatorError(flo,ped,raw->operator, return(FALSE)); - } - - /* grab a copy of the input attributes and propagate them to output */ - dst->bands = in1->bands = sr1->bands; - for(b = 0; b < dst->bands; b++) { - dst->format[b] = in1->format[b] = sr1->format[b]; - if(sr2) - in2->format[b] = sr2->format[b]; - } - return TRUE; -} /* end PrepLogic */ - -/* end module plogic.c */ Index: xc/programs/Xserver/XIE/dixie/process/pmath.c diff -u xc/programs/Xserver/XIE/dixie/process/pmath.c:3.5 xc/programs/Xserver/XIE/dixie/process/pmath.c:removed --- xc/programs/Xserver/XIE/dixie/process/pmath.c:3.5 Fri Dec 14 14:58:06 2001 +++ xc/programs/Xserver/XIE/dixie/process/pmath.c Sat Feb 28 21:41:57 2004 @@ -1,205 +0,0 @@ -/* $Xorg: pmath.c,v 1.6 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module pmath.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - pmath.c -- DIXIE routines for managing the Math element - - Dean Verheiden -- AGE Logic, Inc. July 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/pmath.c,v 3.5 2001/12/14 19:58:06 dawes Exp $ */ - -#define _XIEC_PMATH - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepMath(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pMathVec = -{ - PrepMath /* prepare for analysis and execution */ -}; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a math element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakeMath(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloMath); - ELEMENT_SIZE_MATCH(xieFloMath); - ELEMENT_NEEDS_1_INPUT(src); - - inputs = 1 + (stuff->domainPhototag ? 1 :0); - - if (!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo, tag, xieElemMath, return(NULL)); - - ped->diVec = &pMathVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloMath *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if (flo->reqClient->swapped) - { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->operator = stuff->operator; - raw->bandMask = stuff->bandMask; - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloMath)); - - /* assign phototags to inFlos */ - inFlo = ped->inFloLst; - inFlo[SRCt1].srcTag = raw->src; - if(raw->domainPhototag) - inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; - return ped; -} /* end MakeMath */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepMath(floDefPtr flo, peDefPtr ped) -{ - xieFloMath *raw = (xieFloMath *)ped->elemRaw; - inFloPtr ind, in = &ped->inFloLst[SRCt1]; - outFloPtr src = &in->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* make sure input is not bitonal */ - for (b = 0; b < src->bands; b++) - if (IsntCanonic(src->format[b].class) || - ((raw->bandMask & (1<format[b].class == BIT_PIXEL)) - MatchError(flo,ped, return(FALSE)); - - - /* check out our process domain */ - if(raw->domainPhototag) { - outFloPtr dom; - - ind = &ped->inFloLst[ped->inCnt-1]; - dom = &ind->srcDef->outFlo; - if(IsntDomain(dom->format[0].class) || - (ind->bands = dom->bands) != 1) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - ind->format[0] = dom->format[0]; - } - - /* grab a copy of the input attributes and propagate them to output */ - dst->bands = in->bands = src->bands; - for(b = 0; b < dst->bands; b++) - dst->format[b] = in->format[b] = src->format[b]; - - switch(raw->operator) { - case xieValExp: break; - case xieValLn: break; - case xieValLog2: break; - case xieValLog10: break; - case xieValSquare: break; - case xieValSqrt: break; - default: OperatorError(flo,ped,raw->operator,return(FALSE)); - } - return (TRUE); -} /* end PrepMath */ - -/* end module pmath.c */ Index: xc/programs/Xserver/XIE/dixie/process/ppaste.c diff -u xc/programs/Xserver/XIE/dixie/process/ppaste.c:3.5 xc/programs/Xserver/XIE/dixie/process/ppaste.c:removed --- xc/programs/Xserver/XIE/dixie/process/ppaste.c:3.5 Fri Dec 14 14:58:07 2001 +++ xc/programs/Xserver/XIE/dixie/process/ppaste.c Sat Feb 28 21:41:57 2004 @@ -1,243 +0,0 @@ -/* $Xorg: ppaste.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module ppaste.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ppaste.c -- DIXIE routines for managing the PasteUp element - - Dean Verheiden -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/ppaste.c,v 3.5 2001/12/14 19:58:07 dawes Exp $ */ - -#define _XIEC_PPASTE - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepPasteUp(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pPasteUpVec = { - PrepPasteUp /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a arithmetic element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakePasteUp(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int t; - CARD16 inputs; - peDefPtr ped; - inFloPtr inFlo; - pPasteUpDefPtr pvt; - xieTypTile *rp; - ELEMENT(xieFloPasteUp); - ELEMENT_AT_LEAST_SIZE(xieFloPasteUp); - ELEMENT_NEEDS_1_INPUT(numTiles); - - if ( flo->reqClient->swapped ) { - cpswaps(stuff->numTiles, inputs); - } else - inputs = stuff->numTiles; - - if(!(ped = MakePEDef((CARD32)inputs, (CARD32)stuff->elemLength<<2, - sizeof(pPasteUpDefRec)))) - FloAllocError(flo, tag, xieElemPasteUp, return(NULL)); - - ped->diVec = &pPasteUpVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloPasteUp *)ped->elemRaw; - rp = (xieTypTile *) &(raw[1]); - /* - * copy the client element parameters (swap if necessary) - */ - - if( flo->reqClient->swapped ) { - xieTypTile *sp = (xieTypTile *) &(stuff[1]); - - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - /* We already did this one */ - raw->numTiles = inputs; - cpswapl(stuff->width, raw->width); - cpswapl(stuff->height, raw->height); - cpswapl(stuff->constant0, raw->constant0); - cpswapl(stuff->constant1, raw->constant1); - cpswapl(stuff->constant2, raw->constant2); - for (t = 0; t < inputs; t++) { - cpswaps(sp[t].src, rp[t].src); - cpswapl(sp[t].dstX, rp[t].dstX); - cpswapl(sp[t].dstY, rp[t].dstY); - } - } - else - memcpy((char *)raw, (char *)stuff, (CARD32)stuff->elemLength<<2); - - /* - * convert constants - */ - pvt = (pPasteUpDefPtr)ped->elemPvt; - pvt->constant[0] = ConvertFromIEEE(raw->constant0); - pvt->constant[1] = ConvertFromIEEE(raw->constant1); - pvt->constant[2] = ConvertFromIEEE(raw->constant2); - - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - - for (t = 0; t < inputs; t++) - inFlo[t].srcTag = rp[t].src; - - return(ped); -} /* end MakePasteUp */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepPasteUp(floDefPtr flo, peDefPtr ped) -{ - xieFloPasteUp *raw = (xieFloPasteUp *)ped->elemRaw; - inFloPtr in = &ped->inFloLst[0]; - outFloPtr src = &in->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b, t; - - /* Grab a copy of the input attributes and propagate them to our output. - * Use the first input as a template, all attributes must match except for - * width (and pitch) and height. - */ - - dst->bands = in->bands = src->bands; - - if (raw->numTiles <= 0) - SourceError(flo,ped, return(FALSE)); - - for(b = 0; b < dst->bands; b++) { - CARD32 bits; - if (IsntCanonic(src->format[b].class)) - MatchError(flo,ped,return(FALSE)); - dst->format[b] = in->format[b] = src->format[b]; - dst->format[b].width = bits = raw->width; - dst->format[b].height = raw->height; - bits *= dst->format[b].stride; - dst->format[b].pitch = bits + Align(bits,PITCH_MOD); - } - - /* Compare the remaining tiles to ensure all attibutes that must match do */ - for (t = 1; t < raw->numTiles; t++) { - in = &ped->inFloLst[t]; - src = &in->srcDef->outFlo; - - if (src->bands != dst->bands) { - MatchError(flo,ped,return(FALSE)); - } else - in->bands = src->bands; - - for(b = 0; b < dst->bands; b++) { - formatRec *df = &(dst->format[b]); - formatRec *srf = &(src->format[b]); - if ( srf->class != df->class || - srf->depth != df->depth || - srf->levels != df->levels || - srf->stride != df->stride) { - MatchError(flo,ped,return(FALSE)); - } - in->format[b] = src->format[b]; - } - } - - return( TRUE ); -} /* end PrepPasteUp */ - -/* end module ppaste.c */ Index: xc/programs/Xserver/XIE/dixie/process/ppoint.c diff -u xc/programs/Xserver/XIE/dixie/process/ppoint.c:3.5 xc/programs/Xserver/XIE/dixie/process/ppoint.c:removed --- xc/programs/Xserver/XIE/dixie/process/ppoint.c:3.5 Fri Dec 14 14:58:07 2001 +++ xc/programs/Xserver/XIE/dixie/process/ppoint.c Sat Feb 28 21:41:57 2004 @@ -1,300 +0,0 @@ -/* $Xorg: ppoint.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module ppoint.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - ppoint.c -- DIXIE routines for managing the Point element - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - Ben Fahy -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/ppoint.c,v 3.5 2001/12/14 19:58:07 dawes Exp $ */ - -#define _XIEC_PPOINT -#define _XIEC_POINT - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include -#include - -extern peDefPtr MakePoint(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* - * routines internal to this module - */ -static Bool PrepPoint(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pPointVec = { - PrepPoint /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make a point element -------------------- -------------------------------------------------------------------------*/ -peDefPtr MakePoint(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - int inputs; - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloPoint); - ELEMENT_SIZE_MATCH(xieFloPoint); - ELEMENT_NEEDS_2_INPUTS(src,lut); - inputs = stuff->domainPhototag ? 3 : 2; - - if(!(ped = MakePEDef(inputs, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo,tag,xieElemPoint, return(NULL)) ; - - ped->diVec = &pPointVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloPoint *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - cpswaps(stuff->lut, raw->lut); - cpswapl(stuff->domainOffsetX, raw->domainOffsetX); - cpswapl(stuff->domainOffsetY, raw->domainOffsetY); - cpswaps(stuff->domainPhototag,raw->domainPhototag); - raw->bandMask = stuff->bandMask; - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloPoint)); - /* - * assign phototags to inFlos - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - inFlo[LUTtag].srcTag = raw->lut; - if(raw->domainPhototag) -#if XIE_FULL - inFlo[ped->inCnt-1].srcTag = raw->domainPhototag; -#else - DomainError(flo,ped,raw->domainPhototag, return(ped)); -#endif - - return(ped); -} /* end MakePoint */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepPoint(floDefPtr flo, peDefPtr ped) -{ - xieFloPoint *raw = (xieFloPoint *)ped->elemRaw; - - inFloPtr indom,inlut= &ped->inFloLst[LUTtag],insrc = &ped->inFloLst[SRCtag]; - outFloPtr outdom, outlut= &inlut->srcDef->outFlo, - outsrc= &insrc->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* propage band attributes */ - insrc->bands = outsrc->bands; - inlut->bands = outlut->bands; - - dst->bands = outlut->bands; /* see V4.12 spec, page 6-2 */ - - /* if process domain src and lut class must match */ - if (raw->domainPhototag && insrc->bands != inlut->bands) - MatchError(flo,ped, return(FALSE)); - - /* check to make sure input image is constrained, and lut is a lut */ - if(IsntConstrained(outsrc->format[0].class) || - IsntLut(outlut->format[0].class) ) - MatchError(flo,ped, return(FALSE)); - - /* propagate outflo format of src to our inflo for src */ - for (b=0; bbands; ++b) - insrc->format[b] = outsrc->format[b]; - - /* propagate outflo format of lut to our inflo for lut */ - for (b=0; bbands; ++b) - inlut->format[b] = outlut->format[b]; - - /* do same with process domain, if it is specified */ - if(raw->domainPhototag) { - indom = &ped->inFloLst[ped->inCnt-1]; - outdom = &indom->srcDef->outFlo; - if(IsntDomain(outdom->format[0].class) || - (indom->bands = outdom->bands) != 1) - DomainError(flo,ped,raw->domainPhototag, return(FALSE)); - indom->format[0] = outdom->format[0]; - } else - outdom = NULL; - -/*** Painful enumeration of cases ***/ - - if (outlut->bands == 1 && outsrc->bands == 3) { - int level_product; - - /* Width and heights of all bands must match */ - if (insrc->format[0].width != insrc->format[1].width || - insrc->format[1].width != insrc->format[2].width || - insrc->format[0].height != insrc->format[1].height || - insrc->format[1].height != insrc->format[2].height) - MatchError(flo,ped, return(FALSE)); - - /* make tripleband src into CRAZY PIXELS! produce singleband */ - if ((raw->bandMask !=7) || (outdom != NULL)) - MatchError(flo,ped, return(FALSE)); /* see p7-25 of v4.12 spec */ - - /* check to make sure length of lut is sufficient */ - level_product = insrc->format[0].levels * - insrc->format[1].levels * - insrc->format[2].levels; - - if (inlut->format[0].height < level_product) - MatchError(flo,ped, return(FALSE)); - - dst->format[0] = insrc->format[0]; - dst->format[0].levels = inlut->format[0].levels; - if (!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - } - - else if (outlut->bands == 3 && outsrc->bands == 1) { - /* apply lut for each band to src */ - - /* this variation does not support Domains. */ - if (outdom != NULL) - MatchError(flo,ped, return(FALSE)); - - /* destination format will be close to insrc, but not same */ - for(b = 0; b < dst->bands; b++) { - dst->format[b] = insrc->format[0]; - dst->format[b].band = b; - if ((raw->bandMask & (1<format[b].levels = inlut->format[b].levels; - if (inlut->format[b].height < insrc->format[0].levels) - MatchError(flo,ped, return(FALSE)); - } - if (!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - } - - else if (outlut->bands == outsrc->bands && - (outlut->bands == 3 || outlut->bands == 1) ) { - - /* apply lut for each band to src of each band */ - - for(b = 0; b < dst->bands; b++) { - - dst->format[b] = insrc->format[b]; - if ((raw->bandMask & (1<format[b].levels = inlut->format[b].levels; - - /* check to make sure length of lut is sufficient */ - if (inlut->format[b].height < insrc->format[b].levels) - MatchError(flo,ped, return(FALSE)); - - /* if domain is used, lut levels must be == src levels */ - /* (or else we don't know what to do with pass-thru data */ - if (outdom != NULL) - if (inlut->format[b].levels != insrc->format[b].levels) - MatchError(flo,ped, return(FALSE)); - } - if (!UpdateFormatfromLevels(ped)) - MatchError(flo,ped, return(FALSE)); - - } - else { - /* is this possible? */ - ImplementationError(flo,ped,return(FALSE)); - } - - return(TRUE); -} /* end PrepPoint */ - -/* end module ppoint.c */ Index: xc/programs/Xserver/XIE/dixie/process/puncnst.c diff -u xc/programs/Xserver/XIE/dixie/process/puncnst.c:3.5 xc/programs/Xserver/XIE/dixie/process/puncnst.c:removed --- xc/programs/Xserver/XIE/dixie/process/puncnst.c:3.5 Fri Dec 14 14:58:07 2001 +++ xc/programs/Xserver/XIE/dixie/process/puncnst.c Sat Feb 28 21:41:57 2004 @@ -1,178 +0,0 @@ -/* $Xorg: puncnst.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module puncnst.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - puncnst.c -- DIXIE routines for managing the Unconstrain element - - Dean Verheiden -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/process/puncnst.c,v 3.5 2001/12/14 19:58:07 dawes Exp $ */ - -#define _XIEC_PUNCNST - -/* - * Include files - */ - /* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include - /* - * XIE Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include - -/* - * routines internal to this module - */ -static Bool PrepUnconstrain(floDefPtr flo, peDefPtr ped); - -/* - * dixie entry points - */ -static diElemVecRec pUnconstrainVec = { - PrepUnconstrain /* prepare for analysis and execution */ - }; - - -/*------------------------------------------------------------------------ ------------------------ routine: make an unconstrain element ------------- -------------------------------------------------------------------------*/ -peDefPtr MakeUnconstrain(floDefPtr flo, xieTypPhototag tag, xieFlo *pe) -{ - peDefPtr ped; - inFloPtr inFlo; - ELEMENT(xieFloUnconstrain); - ELEMENT_SIZE_MATCH(xieFloUnconstrain); - ELEMENT_NEEDS_1_INPUT(src); - - if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0))) - FloAllocError(flo, tag, xieElemUnconstrain, return(NULL)); - - ped->diVec = &pUnconstrainVec; - ped->phototag = tag; - ped->flags.process = TRUE; - raw = (xieFloUnconstrain *)ped->elemRaw; - /* - * copy the client element parameters (swap if necessary) - */ - if( flo->reqClient->swapped ) { - raw->elemType = stuff->elemType; - raw->elemLength = stuff->elemLength; - cpswaps(stuff->src, raw->src); - } - else - memcpy((char *)raw, (char *)stuff, sizeof(xieFloUnconstrain)); - /* - * assign phototags to the inFlo - */ - inFlo = ped->inFloLst; - inFlo[SRCtag].srcTag = raw->src; - - return(ped); -} /* end MakeUnconstrain */ - - -/*------------------------------------------------------------------------ ----------------- routine: prepare for analysis and execution ------------- -------------------------------------------------------------------------*/ -static Bool PrepUnconstrain(floDefPtr flo, peDefPtr ped) -{ - inFloPtr inf = &ped->inFloLst[SRCtag]; - outFloPtr src = &inf->srcDef->outFlo; - outFloPtr dst = &ped->outFlo; - int b; - - /* grab a copy of the input attributes and propagate them to our output */ - dst->bands = inf->bands = src->bands; - for(b = 0; b < dst->bands; b++) { - /* All band formats should be the same but check anyway */ - if (IsntCanonic(src->format[b].class)) - MatchError(flo, ped, return(FALSE)); - - /* First, copy everything over */ - dst->format[b] = inf->format[b] = src->format[b]; - - /* Now, fix up everthing in the destination that will change */ - dst->format[b].class = UNCONSTRAINED; - dst->format[b].depth = sz_RealPixel; - dst->format[b].levels = 0; /* Unconstrained */ - dst->format[b].stride = sz_RealPixel; - dst->format[b].pitch = sz_RealPixel * dst->format[b].width; - } - return( TRUE ); -} /* end PrepUnconstrain */ - -/* end module puncnst.c */ Index: xc/programs/Xserver/XIE/dixie/request/Imakefile diff -u xc/programs/Xserver/XIE/dixie/request/Imakefile:3.8 xc/programs/Xserver/XIE/dixie/request/Imakefile:removed --- xc/programs/Xserver/XIE/dixie/request/Imakefile:3.8 Wed Jan 17 17:12:54 2001 +++ xc/programs/Xserver/XIE/dixie/request/Imakefile Sat Feb 28 21:41:57 2004 @@ -1,43 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:29 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/dixie/request/Imakefile,v 3.8 2001/01/17 22:12:54 dawes Exp $ - -XCOMM build device independent request objects - -#define IHaveModules -#include - -SRCS1 = difloat.c error.c event.c flo.c lut.c memory.c \ - photomap.c protoflo.c session.c tables.c technq.c -OBJS1 = difloat.o error.o event.o flo.o lut.o memory.o \ - photomap.o protoflo.o session.o tables.o technq.o - -#if BuildDIS -DIS_DEFINES = -DXIE_DIS -#else -SRCS2 = colorlst.c roi.c -OBJS2 = colorlst.o roi.o -#endif - -DEFINES = $(DIS_DEFINES) $(MODULE_DEFINES) - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) - - LINTLIBS = ../export/llib-lexp.ln ../import/llib-limp.ln \ - ../process/llib-lproc.ln ../request/llib-lreq.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(req,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/dixie/request/colorlst.c diff -u xc/programs/Xserver/XIE/dixie/request/colorlst.c:3.5 xc/programs/Xserver/XIE/dixie/request/colorlst.c:removed --- xc/programs/Xserver/XIE/dixie/request/colorlst.c:3.5 Fri Dec 14 14:58:09 2001 +++ xc/programs/Xserver/XIE/dixie/request/colorlst.c Sat Feb 28 21:41:57 2004 @@ -1,346 +0,0 @@ -/* $Xorg: colorlst.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module colorlst.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - colorlst.c -- DIXIE ColorList management - - Robert NC Shelley -- AGE Logic, Inc. March, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/colorlst.c,v 3.5 2001/12/14 19:58:09 dawes Exp $ */ - -#define _XIEC_COLORLST - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -/* - * Module Specific Includes - */ -#include -#include -#include -#include -#include - -/* - * routines referenced by other modules. - */ -int DeleteColorList(); -colorListPtr LookupColorList(); -void ResetColorList(); - - -/*------------------------------------------------------------------------ ------------------------- CreateColorList Procedures ---------------------- -------------------------------------------------------------------------*/ -int ProcCreateColorList(ClientPtr client) -{ - colorListPtr clst; - REQUEST(xieCreateColorListReq); - REQUEST_SIZE_MATCH(xieCreateColorListReq); - LEGAL_NEW_RESOURCE(stuff->colorList, client); - - /* - * create a new ColorList - */ - if( !(clst = (colorListPtr) XieMalloc(sizeof(colorListRec))) ) - return(client->errorValue = stuff->colorList, BadAlloc); - - clst->ID = stuff->colorList; - clst->refCnt = 1; - clst->cellPtr = NULL; - - ResetColorList(clst, NULL); - - return( AddResource(clst->ID, RT_COLORLIST, (colorListPtr)clst) - ? Success : (client->errorValue = stuff->colorList, BadAlloc) ); -} /* end ProcCreateColorList */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyColorList Procedures --------------------- -------------------------------------------------------------------------*/ -int ProcDestroyColorList(ClientPtr client) -{ - colorListPtr clst; - REQUEST( xieDestroyColorListReq ); - REQUEST_SIZE_MATCH( xieDestroyColorListReq ); - - if( !(clst = LookupColorList(stuff->colorList)) ) - return( SendResourceError(client, xieErrNoColorList, stuff->colorList) ); - - /* - * Disassociate the ColorList from core X -- it calls DeleteColorList() - */ - FreeResourceByType(stuff->colorList, RT_COLORLIST, RT_NONE); - - return(Success); -} /* end ProcDestroyColorList */ - - -/*------------------------------------------------------------------------ --------------------------- PurgeColorList Procedures --------------------- -------------------------------------------------------------------------*/ -int ProcPurgeColorList(ClientPtr client) -{ - colorListPtr clst; - REQUEST( xiePurgeColorListReq ); - REQUEST_SIZE_MATCH( xiePurgeColorListReq ); - - if( !(clst = LookupColorList(stuff->colorList)) ) - return( SendResourceError(client, xieErrNoColorList, stuff->colorList) ); - - /* - * Free the current list of colors - */ - ResetColorList(clst, clst->mapPtr); - - return(Success); -} /* end ProcPurgeColorList */ - - -/*------------------------------------------------------------------------ ------------------------- QueryColorList Procedures ----------------------- -------------------------------------------------------------------------*/ -int ProcQueryColorList(ClientPtr client) -{ - xieQueryColorListReply rep; - colorListPtr clst; - REQUEST( xieQueryColorListReq ); - REQUEST_SIZE_MATCH( xieQueryColorListReq ); - - if( !(clst = LookupColorList(stuff->colorList)) ) - return( SendResourceError(client, xieErrNoColorList, stuff->colorList) ); - - /* - * Fill in the reply header - */ - bzero((char *)&rep, sz_xieQueryColorListReply); - rep.type = X_Reply; - rep.sequenceNum = client->sequence; - rep.colormap = clst->mapID; - rep.length = clst->cellCnt; - - if( client->swapped ) { - /* - * Swap the reply header fields - */ - register int n; - swaps(&rep.sequenceNum,n); - swapl(&rep.colormap,n); - swapl(&rep.length,n); - } - WriteToClient(client, sz_xieQueryColorListReply, (char *)&rep); - - if( clst->cellCnt ) - /* - * Send the list of colors (swapped as necessary) - * Note: cellPtr is type Pixel, which unfortunately is type unsigned long - * and that means more work needed here if longs are 64-bits... - * (anyone care to donate an Alpha?) - */ - if( client->swapped ) - CopySwap32Write(client, clst->cellCnt << 2, clst->cellPtr); - else - WriteToClient(client, clst->cellCnt << 2, (char *)clst->cellPtr); - - return(Success); -} /* end ProcQueryColorList */ - - -/*------------------------------------------------------------------------ ------------------------ deleteFunc: DeleteColorList ---------------------- -------------------------------------------------------------------------*/ -int DeleteColorList(colorListPtr clst, xieTypColorList id) -{ - if( --clst->refCnt ) - return(Success); - - /* free any colors we're holding - */ - ResetColorList(clst, !clst->mapID ? NULL - : (ColormapPtr) LookupIDByType(clst->mapID, RT_COLORMAP)); - - /* free the ColorList structure. - */ - XieFree(clst); - - return(Success); -} /* end DeleteColorList */ - - -/*------------------------------------------------------------------------ ------------------------- routine: LookupColorList ------------------------ -------------------------------------------------------------------------*/ -colorListPtr LookupColorList(xieTypColorList id) -{ - colorListPtr clst; - ColormapPtr cmap; - - clst = (colorListPtr) LookupIDByType(id, RT_COLORLIST); - - if( clst && clst->mapID ) { - /* - * Lookup the associated Colormap. - */ - cmap = (ColormapPtr) LookupIDByType(clst->mapID, RT_COLORMAP); - - if( cmap != clst->mapPtr ) - /* - * Forget about this Colormap and the list of colors - */ - ResetColorList(clst, cmap); - } - - return(clst); -} /* end LookupColorList */ - - -/*------------------------------------------------------------------------ --------------------------- routine: ResetColorList ----------------------- -------------------------------------------------------------------------*/ -void ResetColorList(colorListPtr clst, ColormapPtr cmap) -{ - if( clst->cellPtr ) { - if(cmap && !clst->client->clientGone) { - /* - * free our colors from the colormap - */ - FreeColors(cmap, clst->client->index, clst->cellCnt, clst->cellPtr, 0); - } - XieFree(clst->cellPtr); - } - - /* reset the ColorList to its create-time state - */ - clst->mapID = 0; - clst->mapPtr = NULL; - clst->cellCnt = 0; - clst->cellPtr = NULL; - clst->client = NULL; -} /* end ResetColorList */ - - -int SProcCreateColorList(ClientPtr client) -{ - register int n; - REQUEST(xieCreateColorListReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieCreateColorListReq); - swapl(&stuff->colorList, n); - return (ProcCreateColorList(client)); -} /* end SProcCreateColorList */ - -int SProcDestroyColorList(ClientPtr client) -{ - register int n; - REQUEST( xieDestroyColorListReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieDestroyColorListReq ); - swapl(&stuff->colorList, n); - return (ProcDestroyColorList(client)); -} /* end SProcDestroyColorList */ - -int SProcPurgeColorList(ClientPtr client) -{ - register int n; - REQUEST( xiePurgeColorListReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xiePurgeColorListReq ); - swapl(&stuff->colorList, n); - return (ProcPurgeColorList(client)); -} /* end SProcPurgeColorList */ - -int SProcQueryColorList(ClientPtr client) -{ - register int n; - REQUEST( xieQueryColorListReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieQueryColorListReq ); - swapl(&stuff->colorList, n); - return (ProcQueryColorList(client)); -} /* end SProcQueryColorList */ - -/* end module colorlst.c */ Index: xc/programs/Xserver/XIE/dixie/request/difloat.c diff -u xc/programs/Xserver/XIE/dixie/request/difloat.c:1.8 xc/programs/Xserver/XIE/dixie/request/difloat.c:removed --- xc/programs/Xserver/XIE/dixie/request/difloat.c:1.8 Fri Dec 14 14:58:09 2001 +++ xc/programs/Xserver/XIE/dixie/request/difloat.c Sat Feb 28 21:41:57 2004 @@ -1,109 +0,0 @@ -/* $Xorg: difloat.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module difloat.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - difloat.c - float converters - - Ben Fahy -- AGE Logic, Inc. December 1992 - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/difloat.c,v 1.8 2001/12/14 19:58:09 dawes Exp $ */ - -#ifndef XIE_IEEE_IS_NATIVE -#define _XIEC_DIFLOAT - -/* - * Include files - */ - /* - * Core X Includes - */ -#include - /* - * Server XIE Includes - */ -#include -#include -#include "macro.h" - -double ConvertIEEEtoNative(CARD32 ieee) -{ - double sign; - double exponent; - double fraction; - - if(!(ieee & 0x7fffffff)) return(0.0); - - sign = (ieee & ieeeFloatSignMask) == ieeeFloatSignMask ? -1.0 : 1.0; - exponent = (int)((ieee & ieeeFloatExpMask) >> ieeeFloatExpShift) - 127; - fraction = (double)(ieee & ieeeFloatMantissaMask) / (1 << ieeeMantissaSize); - - return(sign * pow(2.0,exponent) * (1.0 + fraction)); -} /* end ConvertIEEEtoNative */ -#endif /* !XIE_IEEE_IS_NATIVE */ - -/* end module difloat.c */ Index: xc/programs/Xserver/XIE/dixie/request/error.c diff -u xc/programs/Xserver/XIE/dixie/request/error.c:3.5 xc/programs/Xserver/XIE/dixie/request/error.c:removed --- xc/programs/Xserver/XIE/dixie/request/error.c:3.5 Fri Dec 14 14:58:09 2001 +++ xc/programs/Xserver/XIE/dixie/request/error.c Sat Feb 28 21:41:57 2004 @@ -1,303 +0,0 @@ -/* $Xorg: error.c,v 1.6 2001/02/09 02:04:22 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module error.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/error.c,v 3.5 2001/12/14 19:58:09 dawes Exp $ */ - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include - -#include -#include -#include - -/* - * routines referenced by other modules. - */ - - -/*------------------------------------------------------------------------ --------------------------- Send Resource Error --------------------------- -------------------------------------------------------------------------*/ -int -SendResourceError(ClientPtr client, CARD8 code, XID id) -{ - xieResourceErr err; - REQUEST(xieReq); - - if(client->clientGone) return(Success); - - bzero((char *)&err, sz_xieResourceErr); - err.error = X_Error; - err.code = code + extEntry->errorBase; - err.sequenceNum = client->sequence; - err.resourceID = id; - err.minorOpcode = stuff->opcode; - err.majorOpcode = stuff->reqType; - - if( client->swapped ) { - register int n; - swaps(&err.sequenceNum,n); - swapl(&err.resourceID,n); - swaps(&err.minorOpcode,n); - } - WriteToClient(client, sz_xieResourceErr, (char *)&err); - isItTimeToYield = TRUE; - - return(Success); -} /* end SendResourceError */ - -/*------------------------------------------------------------------------ ------------------------------ Send FloID Error --------------------------- -------------------------------------------------------------------------*/ -int -SendFloIDError(ClientPtr client, XID spaceID, XID floID) -{ - xieFloIDErr err; - REQUEST(xieReq); - - if(client->clientGone) return(Success); - - bzero((char *)&err, sz_xieFloErr); - err.error = X_Error; - err.code = xieErrNoFlo + extEntry->errorBase; - err.sequenceNum = client->sequence; - err.floID = floID; - err.floErrorCode = xieErrNoFloID; - err.minorOpcode = stuff->opcode; - err.majorOpcode = stuff->reqType; - err.nameSpace = spaceID; - - if( client->swapped ) { - register int n; - swaps(&err.sequenceNum, n); - swapl(&err.nameSpace, n); - swapl(&err.floID, n); - swaps(&err.minorOpcode,n); - } - WriteToClient(client, sz_xieFloErr, (char *)&err); - isItTimeToYield = TRUE; - - return(Success); -} /* end SendFloIDError */ - -/*------------------------------------------------------------------------ ------------------------------ Send Flo Error ----------------------------- -------------------------------------------------------------------------*/ -int -SendFloError(ClientPtr client, floDefPtr flo) -{ - int status = Success; - register int n; - xieFloErr err; - REQUEST(xieReq); - - if(client->clientGone) return(Success); - /* - * Take care of the common part - */ - err = flo->error; - err.error = X_Error; - err.code = xieErrNoFlo + extEntry->errorBase; - err.sequenceNum = client->sequence; - err.floID = flo->ID; - err.minorOpcode = stuff->opcode; - err.majorOpcode = stuff->reqType; - err.nameSpace = flo->spaceID; - - if( client->swapped ) { - swaps(&err.sequenceNum, n); - swapl(&err.nameSpace, n); - swapl(&err.floID, n); - swaps(&err.phototag, n); - swaps(&err.type, n); - swaps(&err.minorOpcode,n); - } - /* take care of the unique parts - */ - switch( ferrCode(flo) ) { - case xieErrNoFloAccess: - case xieErrNoFloAlloc: - case xieErrNoFloElement: - case xieErrNoFloImplementation: - case xieErrNoFloLength: - case xieErrNoFloMatch: - case xieErrNoFloOperator: - case xieErrNoFloSource: - break; - case xieErrNoFloColormap: - case xieErrNoFloColorList: - case xieErrNoFloDrawable: - case xieErrNoFloGC: - case xieErrNoFloLUT: - case xieErrNoFloPhotomap: - case xieErrNoFloROI: - if( client->swapped ) { - swapl(&((xieFloResourceErr *)(&err))->resourceID, n); - } - break; - case xieErrNoFloDomain: - if( client->swapped ) { - swaps(&((xieFloDomainErr *)(&err))->domainSrc, n); - } - break; - case xieErrNoFloTechnique: - if( client->swapped ) { - swaps(&((xieFloTechniqueErr *)(&err))->techniqueNumber, n); - swaps(&((xieFloTechniqueErr *)(&err))->lenTechParams, n); - } - break; - case xieErrNoFloValue: - if( client->swapped ) { - swapl(&((xieFloValueErr *)(&err))->badValue, n); - } - break; - default: - status = BadImplementation; - break; - } - - if( status == Success ) { - WriteToClient(client, sz_xieFloErr, (char *)&err); - isItTimeToYield = TRUE; - } - return(status); -} /* end SendFloError */ - - -/*------------------------------------------------------------------------ --------------- Convenience routines for setting Flo Errors --------------- -------------------------------------------------------------------------*/ -void -FloError(floDefPtr flo, xieTypPhototag tag, CARD16 type, CARD8 code) -{ - ferrError(flo,tag,type,code); -} - -void -ErrGeneric(floDefPtr flo, peDefPtr ped, CARD8 code) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,code); -} - -void -ErrResource(floDefPtr flo, peDefPtr ped, CARD8 code, CARD32 id) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,code); - ((xieFloResourceErr *)(&flo->error))->resourceID = id; -} - -void -ErrDomain(floDefPtr flo, peDefPtr ped, xieTypPhototag domain) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,xieErrNoFloDomain); - ((xieFloDomainErr *)(&flo->error))->domainSrc = domain; -} - -void -ErrOperator(floDefPtr flo, peDefPtr ped, CARD8 operator) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,xieErrNoFloOperator); - ((xieFloOperatorErr *)(&flo->error))->operator = operator; -} - -void -ErrTechnique(floDefPtr flo, peDefPtr ped, CARD8 group, CARD16 tech, - CARD16 lenParams) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,xieErrNoFloTechnique); - ((xieFloTechniqueErr *)(&flo->error))->techniqueGroup = group; - ((xieFloTechniqueErr *)(&flo->error))->techniqueNumber = tech; - ((xieFloTechniqueErr *)(&flo->error))->lenTechParams = lenParams; -} - -void -ErrValue(floDefPtr flo, peDefPtr ped, CARD32 value) -{ - ferrError(flo,ped->phototag,ped->elemRaw->elemType,xieErrNoFloValue); - ((xieFloValueErr *)(&flo->error))->badValue = value; -} - -/* end module error.c */ Index: xc/programs/Xserver/XIE/dixie/request/event.c diff -u xc/programs/Xserver/XIE/dixie/request/event.c:3.5 xc/programs/Xserver/XIE/dixie/request/event.c:removed --- xc/programs/Xserver/XIE/dixie/request/event.c:3.5 Fri Dec 14 14:58:09 2001 +++ xc/programs/Xserver/XIE/dixie/request/event.c Sat Feb 28 21:41:57 2004 @@ -1,175 +0,0 @@ -/* $Xorg: event.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module event.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - event.c -- DIXIE routines for managing events - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/event.c,v 3.5 2001/12/14 19:58:09 dawes Exp $ */ - -#define _XIEC_EVENT - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include - -#include -#include -#include - -/*------------------------------------------------------------------------ ------------------------------ Send Flo Event ----------------------------- -------------------------------------------------------------------------*/ -void SendFloEvent(floDefPtr flo) -{ - int status = Success; - register int n; - xieFloEvn evn; - - if(flo->runClient->clientGone) return; - /* - * Take care of the common part - */ - evn = flo->event; - evn.sequenceNum = flo->runClient->sequence; - evn.time = currentTime.milliseconds; - evn.instanceNameSpace = flo->spaceID; - evn.instanceFloID = flo->ID; - - if( flo->runClient->swapped ) { - swaps(&evn.sequenceNum, n); - swapl(&evn.time, n); - swapl(&evn.instanceNameSpace, n); - swapl(&evn.instanceFloID, n); - /* - * Take care of the unique parts - */ - switch( evn.event ) { - case xieEvnNoColorAlloc: - swaps(&evn.src, n); - swaps(&evn.type, n); - swapl(&((xieColorAllocEvn *)&evn)->colorList, n); - swaps(&((xieColorAllocEvn *)&evn)->colorAllocTechnique, n); - swapl(&((xieColorAllocEvn *)&evn)->data, n); - break; - case xieEvnNoDecodeNotify: - swaps(&evn.src, n); - swaps(&evn.type, n); - swaps(&((xieDecodeNotifyEvn *)&evn)->decodeTechnique, n); - swapl(&((xieDecodeNotifyEvn *)&evn)->width, n); - swapl(&((xieDecodeNotifyEvn *)&evn)->height, n); - break; - case xieEvnNoExportAvailable: - swaps(&evn.src, n); - swaps(&evn.type, n); - swapl(&((xieExportAvailableEvn *)&evn)->data0, n); - swapl(&((xieExportAvailableEvn *)&evn)->data1, n); - swapl(&((xieExportAvailableEvn *)&evn)->data2, n); - break; - case xieEvnNoImportObscured: - swaps(&evn.src, n); - swaps(&evn.type, n); - swapl(&((xieImportObscuredEvn *)&evn)->window, n); - swaps(&((xieImportObscuredEvn *)&evn)->x, n); - swaps(&((xieImportObscuredEvn *)&evn)->y, n); - swaps(&((xieImportObscuredEvn *)&evn)->width, n); - swaps(&((xieImportObscuredEvn *)&evn)->height, n); - break; - case xieEvnNoPhotofloDone: - break; - default: - status = BadImplementation; - break; - } - } - /* add in our event base */ - evn.event += extEntry->eventBase; - - if( status == Success ) - WriteToClient(flo->runClient, sz_xieFloEvn, (char *)&evn); - -} /* end SendFloEvent */ - -/* end module event.c */ Index: xc/programs/Xserver/XIE/dixie/request/flo.c diff -u xc/programs/Xserver/XIE/dixie/request/flo.c:3.6 xc/programs/Xserver/XIE/dixie/request/flo.c:removed --- xc/programs/Xserver/XIE/dixie/request/flo.c:3.6 Fri Dec 14 14:58:09 2001 +++ xc/programs/Xserver/XIE/dixie/request/flo.c Sat Feb 28 21:41:57 2004 @@ -1,491 +0,0 @@ -/* $Xorg: flo.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module flo.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - flo.c -- DIXIE photoflo utility routines - - Robert NC Shelley -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/flo.c,v 3.6 2001/12/14 19:58:09 dawes Exp $ */ - -/* - * Include files - */ - -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -/* - * Module specific includes - */ -#include - -/* - * routines used internal to this module - */ -static void DAGonize(floDefPtr flo, peDefPtr ped); -static Bool InputsOK(peDefPtr old, peDefPtr new); - - -/*------------------------------------------------------------------------ ------------------------------ routine: MakeFlo --------------------------- -------------------------------------------------------------------------*/ -floDefPtr MakeFlo( - ClientPtr client, - CARD16 peCnt, - xieFlo *peLst) -{ - xieTypPhototag tag; - xieFlo *pe; - peDefPtr ped, export = NULL; - floDefPtr flo; - - if( !(flo = (floDefPtr) XieCalloc(sizeof(floDefRec) + - (peCnt+1) * sizeof(xieFlo *))) ) - return(NULL); - - flo->reqClient = client; - flo->peCnt = peCnt; - flo->peArray = (peDefPtr *) &flo[1]; - flo->flags.modified = TRUE; - ListInit(&flo->defDAG); - ListInit(&flo->optDAG); - - /* allocate photo element definition structures for each client element - */ - for(pe = peLst, tag = 1; tag <= peCnt && !ferrCode(flo); tag++) { - if(client->swapped) { - register int n; - swaps(&pe->elemType, n); - swaps(&pe->elemLength, n); - } - /* if it's a valid element, Make it -- then hop to the next one - */ - if( pe->elemType <= xieMaxElem ) { - flo->peArray[tag] = MakeElement(flo, tag, pe); - pe = (xieFlo *)((CARD32 *)pe + pe->elemLength); - } else - FloElementError(flo,tag,pe->elemType, return(flo)); - } - /* analyze the DAG's topology and connect it all together - */ - for(tag = 1; tag <= peCnt && !ferrCode(flo); tag++) { - ped = flo->peArray[tag]; - if(!ped->flags.export) continue; /* skip to the next export element */ - ped->clink = export; /* link it to previous exports */ - export = ped; - /* link all elements together that contribute data towards this export */ - DAGonize(flo,ped); - } - return(flo); -} /* end MakeFlo */ - - -/*------------------------------------------------------------------------ ------------------------------ routine: EditFlo --------------------------- -------------------------------------------------------------------------*/ -Bool EditFlo( - floDefPtr flo, - xieTypPhototag start, - xieTypPhototag end, - xieFlo *peLst) -{ - xieTypPhototag tag; - pointer ptr; - xieFlo *pe; - peDefPtr old, tmp; - - for(pe = peLst, tag = start; !ferrCode(flo) && tag <= end; tag++) { - if(flo->reqClient->swapped) { - register int n; - swaps(&pe->elemType, n); - swaps(&pe->elemLength, n); - } - old = flo->peArray[tag]; - if(pe->elemType != old->elemRaw->elemType) - FloElementError(flo,tag,pe->elemType, return(FALSE)); - - if( pe->elemType <= xieMaxElem ) { - /* make a temporary peDef to hold the new client parameters */ - if ((tmp = MakeElement(flo, tag, pe)) != 0) { - if(InputsOK(old,tmp)) { - /* swap the new parameter pointers into the existing peDef */ - SwapPtr(old->elemRaw,tmp->elemRaw,ptr); - SwapPtr(old->elemPvt,tmp->elemPvt,ptr); - SwapPtr(old->techPvt,tmp->techPvt,ptr); - SwapPtr(old->techVec,tmp->techVec,ptr); - old->flags.modified = TRUE; - /* free the tmp peDef which now holds the old parameters */ - FreePEDef(tmp); - } else { - FreePEDef(tmp); - SourceError(flo,old, return(FALSE)); - } - } else { - return(FALSE); - } - pe = (xieFlo *)((CARD32 *)pe + pe->elemLength); - } else - FloElementError(flo,tag,pe->elemType, return(FALSE)); - } - return(flo->flags.modified = TRUE); -} /* end EditFlo */ - - -/*------------------------------------------------------------------------ ------------------------------ routine: PrepFlo --------------------------- -------------------------------------------------------------------------*/ -void PrepFlo(floDefPtr flo) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) - /* - * call each element's Prep routine, which will: - * - lookup any resources needed by the element (e.g. Colormap, ROI, ...) - * - validate the element's parameter (and technique) values - * - validate the attributes of each source of data for the element - * - determine the element's output attributes - * - determine if anything was modified since a previous execution - */ - if( !(*ped->diVec->prep)(flo, ped) ) - break; -} /* end PrepFlo */ - - -/*------------------------------------------------------------------------ ------------------------------ routine: FreeFlo --------------------------- -------------------------------------------------------------------------*/ -floDefPtr FreeFlo(floDefPtr flo) -{ - peDefPtr ped; - xieTypPhototag tag; - - while( !ListEmpty(&flo->optDAG) ) { - /* free peDefs from the optimized DAG */ - RemoveMember(ped, flo->optDAG.flink); - FreePEDef(ped); - } - for(tag = 1; tag <= flo->peCnt; tag++) { - /* free the peDef and parameter block for each client element */ - FreePEDef(flo->peArray[tag]); - } - /* finally, free the floDef itself */ - XieFree(flo); - - return(NULL); -} /* end FreeFlo */ - - -/*------------------------------------------------------------------------ ----- routine: Alloc a peDef and DIXIE parameter storage for an element --- -------------------------------------------------------------------------*/ -peDefPtr MakePEDef( - CARD32 inFloCnt, - CARD32 rawLen, - CARD32 pvtLen) -{ - int i, b; - inFloPtr inf; - peDefPtr ped = (peDefPtr) XieCalloc(sizeof(peDefRec) + - sizeof(inFloRec) * inFloCnt); - if( ped ) { - /* alloc some space for a copy of the client's element parameters */ - if( !(ped->elemRaw = (xieFlo *) XieMalloc(rawLen))) - return(FreePEDef(ped)); - - /* alloc whatever private space this element needs for dixie info */ - if(pvtLen) - if ((ped->elemPvt = (pointer)XieCalloc(pvtLen)) != 0) - *(CARD32 *)ped->elemPvt = pvtLen; - else - ped = FreePEDef(ped); - ped->flags.modified = TRUE; - - /* init the outFlo */ - for(b = 0; b < xieValMaxBands; ++b) { - ListInit(&ped->outFlo.output[b]); - ped->outFlo.format[b].band = b; - } - - /* init the in-line inFlo list */ - inf = (inFloPtr) &ped[1]; - ped->inFloLst = inf; - ped->inCnt = inFloCnt; - for(i = 0; i < inFloCnt; (inf++)->index = i++) - for(b = 0; b < xieValMaxBands; ++b) - inf->format[b].band = b; - } - return(ped); -} /* end MakePEDef */ - - -/*------------------------------------------------------------------------ ----------------------------- routine: FreePEDef -------------------------- -------------------------------------------------------------------------*/ -peDefPtr FreePEDef(peDefPtr ped) -{ - int b; - - if( ped ) { - /* - * empty the outFlo - */ - for(b = 0; b < xieValMaxBands; ++b) { - if(!ListEmpty(&ped->outFlo.output[b])) - FreeStrips(&ped->outFlo.output[b]); - } - /* free element parameter structures - */ - if( ped->elemRaw ) XieFree(ped->elemRaw); - if( ped->elemPvt ) XieFree(ped->elemPvt); - if( ped->techPvt ) XieFree(ped->techPvt); - - XieFree(ped); - } - return(NULL); -} /* end FreePEDef */ - - -/*------------------------------------------------------------------------ ------------------------------ Send Client Data --------------------------- -------------------------------------------------------------------------*/ -void SendClientData( - floDefPtr flo, - peDefPtr ped, - CARD8 *data, - CARD32 bytes, - CARD8 swapUnits, - CARD8 state) -{ - xieGetClientDataReply rep; - - if(flo->reqClient->clientGone) return; - - bzero((char *)&rep, sz_xieGetClientDataReply); - rep.newState = state; - rep.type = X_Reply; - rep.sequenceNum = flo->reqClient->sequence; - rep.length = (bytes + 3) >> 2; - rep.byteCount = bytes; - - if( flo->reqClient->swapped ) { - register int n; - swaps(&rep.sequenceNum, n); - swapl(&rep.length, n); - swapl(&rep.byteCount, n); - } - WriteToClient(flo->reqClient, sz_xieGetClientDataReply, (char *)&rep); - - if( bytes ) { - /* if the data needs to be swapped, do it now - */ - if( flo->reqClient->swapped ) switch(swapUnits) { - case 0: - case 1: - break; - case 2: - SwapShorts((short*)data,bytes>>1); - break; - case 4: - case 8: - case 16: - SwapLongs((CARD32*)data,bytes>>2); - break; - } - WriteToClient(flo->reqClient, bytes, (char *)data); - } -} /* end SendClientData */ - - -/*------------------------------------------------------------------------ -------- Based on levels, updata the passed in peDef's outFlo format------- -------------------------------------------------------------------------*/ -Bool UpdateFormatfromLevels(peDefPtr ped) -{ - int i,bits; - - for(i = 0; i < ped->outFlo.bands; i++) { - SetDepthFromLevels(ped->outFlo.format[i].levels, - ped->outFlo.format[i].depth); - - if((bits = ped->outFlo.format[i].depth) > MAX_DEPTH(ped->outFlo.bands) || - ped->outFlo.format[i].levels < 2) - return(FALSE); - - else if(bits == 1) { - ped->outFlo.format[i].class = BIT_PIXEL; - ped->outFlo.format[i].stride = 1; - } else if(bits <= 8) { - ped->outFlo.format[i].class = BYTE_PIXEL; - ped->outFlo.format[i].stride = 8; - } else if(bits <= 16) { - ped->outFlo.format[i].class = PAIR_PIXEL; - ped->outFlo.format[i].stride = 16; - } else { - ped->outFlo.format[i].class = QUAD_PIXEL; - ped->outFlo.format[i].stride = 32; - } - bits = ped->outFlo.format[i].width * ped->outFlo.format[i].stride; - ped->outFlo.format[i].pitch = bits + Align(bits,PITCH_MOD); - } - return (TRUE); -} - - -/*------------------------------------------------------------------------* - * DAGonize recurses back through all the elements that contribute data * - * to the element passed to it. The recursion terminates when: * - * - an import element is found * - * - an element with fully connected inputs is found * - * - an error is encountered (phototag out of range, or loop detected) * - *------------------------------------------------------------------------*/ -static void DAGonize(floDefPtr flo, peDefPtr ped) -{ - int in, tag; - peDefPtr src; - inFloPtr inFlo; - - if(ped->flink) return; /* this element has already been DAGonized */ - - /* connect all the inputs to this element */ - for(ped->flags.loop = TRUE,in = 0; in < ped->inCnt && !ferrCode(flo); in++) { - inFlo = &ped->inFloLst[in]; - if((tag = inFlo->srcTag) > flo->peCnt) - SourceError(flo,ped, break); /* input is outside the flo-graph! */ - - if(tag) { /* only connect specified (i.e. non-zero) inputs */ - inFlo->ownDef = ped; - src = inFlo->srcDef = flo->peArray[tag]; - - if(src->flags.loop || src->flags.export) - SourceError(flo,ped, break); /* oops, we've stumbled over a loop */ - - /* insert this inFlo into the source element's outFlo list */ - inFlo->outChain = src->outFlo.outChain; - src->outFlo.outChain = inFlo; - - /* connect all the elements that contribute data towards this input */ - DAGonize(flo,src); - } - } - if(!ferrCode(flo)) { - /* clear the loop-detector */ - ped->flags.loop = FALSE; - - if(ped->flags.import && !ListEmpty(&flo->defDAG)) { - /* find the end of the import list, then append this element */ - for(src = flo->defDAG.flink; src->clink; src = src->clink); - src->clink = ped; - } - /* finally -- append this element onto the definition DAG */ - InsertMember(ped, flo->defDAG.blink); - } -} /* end DAGonize */ - - -/*------------------------------------------------------------------------ --------------- compare input connections between two peDefs -------------- -------------------------------------------------------------------------*/ -static Bool InputsOK(peDefPtr old, peDefPtr new) -{ - inFloPtr oldin = old->inFloLst, newin = old->inFloLst; - int i; - - if(old->inCnt != new->inCnt) - return(FALSE); - - for(i = 0; i < old->inCnt; oldin++, newin++, i++) - if(oldin->srcTag != newin->srcTag) - return(FALSE); - - return(TRUE); -} - -/* end module flo.c */ Index: xc/programs/Xserver/XIE/dixie/request/lut.c diff -u xc/programs/Xserver/XIE/dixie/request/lut.c:3.5 xc/programs/Xserver/XIE/dixie/request/lut.c:removed --- xc/programs/Xserver/XIE/dixie/request/lut.c:3.5 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/lut.c Sat Feb 28 21:41:57 2004 @@ -1,193 +0,0 @@ -/* $Xorg: lut.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module lut.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/lut.c,v 3.5 2001/12/14 19:58:10 dawes Exp $ */ - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Module Specific Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other modules. - */ -extern int DeleteLUT(lutPtr lut, xieTypLUT id); - - -/*------------------------------------------------------------------------ ---------------------------- CreateLUT Procedures ------------------------- -------------------------------------------------------------------------*/ -int ProcCreateLUT(ClientPtr client) -{ - int b; - lutPtr lut; - REQUEST(xieCreateLUTReq); - REQUEST_SIZE_MATCH(xieCreateLUTReq); - LEGAL_NEW_RESOURCE(stuff->lut, client); - - /* create a new lookup table - */ - if( !(lut = (lutPtr) XieCalloc(sizeof(lutRec))) ) - return(client->errorValue = stuff->lut, BadAlloc); - - lut->ID = stuff->lut; - lut->refCnt = 1; - for(b = 0; b < xieValMaxBands; b++) - ListInit(&lut->strips[b]); - - return( AddResource(lut->ID, RT_LUT, (lutPtr)lut) - ? Success : (client->errorValue = stuff->lut, BadAlloc) ); -} /* end ProcCreateLUT */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyLUT Procedures -------------------------- -------------------------------------------------------------------------*/ -int ProcDestroyLUT(ClientPtr client) -{ - lutPtr lut; - REQUEST( xieDestroyLUTReq ); - REQUEST_SIZE_MATCH( xieDestroyLUTReq ); - - if( !(lut = (lutPtr)LookupIDByType(stuff->lut, RT_LUT)) ) - return( SendResourceError(client, xieErrNoLUT, stuff->lut) ); - - /* Disassociate the LUT from core X -- it calls DeleteLUT() - */ - FreeResourceByType(stuff->lut, RT_LUT, RT_NONE); - - return(Success); -} /* end ProcDestroyLUT */ - - -/*------------------------------------------------------------------------ ------------------------- deleteFunc: DeleteLUT --------------------------- -------------------------------------------------------------------------*/ -int DeleteLUT(lutPtr lut, xieTypLUT id) -{ - int i; - - if( --lut->refCnt ) - return(Success); - - /* Free any lookup table arrays - */ - for(i = 0; i < lut->lutCnt; i++ ) - FreeStrips(&lut->strips[i]); - - /* Free the LUT structure. - */ - XieFree(lut); - - return(Success); -} /* end DeleteLUT */ - - -int SProcCreateLUT(ClientPtr client) -{ - register int n; - REQUEST(xieCreateLUTReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieCreateLUTReq); - swapl(&stuff->lut, n); - return (ProcCreateLUT(client)); -} /* end SProcCreateLUT */ - -int SProcDestroyLUT(ClientPtr client) -{ - register int n; - REQUEST( xieDestroyLUTReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieDestroyLUTReq ); - swapl(&stuff->lut, n); - return (ProcDestroyLUT(client)); -} /* end SProcDestroyLUT */ - -/* end module LUT.c */ Index: xc/programs/Xserver/XIE/dixie/request/memory.c diff -u xc/programs/Xserver/XIE/dixie/request/memory.c:3.7 xc/programs/Xserver/XIE/dixie/request/memory.c:removed --- xc/programs/Xserver/XIE/dixie/request/memory.c:3.7 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/memory.c Sat Feb 28 21:41:57 2004 @@ -1,129 +0,0 @@ -/* $Xorg: memory.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/* Module memory.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - memory.c: Xie Memory Management Wrapper Routines - - Dean Verheiden, AGE Logic, Inc., April 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/memory.c,v 3.7 2001/12/14 19:58:10 dawes Exp $ */ - -#define _XIEC_MEMORY - -/* -** Include files -*/ -/* - * Core X Includes - */ -#include -#include - -#include "misc.h" /* for pointer */ -#include /* to assert declaration and definition match */ -#include "macro.h" - - -int ALLOCS = 0; /* DEBUG */ - -pointer XieMalloc(unsigned size) -{ - char *memptr = (char *)xalloc(size); - - if(memptr) - ++ALLOCS; /* DEBUG */ - return (pointer )(memptr); -} - - -pointer XieRealloc(pointer ptr, unsigned size) -{ - return (pointer )xrealloc(ptr,size); -} - -pointer XieCalloc(unsigned size) -{ - char *memptr = (char *)xalloc(size); - - if(memptr) { - ++ALLOCS; /* DEBUG */ - bzero(memptr,size); - } - return (pointer )(memptr); -} - -pointer XieFree(pointer ptr) -{ - if(ptr) { - --ALLOCS; /* DEBUG */ - xfree(ptr); - } - return(0); -} - -/* End of module memory.c */ Index: xc/programs/Xserver/XIE/dixie/request/photomap.c diff -u xc/programs/Xserver/XIE/dixie/request/photomap.c:3.5 xc/programs/Xserver/XIE/dixie/request/photomap.c:removed --- xc/programs/Xserver/XIE/dixie/request/photomap.c:3.5 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/photomap.c Sat Feb 28 21:41:57 2004 @@ -1,296 +0,0 @@ -/* $Xorg: photomap.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module photomap.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -**************************************************************************** - - photomap.c: Routines to handle Photomap protocol requests - - Dean Verheiden, Robert NC Shelley AGE Logic, Inc. April 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/photomap.c,v 3.5 2001/12/14 19:58:10 dawes Exp $ */ - -#define _XIEC_PHOTOMAP - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Module Specific Includes - */ -#include -#include -#include -#include -#include - - -/* - * Xie protocol proceedures called from the dispatcher - */ -int ProcCreatePhotomap(); -int ProcDestroyPhotomap(); -int ProcQueryPhotomap(); -int SProcCreatePhotomap(); -int SProcDestroyPhotomap(); -int SProcQueryPhotomap(); - -/* - * routines referenced by other modules. - */ -int DeletePhotomap(); - - -/*------------------------------------------------------------------------ ------------------------- CreatePhotomap Procedures ---------------------- -------------------------------------------------------------------------*/ -int ProcCreatePhotomap(ClientPtr client) -{ - int b; - photomapPtr map; - REQUEST(xieCreatePhotomapReq); - REQUEST_SIZE_MATCH(xieCreatePhotomapReq); - LEGAL_NEW_RESOURCE(stuff->photomap, client); - - /* create a new Photomap - */ - if( !(map = (photomapPtr) XieCalloc(sizeof(photomapRec))) ) - return(client->errorValue = stuff->photomap, BadAlloc); - - map->ID = stuff->photomap; - map->refCnt = 1; - map->bands = 0; - for(b = 0; b < xieValMaxBands; b++) - ListInit(&map->strips[b]); - - return( AddResource(map->ID, RT_PHOTOMAP, (photomapPtr)map) - ? Success : (client->errorValue = stuff->photomap, BadAlloc) ); -} /* end ProcCreatePhotomap */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyPhotomap Procedures --------------------- -------------------------------------------------------------------------*/ -int ProcDestroyPhotomap(ClientPtr client) -{ - photomapPtr map; - REQUEST( xieDestroyPhotomapReq ); - REQUEST_SIZE_MATCH( xieDestroyPhotomapReq ); - - if( !(map = (photomapPtr)LookupIDByType(stuff->photomap, RT_PHOTOMAP)) ) - return( SendResourceError(client, xieErrNoPhotomap, stuff->photomap) ); - - /* Disassociate the Photomap from core X -- it calls DeletePhotomap() - */ - FreeResourceByType(stuff->photomap, RT_PHOTOMAP, RT_NONE); - - return(Success); -} /* end ProcDestroyPhotomap */ - - -/*------------------------------------------------------------------------ ------------------------- QueryPhotomap Procedures ----------------------- -------------------------------------------------------------------------*/ -int ProcQueryPhotomap(ClientPtr client) -{ - xieQueryPhotomapReply rep; - photomapPtr map; - REQUEST( xieQueryPhotomapReq ); - REQUEST_SIZE_MATCH( xieQueryPhotomapReq ); - - if( !(map = (photomapPtr)LookupIDByType(stuff->photomap, RT_PHOTOMAP)) ) - return( SendResourceError(client, xieErrNoPhotomap, stuff->photomap) ); - - /* Fill in the reply header - */ - bzero((char *)&rep, sz_xieQueryPhotomapReply); - rep.type = X_Reply; - rep.sequenceNum = client->sequence; - rep.length = sz_xieQueryPhotomapReply-32>>2; - - if( map->bands ) { - rep.populated = TRUE; - rep.dataType = map->dataType; - rep.dataClass = map->dataClass; - rep.width0 = map->format[0].width; - rep.height0 = map->format[0].height; - rep.levels0 = map->format[0].levels; - rep.decodeTechnique = map->technique; - if( map->bands == xieValMaxBands ) { - rep.width1 = map->format[1].width; - rep.height1 = map->format[1].height; - rep.levels1 = map->format[1].levels; - rep.width2 = map->format[2].width; - rep.height2 = map->format[2].height; - rep.levels2 = map->format[2].levels; - } - } else { - rep.populated = FALSE; - } - - if( client->swapped ) { - /* - * Swap the reply header fields - */ - register int n; - - swaps(&rep.sequenceNum,n); - swapl(&rep.length,n); - if (rep.populated) { - swaps(&rep.decodeTechnique,n); - swapl(&rep.width0,n); - swapl(&rep.height0,n); - swapl(&rep.levels0,n); - if (rep.dataClass == xieValTripleBand) { - swapl(&rep.width1,n); - swapl(&rep.height1,n); - swapl(&rep.levels1,n); - swapl(&rep.width2,n); - swapl(&rep.height2,n); - swapl(&rep.levels2,n); - } - } - } - WriteToClient(client, sz_xieQueryPhotomapReply, (char *)&rep); - - return(Success); -} /* end ProcQueryPhotomap */ - - -/*------------------------------------------------------------------------ ------------------------ deleteFunc: DeletePhotomap ---------------------- -------------------------------------------------------------------------*/ -int DeletePhotomap( - photomapPtr map, - xieTypPhotomap id) -{ - int i; - - if( --map->refCnt ) - return(Success); - - /* free compression parameters and image data - */ - if (map->tecParms) - map->tecParms = (pointer)XieFree(map->tecParms); - if (map->pvtParms) - map->pvtParms = (pointer)XieFree(map->pvtParms); - for(i = 0; i < map->bands; i++) - FreeStrips(&map->strips[i]); - /* - Free the Photomap structure. - */ - XieFree(map); - - return(Success); -} /* end DeletePhotomap */ - -int SProcCreatePhotomap(ClientPtr client) -{ - register int n; - REQUEST(xieCreatePhotomapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieCreatePhotomapReq); - swapl(&stuff->photomap, n); - return (ProcCreatePhotomap(client)); -} /* end SProcCreatePhotomap */ - -int SProcDestroyPhotomap(ClientPtr client) -{ - register int n; - REQUEST( xieDestroyPhotomapReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieDestroyPhotomapReq ); - swapl(&stuff->photomap, n); - return (ProcDestroyPhotomap(client)); -} /* end SProcDestroyPhotomap */ - -int SProcQueryPhotomap(ClientPtr client) -{ - register int n; - REQUEST( xieQueryPhotomapReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieQueryPhotomapReq ); - swapl(&stuff->photomap, n); - return (ProcQueryPhotomap(client)); -} /* end SProcQueryPhotomap */ - -/* end module Photomap.c */ Index: xc/programs/Xserver/XIE/dixie/request/protoflo.c diff -u xc/programs/Xserver/XIE/dixie/request/protoflo.c:3.5 xc/programs/Xserver/XIE/dixie/request/protoflo.c:removed --- xc/programs/Xserver/XIE/dixie/request/protoflo.c:3.5 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/protoflo.c Sat Feb 28 21:41:57 2004 @@ -1,856 +0,0 @@ -/* $Xorg: protoflo.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module protoflo.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - protoflo.c: photospace and photoflo request/reply procedures - - Robert NC Shelley, Dean Verheiden -- AGE Logic, Inc., May 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/protoflo.c,v 3.5 2001/12/14 19:58:10 dawes Exp $ */ - - -#include - -#include -#include -#include - -/* - * routines used internal to this module - */ -static floDefPtr LookupExecutable(CARD32 spaceID, CARD32 floID); -static floDefPtr LookupImmediate(CARD32 spaceID, CARD32 floID, photospacePtr *spacePtr); -static int RunFlo(ClientPtr client, floDefPtr flo); -static int FloDone(floDefPtr flo); -static void DeleteImmediate(floDefPtr flo); - - - -/*------------------------------------------------------------------------ ---------------------------- CreatePhotospace Procedure ------------------- -------------------------------------------------------------------------*/ -int ProcCreatePhotospace(ClientPtr client) -{ - photospacePtr space; - REQUEST(xieCreatePhotospaceReq); - REQUEST_SIZE_MATCH(xieCreatePhotospaceReq); - LEGAL_NEW_RESOURCE(stuff->nameSpace, client); - - /* - * create a new lookup table - */ - if(!(space = (photospacePtr) XieMalloc(sizeof(photospaceRec)))) - return(client->errorValue = stuff->nameSpace, BadAlloc); - - space->spaceID = stuff->nameSpace; - space->floCnt = 0; - ListInit(&space->floLst); - - return( AddResource(space->spaceID, RT_PHOTOSPACE, space) - ? Success : (client->errorValue = stuff->nameSpace, BadAlloc) ); -} /* end ProcCreatePhotospace */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyPhotospace Procedure --------------------- -------------------------------------------------------------------------*/ -int ProcDestroyPhotospace(ClientPtr client) -{ - photospacePtr space; - REQUEST( xieDestroyPhotospaceReq ); - REQUEST_SIZE_MATCH( xieDestroyPhotospaceReq ); - - if(!(space = (photospacePtr)LookupIDByType(stuff->nameSpace,RT_PHOTOSPACE))) - return( SendResourceError(client, xieErrNoPhotospace, stuff->nameSpace) ); - - /* - * Disassociate the Photospace from core X -- it calls DeletePhotospace() - */ - FreeResourceByType(stuff->nameSpace, RT_PHOTOSPACE, RT_NONE); - - return(Success); -} /* end ProcDestroyPhotospace */ - - -/*------------------------------------------------------------------------ ------------------------- ExecuteImmediate Procedure ---------------------- -------------------------------------------------------------------------*/ -int ProcExecuteImmediate(ClientPtr client) -{ - floDefPtr flo; - photospacePtr space; - REQUEST(xieExecuteImmediateReq); - REQUEST_AT_LEAST_SIZE(xieExecuteImmediateReq); - - /* verify that the new flo-id is unique */ - flo = LookupImmediate(stuff->nameSpace, stuff->floID, &space); - if( !space || flo ) - return(SendFloIDError(client,stuff->nameSpace,stuff->floID)); - - /* create the flo structures and verify the DAG's topology */ - if(!(flo = MakeFlo(client, stuff->numElements, (xieFlo *)&stuff[1]))) - return(client->errorValue = stuff->floID, BadAlloc); - - /* append the new flo to the photospace */ - flo->space = space; - flo->spaceID = stuff->nameSpace; - flo->ID = stuff->floID; - flo->flags.notify = stuff->notify; - space->floCnt++; - InsertMember(flo,space->floLst.blink); - - /* try to execute it */ - return(RunFlo(client,flo)); -} /* end ProcExecuteImmediate */ - - -/*------------------------------------------------------------------------ -------------------------- CreatePhotoflo Procedure ----------------------- -------------------------------------------------------------------------*/ -int ProcCreatePhotoflo(ClientPtr client) -{ - floDefPtr flo; - REQUEST(xieCreatePhotofloReq); - REQUEST_AT_LEAST_SIZE(xieCreatePhotofloReq); - LEGAL_NEW_RESOURCE(stuff->floID, client); - - /* create a new Photoflo - */ - if( !(flo = MakeFlo(client, stuff->numElements, (xieFlo *)&stuff[1])) ) - return(client->errorValue = stuff->floID, BadAlloc); - flo->ID = stuff->floID; - - if( ferrCode(flo) ) { - SendFloError(client,flo); - DeletePhotoflo(flo, stuff->floID); - return(Success); - } - /* All is well, try to register the new flo - */ - return( AddResource(stuff->floID, RT_PHOTOFLO, (floDefPtr)flo) - ? Success : (client->errorValue = stuff->floID, BadAlloc) ); -} /* end ProcCreatePhotoflo */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyPhotoflo Procedure ----------------------- -------------------------------------------------------------------------*/ -int ProcDestroyPhotoflo(ClientPtr client) -{ - floDefPtr flo; - REQUEST( xieDestroyPhotofloReq ); - REQUEST_SIZE_MATCH( xieDestroyPhotofloReq ); - - if( !(flo = (floDefPtr) LookupIDByType(stuff->floID, RT_PHOTOFLO)) ) - return( SendResourceError(client, xieErrNoPhotoflo, stuff->floID) ); - - /* Disassociate the Photoflo from core X -- it calls DeletePhotoflo() - */ - FreeResourceByType(stuff->floID, RT_PHOTOFLO, RT_NONE); - - return(Success); -} /* end ProcDestroyPhotoflo */ - - -/*------------------------------------------------------------------------ ------------------------- ExecutePhotoflo Procedure ----------------------- -------------------------------------------------------------------------*/ -int ProcExecutePhotoflo(ClientPtr client) -{ - floDefPtr flo; - REQUEST( xieExecutePhotofloReq ); - REQUEST_SIZE_MATCH( xieExecutePhotofloReq ); - - if( !(flo = (floDefPtr) LookupIDByType(stuff->floID, RT_PHOTOFLO)) ) - return( SendResourceError(client, xieErrNoPhotoflo, stuff->floID) ); - - if( flo->flags.active ) - FloAccessError(flo,0,0, return(SendFloError(client,flo))); - flo->flags.notify = stuff->notify; - ferrCode(flo) = 0; - - /* try to execute it */ - return(RunFlo(client,flo)); -} /* end ProcExecutePhotoflo */ - - -/*------------------------------------------------------------------------ -------------------------- ModifyPhotoflo Procedure ----------------------- -------------------------------------------------------------------------*/ -int ProcModifyPhotoflo(ClientPtr client) -{ - floDefPtr flo; - xieTypPhototag end; - REQUEST( xieModifyPhotofloReq ); - REQUEST_AT_LEAST_SIZE(xieModifyPhotofloReq); - - if( !(flo = (floDefPtr) LookupIDByType(stuff->floID, RT_PHOTOFLO)) ) - return( SendResourceError(client, xieErrNoPhotoflo, stuff->floID) ); - - if( flo->flags.active ) - FloAccessError(flo,0,0, goto egress); - - if(!stuff->start || stuff->start > flo->peCnt) - FloSourceError(flo,stuff->start,0, goto egress); - - if((end = stuff->start + stuff->numElements - 1) > flo->peCnt) - FloElementError(flo,flo->peCnt,0, goto egress); - - /* edit existing elements according to the list of elements we were given - */ - EditFlo(flo, stuff->start, end, (xieFlo *)&stuff[1]); - - egress: - return(ferrCode(flo) ? SendFloError(client,flo) : Success); -} /* end ProcModifyPhotoflo */ - - -/*------------------------------------------------------------------------ ------------------------- RedefinePhotoflo Procedure ---------------------- -------------------------------------------------------------------------*/ -int ProcRedefinePhotoflo(ClientPtr client) -{ - floDefPtr old, new; - REQUEST( xieRedefinePhotofloReq ); - REQUEST_AT_LEAST_SIZE(xieRedefinePhotofloReq); - - if( !(old = (floDefPtr) LookupIDByType(stuff->floID, RT_PHOTOFLO)) ) - return( SendResourceError(client, xieErrNoPhotoflo, stuff->floID) ); - - if( old->flags.active ) - FloAccessError(old,0,0, return(SendFloError(client,old))); - - /* create a new Photoflo - */ - if( !(new = MakeFlo(client, stuff->numElements, (xieFlo *)&stuff[1])) ) - return(client->errorValue = stuff->floID, BadAlloc); - new->ID = stuff->floID; - - if( ferrCode(new) ) { - SendFloError(client,new); - DeletePhotoflo(new, stuff->floID); - return(Success); - } - /* Disassociate the old flo from core X -- it calls DeletePhotoflo() - */ - FreeResourceByType(stuff->floID, RT_PHOTOFLO, RT_NONE); - - /* Then (re)register the new flo using the old flo's ID - */ - return( AddResource(stuff->floID, RT_PHOTOFLO, (floDefPtr)new) - ? Success : (client->errorValue = stuff->floID, BadAlloc) ); -} /* end ProcRedefinePhotoflo */ - - -/*------------------------------------------------------------------------ ------------------------------- Abort Procedure --------------------------- -------------------------------------------------------------------------*/ -int ProcAbort(ClientPtr client) -{ - floDefPtr flo; - REQUEST( xieAbortReq ); - REQUEST_SIZE_MATCH( xieAbortReq ); - - if ((flo = LookupExecutable(stuff->nameSpace, stuff->floID)) != 0) - if( flo->flags.active ) { - flo->reqClient = client; - flo->flags.aborted = TRUE; - ddShutdown(flo); - FloDone(flo); - } - return(Success); -} /* end ProcAbort */ - - -/*------------------------------------------------------------------------ ------------------------------- Await Procedure --------------------------- -------------------------------------------------------------------------*/ -int ProcAwait(ClientPtr client) -{ - ClientPtr *awaken; - floDefPtr flo; - REQUEST( xieAwaitReq ); - REQUEST_SIZE_MATCH( xieAwaitReq ); - - if( (flo = LookupExecutable(stuff->nameSpace, stuff->floID)) - && flo->flags.active ) { - if((awaken = (ClientPtr*)(flo->awakenCnt - ? XieRealloc( flo->awakenPtr, - (flo->awakenCnt+1)*sizeof(ClientPtr)) - : XieMalloc(sizeof(ClientPtr)))) != 0) { - /* - * tell core X to ignore this client until the flo is done - */ - awaken[flo->awakenCnt++] = client; - flo->awakenPtr = awaken; - IgnoreClient(client); - } else { - return(BadAlloc); - } - } - return(Success); -} /* end ProcAwait */ - - -/*------------------------------------------------------------------------ --------------------------- Get Client Data Procedure --------------------- -------------------------------------------------------------------------*/ -int ProcGetClientData(ClientPtr client) -{ - floDefPtr flo; - peDefPtr ped; - REQUEST( xieGetClientDataReq ); - REQUEST_SIZE_MATCH( xieGetClientDataReq ); - - /* find the flo and make sure it's active - */ - if(!(flo = LookupExecutable(stuff->nameSpace, stuff->floID))) - return SendFloIDError(client, stuff->nameSpace, stuff->floID); - if(!flo->flags.active) - FloAccessError(flo,stuff->element,0, return(SendFloError(client,flo))); - - /* verify that the specified element and band are OK - */ - flo->reqClient = client; - ped = (stuff->element && stuff->element <= flo->peCnt - ? flo->peArray[stuff->element] : NULL); - if(!ped || !ped->flags.getData) - FloElementError(flo, stuff->element, ped ? ped->elemRaw->elemType : 0, - goto egress); - if(stuff->bandNumber >= ped->inFloLst[0].bands) - ValueError(flo,ped,stuff->bandNumber, goto egress); - - /* grab some data and have it sent to the client - */ - ddOutput(flo, ped, stuff->bandNumber, stuff->maxBytes, stuff->terminate); - - egress: - return(ferrCode(flo) || !flo->flags.active ? FloDone(flo) : Success); -} /* end ProcGetClientData */ - - -/*------------------------------------------------------------------------ --------------------------- Put Client Data Procedure --------------------- -------------------------------------------------------------------------*/ -int ProcPutClientData(ClientPtr client) -{ - floDefPtr flo; - peDefPtr ped; - REQUEST( xiePutClientDataReq ); - REQUEST_AT_LEAST_SIZE(xiePutClientDataReq); - - /* find the flo and make sure it's active - */ - if( !(flo = LookupExecutable(stuff->nameSpace, stuff->floID)) ) - return( SendFloIDError(client, stuff->nameSpace, stuff->floID) ); - if( !flo->flags.active ) - FloAccessError(flo,stuff->element,0, return(SendFloError(client,flo))); - - /* verify that the target element and band are OK - */ - flo->reqClient = client; - ped = stuff->element && stuff->element <= flo->peCnt - ? flo->peArray[stuff->element] : NULL; - if( !ped || !ped->flags.putData ) - FloElementError(flo, stuff->element, ped ? ped->elemRaw->elemType : 0, - goto egress); - if( stuff->bandNumber >= ped->inFloLst[0].bands ) - ValueError(flo,ped,stuff->bandNumber, goto egress); - - /* check for partial aggregates and swap the data as required - */ - switch(ped->swapUnits[stuff->bandNumber]) { - case 0: - case 1: - break; - case 2: - if(stuff->byteCount & 1) - ValueError(flo,ped,stuff->byteCount, goto egress); - if (client->swapped) - SwapShorts((short*)&stuff[1],stuff->byteCount>>1); - break; - case 4: - case 8: - case 16: - if(stuff->byteCount & (ped->swapUnits[stuff->bandNumber]-1)) - ValueError(flo,ped,stuff->byteCount, goto egress); - if(client->swapped) - SwapLongs((CARD32*)&stuff[1],stuff->byteCount>>2); - break; - } - /* pass the byte-stream to the target element - */ - if(stuff->byteCount || stuff->final) - ddInput(flo, ped, stuff->bandNumber, - (CARD8*)&stuff[1], stuff->byteCount, stuff->final); - - egress: - return(ferrCode(flo) || !flo->flags.active ? FloDone(flo) : Success); -} /* end ProcPutClientData */ - - -/*------------------------------------------------------------------------ ------------------------- QueryPhotoflo Procedure ------------------------- -------------------------------------------------------------------------*/ -int ProcQueryPhotoflo(ClientPtr client) -{ - CARD16 imCnt, exCnt; - CARD32 shorts; - floDefPtr flo; - xieTypPhototag *list; - xieQueryPhotofloReply rep; - REQUEST( xieQueryPhotofloReq ); - REQUEST_SIZE_MATCH( xieQueryPhotofloReq ); - - bzero((char *)&rep, sz_xieQueryPhotofloReply); - rep.state = ((flo = LookupExecutable(stuff->nameSpace, stuff->floID)) - ? (flo->flags.active ? xieValActive : xieValInactive) - : xieValNonexistent); - - /* Ask ddxie about the status of client transport - */ - if(!flo || !flo->flags.active) - imCnt = exCnt = 0; - else if(!ddQuery(flo,&list,&imCnt,&exCnt)) - return(SendFloError(client,flo)); - - /* Fill in the reply header - */ - shorts = ((imCnt + 1) & ~1) + ((exCnt + 1) & ~1); - rep.type = X_Reply; - rep.sequenceNum = client->sequence; - rep.length = shorts >> 1; - rep.expectedCount = imCnt; - rep.availableCount = exCnt; - - if( client->swapped ) { - register int n; - swaps(&rep.sequenceNum,n); - swapl(&rep.length,n); - swaps(&rep.expectedCount,n); - swaps(&rep.availableCount,n); - } - WriteToClient(client, sz_xieQueryPhotofloReply, (char *)&rep); - - if(shorts) { - /* Send the list of pending import/export(s) (swapped as necessary) - */ - if( client->swapped ) - SwapShorts((short *)list, shorts); - WriteToClient(client, shorts<<1, (char *)list); - XieFree(list); - } - return(Success); -} /* end ProcQueryPhotoflo */ - - -/*------------------------------------------------------------------------ ------------------------ deleteFunc: DeletePhotospace --------------------- -------------------------------------------------------------------------*/ -int DeletePhotospace( - photospacePtr space, - xieTypPhotospace id) -{ - /* abort and destroy all flos in the photospace - */ - while( space->floCnt ) { - floDefPtr flo = space->floLst.flink; - /* - * abort it's execution, and then let it go away quietly (no error/events) - */ - flo->reqClient = flo->runClient; - flo->flags.aborted = TRUE; - flo->flags.notify = FALSE; - ddShutdown(flo); - ferrCode(flo) = 0; - FloDone(flo); - } - /* Free the Photospace structure. - */ - XieFree(space); - - return(Success); -} /* end DeletePhotospace */ - - -/*------------------------------------------------------------------------ ------------------------ deleteFunc: DeletePhotoflo ----------------------- -------------------------------------------------------------------------*/ -int DeletePhotoflo( - floDefPtr flo, - xieTypPhotoflo id) -{ - if(flo->flags.active) { - /* - * abort it's execution, and then let it go away quietly (no error/events) - */ - flo->reqClient = flo->runClient; - flo->flags.aborted = TRUE; - flo->flags.notify = FALSE; - ddShutdown(flo); - ferrCode(flo) = 0; - FloDone(flo); - } - /* destroy any lingering ddxie structures - */ - ddDestroy(flo); - - /* free the dixie element structures - */ - FreeFlo(flo); - - return(Success); -} /* end DeletePhotoflo */ - - -/*------------------------------------------------------------------------ -------------------------- routine: LookupExecutable ---------------------- -------------------------------------------------------------------------*/ -static floDefPtr LookupExecutable(CARD32 spaceID, CARD32 floID) -{ - floDefPtr flo; - - if( spaceID ) - flo = LookupImmediate(spaceID, floID, NULL); - else - flo = (floDefPtr) LookupIDByType(floID, RT_PHOTOFLO); - - return(flo); -} /* end LookupExecutable */ - - -/*------------------------------------------------------------------------ ------------------------- routine: LookupImmediate ------------------------ -------------------------------------------------------------------------*/ -static floDefPtr LookupImmediate( - CARD32 spaceID, - CARD32 floID, - photospacePtr *spacePtr) -{ - floDefPtr flo; - photospacePtr space = (photospacePtr) LookupIDByType(spaceID, RT_PHOTOSPACE); - - if(spacePtr) - *spacePtr = space; - if(!space) - return(NULL); - - /* search the photospace for the specified flo - */ - for(flo = space->floLst.flink; - !ListEnd(flo,&space->floLst) && floID != flo->ID; - flo = flo->flink); - - return( ListEnd(flo,&space->floLst) ? NULL : flo ); -} /* end LookupImmediate */ - - -/*------------------------------------------------------------------------ ------------ initiate, and possibly complete, photoflo execution ---------- -------------------------------------------------------------------------*/ -static int RunFlo(ClientPtr client, floDefPtr flo) -{ - flo->runClient = flo->reqClient = client; - - /* validate parameters and propagate attributes between elements */ - if( !ferrCode(flo) ) - PrepFlo(flo); - - /* choose the "best" set of handlers for this DAG (this also - * establishes all DDXIE entry points in the floDef and peDefs) - */ - if(!ferrCode(flo) && flo->flags.modified) - DAGalyze(flo); - - /* create all the new handlers that were chosen by DAGalyze */ - if(!ferrCode(flo) && flo->flags.modified) - ddLink(flo); - - /* begin (and maybe complete) execution */ - if( ferrCode(flo) || !ddStartup(flo) ) - FloDone(flo); - - return(Success); -} /* end RunFlo */ - - -/*------------------------------------------------------------------------ --------- Handle Photoflo Done: send error and event, then clean up ------- -------------------------------------------------------------------------*/ -static int FloDone(floDefPtr flo) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - Bool ok = !ferrCode(flo) && !flo->flags.aborted; - - /* debrief import elements */ - for(ped = lst->flink; ped && !ListEnd(ped,lst); ped = ped->clink) - if(ped->diVec->debrief) - ok &= (*ped->diVec->debrief)(flo,ped,ok); - - /* debrief all other elements (e.g. export and ConvertToIndex) */ - for(ped = lst->flink; ped && !ListEnd(ped,lst); ped = ped->flink) - if(!ped->flags.import && ped->diVec->debrief) - ok &= (*ped->diVec->debrief)(flo,ped,ok); - - /* handle errors */ - if(ferrCode(flo)) { - ddShutdown(flo); - SendFloError(flo->runClient,flo); - if(flo->reqClient != flo->runClient) - SendFloError(flo->reqClient,flo); - } - /* handle events */ - if(flo->flags.notify) { - flo->event.event = xieEvnNoPhotofloDone; - - if(ferrCode(flo)) - ((xiePhotofloDoneEvn *)&flo->event)->outcome = xieValFloError; - else if(flo->flags.aborted) - ((xiePhotofloDoneEvn *)&flo->event)->outcome = xieValFloAbort; - else - ((xiePhotofloDoneEvn *)&flo->event)->outcome = xieValFloSuccess; - - SendFloEvent(flo); - } - /* if this was an immediate flo, it's history */ - if(flo->spaceID) - DeleteImmediate(flo); - - return(Success); -} /* end FloDone */ - - -/*------------------------------------------------------------------------ -------------------------- routine: DeleteImmediate ----------------------- -------------------------------------------------------------------------*/ -static void DeleteImmediate(floDefPtr flo) -{ - floDefPtr tmp; - - /* destroy any lingering DDXIE structures - */ - ddDestroy(flo); - - /* remove the photoflo from the photospace and destroy it - */ - flo->space->floCnt--; - RemoveMember(tmp, flo); - FreeFlo(tmp); -} /* end DeleteImmediate */ - - -/*------------------------------------------------------------------------ ------------------------------ Swap procedures ---------------------------- -------------------------------------------------------------------------*/ -int SProcCreatePhotospace(ClientPtr client) -{ - register long n; - REQUEST(xieCreatePhotospaceReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieCreatePhotospaceReq); - swapl(&stuff->nameSpace, n); - return (ProcCreatePhotospace(client)); -} /* end SProcCreatePhotospace */ - -int SProcDestroyPhotospace(ClientPtr client) -{ - register long n; - REQUEST( xieDestroyPhotospaceReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieDestroyPhotospaceReq ); - swapl(&stuff->nameSpace, n); - return (ProcDestroyPhotospace(client)); -} /* end SProcDestroyPhotospace */ - -int SProcExecuteImmediate(ClientPtr client) -{ - register int n; - REQUEST(xieExecuteImmediateReq); - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xieExecuteImmediateReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - swaps(&stuff->numElements, n); - return( ProcExecuteImmediate(client) ); -} - -int SProcCreatePhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieCreatePhotofloReq); - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xieCreatePhotofloReq); - swapl(&stuff->floID, n); - swaps(&stuff->numElements, n); - return( ProcCreatePhotoflo(client) ); -} - -int SProcDestroyPhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieDestroyPhotofloReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieDestroyPhotofloReq); - swapl(&stuff->floID, n); - return( ProcDestroyPhotoflo(client) ); -} - -int SProcExecutePhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieExecutePhotofloReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieExecutePhotofloReq); - swapl(&stuff->floID, n); - return( ProcExecutePhotoflo(client) ); -} - -int SProcModifyPhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieModifyPhotofloReq); - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xieModifyPhotofloReq); - swapl(&stuff->floID, n); - swaps(&stuff->start, n); - swaps(&stuff->numElements, n); - return( ProcModifyPhotoflo(client) ); -} - -int SProcRedefinePhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieRedefinePhotofloReq); - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xieRedefinePhotofloReq); - swapl(&stuff->floID, n); - swaps(&stuff->numElements, n); - return( ProcRedefinePhotoflo(client) ); -} - -int SProcAbort(ClientPtr client) -{ - register int n; - REQUEST(xieAbortReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieAbortReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - return( ProcAbort(client) ); -} - -int SProcAwait(ClientPtr client) -{ - register int n; - REQUEST(xieAwaitReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieAwaitReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - return( ProcAwait(client) ); -} - -int SProcGetClientData(ClientPtr client) -{ - register int n; - REQUEST(xieGetClientDataReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieGetClientDataReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - swapl(&stuff->maxBytes, n); - swaps(&stuff->element, n); - return( ProcGetClientData(client) ); -} - -int SProcPutClientData(ClientPtr client) -{ - register int n; - REQUEST(xiePutClientDataReq); - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xiePutClientDataReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - swaps(&stuff->element, n); - swapl(&stuff->byteCount, n); - return( ProcPutClientData(client) ); -} - -int SProcQueryPhotoflo(ClientPtr client) -{ - register int n; - REQUEST(xieQueryPhotofloReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieQueryPhotofloReq); - swapl(&stuff->nameSpace, n); - swapl(&stuff->floID, n); - return( ProcQueryPhotoflo(client) ); -} - -/* end module protoflo.c */ Index: xc/programs/Xserver/XIE/dixie/request/roi.c diff -u xc/programs/Xserver/XIE/dixie/request/roi.c:3.5 xc/programs/Xserver/XIE/dixie/request/roi.c:removed --- xc/programs/Xserver/XIE/dixie/request/roi.c:3.5 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/roi.c Sat Feb 28 21:41:58 2004 @@ -1,189 +0,0 @@ -/* $Xorg: roi.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** module roi.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - roi.c: Routines to manage region of interest protocol requests - - Dean Verheiden, AGE Logic, Inc., April 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/roi.c,v 3.5 2001/12/14 19:58:10 dawes Exp $ */ - -#define _XIEC_ROI - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Module Specific Includes - */ -#include -#include -#include -#include -#include - -/* - * routines referenced by other modules. - */ -extern int DeleteROI(roiPtr roi, xieTypROI id); - - -/*------------------------------------------------------------------------ ---------------------------- CreateROI Procedures ------------------------- -------------------------------------------------------------------------*/ -int ProcCreateROI(ClientPtr client) -{ - roiPtr roi; - REQUEST(xieCreateROIReq); - REQUEST_SIZE_MATCH(xieCreateROIReq); - LEGAL_NEW_RESOURCE(stuff->roi, client); - - /* create a new lookup table - */ - if( !(roi = (roiPtr) XieCalloc(sizeof(roiRec))) ) - return(client->errorValue = stuff->roi, BadAlloc); - - roi->ID = stuff->roi; - roi->refCnt = 1; - ListInit(&roi->strips); - - return( AddResource(roi->ID, RT_ROI, (roiPtr)roi) - ? Success : (client->errorValue = stuff->roi, BadAlloc) ); -} /* end ProcCreateROI */ - - -/*------------------------------------------------------------------------ ------------------------- DestroyROI Procedures -------------------------- -------------------------------------------------------------------------*/ -int ProcDestroyROI(ClientPtr client) -{ - roiPtr roi; - REQUEST( xieDestroyROIReq ); - REQUEST_SIZE_MATCH( xieDestroyROIReq ); - - if( !(roi = (roiPtr) LookupIDByType(stuff->roi, RT_ROI)) ) - return( SendResourceError(client, xieErrNoROI, stuff->roi) ); - - /* Disassociate the ROI from core X -- it calls DeleteROI() - */ - FreeResourceByType(stuff->roi, RT_ROI, RT_NONE); - - return(Success); -} /* end ProcDestroyROI */ - - -/*------------------------------------------------------------------------ ------------------------ deleteFunc: DeleteROI --------------------------- -------------------------------------------------------------------------*/ -int DeleteROI(roiPtr roi, xieTypROI id) -{ - if( --roi->refCnt ) - return(Success); - - FreeStrips(&roi->strips); - XieFree(roi); - - return(Success); -} /* end DeleteROI */ - -int SProcCreateROI(ClientPtr client) -{ - register int n; - REQUEST(xieCreateROIReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xieCreateROIReq); - swapl(&stuff->roi,n); - return (ProcCreateROI(client)); -} /* end SProcCreateROI */ - -int SProcDestroyROI(ClientPtr client) -{ - register int n; - REQUEST( xieDestroyROIReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieDestroyROIReq ); - swapl(&stuff->roi,n); - return (ProcDestroyROI(client)); -} /* end SProcDestroyROI */ - -/* end module ROI.c */ Index: xc/programs/Xserver/XIE/dixie/request/session.c diff -u xc/programs/Xserver/XIE/dixie/request/session.c:3.14 xc/programs/Xserver/XIE/dixie/request/session.c:removed --- xc/programs/Xserver/XIE/dixie/request/session.c:3.14 Fri Dec 14 14:58:10 2001 +++ xc/programs/Xserver/XIE/dixie/request/session.c Sat Feb 28 21:41:58 2004 @@ -1,347 +0,0 @@ -/* $Xorg: session.c,v 1.4 2001/02/09 02:04:22 xorgcvs Exp $ */ -/**** session.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - session.c: Initialization code for the XIE server. - - Dean Verheiden -- AGE Logic, Inc March, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/session.c,v 3.14 2001/12/14 19:58:10 dawes Exp $ */ - -#define _XIEC_SESSION - -#define NEED_EVENTS -#define NEED_REPLIES -#include "X.h" /* Needed for just about anything */ -#include "Xproto.h" /* defines protocol-related stuff */ -#include "misc.h" /* includes os.h, which type FatalError */ -#include "dixstruct.h" /* this picks up ClientPtr definition */ -#include "extnsionst.h" /* defines things like ExtensionEntry */ - -#include "XIE.h" -#include "XIEproto.h" /* Xie protocol specification */ -#include /* core X interface routine definitions */ -#include -#include /* server internal macros */ - -#include -#include /* extern def for technique_init */ - -/* function declarations */ -extern int SProcQueryImageExtension(ClientPtr client); -extern int ProcQueryImageExtension(ClientPtr client); - -static int XieDispatch(ClientPtr client), - SXieDispatch(ClientPtr client), - DeleteXieClient(pointer data, XID id); -static void XieReset (ExtensionEntry *extEntry); -static int DdxInit(void); - -#define REPORT_MEMORY_LEAKS -#ifdef REPORT_MEMORY_LEAKS -extern int ALLOCS; -extern int STRIPS; -extern int BYTES; -#endif - -ExtensionEntry *extEntry; -RESTYPE RC_XIE; /* XIE Resource Class */ -#if XIE_FULL -RESTYPE RT_COLORLIST; /* ColorList resource type */ -#endif -RESTYPE RT_LUT; /* Lookup table resource type */ -RESTYPE RT_PHOTOFLO; /* Photoflo resource type */ -RESTYPE RT_PHOTOMAP; /* Photomap resource type */ -RESTYPE RT_PHOTOSPACE; /* Photospace resource type */ -#if XIE_FULL -RESTYPE RT_ROI; /* Region Of Interest type */ -#endif -RESTYPE RT_XIE_CLIENT; /* XIE Type for Shutdown Notice */ - -struct _client_table { - XID Shutdown_id; - int (**proc_table)(ClientPtr); /* Table of version specific procedures */ - int (**sproc_table)(ClientPtr); - CARD16 minorVersion; - CARD16 pad; -} client_table[MAXCLIENTS]; - -void XieInit(void) -{ - ExtensionEntry *AddExtension(); - - /* Initialize XIE Resources */ - RC_XIE = CreateNewResourceClass(); -#if XIE_FULL - RT_COLORLIST = RC_XIE | CreateNewResourceType((DeleteType)DeleteColorList); -#endif - RT_LUT = RC_XIE | CreateNewResourceType((DeleteType)DeleteLUT); - RT_PHOTOFLO = RC_XIE | CreateNewResourceType((DeleteType)DeletePhotoflo); - RT_PHOTOMAP = RC_XIE | CreateNewResourceType((DeleteType)DeletePhotomap); - RT_PHOTOSPACE = RC_XIE | CreateNewResourceType((DeleteType)DeletePhotospace); -#if XIE_FULL - RT_ROI = RC_XIE | CreateNewResourceType((DeleteType)DeleteROI); -#endif - RT_XIE_CLIENT = RC_XIE | CreateNewResourceType((DeleteType)DeleteXieClient); - - - extEntry = AddExtension(xieExtName, /* extension name */ - xieNumEvents, /* number of events */ - xieNumErrors, /* number of errors */ - XieDispatch, /* Xie's dispatcher */ - SXieDispatch, /* Swapped dispatch */ - XieReset, /* Reset XIE stuff */ - StandardMinorOpcode /* choose opcode dynamically */ - ); - - if (extEntry == NULL) - FatalError(" could not add Xie as an extension\n"); - - /* Initialize client table */ - bzero((char *)client_table, sizeof(client_table)); - - if (!technique_init() || DdxInit() != Success) - FatalError(" could not add Xie as an extension\n"); - -} - -/**********************************************************************/ -/* Register client with core X under a FakeClientID */ -static int RegisterXieClient(ClientPtr client, CARD16 minor) -{ - client_table[client->index].Shutdown_id = FakeClientID(client->index); - client_table[client->index].minorVersion = minor; - - init_proc_tables(minor, - &(client_table[client->index].proc_table), - &(client_table[client->index].sproc_table)); - - /* Register the client with Core X for shutdown */ - return (AddResource(client_table[client->index].Shutdown_id, - RT_XIE_CLIENT, - &(client_table[client->index]))); -} - -/**********************************************************************/ -/* dispatcher for XIE opcodes */ -static int XieDispatch (ClientPtr client) -{ - REQUEST(xieReq); /* make "stuff" point to client's request buffer */ - - /* QueryImageExtension establishes a communication version */ - if (stuff->opcode == X_ieQueryImageExtension) - return (ProcQueryImageExtension(client)); - - /* First make sure that a communication version has been established */ - if (client_table[client->index].Shutdown_id == 0 && /* Pick a favorite */ - !RegisterXieClient(client, xieMinorVersion)) /* minor version */ - return ( BadAlloc ); - if (stuff->opcode > 0 && stuff->opcode <= xieNumProtoReq) - /* Index into version specific routines */ - return (CallProc(client)); - else - return ( BadRequest); -} - - -/**********************************************************************/ -/* dispatcher for swapped code */ -static int SXieDispatch (ClientPtr client) -{ - REQUEST(xieReq); /* make "stuff" point to client's request buffer */ - - /* QueryImageExtension establishes a communication version */ - if (stuff->opcode == X_ieQueryImageExtension) - return (SProcQueryImageExtension(client)); - - /* First make sure that a communication version has been established */ - if (client_table[client->index].Shutdown_id == 0 && /* Pick a favorite */ - !RegisterXieClient(client, xieMinorVersion)) /* minor version */ - return ( BadAlloc ); - if (stuff->opcode > 0 && stuff->opcode <= xieNumProtoReq) - /* Index into version specific routines */ - return (CallSProc(client)); - - else - return ( BadRequest); -} - -/**********************************************************************/ -int ProcQueryImageExtension(ClientPtr client) -{ - xieQueryImageExtensionReply reply; - XID FakeClientID(); - REQUEST(xieQueryImageExtensionReq); - REQUEST_SIZE_MATCH( xieQueryImageExtensionReq ); - - reply.type = X_Reply; - reply.sequenceNum = client->sequence; - - reply.majorVersion = xieMajorVersion; - - if (stuff->majorVersion != xieMajorVersion || -#if xieEarliestMinorVersion > 0 - stuff->minorVersion < xieEarliestMinorVersion || -#endif - stuff->minorVersion > xieLatestMinorVersion) - reply.minorVersion = xieMinorVersion; - else - reply.minorVersion = stuff->minorVersion; - - reply.length = sizeof(Preferred_levels)>>2; - -#if XIE_FULL - reply.serviceClass = xieValFull; -#else - reply.serviceClass = xieValDIS; -#endif - reply.alignment = ALIGNMENT; - reply.unconstrainedMantissa = UNCONSTRAINED_MANTISSA; - reply.unconstrainedMaxExp = UNCONSTRAINED_MAX_EXPONENT; - reply.unconstrainedMinExp = UNCONSTRAINED_MIN_EXPONENT; - - /* - If this is the first QueryImageExtension for this client, register fake_id - with Core X to get a closedown notification later - */ - if (client_table[client->index].Shutdown_id == 0) - if (!RegisterXieClient(client, reply.minorVersion)) - return ( BadAlloc ); - - /*** Take care of swapping bytes if necessary ***/ - if (client->swapped) { - register int n; - - swaps(&reply.sequenceNum,n); - swapl(&reply.length,n); - swaps(&reply.majorVersion,n); - swaps(&reply.minorVersion,n); - swaps(&reply.unconstrainedMantissa,n); - swapl(&reply.unconstrainedMaxExp,n); - swapl(&reply.unconstrainedMinExp,n); - } - WriteToClient(client,sz_xieQueryImageExtensionReply,(char*)&reply); - - /* - * Send the list of preferred levels (swapped as necessary) - */ - if(reply.length) - if(client->swapped) - CopySwap32Write(client,sizeof(Preferred_levels),Preferred_levels); - else - WriteToClient(client,sizeof(Preferred_levels),(char*)Preferred_levels); - - return(Success); -} - - -/**********************************************************************/ -int SProcQueryImageExtension(ClientPtr client) -{ - REQUEST(xieQueryImageExtensionReq); - register int n; - swaps(&stuff->length,n); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion, n); - return( ProcQueryImageExtension(client) ); -} - -/************************************************************************/ - -static int DdxInit(void) -{ - return Success; -} - -/**********************************************************************/ -/* Clean up routine */ -static int DeleteXieClient(pointer data, XID id) -{ - bzero((char *)&(client_table[CLIENT_ID(id)]), sizeof(struct _client_table)); - return 0; -} - -/**********************************************************************/ -/* reset the XIE code, eg, on reboot */ -static void XieReset (ExtensionEntry *extEntry) -{ -#ifdef REPORT_MEMORY_LEAKS - - /* memory leak debug code - */ - /* Initialize client table */ - bzero((char *)client_table, sizeof(client_table)); - if(ALLOCS) /* check on outstanding mallocs and callocs */ - ErrorF("XieReset: %d allocs still outstanding.\n", ALLOCS); - - if(STRIPS || BYTES) /* check on outstanding data manager allocs */ - ErrorF("XieReset: %d strips with %d data bytes still outstanding.\n", - STRIPS, BYTES); -#endif -} - -/**** End of session.c ****/ Index: xc/programs/Xserver/XIE/dixie/request/tables.c diff -u xc/programs/Xserver/XIE/dixie/request/tables.c:3.6 xc/programs/Xserver/XIE/dixie/request/tables.c:removed --- xc/programs/Xserver/XIE/dixie/request/tables.c:3.6 Fri Dec 14 14:58:11 2001 +++ xc/programs/Xserver/XIE/dixie/request/tables.c Sat Feb 28 21:41:58 2004 @@ -1,354 +0,0 @@ -/* $Xorg: tables.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** tables.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - tables.c: XIE vector tables - - Dean Verheiden, AGE Logic, Inc March 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/tables.c,v 3.6 2001/12/14 19:58:11 dawes Exp $ */ - -#define _XIEC_TABLES - -#define NEED_EVENTS -#define NEED_REPLIES -#include "X.h" /* Needed for just about anything */ -#include "Xproto.h" /* defines protocol-related stuff */ -#include "misc.h" /* includes os.h, which type FatalError */ -#include "dixstruct.h" /* this picks up ClientPtr definition */ - -#include "XIE.h" -#include "XIEproto.h" /* Xie v4 protocol specification */ -#include /* interface to core X definitions */ -#include -#include -#include - - -/*------------------------------------------------------------------------ ------------------------- Procedure Not Implemented ----------------------- -------------------------------------------------------------------------*/ -static int ProcNotImplemented(ClientPtr client) -{ - return( BadRequest ); -} /* end ProcNotImplemented */ - - -/*------------------------------------------------------------------------ ----------------- Error stub for unsupported element types ---------------- -------------------------------------------------------------------------*/ -static peDefPtr ElementNotImplemented( - floDefPtr flo, - xieTypPhototag tag, - xieFlo *pe) -{ - FloElementError(flo,tag,pe->elemType, return(NULL)); -} - -/*------------------------------------------------------------------------ ----------------- Array of DD entry points called from DI ---------------- -------------------------------------------------------------------------*/ -/* Very rarely, a device independent routine needs to access device dependent - code. Interface through this array. -*/ -xieVoidProc DDInterface[] = { - (xieVoidProc)DAGalyze, - (xieVoidProc)GetServerChoice -}; - - -#if XIE_FULL -static int (*ProcTable5_00[])(ClientPtr) = { -/* 00 */ ProcNotImplemented, /* Illegal protocol request */ -/* 01 */ ProcNotImplemented, /* QueryImageExtension doesn't use the table */ -/* 02 */ ProcQueryTechniques, -/* 03 */ ProcCreateColorList, -/* 04 */ ProcDestroyColorList, -/* 05 */ ProcPurgeColorList, -/* 06 */ ProcQueryColorList, -/* 07 */ ProcCreateLUT, -/* 08 */ ProcDestroyLUT, -/* 09 */ ProcCreatePhotomap, -/* 10 */ ProcDestroyPhotomap, -/* 11 */ ProcQueryPhotomap, -/* 12 */ ProcCreateROI, -/* 13 */ ProcDestroyROI, -/* 14 */ ProcCreatePhotospace, -/* 15 */ ProcDestroyPhotospace, -/* 16 */ ProcExecuteImmediate, -/* 17 */ ProcCreatePhotoflo, -/* 18 */ ProcDestroyPhotoflo, -/* 19 */ ProcExecutePhotoflo, -/* 20 */ ProcModifyPhotoflo, -/* 21 */ ProcRedefinePhotoflo, -/* 22 */ ProcPutClientData, -/* 23 */ ProcGetClientData, -/* 24 */ ProcQueryPhotoflo, -/* 25 */ ProcAwait, -/* 26 */ ProcAbort - }; - -static int (*SProcTable5_00[])(ClientPtr) = { -/* 00 */ ProcNotImplemented, /* Illegal protocol request */ -/* 01 */ ProcNotImplemented, /* QueryImageExtension doesn't use the table */ -/* 02 */ SProcQueryTechniques, -/* 03 */ SProcCreateColorList, -/* 04 */ SProcDestroyColorList, -/* 05 */ SProcPurgeColorList, -/* 06 */ SProcQueryColorList, -/* 07 */ SProcCreateLUT, -/* 08 */ SProcDestroyLUT, -/* 09 */ SProcCreatePhotomap, -/* 10 */ SProcDestroyPhotomap, -/* 11 */ SProcQueryPhotomap, -/* 12 */ SProcCreateROI, -/* 13 */ SProcDestroyROI, -/* 14 */ SProcCreatePhotospace, -/* 15 */ SProcDestroyPhotospace, -/* 16 */ SProcExecuteImmediate, -/* 17 */ SProcCreatePhotoflo, -/* 18 */ SProcDestroyPhotoflo, -/* 19 */ SProcExecutePhotoflo, -/* 20 */ SProcModifyPhotoflo, -/* 21 */ SProcRedefinePhotoflo, -/* 22 */ SProcPutClientData, -/* 23 */ SProcGetClientData, -/* 24 */ SProcQueryPhotoflo, -/* 25 */ SProcAwait, -/* 26 */ SProcAbort - }; - -peDefPtr (*MakeTable[])( - floDefPtr flo, - xieTypPhototag tag, - xieFlo *pe) = { -/* 00 */ ElementNotImplemented, -/* 01 */ MakeICLUT, -/* 02 */ MakeICPhoto, -/* 03 */ MakeICROI, -/* 04 */ MakeIDraw, -/* 05 */ MakeIDrawP, -/* 06 */ MakeILUT, -/* 07 */ MakeIPhoto, -/* 08 */ MakeIROI, -/* 09 */ MakeArith, -/* 10 */ MakeBandCom, -/* 11 */ MakeBandExt, -/* 12 */ MakeBandSel, -/* 13 */ MakeBlend, -/* 14 */ MakeCompare, -/* 15 */ MakeConstrain, -/* 16 */ MakeConvertFromIndex, -/* 17 */ MakeConvertFromRGB, -/* 18 */ MakeConvertToIndex, -/* 19 */ MakeConvertToRGB, -/* 20 */ MakeConvolve, -/* 21 */ MakeDither, -/* 22 */ MakeGeometry, -/* 23 */ MakeLogic, -/* 24 */ MakeMatchHistogram, -/* 25 */ MakeMath, -/* 26 */ MakePasteUp, -/* 27 */ MakePoint, -/* 28 */ MakeUnconstrain, -/* 29 */ MakeECHistogram, -/* 30 */ MakeECLUT, -/* 31 */ MakeECPhoto, -/* 32 */ MakeECROI, -/* 33 */ MakeEDraw, -/* 34 */ MakeEDrawPlane, -/* 35 */ MakeELUT, -/* 36 */ MakeEPhoto, -/* 37 */ MakeEROI - }; - -#else /* XIEdis */ - -static int (*ProcTable5_00[])() = { -/* 00 */ ProcNotImplemented, /* Illegal protocol request */ -/* 01 */ ProcNotImplemented, /* QueryImageExtension doesn't use the table */ -/* 02 */ ProcQueryTechniques, -/* 03 */ ProcNotImplemented, /* CreateColorList */ -/* 04 */ ProcNotImplemented, /* DestroyColorList */ -/* 05 */ ProcNotImplemented, /* PurgeColorList */ -/* 06 */ ProcNotImplemented, /* QueryColorList */ -/* 07 */ ProcCreateLUT, -/* 08 */ ProcDestroyLUT, -/* 09 */ ProcCreatePhotomap, -/* 10 */ ProcDestroyPhotomap, -/* 11 */ ProcQueryPhotomap, -/* 12 */ ProcNotImplemented, /* CreateROI */ -/* 13 */ ProcNotImplemented, /* DestroyROI */ -/* 14 */ ProcCreatePhotospace, -/* 15 */ ProcDestroyPhotospace, -/* 16 */ ProcExecuteImmediate, -/* 17 */ ProcCreatePhotoflo, -/* 18 */ ProcDestroyPhotoflo, -/* 19 */ ProcExecutePhotoflo, -/* 20 */ ProcModifyPhotoflo, -/* 21 */ ProcRedefinePhotoflo, -/* 22 */ ProcPutClientData, -/* 23 */ ProcGetClientData, -/* 24 */ ProcQueryPhotoflo, -/* 25 */ ProcAwait, -/* 26 */ ProcAbort - }; - -static int (*SProcTable5_00[])() = { -/* 00 */ ProcNotImplemented, /* Illegal protocol request */ -/* 01 */ ProcNotImplemented, /* QueryImageExtension doesn't use the table */ -/* 02 */ SProcQueryTechniques, -/* 03 */ ProcNotImplemented, /* CreateColorList */ -/* 04 */ ProcNotImplemented, /* DestroyColorList */ -/* 05 */ ProcNotImplemented, /* PurgeColorList */ -/* 06 */ ProcNotImplemented, /* QueryColorList */ -/* 07 */ SProcCreateLUT, -/* 08 */ SProcDestroyLUT, -/* 09 */ SProcCreatePhotomap, -/* 10 */ SProcDestroyPhotomap, -/* 11 */ SProcQueryPhotomap, -/* 12 */ ProcNotImplemented, /* CreateROI */ -/* 13 */ ProcNotImplemented, /* DestroyROI */ -/* 14 */ SProcCreatePhotospace, -/* 15 */ SProcDestroyPhotospace, -/* 16 */ SProcExecuteImmediate, -/* 17 */ SProcCreatePhotoflo, -/* 18 */ SProcDestroyPhotoflo, -/* 19 */ SProcExecutePhotoflo, -/* 20 */ SProcModifyPhotoflo, -/* 21 */ SProcRedefinePhotoflo, -/* 22 */ SProcPutClientData, -/* 23 */ SProcGetClientData, -/* 24 */ SProcQueryPhotoflo, -/* 25 */ SProcAwait, -/* 26 */ SProcAbort - }; - -peDefPtr (*MakeTable[])() = { -/* 00 */ ElementNotImplemented, -/* 01 */ MakeICLUT, -/* 02 */ MakeICPhoto, -/* 03 */ ElementNotImplemented, /* ICROI */ -/* 04 */ MakeIDraw, -/* 05 */ MakeIDrawP, -/* 06 */ MakeILUT, -/* 07 */ MakeIPhoto, -/* 08 */ ElementNotImplemented, /* IROI */ -/* 09 */ ElementNotImplemented, /* Arith */ -/* 10 */ ElementNotImplemented, /* BandCom */ -/* 11 */ ElementNotImplemented, /* BandExt */ -/* 12 */ ElementNotImplemented, /* BandSel */ -/* 13 */ ElementNotImplemented, /* Blend */ -/* 14 */ ElementNotImplemented, /* Compare */ -/* 15 */ ElementNotImplemented, /* Constrain */ -/* 16 */ ElementNotImplemented, /* ConvertFromIndex */ -/* 17 */ ElementNotImplemented, /* ConvertFromRGB */ -/* 18 */ ElementNotImplemented, /* ConvertToIndex */ -/* 19 */ ElementNotImplemented, /* ConvertToRGB */ -/* 20 */ ElementNotImplemented, /* Convolve */ -/* 21 */ ElementNotImplemented, /* Dither */ -/* 22 */ MakeGeometry, -/* 23 */ ElementNotImplemented, /* Logic */ -/* 24 */ ElementNotImplemented, /* MatchHistogram */ -/* 25 */ ElementNotImplemented, /* Math */ -/* 26 */ ElementNotImplemented, /* PasteUp */ -/* 27 */ MakePoint, -/* 28 */ ElementNotImplemented, /* Unconstrain */ -/* 29 */ ElementNotImplemented, /* ECHistogram */ -/* 30 */ MakeECLUT, -/* 31 */ MakeECPhoto, -/* 32 */ ElementNotImplemented, /* ECROI */ -/* 33 */ MakeEDraw, -/* 34 */ MakeEDrawPlane, -/* 35 */ MakeELUT, -/* 36 */ MakeEPhoto, -/* 37 */ ElementNotImplemented /* EROI */ - }; -#endif - -/************************************************************************ - Fill in the version specific tables for the selected minor protocol - version -************************************************************************/ -void init_proc_tables( - CARD16 minorVersion, - int (**ptable[])(ClientPtr), - int (**sptable[])(ClientPtr)) -{ - /* Kind of boring with only one version to work with */ - switch (minorVersion) { - case 0: - *ptable = ProcTable5_00; - *sptable = SProcTable5_00; - break; - default: - *ptable = ProcTable5_00; - *sptable = SProcTable5_00; - } -} - -/* end module tables.c */ Index: xc/programs/Xserver/XIE/dixie/request/technq.c diff -u xc/programs/Xserver/XIE/dixie/request/technq.c:3.7 xc/programs/Xserver/XIE/dixie/request/technq.c:removed --- xc/programs/Xserver/XIE/dixie/request/technq.c:3.7 Fri Dec 14 14:58:11 2001 +++ xc/programs/Xserver/XIE/dixie/request/technq.c Sat Feb 28 21:41:58 2004 @@ -1,360 +0,0 @@ -/* $Xorg: technq.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module technq.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -**************************************************************************** - technq.c: Routines to handle technique protocol requests - - Dean Verheiden AGE Logic, Inc. April 1993 -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/dixie/request/technq.c,v 3.7 2001/12/14 19:58:11 dawes Exp $ */ - -#define _XIEC_TECHNQ - -/* - A Note on Technique Etiquette: - - To change technique defaults, or add new techniques or technique - groups, don't edit this file. Make the appropriate changes to the technq.h - file. - - If the changes result in the creation of a new default technique or - allow a technique to use default parameters, it is also necessary that - the corresponding technique copy function be updated to supply default - parameters should they be required. -*/ - - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include - -/* - * Element Specific Includes - */ -#include -#include -#include -#include -#include - -/* - * Used internally by this module - */ -static Bool send_reply(xieTypTechniqueGroup group, TechPtr tech, ClientPtr client); -static Bool send_technique_replies(xieTypTechniqueGroup group, ClientPtr client); - -/*------------------------------------------------------------------------ ------------------------- QueryTechniques Procedures ----------------------- -------------------------------------------------------------------------*/ -int ProcQueryTechniques(ClientPtr client) -{ - xieQueryTechniquesReply rep; - REQUEST( xieQueryTechniquesReq ); - REQUEST_SIZE_MATCH( xieQueryTechniquesReq ); - - /* - * Fill in the reply header - */ - bzero((char *)&rep, sz_xieQueryTechniquesReply); - rep.type = X_Reply; - rep.sequenceNum = client->sequence; - - /* First, figure out how big the ListofTechniqueRecs is going to be */ - if (stuff->techniqueGroup == xieValDefault) { - rep.numTechniques = techTable.numDefaults; - rep.length = techTable.defaultSize; - } else if (stuff->techniqueGroup == xieValAll) { - rep.numTechniques = techTable.numTechniques; - rep.length = techTable.tableSize; - } else { - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) - if (stuff->techniqueGroup == tg->group) { - rep.numTechniques = tg->numTechniques; - rep.length = tg->groupSize; - break; - } - - if (g >= techTable.numGroups) /* Couldn't find the group */ - return(BadValue); - } - - if( client->swapped ) { - /* - * Swap the reply header fields - */ - register int n; - - swaps(&rep.sequenceNum,n); - swapl(&rep.length,n); - swaps(&rep.numTechniques,n); - } - - WriteToClient(client, sz_xieQueryTechniquesReply, (char *)&rep); - - send_technique_replies(stuff->techniqueGroup,client); - - return(Success); -} /* end ProcQueryTechniques */ - -int SProcQueryTechniques(ClientPtr client) -{ - register int n; - REQUEST( xieQueryTechniquesReq ); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH( xieQueryTechniquesReq ); - return (ProcQueryTechniques(client)); -} /* end SProcQueryTechniques */ - -/************************************************************************* - Initialization Procedure: Fill in various technique fields -*************************************************************************/ - -Bool technique_init(void) -{ - CARD32 defaultSize = 0; - CARD32 tableSize = 0; - CARD32 numTechniques = 0; - CARD32 numDefaults = 0; - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) { - TechPtr tp = tg->tech; - CARD16 defaultNumber = tg->defaultNumber; - Bool needDefault = (defaultNumber != NO_DEFAULT); - CARD32 groupSize = 0; - int t; - - for (t = 0; t < tg->numTechniques; t++, tp++) { - tp->nameLength = strlen((char *)(tp->name)); - tp->techSize = (sizeof(xieTypTechniqueRec) + tp->nameLength + 3) - >> 2; - groupSize += tp->techSize; - if (needDefault && defaultNumber == tp->techvec.number) { - tg->defaultIndex = t; - defaultSize += tp->techSize; - numDefaults++; - needDefault = FALSE; - } - } - if (needDefault) return (FALSE); - tg->groupSize = groupSize; - tableSize += groupSize; - numTechniques += tg->numTechniques; - } - - techTable.numTechniques = numTechniques; - techTable.numDefaults = numDefaults; - techTable.tableSize = tableSize; - techTable.defaultSize = defaultSize; - - return (TRUE); -} /* end technique_init */ - -/************************************************************************* - Send Technique Reply: send technique structures to client, one at a time, - swapping them first if necessary -*************************************************************************/ - -static Bool send_reply( - xieTypTechniqueGroup group, - TechPtr tech, - ClientPtr client) -{ - xieTypTechniqueRec rep; - - rep.needsParam = !(tech->techvec.NoTech || tech->techvec.OptionalTech); - rep.group = group; - rep.number = (client->swapped) ? lswaps(tech->techvec.number) : - tech->techvec.number; - rep.speed = tech->speed; - rep.nameLength = tech->nameLength; - - /* Send everything except the name */ - WriteToClient(client, sz_xieTypTechniqueRec, (char *)&rep); - /* Send the name */ - WriteToClient(client, tech->nameLength, (char *)tech->name); - - return(TRUE); -} - -static Bool send_technique_replies( - xieTypTechniqueGroup group, - ClientPtr client) -{ - if (group == xieValDefault) { - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) - if (tg->defaultNumber != NO_DEFAULT) - send_reply(tg->group,&tg->tech[tg->defaultIndex],client); - return (TRUE); - } else if (group == xieValAll) { - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) { - TechPtr tp = tg->tech; - int t = 0; - - for (t = 0; t < tg->numTechniques; t++, tp++) - send_reply(tg->group,tp,client); - } - return (TRUE); - } else { - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) - if (group == tg->group) { - TechPtr tp = tg->tech; - int t = 0; - - for (t = 0; t < tg->numTechniques; t++, tp++) - send_reply(group,tp,client); - - return(TRUE); - } - } - - return(FALSE); /* Unrecognized group */ -} /* end return_technique_replies */ - -/************************************************************************* -FindTechnique: return group's technique entry point structure -*************************************************************************/ -techVecPtr FindTechnique( - xieTypTechniqueGroup group, - CARD16 number) -{ - TechGroupPtr tg = techTable.techgroups; - int g; - - for (g = 0; g < techTable.numGroups; g++, tg++) - if (group == tg->group) { - TechPtr tp = tg->tech; - int t = 0; - - if (number == xieValDefault) { - if (tg->defaultNumber) - return (&tg->tech[tg->defaultIndex].techvec); - else - return((techVecPtr)NULL); /* No default for this group */ - } else { - for (t = 0; t < tg->numTechniques; t++, tp++) - if (tp->techvec.number == number) - return (&tp->techvec); - } - } - - return((techVecPtr)NULL); /* Unrecognized group */ -} /* end FindTechnique */ - -/************************************************************************* -NoParamCheck: Used as copyfnc for techniques that do not have parameters. - Checks to make sure that no parameters have been passed in. -*************************************************************************/ -static Bool NoParamCheck( - floDefPtr flo, - pointer rparms, - pointer cparms, - CARD16 tsize) -{ - return(!tsize); -} /* end NoParamCheck */ - -/************************************************************************* -NoTechYet: error stub for unimplemented technique routines -*************************************************************************/ -static Bool NoTechYet( - floDefPtr flo, - peDefPtr ped, - pointer parm, - pointer tech) -{ - return(FALSE); -} /* end NoTechYet */ - -/* end module technq.c */ Index: xc/programs/Xserver/XIE/include/colorlst.h diff -u xc/programs/Xserver/XIE/include/colorlst.h:1.2 xc/programs/Xserver/XIE/include/colorlst.h:removed --- xc/programs/Xserver/XIE/include/colorlst.h:1.2 Fri Dec 14 14:58:12 2001 +++ xc/programs/Xserver/XIE/include/colorlst.h Sat Feb 28 21:41:58 2004 @@ -1,94 +0,0 @@ -/* $Xorg: colorlst.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** colorlst.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - colorlst.h -- contains color list specific definitions - - Robert NC Shelley -- AGE Logic, Inc. March 1993 - -******************************************************************************/ - -#ifndef _XIEH_COLORLST -#define _XIEH_COLORLST - -/* colorlist structure definition - */ -typedef struct _colorlist { - xieTypColorList ID; - INT32 refCnt; - ClientPtr client; - Colormap mapID; - ColormapPtr mapPtr; - CARD32 cellCnt; - Pixel *cellPtr; -} colorListRec, *colorListPtr; - -#ifndef _XIEC_COLORLST -extern colorListPtr LookupColorList(); -extern void ResetColorList(); -#endif - -#endif /* end _XIEH_COLORLST */ Index: xc/programs/Xserver/XIE/include/corex.h diff -u xc/programs/Xserver/XIE/include/corex.h:1.5 xc/programs/Xserver/XIE/include/corex.h:removed --- xc/programs/Xserver/XIE/include/corex.h:1.5 Fri Dec 14 14:58:12 2001 +++ xc/programs/Xserver/XIE/include/corex.h Sat Feb 28 21:41:58 2004 @@ -1,163 +0,0 @@ -/* $Xorg: corex.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module corex.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - corex.h - Xie server interface (for hooking to Core X) - - Dean Verheiden -- AGE Logic, Inc. April, 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/corex.h,v 1.5 2001/12/14 19:58:12 dawes Exp $ */ - -#ifndef _XIEH_COREX -#define _XIEH_COREX - -#include - -/* temporary hack: - * - * XIE is suppose to support single-band images up to the depth - * of the deepest drawable supported by the server -- but not less than 16. - * Triple-band data should never be more than 16 bits. - * - * Later releases will compute the correct value, but it will not exceed 24 - * in the sample implementation. (eeeck, sounds like a global variable..) - */ - -#define MAX_SINGLE 24 -#define MAX_TRIPLE 16 -#define MAX_DEPTH(nbands) (nbands > 1 ? MAX_TRIPLE : MAX_SINGLE) -#define MAX_LEVELS(nbands) (nbands > 1 ? (1< - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* - * Interfaces of XIE/dixie/export - */ - -#ifndef _XIEH_DIXIE_EXPORT -#define _XIEH_DIXIE_EXPORT 1 - -#include -#include -#include /* declares xieFloEvn */ -#include -#include -#include - -/* echist.h */ -extern peDefPtr MakeECHistogram(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* eclut.c */ -extern peDefPtr MakeECLUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ecphoto.h */ -peDefPtr MakeECPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ecroi.c */ -extern peDefPtr MakeECROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* edraw.c */ -extern peDefPtr MakeEDraw(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); -extern Bool DrawableAndGC( - floDefPtr flo, - peDefPtr ped, - Drawable draw_id, - GContext gc_id, - DrawablePtr *draw_ret, - GCPtr *gc_ret); - -/* edrawp.c */ -extern peDefPtr MakeEDrawPlane(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* elut.h */ -extern peDefPtr MakeELUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ephoto.h */ -extern peDefPtr MakeEPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); -extern Bool BuildDecodeFromEncode(floDefPtr flo, peDefPtr ped); -extern Bool CompareDecode(floDefPtr flo, peDefPtr ped); - -/* eroi.c */ -extern peDefPtr MakeEROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -#endif /* _XIEH_DIXIE_EXPORT */ Index: xc/programs/Xserver/XIE/include/dixie_i.h diff -u xc/programs/Xserver/XIE/include/dixie_i.h:1.1 xc/programs/Xserver/XIE/include/dixie_i.h:removed --- xc/programs/Xserver/XIE/include/dixie_i.h:1.1 Sun Oct 25 02:11:45 1998 +++ xc/programs/Xserver/XIE/include/dixie_i.h Sat Feb 28 21:41:58 2004 @@ -1,72 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/XIE/include/dixie_i.h,v 1.1 1998/10/25 07:11:45 dawes Exp $ - */ - -/************************************************************ - -Copyright 1998 by Thomas E. Dickey - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* - * Interfaces of XIE/dixie/import - */ - -#ifndef _XIEH_DIXIE_IMPORT -#define _XIEH_DIXIE_IMPORT 1 - -#include - -#include -#include /* declares xieFloEvn */ -#include -#include -#include -#include - -/* iclut.h */ -extern peDefPtr MakeICLUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* icphoto.h */ -extern peDefPtr MakeICPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* icroi.h */ -extern peDefPtr MakeICROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* idraw.h */ -extern peDefPtr MakeIDraw(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* idrawp.h */ -extern peDefPtr MakeIDrawP(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ilut.h */ -extern peDefPtr MakeILUT(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* iphoto.h */ -extern peDefPtr MakeIPhoto(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); -extern photomapPtr GetImportPhotomap(peDefPtr ped); -extern pointer GetImportTechnique(peDefPtr ped, CARD16 *num_ret, CARD16 *len_ret); - -/* iroi.h */ -extern peDefPtr MakeIROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -#endif /* _XIEH_DIXIE_IMPORT */ Index: xc/programs/Xserver/XIE/include/dixie_p.h diff -u xc/programs/Xserver/XIE/include/dixie_p.h:1.1 xc/programs/Xserver/XIE/include/dixie_p.h:removed --- xc/programs/Xserver/XIE/include/dixie_p.h:1.1 Sun Oct 25 02:11:45 1998 +++ xc/programs/Xserver/XIE/include/dixie_p.h Sat Feb 28 21:41:58 2004 @@ -1,106 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/XIE/include/dixie_p.h,v 1.1 1998/10/25 07:11:45 dawes Exp $ - */ - -/************************************************************ - -Copyright 1998 by Thomas E. Dickey - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* - * Interfaces of XIE/dixie/process - */ - -#ifndef _XIEH_DIXIE_PROCESS -#define _XIEH_DIXIE_PROCESS 1 - -#include -#include -#include /* declares xieFloEvn */ -#include -#include -#include - -/* parith.c */ -extern peDefPtr MakeArith(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pbandc.c */ -extern peDefPtr MakeBandCom(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pbande.c */ -extern peDefPtr MakeBandExt(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pbands.c */ -extern peDefPtr MakeBandSel(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pblend.c */ -extern peDefPtr MakeBlend(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pcfrgb.c */ -extern peDefPtr MakeConvertFromRGB(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pcfromi.c */ -extern peDefPtr MakeConvertFromIndex(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pcnst.c */ -extern peDefPtr MakeConstrain(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pcomp.c */ -extern peDefPtr MakeCompare(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pconv.c */ -extern peDefPtr MakeConvolve(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pctoi.c */ -extern peDefPtr MakeConvertToIndex(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pctrgb.c */ -extern peDefPtr MakeConvertToRGB(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); -extern void copy_floats(double *doubles_out, xieTypFloat *funny_floats_in, int cnt); -extern void swap_floats(double *doubles_out, xieTypFloat *funny_floats_in, int cnt); - -/* pdither.c */ -extern peDefPtr MakeDither(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pgeom.c */ -extern peDefPtr MakeGeometry(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* phist.c */ -extern peDefPtr MakeMatchHistogram(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* plogic.c */ -extern peDefPtr MakeLogic(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* pmath.c */ -extern peDefPtr MakeMath(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ppaste.c */ -extern peDefPtr MakePasteUp(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* ppoint.c */ -extern peDefPtr MakePoint(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -/* puncst.c */ -extern peDefPtr MakeUnconstrain(floDefPtr flo, xieTypPhototag tag, xieFlo *pe); - -#endif /* _XIEH_DIXIE_PROCESS */ Index: xc/programs/Xserver/XIE/include/element.h diff -u xc/programs/Xserver/XIE/include/element.h:1.2 xc/programs/Xserver/XIE/include/element.h:removed --- xc/programs/Xserver/XIE/include/element.h:1.2 Fri Dec 14 14:58:12 2001 +++ xc/programs/Xserver/XIE/include/element.h Sat Feb 28 21:41:58 2004 @@ -1,475 +0,0 @@ -/* $Xorg: element.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/* module element.h */ -/***************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - element.h -- device independent definitions for elements - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ - - -#ifndef _XIEH_ELEMENT -#define _XIEH_ELEMENT - -#include - -/* - * Generic Definitions - */ -#define SRCtag 0 /* inFlo index for src of single input elements */ -#define SRCt1 0 /* inFlo index for src1 of multi-input elements */ -#define SRCt2 1 /* inFlo index for src2 of multi-input elements */ -#define SRCt3 2 /* inFlo index for src3 of multi-input elements */ -#define LUTtag 1 /* inFlo index for lut input of point element */ - /* inFlo index for alpha stored in private structure*/ - /* inFlo index for domain input is inFloCnt - 1 */ - -#define IMPORT 0 /* inFlo index for "imported" data */ - - -#if defined(_XIEC_IDRAW) || defined(_XIEC_IDRAWP) -/* - * dixie element-private data for the ImportDrawable and ImportDrawablePlane - * elements - */ -typedef struct _idrawdef { - CARD32 pvtBytes; - DrawablePtr pDraw; -} iDrawDefRec, *iDrawDefPtr; -#endif /* _XIEC_IDRAW || _XIEC_IDRAWP */ - -#if defined(_XIEC_ILUT) -/* - * dixie element-private data for the ImportLUT element - */ -typedef struct _ilutdef { - CARD32 pvtBytes; - lutPtr lut; -} iLUTDefRec, *iLUTDefPtr; -#endif /* _XIEC_ILUT */ - -#if defined(_XIEC_IPHOTO) -/* - * dixie element-private data for the ImportPhotomap element - */ -typedef struct _iphotodef { - CARD32 pvtBytes; - photomapPtr map; -} iPhotoDefRec, *iPhotoDefPtr; -#endif /* _XIEC_IPHOTO */ - -#if defined(_XIEC_IROI) -/* - * dixie element-private data for the ImportROI element - */ -typedef struct _iroidef { - CARD32 pvtBytes; - roiPtr roi; -} iROIDefRec, *iROIDefPtr; -#endif /* _XIEC_IROI */ - -#if defined(_XIEC_PARITH) -/* - * dixie element-private data for the Arithmetic element - */ -typedef struct _parith { - CARD32 pvtBytes; - double constant[xieValMaxBands]; -} pArithDefRec, *pArithDefPtr; -#endif /* _XIEC_PARITH */ - -#if defined(_XIEC_PBANDE) -/* - * dixie element-private data for the band extract element - */ -typedef struct _pbandext { - CARD32 pvtBytes; - double coef[3]; - double bias; -} pBandExtDefRec, *pBandExtDefPtr; -#endif /* _XIEC_PBANDE */ - -#if defined(_XIEC_PBLEND) -/* - * dixie element-private data for the Arithmetic element - */ -typedef struct _pblend { - CARD32 pvtBytes; - CARD16 aindex; /* if non zero, index of alpha plane */ - CARD16 dindex; /* if non zero, index of proc domain */ - double constant[xieValMaxBands]; - double alphaConst; -} pBlendDefRec, *pBlendDefPtr; -#endif /* _XIEC_PBLEND */ - -#if defined(_XIEC_PCFRGB) -/* - * dixie element-private technique data for the ConvertFromRGB element - */ -typedef struct _ptecRBGtoCIELab_and_XYZdef { - double matrix[9]; - double whitePoint[3]; /* Optional whitePoint correction*/ - techVecPtr whiteTec; - xieTypWhiteAdjustTechnique whiteAdjusted; - CARD16 lenWhiteParams;/* Length for whitePoint params */ -} pTecRGBToCIEDefRec, *pTecRGBToCIEDefPtr; - -typedef struct _ptecRGBToYCbCr { - CARD32 levels0; - CARD32 levels1; - CARD32 levels2; - double red; - double green; - double blue; - double bias0; - double bias1; - double bias2; -} pTecRGBToYCbCrDefRec, *pTecRGBToYCbCrDefPtr; - -typedef struct _ptecRGBToYCC { - CARD32 levels0; - CARD32 levels1; - CARD32 levels2; - double red; - double green; - double blue; - double scale; -} pTecRGBToYCCDefRec, *pTecRGBToYCCDefPtr; - -#endif /* _XIEC_PCFRGB */ - -#if defined(_XIEC_PCFROMI) -/* - * dixie element-private data for the ConvertFromIndex element - */ -typedef struct _pcfromidef { - CARD32 pvtBytes; - ColormapPtr cmap; - VisualPtr visual; - CARD16 class; - CARD16 cells; - CARD32 pixMsk[3]; - CARD8 pixPos[3]; - CARD8 precShift; -} pCfromIDefRec, *pCfromIDefPtr; -#endif /* _XIEC_PCFROMI */ - -#if defined(_XIEC_PCNST) -/* - * dixie element-private data for the Constrain element - */ -typedef struct _pcnst { - double input_low[3]; - double input_high[3]; - CARD32 output_low[3]; - CARD32 output_high[3]; -} pCnstDefRec, *pCnstDefPtr; -#endif /* _XIEC_PCNST */ - -#if defined(_XIEC_PCOMP) -/* - * dixie element-private data for the Arithmetic element - */ -typedef struct _pcompare { - CARD32 pvtBytes; - double constant[xieValMaxBands]; -} pCompareDefRec, *pCompareDefPtr; -#endif /* _XIEC_PCOMP */ - -#if defined(_XIEC_PCONV) -/* - * constant technique private data for the Convolve element - */ -#define ConvFloat float - -typedef struct _pconv { - ConvFloat constant[3]; -} pTecConvolveConstantDefRec, *pTecConvolveConstantDefPtr; -#endif /* _XIEC_PCONV */ - -#if defined(_XIEC_PCTOI) -/* - * dixie element-private data for the ConvertToIndex element - */ -typedef struct _pctoidef { - CARD32 pvtBytes; - colorListPtr list; - ColormapPtr cmap; - VisualPtr visual; - CARD32 mask[3]; - CARD16 cells; - CARD8 shft[3]; - CARD8 class; - CARD8 depth; - CARD8 stride; - BOOL graySrc; - BOOL dynamic; - BOOL preFmt; - BOOL doHist; - CARD32 levels[3]; -} pCtoIDefRec, *pCtoIDefPtr; - -typedef struct _pTecConvertToIndexMatchdef { - CARD32 pvtBytes; - double matchLimit; - double grayLimit; -} pTecConvertToIndexMatchDefRec, *pConvertToIndexMatchDefPtr; - -typedef struct _ptecctoi { - CARD32 fill; - BOOL defTech; -} pTecCtoIDefRec, *pTecCtoIDefPtr; - -#endif /* _XIEC_PCTOI */ - -#if defined(_XIEC_PCTRGB) -/* - * dixie element-private technique data for the ConvertToRGB element - */ -typedef struct _ptecCIELab_and_XYZtoRGBdef { - double matrix[9]; - double whitePoint[3]; /* Optional whitePoint correction*/ - techVecPtr whiteTec; - xieTypWhiteAdjustTechnique whiteAdjusted; - CARD16 lenWhiteParams;/* Length for whitePoint params */ - techVecPtr gamutTec; - xieTypGamutTechnique gamutCompress; - CARD16 lenGamutParams;/* Length for gamut params */ -} pTecCIEToRGBDefRec, *pTecCIEToRGBDefPtr; - -typedef struct _ptecYCCToRGB { - CARD32 levels0; - CARD32 levels1; - CARD32 levels2; - double red; - double green; - double blue; - double scale; - techVecPtr gamutTec; - xieTypGamutTechnique gamutCompress; - CARD16 lenGamutParams;/* Length for gamut params */ -} pTecYCCToRGBDefRec, *pTecYCCToRGBDefPtr; - -typedef struct _ptecYCbCrToRGB { - CARD32 levels0; - CARD32 levels1; - CARD32 levels2; - double red; - double green; - double blue; - double bias0; - double bias1; - double bias2; - techVecPtr gamutTec; - xieTypGamutTechnique gamutCompress; - CARD16 lenGamutParams;/* Length for gamut params */ -} pTecYCbCrToRGBDefRec, *pTecYCbCrToRGBDefPtr; - -#endif /* _XIEC_PCTRGB */ - - -#if defined(_XIEC_PGEOM) -/* - * dixie element-private data for the Geoemtry element - */ -typedef struct _geom_elem { - double coeffs[6]; - double constant[xieValMaxBands]; - int do_band[3]; -} pGeomDefRec, *pGeomDefPtr; - -/* - * constant technique private data for the Geometry element - */ -typedef struct _geom_nn { - int modify; -} pTecGeomNearestNeighborDefRec, *pTecGeomNearestNeighborDefPtr; - -typedef struct _geom_gauss { - double sigma; - double normalize; - int radius; - Bool simple; -} pTecGeomGaussianDefRec, *pTecGeomGaussianDefPtr; - -#endif /* _XIEC_PGEOM */ - -#if defined(_XIEC_PHIST) - -/* - * technique private structures - */ - -typedef struct _pmhistgaussian { - double mean; - double sigma; -} pTecHistogramGaussianDefRec, *pTecHistogramGaussianDefPtr; - -typedef struct _pmhisthyperbolic { - double constant; - Bool shapeFactor; -} pTecHistogramHyperbolicDefRec, *pTecHistogramHyperbolicDefPtr; - -#endif /* _XIEC_PHIST */ - -#if defined(_XIEC_PLOGIC) -/* - * dixie element-private data for the Logical element - */ -typedef struct _plogic { - CARD32 pvtBytes; - double constant[xieValMaxBands]; -} pLogicDefRec, *pLogicDefPtr; -#endif /* _XIEC_PLOGIC */ - -#if defined(_XIEC_PPASTE) -/* - * dixie element-private data for the Paste Up element - */ -#define PasteUpFloat float - -typedef struct _ppasteup { - CARD32 pvtBytes; - PasteUpFloat constant[xieValMaxBands]; -} pPasteUpDefRec, *pPasteUpDefPtr; -#endif /* _XIEC_PPASTE */ - -#if defined(_XIEC_ECPHOTO) -/* - * JPEG Baseline technique private data for the export client photo element - */ -typedef struct _eEndcodeJPEGBaselinedef { - CARD32 pvtBytes; - CARD8 *q; - CARD8 *a; - CARD8 *d; -} eTecEncodeJPEGBaselineDefRec, *eTecEncodeJPEGBaselineDefPtr; -#endif /* _XIEC_ECPHOTO */ - -#if defined(_XIEC_EDRAW) -/* - * dixie element-private data for the ExportDrawable element - */ -typedef struct _edrawdef { - CARD32 pvtBytes; - DrawablePtr pDraw; - GCPtr pGC; -} eDrawDefRec, *eDrawDefPtr; -#endif /* _XIEC_EDRAW */ - -#if defined(_XIEC_EDRAWP) -/* - * dixie element-private data for the ExportDrawable element - */ -typedef struct _edrawpdef { - CARD32 pvtBytes; - DrawablePtr pDraw; - GCPtr pGC; -} eDrawPDefRec, *eDrawPDefPtr; -#endif /* _XIEC_EDRAWP */ - -#if defined(_XIEC_ELUT) -/* - * dixie element-private data for the ExportLUT element - */ -typedef struct _elutdef { - CARD32 pvtBytes; - lutPtr lut; -} eLUTDefRec, *eLUTDefPtr; -#endif /* _XIEC_ELUT */ - -#if defined(_XIEC_EPHOTO) || defined(_XIEC_ECPHOTO) || defined(_XIEC_SCHOICE) -/* - * dixie element-private data for the ExportPhotomap/ExportClientPhoto elements - */ -typedef struct _ephotodef { - CARD32 pvtBytes; - photomapPtr map; - BOOL serverChose; /* TRUE = server chose encode technique */ - BOOL congress; /* make sure no work gets done */ - CARD16 encodeNumber; /* encode technique number */ - CARD16 encodeLen; /* length of encode parms */ - pointer encodeParms; /* pointer to parms to be used for encode */ - CARD16 decodeNumber; /* decode technique number */ - CARD16 decodeLen; /* length of decode parms */ - pointer decodeParms; /* pointer to parms to be used for decode */ - pointer pvtParms; -} ePhotoDefRec, *ePhotoDefPtr; -#endif /* _XIEC_EPHOTO || _XIEC_ECPHOTO || _XIEC_SCHOICE */ - -#if defined(_XIEC_EROI) -/* - * dixie element-private data for the ExportROI element - */ -typedef struct _eroidef { - CARD32 pvtBytes; - roiPtr roi; -} eROIDefRec, *eROIDefPtr; -#endif /* _XIEC_EROI */ - -#endif /* module _XIEH_ELEMENT */ Index: xc/programs/Xserver/XIE/include/error.h diff -u xc/programs/Xserver/XIE/include/error.h:3.5 xc/programs/Xserver/XIE/include/error.h:removed --- xc/programs/Xserver/XIE/include/error.h:3.5 Fri Dec 14 14:58:13 2001 +++ xc/programs/Xserver/XIE/include/error.h Sat Feb 28 21:41:58 2004 @@ -1,162 +0,0 @@ -/* $Xorg: error.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module error.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - error.h -- error specific definitions - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/error.h,v 3.5 2001/12/14 19:58:13 dawes Exp $ */ - -#ifndef _XIEH_ERROR -#define _XIEH_ERROR - -#include -#include -#include /* declares xieFloEvn */ -#include /* declares xieTypPhototag */ -#include /* declares floDefPtr */ - -extern int SendFloError(ClientPtr client, floDefPtr flo); -extern int SendFloIDError(ClientPtr client, XID spaceID, XID floID); -extern int SendResourceError(ClientPtr client, CARD8 code, XID id); -extern void ErrDomain(floDefPtr flo, peDefPtr ped, xieTypPhototag domain); -extern void ErrGeneric(floDefPtr flo, peDefPtr ped, CARD8 code); -extern void ErrOperator(floDefPtr flo, peDefPtr ped, CARD8 operator); -extern void ErrResource(floDefPtr flo, peDefPtr ped, CARD8 code, CARD32 id); -extern void ErrTechnique(floDefPtr flo, peDefPtr ped, CARD8 group, CARD16 tech, CARD16 lenParams); -extern void ErrValue(floDefPtr flo, peDefPtr ped, CARD32 value); -extern void FloError(floDefPtr flo, xieTypPhototag tag, CARD16 type, CARD8 code); - -/* - * Convenience macros for dealing with the floDef generic error packet - */ -#define ferrTag(flo) ((flo)->error.phototag) -#define ferrType(flo) ((flo)->error.type) -#define ferrCode(flo) ((flo)->error.floErrorCode) -#define ferrError(flo,tag,type,code) \ - (ferrTag(flo)=(tag),ferrType(flo)=(type),ferrCode(flo)=(code)) - -/* - * convenience macros for general flo errors - */ -#define xieFloError(flo,tag,type,code) \ - FloError(flo,(xieTypPhototag)tag,(CARD16)(long)type,(CARD8)code) - -#define FloAccessError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloAccess); xfer;} -#define FloAllocError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloAlloc); xfer;} -#define FloElementError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloElement); xfer;} -#define FloImplementationError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloImplementation); xfer;} -#define FloLengthError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloLength); xfer;} -#define FloSourceError(flo,tag,type,xfer) \ - {xieFloError(flo,tag,type,xieErrNoFloSource); xfer;} - -/* - * convenience macros for element-specific flo errors - */ -#define AccessError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloAccess); xfer;} -#define AllocError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloAlloc); xfer;} -#define ColorListError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloColorList,id); xfer;} -#define ColormapError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloColormap,id); xfer;} -#define DomainError(flo,ped,dom,xfer) \ - {ErrDomain(flo,ped,dom); xfer;} -#define DrawableError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloDrawable,id); xfer;} -#define ElementError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloElement); xfer;} -#define GCError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloGC,id); xfer;} -#define ImplementationError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloImplementation); xfer;} -#define LUTError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloLUT,id); xfer;} -#define MatchError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloMatch); xfer;} -#define OperatorError(flo,ped,op,xfer) \ - {ErrOperator(flo,ped,(CARD8)op); xfer;} -#define PhotomapError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloPhotomap,id); xfer;} -#define ROIError(flo,ped,id,xfer) \ - {ErrResource(flo,ped,(CARD8)xieErrNoFloROI,id); xfer;} -#define SourceError(flo,ped,xfer) \ - {ErrGeneric(flo,ped,(CARD8)xieErrNoFloSource); xfer;} -#define TechniqueError(flo,ped,group,tech,len,xfer) \ - {ErrTechnique(flo,ped,(CARD8)group,(CARD16)tech,(CARD16)len); \ - xfer;} -#define ValueError(flo,ped,value,xfer) \ - {ErrValue(flo,ped,value); xfer;} - -#endif /* end _XIEH_ERROR */ Index: xc/programs/Xserver/XIE/include/flo.h diff -u xc/programs/Xserver/XIE/include/flo.h:1.5 xc/programs/Xserver/XIE/include/flo.h:removed --- xc/programs/Xserver/XIE/include/flo.h:1.5 Fri Dec 14 14:58:13 2001 +++ xc/programs/Xserver/XIE/include/flo.h Sat Feb 28 21:41:58 2004 @@ -1,119 +0,0 @@ -/* $Xorg: flo.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module flo.h ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - flo.h -- high level photoflo-specific definitions - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/flo.h,v 1.5 2001/12/14 19:58:13 dawes Exp $ */ - -#ifndef _XIEH_FLO -#define _XIEH_FLO - -#include - -/* various structure pointers - */ -typedef struct _flotex *ddFloTexPtr; -typedef struct _petex *ddPETexPtr; -typedef struct _schedvec *ddSchedVecPtr; -typedef struct _stripvec *ddStripVecPtr; - -typedef struct _photospace *photospacePtr; -typedef struct _techvec *techVecPtr; - -/* various function type pointers - */ -typedef Bool (*xieBoolProc)(); -typedef CARD8 * (*xieDataProc)(); -typedef int (*xieIntProc)(); -typedef void (*xieVoidProc)(); - - -#ifndef _XIEC_FLO -extern struct _flodef *MakeFlo(ClientPtr client, CARD16 peCnt, xieFlo *peLst); -extern Bool EditFlo(struct _flodef * flo, xieTypPhototag start, xieTypPhototag end, xieFlo *peLst); -extern void PrepFlo(struct _flodef * flo); -extern struct _flodef *FreeFlo(struct _flodef * flo); -extern struct _pedef *MakePEDef(CARD32 inFloCnt, CARD32 rawLen, CARD32 pvtLen); -extern struct _pedef *FreePEDef(struct _pedef * ped); -extern void SendClientData( - struct _flodef * flo, - struct _pedef * ped, - CARD8 *data, - CARD32 bytes, - CARD8 swapUnits, - CARD8 state); -extern Bool UpdateFormatfromLevels(struct _pedef * ped); -#endif - -#ifndef _XIEC_EVENT -extern void SendFloEvent(); -#endif - -#endif /* end _XIEH_FLO */ Index: xc/programs/Xserver/XIE/include/flodata.h diff -u xc/programs/Xserver/XIE/include/flodata.h:1.2 xc/programs/Xserver/XIE/include/flodata.h:removed --- xc/programs/Xserver/XIE/include/flodata.h:1.2 Fri Dec 14 14:58:13 2001 +++ xc/programs/Xserver/XIE/include/flodata.h Sat Feb 28 21:41:58 2004 @@ -1,169 +0,0 @@ -/* $Xorg: flodata.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module flodata.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - flodata.h - data formats - - Dean Verheiden, Robert NC Shelley -- AGE Logic, Inc. April 1993 - -******************************************************************************/ - -#ifndef _XIE_FLODATA -#define _XIE_FLODATA - -#include - -/* - * Supported data format classes - */ -#define BIT_PIXEL 1 /* bitonal data */ -#define BYTE_PIXEL 2 /* up to 2^8 levels */ -#define PAIR_PIXEL 3 /* up to 2^16 levels */ -#define QUAD_PIXEL 4 /* up to 2^32 levels */ -#define UNCONSTRAINED 16 /* levels are undefined */ -#define LUT_ARRAY 32 /* non-canonic lut array */ -#define RUN_LENGTH 64 /* non-canonic run_length */ -#define STREAM 128 /* non-canonic generic stream */ - -#define IsntLut(dfc) (dfc != LUT_ARRAY) -#define IsntDomain(dfc) (dfc & ~(RUN_LENGTH | BIT_PIXEL)) -#define IsntCanonic(dfc) (dfc & (RUN_LENGTH | STREAM | LUT_ARRAY)) -#define IsntConstrained(dfc) \ - (dfc & (UNCONSTRAINED | RUN_LENGTH | STREAM | LUT_ARRAY)) - -#define IsLut(dfc) (dfc == LUT_ARRAY) -#define IsDomain(dfc) (!IsntDomain(dfc)) -#define IsCanonic(dfc) (!IsntCanonic(dfc)) -#define IsConstrained(dfc) (!IsntConstrained(dfc)) - -#define IndexClass(dfc) (dfc == UNCONSTRAINED ? 0 : dfc ) - -#define ConstrainConst(fconst,levels) \ - ( (fconst <= 0.) ? (CARD32) 0 : \ - (fconst >= levels) ? (CARD32) (levels - 1) : \ - (CARD32) (fconst + 0.5)) - -/* - * Data types and sizes for supported format classes - */ -typedef CARD8 BitPixel; -typedef CARD8 BytePixel; -typedef CARD16 PairPixel; -typedef CARD32 QuadPixel; -typedef float RealPixel; /* type of Unconstrained data */ - -#define sz_BitPixel 1 -#define sz_BytePixel 8 -#define sz_PairPixel 16 -#define sz_QuadPixel 32 -#define sz_RealPixel 32 /* size of Unconstrained data */ - -typedef struct _format { - CARD8 class; /* format class {e.g. BIT_PIXEL, STREAM, ...} */ - CARD8 band; /* band number {0,1,2} */ - BOOL interleaved; /* true if pixels contain multiple bands */ - CARD8 depth; /* minimum bits needed to contain levels */ - CARD32 width; /* width in pixels */ - CARD32 height; /* height in pixels */ - CARD32 levels; /* quantization levels */ - CARD32 stride; /* distance between adjacent pixels in bits */ - CARD32 pitch; /* distance between adjacent scanlines in bits */ -} formatRec, *formatPtr; - - -typedef struct _strip { - struct _strip *flink; /* link to next strip */ - struct _strip *blink; /* link to previous strip */ - struct _strip *parent;/* link to strip from which this one was cloned */ - formatRec *format; /* pointer to format record that describes data */ - CARD32 refCnt; /* reference count */ - BOOL Xowner; /* if true, core X "owns" the data buffer */ - BOOL canonic; /* if true, units are scanlines, otherwise bytes */ - BOOL final; /* if true, this is the last strip for this band */ - BOOL cache; /* if true, buffer can be cached (standard size) */ - CARD32 start; /* first line/byte of overall data in this strip */ - CARD32 end; /* last line/byte of overall data in this strip */ - CARD32 length; /* lines/bytes of useable data in buffer */ - CARD32 bitOff; /* bit offset to first data (usually zero) */ - CARD32 bufSiz; /* size of the data buffer in bytes */ - CARD8 *data; /* pointer to the data buffer */ -} stripRec, *stripPtr; - -/* generic header for managing circular doubly linked lists - */ -typedef struct _lst { - struct _lst *flink; - struct _lst *blink; -} lstRec, *lstPtr; - -/* link-pair for managing a circular doubly linked list of strips - */ -typedef struct _striplst { - stripRec *flink; - stripRec *blink; -} stripLstRec, *stripLstPtr; - -#endif /* end _XIE_FLODATA */ Index: xc/programs/Xserver/XIE/include/flostr.h diff -u xc/programs/Xserver/XIE/include/flostr.h:1.2 xc/programs/Xserver/XIE/include/flostr.h:removed --- xc/programs/Xserver/XIE/include/flostr.h:1.2 Fri Dec 14 14:58:13 2001 +++ xc/programs/Xserver/XIE/include/flostr.h Sat Feb 28 21:41:58 2004 @@ -1,224 +0,0 @@ -/* $Xorg: flostr.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module flostr.h ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - flostr.h -- DIXIE photoflo and element structure definitions - - Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ - -#ifndef _XIEH_FLOSTR -#define _XIEH_FLOSTR - -#include - -typedef CARD8 bandMsk; /* per-band bit mask (bit0 == band0,...)*/ - -/* dixie photo element entry points - */ -typedef struct _dielemvec { - xieBoolProc prep; /* prepare for analysis and execution */ - xieBoolProc debrief; /* post execution clean-up */ -} diElemVecRec, *diElemVecPtr; - -/* ddxie photo-element interface - */ -typedef struct _ddelemvec { - xieIntProc create; - xieIntProc initialize; - xieIntProc activate; - xieIntProc flush; - xieIntProc reset; - xieIntProc destroy; -} ddElemVecRec, *ddElemVecPtr; - -/* ddxie photoflo manager entry points - */ -typedef struct _flovec { - xieIntProc link; - xieIntProc startup; - xieIntProc resume; - xieIntProc shutdown; - xieIntProc destroy; -} floVecRec, *floVecPtr; - -/* ddxie client data manager entry points - */ -typedef struct _datavec { - xieIntProc input; - xieIntProc output; - xieIntProc query; -} dataVecRec, *dataVecPtr; - -/* photo-element inFlo definition - */ -typedef struct _inflo { - CARD8 bands; /* number of bands this input will receive */ - CARD8 index; /* inFlo index of this input */ - xieTypPhototag srcTag; /* phototag of source element */ - struct _pedef *srcDef; /* pointer to source element definition */ - struct _pedef *ownDef; /* pointer to this element's definition */ - struct _inflo *outChain; /* chain of inFlos sharing the same output */ - formatRec format[xieValMaxBands]; /* data format per input band */ -} inFloRec, *inFloPtr; - -/* photo-element outFlo definition - */ -typedef struct _outflo { - inFloPtr outChain; /* chain of inFlos receiving output */ - bandMsk active; /* bands that will supply client data */ - bandMsk ready; /* bands that are holding client data */ - CARD8 bands; /* number of output bands */ - CARD8 pad; - stripLstRec output[xieValMaxBands];/* holding place for element's output */ - formatRec format[xieValMaxBands];/* data format per output band */ -} outFloRec, *outFloPtr; - -/* photo-element definition structure - */ -typedef struct _pedef { - struct _pedef *flink; /* foreword link in DAG-ordered peDef list */ - struct _pedef *blink; /* backword link in DAG-ordered peDef list */ - struct _pedef *clink; /* next element of the same class */ - struct _pedef *olink; /* link to optimized element */ - xieFlo *elemRaw; /* raw (swapped) client element */ - pointer elemPvt; /* dixie element-private info */ - pointer techPvt; /* dixie technique-private info */ - techVecPtr techVec; /* technique vectors */ - ddPETexPtr peTex; /* DDXIE execution context */ - inFloPtr inFloLst; /* pointer to in-line array of input info */ - CARD16 inCnt; /* number of inputs (inc. LUT & domain) */ - xieTypPhototag phototag; /* phototag of this element */ - struct { - unsigned int import : 1; /* element performs import functions */ - unsigned int process : 1; /* element performs processing */ - unsigned int export : 1; /* element performs export functions */ - unsigned int getData : 1; /* element allows GetClientData */ - unsigned int putData : 1; /* element allows PutClientData */ - unsigned int modified : 1; /* modified attributes or parameters */ - unsigned int loop : 1; /* loop-detection flag */ - unsigned int reserved : 1; - } flags; - CARD8 swapUnits[xieValMaxBands]; /* size of client data aggregates */ - diElemVecPtr diVec; /* DIXIE entry point vector */ - ddElemVecRec ddVec; /* DDXIE entry point vector (in-line) */ - outFloRec outFlo; /* output attribute/connection info */ -#if 0 - inFloRec inFlo[inCnt]; /* array of in-line input connection info */ -#endif -} peDefRec, *peDefPtr; - -/* link-pair for managing a circular doubly linked list of peDefs - */ -typedef struct _pedlst { - peDefPtr flink; - peDefPtr blink; -} pedLstRec, *pedLstPtr; - -/* photoflo definition structure - */ -typedef struct _flodef { - struct _flodef *flink; /* foreword link in nameSpace (immed only) */ - struct _flodef *blink; /* backword link in nameSpace (immed only) */ - ClientPtr runClient; /* client that is running the flo */ - ClientPtr reqClient; /* client that is making current request */ - ClientPtr *awakenPtr; /* list of clients Awaiting flo done */ - CARD32 awakenCnt; /* number of clients Awaiting flo done */ - CARD32 ID; /* instance-id within nameSpace */ - CARD32 spaceID; /* photospace-id or 0 (serverIDspace) */ - photospacePtr space; /* photospacePtr or NULL */ - ddFloTexPtr floTex; /* DDXIE execution context info */ - floVecPtr floVec; /* DDXIE photoflo management entry points */ - dataVecPtr dataVec; /* DDXIE client data manager entry points */ - ddSchedVecPtr schedVec; /* DDXIE scheduler entry points */ - ddStripVecPtr stripVec; /* DDXIE strip manager entry points */ - pedLstRec defDAG; /* DAG peList (flink=import, blink=export) */ - pedLstRec optDAG; /* optimized DAG peList */ - peDefPtr *peArray; /* pointer to in-line peDef pointer array */ - CARD16 peCnt; /* number of elements in peArray */ - struct { - unsigned int active : 1; /* execute requested (else inactive) */ - unsigned int modified : 1; /* something changed since last execution */ - unsigned int notify : 1; /* send an event upon flo completion */ - unsigned int aborted : 1; /* the client aborted execution */ - unsigned int reserved : 12; - } flags; - xieFloEvn event; /* generic event packet */ - xieFloErr error; /* generic error packet */ -#if 0 - peDefPtr peArray[peCnt];/* array of peDef pointers */ -#endif -} floDefRec, *floDefPtr; - -/* link-pair for managing a circular doubly linked list of floDefs - */ -typedef struct _flolst { - floDefPtr flink; - floDefPtr blink; -} floLstRec, *floLstPtr; - -#endif /* end _XIEH_FLOSTR */ Index: xc/programs/Xserver/XIE/include/lut.h diff -u xc/programs/Xserver/XIE/include/lut.h:1.2 xc/programs/Xserver/XIE/include/lut.h:removed --- xc/programs/Xserver/XIE/include/lut.h:1.2 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/lut.h Sat Feb 28 21:41:58 2004 @@ -1,109 +0,0 @@ -/* $Xorg: lut.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module lut.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - lut.h: contains lut specific definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -******************************************************************************/ - -#ifndef _XIEH_LUT -#define _XIEH_LUT - -#include - -/* - * LUT resource definition - */ - -typedef struct _lutformat { - xieTypOrientation bandOrder; /* Lut order */ - CARD8 pad[3]; - CARD32 length; /* Input quantization levels */ - CARD32 level; /* Output quantization levels */ -} lutFormatRec, *lutFormatPtr; - -typedef struct _lut { - xieTypLUT ID; - CARD16 refCnt; - CARD8 lutCnt; - lutFormatRec format[xieValMaxBands]; - stripLstRec strips[xieValMaxBands]; /* lists of image strips */ -} lutRec, *lutPtr; - -/* - * Macros for working with Luts - * LutPitch(levels) - returns size of single lut array entry in bytes. - */ - -#define LutPitch(Levels) \ - (((Levels) == 0) ? 4 : \ - (((Levels) > (1<<16)) ? 4 : \ - (((Levels) > (1<<8)) ? 2 : 1))) - -#endif -/* end _XIEH_LUT */ Index: xc/programs/Xserver/XIE/include/macro.h diff -u xc/programs/Xserver/XIE/include/macro.h:1.10 xc/programs/Xserver/XIE/include/macro.h:removed --- xc/programs/Xserver/XIE/include/macro.h:1.10 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/macro.h Sat Feb 28 21:41:58 2004 @@ -1,219 +0,0 @@ -/* $Xorg: macro.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module macro.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - macro.h -- XIE utility macros - - Robert NC Shelley -- AGE Logic, Inc. March 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/macro.h,v 1.10 2001/12/14 19:58:14 dawes Exp $ */ - -#ifndef _XIEH_MACRO -#define _XIEH_MACRO - -#include - -/* DDXIE photoflo management interface - */ -#define ddShutdown(flo) (flo->floVec ? (*flo->floVec->shutdown)(flo) : 0) -#define ddDestroy(flo) (flo->floVec ? (*flo->floVec->destroy) (flo) : 0) -#define ddLink(flo) (*flo->floVec->link)(flo) -#define ddResume(flo) (*flo->floVec->resume)(flo) -#define ddStartup(flo) (*flo->floVec->startup)(flo) - -/* DDXIE client data management interface - */ -#define ddInput(flo,ped,band,data,bytes,final) \ - (*flo->dataVec->input)(flo,ped,band,data,bytes,final) -#define ddOutput(flo,ped,band,maxLen,term) \ - (*flo->dataVec->output)(flo,ped,band,maxLen,term) -#define ddQuery(flo,lst,im,ex) (*flo->dataVec->query)(flo,lst,im,ex) - -/* List management macros - */ -#define ListInit(head) \ - (((lstPtr)(head))->flink = (lstPtr)(head), \ - ((lstPtr)(head))->blink = (lstPtr)(head)) - -#define ListEnd(current,head) ((lstPtr)(current) == (lstPtr)(head)) - -#define ListEmpty(head) (((lstPtr)(head))->flink == (lstPtr)(head)) - -#define InsertMember(new,prev) \ - {lstPtr ptr = (lstPtr)(prev); \ - ((lstPtr)(new))->flink = ptr->flink; \ - ((lstPtr)(new))->blink = ptr; ptr->flink = (lstPtr)(new); \ - ((lstPtr)(new))->flink->blink = (lstPtr)(new);} - -#define RemoveMember(ptr,old) \ - (ptr=old, \ - ((lstPtr)(ptr))->blink->flink = ((lstPtr)(ptr))->flink, \ - ((lstPtr)(ptr))->flink->blink = ((lstPtr)(ptr))->blink) - - -/* return amount that should be added to 'len' to make it modulo 'pad' - */ -#define Align(len,pad) (((pad)-(len)%(pad))%(pad)) - - -/* swap a pair of pointers - */ -#define SwapPtr(p1,p2,pt) \ - (*((pointer *)&(pt)) = (pointer )(p1), \ - *((pointer *)&(p1)) = (pointer )(p2), \ - *((pointer *)&(p2)) = (pointer )(pt)) - - -/* compute the minimum number of bits ('depth') required to represent 'levels' - */ -#define SetDepthFromLevels(levels,depth) \ - if(levels > 2) { CARD32 _i = levels; \ - for(depth = 0; (_i >>= 1); ++depth); \ - if(((1 << depth) - 1) & levels) ++depth; } \ - else depth = levels ? 1 : 32 - -/* event convenience macros - */ -#define SendElementEvent(flo,ped,code) \ - (flo->event.src = ped->phototag, \ - flo->event.type = ped->elemRaw->elemType, \ - flo->event.event = code, \ - SendFloEvent(flo)) -#define SendColorAllocEvent(flo,ped,clst,tn,td) \ - {((xieColorAllocEvn *)&flo->event)->colorList = clst; \ - ((xieColorAllocEvn *)&flo->event)->colorAllocTechnique = tn; \ - ((xieColorAllocEvn *)&flo->event)->data = td; \ - SendElementEvent(flo,ped,xieEvnNoColorAlloc);} -#define SendDecodeNotifyEvent(flo,ped,b,tn,dw,dh,abt) \ - {((xieDecodeNotifyEvn *)&flo->event)->bandNumber = b; \ - ((xieDecodeNotifyEvn *)&flo->event)->decodeTechnique = tn; \ - ((xieDecodeNotifyEvn *)&flo->event)->width = dw; \ - ((xieDecodeNotifyEvn *)&flo->event)->height = dh; \ - ((xieDecodeNotifyEvn *)&flo->event)->aborted = abt; \ - SendElementEvent(flo,ped,xieEvnNoDecodeNotify);} -#define SendExportAvailableEvent(flo,ped,b,d0,d1,d2) \ - {((xieExportAvailableEvn *)&flo->event)->bandNumber = b; \ - ((xieExportAvailableEvn *)&flo->event)->data0 = d0; \ - ((xieExportAvailableEvn *)&flo->event)->data1 = d1; \ - ((xieExportAvailableEvn *)&flo->event)->data2 = d2; \ - SendElementEvent(flo,ped,xieEvnNoExportAvailable);} -#define SendImportObscuredEvent(flo,ped,win,ex,ey,ew,eh) \ - {((xieImportObscuredEvn *)&flo->event)->window = win; \ - ((xieImportObscuredEvn *)&flo->event)->x = ex; \ - ((xieImportObscuredEvn *)&flo->event)->y = ey; \ - ((xieImportObscuredEvn *)&flo->event)->width = ew; \ - ((xieImportObscuredEvn *)&flo->event)->height = eh; \ - SendElementEvent(flo,ped,xieEvnNoImportObscured);} - - -#define ExecProc(client,opcode) \ - ((client_table[client->index].proc_table[opcode])(client)) -#define ExecSProc(client,opcode) \ - ((client_table[client->index].sproc_table[opcode])(client)) - -#define CallProc(client) (ExecProc(client,stuff->opcode)) -#define CallSProc(client) (ExecSProc(client,stuff->opcode)) - -#define MakeElement(flo,tag,pe) \ - ((MakeTable[pe->elemType])(flo,tag,pe)) - -#define ELEMENT(type) \ - register type *raw, *stuff = (type *)pe - -#define ELEMENT_SIZE_MATCH(type) \ - if(stuff->elemLength != sizeof(type)>>2) \ - FloLengthError(flo,tag,stuff->elemType, return(NULL)) - -#define ELEMENT_AT_LEAST_SIZE(type) \ - if(stuff->elemLength < sizeof(type)>>2) \ - FloLengthError(flo,tag,stuff->elemType, return(NULL)) - -#define ELEMENT_NEEDS_1_INPUT(input) \ - if(!(stuff->input)) \ - FloSourceError(flo,tag,stuff->elemType, return(NULL)) - -#define ELEMENT_NEEDS_2_INPUTS(input1,input2) \ - if(!(stuff->input1) || !(stuff->input2)) \ - FloSourceError(flo,tag,stuff->elemType, return(NULL)) - - -#define ELEMENT_NEEDS_3_INPUTS(input1,input2,input3) \ - if(!(stuff->input1) || !(stuff->input2) || !(stuff->input3)) \ - FloSourceError(flo,tag,stuff->elemType, return(NULL)) - -/* - * if XIE is built as a module, it shouldn't call libc functions. - * The following macros should wrap all calls in XIE - */ -#ifndef XFree86LOADER -#include -#include -#else -#include "xf86_ansic.h" -#endif - -#endif /* end _XIEH_MACRO */ Index: xc/programs/Xserver/XIE/include/memory.h diff -u xc/programs/Xserver/XIE/include/memory.h:1.5 xc/programs/Xserver/XIE/include/memory.h:removed --- xc/programs/Xserver/XIE/include/memory.h:1.5 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/memory.h Sat Feb 28 21:41:58 2004 @@ -1,86 +0,0 @@ -/* $Xorg: memory.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module memory.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - memory.h - XIE memory management definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/memory.h,v 1.5 2001/12/14 19:58:14 dawes Exp $ */ - -#ifndef _XIEH_MEMORY -#define _XIEH_MEMORY - -#include "misc.h" /* for pointer */ - -extern pointer XieMalloc(unsigned size); -extern pointer XieCalloc(unsigned size); -extern pointer XieRealloc(pointer ptr, unsigned size); -extern pointer XieFree(pointer ptr); - -#endif -/* end _XIEH_MEMORY */ Index: xc/programs/Xserver/XIE/include/photomap.h diff -u xc/programs/Xserver/XIE/include/photomap.h:1.2 xc/programs/Xserver/XIE/include/photomap.h:removed --- xc/programs/Xserver/XIE/include/photomap.h:1.2 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/photomap.h Sat Feb 28 21:41:58 2004 @@ -1,104 +0,0 @@ -/* $Xorg: photomap.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module photomap.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - photomap.h -- contains photomap definitions - - Dean Verheiden, Robert NC Shelley -- AGE Logic, Inc. April 1993 - -******************************************************************************/ - -#ifndef _XIEH_PHOTOMAP -#define _XIEH_PHOTOMAP - -#include - -/* - * Definitions - */ -typedef struct _photomap *photomapPtr; - -typedef struct _photomap { - xieTypPhotomap ID; - CARD16 refCnt; - CARD16 technique; /* decode technique needed to decompress*/ - CARD16 lenParms; /* length of technique params (in bytes)*/ - CARD16 pad0; - pointer tecParms; /* technique-specific decode parameters */ - pointer pvtParms; /* additional decode hints */ - xieTypDataClass dataClass; /* {SingleBand,TripleBand} */ - CARD8 bands; /* number of bands {0=unpopulated,1,3} */ - /* Tripleband, interleaved has bands=1, */ - /* so this parameter is *not* redundant */ - xieTypDataType dataType; /* {Constrained,Unconstrined} */ - CARD8 pad1; - formatRec format[xieValMaxBands]; /* format of data in strips */ - stripLstRec strips[xieValMaxBands]; /* lists of image strips */ -} photomapRec; - - -#endif -/* end _XIEH_PHOTOMAP */ Index: xc/programs/Xserver/XIE/include/photospc.h diff -u xc/programs/Xserver/XIE/include/photospc.h:1.2 xc/programs/Xserver/XIE/include/photospc.h:removed --- xc/programs/Xserver/XIE/include/photospc.h:1.2 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/photospc.h Sat Feb 28 21:41:58 2004 @@ -1,86 +0,0 @@ -/* $Xorg: photospc.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module photospc.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - photospc.h: photospace definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -******************************************************************************/ - -#ifndef _XIEH_PHOTOSPC -#define _XIEH_PHOTOSPC - -/* - * photospace definition - */ -typedef struct _photospace { - xieTypPhotospace spaceID; - CARD32 floCnt; - floLstRec floLst; -} photospaceRec; - -#endif /* end _XIEH_PHOTOSPC */ Index: xc/programs/Xserver/XIE/include/protoflo.h diff -u xc/programs/Xserver/XIE/include/protoflo.h:1.1 xc/programs/Xserver/XIE/include/protoflo.h:removed --- xc/programs/Xserver/XIE/include/protoflo.h:1.1 Sun Oct 25 02:11:47 1998 +++ xc/programs/Xserver/XIE/include/protoflo.h Sat Feb 28 21:41:58 2004 @@ -1,90 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/XIE/include/protoflo.h,v 1.1 1998/10/25 07:11:47 dawes Exp $ - */ - -/************************************************************ - -Copyright 1998 by Thomas E. Dickey - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of the above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -/* - * dixie/request/protoflo.c - */ - -#ifndef _XIE_PROTOFLO_H_ -#define _XIE_PROTOFLO_H_ 1 - -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include - -/* - * Xie protocol procedures called from the dispatcher - */ -extern int ProcAbort (ClientPtr client); -extern int ProcAwait (ClientPtr client); -extern int ProcCreatePhotoflo (ClientPtr client); -extern int ProcCreatePhotospace (ClientPtr client); -extern int ProcDestroyPhotoflo (ClientPtr client); -extern int ProcDestroyPhotospace (ClientPtr client); -extern int ProcExecuteImmediate (ClientPtr client); -extern int ProcExecutePhotoflo (ClientPtr client); -extern int ProcGetClientData (ClientPtr client); -extern int ProcModifyPhotoflo (ClientPtr client); -extern int ProcPutClientData (ClientPtr client); -extern int ProcQueryPhotoflo (ClientPtr client); -extern int ProcRedefinePhotoflo (ClientPtr client); -extern int SProcAbort (ClientPtr client); -extern int SProcAwait (ClientPtr client); -extern int SProcCreatePhotoflo (ClientPtr client); -extern int SProcCreatePhotospace (ClientPtr client); -extern int SProcDestroyPhotoflo (ClientPtr client); -extern int SProcDestroyPhotospace (ClientPtr client); -extern int SProcExecuteImmediate (ClientPtr client); -extern int SProcExecutePhotoflo (ClientPtr client); -extern int SProcGetClientData (ClientPtr client); -extern int SProcModifyPhotoflo (ClientPtr client); -extern int SProcPutClientData (ClientPtr client); -extern int SProcQueryPhotoflo (ClientPtr client); -extern int SProcRedefinePhotoflo (ClientPtr client); - -/* - * routines referenced by other modules - */ -extern int DeletePhotoflo (floDefPtr flo, xieTypPhotoflo id); -extern int DeletePhotospace (photospacePtr space, xieTypPhotospace id); - -#endif /* _XIE_PROTOFLO_H_ */ Index: xc/programs/Xserver/XIE/include/roi.h diff -u xc/programs/Xserver/XIE/include/roi.h:1.2 xc/programs/Xserver/XIE/include/roi.h:removed --- xc/programs/Xserver/XIE/include/roi.h:1.2 Fri Dec 14 14:58:14 2001 +++ xc/programs/Xserver/XIE/include/roi.h Sat Feb 28 21:41:58 2004 @@ -1,88 +0,0 @@ -/* $Xorg: roi.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module roi.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - roi.h: contains region of interest specific definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -******************************************************************************/ - -#ifndef _XIEH_ROI -#define _XIEH_ROI - -#include - -/* - * ROI resource definitions - */ -typedef struct _roi { - xieTypROI ID; - CARD32 refCnt; - stripLstRec strips; /* run-length encoded list of rectangles */ -} roiRec, *roiPtr; - -#endif /* end _XIEH_ROI */ Index: xc/programs/Xserver/XIE/include/tables.h diff -u xc/programs/Xserver/XIE/include/tables.h:1.5 xc/programs/Xserver/XIE/include/tables.h:removed --- xc/programs/Xserver/XIE/include/tables.h:1.5 Fri Dec 14 14:58:15 2001 +++ xc/programs/Xserver/XIE/include/tables.h Sat Feb 28 21:41:58 2004 @@ -1,139 +0,0 @@ -/* $Xorg: tables.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module tables.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - tables.h: entry points etc. - - Dean Verheiden, Robert NC Shelley -- AGE Logic, Inc. April 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/tables.h,v 1.5 2001/12/14 19:58:15 dawes Exp $ */ - -#ifndef _XIEH_TABLES -#define _XIEH_TABLES - -#include -#include - -#define DDAnalyzeIndex 0 -#define DDServerChoiceIndex 1 - -#ifndef _XIEC_TABLES - -extern peDefPtr (*MakeTable[])(); -extern xieVoidProc DDInterface[]; - -#endif /* _XIEC_TABLES */ - - /* dd entry points for di */ - -extern int DAGalyze(floDefPtr); -extern xieBoolProc GetServerChoice(floDefPtr, peDefPtr); /* FIXME: mixie */ - - /* lut.c */ -extern int ProcCreateLUT(ClientPtr); -extern int ProcDestroyLUT(ClientPtr); -extern int SProcCreateLUT(ClientPtr); -extern int SProcDestroyLUT(ClientPtr); - /* photomap.c */ -extern int ProcCreatePhotomap(ClientPtr); -extern int ProcDestroyPhotomap(ClientPtr); -extern int ProcQueryPhotomap(ClientPtr); -extern int SProcCreatePhotomap(ClientPtr); -extern int SProcDestroyPhotomap(ClientPtr); -extern int SProcQueryPhotomap(ClientPtr); - /* technq.c */ -extern int ProcQueryTechniques(ClientPtr); -extern int SProcQueryTechniques(ClientPtr); - -#if XIE_FULL - /* colorlst.c */ -extern int ProcCreateColorList(ClientPtr); -extern int ProcDestroyColorList(ClientPtr); -extern int ProcPurgeColorList(ClientPtr); -extern int ProcQueryColorList(ClientPtr); -extern int SProcCreateColorList(ClientPtr); -extern int SProcDestroyColorList(ClientPtr); -extern int SProcPurgeColorList(ClientPtr); -extern int SProcQueryColorList(ClientPtr); - /* roi.c */ -extern int ProcCreateROI(ClientPtr); -extern int ProcDestroyROI(ClientPtr); -extern int SProcCreateROI(ClientPtr); -extern int SProcDestroyROI(ClientPtr); -#endif - -/* elements */ -#include -#include -#include - -extern void init_proc_tables( - CARD16 minorVersion, - int (**ptable[])(ClientPtr), - int (**sptable[])(ClientPtr)); - -#endif /* _XIEH_TABLES */ Index: xc/programs/Xserver/XIE/include/technq.h diff -u xc/programs/Xserver/XIE/include/technq.h:1.5 xc/programs/Xserver/XIE/include/technq.h:removed --- xc/programs/Xserver/XIE/include/technq.h:1.5 Fri Dec 14 14:58:15 2001 +++ xc/programs/Xserver/XIE/include/technq.h Sat Feb 28 21:41:58 2004 @@ -1,1414 +0,0 @@ -/* $Xorg: technq.h,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module technq.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************* - - technq.h: contains technique definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/include/technq.h,v 1.5 2001/12/14 19:58:15 dawes Exp $ */ - -#ifndef _XIEH_TECHNQ -#define _XIEH_TECHNQ - -#include - -#define TECHNQ_COPY_ARGS \ - floDefPtr flo, \ - peDefPtr ped, \ - pointer sParms, \ - pointer rParms, \ - CARD16 tsize, \ - Bool isDefault - -#define TECHNQ_WADJ_ARGS \ - floDefPtr flo, \ - peDefPtr ped, \ - pointer sparms, \ - double *pvtf, \ - techVecPtr tv, \ - CARD16 tsize, \ - Bool isDefault - -typedef Bool (*techCopyFunc)(TECHNQ_COPY_ARGS); /* the normal case */ -typedef Bool (*techWadjFunc)(TECHNQ_WADJ_ARGS); /* ...an exception */ -typedef Bool (*techGamuFunc)(CARD16); /* ...an exception */ - -#define TECH_WADJ_FUNC(func) ((techWadjFunc)(func->copyfnc)) -#define TECH_GAMU_FUNC(func) ((techGamuFunc)(func->copyfnc)) - -/* - * dixie import client photo technique entry points - */ -extern Bool CopyICPhotoUnSingle(TECHNQ_COPY_ARGS); -extern Bool CopyICPhotoG31D(TECHNQ_COPY_ARGS); -extern Bool CopyICPhotoG32D(TECHNQ_COPY_ARGS); -extern Bool CopyICPhotoG42D(TECHNQ_COPY_ARGS); -extern Bool CopyICPhotoTIFF2(TECHNQ_COPY_ARGS); -extern Bool CopyICPhotoTIFFPackBits(TECHNQ_COPY_ARGS); -extern Bool PrepICPhotoUnSingle( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeUncompressedSingle *tec); -extern Bool PrepICPhotoG31D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG31D *tec); -extern Bool PrepICPhotoG32D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG32D *tec); -extern Bool PrepICPhotoG42D( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeG42D *tec); -extern Bool PrepICPhotoTIFF2( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeTIFF2 *tec); -extern Bool PrepICPhotoTIFFPackBits( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeTIFFPackBits *tec); -#if XIE_FULL -extern Bool CopyICPhotoUnTriple(TECHNQ_COPY_ARGS); -extern Bool PrepICPhotoUnTriple( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeUncompressedTriple *tec); -extern Bool CopyICPhotoJPEGBaseline(TECHNQ_COPY_ARGS); -extern Bool PrepICPhotoJPEGBaseline( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeJPEGBaseline *tec); -#ifdef BEYOND_SI -extern Bool CopyICPhotoJPEGLossless(TECHNQ_COPY_ARGS); -extern Bool PrepICPhotoJPEGLossless( - floDefPtr flo, - peDefPtr ped, - xieFloImportClientPhoto *raw, - xieTecDecodeJPEGLossless *tec); -#endif /* BEYOND_SI */ -#endif - -/* - * dixie constrain technique entry points - */ -#if XIE_FULL -extern Bool CopyPConstrainStandard(TECHNQ_COPY_ARGS); -extern Bool CopyPConstrainClipScale(TECHNQ_COPY_ARGS); -extern Bool PrepPConstrainStandard( - floDefPtr flo, - peDefPtr ped, - pointer raw, - pointer tec); -extern Bool PrepPConstrainClipScale( - floDefPtr flo, - peDefPtr ped, - xieTecClipScale *raw, - xieTecClipScale *tec); -#endif - -/* - * dixie convolve technique entry points - */ -#if XIE_FULL -extern Bool CopyConvolveConstant(TECHNQ_COPY_ARGS); -extern Bool PrepConvolveStandard( - floDefPtr flo, - peDefPtr ped, - pointer raw, - pointer tec); -#ifdef BEYOND_SI -extern Bool CopyConvolveReplicate(TECHNQ_COPY_ARGS); -#endif /* BEYOND_SI */ -#endif - -/* - * dixie dither technique entry points - */ -#if XIE_FULL -extern Bool CopyPDitherErrorDiffusion(TECHNQ_COPY_ARGS); -extern Bool PrepPDitherErrorDiffusion( - floDefPtr flo, - peDefPtr ped, - xieFloDither *raw, - pointer tec); -extern Bool CopyPDitherOrdered(TECHNQ_COPY_ARGS); -extern Bool PrepPDitherOrdered( - floDefPtr flo, - peDefPtr ped, - xieFloDither *raw, - xieTecDitherOrdered *tec); -#endif - -/* - * dixie geometry technique entry points - */ -extern Bool CopyGeomNearestNeighbor(TECHNQ_COPY_ARGS); -extern Bool PrepGeomNearestNeighbor( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec); -extern Bool CopyGeomAntiAlias(TECHNQ_COPY_ARGS); -extern Bool PrepGeomAntiAlias( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec); -#if XIE_FULL -extern Bool CopyGeomBilinearInterp(TECHNQ_COPY_ARGS); -extern Bool PrepGeomBilinearInterp( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec); -extern Bool CopyGeomGaussian(TECHNQ_COPY_ARGS); -extern Bool PrepGeomGaussian( - floDefPtr flo, - peDefPtr ped, - xieFloGeometry *raw, - pointer tec); -#endif - -/* - * dixie match histogram technique entry points - */ -#if XIE_FULL -extern Bool CopyPHistogramFlat(TECHNQ_COPY_ARGS); -extern Bool CopyPHistogramGaussian(TECHNQ_COPY_ARGS); -extern Bool CopyPHistogramHyperbolic(TECHNQ_COPY_ARGS); -extern Bool PrepPHistogramFlat(floDefPtr flo, peDefPtr ped); -extern Bool PrepPHistogramGaussian(floDefPtr flo, peDefPtr ped); -extern Bool PrepPHistogramHyperbolic(floDefPtr flo, peDefPtr ped); -#endif - -/* - * dixie convert to index technique entry points - */ -#if XIE_FULL -extern Bool CopyCtoIAllocAll(TECHNQ_COPY_ARGS); -extern Bool PrepCtoIAllocAll( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToIndex *raw, - xieTecColorAllocAll *tec); -#ifdef BEYOND_SI -extern Bool CopyCtoIAllocMatch(TECHNQ_COPY_ARGS); -extern Bool CopyCtoIAllocRequantize(TECHNQ_COPY_ARGS); -#endif /* BEYOND_SI */ -#endif - -/* - * dixie export client photo technique entry points - */ -extern Bool CopyECPhotoUnSingle(TECHNQ_COPY_ARGS); -extern Bool CopyECPhotoG31D(TECHNQ_COPY_ARGS); -extern Bool CopyECPhotoG32D(TECHNQ_COPY_ARGS); -extern Bool CopyECPhotoG42D(TECHNQ_COPY_ARGS); -extern Bool CopyECPhotoTIFF2(TECHNQ_COPY_ARGS); -extern Bool CopyECPhotoTIFFPackBits(TECHNQ_COPY_ARGS); - -extern Bool PrepECPhotoUnSingle( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeUncompressedSingle *tec); -extern Bool PrepECPhotoG31D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG31D *tec); -extern Bool PrepECPhotoG32D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG32D *tec); -extern Bool PrepECPhotoG42D( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeG42D *tec); -extern Bool PrepECPhotoTIFF2( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeTIFF2 *tec); -extern Bool PrepECPhotoTIFFPackBits( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeTIFFPackBits *tec); -#if XIE_FULL -extern Bool CopyECPhotoUnTriple(TECHNQ_COPY_ARGS); -extern Bool PrepECPhotoUnTriple( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeUncompressedTriple *tec); -extern Bool CopyECPhotoJPEGBaseline(TECHNQ_COPY_ARGS); -extern Bool PrepECPhotoJPEGBaseline( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGBaseline *tec); -#ifdef BEYOND_SI -extern Bool CopyECPhotoJPEGLossless(TECHNQ_COPY_ARGS); -extern Bool PrepECPhotoJPEGLossless( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGLossless *tec); -#endif /* BEYOND_SI */ -#endif - -/* - * dixie convert to and from RBG technique entry points - */ -#if XIE_FULL -extern Bool CopyPConvertFromRGBCIE(TECHNQ_COPY_ARGS); -extern Bool CopyPConvertFromRGBYCC(TECHNQ_COPY_ARGS); -extern Bool CopyPConvertFromRGBYCbCr(TECHNQ_COPY_ARGS); -extern Bool CopyPConvertToRGBCIE(TECHNQ_COPY_ARGS); -extern Bool CopyPConvertToRGBYCC(TECHNQ_COPY_ARGS); -extern Bool CopyPConvertToRGBYCbCr(TECHNQ_COPY_ARGS); -extern Bool CopyPWhiteAdjustNone( - floDefPtr flo, - peDefPtr ped, - pointer sparms, - double *pvtf, - techVecPtr tv, - CARD16 tsize, - Bool isDefault); -extern Bool CopyPWhiteAdjustCIELabShift( - floDefPtr flo, - peDefPtr ped, - xieTecWhiteAdjustCIELabShift *sparms, - double *pvtf, - techVecPtr tv, - CARD16 tsize, - Bool isDefault); -extern Bool CopyPGamut(CARD16 tsize); - -extern Bool PrepPConvertFromRGBCIE( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToCIELab *tec); -extern Bool PrepPConvertFromRGBYCC( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToYCC *tec); -extern Bool PrepPConvertFromRGBYCbCr( - floDefPtr flo, - peDefPtr ped, - xieFloConvertFromRGB *raw, - xieTecRGBToYCbCr *tec); -extern Bool PrepPConvertToRGBCIE( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecCIELabToRGB *tec); -extern Bool PrepPConvertToRGBYCC( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecYCCToRGB *tec); -extern Bool PrepPConvertToRGBYCbCr( - floDefPtr flo, - peDefPtr ped, - xieFloConvertToRGB *raw, - xieTecYCbCrToRGB *tec); -extern Bool PrepPWhiteAdjustNone( - floDefPtr flo, - peDefPtr ped, - double *pwp); -extern Bool PrepPWhiteAdjustCIELabShift( - floDefPtr flo, - peDefPtr ped, - double *pwp); -extern Bool PrepPGamut(void); -#endif - -/* Global definitions for referencing techniques */ - -typedef struct _techvec { - BOOL NoTech; /* If true, this technique has no parameters */ - BOOL OptionalTech; /* If true, parameters are optional */ - BOOL FixedTech; /* If true, parameter size is fixed */ - BOOL pad; - CARD16 techSize; /* size of parameters (possibly optional) */ - CARD16 number; - techCopyFunc copyfnc; /* function to copy parameter from client */ - xieBoolProc prepfnc; /* function to prepare for activation */ -} techVecRec; - -/* - Standard macro to verify correct technique parameter sizes . . . - Should work for any technique that has been properly defined -*/ - - -#define VALIDATE_TECHNIQUE_SIZE(tv, size, isDefault) \ - if ((isDefault && size) || ((!isDefault && \ - (tv->FixedTech && \ - ((!tv->OptionalTech && tv->techSize != size) || \ - (tv->OptionalTech && size && tv->techSize != size)))) || \ - (!tv->FixedTech && \ - ((!tv->OptionalTech && tv->techSize > size) || \ - (tv->OptionalTech && size && tv->techSize > size))))) \ - return(FALSE); - - -/* - * Technique resource definition - */ - -typedef struct _technique { - CARD8 speed; - CARD8 nameLength; - CARD16 techSize; - CARD8 *name; - techVecRec techvec; -} TechRec, *TechPtr; - -typedef struct _techgroup { - xieTypTechniqueGroup group; - CARD16 numTechniques; - CARD16 defaultNumber; - CARD16 defaultIndex; - CARD32 groupSize; /* Size in words */ - TechPtr tech; -} TechGroupRec, *TechGroupPtr; - -typedef struct _techtable { - CARD16 numGroups; /* Number of tech groups */ - CARD16 numDefaults; /* Number of default groups */ - CARD16 numTechniques; /* Total number of techniques */ - CARD16 pad; - CARD32 tableSize; /* All tech size (in words) */ - CARD32 defaultSize; /* Default size (in words) */ - TechGroupPtr techgroups; -} TechTable; - -#if defined(_XIEC_TECHNQ) - -#define DEFAULT_SPEED 128 - -#define NO_DEFAULT 0 -#define UNINITIALIZED 0 - -#define TECH_HAS_NO_PARMS TRUE -#define TECH_HAS_PARMS FALSE -#define TECH_PARMS_OPTIONAL TRUE -#define TECH_PARMS_REQUIRED FALSE -#define TECH_FIXED_SIZE TRUE -#define TECH_VARIABLE_SIZE FALSE - -/* - * Initialize nameLength to 0 and compute at runtime. Some compilers do not - * support the use of sizeof(static string) at compile time - */ - -static Bool NoParamCheck(floDefPtr flo, pointer rparms, pointer cparms, CARD16 tsize); -static Bool NoTechYet(floDefPtr flo, peDefPtr ped, pointer parm, pointer tech); - -#if XIE_FULL -/* Array of techniques for coloralloc */ -TechRec Tcoloralloc[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ALLOC-ALL", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecColorAllocAll / 4, - xieValColorAllocAll, - CopyCtoIAllocAll, - PrepCtoIAllocAll - } - } -#ifdef BEYOND_SI - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"MATCH", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecColorAllocMatch / 4, - xieValColorAllocMatch, - CopyCtoIAllocMatch, - NoTechYet - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"REQUANTIZE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecColorAllocRequantize / 4, - xieValColorAllocRequantize, - CopyCtoIAllocRequantize, - NoTechYet - } - } -#endif /* BEYOND_SI */ -}; -#endif - -#if XIE_FULL -/* Array of techniques for constrain */ -TechRec Tconstrain[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CLIP-SCALE", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecClipScale / 4, - xieValConstrainClipScale, - CopyPConstrainClipScale, - PrepPConstrainClipScale - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"HARD-CLIP", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecHardClip / 4, - xieValConstrainHardClip, - CopyPConstrainStandard, - PrepPConstrainStandard - } - } -}; -#endif - -#if XIE_FULL -/* Array of techniques for conversion from RGB to another colorspace */ -TechRec Tconvertfromrgb[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CIELAB", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecRGBToCIELab / 4, - xieValRGBToCIELab, - CopyPConvertFromRGBCIE, - PrepPConvertFromRGBCIE - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CIEXYZ", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecRGBToCIEXYZ / 4, - xieValRGBToCIEXYZ, - CopyPConvertFromRGBCIE, - PrepPConvertFromRGBCIE - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"YCbCr", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecRGBToYCbCr / 4, - xieValRGBToYCbCr, - CopyPConvertFromRGBYCbCr, - PrepPConvertFromRGBYCbCr - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"YCC", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecRGBToYCC / 4, - xieValRGBToYCC, - CopyPConvertFromRGBYCC, - PrepPConvertFromRGBYCC - } - } -}; -#endif - -#if XIE_FULL -/* Array of techniques for converting to RGB from another colorspace */ -TechRec Tconverttorgb[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CIELAB", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecCIELabToRGB / 4, - xieValCIELabToRGB, - CopyPConvertToRGBCIE, - PrepPConvertToRGBCIE - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CIEXYZ", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecCIEXYZToRGB / 4, - xieValCIEXYZToRGB, - CopyPConvertToRGBCIE, - PrepPConvertToRGBCIE - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"YCbCr", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecYCbCrToRGB / 4, - xieValYCbCrToRGB, - CopyPConvertToRGBYCbCr, - PrepPConvertToRGBYCbCr - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"YCC", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecYCCToRGB / 4, - xieValYCCToRGB, - CopyPConvertToRGBYCC, - PrepPConvertToRGBYCC - } - } -}; -#endif - -#if XIE_FULL -/* Array of techniques for convolve */ -TechRec Tconvolve[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CONSTANT", - { - TECH_HAS_PARMS, - TECH_PARMS_OPTIONAL, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecConvolveConstant / 4, - xieValConvolveConstant, - CopyConvolveConstant, - PrepConvolveStandard - } - } -#ifdef BEYOND_SI - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"REPLICATE", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecConvolveReplicate / 4, - xieValConvolveReplicate, - CopyConvolveReplicate, - PrepConvolveStandard - } - } -#endif /* BEYOND_SI */ -}; -#endif - -/* Array of techniques for decode */ -TechRec Tdecode[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"UNCOMPRESSED-SINGLE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeUncompressedSingle / 4, - xieValDecodeUncompressedSingle, - CopyICPhotoUnSingle, - PrepICPhotoUnSingle - } - } -#if XIE_FULL - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"UNCOMPRESSED-TRIPLE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeUncompressedTriple / 4, - xieValDecodeUncompressedTriple, - CopyICPhotoUnTriple, - PrepICPhotoUnTriple - } - } -#endif - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G31D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeG31D / 4, - xieValDecodeG31D, - CopyICPhotoG31D, - PrepICPhotoG31D - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G32D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeG32D / 4, - xieValDecodeG32D, - CopyICPhotoG32D, - PrepICPhotoG32D - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G42D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeG42D / 4, - xieValDecodeG42D, - CopyICPhotoG42D, - PrepICPhotoG42D - } - } -#if XIE_FULL - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"JPEG-BASELINE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecDecodeJPEGBaseline / 4, - xieValDecodeJPEGBaseline, - CopyICPhotoJPEGBaseline, - PrepICPhotoJPEGBaseline - } - } -#ifdef BEYOND_SI - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"JPEG-LOSSLESS", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeJPEGLossless / 4, - xieValDecodeJPEGLossless, - CopyICPhotoJPEGLossless, - PrepICPhotoJPEGLossless - } - } -#endif /* BEYOND_SI */ -#endif - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"TIFF-2", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeTIFF2 / 4, - xieValDecodeTIFF2, - CopyICPhotoTIFF2, - PrepICPhotoTIFF2 - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"TIFF-PACKBITS", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDecodeTIFFPackBits / 4, - xieValDecodeTIFFPackBits, - CopyICPhotoTIFFPackBits, - PrepICPhotoTIFFPackBits - } - } -}; - -#if XIE_FULL -/* Array of techniques for dither */ -TechRec Tdither[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ERROR-DIFFUSION", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDitherErrorDiffusion / 4, - xieValDitherErrorDiffusion, - CopyPDitherErrorDiffusion, - PrepPDitherErrorDiffusion - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ORDERED", - { - TECH_HAS_PARMS, - TECH_PARMS_OPTIONAL, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecDitherOrdered / 4, - xieValDitherOrdered, - CopyPDitherOrdered, - PrepPDitherOrdered - } - } -}; -#endif - -/* Array of techniques for encode */ -TechRec Tencode[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"UNCOMPRESSED-SINGLE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeUncompressedSingle / 4, - xieValEncodeUncompressedSingle, - CopyECPhotoUnSingle, - PrepECPhotoUnSingle - } - } -#if XIE_FULL - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"UNCOMPRESSED-TRIPLE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeUncompressedTriple / 4, - xieValEncodeUncompressedTriple, - CopyECPhotoUnTriple, - PrepECPhotoUnTriple - } - } -#endif - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G31D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeG31D / 4, - xieValEncodeG31D, - CopyECPhotoG31D, - PrepECPhotoG31D - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G32D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeG32D / 4, - xieValEncodeG32D, - CopyECPhotoG32D, - PrepECPhotoG32D - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CCITT-G42D", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeG42D / 4, - xieValEncodeG42D, - CopyECPhotoG42D, - PrepECPhotoG42D - } - } -#if XIE_FULL - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"JPEG-BASELINE", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_VARIABLE_SIZE, - UNINITIALIZED, - sz_xieTecEncodeJPEGBaseline / 4, - xieValEncodeJPEGBaseline, - CopyECPhotoJPEGBaseline, - PrepECPhotoJPEGBaseline - } - } -#ifdef BEYOND_SI - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"JPEG-LOSSLESS", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeJPEGLossless / 4, - xieValEncodeJPEGLossless, - CopyECPhotoJPEGLossless, - PrepECPhotoJPEGLossless - } - } -#endif /* BEYOND_SI */ -#endif - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"TIFF-2", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeTIFF2 / 4, - xieValEncodeTIFF2, - CopyECPhotoTIFF2, - PrepECPhotoTIFF2 - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"TIFF-PACKBITS", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecEncodeTIFFPackBits / 4, - xieValEncodeTIFFPackBits, - CopyECPhotoTIFFPackBits, - PrepECPhotoTIFFPackBits - } - } -}; - -#if XIE_FULL -/* Array of techniques for gamut */ -TechRec Tgamut[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"NONE", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGamutNone / 4, - xieValGamutNone, - (techCopyFunc) CopyPGamut, - PrepPGamut - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CLIP-RGB", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGamutClipRGB / 4, - xieValGamutClipRGB, - (techCopyFunc) CopyPGamut, - PrepPGamut - } - } -}; -#endif - -/* Array of techniques for geometry */ -TechRec Tgeometry[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ANTIALIAS", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomAntialias / 4, - xieValGeomAntialias, - CopyGeomAntiAlias, - PrepGeomAntiAlias - } - } -#ifdef BEYOND_SI - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ANTIALIAS-BY-AREA", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomAntialiasByArea / 4, - xieValGeomAntialiasByArea, - NoParamCheck, - NoTechYet - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"ANTIALIAS-BY-LOWPASS", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomAntialiasByLowpass / 4, - xieValGeomAntialiasByLPF, - NoParamCheck, - NoTechYet - } - } -#endif -#if XIE_FULL - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"BILINEAR-INTERPOLATION", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomBilinearInterpolation / 4, - xieValGeomBilinearInterp, - CopyGeomBilinearInterp, - PrepGeomBilinearInterp - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"GAUSSIAN", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomGaussian / 4, - xieValGeomGaussian, - CopyGeomGaussian, - PrepGeomGaussian - } - } -#endif - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"NEAREST-NEIGHBOR", - { - TECH_HAS_PARMS, - TECH_PARMS_OPTIONAL, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecGeomNearestNeighbor / 4, - xieValGeomNearestNeighbor, - CopyGeomNearestNeighbor, - PrepGeomNearestNeighbor - } - } -}; - -#if XIE_FULL -/* Array of techniques for histogram */ -TechRec Thistogram[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"FLAT", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecHistogramFlat / 4, - xieValHistogramFlat, - CopyPHistogramFlat, - PrepPHistogramFlat - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"GAUSSIAN", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecHistogramGaussian / 4, - xieValHistogramGaussian, - CopyPHistogramGaussian, - PrepPHistogramGaussian - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"HYPERBOLIC", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecHistogramHyperbolic / 4, - xieValHistogramHyperbolic, - CopyPHistogramHyperbolic, - PrepPHistogramHyperbolic - } - } -}; -#endif - -#if XIE_FULL -/* Array of techniques for white adjust */ -TechRec Twhiteadjust[] = { - { DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"NONE", - { - TECH_HAS_NO_PARMS, - TECH_HAS_NO_PARMS, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecWhiteAdjustNone / 4, - xieValWhiteAdjustNone, - (techCopyFunc) CopyPWhiteAdjustNone, - PrepPWhiteAdjustNone - } - } - ,{ DEFAULT_SPEED, - UNINITIALIZED, - UNINITIALIZED, - (CARD8 *)"CIELAB-SHIFT", - { - TECH_HAS_PARMS, - TECH_PARMS_REQUIRED, - TECH_FIXED_SIZE, - UNINITIALIZED, - sz_xieTecWhiteAdjustCIELabShift / 4, - xieValWhiteAdjustCIELabShift, - (techCopyFunc) CopyPWhiteAdjustCIELabShift, - PrepPWhiteAdjustCIELabShift - } - } -}; -#endif - -TechGroupRec techArray[] = { -#if XIE_FULL - { - xieValColorAlloc, - sizeof(Tcoloralloc)/sizeof(TechRec), - xieValColorAllocAll, - UNINITIALIZED, - UNINITIALIZED, - Tcoloralloc - } - ,{ - xieValConstrain, - sizeof(Tconstrain)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Tconstrain - } - ,{ - xieValConvertFromRGB, - sizeof(Tconvertfromrgb)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Tconvertfromrgb - } - ,{ - xieValConvertToRGB, - sizeof(Tconverttorgb)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Tconverttorgb - } - ,{ - xieValConvolve, - sizeof(Tconvolve)/sizeof(TechRec), - xieValConvolveConstant, - UNINITIALIZED, - UNINITIALIZED, - Tconvolve - }, -#endif - { - xieValDecode, - sizeof(Tdecode)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Tdecode - } -#if XIE_FULL - ,{ - xieValDither, - sizeof(Tdither)/sizeof(TechRec), - xieValDitherErrorDiffusion, - UNINITIALIZED, - UNINITIALIZED, - Tdither - } -#endif - ,{ - xieValEncode, - sizeof(Tencode)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Tencode - } -#if XIE_FULL - ,{ - xieValGamut, - sizeof(Tgamut)/sizeof(TechRec), - xieValGamutNone, - UNINITIALIZED, - UNINITIALIZED, - Tgamut - } -#endif - ,{ - xieValGeometry, - sizeof(Tgeometry)/sizeof(TechRec), - xieValGeomNearestNeighbor, - UNINITIALIZED, - UNINITIALIZED, - Tgeometry - } -#if XIE_FULL - ,{ - xieValHistogram, - sizeof(Thistogram)/sizeof(TechRec), - NO_DEFAULT, - UNINITIALIZED, - UNINITIALIZED, - Thistogram - } - ,{ - xieValWhiteAdjust, - sizeof(Twhiteadjust)/sizeof(TechRec), - xieValWhiteAdjustNone, - UNINITIALIZED, - UNINITIALIZED, - Twhiteadjust - } -#endif -}; - -TechTable techTable = { - sizeof(techArray)/sizeof(TechGroupRec), - UNINITIALIZED, - UNINITIALIZED, - UNINITIALIZED, - UNINITIALIZED, - UNINITIALIZED, - techArray -}; - -#endif /* if defined(_XIEC_TECHNQ) */ - -extern Bool technique_init(void); -extern techVecPtr FindTechnique(xieTypTechniqueGroup group, CARD16 number); - -#if 0 -extern Bool TechNeedsParams(); -extern CARD16 TechDefault(); -#endif - -#endif /* end _XIEH_TECHNQ */ Index: xc/programs/Xserver/XIE/mixie/Imakefile diff -u xc/programs/Xserver/XIE/mixie/Imakefile:3.17 xc/programs/Xserver/XIE/mixie/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/Imakefile:3.17 Wed Jan 17 17:12:59 2001 +++ xc/programs/Xserver/XIE/mixie/Imakefile Sat Feb 28 21:41:58 2004 @@ -1,40 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:33 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/Imakefile,v 3.17 2001/01/17 22:12:59 dawes Exp $ - -#define IHaveModules -#include - -#if BuildDIS -SUBDIRS = control fax import process export -OBJS = control/?*.o fax/?*.o import/?*.o process/?*.o export/?*.o -DONES = control/DONE fax/DONE import/DONE process/DONE export/DONE -#else -SUBDIRS = control fax import jpeg process export -OBJS = control/?*.o fax/?*.o import/?*.o jpeg/?*.o process/?*.o export/?*.o -DONES = control/DONE fax/DONE import/DONE jpeg/DONE process/DONE export/DONE -#endif - -#define IHaveSubdirs - - -#if HasParallelMake -MakeMutex($(SUBDIRS) $(OBJS) $(DONES)) -#endif - -#if HasGnuMake || HasBsdMake -$(DONES): $(SUBDIRS) -#endif - -DepLibraryModuleTarget(mixie,$(SUBDIRS) $(DONES),$(OBJS)) - -ForceSubdirs($(SUBDIRS)) - -DependSubdirs($(SUBDIRS)) - -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - Index: xc/programs/Xserver/XIE/mixie/control/Imakefile diff -u xc/programs/Xserver/XIE/mixie/control/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/control/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/control/Imakefile:3.6 Wed Jan 17 17:13:00 2001 +++ xc/programs/Xserver/XIE/mixie/control/Imakefile Sat Feb 28 21:41:58 2004 @@ -1,41 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:34 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/control/Imakefile,v 3.6 2001/01/17 22:13:00 dawes Exp $ - -XCOMM build device dependent machine independent control objects - -#define IHaveModules -#include - - SRCS = analyze.c \ - domain.c \ - floman.c \ - sched.c \ - strip.c - - OBJS = analyze.o \ - domain.o \ - floman.o \ - sched.o \ - strip.o - -#if BuildDIS - DEFINES = -DXIE_DIS -#endif - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(ctrl,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/control/analyze.c diff -u xc/programs/Xserver/XIE/mixie/control/analyze.c:1.5 xc/programs/Xserver/XIE/mixie/control/analyze.c:removed --- xc/programs/Xserver/XIE/mixie/control/analyze.c:1.5 Fri Dec 14 14:58:16 2001 +++ xc/programs/Xserver/XIE/mixie/control/analyze.c Sat Feb 28 21:41:58 2004 @@ -1,188 +0,0 @@ -/* $Xorg: analyze.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module analyze.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - analyze.c -- DDXIE prototype (simple minded) DAG analyzer - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/control/analyze.c,v 1.5 2001/12/14 19:58:16 dawes Exp $ */ - -#define _XIEC_ANALYZE - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include - - -/* - * routines called from DIXIE - */ -int DAGalyze(); - - -/*------------------------------------------------------------------------ ------------------------ analyze (sort of) the DAG ------------------------ -------------------------------------------------------------------------*/ -int DAGalyze(flo) - floDefPtr flo; -{ - int ok = TRUE; - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - - /* establish our default flo manager - */ - InitFloManager(flo); - - /* choose element handlers - */ - for(ped = lst->flink; ok && !ListEnd(ped,lst); ped = ped->flink) - switch(ped->elemRaw->elemType) { -#if XIE_FULL - case xieElemImportClientLUT: ok = miAnalyzeICLUT(flo,ped); break; - case xieElemImportClientPhoto: ok = miAnalyzeICPhoto(flo,ped); break; - case xieElemImportClientROI: ok = miAnalyzeICROI(flo,ped); break; - case xieElemImportDrawable: ok = miAnalyzeIDraw(flo,ped); break; - case xieElemImportDrawablePlane:ok = miAnalyzeIDrawP(flo,ped); break; - case xieElemImportLUT: ok = miAnalyzeILUT(flo,ped); break; - case xieElemImportPhotomap: ok = miAnalyzeIPhoto(flo,ped); break; - case xieElemImportROI: ok = miAnalyzeIROI(flo,ped); break; - case xieElemArithmetic: ok = miAnalyzeArith(flo,ped); break; - case xieElemBandCombine: ok = miAnalyzeBandCom(flo,ped); break; - case xieElemBandExtract: ok = miAnalyzeBandExt(flo,ped); break; - case xieElemBandSelect: ok = miAnalyzeBandSel(flo,ped); break; - case xieElemBlend: ok = miAnalyzeBlend(flo,ped); break; - case xieElemCompare: ok = miAnalyzeCompare(flo,ped); break; - case xieElemConstrain: ok = miAnalyzeConstrain(flo,ped); break; - case xieElemConvertFromIndex: ok = miAnalyzeCvtFromInd(flo,ped); break; - case xieElemConvertFromRGB: ok = miAnalyzeFromRGB(flo,ped); break; - case xieElemConvertToIndex: ok = miAnalyzeCvtToInd(flo,ped); break; - case xieElemConvertToRGB: ok = miAnalyzeToRGB(flo,ped); break; - case xieElemConvolve: ok = miAnalyzeConvolve(flo,ped); break; - case xieElemDither: ok = miAnalyzeDither(flo,ped); break; - case xieElemGeometry: ok = miAnalyzeGeometry(flo,ped); break; - case xieElemLogical: ok = miAnalyzeLogic(flo,ped); break; - case xieElemMatchHistogram: ok = miAnalyzeMatchHist(flo,ped); break; - case xieElemMath: ok = miAnalyzeMath(flo,ped); break; - case xieElemPasteUp: ok = miAnalyzePasteUp(flo,ped); break; - case xieElemPoint: ok = miAnalyzePoint(flo,ped); break; - case xieElemUnconstrain: ok = miAnalyzeUnconstrain(flo,ped); break; - case xieElemExportClientHistogram:ok = miAnalyzeECHist(flo,ped); break; - case xieElemExportClientLUT: ok = miAnalyzeECLUT(flo,ped); break; - case xieElemExportClientPhoto: ok = miAnalyzeECPhoto(flo,ped); break; - case xieElemExportClientROI: ok = miAnalyzeECROI(flo,ped); break; - case xieElemExportDrawable: ok = miAnalyzeEDraw(flo,ped); break; - case xieElemExportDrawablePlane:ok = miAnalyzeEDrawP(flo,ped); break; - case xieElemExportLUT: ok = miAnalyzeELUT(flo,ped); break; - case xieElemExportPhotomap: ok = miAnalyzeEPhoto(flo,ped); break; - case xieElemExportROI: ok = miAnalyzeEROI(flo,ped); break; -#else - case xieElemImportClientLUT: ok = miAnalyzeICLUT(flo,ped); break; - case xieElemImportClientPhoto: ok = miAnalyzeICPhoto(flo,ped); break; - case xieElemImportDrawable: ok = miAnalyzeIDraw(flo,ped); break; - case xieElemImportDrawablePlane:ok = miAnalyzeIDrawP(flo,ped); break; - case xieElemImportLUT: ok = miAnalyzeILUT(flo,ped); break; - case xieElemImportPhotomap: ok = miAnalyzeIPhoto(flo,ped); break; - case xieElemGeometry: ok = miAnalyzeGeometry(flo,ped); break; - case xieElemPoint: ok = miAnalyzePoint(flo,ped); break; - case xieElemExportClientLUT: ok = miAnalyzeECLUT(flo,ped); break; - case xieElemExportClientPhoto: ok = miAnalyzeECPhoto(flo,ped); break; - case xieElemExportDrawable: ok = miAnalyzeEDraw(flo,ped); break; - case xieElemExportDrawablePlane:ok = miAnalyzeEDrawP(flo,ped); break; - case xieElemExportLUT: ok = miAnalyzeELUT(flo,ped); break; - case xieElemExportPhotomap: ok = miAnalyzeEPhoto(flo,ped); break; -#endif - default: ElementError(flo,ped, return(FALSE)); - } - return(ok); -} /* end DAGalyze */ - -/* end module analyze.c */ Index: xc/programs/Xserver/XIE/mixie/control/domain.c diff -u xc/programs/Xserver/XIE/mixie/control/domain.c:1.5 xc/programs/Xserver/XIE/mixie/control/domain.c:removed --- xc/programs/Xserver/XIE/mixie/control/domain.c:1.5 Fri Dec 14 14:58:17 2001 +++ xc/programs/Xserver/XIE/mixie/control/domain.c Sat Feb 28 21:41:58 2004 @@ -1,501 +0,0 @@ -/* $Xorg: domain.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module domain.c ****/ -/****************************************************************************** -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - domain.c -- DDXIE Process Domain routines for flo manager - - Dean Verheiden -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/control/domain.c,v 1.5 2001/12/14 19:58:17 dawes Exp $ */ - -#define _XIEC_DOMAIN - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules -*/ -Bool InitProcDomain(); -void ResetProcDomain(); - -static Bool NoDomainSyncDomain(); -static INT32 NoDomainGetRun(); - -#if XIE_FULL -static Bool RunLengthSyncDomain(); -static INT32 RunLengthGetRun(); -static Bool ControlPlaneSyncDomain(); -static INT32 ControlPlaneGetRun(); -#endif - -Bool InitProcDomain(flo,ped,dtag,offX,offY) -floDefPtr flo; -peDefPtr ped; -xieTypPhototag dtag; -INT32 offX,offY; -{ -peTexPtr pet = ped->peTex; -receptorPtr rcp = &pet->receptor[ped->inCnt-1]; - - if (!dtag) { /* No process domain */ - pet->roiinit = NoDomainSyncDomain; - pet->roiget = NoDomainGetRun; - - return TRUE; - } -#if !XIE_FULL - else - ImplementationError(flo,ped, return(FALSE)); -#else - if (!InitReceptor(flo,ped,rcp,0,1,ALL_BANDS,NO_BANDS)) - return FALSE; - - pet->domXoff = offX; - pet->domYoff = offY; - - if (rcp->band[0].format->class == RUN_LENGTH) { - pet->roiinit = RunLengthSyncDomain; - pet->roiget = RunLengthGetRun; - } else { - bandPtr rband = &rcp->band[0]; - bandPtr band = &pet->emitter[0]; - CARD32 b; - - pet->roiinit = ControlPlaneSyncDomain; - pet->roiget = ControlPlaneGetRun; - - /* See if there is some intersection between the ROI and image*/ - for(b = 0; b < ped->outFlo.bands; b++, band++, rband++) - if ( pet->domXoff + (INT32)rband->format->width <= 0 || - pet->domXoff >= (INT32)band->format->width || - pet->domYoff + (INT32)rband->format->height <= 0 || - pet->domYoff >= (INT32)band->format->height) { - SetBandThreshold(rband,~0); - IgnoreBand(rband); - band->allpass = TRUE; /* No regions any line */ - } - } - return (TRUE); -#endif -} - - -void ResetProcDomain(ped) -peDefPtr ped; -{ -peTexPtr pet = ped->peTex; -bandPtr band = &pet->emitter[0]; -int b; - - pet->roi = (pointer) NULL; - pet->roiinit = (Bool (*)()) NULL; - pet->roiget = (INT32 (*)()) NULL; - pet->domXoff = 0; - pet->domYoff = 0; - - for(b = 0; b < ped->outFlo.bands; b++, band++) { - band->pcroi = (pointer)NULL; - band->xindex = 0; - band->xcount = 0; - band->ypass = FALSE; - band->inside = FALSE; - band->allpass = FALSE; - } -} - - -/* Called when elements do not have an optional process domain */ -static Bool NoDomainSyncDomain(flo,ped,bnd,purge) -floDefPtr flo; -peDefPtr ped; -bandPtr bnd; -Bool purge; -{ - bnd->xcount = 0; - return (TRUE); -} - -static INT32 NoDomainGetRun(flo,pet,bnd) -floDefPtr flo; -peTexPtr pet; -bandPtr bnd; -{ - if (bnd->xcount) - return(0); - else - return(bnd->xcount = (INT32)bnd->format->width); -} - -#if XIE_FULL -/* Initialize run length structures for desired line */ -static Bool RunLengthSyncDomain(flo,ped,bnd,purge) -floDefPtr flo; -peDefPtr ped; -bandPtr bnd; -Bool purge; -{ -peTexPtr pet = ped->peTex; -bandPtr rband = &pet->receptor[ped->inCnt-1].band[bnd->band]; -ROIPtr proi; -linePtr lp; -INT32 ytrans; - - /* Grab table if necessary */ - if (!pet->roi) - if (!(pet->roi = GetSrcBytes(flo,pet,rband,0,1,KEEP))) - return (FALSE); - - proi = (ROIPtr)pet->roi; - - /* Make sure that there is some intersection between the ROI and image*/ - if (bnd->allpass || - proi->x + pet->domXoff + proi->width <= 0 || - proi->x + pet->domXoff >= (INT32)bnd->format->width || - proi->y + pet->domYoff + proi->height <= 0 || - proi->y + pet->domYoff >= (INT32)bnd->format->height) { - bnd->allpass = TRUE; /* No regions any line */ - bnd->xcount = 0; - return (TRUE); - } - - /* If no table or current y is past y desired, start at the beginning */ - lp = (linePtr)bnd->pcroi; - ytrans = bnd->current - pet->domYoff; - if (!lp || lp->y > ytrans) { - lp = (linePtr)&proi[1]; - if (lp->y > ytrans) { /* Make sure we are after first entry */ - bnd->ypass = TRUE; /* No regions this line */ - bnd->xcount = 0; - return (TRUE); - } - } - - /* - step through structures until corresponding y is found or until - table is exhausted - */ - while (lp < proi->lend && ytrans >= lp->y + lp->nline) - lp = (linePtr)RUNPTR(lp->nrun); - - /* If some domains for this line, set up for processing */ - if (!(bnd->ypass = lp >= proi->lend || ytrans < lp->y)) { - bnd->pcroi = (pointer)lp; - bnd->xcount = (proi->x + pet->domXoff) < 0 ? - proi->x + pet->domXoff : 0; - bnd->xindex = 0; - bnd->inside = lp->nrun && !RUNPTR(0)->dstart && - proi->x + pet->domXoff <= 0; - } else { - bnd->xcount = 0; - if (lp >= proi->lend) /* Tidy up garbage pointer */ - bnd->pcroi = (pointer)NULL; - } - - return (TRUE); -} /* SyncDomain */ - -static INT32 RunLengthGetRun(flo,pet,bnd) -floDefPtr flo; -peTexPtr pet; -bandPtr bnd; -{ -ROIPtr proi = (ROIPtr)pet->roi; -linePtr lp = (linePtr)bnd->pcroi; -runPtr rp; -INT32 width = (INT32)bnd->format->width; -INT32 xcount = bnd->xcount; -INT32 startx, nextx, length; -CARD32 xindex, nrun; -Bool inside; - - /* Make sure that SyncDomain was called first */ - if (!proi) ImplementationError(flo,pet->peDef,return(0)); - - /* See if there are any processing domains for the current line */ - if (bnd->allpass || bnd->ypass || xcount >= width) { - if (xcount) - return(0); /* off edge of image */ - else - return (-(bnd->xcount = width)); - } - - rp = RUNPTR(0); - nrun = lp->nrun; - inside = bnd->inside; - xindex = bnd->xindex; - - /* Handle left clip */ - if (xcount < 0) { - while (xindex < nrun && - (!inside && xcount + rp[xindex].dstart < 0 || - inside && xcount + rp[xindex].length < 0)) { - if (inside) - xcount += rp[xindex++].length; - else - xcount += rp[xindex].dstart; - inside = !inside; - } - - /* This should have already been caught in init */ - if (xindex >= nrun) { /* no intersection */ - bnd->ypass = TRUE; - return (-(bnd->xcount = width)); - } - - startx = 0; - } else - startx = xcount; - - /* Handle right clip */ - if (xindex >= nrun || - inside && xcount + rp[xindex].length > width || - !inside && xcount + rp[xindex].dstart > width) { - bnd->ypass = TRUE; - nextx = width; - } else if (inside) - nextx = xcount + rp[xindex++].length; - else { - nextx = xcount + rp[xindex].dstart; - /* Handle case where first domain starts past start of image */ - if (!xindex && proi->x + pet->domXoff > 0) - nextx += proi->x + pet->domXoff; - } - - length = (inside) ? nextx - startx : startx - nextx; - - /* toggle inside/outside */ - bnd->inside = !inside; - bnd->xcount = nextx; - bnd->xindex = xindex; - - return (length); -} /* GetRun */ - -/* Initialize control plane structures for desired line */ -static Bool ControlPlaneSyncDomain(flo,ped,bnd,purge) -floDefPtr flo; -peDefPtr ped; -bandPtr bnd; -Bool purge; -{ -peTexPtr pet = ped->peTex; -bandPtr rband; -INT32 ytrans; - - bnd->xcount = 0; - - /* If init routine determined no intersection, pass line */ - if (bnd->allpass) - return (TRUE); - - rband = &pet->receptor[ped->inCnt-1].band[bnd->band]; - ytrans = bnd->current - pet->domYoff; - - if (ytrans < 0 || ytrans >= (INT32)rband->format->height) { - bnd->ypass = TRUE; - return (TRUE); - } else - bnd->ypass = FALSE; - - /* Grab control plane line */ - if (!(pet->roi = bnd->pcroi = GetSrc(flo,pet,rband,ytrans,purge))){ - if (purge) - FreeData(flo,pet,rband,rband->current); - else - SetBandThreshold(rband,rband->available + 1); - return (FALSE); - } - - if ( pet->domXoff > 0 ) { - bnd->inside = FALSE; - bnd->xindex = 0; - } else { - bnd->xindex = -pet->domXoff; - bnd->inside = LOG_tstbit((LogInt *)bnd->pcroi,bnd->xindex) != 0; - } - - return (TRUE); -} - -static INT32 countZeros(line,offset,iedge) -LogInt *line; -INT32 offset,iedge; -{ -INT32 count = 0; -CARD32 index = (CARD32)offset, edge = (CARD32)iedge; - - while (index < edge && !LOG_tstbit(line,index)) { - count++; - index++; - } - - return(count); -} - -INT32 countOnes(line,offset,iedge) -LogInt *line; -INT32 offset,iedge; -{ -INT32 count = 0; -CARD32 index = (CARD32)offset, edge = (CARD32)iedge; - - while (index < edge && LOG_tstbit(line,index)) { - count++; - index++; - } - - return(count); -} - -static INT32 ControlPlaneGetRun(flo,pet,bnd) -floDefPtr flo; -peTexPtr pet; -bandPtr bnd; -{ -peDefPtr ped = pet->peDef; -bandPtr rband = &pet->receptor[ped->inCnt-1].band[bnd->band]; -INT32 xcount = bnd->xcount; -INT32 width = (INT32)bnd->format->width; - -LogInt *cpl; -Bool inside; -INT32 xindex, dwidth, Xoff, length, edge; - - /* See if there is every anything to do with this band */ - if (bnd->allpass || bnd->ypass) { - if (xcount) - return(0); - else - return(-(bnd->xcount = width)); - } - - /* Make sure that there is something left to look at */ - if (xcount >= width) - return (0); - - /* defer sucking these out til necessary */ - cpl = (LogInt *)bnd->pcroi; - inside = bnd->inside; - xindex = bnd->xindex; - dwidth = (INT32)rband->format->width; - Xoff = pet->domXoff; - - /* Figure out the maximum bound to check */ - edge = (Xoff + dwidth > width) ? width - Xoff : dwidth; - - /* See if we are off the side of the control plane */ - if (!xcount && pet->domXoff > 0) { - xcount = length = Xoff + (xindex = countZeros(cpl, 0, edge)); - } else if (inside) { - xcount += (length = countOnes(cpl, xindex, edge)); - xindex += length; - } else { - xcount += (length = countZeros(cpl, xindex, edge)); - xindex += length; - /* If control plane ends before image, push to edge */ - if (xindex >= edge && xcount < width) { - length += width - xcount; - xcount = width; - } - } - - bnd->inside = !inside; - bnd->xcount = xcount; - bnd->xindex = xindex; - - return ((inside) ? length : -length); -} -#endif - -/* end domain.c */ Index: xc/programs/Xserver/XIE/mixie/control/floman.c diff -u xc/programs/Xserver/XIE/mixie/control/floman.c:3.5 xc/programs/Xserver/XIE/mixie/control/floman.c:removed --- xc/programs/Xserver/XIE/mixie/control/floman.c:3.5 Fri Dec 14 14:58:17 2001 +++ xc/programs/Xserver/XIE/mixie/control/floman.c Sat Feb 28 21:41:58 2004 @@ -1,529 +0,0 @@ -/* $Xorg: floman.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module floman.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - floman.c -- DDXIE photoflo manager - - Robert NC Shelley -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/control/floman.c,v 3.5 2001/12/14 19:58:17 dawes Exp $ */ - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* routines used internal to this module - */ -static int flo_link(floDefPtr flo); -static int flo_startup(floDefPtr flo); -static int flo_resume(floDefPtr flo); -static int flo_shutdown(floDefPtr flo); -static int flo_destroy(floDefPtr flo); - -/* DIXIE to DDXIE photoflo management entry points - */ -static floVecRec floManagerVec = { - flo_link, - flo_startup, - flo_resume, - flo_shutdown, - flo_destroy - }; - -/*------------------------------------------------------------------------ ------------------------- Initialize Photoflo Manager --------------------- -------------------------------------------------------------------------*/ -int InitFloManager(floDefPtr flo) -{ - /* plug in the DDXIE photoflo management vector */ - flo->floVec = &floManagerVec; - - return(TRUE); -} /* end InitFloManager */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -int MakePETex( - floDefPtr flo, - peDefPtr ped, - CARD32 extend, - Bool inSync, - Bool bandSync) -{ - peTexPtr pet; - inFloPtr inf; - receptorPtr rcp; - bandPtr bnd; - int b, i; - - /* attach an execution context to the photo element definition */ - if(!(pet = (peTexPtr) XieCalloc(sizeof(peTexRec) + (extend + 4) + - ped->inCnt * sizeof(receptorRec)))) - AllocError(flo,ped, return(FALSE)); - - /* init the new peTex */ - ped->peTex = pet; - pet->peDef = ped; - pet->inSync = inSync; - pet->bandSync = bandSync; - pet->outFlo = &ped->outFlo; - pet->receptor = (receptorPtr) &pet[1]; - for(b = 0; b < xieValMaxBands; b++) { - bnd = &pet->emitter[b]; - bnd->band = b; - bnd->format = &ped->outFlo.format[b]; - ListInit(&bnd->stripLst); - } - /* init the new receptors */ - for(i = 0; i < ped->inCnt; i++) { - inf = &ped->inFloLst[i]; - rcp = &pet->receptor[i]; - rcp->inFlo = inf; - for(b = 0; b < xieValMaxBands; b++) { - bnd = &rcp->band[b]; - bnd->band = b; - bnd->isInput = TRUE; - bnd->receptor = rcp; - bnd->format = &rcp->inFlo->format[b]; - ListInit(&bnd->stripLst); - } - } - if(extend) { - /* In case private structure has 'double', round up */ - unsigned char *ptr = (pointer) &pet->receptor[ped->inCnt]; - pet->private = (pointer) - (((unsigned long)ptr + sizeof(double)-1) & -sizeof(double)); - } - - return(TRUE); -} /* end MakePETex */ - - -/*------------------------------------------------------------------------ ---------------------- prepare Receptors for execution -------------------- -------------------------------------------------------------------------*/ -Bool InitReceptors( - floDefPtr flo, - peDefPtr ped, - CARD32 mapSize, - CARD32 threshold) -{ - receptorPtr rcp = ped->peTex->receptor; - int i; - - /* initialize each receptor (1 per inFlo) */ - for(i = 0; i < ped->inCnt; ++rcp, ++i) - if(!InitReceptor(flo,ped,rcp,mapSize,threshold,(CARD8)~0,(CARD8)0)) - return(FALSE); - - return(TRUE); -} /* end InitReceptors */ - - -/*------------------------------------------------------------------------ ---------------------- prepare Receptors for execution -------------------- -------------------------------------------------------------------------*/ -Bool InitReceptor( - floDefPtr flo, - peDefPtr ped, - receptorPtr rcp, - CARD32 mapSize, - CARD32 threshold, - unsigned process, - unsigned bypass) -{ - bandPtr bnd = rcp->band; - int b, bands = rcp->inFlo->bands; - - /* bands to pass rather than process */ - rcp->bypass = rcp->inFlo->index == SRCt1 ? bypass : NO_BANDS; - - /* initialize each band */ - for(b = 0; b < bands; ++bnd, ++b) - if(process & 1<peTex; - int b; - - /* initialize the outFlo and emitter */ - ped->outFlo.active = NO_BANDS; - ped->outFlo.ready = NO_BANDS; - - /* initialize each band */ - for(b = 0; b < ped->outFlo.bands; b++) { - if(pet->receptor[SRCt1].bypass & 1<emitter[b], mapSize, (CARD32) 0, inPlace)) - return(FALSE); - } - return(TRUE); -} /* end InitEmitter */ - - -/*------------------------------------------------------------------------ -------------- prepare a receptor or emitter band for execution ----------- -------------------------------------------------------------------------*/ -Bool InitBand( - floDefPtr flo, - peDefPtr ped, - bandPtr bnd, - CARD32 mapSize, - CARD32 threshold, - INT32 inPlace) -{ - bnd->threshold = threshold; - bnd->available = 0; - bnd->minGlobal = 0; - bnd->minLocal = 0; - bnd->current = 0; - bnd->maxLocal = 0; - bnd->maxGlobal = 0; - bnd->pitch = IsCanonic(bnd->format->class) ? bnd->format->pitch>>3 : 1; - bnd->strip = NULL; - bnd->data = NULL; - bnd->dataMap = NULL; - bnd->final = FALSE; - if((bnd->mapSize = mapSize) && - !(bnd->dataMap = (CARD8**)XieMalloc(mapSize * sizeof(CARD8*)))) - FloAllocError(flo,0,0, return(FALSE)); - - if(bnd->isInput) { - bnd->receptor->active |= 1<band; - bnd->receptor->attend |= 1<band; - bnd->inPlace = NULL; - if(bnd->band == 0 || !bnd->receptor->band[0].replicate) { - if(ped->flags.putData) - ++flo->floTex->imports; - - if(!bnd->receptor->admit) - ++ped->peTex->admissionCnt; - bnd->receptor->admit |= 1<band; - - if(bnd->replicate) { - int b = 1; - /* replicate band zero's format (into the phantom bands - * that will be sharing its data) and initialize them too - */ - do - if(bnd->replicate & 1<format; - bnd[b].format->band = b; - InitBand(flo,ped,&bnd[b],NO_DATAMAP,threshold,NO_INPLACE); - } - while(++b < xieValMaxBands); - } - } - } else { /* IsEmitter */ - bnd->inPlace = ((inPlace == NO_INPLACE) - ? NULL : &ped->peTex->receptor[inPlace].band[bnd->band]); - ped->peTex->emitting |= 1<band; - if(ped->flags.getData) { - ped->outFlo.active |= 1<band; - flo->floTex->exports++; - } - } - return(TRUE); -} /* end InitBand */ - - -/*------------------------------------------------------------------------ -------------------- get rid of left over strips etc. --------------------- -------------------------------------------------------------------------*/ -void ResetReceptors(peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - receptorPtr rcp; - int b,i; - - for(i = 0; i < ped->inCnt; i++) { - for(rcp = &pet->receptor[i], b = 0; b < xieValMaxBands; ++b) { - if(rcp->forward & 1<outFlo.output[b]); - } - rcp->forward = NO_BANDS; - ResetBand(&rcp->band[b]); - } - rcp->admit = NO_BANDS; - rcp->ready = NO_BANDS; - rcp->active = NO_BANDS; - rcp->attend = NO_BANDS; - rcp->bypass = NO_BANDS; - } -} /* end ResetReceptors */ - - -/*------------------------------------------------------------------------ -------------------- get rid of left over strips etc. --------------------- -------------------------------------------------------------------------*/ -void ResetEmitter(peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - int b; - - pet->emitting = NO_BANDS; - - for(b = 0; b < ped->outFlo.bands; ++b) - ResetBand(&pet->emitter[b]); -} /* end ResetEmitter */ - - -/*------------------------------------------------------------------------ -------------------- get rid of left over strips etc. --------------------- -------------------------------------------------------------------------*/ -void ResetBand(bandPtr bnd) -{ - bnd->replicate = NO_BANDS; - - FreeStrips(&bnd->stripLst); - - if(bnd->dataMap) - bnd->dataMap = (CARD8 **)XieFree(bnd->dataMap); -} /* end ResetBand */ - - -/*------------------------------------------------------------------------ --------------------------------- Link ----------------------------------- -------------------------------------------------------------------------*/ -static int flo_link(floDefPtr flo) -{ - peDefPtr ped; - ddElemVecRec vec; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - - /* create and initialize our photoflo's execution context */ - if(!flo->floTex && !(flo->floTex = (floTexPtr) XieMalloc(sizeof(floTexRec)))) - FloAllocError(flo,0,0, return(FALSE)); - - flo->floTex->yieldPtr = NULL; - - /* create new element execution contexts for elements that have changed */ - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) - if(flo->flags.modified) { /* XXX should be ped->flags.modified */ - if(ped->peTex) { /* fix this after beta release */ - vec = ped->ddVec; /* shouldn't have to save vetors */ - Destroy(flo,ped); /* destroy the old element context */ - ped->ddVec = vec; /* shouldn't have to restore them*/ - } - if(!Create(flo,ped)) - return(FALSE); - } - return(TRUE); -} /* end flo_link */ - - -/*------------------------------------------------------------------------ --------------------------------- Startup ----------------------------------- -------------------------------------------------------------------------*/ -static int flo_startup(floDefPtr flo) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - int status; - - /* initialize our assistant managers */ - InitScheduler(flo); - InitStripManager(flo); - - flo->floTex->imports = flo->floTex->exports = 0; - flo->floTex->exitCnt = 0; - - /* initialize all the elements */ - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) { - ped->peTex->admissionCnt = 0; - ped->peTex->schedCnt = 0; - ped->peTex->scheduled = 0; - if(Initialize(flo,ped)) - ped->flags.modified = FALSE; - else - break; - } - flo->flags.active = TRUE; - flo->flags.aborted = FALSE; - flo->flags.modified = FALSE; - - /* Call the scheduler -- there are no ImportClient elements the first time - */ - if(ferrCode(flo)) { - flo_shutdown(flo); - status = FALSE; - } else { - status = Execute(flo, NULL); - } - return(status); -} /* end flo_startup */ - - -/*------------------------------------------------------------------------ --------------------------------- Resume ----------------------------------- -------------------------------------------------------------------------*/ -static int flo_resume(floDefPtr flo) -{ - /* not implemented in the SI */ - - FloImplementationError(flo,0,0, return(FALSE)); -} /* end flo_resume */ - - -/*------------------------------------------------------------------------ ------------------------------- Shutdown ---------------------------------- -------------------------------------------------------------------------*/ -static int flo_shutdown(floDefPtr flo) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - - if(flo->floTex) { - /* reset all the elements */ - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) - Reset(flo,ped); - - /* empty the strip cache */ - flo->floTex->stripSize = 0; - if(flo->floTex->stripHead.flink) - FreeStrips(&flo->floTex->stripHead); - - if(flo->awakenPtr) { - /* awaken snoozing clients - */ - while(flo->awakenCnt) { - ClientPtr client = flo->awakenPtr[--flo->awakenCnt]; - if(!client->clientGone) - AttendClient(client); - } - flo->awakenPtr = (ClientPtr*)XieFree(flo->awakenPtr); - } - flo->flags.active = FALSE; - } - return(TRUE); -} /* end flo_shutdown */ - - -/*------------------------------------------------------------------------ --------------------------------- Destroy --------------------------------- -------------------------------------------------------------------------*/ -static int flo_destroy(floDefPtr flo) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - - if(flo->floTex) { - /* destroy all the lingering element structures */ - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) - Destroy(flo,ped); - - /* get rid of the floTex */ - flo->floTex = (floTexPtr) XieFree(flo->floTex); - } - /* zap the DDXIE photoflo management vectors */ - flo->floVec = NULL; - flo->schedVec = NULL; - flo->stripVec = NULL; - - return(TRUE); -} /* end flo_destroy */ - -/* end module floman.c */ Index: xc/programs/Xserver/XIE/mixie/control/sched.c diff -u xc/programs/Xserver/XIE/mixie/control/sched.c:1.6 xc/programs/Xserver/XIE/mixie/control/sched.c:removed --- xc/programs/Xserver/XIE/mixie/control/sched.c:1.6 Fri Dec 14 14:58:17 2001 +++ xc/programs/Xserver/XIE/mixie/control/sched.c Sat Feb 28 21:41:58 2004 @@ -1,248 +0,0 @@ -/* $Xorg: sched.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/**** module sched.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - sched.c -- DDXIE machine independent photoflo scheduler - - Dean Verheiden, Robert NC Shelley -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/control/sched.c,v 1.6 2001/12/14 19:58:17 dawes Exp $ */ - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -#define SCHED_BAIL_OUT 10000 /* number of nonproductive times around scheduler - * loop before bailing out -- bad element - */ - -/* - * routines used internal to this module - */ -static Bool execute(floDefPtr flo, peTexPtr importer); -static bandMsk runnable(floDefPtr flo, peTexPtr pet); - -/* - * DDXIE photoflo manager entry points - */ -static schedVecRec schedulerVec = { - execute, - runnable - }; - - -/*------------------------------------------------------------------------ ---------------------------- Initialize Scheduler ------------------------- -------------------------------------------------------------------------*/ -int InitScheduler(floDefPtr flo) -{ - /* plug in the DDXIE scheduler vector */ - flo->schedVec = &schedulerVec; - - /* init the scheduler ready-list */ - ListInit(&flo->floTex->schedHead); - - return(TRUE); -} /* end InitScheduler */ - - -/*------------------------------------------------------------------------ -------------------------- Execute the photoflo --------------------------- -------------------------------------------------------------------------*/ -static Bool execute(floDefPtr flo, peTexPtr importer) -{ - bandMsk ready; - peTexPtr pet; - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - CARD32 sched_count = SCHED_BAIL_OUT; - CARD32 strip_count = flo->floTex->putCnt; - - if(importer) { - /* Put the ImportClient element at the head of the ready-list */ - InsertMember(importer,&flo->floTex->schedHead); - importer->scheduled = importer->receptor[IMPORT].ready; - } - do { - /* execute elements from the head of the ready-list until it's empty - * (calls to schedule from the data manager may prepend - * additional elements to the ready-list) - */ - while(!ListEmpty(&flo->floTex->schedHead)) { - pet = flo->floTex->schedHead.flink; - - if(Activate(flo,pet->peDef,pet) && (ready = runnable(flo,pet))) { - pet->scheduled = ready; /* remember which bands keep us alive */ - } else { - /* element is no longer runnable, remove it and check for errors - */ - RemoveMember(pet,pet); - pet->scheduled = 0; - if(ferrCode(flo)) - return(flo->flags.active = FALSE); - } - if(strip_count != flo->floTex->putCnt) { - sched_count = SCHED_BAIL_OUT; - strip_count = flo->floTex->putCnt; - } else if( !--sched_count) - ImplementationError(flo,pet->peDef, return(FALSE)); - } - /* Load all the elements onto the ready-list that can keep producing - * output without requiring any additional input (e.g. ImportResource - * elements). - */ - for(ped = lst->flink; !ListEnd(ped,lst); ped = ped->flink) - if(ped->peTex->emitting && !ped->peTex->admissionCnt) - InsertMember(ped->peTex,&flo->floTex->schedHead); - /* - * keep on trucking if there's nothing expected from the client - */ - } while(!flo->floTex->imports && !ListEmpty(&flo->floTex->schedHead)); - - /* if we still have stuff to do, count another round, otherwise shut it down - */ - if(flo->floTex->imports || flo->floTex->exports) - ++flo->floTex->exitCnt; - else - ddShutdown(flo); - - return(flo->flags.active); -} /* end execute */ - - -/*------------------------------------------------------------------------ ------------------------ test element for runnability --------------------- -------------------------------------------------------------------------*/ -static bandMsk runnable(floDefPtr flo, peTexPtr pet) -{ - receptorPtr rcp = pet->receptor, rend = &pet->receptor[pet->peDef->inCnt]; - bandMsk R, r; - - if(ferrCode(flo)) - return(0); - - if(pet->inSync) - if(pet->bandSync) { - /* - * inSync true, bandSync true: all attendable bands and inputs needed - */ - for(R = ~0; rcp < rend && R; R &= r, ++rcp) - if((rcp->active & rcp->attend) != (r = rcp->ready & rcp->attend)) - return(NO_BANDS); - return(R); /* return AND of attendable bands */ - } else { - /* - * inSync true, bandSync false: any bands that match between all inputs - */ - for(r = 0, R = ~0; rcp < rend; R &= r, ++rcp) - if(rcp->active & rcp->attend && !(r = rcp->ready & rcp->attend)) - return(NO_BANDS); - return(R & r); /* return AND of attendable bands */ - } - else - if(pet->bandSync) { - /* - * inSync false, bandSync true: all bands of any input must be ready - */ - for(R = 0; rcp < rend; R |= r, ++rcp) - if((rcp->active & rcp->attend) != (r = rcp->ready & rcp->attend)) - return(NO_BANDS); - return(R); /* return OR of attendable bands */ - } else { - /* - * inSync false, bandSync false: any band from any input will do - */ - for(R = 0; rcp < rend; R |= rcp->ready & rcp->attend, ++rcp); - return(R); /* return OR of attendable bands */ - } -} /* end runnable */ - -/* end module sched.c */ Index: xc/programs/Xserver/XIE/mixie/control/strip.c diff -u xc/programs/Xserver/XIE/mixie/control/strip.c:3.7 xc/programs/Xserver/XIE/mixie/control/strip.c:removed --- xc/programs/Xserver/XIE/mixie/control/strip.c:3.7 Fri Dec 14 14:58:17 2001 +++ xc/programs/Xserver/XIE/mixie/control/strip.c Sat Feb 28 21:41:58 2004 @@ -1,1232 +0,0 @@ -/* $Xorg: strip.c,v 1.4 2001/02/09 02:04:23 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module strip.c ****/ -/***************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - strip.c -- DDXIE machine independent data flo manager - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/control/strip.c,v 3.7 2001/12/14 19:58:17 dawes Exp $ */ - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* routines exported to DIXIE via the photoflo management vector - */ -static int import_data( - floDefPtr flo, - peDefPtr ped, - CARD8 band, - CARD8 *data, - CARD32 len, - BOOL final); -static int export_data( - floDefPtr flo, - peDefPtr ped, - CARD8 band, - CARD32 maxLen, - BOOL term); -static int query_data( - floDefPtr flo, - xieTypPhototag **list, - CARD16 *pending, - CARD16 *available); - -/* routines exported to elements via the data manager's vector - */ -static CARD8 *make_bytes( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 contig, - Bool purge); -static CARD8 *make_lines( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - Bool purge); -static Bool map_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 map, - CARD32 unit, - CARD32 len, - Bool purge); -static CARD8 *get_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 contig, - Bool purge); -static Bool put_data(floDefPtr flo, peTexPtr pet, bandPtr dbnd); -static void free_data(floDefPtr flo, peTexPtr pet, bandPtr dbnd); -static Bool pass_strip( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripPtr strip); -static Bool import_strips( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripLstPtr strips); -static Bool alter_src(floDefPtr flo, peTexPtr pet, stripPtr strip); -static void bypass_src(floDefPtr flo, peTexPtr pet, bandPtr dbnd); -static void disable_src(floDefPtr flo, peTexPtr pet, bandPtr bnd, Bool purge); -static void disable_dst(floDefPtr flo, peTexPtr pet, bandPtr dbnd); - -/* routines used internal to this module - */ -static stripPtr alter_data(floDefPtr flo, peTexPtr pet, bandPtr db); -static stripPtr contig_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripPtr i_strip, - CARD32 contig); -static stripPtr make_strip( - floDefPtr flo, - formatPtr fmt, - CARD32 start, - CARD32 units, - CARD32 bytes, - Bool allocData); -static stripPtr clone_strip(floDefPtr flo, stripPtr in_strip); -static bandMsk put_strip(floDefPtr flo, peTexPtr pet, stripPtr strip); -static void forward_strip(floDefPtr flo, peTexPtr pet, stripPtr fwd); -static stripPtr free_strip(floDefPtr flo, stripPtr strip); - -/* DDXIE client data manager entry points - */ -static dataVecRec dataManagerVec = { - (xieIntProc)import_data, - (xieIntProc)export_data, - (xieIntProc)query_data - }; - -/* DDXIE photoflo manager entry points - */ -static stripVecRec stripManagerVec = { - make_bytes, - make_lines, - map_data, - get_data, - put_data, - free_data, - pass_strip, - import_strips, - alter_src, - bypass_src, - disable_src, - disable_dst - }; - -INT32 STRIPS = 0; /* DEBUG */ -INT32 BYTES = 0; /* DEBUG */ - -/*------------------------------------------------------------------------ --------------------------- Initialize Data Manager ----------------------- -------------------------------------------------------------------------*/ -int InitStripManager(floDefPtr flo) -{ - /* plug in the DDXIE client data management vector */ - flo->dataVec = &dataManagerVec; - - /* plug in the strip manager vector */ - flo->stripVec = &stripManagerVec; - - /* init the strip cache */ - ListInit(&flo->floTex->stripHead); - - /* choose the best strip size for this flo (a constant value for now) */ - flo->floTex->stripSize = STANDARD_STRIP_SIZE; - - /* clear the count of strips passed */ - flo->floTex->putCnt = 0; - - return(TRUE); -} /* end InitStripManager */ - - -/*------------------------------------------------------------------------ ------------ discard parent headers from a whole list of strips ----------- ------------ and copy data if multiple references are found ----------- ------------ then transfer them all to their final destination ----------- -------------------------------------------------------------------------*/ -int DebriefStrips( - stripLstPtr i_head, - stripLstPtr o_head) -{ - stripPtr child, parent; - - /* NOTE: we might want to consider (re)allocing strip buffers to - * strip->length instead of leaving them an strip->bufSiz. - */ - for(child = i_head->flink; !ListEnd(child,i_head); child = child->flink) { - while ((parent = child->parent) != 0) - if(parent->refCnt == 1) { /* discard a cloned header */ - child->parent = parent->parent; - XieFree(parent); - --STRIPS; /*DEBUG*/ - } else { /* copy multiply referenced data */ - if(!(child->data = (CARD8*)XieMalloc(child->bufSiz))) - return(FALSE); - memcpy((char*)child->data, (char*)parent->data, (int)child->bufSiz); - child->parent = NULL; /* de-reference child from parent */ - --parent->refCnt; - BYTES += child->bufSiz; /*DEBUG*/ - } - child->format = NULL; /* kill per-strip format pointer */ - } - /* transfer the entire list of input strips to the output - */ - if(ListEmpty(i_head)) - ListInit(o_head); - else { - i_head->flink->blink = (stripPtr)o_head; - i_head->blink->flink = (stripPtr)o_head; - *o_head = *i_head; - ListInit(i_head); - } - return(TRUE); -} /* end DebriefStrips */ - - -/*------------------------------------------------------------------------ -------------------------- Free a whole list of strips -------------------- -------------------------------------------------------------------------*/ -void FreeStrips(stripLstPtr head) -{ - while( !ListEmpty(head) ) { - stripPtr strip; - - RemoveMember(strip, head->flink); - free_strip(NULL, strip); - } -} /* end FreeStrips */ - - -/*------------------------------------------------------------------------ ------------------------- Input from PutClientData ------------------------ -------------------------------------------------------------------------*/ -static int import_data( - floDefPtr flo, - peDefPtr ped, - CARD8 band, - CARD8 *data, - CARD32 len, - BOOL final) -{ - peTexPtr pet = ped->peTex; - receptorPtr rcp = &pet->receptor[IMPORT]; - bandPtr bnd = &rcp->band[band]; - bandMsk msk = 1<admit | rcp->bypass) & msk)) - return(TRUE); /* drop unwanted data */ - - /* make a strip and fill it in the info from the client - * (the format info was supplied with the element and technique parameters) - */ - if(!(strip = make_strip(flo,bnd->format,bnd->maxGlobal,len,len,FALSE))) - AllocError(flo,ped, return(FALSE)); - strip->final = final; - strip->data = data; - strip->bufSiz = len; - - if(rcp->bypass & msk) { - put_strip(flo,pet,strip); /* pass it downstream */ - if(!strip->flink) - free_strip(flo,strip); /* nobody wanted it */ - } else { - bnd->maxGlobal = strip->end + 1; - bnd->available += len; - rcp->ready |= msk; - InsertMember(strip,bnd->stripLst.blink); - if ((bnd->final = final) != 0) { - if(!(rcp->admit &= ~msk)) - --pet->admissionCnt; - --flo->floTex->imports; - } - } - /* fire up the scheduler -- then we're outa here */ - return( Execute(flo,pet) ); -} /* end import_data */ - - -/*------------------------------------------------------------------------ --------------------------- Output for GetClientData ---------------------- -------------------------------------------------------------------------*/ -static int export_data( - floDefPtr flo, - peDefPtr ped, - CARD8 band, - CARD32 maxLen, - BOOL term) -{ - BOOL release = FALSE, final = FALSE; - stripLstPtr lst = &ped->outFlo.output[band]; - stripPtr strip = NULL; - CARD32 bytes, want = maxLen; - CARD8 state, *data; - - /* if this is multi-byte data, make sure we send/swap complete aggregates - */ - if(ped->swapUnits[band] > 1) - want &= ~(ped->swapUnits[band]-1); - - if ((bytes = ListEmpty(lst) ? 0 : min(lst->flink->length, want)) != 0) { - strip = lst->flink; - data = strip->data + (strip->bitOff>>3); - if(strip->length -= bytes) { - strip->start += bytes; - strip->bitOff += bytes<<3; - } else { - RemoveMember(strip, strip); - final = strip->final; - release = TRUE; - if(ListEmpty(lst)) - ped->outFlo.ready &= ~(1<floTex->exports--; - else if(term) { - /* shut down the output band prematurely */ - ped->outFlo.ready &= ~(1<peTex,&ped->peTex->emitter[band]); - } - /* figure out our current state and send a reply to the client - */ - state = ped->outFlo.ready & 1<outFlo.active & 1<swapUnits[band],state); - if(release) - free_strip(flo,strip); - - return(bytes ? Execute(flo,NULL) : TRUE); -} /* end export_data */ - - -/*------------------------------------------------------------------------ ------------ Query flo elements involved in client data transport --------- -------------------------------------------------------------------------*/ -static int query_data( - floDefPtr flo, - xieTypPhototag **list, - CARD16 *pending, - CARD16 *available) -{ - peDefPtr ped; - pedLstPtr lst = ListEmpty(&flo->optDAG) ? &flo->defDAG : &flo->optDAG; - CARD32 exdex; - - *pending = *available = 0; - if(!(*list = (xieTypPhototag *)XieMalloc(flo->peCnt * sz_xieTypPhototag))) - FloAllocError(flo,0,0, return(FALSE)); - - /* find all the import elements that need client data */ - for(ped = lst->flink; ped; ped = ped->clink) - if(ped->flags.putData && ped->peTex->admissionCnt) - *list[(*pending)++] = ped->phototag; - - /* find all the export elements that have client data */ - exdex = *pending + (*pending & 1); - for(ped = lst->blink; ped; ped = ped->clink) - if(ped->flags.getData && ped->outFlo.ready) - *list[exdex + (*available)++] = ped->phototag; - - return(TRUE); -} /* end query_data */ - - -/*------------------------------------------------------------------------ ----- make a strip containing the specified number of contiguous bytes ---- -------------------------------------------------------------------------*/ -static CARD8* make_bytes( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 contig, - Bool purge) -{ - stripPtr strip = bnd->stripLst.blink; - CARD32 limit, size, units; - Bool avail = (!ListEmpty(&bnd->stripLst) && bnd->current >= strip->start && - bnd->current + contig <= strip->start + strip->bufSiz); - - if(purge && !avail && put_data(flo,pet,bnd)) - return(bnd->data = NULL); /* force element to suspend processing */ - - if(_is_global(bnd)) - return(get_data(flo,pet,bnd,contig,FALSE)); /* "current" is available */ - - if(avail) { - /* extend the available space in our current strip - */ - limit = bnd->current + contig; - bnd->available += limit - bnd->maxGlobal; - bnd->maxGlobal = limit; - strip->end = limit - 1; - strip->length = limit - strip->start; - } else { - /* time to make a fresh strip - */ - units = bnd->current + contig - bnd->maxGlobal; - size = units + Align(units,flo->floTex->stripSize); - if(!(strip = make_strip(flo,bnd->format,bnd->maxGlobal,units,size,TRUE))) - AllocError(flo,pet->peDef, return(NULL)); - - bnd->available += strip->length; - bnd->maxGlobal = strip->end + 1; - InsertMember(strip,bnd->stripLst.blink); - } - /* update our bandRec with the results */ - bnd->strip = strip; - bnd->minLocal = max(bnd->minGlobal,strip->start); - bnd->maxLocal = strip->end + 1; - return(bnd->data = _byte_ptr(bnd)); -} /* end make_bytes */ - - -/*------------------------------------------------------------------------ ---- Find or make a strip containing the unit specified by bnd->current --- -------------------------------------------------------------------------*/ -static CARD8* make_lines( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - Bool purge) -{ - stripPtr strip = NULL; - formatPtr fmt; - CARD32 size, units; - - if(purge && _release_ok(bnd) && put_data(flo,pet,bnd)) - return(bnd->data = NULL); /* force element to suspend processing */ - - if(_is_global(bnd)) /* we already have it, just go find it */ - return(get_data(flo,pet,bnd,(CARD32) 1,FALSE)); - - fmt = bnd->format; - if(bnd->current >= fmt->height) - return(NULL); /* trying to go beyond end of image */ - - while(bnd->current >= bnd->maxGlobal) { - /* - * re-use src if we're allowed to alter the data - */ - if(!bnd->inPlace || !(strip = alter_data(flo,pet,bnd))) { - size = flo->floTex->stripSize; - units = size / bnd->pitch; - if(units == 0) { /* image bigger than standard strip */ - units = 1; - size = bnd->pitch; - } else if(bnd->current + units > fmt->height) /* at end of image */ - units = fmt->height - bnd->current; - strip = make_strip(flo,fmt,bnd->maxGlobal,units,size,TRUE); - } - if(!strip) - AllocError(flo,pet->peDef, return(NULL)); - bnd->available += strip->length; - bnd->maxGlobal = strip->end + 1; - if(bnd->maxGlobal == fmt->height) - bnd->final = strip->final = TRUE; - InsertMember(strip,bnd->stripLst.blink); - } - /* update our bandRec with the results */ - bnd->strip = strip; - bnd->minLocal = max(bnd->minGlobal,strip->start); - bnd->maxLocal = strip->end + 1; - return(bnd->data = _line_ptr(bnd)); -} /* end make_lines */ - - -/*------------------------------------------------------------------------ --------------- load data map with pointers to specified data ------------- -------------------------------------------------------------------------*/ -static Bool map_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 map, - CARD32 unit, - CARD32 len, - Bool purge) -{ - CARD32 line, pitch; - CARD8 *next = (CARD8 *)NULL, *last = (CARD8 *)NULL; - CARD8 **ptr = bnd->dataMap + map; - stripPtr strip; - - /* first map the last unit and then the first unit -- if we have to make - * strips, or if input strips aren't there, we may as well handle it now - */ - if(len && map + len <= bnd->mapSize) - if(bnd->isInput) { - last = (CARD8*)GetSrc(flo,pet,bnd,unit+len-1,KEEP); - next = (CARD8*)GetSrc(flo,pet,bnd,unit,purge); - } else { - last = (CARD8*)GetDst(flo,pet,bnd,unit+len-1,KEEP); - next = (CARD8*)GetDst(flo,pet,bnd,unit,purge); - } - if(!next || !last) - return(FALSE); /* map too small or can't map first and last unit */ - - /* now walk through the strips and map all the lines (or bytes!) - */ - strip = bnd->strip; - pitch = bnd->pitch; - line = unit; - while((*ptr++ = next) != last) - if(++line <= strip->end) - next += pitch; - else { - strip = strip->flink; - next = strip->data; - } - return(TRUE); -} /* end map_data */ - - -/*------------------------------------------------------------------------ ------- Find the strip containing the unit specified by bnd->current ------ -------------------------------------------------------------------------*/ -static CARD8* get_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - CARD32 contig, - Bool purge) -{ - /* NOTE: get_data assumes that the caller has already verified that the - * beginning of the requested data is available in bnd->stripLst. - */ - stripPtr strip = bnd->strip ? bnd->strip : bnd->stripLst.flink; - - /* first get rid of extra baggage if we can - */ - if(purge && _release_ok(bnd)) - free_data(flo,pet,bnd); - - strip = bnd->strip ? bnd->strip : bnd->stripLst.flink; - while(!ListEnd(strip,&bnd->stripLst)) - if(bnd->current > strip->end) - strip = strip->flink; /* try the next strip */ - else if(bnd->current < strip->start) - strip = strip->blink; /* try the previous strip */ - else if(bnd->current+contig-1 <= strip->end || - (strip = contig_data(flo,pet,bnd,strip,contig))) - break; /* we found or assembled it */ - else - return(NULL); /* couldn't get enough bytes */ - - /* update our bandRec with the results - */ - bnd->strip = strip; - bnd->minLocal = max(bnd->minGlobal,strip->start); - bnd->maxLocal = strip->end + 1; - bnd->data = _is_local_contig(bnd,contig) ? _line_ptr(bnd) : NULL; - return(bnd->data); -} /* end get_data */ - - -/*------------------------------------------------------------------------ -------- move strip(s) onto awaiting receptor(s) or an export outFlo ------ -------------------------------------------------------------------------*/ -static Bool put_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd) -{ - bandMsk suspend = 0; - stripPtr strip; - - /* transfer strips until we run out or reach the one we're working in - */ - while(_release_ok(bnd)) { - RemoveMember(strip, bnd->stripLst.flink); - bnd->available -= strip->length; - bnd->minGlobal = strip->end + 1; - - if(!(pet->emitting & 1<band)) - free_strip(flo,strip); /* output disabled */ - else { - strip->flink = NULL; - suspend |= put_strip(flo,pet,strip); /* send it downstream */ - if(!strip->flink) - free_strip(flo,strip); /* nobody wanted it! */ - } - } - if(ListEmpty(&bnd->stripLst)) { - bnd->strip = NULL; - bnd->data = NULL; - if(bnd->final) - disable_dst(flo,pet,bnd); - } - return(suspend != 0); -} /* end put_data */ - - -/*------------------------------------------------------------------------ ----------- free strip(s) from a receptor band or an emitter band --------- -------------------------------------------------------------------------*/ -static void free_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd) -{ - bandMsk msk = 1<band; - - /* free strips until we run out or reach the one we're working in - */ - while(_release_ok(bnd)) { - stripPtr strip; - - RemoveMember(strip, bnd->stripLst.flink); - bnd->available -= strip->length - (bnd->minGlobal - strip->start); - bnd->minGlobal = strip->end + 1; - if(bnd->isInput && bnd->receptor->forward & msk) - forward_strip(flo,pet,strip); - else - free_strip(flo,strip); - } - /* a little bookkeeping to let the scheduler know where we're at - */ - bnd->available -= bnd->current - bnd->minGlobal; - bnd->minGlobal = bnd->current; - if(bnd->isInput) { - CheckSrcReady(bnd,msk); - } - if(bnd->final && bnd->isInput && ListEmpty(&bnd->stripLst)) { - bnd->receptor->active &= ~msk; - bnd->receptor->attend &= ~msk; - } - if(!(bnd->data = _is_local(bnd) ? _line_ptr(bnd) : NULL)) - bnd->strip = NULL; -} /* end free_data */ - - -/*------------------------------------------------------------------------ ----- take list of strips passed in (most likely from a photomap), clone -- ----- the headers, and hang them on the input receptor to make the data -- ----- accessable by standard macros -- -------------------------------------------------------------------------*/ -static Bool import_strips( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripLstPtr strips) -{ - stripPtr strip = strips->flink, clone = NULL; - receptorPtr rcp = pet->receptor; - CARD8 msk = 1<band; - - for(strip = strips->flink; !ListEnd(strip,strips); strip = strip->flink) { - - if(!(clone = clone_strip(flo, strip))) - AllocError(flo,pet->peDef, return(FALSE)); - - clone->format = bnd->format; /* this had better be right! */ - - bnd->available += clone->length; - - InsertMember(clone,bnd->stripLst.blink); - } - bnd->final = clone->final; - bnd->maxGlobal = clone->end + 1; - - if(!(rcp->admit &= ~msk)) - --pet->admissionCnt; - - return(TRUE); -} /* end import_strips */ - - -/*------------------------------------------------------------------------ ---------- Clone a strip and pass it on to the element's recipients ------- -------------------------------------------------------------------------*/ -static Bool pass_strip( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripPtr strip) -{ - stripPtr clone; - - if(!(pet->emitting & 1<band)) - return(TRUE); /* output disabled */ - - if(!(clone = clone_strip(flo, strip))) - AllocError(flo,pet->peDef, return(FALSE)); - - clone->format = bnd->format; /* this had better be right! */ - - put_strip(flo,pet,clone); /* give to downstream receptors */ - if(!clone->flink) - free_strip(flo,clone); /* nobody wanted it */ - - if ((bnd->final = strip->final) != 0) - disable_dst(flo,pet,bnd); - - return(TRUE); -} /* end pass_strip */ - - -/*------------------------------------------------------------------------ ------------- see if it's ok to over write the data in a src strip -------- -------------------------------------------------------------------------*/ -static Bool alter_src( - floDefPtr flo, - peTexPtr pet, - stripPtr strip) -{ - stripPtr chk; - - if(!strip->data || strip->Xowner) - return(FALSE); - - /* make sure there are no other users of this strip's data - */ - for(chk = strip; chk->parent && chk->refCnt == 1; chk = chk->parent); - return(chk->refCnt == 1); -} /* end alter_src */ - - -/*------------------------------------------------------------------------ ---------- pass all remaining input for this band straight through -------- -------------------------------------------------------------------------*/ -static void bypass_src( - floDefPtr flo, - peTexPtr pet, - bandPtr sbnd) -{ - stripPtr strip; - bandPtr dbnd = &pet->emitter[sbnd->band]; - CARD8 *src; - CARD8 *dst; - - if(sbnd->receptor->active & 1<band) { - /* - * if there's lingering data, see that it gets to its destination - */ - for(src = (CARD8*)GetCurrentSrc(flo,pet,sbnd), - dst = (CARD8*)GetCurrentDst(flo,pet,dbnd); - src && dst; - src = (CARD8*)GetNextSrc(flo,pet,sbnd,KEEP), - dst = (CARD8*)GetNextDst(flo,pet,dbnd,!src)) { - if(src != dst) - memcpy((char*)dst, (char*)src, (int)dbnd->pitch); - } - /* if there's a partial strip still here, adjust its length - */ - if(!ListEmpty(&dbnd->stripLst)) { - strip = dbnd->stripLst.blink; - if(strip->start < dbnd->current) { - strip->end = dbnd->current - 1; - strip->length = dbnd->current - strip->start; - put_data(flo,pet,dbnd); - } - } - /* shut down the src band, or the dst band if we're all done - */ - if(pet->emitting &= ~(1<band)) - disable_src(flo,pet,sbnd,FLUSH); - else - disable_dst(flo,pet,dbnd); - } - /* if we're still accepting input, the remainder will bypass this element - */ - sbnd->receptor->bypass |= 1<band; -} /* end bypass_src */ - - -/*------------------------------------------------------------------------ ----------- disable src band and discard any remaining input data --------- -------------------------------------------------------------------------*/ -static void disable_src( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - Bool purge) -{ - bandMsk msk = 1<band; - - if(bnd->receptor->admit & msk && pet->peDef->flags.putData) - --flo->floTex->imports; /* one less import client band */ - - if(bnd->receptor->admit && !(bnd->receptor->admit &= ~msk)) - --pet->admissionCnt; /* one less receptor needing data */ - - bnd->final = TRUE; - - if(purge) - FreeData(flo,pet,bnd,bnd->maxGlobal); -} /* end disable_src */ - - -/*------------------------------------------------------------------------ ---- disable dst band -- also disables all src's if no dst bands remain --- -------------------------------------------------------------------------*/ -static void disable_dst( - floDefPtr flo, - peTexPtr pet, - bandPtr dbnd) -{ - peDefPtr ped = pet->peDef; - receptorPtr rcp, rend = &pet->receptor[ped->inCnt]; - bandMsk mask; - bandPtr sbnd; - - /* if this is the last emitter band to turn off and this isn't an import - * client element, we'll step thru all the receptor bands and kill them too - */ - if(!(pet->emitting &= ~(1<band)) && !ped->flags.putData) - for(rcp = pet->receptor; rcp < rend; ++rcp) - for(mask = 1, sbnd = rcp->band; rcp->active; mask <<= 1, ++sbnd) - if(rcp->active & mask) - disable_src(flo,pet,sbnd,TRUE); - if(ped->flags.getData) { - ped->outFlo.active &= ~(1<band); - if(!(ped->outFlo.ready & 1<band)) - flo->floTex->exports--; - } -} /* end disable_dst */ -/*------------------------------------------------------------------------ -- Get permission for an emitter to write into an existing receptor strip - -------------------------------------------------------------------------*/ -static stripPtr alter_data( - floDefPtr flo, - peTexPtr pet, - bandPtr db) -{ - bandPtr sb = db->inPlace; - stripPtr chk, strip = sb->strip ? sb->strip : sb->stripLst.flink; - - /* search through the source data for the corresponding line number - */ - while(!ListEnd(strip,&sb->stripLst)) - if(db->current > strip->end) - strip = strip->flink; - else if(db->current < strip->start) - strip = strip->blink; - else if(!strip->data || strip->Xowner) - break; - else { - /* make sure there are no other users of this strip's data - */ - for(chk = strip; chk->parent && chk->refCnt == 1; chk = chk->parent); - if(chk->refCnt > 1) - break; - return(clone_strip(flo,strip)); /* return a clone of the src strip */ - } - return(NULL); -} /* end alter_data */ - - -/*------------------------------------------------------------------------ ----------- enter with a strip containing at least one byte of data ------ ----------- {if a new strip must be created (to hold at least ------ ----------- contig bytes), available data will be copied to it} ------ ----------- return with a strip containing "contig" contiguous bytes ------ -------------------------------------------------------------------------*/ -static stripPtr contig_data( - floDefPtr flo, - peTexPtr pet, - bandPtr bnd, - stripPtr i_strip, - CARD32 contig) -{ - stripPtr o_strip, n_strip; - CARD32 limit, start, skip, avail = i_strip->end - bnd->current + 1; - - if(contig <= i_strip->bufSiz - i_strip->length + avail) - o_strip = i_strip; - else { - /* i_strip too small, make a new one and copy available data into it - */ - if(!(o_strip = make_strip(flo, bnd->format, bnd->current, avail, - contig + Align(contig, flo->floTex->stripSize), - TRUE))) - AllocError(flo,pet->peDef, return(NULL)); - InsertMember(o_strip,i_strip); - memcpy((char*)o_strip->data, - (char*)&i_strip->data[bnd->current-i_strip->start], (int)avail); - if(i_strip->length -= avail) - i_strip->end -= avail; - else { - RemoveMember(n_strip,i_strip); - o_strip->final = n_strip->final; - free_strip(flo, n_strip); - } - } - /* determine how far we can extend our o_strip - */ - if(bnd->current + contig <= bnd->maxGlobal) - limit = bnd->current + contig; /* limit to data needed */ - else - limit = bnd->maxGlobal; /* limit to data available */ - - /* if there are more strips beyond "o_strip", transfer the needed amount of - * data into our mega-strip (free any strips that we completely consume) - */ - for(start = o_strip->end+1; start < limit; start += avail) { - n_strip = o_strip->flink; - skip = start - n_strip->start; - avail = min(n_strip->length - skip, limit - start); - memcpy((char*)&o_strip->data[o_strip->length], - (char*)&n_strip->data[skip], (int)avail); - o_strip->end += avail; - o_strip->length += avail; - if(avail+skip == n_strip->length) { - RemoveMember(n_strip, n_strip); - o_strip->final = n_strip->final; - free_strip(flo, n_strip); - } - } - if(!bnd->isInput) { - limit = bnd->current + contig; - bnd->available += limit - bnd->maxGlobal; - bnd->maxGlobal = limit; - o_strip->end = limit - 1; - o_strip->length = limit - o_strip->start; - } - return(o_strip); -} /* end contig_data */ - - -/*------------------------------------------------------------------------ ----------------------------- Make a new strip ---------------------------- -------------------------------------------------------------------------*/ -static stripPtr make_strip( - floDefPtr flo, - formatPtr fmt, - CARD32 start, - CARD32 units, - CARD32 bytes, - Bool allocData) -{ - stripPtr strip; - stripLstPtr cache = &flo->floTex->stripHead; - Bool cachable = allocData && bytes == flo->floTex->stripSize; - - if(!ListEmpty(cache) && (cachable || !cache->blink->data)) - RemoveMember(strip, cachable ? cache->flink : cache->blink); - else if ((strip = (stripPtr) XieMalloc(sizeof(stripRec))) != 0) { - strip->data = NULL; - ++STRIPS; /*DEBUG*/ - } - if(strip) { - strip->flink = NULL; - strip->parent = NULL; - strip->format = fmt; - strip->refCnt = 1; - strip->Xowner = !allocData; - strip->canonic = IsCanonic(fmt->class); - strip->final = FALSE; - strip->cache = cachable; - strip->start = start; - strip->end = start + units - 1; - strip->length = units; - strip->bitOff = 0; - strip->bufSiz = bytes; - - if(allocData && bytes && !strip->data) - if ((strip->data = (CARD8 *) XieCalloc(bytes)) != 0) /* calloc to hush purify */ - BYTES += bytes; /*DEBUG*/ - else - strip = free_strip(NULL,strip); - } - return(strip); -} /* end make_strip */ - - -/*------------------------------------------------------------------------ ----- Clone a new modifiable strip wrapper for existing read-only data ---- -------------------------------------------------------------------------*/ -static stripPtr clone_strip(floDefPtr flo, stripPtr in_strip) -{ - stripLstPtr cache = &flo->floTex->stripHead; - stripPtr out_strip; - - if(ListEmpty(cache) || cache->blink->data) { - out_strip = (stripPtr) XieMalloc(sizeof(stripRec)); - ++STRIPS; /*DEBUG*/ - } else { - RemoveMember(out_strip, cache->blink); - } - if(out_strip) { - *out_strip = *in_strip; - out_strip->flink = NULL; - out_strip->parent = in_strip; - out_strip->refCnt = 1; - ++in_strip->refCnt; - } - return(out_strip); -} /* end clone_strip */ - - -/*------------------------------------------------------------------------ ----------------- Put strip on each receptor fed by an element ------------ -------------------------------------------------------------------------*/ -static bandMsk put_strip(floDefPtr flo, peTexPtr pet, stripPtr strip) -{ - peTexPtr dst; - inFloPtr inf; - bandPtr bnd; - stripPtr clone; - receptorPtr rcp; - CARD8 band = strip->format->band; - bandMsk repmsk, mask = 1<peDef->flags.export) { - pet->outFlo->ready |= mask; - /* - * give to DIXIE via our outFlo; if we're not first in line, make a clone - */ - if(!(clone = strip->flink ? clone_strip(flo,strip) : strip)) - AllocError(flo,pet->peDef, return(suspend)); - InsertMember(clone,pet->outFlo->output[band].blink); - ++flo->floTex->putCnt; - return(suspend); - } - /* hang this strip on the receptor of each of our interested recipients - */ - for(inf = pet->outFlo->outChain; inf; inf = inf->outChain) { - if(inf->format[band].class != strip->format->class) - continue; - dst = inf->ownDef->peTex; - rcp = &dst->receptor[inf->index]; - bnd = &rcp->band[band]; - - if(rcp->bypass & mask) { - suspend |= put_strip(flo,dst,strip); /* just passin' through */ - continue; - } else if(!(rcp->admit & mask)) { - continue; /* data not wanted here */ - } - if(strip->final && !(rcp->admit &= ~mask)) - --dst->admissionCnt; /* all bands complete */ - /* - * give the data to the intended receptor band - */ - for(repmsk = mask; repmsk <= rcp->active; ++bnd, repmsk <<= 1) { - if(rcp->active & repmsk) { - bnd->final = strip->final; - bnd->maxGlobal = strip->end + 1; - bnd->available += strip->length; - Schedule(flo,dst,rcp,bnd,repmsk); /* schedule if runnable */ - suspend |= dst->scheduled; - /* - * first recipient gets the original, all others get clones - */ - if(!(clone = strip->flink ? clone_strip(flo,strip) : strip)) - AllocError(flo,dst->peDef, break); - InsertMember(clone,bnd->stripLst.blink); - ++flo->floTex->putCnt; - } - /* see if we should replicate the data through the other bands - */ - if(!rcp->band[0].replicate) break; - } - } - return(suspend); -} /* end put_strip */ - - -/*------------------------------------------------------------------------ ------------- forward input data downstream (re-buffer if Xowner) -------- ------------- primarily used to pass compressed data to a photomap -------- -------------------------------------------------------------------------*/ -static void forward_strip(floDefPtr flo, peTexPtr pet, stripPtr fwd) -{ - if(!pet->peDef->flags.putData) { - /* non-client data -- just pass it along - */ - fwd->flink = NULL; - put_strip(flo,pet,fwd); /* give to downstream receptors */ - if(!fwd->flink) - free_strip(flo,fwd); /* hmm, nobody wanted it */ - } else { - /* since this is client data we must copy it before passing it along - */ - stripLstPtr lst = &pet->outFlo->output[fwd->format->band]; - stripPtr tmp = ListEmpty(lst) ? NULL : lst->flink; - int maxlen = flo->floTex->stripSize, datlen; - int overlap = tmp ? tmp->end - fwd->start + 1 : 0; - int start = fwd->start + overlap; - int size = fwd->length - overlap; - CARD8 *data = &fwd->data[overlap]; - Bool final = FALSE; - - while(!final) { - if(ListEmpty(lst)) - if ((tmp = make_strip(flo, fwd->format, start, 0, maxlen, TRUE)) != 0) { - InsertMember(tmp,lst->flink); - } else { - free_strip(flo,fwd); - AllocError(flo,pet->peDef, return); - } - if(size) { - datlen = min(size, tmp->bufSiz - tmp->length); - memcpy((char*)&tmp->data[tmp->length], (char*)data, (int)datlen); - tmp->length += datlen; - tmp->end += datlen; - data += datlen; - size -= datlen; - } - if((!size && fwd->final) || tmp->length == tmp->bufSiz) { - RemoveMember(tmp,lst->flink); - start = tmp->start + tmp->length; - tmp->final = final = fwd->final && !size; - tmp->canonic = fwd->canonic; - tmp->flink = NULL; - put_strip(flo,pet,tmp); /* give to downstream receptors */ - if(!tmp->flink) - free_strip(flo,tmp); - } - if(!size) break; - } - free_strip(flo,fwd); - } -} /* end forward_strip */ - - -/*------------------------------------------------------------------------ ------------------------------ Get rid of a strip ------------------------- -------------------------------------------------------------------------*/ -static stripPtr free_strip(floDefPtr flo, stripPtr strip) -{ - lstPtr cache; - - if(strip && !--strip->refCnt) { - /* since this was the last reference we're going to nuke this strip, - * if this was a clone, free the parent and forget where the data was - */ - if(strip->parent) { - free_strip(flo, strip->parent); - strip->data = NULL; - } else if(strip->data) { - /* if the data buffer belongs to coreX or is uncachable, nuke it */ - if(strip->Xowner) - strip->data = NULL; - else if(!flo || !strip->cache) { - strip->data = (CARD8 *) XieFree(strip->data); - BYTES -= strip->bufSiz; /*DEBUG*/ - } - } - if(flo) { - /* strips with standard data buffers are cached at the front - * strips without data buffers go at the back - */ - strip->refCnt = 1; - strip->parent = NULL; - cache = (strip->data - ? (lstPtr)&flo->floTex->stripHead - : (lstPtr) flo->floTex->stripHead.blink); - InsertMember(strip,cache); - } else { - XieFree(strip); - --STRIPS; /*DEBUG*/ - } - } - return(NULL); -} /* end free_strip */ - -/* end module strip.c */ Index: xc/programs/Xserver/XIE/mixie/export/Imakefile diff -u xc/programs/Xserver/XIE/mixie/export/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/export/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/export/Imakefile:3.6 Wed Jan 17 17:13:01 2001 +++ xc/programs/Xserver/XIE/mixie/export/Imakefile Sat Feb 28 21:41:58 2004 @@ -1,42 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:35 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/export/Imakefile,v 3.6 2001/01/17 22:13:01 dawes Exp $ - -XCOMM build device dependent machine independent export element objs - -#define IHaveModules -#include - -SRCS1 = meclut.c mecphoto.c medraw.c medrawp.c \ - mefax.c melut.c mephoto.c meuncomp.c schoice.c - -OBJS1 = meclut.o mecphoto.o medraw.o medrawp.o \ - mefax.o melut.o mephoto.o meuncomp.o schoice.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = mechist.c mecroi.c meroi.c mejpeg.c -OBJS2 = mechist.o mecroi.o meroi.o mejpeg.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions -I../jpeg - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(mexp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/export/mechist.c diff -u xc/programs/Xserver/XIE/mixie/export/mechist.c:3.6 xc/programs/Xserver/XIE/mixie/export/mechist.c:removed --- xc/programs/Xserver/XIE/mixie/export/mechist.c:3.6 Fri Dec 14 14:58:18 2001 +++ xc/programs/Xserver/XIE/mixie/export/mechist.c Sat Feb 28 21:41:58 2004 @@ -1,370 +0,0 @@ -/* $Xorg: mechist.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mechist.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mechist.c -- DDXIE export client histogram element - - Larry Hare -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mechist.c,v 3.6 2001/12/14 19:58:18 dawes Exp $ */ - -#define _XIEC_MECHIST -#define _XIEC_ECHIST - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* routines used internal to this module - */ -static int CreateECHist(floDefPtr flo, peDefPtr ped); -static int InitializeECHist(floDefPtr flo, peDefPtr ped); -static int ActivateECHist(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetECHist(floDefPtr flo, peDefPtr ped); -static int DestroyECHist(floDefPtr flo, peDefPtr ped); - -/* DDXIE ExportClientHist entry points - */ -static ddElemVecRec ECHistVec = { - CreateECHist, - InitializeECHist, - ActivateECHist, - (xieIntProc)NULL, - ResetECHist, - DestroyECHist - }; - -/* declarations for private structures and actions procs ... */ - -typedef struct { - pointer histdata; - CARD32 histsize; - void (*histproc) (); -} miECHistRec, *miECHistPtr; - -extern void doHistQ(pointer svoid, CARD32 *hist, CARD32 clip, CARD32 x, CARD32 dx); -extern void doHistP(pointer svoid, CARD32 *hist, CARD32 clip, CARD32 x, CARD32 dx); -extern void doHistB(pointer svoid, CARD32 *hist, CARD32 clip, CARD32 x, CARD32 dx); -extern void doHistb(pointer svoid, CARD32 *hist, CARD32 clip, CARD32 x, CARD32 dx); - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeECHist(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = ECHistVec; - - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateECHist(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - - /* always force syncing between inputs (is nop if only one input) */ - return MakePETex(flo, ped, sizeof(miECHistRec), SYNC, NO_SYNC); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeECHist(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientHistogram *raw = - (xieFloExportClientHistogram *)ped->elemRaw; - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - miECHistPtr pvt = (miECHistPtr)(pet->private); - bandPtr iband; - CARD32 nclip; - - iband = &(pet->receptor[SRCtag].band[0]); - - switch (iband->format->class) { - case QUAD_PIXEL: pvt->histproc = doHistQ; - break; - case PAIR_PIXEL: pvt->histproc = doHistP; - break; - case BYTE_PIXEL: pvt->histproc = doHistB; - break; - case BIT_PIXEL: pvt->histproc = doHistb; - break; - default: ImplementationError(flo, ped, return(FALSE)); - } - - SetDepthFromLevels(iband->format->levels, nclip); - pvt->histsize = nclip = 1 << nclip; - - if (!(pvt->histdata = (pointer ) XieCalloc(nclip * sizeof(CARD32)))) - AllocError(flo,ped,return(FALSE)); - - return InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,1,NO_BANDS) && - InitProcDomain(flo, ped, raw->domainPhototag, - raw->domainOffsetX, raw->domainOffsetY) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateECHist(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientHistogram *raw = - (xieFloExportClientHistogram *)ped->elemRaw; - miECHistPtr pvt = (miECHistPtr)(pet->private); - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &rcp->band[0]; - bandPtr dbnd = &pet->emitter[0]; - pointer src; - - src = GetCurrentSrc(flo,pet,sbnd); - while(src && SyncDomain(flo,ped,sbnd,FLUSH)) { - INT32 x = 0, dx; - while ((dx = GetRun(flo,pet,sbnd)) != 0) { - if (dx > 0) { - (*(pvt->histproc)) (src,pvt->histdata,pvt->histsize,x,dx); - x += dx; - } else - x -= dx; - } - src = GetNextSrc(flo,pet,sbnd,FLUSH); - } - FreeData(flo,pet,sbnd,sbnd->current); - - /* if finished with accumulation, send back to client */ - if (!src && sbnd->final) { - CARD32 *hist; - CARD32 ilev, nlev = sbnd->format->levels; - CARD32 nhist = 0; - xieTypHistogramData *histpair; - - /* Count populated cells */ - for (ilev = 0, hist = (CARD32*)pvt->histdata; ilev < nlev; ilev++, hist++) - if (*hist) - nhist++; - - if(nhist) { - if(!(histpair = (xieTypHistogramData*)GetDstBytes(flo,pet,dbnd,0, - nhist * sizeof(xieTypHistogramData),KEEP))) - return FALSE; - - for (ilev = 0, hist = (CARD32*)pvt->histdata; ilev < nlev; ilev++, hist++) - if (*hist) { - histpair->count = *hist; - histpair->value = ilev; - histpair++; - } - SetBandFinal(dbnd); - PutData(flo,pet,dbnd, nhist * sizeof(xieTypHistogramData)); - } else { - /* signal that there is no data to send - */ - DisableDst(flo,pet,dbnd); - } - switch(raw->notify) { - case xieValFirstData: /* fall thru */ - case xieValNewData: SendExportAvailableEvent(flo,ped, - 0, /* band */ - nhist, /* count */ - 0,0); /* unused */ - default: break; - } - } - return TRUE; -} - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetECHist(floDefPtr flo, peDefPtr ped) -{ - miECHistPtr pvt = (miECHistPtr) ped->peTex->private; - - /* free any dynamic private data */ - if (pvt->histdata) - pvt->histdata = (pointer ) XieFree(pvt->histdata); - - ResetReceptors(ped); - ResetEmitter(ped); - - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyECHist(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return TRUE; -} - - -/*------------------------------------------------------------------------ ------------------------- action procs to do histogram -------------------- -------------------------------------------------------------------------*/ - -void doHistQ( - pointer svoid, - CARD32 *hist, - CARD32 clip, - CARD32 x, - CARD32 dx) -{ - QuadPixel *src = (QuadPixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; -} - -void doHistP( - pointer svoid, - CARD32 *hist, - CARD32 clip, - CARD32 x, - CARD32 dx) -{ - PairPixel *src = (PairPixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; -} - -void doHistB( - pointer svoid, - CARD32 *hist, - CARD32 clip, - CARD32 x, - CARD32 dx) -{ - BytePixel *src = (BytePixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; /* could pad to 256 .. */ -} - -void doHistb( - pointer svoid, - CARD32 *hist, - CARD32 clip, - CARD32 x, - CARD32 dx) -{ - LogInt *src = (LogInt *) svoid; - CARD32 cnt0 = 0, cnt1 = 0; - - /* does anyone actually do bit histograms? :-) */ - for ( ; dx > 0 ; dx--, x++) - if (LOG_tstbit(src,x)) - cnt1++; - else - cnt0++; - - hist[0] += cnt0; - hist[1] += cnt1; -} - -/* end module mechist.c */ Index: xc/programs/Xserver/XIE/mixie/export/meclut.c diff -u xc/programs/Xserver/XIE/mixie/export/meclut.c:3.6 xc/programs/Xserver/XIE/mixie/export/meclut.c:removed --- xc/programs/Xserver/XIE/mixie/export/meclut.c:3.6 Fri Dec 14 14:58:18 2001 +++ xc/programs/Xserver/XIE/mixie/export/meclut.c Sat Feb 28 21:41:58 2004 @@ -1,233 +0,0 @@ -/* $Xorg: meclut.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module meclut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - meclut.c -- DDXIE export client LUT element - - Larry Hare -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/meclut.c,v 3.6 2001/12/14 19:58:18 dawes Exp $ */ - -#define _XIEC_MECLUT -#define _XIEC_ECLUT - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* routines used internal to this module - */ -static int CreateECLUT(floDefPtr flo, peDefPtr ped); -static int InitializeECLUT(floDefPtr flo, peDefPtr ped); -static int ActivateECLUT(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetECLUT(floDefPtr flo, peDefPtr ped); -static int DestroyECLUT(floDefPtr flo, peDefPtr ped); - -/* DDXIE ExportClientLUT entry points - */ -static ddElemVecRec ECLUTVec = { - CreateECLUT, - InitializeECLUT, - ActivateECLUT, - (xieIntProc)NULL, - ResetECLUT, - DestroyECLUT - }; - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeECLUT(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = ECLUTVec; - - return(TRUE); -} /* end miAnalyzeECLUT */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateECLUT(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC); -} /* end CreateECLUT */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeECLUT(floDefPtr flo, peDefPtr ped) -{ - return InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeECLUT */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateECLUT(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientLUT *raw = (xieFloExportClientLUT *)ped->elemRaw; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp->inFlo->bands; - bandPtr dbnd, sbnd = &rcp->band[0]; - CARD32 *start = &(raw->start0); - CARD32 *length = &(raw->length0); - CARD8 *src, *dst; - CARD32 b, pitch, nentry, dlen; - Bool swizzle; - - swizzle = (bands == 3) && (raw->bandOrder != xieValLSFirst); - - for(b = 0; b < bands; ++sbnd, ++b) { - - if (!(src = (CARD8*)GetCurrentSrc(flo,pet,sbnd))) continue; - - dbnd = &pet->emitter[swizzle ? xieValMaxBands - b - 1 : b]; - - nentry = length[b] ? length[b] : sbnd->format->height; - pitch = LutPitch(sbnd->format->levels); - dlen = nentry * pitch; - - if (!(dst = (CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current,dlen,KEEP))) - return FALSE; - - if (start[b]) - src += start[b] * pitch; /* Adjust via start[b] && length[b] */ - - memcpy(dst,src,dlen); - - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - - FreeData(flo,pet,sbnd,sbnd->maxLocal); - - switch(raw->notify) { - case xieValFirstData: /* fall thru */ - case xieValNewData: SendExportAvailableEvent(flo,ped,b,nentry,0,0); - default: break; - } - } - return(TRUE); -} /* end ActivateECLUT */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetECLUT(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetECLUT */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyECLUT(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyECLUT */ - -/* end module meclut.c */ Index: xc/programs/Xserver/XIE/mixie/export/mecphoto.c diff -u xc/programs/Xserver/XIE/mixie/export/mecphoto.c:3.6 xc/programs/Xserver/XIE/mixie/export/mecphoto.c:removed --- xc/programs/Xserver/XIE/mixie/export/mecphoto.c:3.6 Fri Dec 14 14:58:18 2001 +++ xc/programs/Xserver/XIE/mixie/export/mecphoto.c Sat Feb 28 21:41:58 2004 @@ -1,828 +0,0 @@ -/* $Xorg: mecphoto.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mecphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mecphoto.c -- DDXIE export client photo element - - Robert NC Shelley && Dean Verheiden -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mecphoto.c,v 3.6 2001/12/14 19:58:18 dawes Exp $ */ -#define _XIEC_MECPHOTO -#define _XIEC_ECPHOTO -#define _XIEC_EPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - -/* routines referenced by other DDXIE modules - */ -extern int miAnalyzeECPhoto(floDefPtr flo, peDefPtr ped); - -/* routines used internal to this module - */ -static int CreateECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped); -static int InitializeECPhotoStream(floDefPtr flo, peDefPtr ped); -static int InitializeECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped); -static int ActivateECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ActivateECPhotoStream(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetECPhoto(floDefPtr flo, peDefPtr ped); -static int DestroyECPhotoUn(floDefPtr flo, peDefPtr ped); - -#if XIE_FULL -static int CreateECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped); -static int InitializeECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped); -static int ActivateECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped, peTexPtr pet); -#endif /* XIE_FULL */ - -/* - * routines we need from somewhere else - */ - -extern int InitializeECPhotoFAX(); -/* note: all the other Fax EC entry points are shared with EphotoFAX */ - -extern int CreateEPhotoFAX(); -extern int ActivateEPhotoFAX(); -extern int ResetEPhotoFAX(); -extern int DestroyEPhotoFAX(); - -extern int InitializeECPhotoJPEGBaseline(); -/* note: all the other EC entry points are shared with EphotoJPEGBaseline */ - -extern int CreateEPhotoJPEGBaseline(); -extern int ActivateEPhotoJPEGBaseline(); -extern int ResetEPhotoJPEGBaseline(); -extern int DestroyEPhotoJPEGBaseline(); - -/* - * DDXIE ExportClientPhoto entry points - */ -static ddElemVecRec ECPhotoUncomByPlaneVec = { - CreateECPhotoUncomByPlane, - InitializeECPhotoUncomByPlane, - ActivateECPhotoUncomByPlane, - (xieIntProc)NULL, - ResetECPhoto, - DestroyECPhotoUn - }; - -static ddElemVecRec ECPhotoStreamVec = { - CreateECPhotoUncomByPlane, - InitializeECPhotoStream, - ActivateECPhotoStream, - (xieIntProc)NULL, - ResetECPhoto, - DestroyECPhotoUn - }; - -static ddElemVecRec ECPhotoFAXVec = { - CreateEPhotoFAX, - InitializeECPhotoFAX, /* only this can't be shared */ - ActivateEPhotoFAX, - (xieIntProc)NULL, - ResetEPhotoFAX, - DestroyEPhotoFAX - }; - -#if XIE_FULL -static ddElemVecRec ECPhotoUncomByPixelVec = { - CreateECPhotoUncomByPixel, - InitializeECPhotoUncomByPixel, - ActivateECPhotoUncomByPixel, - (xieIntProc)NULL, - ResetECPhoto, - DestroyECPhotoUn - }; - -static ddElemVecRec ECPhotoJPEGBaselineVec = { - CreateEPhotoJPEGBaseline, - InitializeECPhotoJPEGBaseline, /* only this can't be shared */ - ActivateEPhotoJPEGBaseline, - (xieIntProc)NULL, - ResetEPhotoJPEGBaseline, - DestroyEPhotoJPEGBaseline - }; - -#endif /* XIE_FULL */ - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeECPhoto(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - if(pvt->congress) { - ped->ddVec = ECPhotoStreamVec; - return(TRUE); - } - switch(pvt->encodeNumber) { - case xieValEncodeUncompressedSingle: - ped->ddVec = ECPhotoUncomByPlaneVec; - break; - - case xieValEncodeG31D: - case xieValEncodeG32D: - case xieValEncodeG42D: - case xieValEncodeTIFF2: - case xieValEncodeTIFFPackBits: - ped->ddVec = ECPhotoFAXVec; - break; - -#if XIE_FULL - case xieValEncodeUncompressedTriple: - { - xieTecEncodeUncompressedTriple *tecParms = - (xieTecEncodeUncompressedTriple *)pvt->encodeParms; - - switch(tecParms->interleave) { - case xieValBandByPlane: - ped->ddVec = ECPhotoUncomByPlaneVec; - break; - - case xieValBandByPixel: - ped->ddVec = ECPhotoUncomByPixelVec; - break; - } /* end switch on interleave */ - break; - } - - case xieValEncodeJPEGBaseline: - { - /*** JPEG for SI can only handle 8 bit image depths ***/ - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr src = &inf->srcDef->outFlo; - int b; - for (b=0; b< src->bands; ++b) - if (src->format[b].depth != 8) { - xieFloExportClientPhoto *raw = - (xieFloExportClientPhoto *)ped->elemRaw; - - TechniqueError(flo,ped,xieValEncode,raw->encodeTechnique, - raw->lenParams,return(FALSE)); - } - } - ped->ddVec = ECPhotoJPEGBaselineVec; - break; -#endif /* XIE_FULL */ - default: - ImplementationError(flo,ped, return(FALSE)); - } - return(TRUE); -} /* end meAnalyzeECPhoto */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, xieValMaxBands * sizeof(meUncompRec), NO_SYNC, - NO_SYNC)); -} /* end CreateECPhoto */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - formatPtr inf = ped->inFloLst[SRCtag].format; - meUncompPtr pvt = (meUncompPtr)pet->private; - CARD32 nbands = ped->outFlo.bands, b, s; - xieTypOrientation pixelOrder, fillOrder; - - if (nbands == 1) { - xieTecEncodeUncompressedSingle *tecParms = - (xieTecEncodeUncompressedSingle *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - - pixelOrder = tecParms->pixelOrder; - fillOrder = tecParms->fillOrder; - pvt[0].bandMap = 0; - } else { - xieTecEncodeUncompressedTriple *tecParms = - (xieTecEncodeUncompressedTriple *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - - pixelOrder = tecParms->pixelOrder; - fillOrder = tecParms->fillOrder; - if (tecParms->bandOrder == xieValLSFirst) - for(b = 0; b < xieValMaxBands; ++b) - pvt[b].bandMap = b; - else - for(s = 0, b = xieValMaxBands; b--; ++s) - pvt[s].bandMap = b; - } - - for (b = 0; b < nbands; b++, pvt++, inf++) { - formatPtr outf = &ped->outFlo.format[pvt->bandMap]; - CARD8 class = inf->class; - if (class == BIT_PIXEL) { - pvt->width = inf->width; -#if (IMAGE_BYTE_ORDER == MSBFirst) - if (outf->stride != 1) { - pvt->action = (fillOrder == xieValMSFirst) ? btoIS: sbtoIS; - } else { - pvt->action = (fillOrder == xieValMSFirst) ? btoS : sbtoS; - } -#else - if (outf->stride != 1) { - pvt->action = (fillOrder == xieValLSFirst) ? btoIS: sbtoIS; - } else { - pvt->action = (fillOrder == xieValLSFirst) ? btoS : sbtoS; - } -#endif - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } else if (class == BYTE_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 7)) { - if (outf->stride == 8) - pvt->action = BtoS; - else - pvt->action = BtoIS; - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = BtoLLUB; - else - pvt->action = BtoLMUB; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = BtoMLUB; - else - pvt->action = BtoMMUB; - } - pvt->bitOff = 0; /* Bit offset to first pixel on line */ - pvt->leftOver = 0; /* Left over bits from last line */ - pvt->depth = inf->depth; - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } - } else if (class == PAIR_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 15)) { -#if (IMAGE_BYTE_ORDER == LSBFirst) - if (outf->stride == 16) - pvt->action = (fillOrder == xieValLSFirst) ? PtoS : sPtoS; - else - pvt->action = (fillOrder == xieValLSFirst) ? PtoIS: sPtoIS; -#else - if (outf->stride == 16) - pvt->action = (fillOrder == xieValMSFirst) ? PtoS : sPtoS; - else - pvt->action = (fillOrder == xieValMSFirst) ? PtoIS: sPtoIS; -#endif - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = PtoLLUP; - else - pvt->action = PtoLMUP; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = PtoMLUP; - else - pvt->action = PtoMMUP; - } - pvt->bitOff = 0; /* Bit offset to first pixel on line */ - pvt->leftOver = 0; /* Left over bits from last line */ - pvt->depth = inf->depth; - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } - } else if (class == QUAD_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 31)) { -#if (IMAGE_BYTE_ORDER == LSBFirst) - if (outf->stride == 32) - pvt->action = (fillOrder == xieValLSFirst) ? QtoS : sQtoS; - else - pvt->action = (fillOrder == xieValLSFirst) ? QtoIS: sQtoIS; -#else - if (outf->stride == 32) - pvt->action = (fillOrder == xieValMSFirst) ? QtoS : sQtoS; - else - pvt->action = (fillOrder == xieValMSFirst) ? QtoIS: sQtoIS; -#endif - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = QtoLLUQ; - else - pvt->action = QtoLMUQ; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = QtoMLUQ; - else - pvt->action = QtoMMUQ; - } - } - } else - ImplementationError(flo,ped, return(FALSE)); - - } - - pet->bandSync = NO_SYNC; - - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeEPhotoUncomByPlane */ - - -static int InitializeECPhotoStream(floDefPtr flo, peDefPtr ped) -{ - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeECPhotoStream */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateECPhotoUncomByPlane(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientPhoto *raw = (xieFloExportClientPhoto*)ped->elemRaw; - meUncompPtr pvt = (meUncompPtr)pet->private; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp->inFlo->bands; - bandPtr sbnd = rcp->band,dbnd; - bandMsk ready = ped->outFlo.ready; - CARD32 b, d, olen, nlen, pitch; - pointer src, dst; - - for(b = 0; b < bands; ++sbnd, ++dbnd, ++b, ++pvt) { - d = pvt->bandMap; - dbnd = &pet->emitter[d]; - pitch = dbnd->format->pitch; - nlen = (pvt->bitOff + pitch + 7) >> 3; - src = GetCurrentSrc(flo,pet,sbnd); - dst = GetDstBytes(flo,pet,dbnd,dbnd->current,nlen,KEEP); - - while(src && dst) { - - (*pvt->action)(src,dst,pvt); - - pvt->bitOff = (pvt->bitOff + pitch) & 7; - olen = pvt->bitOff ? nlen - 1 : nlen; - nlen = (pvt->bitOff + pitch + 7) >> 3; - src = GetNextSrc(flo,pet,sbnd,FLUSH); - dst = GetDstBytes(flo,pet,dbnd,dbnd->current+olen,nlen,KEEP); - } - FreeData(flo,pet,sbnd,sbnd->current); - if(!src && sbnd->final) { - if(pvt->bitOff) /* If we have any bits left, send them out now */ - *(CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current,1,KEEP)=pvt->leftOver; - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); /* write the remaining data */ - } - - if(~ready & ped->outFlo.ready & 1<notify == xieValNewData || - (raw->notify == xieValFirstData && !ped->outFlo.output[d].flink->start))) - SendExportAvailableEvent(flo,ped,d,0,0,0); - } - return(TRUE); -} /* end ActivateECPhotoUncomByPlane */ - - -static int ActivateECPhotoStream(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientPhoto *raw = (xieFloExportClientPhoto*)ped->elemRaw; - bandPtr sbnd = pet->receptor[SRCtag].band; - bandPtr dbnd = pet->emitter; - outFloPtr oflo = &ped->outFlo; - CARD32 nbands = oflo->bands; - bandMsk ready = oflo->ready; - CARD32 b; - - for(b = 0; b < nbands; ++sbnd, ++dbnd, ++b) { - if(!(pet->scheduled & 1<strip)) - return(FALSE); - - FreeData(flo,pet,sbnd,sbnd->maxLocal); - } - /* if it's appropriate, send an event - */ - if(~ready & oflo->ready & 1<notify == xieValNewData || - (raw->notify == xieValFirstData && !oflo->output[b].flink->start))) - SendExportAvailableEvent(flo,ped,b,0,0,0); - } - return(TRUE); -} /* end ActivateECPhotoStream */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetECPhoto(floDefPtr flo, peDefPtr ped) -{ - meUncompPtr pvt = (meUncompPtr)ped->peTex->private; - int i; - - for(i = 0; i < xieValMaxBands; ++i) - if(pvt[i].buf) pvt[i].buf = (pointer) XieFree(pvt[i].buf); - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetECPhoto */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyECPhotoUn(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyECPhotoUn */ - - -#if XIE_FULL -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, xieValMaxBands * sizeof(meUncompRec), NO_SYNC, - SYNC)); -} /* end CreateECPhoto */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - meUncompPtr pvt = (meUncompPtr)pet->private; - formatPtr outf = pet->emitter[0].format; - xieTecEncodeUncompressedTriple *tec = - (xieTecEncodeUncompressedTriple *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - bandPtr sbnd1,sbnd2,sbnd3; - CARD32 depth1,depth2,depth3,dstride,width; - int s, d; - - pvt->unaligned = (tec->pixelStride[0] & 7) != 0; - - if(tec->bandOrder == xieValLSFirst) - for(d = 0; d < xieValMaxBands; ++d) - pvt[d].bandMap = d; - else - for(s = 0, d = xieValMaxBands; d--; ++s) - pvt[s].bandMap = d; - - sbnd1 = &pet->receptor[SRCtag].band[pvt[0].bandMap]; - sbnd2 = &pet->receptor[SRCtag].band[pvt[1].bandMap]; - sbnd3 = &pet->receptor[SRCtag].band[pvt[2].bandMap]; - depth1 = sbnd1->format->depth; - depth2 = sbnd2->format->depth; - depth3 = sbnd3->format->depth; - width = sbnd1->format->width; - dstride = tec->pixelStride[0]>>3; - - if (!pvt->unaligned) { - /* First, look for special cases */ - if (depth1 == 16 && depth2 == 16 && depth3 == 16) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? PtoIS : sPtoIS; -#else - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? sPtoIS : PtoIS; -#endif - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = pa; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = s; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } - } else if (depth1 == 8 && depth2 == 8 && depth3 == 8) { - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = BtoIS; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = s; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } - } else if (depth1 == 4 && depth2 == 4 && depth3 == 4) { - if (tec->fillOrder == xieValMSFirst) { - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - (pvt++)->shift = 4; - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0x0f; - pvt->clear_dst = FALSE; - (pvt++)->shift = 0; - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 1; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - pvt->shift = 4; - } else { /* xieValLSFirst */ - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->clear_dst = FALSE; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - (pvt++)->shift = 4; - pvt->action = BtoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 1; - pvt->mask = 0x0f; - pvt->clear_dst = FALSE; - pvt->shift = 0; - } - } else if (depth1 + depth2 + depth3 <= 8) { - CARD8 ones = 0xff,smask1,smask2,smask3,shift1,shift2,shift3; - if (tec->fillOrder == xieValMSFirst) { - smask1 = ~(ones>>depth1); - smask2 = ~(ones>>(depth1 + depth2) | smask1); - smask3 = ~(ones>>(depth1 + depth2 + depth3) | smask1 | smask2); - shift1 = 8 - depth1; - shift2 = 8 - (depth1 + depth2); - shift3 = 8 - (depth1 + depth2 + depth3); - } else { /* fillOrder == xieValLSFirst */ - smask3 = ~(ones<action = (depth1 > 1) ? BtoISb : btoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask1; - pvt->clear_dst = TRUE; - (pvt++)->shift = shift1; - pvt->action = (depth2 > 1) ? BtoISb : btoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask2; - pvt->clear_dst = TRUE; - (pvt++)->shift = shift2; - pvt->action = (depth3 > 1) ? BtoISb : btoISb; - pvt->width = width; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask3; - pvt->clear_dst = TRUE; - pvt->shift = shift3; - } else - pvt->unaligned = TRUE; - } - pvt = (meUncompPtr)pet->private; - if ( pvt->unaligned ) { - pvt[0].pitch = outf->pitch; - pvt[0].width = sbnd1->format->width; - pvt[0].depth = depth1; - pvt[1].depth = depth2; - pvt[2].depth = depth3; - pvt->action = EncodeTripleFuncs[tec->pixelOrder == xieValLSFirst ? 0 : 1] - [tec->fillOrder == xieValLSFirst ? 0 : 1] - [depth1 <= 8 ? 0 : 1] - [depth2 <= 8 ? 0 : 1] - [depth3 <= 8 ? 0 : 1]; - if((depth1 == 1 && !(pvt[0].buf = (pointer)XieMalloc(pvt[0].width+7))) || - (depth2 == 1 && !(pvt[1].buf = (pointer)XieMalloc(pvt[1].width+7))) || - (depth3 == 1 && !(pvt[2].buf = (pointer)XieMalloc(pvt[2].width+7)))) - AllocError(flo,ped, return(FALSE)); - } - - pet->bandSync = SYNC; - - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeECPhotoUnTriple */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateECPhotoUncomByPixel(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientPhoto *raw = (xieFloExportClientPhoto*)ped->elemRaw; - meUncompPtr pvt = (meUncompPtr)pet->private; - bandPtr sb0 = &pet->receptor[SRCtag].band[pvt[0].bandMap]; - bandPtr sb1 = &pet->receptor[SRCtag].band[pvt[1].bandMap]; - bandPtr sb2 = &pet->receptor[SRCtag].band[pvt[2].bandMap]; - bandPtr dbnd = &pet->emitter[0]; - CARD32 pitch = dbnd->format->pitch; - bandMsk ready = ped->outFlo.ready; - pointer dst, sp0 = (pointer)NULL, sp1 = (pointer)NULL, sp2 = (pointer)NULL; - - if (pvt->unaligned) { - CARD32 stride = dbnd->format->stride; - CARD32 width = dbnd->format->width; - CARD32 nextdlen = (pvt->bitOff + pitch + 7) >> 3, olddlen; - if((sp0 = GetCurrentSrc(flo,pet,sb0)) && - (sp1 = GetCurrentSrc(flo,pet,sb1)) && - (sp2 = GetCurrentSrc(flo,pet,sb2)) && - (dst = GetDstBytes(flo,pet,dbnd,dbnd->current,nextdlen,KEEP))) - do { - if(pvt[0].buf) sp0 = bitexpand(sp0,pvt[0].buf,width,(char)0,(char)1); - if(pvt[1].buf) sp1 = bitexpand(sp1,pvt[1].buf,width,(char)0,(char)1); - if(pvt[2].buf) sp2 = bitexpand(sp2,pvt[2].buf,width,(char)0,(char)1); - - (*pvt->action)(sp0,sp1,sp2,dst,stride,pvt); - - sp0 = GetNextSrc(flo,pet,sb0,FLUSH); - sp1 = GetNextSrc(flo,pet,sb1,FLUSH); - sp2 = GetNextSrc(flo,pet,sb2,FLUSH); - pvt->bitOff = (pvt->bitOff + pitch) & 7; /* Set next */ - olddlen = (pvt->bitOff) ? nextdlen - 1 : nextdlen; - nextdlen = (pvt->bitOff + pitch + 7) >> 3; - dst = GetDstBytes(flo,pet,dbnd,dbnd->current+olddlen, - nextdlen,KEEP); - } while(dst && sp0 && sp1 && sp2); - } else { - CARD32 dlen = pitch >> 3; /* For nicely aligned data */ - if((sp0 = GetCurrentSrc(flo,pet,sb0)) && - (sp1 = GetCurrentSrc(flo,pet,sb1)) && - (sp2 = GetCurrentSrc(flo,pet,sb2)) && - (dst = GetDstBytes(flo,pet,dbnd,dbnd->current,dlen,KEEP))) - do { - - if (pvt[0].clear_dst) bzero(dst,(int)dlen); - - (*pvt[0].action)(sp0,dst,&pvt[0]); - (*pvt[1].action)(sp1,dst,&pvt[1]); - (*pvt[2].action)(sp2,dst,&pvt[2]); - - sp0 = GetNextSrc(flo,pet,sb0,FLUSH); - sp1 = GetNextSrc(flo,pet,sb1,FLUSH); - sp2 = GetNextSrc(flo,pet,sb2,FLUSH); - dst = GetDstBytes(flo,pet,dbnd,dbnd->current+dlen,dlen,KEEP); - } while(dst && sp0 && sp1 && sp2); - } - - FreeData(flo,pet,sb0,sb0->current); - FreeData(flo,pet,sb1,sb1->current); - FreeData(flo,pet,sb2,sb2->current); - if(!sp0 && sb0->final && !sp1 && sb1->final && !sp2 && sb2->final) { - if (pvt->bitOff) /* If we have any bits left, send them out now */ - *(CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current,1,KEEP) = pvt->leftOver; - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); /* write the remaining data */ - } - - if(~ready & ped->outFlo.ready & 1 && - (raw->notify == xieValNewData || - (raw->notify == xieValFirstData && !ped->outFlo.output[0].flink->start))) - SendExportAvailableEvent(flo,ped,0,0,0,0); - - return(TRUE); -} /* end ActivateECPhotoUncomByPixel */ -#endif - -/* end module mecphoto.c */ Index: xc/programs/Xserver/XIE/mixie/export/mecroi.c diff -u xc/programs/Xserver/XIE/mixie/export/mecroi.c:3.6 xc/programs/Xserver/XIE/mixie/export/mecroi.c:removed --- xc/programs/Xserver/XIE/mixie/export/mecroi.c:3.6 Fri Dec 14 14:58:19 2001 +++ xc/programs/Xserver/XIE/mixie/export/mecroi.c Sat Feb 28 21:41:58 2004 @@ -1,249 +0,0 @@ -/* $Xorg: mecroi.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mecroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mecroi.c -- DDXIE export client roi element - - Larry Hare && Dean Verheiden -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mecroi.c,v 3.6 2001/12/14 19:58:19 dawes Exp $ */ - -#define _XIEC_MECROI -#define _XIEC_ECROI - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - - -/* routines referenced by other DDXIE modules - */ -extern int miAnalyzeECROI(floDefPtr flo, peDefPtr ped); - -/* routines used internal to this module - */ -static int CreateECROI(floDefPtr flo, peDefPtr ped); -static int InitializeECROI(floDefPtr flo, peDefPtr ped); -static int ActivateECROI(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetECROI(floDefPtr flo, peDefPtr ped); -static int DestroyECROI(floDefPtr flo, peDefPtr ped); - -/* DDXIE ExportClientROI entry points - */ -static ddElemVecRec ECROIVec = -{ - CreateECROI, - InitializeECROI, - ActivateECROI, - (xieIntProc)NULL, - ResetECROI, - DestroyECROI -}; - -/* Local routines */ -static void ConvertToRect(ROIPtr proi, xieTypRectangle *prect); - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeECROI(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = ECROIVec; - return TRUE; -} /* end miAnalyzeECROI */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateECROI(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the roi element definition */ - return MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC); -} /* end CreateECROI */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeECROI(floDefPtr flo, peDefPtr ped) -{ - return InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeECROI */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateECROI(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportClientROI *raw = (xieFloExportClientROI*)ped->elemRaw; - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &rcp->band[0]; - bandPtr dbnd = &pet->emitter[0]; - CARD32 rectSize; - xieTypRectangle *prect; - ROIPtr proi; - - if (!(proi = (ROIRec*)GetCurrentSrc(flo,pet,sbnd))) - return FALSE; - - rectSize = sizeof(xieTypRectangle) * proi->nrects; - - if (!(prect = (xieTypRectangle*)GetDstBytes(flo,pet,dbnd,0,rectSize,KEEP))) - return FALSE; - - ConvertToRect(proi,prect); - - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,rectSize); - FreeData(flo,pet,sbnd,sbnd->maxLocal); - - switch(raw->notify) { - case xieValFirstData: /* fall thru */ - case xieValNewData: SendExportAvailableEvent(flo,ped,0,proi->nrects,0,0); - default: break; - } - - return TRUE; -} /* end ActivateECROI */ - -static void ConvertToRect(ROIPtr proi, xieTypRectangle *prect) -{ - CARD32 nrects = 0; - linePtr lp; - - /* Convert run lengths to xieTypRectangles */ - lp = (linePtr)&proi[1]; - while (lp < proi->lend) { - register runPtr rp = RUNPTR(0); - register CARD32 x = proi->x; - register CARD32 j = lp->nrun; - - while (j--) { - x += rp->dstart; - prect[nrects].x = x; - prect[nrects].y = lp->y; - prect[nrects].width = rp->length; - prect[nrects++].height = lp->nline; - x += (rp++)->length; - } - lp = (linePtr)RUNPTR(lp->nrun); - } -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetECROI(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return TRUE; -} /* end ResetECROI */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyECROI(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.flush = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return TRUE; -} /* end DestroyECROI */ Index: xc/programs/Xserver/XIE/mixie/export/medraw.c diff -u xc/programs/Xserver/XIE/mixie/export/medraw.c:3.6 xc/programs/Xserver/XIE/mixie/export/medraw.c:removed --- xc/programs/Xserver/XIE/mixie/export/medraw.c:3.6 Fri Dec 14 14:58:19 2001 +++ xc/programs/Xserver/XIE/mixie/export/medraw.c Sat Feb 28 21:41:58 2004 @@ -1,363 +0,0 @@ -/* $Xorg: medraw.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module medraw.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - medraw.c -- DDXIE prototype export drawable element - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/medraw.c,v 3.6 2001/12/14 19:58:19 dawes Exp $ */ - -#define _XIEC_MEDRAW -#define _XIEC_EDRAW - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -extern int miAnalyzeEDraw(floDefPtr flo, peDefPtr ped); - -/* - * routines used internal to this module - */ -static int CreateEDraw(floDefPtr flo, peDefPtr ped); -static int InitializeEDraw(floDefPtr flo, peDefPtr ped); -static int ActivateEDrawAlign(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ActivateEDrawStrip(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetEDraw(floDefPtr flo, peDefPtr ped); -static int DestroyEDraw(floDefPtr flo, peDefPtr ped); - -static void adjustStride8to4(char *dst, char *src, CARD32 width); -static void adjustStride32to24(char *dst, char *src, CARD32 width); - -extern Bool DrawableAndGC(); - -/* - * DDXIE ExportDrawable entry points - */ -static ddElemVecRec EDrawVec = { - CreateEDraw, - InitializeEDraw, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetEDraw, - DestroyEDraw - }; - -typedef struct _medraw { - xieVoidProc adjust; - char *buf; -} meDrawRec, *meDrawPtr; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeEDraw(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = EDrawVec; - - return(TRUE); -} /* end miAnalyzeEDraw */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateEDraw(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, sizeof(meDrawRec), NO_SYNC, NO_SYNC); -} /* end CreateEDraw */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEDraw(floDefPtr flo, peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - meDrawPtr ddx = (meDrawPtr) pet->private; - formatPtr sf = &ped->inFloLst[SRCtag].format[0]; - formatPtr df = &ped->outFlo.format[0]; - Bool adj_stride = sf->stride != df->stride; - Bool adj_pitch = sf->pitch != df->pitch; - - if(adj_stride || adj_pitch) { - ped->ddVec.activate = ActivateEDrawAlign; - - if(adj_stride) { - if(!(ddx->buf = (char*) XieMalloc(df->pitch>>3))) - AllocError(flo,ped, return(FALSE)); - - if(sf->stride == 32 && df->stride == 24) - ddx->adjust = adjustStride32to24; - - else if(sf->stride == 8 && df->stride == 4) - ddx->adjust = adjustStride8to4; - - /* add more adjustment routines as required */ - } - } else { - ped->ddVec.activate = ActivateEDrawStrip; - } - return(InitReceptors(flo,ped,NO_DATAMAP,1)); -} /* end InitializeEDraw */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateEDrawAlign(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportDrawable *raw = (xieFloExportDrawable *) ped->elemRaw; - eDrawDefPtr dix = (eDrawDefPtr) ped->elemPvt; - meDrawPtr ddx = (meDrawPtr) pet->private; - bandPtr bnd = &pet->receptor[SRCtag].band[0]; - char *dst, *src = (char*)GetCurrentSrc(flo,pet,bnd); - CARD32 width = bnd->format->width; - - if (!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&dix->pDraw,&dix->pGC)) - return FALSE; - - do { - if(ddx->adjust) { - dst = AlterSrc(flo,pet,bnd->strip) ? src : ddx->buf; - (*ddx->adjust)(dst, src, width); - } else - dst = src; - - (*dix->pGC->ops->PutImage)(dix->pDraw, /* drawable */ - dix->pGC, /* gc */ - dix->pDraw->depth, /* depth */ - raw->dstX, /* drawable-x */ - raw->dstY + bnd->current, /* drawable-y */ - width, 1, /* width, height */ - bnd->strip->bitOff, /* padding? */ - ZPixmap, /* data format */ - dst /* data buffer */ - ); - } while ((src = (char*)GetNextSrc(flo,pet,bnd,KEEP)) != 0); - - /* make sure the scheduler knows how much src we used */ - FreeData(flo,pet,bnd,bnd->current); - - return(TRUE); -} /* end ActivateEDrawAlign */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateEDrawStrip(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportDrawable *raw = (xieFloExportDrawable *) ped->elemRaw; - eDrawDefPtr pvt = (eDrawDefPtr) ped->elemPvt; - bandPtr bnd = &pet->receptor[SRCtag].band[0]; - char *src = (char*)GetCurrentSrc(flo,pet,bnd); - - if(src) { - if (!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&pvt->pDraw,&pvt->pGC)) - return FALSE; - do - (*pvt->pGC->ops->PutImage)(pvt->pDraw, /* drawable */ - pvt->pGC, /* gc */ - pvt->pDraw->depth, /* depth */ - raw->dstX, /* drawable-x */ - raw->dstY+bnd->minLocal, /* drawable-y */ - bnd->format->width, /* width */ - bnd->strip->length, /* height */ - bnd->strip->bitOff, /* padding? */ - ZPixmap, /* data format */ - src /* data buffer */ - ); - while ((src = (char*)GetSrc(flo,pet,bnd,bnd->maxLocal,KEEP)) != 0); - } - /* make sure the scheduler knows how much src we used */ - FreeData(flo,pet,bnd,bnd->current); - - return(TRUE); -} /* end ActivateEDrawStrip */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetEDraw(floDefPtr flo, peDefPtr ped) -{ - meDrawPtr ddx = (meDrawPtr) ped->peTex->private; - - if(ddx->buf) ddx->buf = (char*)XieFree(ddx->buf); - ddx->adjust = (xieVoidProc)NULL; - - ResetReceptors(ped); - - return(TRUE); -} /* end ResetEDraw */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyEDraw(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyEDraw */ - - -/*------------------------------------------------------------------------ ----------------------------- alignment routines -------------------------- -------------------------------------------------------------------------*/ -static void adjustStride32to24(char *dst, char *src, CARD32 width) -{ - register char *ip, *op; - CARD32 i; - -#if (BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER) - ip = src; - op = dst; - for(i = 0; i < width; ip += 2, ++i) { - *op++ = *ip++; *op++ = *ip++; *op++ = *ip; - } -#else - /* we'll do the first 2 pixels by hand in case we're doing this in-place - */ - char tmp = src[0]; - dst[0] = src[2]; - dst[2] = tmp; - if(width > 1) { - tmp = src[4]; - dst[3] = src[6]; - dst[4] = src[5]; - dst[5] = tmp; - } - if(width > 2) { - ip = src + 8; - op = dst + 6; - for(i = 2; i < width; ip += 4, ++i) { - *op++ = ip[2]; *op++ = ip[1]; *op++ = *ip; - } - } -#endif -} - -static void adjustStride8to4(char *dst, char *src, CARD32 width) -{ - register char *ip = src, *op = dst; - CARD32 i; - - for(i = 0; i < width; ip += 2, ++i) { -#if (BITMAP_BIT_ORDER == LSBFirst) - *op++ = *ip | *(ip+1)<<8; -#else - *op++ = *ip<<8 | *(ip+1); -#endif - } -} - -/* end module medraw.c */ Index: xc/programs/Xserver/XIE/mixie/export/medrawp.c diff -u xc/programs/Xserver/XIE/mixie/export/medrawp.c:3.6 xc/programs/Xserver/XIE/mixie/export/medrawp.c:removed --- xc/programs/Xserver/XIE/mixie/export/medrawp.c:3.6 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/medrawp.c Sat Feb 28 21:41:58 2004 @@ -1,417 +0,0 @@ -/* $Xorg: medrawp.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module medrawp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - medrawp.c -- DDXIE prototype export drawable plane element - - Robert NC Shelley && Larry Hare -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/medrawp.c,v 3.6 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MEDRAWP -#define _XIEC_EDRAWP - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -extern Bool DrawableAndGC(); - -/* - * routines referenced by other DDXIE modules - */ -extern int miAnalyzeEDrawP(floDefPtr flo, peDefPtr ped); - -/* - * routines used internal to this module - */ -static int CreateEDrawP(floDefPtr flo, peDefPtr ped); -static int InitializeEDrawP(floDefPtr flo, peDefPtr ped); -static int ActivateEDrawP(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ActivateEDrawPTrans(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetEDrawP(floDefPtr flo, peDefPtr ped); -static int DestroyEDrawP(floDefPtr flo, peDefPtr ped); - -/* - * DDXIE ExportDrawable entry points - */ -static ddElemVecRec EDrawPVec = { - CreateEDrawP, - InitializeEDrawP, - ActivateEDrawP, - (xieIntProc)NULL, - ResetEDrawP, - DestroyEDrawP - }; - -typedef struct _medrawp { - BytePixel *buf; -} meDrawPRec, *meDrawPPtr; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeEDrawP(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = EDrawPVec; - - return(TRUE); -} /* end miAnalyzeEDrawP */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateEDrawP(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, sizeof(meDrawPRec), NO_SYNC, NO_SYNC); -} /* end CreateEDrawP */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEDrawP(floDefPtr flo, peDefPtr ped) -{ - xieFloExportDrawablePlane *raw = (xieFloExportDrawablePlane *) ped->elemRaw; - eDrawPDefPtr dix = (eDrawPDefPtr) ped->elemPvt; - - if (!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&dix->pDraw,&dix->pGC)) - return FALSE; - - if (dix->pGC->fillStyle == FillStippled) - ped->ddVec.activate = ActivateEDrawPTrans; - else /* normal case: FillSolid || FillTiled || FillOpaqueStippled */ - ped->ddVec.activate = ActivateEDrawP; - -#if (BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER) - { - meDrawPPtr ddx = (meDrawPPtr) ped->peTex->private; - if(!(ddx->buf = ((BytePixel*)XieMalloc(max(ped->outFlo.format[0].pitch+7>>3, - flo->floTex->stripSize))))) - AllocError(flo,ped, return(FALSE)); - } -#endif - - return InitReceptors(flo,ped,NO_DATAMAP,1); -} /* end InitializeEDrawP */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateEDrawP(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportDrawablePlane *raw = (xieFloExportDrawablePlane *) ped->elemRaw; - eDrawPDefPtr dix = (eDrawPDefPtr) ped->elemPvt; - bandPtr bnd = &pet->receptor[SRCtag].band[0]; - BytePixel *src = (BytePixel*)GetCurrentSrc(flo,pet,bnd); - CARD32 pixtype, depth; - - if(src) { - if(!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&dix->pDraw,&dix->pGC)) - return FALSE; - pixtype = (dix->pDraw->type == DRAWABLE_PIXMAP) ? XYPixmap : XYBitmap; - depth = (pixtype == XYBitmap) ? 1 : dix->pDraw->depth; - - do { -#if (BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER) - { - meDrawPPtr ddx = (meDrawPPtr) pet->private; - BytePixel *op, *dst; - int nb = bnd->pitch * bnd->strip->length; - dst = op = AlterSrc(flo,pet,bnd->strip) ? src : ddx->buf; - - while (nb--) - *op++ = _ByteReverseTable[*src++]; - src = dst; - } -#endif - (*dix->pGC->ops->PutImage)(dix->pDraw, /* drawable */ - dix->pGC, /* gc */ - depth, /* depth */ - raw->dstX, /* drawable-x */ - raw->dstY+bnd->minLocal, /* drawable-y */ - bnd->format->width, /* width */ - bnd->strip->length, /* height */ - bnd->strip->bitOff, /* padding? */ - pixtype, /* data format */ - (char*)src /* data buffer */ - ); - } - while ((src = (BytePixel*)GetSrc(flo,pet,bnd,bnd->maxLocal,KEEP)) != 0) - ; - - /* make sure the scheduler knows how much src we used */ - FreeData(flo,pet,bnd,bnd->current); - } - return(TRUE); -} /* end ActivateEDrawP */ - -static int ActivateEDrawPTrans(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - xieFloExportDrawablePlane *raw = (xieFloExportDrawablePlane *) ped->elemRaw; - eDrawPDefPtr dix = (eDrawPDefPtr) ped->elemPvt; - bandPtr bnd = &pet->receptor[SRCtag].band[0]; - DrawablePtr draw; - GCPtr gc, scratch; - PixmapPtr bitmap; - BytePixel *src; - int oldstyle, newstyle = FillSolid; - XID gcvals[3]; - - src = (BytePixel*)GetSrc(flo,pet,bnd,bnd->minGlobal,FALSE); - if(src) { - if (!DrawableAndGC(flo,ped,raw->drawable,raw->gc,&dix->pDraw,&dix->pGC)) - return FALSE; - - draw = dix->pDraw; - gc = dix->pGC; - - /* - ** We use PushPixels with a solid fill to move the one bits onto the - ** screen. Alternatives include: - ** a) treat the bitmap as a stipple, set it up in a GC, and do a - ** simple FillRect with FillStippled. This has all the same - ** problems, plus some more. Notably its more difficult to - ** use ChangeGC to transiently save/restore stipples, and to - ** compute the stipple offsets. - ** b) another alternative is to change the incoming bitonal - ** image to run length and do a FillSpans. This also requires - ** either a scratch GC or transiently using the incoming GC. - ** It saves the extra bitmap creation and PutImage, but might - ** become grotesque when a dithered image comes rolling thru. - */ - - /* - ** Core X does not seem to provide an official interface to create - ** a pixmap header, or even to replace the data pointer. We can't - ** simply memcpy our data to it either, it might be on a separate - ** cpu/memory system, or even upside down. So we just use PutImage - ** to prepare our data. Sigh. On most cpu's, just explicitly - ** create a pixmap header yourself and call PushPixels directly. - ** Another optimization would be to use more lines at once. One - ** model for all this is miglblt.c - ** - ** Since we expect people may want to redo this routine, we have - ** left the pixmap and GC games local to this function rather than - ** spreading stuff out into private structures and initialize - ** and destroy routines. For instance, the bitmap and scratchGC - ** could be allocated once for the entire flow. - ** - ** For now we do 64 lines of bits at a time. We might come up - ** with a better estimate based on actual scanline length. We - ** need a function to call though to make this unkludgey. Using - ** NLINES as 64 may be bad if we get a very wide image. - ** - ** The current performance seems very bad, even doing a large - ** number of lines at a time. Haven't had time to investigate this. - */ - -#define NLINES 64 - - if (!(scratch = GetScratchGC(1, draw->pScreen))) - AllocError(flo,ped,return(FALSE)); - - - if (!(bitmap = (*draw->pScreen->CreatePixmap) (draw->pScreen, - bnd->format->width, NLINES, 1))) { - FreeScratchGC(scratch); - AllocError(flo,ped,return(FALSE)); - } - gcvals[0] = 1; - gcvals[1] = 0; - ChangeGC(scratch, GCForeground|GCBackground, gcvals); - - oldstyle = gc->fillStyle; - ChangeGC(gc, GCFillStyle, (XID *)&newstyle); - - do { - int iy, ny; -#if (BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER) - { - meDrawPPtr ddx = (meDrawPPtr) pet->private; - BytePixel *op, *dst; - int nb = bnd->pitch * bnd->strip->length; - dst = op = AlterSrc(flo,pet,bnd->strip) ? src : ddx->buf; - - while (nb--) - *op++ = _ByteReverseTable[*src++]; - src = dst; - } -#endif - for (iy = 0 ; iy < bnd->strip->length; iy += ny) { - ny = bnd->strip->length - iy; - if (ny > NLINES) - ny = NLINES; - if ((scratch->serialNumber) != (bitmap->drawable.serialNumber)) - ValidateGC((DrawablePtr)bitmap, scratch); - (*scratch->ops->PutImage) ( - (DrawablePtr)bitmap, /* drawable bitmap */ - scratch, /* gc */ - 1, /* depth */ - 0, /* drawable-x */ - 0, /* drawable-y */ - bnd->format->width, /* width */ - ny, /* height */ - bnd->strip->bitOff, /* padding? */ - XYPixmap, /* data format */ - (char*)src /* data buffer */ - ); - if ((gc->serialNumber) != (draw->serialNumber)) - ValidateGC(draw, gc); - (*gc->ops->PushPixels) ( - gc, /* gc */ - bitmap, /* bitmap */ - draw, /* drawable */ - bnd->format->width, /* width */ - ny, /* height */ - raw->dstX+(gc->miTranslate?draw->x:0), /* dst X/Y */ - raw->dstY+(gc->miTranslate?draw->y:0)+bnd->current+iy - ); - src += bnd->pitch * ny; /* gack */ - } - } while ((src = (BytePixel*)GetSrc(flo,pet,bnd,bnd->maxLocal,FALSE)) != 0); - - /* make sure the scheduler knows how much src we used */ - FreeData(flo,pet,bnd,bnd->current); - - ChangeGC(gc, GCFillStyle, (XID *)&oldstyle); - ValidateGC(draw, gc); - - (*draw->pScreen->DestroyPixmap) (bitmap); - FreeScratchGC(scratch); - } - - return(TRUE); -} /* end ActivateEDrawPTrans */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetEDrawP(floDefPtr flo, peDefPtr ped) -{ - meDrawPPtr ddx = (meDrawPPtr) ped->peTex->private; - - if(ddx->buf) ddx->buf = (BytePixel*)XieFree(ddx->buf); - - ResetReceptors(ped); - - return(TRUE); -} /* end ResetEDrawP */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyEDrawP(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyEDrawP */ - -/* end module medrawp.c */ Index: xc/programs/Xserver/XIE/mixie/export/mefax.c diff -u xc/programs/Xserver/XIE/mixie/export/mefax.c:3.6 xc/programs/Xserver/XIE/mixie/export/mefax.c:removed --- xc/programs/Xserver/XIE/mixie/export/mefax.c:3.6 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/mefax.c Sat Feb 28 21:41:58 2004 @@ -1,613 +0,0 @@ -/* $Xorg: mefax.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mefax.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mefax.c -- DDXIE prototype export photomap coded with one of - many FAX techiques (g31d,g32d,g42d,tiff2,packbits) - - Ben Fahy -- AGE Logic, Inc. Oct, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mefax.c,v 3.6 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MEPHOTO -#define _XIEC_EPHOTO - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include <../include/fax.h> /* XXX - ugh! */ -#include <../fax/fencode.h> /* XXX - even ugh-ier! */ -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -extern int CreateEPhotoFAX(floDefPtr flo, peDefPtr ped); -extern int InitializeEPhotoFAX(floDefPtr flo, peDefPtr ped); -extern int ActivateEPhotoFAX(floDefPtr flo, peDefPtr ped, peTexPtr pet); -extern int ResetEPhotoFAX(floDefPtr flo, peDefPtr ped); -extern int DestroyEPhotoFAX(floDefPtr flo, peDefPtr ped); -extern int InitializeECPhotoFAX(floDefPtr flo, peDefPtr ped); - -/* ECPhoto Create routines are shared */ -/* ECPhoto Activate routines are shared */ -/* ECPhoto Reset routines are shared */ -/* ECPhoto Destroy routines are shared */ - -/* - * Local Declarations - */ - - -typedef struct _fax_encode_pvt { - int (*encodptr)(); /* function used to encode the data */ - FaxEncodeState state; /* holds all coding info for FAX dudes */ - int notify; /* relevant for ECPhoto only */ - int encoded_order; /* LSfirst or MSfirst */ - - xieTypEncodeTechnique encode_technique; - char *tech_params; /* scroll away technique information */ - - int height; /* image height, so we know when done */ - int strip_req_newbytes; - /* when we GetDstBytes, how much */ -} faxPvtRec, *faxPvtPtr; - -#define MaybeSwapOutput() \ - if (texpvt->encoded_order == xieValLSFirst) { \ - register int size=dbnd->maxLocal-dbnd->minLocal; \ - register unsigned char *ucp = dst; \ - while (size--) \ - { \ - *ucp = _ByteReverseTable[*ucp]; \ - ucp++; \ - } \ - } - -/* - * routines used internal to this module - */ - -static int common_init( - floDefPtr flo, - peDefPtr ped, - char *tec, - CARD16 encodeTechnique); - -static int sub_fun( - floDefPtr flo, - peDefPtr ped, - peTexPtr pet, - faxPvtPtr texpvt, - FaxEncodeState *state, - bandPtr sbnd, - bandPtr dbnd); - -static void FreeFaxData(floDefPtr flo, peDefPtr ped); - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -int CreateEPhotoFAX(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, sizeof(faxPvtRec), NO_SYNC, NO_SYNC)); -} /* end CreateEPhotoFAX */ -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeEPhotoFAX(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - return( common_init(flo,ped,pvt->encodeParms,pvt->encodeNumber) ); -} -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeECPhotoFAX(floDefPtr flo, peDefPtr ped) -{ - xieFloExportClientPhoto *raw = (xieFloExportClientPhoto *) ped->elemRaw; - peTexPtr pet = ped->peTex; - faxPvtPtr texpvt = (faxPvtPtr)pet->private; - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - if( !common_init(flo,ped,pvt->encodeParms,pvt->encodeNumber) ) - return FALSE; - - texpvt->notify = raw->notify; - return TRUE; -} -/*------------------------------------------------------------------------ -------- lots of stuff shared between ECPhoto and EPhoto. . . ------------- -------------------------------------------------------------------------*/ -static int common_init( - floDefPtr flo, - peDefPtr ped, - char *tec, - CARD16 encodeTechnique) -{ -peTexPtr pet = ped->peTex; -faxPvtPtr texpvt=(faxPvtPtr) pet->private; -formatPtr inf = pet->receptor[0].band[0].format; -FaxEncodeState *state = &texpvt->state; -int pbytes,max_lines_in; - -/* every time we run, reset this */ - bzero(texpvt,sizeof(faxPvtRec)); - -/* now save away protocol technique info */ - texpvt->encode_technique = encodeTechnique; - texpvt->tech_params = tec; - -/* we also need width */ - state->width = inf->width; - texpvt->height = inf->height; - -/* do technique-dependent initialization */ - switch(encodeTechnique) { - case xieValEncodeG31D: - { - G31DEncodePvt *epvt; - xieTecEncodeG31D *g31dtec = (xieTecEncodeG31D *)tec; - - state->goal = ENCODE_FAX_GOAL_StartNewLine; - state->radiometric = g31dtec->radiometric; - texpvt->encoded_order = g31dtec->encodedOrder; - - /* set up data private to this technique */ - epvt = (G31DEncodePvt *) XieMalloc(sizeof(G31DEncodePvt)); - bzero(epvt,sizeof(G31DEncodePvt)); - epvt->counts = (int *) XieMalloc((state->width+1) * sizeof(int)); - if (!epvt->counts) { - FreeFaxData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - epvt->align_eol = g31dtec->alignEol; - state->private = (pointer ) epvt; - - texpvt->encodptr = encode_g31d; - } - break; - case xieValEncodeG32D: - { - G32DEncodePvt *epvt; - xieTecEncodeG32D *g32dtec = (xieTecEncodeG32D *)tec; - - state->goal = ENCODE_FAX_GOAL_StartNewLine; - state->radiometric = g32dtec->radiometric; - texpvt->encoded_order = g32dtec->encodedOrder; - - /* set up data private to this technique */ - epvt = (G32DEncodePvt *) XieMalloc(sizeof(G32DEncodePvt)); - bzero(epvt,sizeof(G32DEncodePvt)); - epvt->counts = (int *) XieMalloc((state->width+1) * sizeof(int)); - epvt->above = (int *) XieMalloc((state->width+1) * sizeof(int)); - if (!epvt->counts || !epvt->above) { - FreeFaxData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - epvt->k = g32dtec->kFactor; - epvt->align_eol = g32dtec->alignEol; - epvt->uncompressed = g32dtec->uncompressed; - state->private = (pointer ) epvt; - } - texpvt->encodptr = encode_g32d; - break; - case xieValEncodeG42D: - { - G42DEncodePvt *epvt; - xieTecEncodeG42D *g42dtec = (xieTecEncodeG42D *)tec; - - state->goal = ENCODE_FAX_GOAL_StartNewLine; - texpvt->encoded_order = g42dtec->encodedOrder; - state->radiometric = g42dtec->radiometric; - - /* set up data private to this technique */ - epvt = (G42DEncodePvt *) XieMalloc(sizeof(G42DEncodePvt)); - bzero(epvt,sizeof(G42DEncodePvt)); - epvt->counts = (int *) XieMalloc((state->width+1) * sizeof(int)); - epvt->above = (int *) XieMalloc((state->width+1) * sizeof(int)); - if (!epvt->counts || !epvt->above) { - FreeFaxData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - /* for G4, initialize imaginary line to "all white" */ - epvt->counts[0] = state->width; - epvt->nvals = 1; - - epvt->uncompressed = ((xieTecEncodeG42D *)tec)->uncompressed; - epvt->really_g4 = 1; - state->private = (pointer ) epvt; - } - texpvt->encodptr = encode_g32d; - break; - case xieValEncodeTIFF2: - { - Tiff2EncodePvt *epvt; - xieTecEncodeTIFF2 *tiff2tec = (xieTecEncodeTIFF2 *)tec; - - state->goal = ENCODE_FAX_GOAL_StartNewLine; - state->radiometric = tiff2tec->radiometric; - texpvt->encoded_order = tiff2tec->encodedOrder; - - /* set up data private to this technique */ - epvt = (Tiff2EncodePvt *) XieMalloc(sizeof(Tiff2EncodePvt)); - bzero(epvt,sizeof(Tiff2EncodePvt)); - epvt->counts = (int *) XieMalloc((state->width+1) * sizeof(int)); - if (!epvt->counts) { - FreeFaxData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - state->private = (pointer ) epvt; - } - texpvt->encodptr = encode_tiff2; - break; - case xieValEncodeTIFFPackBits: - { - PackBitsEncodePvt *epvt; - xieTecEncodeTIFFPackBits *tiffpbtec = (xieTecEncodeTIFFPackBits *)tec; - - state->goal = ENCODE_FAX_GOAL_StartNewLine; - state->width = 8 * ((state->width + 7)/8); - /* packbits assumes lines are padded to an even byte */ - - texpvt->encoded_order = tiffpbtec->encodedOrder; - - /* set up data private to this technique */ - epvt = (PackBitsEncodePvt *) XieMalloc(sizeof(PackBitsEncodePvt)); - bzero(epvt,sizeof(PackBitsEncodePvt)); - epvt->values = (int *) XieMalloc((state->width) * sizeof(int)); - epvt->counts = (int *) XieMalloc((state->width) * sizeof(int)); - if (!epvt->counts || !epvt->values) { - FreeFaxData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - state->private = (pointer ) epvt; - } - texpvt->encodptr = encode_tiffpb; - break; - default: - ImplementationError(flo,ped, return(FALSE)); - } - - /* size of first output strip */ - texpvt->strip_req_newbytes = flo->floTex->stripSize; - state->strip_state = StripStateNew; - -/* calculate size of the input strip data map we will need */ - pbytes = (inf->pitch + 7) >> 3; - max_lines_in = flo->floTex->stripSize / pbytes; - - if (!max_lines_in) - max_lines_in = 1; /* in case a line was bigger than std stripsize */ - - return(InitReceptors(flo, ped, max_lines_in, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); - -} /* end common_init() */ -/*------------------------------------------------------------------------ ------------------------------ free some data ---------------------------- -------------------------------------------------------------------------*/ -static void FreeFaxData(floDefPtr flo, peDefPtr ped) -{ -peTexPtr pet = ped->peTex; -faxPvtPtr texpvt=(faxPvtPtr) pet->private; -FaxEncodeState *state = &texpvt->state; - - switch(texpvt->encode_technique) { - case xieValEncodeG31D: - { - G31DEncodePvt *epvt = (G31DEncodePvt *) state->private; - if (epvt) { - if (epvt->counts) - XieFree(epvt->counts); - XieFree(epvt); - } - } - break; - case xieValEncodeG32D: - case xieValEncodeG42D: - { - G32DEncodePvt *epvt = (G32DEncodePvt *) state->private; - if (epvt) { - if (epvt->counts) XieFree(epvt->counts); - if (epvt->above) XieFree(epvt->above); - XieFree(epvt); - } - } - break; - case xieValEncodeTIFF2: - { - Tiff2EncodePvt *epvt = (Tiff2EncodePvt *) state->private; - if (epvt) { - if (epvt->counts) - XieFree(epvt->counts); - XieFree(epvt); - } - } - break; - case xieValEncodeTIFFPackBits: - { - PackBitsEncodePvt *epvt = (PackBitsEncodePvt *) state->private; - if (epvt) { - if (epvt->counts) XieFree(epvt->counts); - if (epvt->values) XieFree(epvt->values); - XieFree(epvt); - } - } - break; - default: - break; - } -} -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -int ActivateEPhotoFAX(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &rcp->band[0]; - bandPtr dbnd = &pet->emitter[0]; - faxPvtPtr texpvt=(faxPvtPtr) pet->private; - FaxEncodeState *state = &texpvt->state; - int was_ready, status; - - if (texpvt->notify) - was_ready = ped->outFlo.ready & 1; - - status = sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd); - - if(texpvt->notify && ~was_ready & ped->outFlo.ready & 1 && - (texpvt->notify==xieValNewData || - (texpvt->notify==xieValFirstData && !ped->outFlo.output[0].flink->start))) - SendExportAvailableEvent(flo,ped,0,0,0,0); - - return( status ); -} - -/*------------------------------------------------------------------------ --------------------- *really* crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int sub_fun( - floDefPtr flo, - peDefPtr ped, - peTexPtr pet, - faxPvtPtr texpvt, - FaxEncodeState *state, - bandPtr sbnd, - bandPtr dbnd) -{ -BytePixel *src,*dst; -int lines_coded; -int nl_mappable; - -/*** This program can exit the while(dst) loop because: - - 1) no new dst is available. This would only be because the - scheduler wants to activate somebody else. - - 2) We can't get (map) a new input strip. Maybe it's not available - because our data is coming from the client. We want to return - so we can get some. - - 3) we finished encoding all requested lines. - - 4) we notice an error. - - Now, the scheduler will always keep calling us as long as - we either have input data or final isn't set. We only set - final when we have used all input data and flushed all - output data. So there is no way for us to exit without - coming back properly. -***/ - - src = GetCurrentSrc(flo,pet,sbnd); - - if (dbnd->final) { - /* be forgiving if extra data gets passed to us */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - while ((dst = (BytePixel*)GetDstBytes(flo,pet,dbnd,dbnd->current, - texpvt->strip_req_newbytes,KEEP)) != 0) { - - if (!state->strip) { - state->strip = dst; - state->strip_size = dbnd->maxLocal - dbnd->current; - state->strip_state = StripStateNew; - } - nl_mappable = sbnd->maxLocal - sbnd->current; - if (nl_mappable + sbnd->current > texpvt->height) - nl_mappable = texpvt->height - sbnd->current; - - if (!MapData(flo,pet,sbnd,0,sbnd->current,nl_mappable,FLUSH)) { - FreeData(flo,pet,sbnd,sbnd->maxLocal); - return(TRUE); /* need another input strip */ - } - - state->i_lines = (char **)sbnd->dataMap; - state->nl_tocode = nl_mappable; - - lines_coded = (*(texpvt->encodptr))(state); - if (lines_coded < 0 || state->encoder_done > FAX_ENCODE_DONE_OK) { - /* coding error. But we should be able to *en*code anything! */ - ImplementationError(flo,ped, return(FALSE)); - } - state->i_line += lines_coded; - sbnd->current = state->i_line; - - if (state->i_line >= texpvt->height) { - /* We're all done! */ - - if (state->bits.bitpos) { - /* we need to make sure the stager gets flushed */ - unsigned char *byteptr= state->bits.byteptr; - - if (state->bits.endptr > byteptr) { - /* there is room in this strip for the stager */ - *byteptr = state->stager >> 24; - } - else { - /* woe is us. Stager won't fit in current output strip */ - MaybeSwapOutput(); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - /* flush current strip */ - /* ask for one more strip of length 1 */ - dst = (BytePixel*)GetDstBytes(flo,pet, - dbnd,dbnd->current,1,KEEP); - *dst = state->stager >> 24; - } - state->bits.byteptr++; - } - /* however we got here, we now have one strip to flush, - which contains all the remaining encoded data. - */ - TruncateStrip(dbnd, - dbnd->minLocal + state->bits.byteptr - state->strip); - SetBandFinal(dbnd); - MaybeSwapOutput(); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - - if (state->magic_needs) { - /* encoder needs a new output strip */ - if (state->strip_state != StripStateDone) - ImplementationError(flo,ped, return(FALSE)); - - MaybeSwapOutput(); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - /* I presume this will increment dbnd->current */ - - state->strip = 0; - continue; - } - - } /* end of while (GetDstBytes) */ - - return(TRUE); -} /* end ActivateEPhotoFAX */ -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -int ResetEPhotoFAX(floDefPtr flo, peDefPtr ped) -{ - faxPvtPtr texpvt=(faxPvtPtr) ped->peTex->private; - - if (texpvt) FreeFaxData(flo,ped); - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetEPhotoFAX */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -int DestroyEPhotoFAX(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyEPhotoFAX */ -/* end module mefax.c */ Index: xc/programs/Xserver/XIE/mixie/export/mejpeg.c diff -u xc/programs/Xserver/XIE/mixie/export/mejpeg.c:3.8 xc/programs/Xserver/XIE/mixie/export/mejpeg.c:removed --- xc/programs/Xserver/XIE/mixie/export/mejpeg.c:3.8 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/mejpeg.c Sat Feb 28 21:41:58 2004 @@ -1,649 +0,0 @@ -/* $Xorg: mejpeg.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mejpeg.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mejpeg.c -- DDXIE prototype export photomap coded ala JPEG element - - Ben Fahy -- AGE Logic, Inc. Oct, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mejpeg.c,v 3.8 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MEPHOTO -#define _XIEC_EPHOTO -#define _XIEC_ECPHOTO - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -extern int CreateEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped); -extern int InitializeEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped); -extern int ActivateEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped, peTexPtr pet); -extern int ResetEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped); -extern int DestroyEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped); - -/* Create routines are shared */ -int InitializeECPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped); -/* Activate routines are shared */ -/* Reset routines are shared */ -/* Destroy routines are shared */ - -/* - * routines used internal to this module - */ - -/* - * Local Declarations - */ - -typedef struct _jpeg_encode_pvt { - int (*encodptr)(); /* function used to encode the data */ - - xieTypDataClass class; /* SingleBand or TripleBand */ - int out_bands; /* should be 1 if interleaved */ - int in_bands; /* should be 3 if TripleBand */ - int colors_smushed; /* TripleBand BandByPixel */ - int swizzle; /* true to reverse band order */ - int notify; /* relevant for ECPhoto only */ - /* the following are used by the JPEG private routines */ - struct Compress_methods_struct c_methods; - struct External_methods_struct e_methods; - - /* these things hold state. may need one for each band */ - JpegEncodeState state[3]; - struct Compress_info_struct cinfo[3]; - unsigned char output_buffer[3][JPEG_BUF_SIZE]; -} jpegPvtRec, *jpegPvtPtr; - -static int sub_fun( - floDefPtr flo, - peDefPtr ped, - peTexPtr pet, - jpegPvtPtr texpvt, - JpegEncodeState *state, - bandPtr sbnd, - bandPtr dbnd, - bandPtr sbnd1, - bandPtr sbnd2); - -static int common_init( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGBaseline *tec, - CARD16 encodeTechnique); - -static int FlushJpegEncodeData( - bandPtr dbnd, - register unsigned char *dst, - JpegEncodeState *state); - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -int CreateEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, sizeof(jpegPvtRec), NO_SYNC, NO_SYNC)); -} /* end CreateEPhotoJPEGBaseline */ -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - return( common_init(flo,ped,pvt->encodeParms,pvt->encodeNumber) ); -} -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeECPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - peTexPtr pet = ped->peTex; - jpegPvtPtr texpvt=(jpegPvtPtr) pet->private; - - if(!common_init(flo,ped,pvt->encodeParms,pvt->encodeNumber)) { - if(ferrCode(flo)) - return(FALSE); - else - TechniqueError(flo,ped,xieValEncode, - ((xieFloExportClientPhoto*)ped->elemRaw)->encodeTechnique, - ((xieFloExportClientPhoto*)ped->elemRaw)->lenParams, - return(FALSE)); - } - texpvt->notify = ((xieFloExportClientPhoto *)ped->elemRaw)->notify; - return(TRUE); -} -/*------------------------------------------------------------------------ -------- lots of stuff shared between ECPhoto and EPhoto. . . ------------- -------------------------------------------------------------------------*/ -static int common_init( - floDefPtr flo, - peDefPtr ped, - xieTecEncodeJPEGBaseline *tec, - CARD16 encodeTechnique) -{ - peTexPtr pet = ped->peTex; - eTecEncodeJPEGBaselineDefPtr pedpvt=(eTecEncodeJPEGBaselineDefPtr) - ped->techPvt; - jpegPvtPtr texpvt=(jpegPvtPtr) pet->private; - int out_bands = ped->outFlo.bands; /* # of output bands */ - int in_bands = ped->inFloLst[SRCtag].bands; /* # of input bands */ - formatPtr inf = pet->receptor[0].band[0].format; - compress_info_ptr cinfo; - int pbytes,max_lines_in,b; - - /* every time we run, reset this */ - bzero(texpvt,sizeof(jpegPvtRec)); - - /* squirrel away # of bands and class output, class of input */ - texpvt->in_bands = in_bands; - texpvt->out_bands = out_bands; - texpvt->class = (in_bands == 3)? xieValTripleBand : xieValSingleBand; - texpvt->colors_smushed = 0; - - /* note: we assume dixie side has set up the in/out #bands properly */ - if (in_bands == 1) - texpvt->encodptr = encode_jpeg_lossy_gray; - /* JPEG will be coding grayscale */ - - else { - /* if interleave is BandByPlane, do gray, one band at a time. - * otherwise, do color, three bands at a time. - */ - if (in_bands == out_bands) { /* interleaving BandByPlane */ - texpvt->encodptr = encode_jpeg_lossy_gray; - /* JPEG will code each band individually */ - } - else { /* BandByPixel, do all 3 bands at once */ - texpvt->encodptr = encode_jpeg_lossy_color; - texpvt->colors_smushed = 1; - /* JPEG will code all bands simultaneously */ - } - } - ped->peTex->bandSync = in_bands != out_bands; - texpvt->swizzle = tec->bandOrder == xieValMSFirst; - - /* now deal with stuff on per-band basis */ - for (b=0; b < out_bands; ++b) { - JpegEncodeState *state = &(texpvt->state[b]); - - state->width = inf->width; - state->height = inf->height; - state->n_bands = texpvt->colors_smushed ? 3 : 1; - /* this is how many bands the encoder looks at. If the image is */ - /* TripleBand-BandByPixel, 3. If BandByPlane or SingleBand, 1 */ - - state->c_methods = &texpvt->c_methods; - state->e_methods = &texpvt->e_methods; - - state->lenQtable = tec->lenQtable; - state->lenACtable = tec->lenACtable; - state->lenDCtable = tec->lenDCtable; - state->Qtable = pedpvt->q; - state->ACtable = pedpvt->a; - state->DCtable = pedpvt->d; - - state->goal = JPEG_ENCODE_GOAL_Startup; - state->needs_input_strip = 1; - - cinfo = state->cinfo = &texpvt->cinfo[b]; - if(JC_INIT(cinfo,state->c_methods,state->e_methods) != 0) - return(FALSE); - - cinfo->jpeg_buf_size = JPEG_BUF_SIZE; - cinfo->output_buffer = (char *) texpvt->output_buffer[b]; - state->jpeg_output_buffer = texpvt->output_buffer[b]; - - /* size of first output strip */ - state->strip_req_newbytes = flo->floTex->stripSize; - - if(texpvt->colors_smushed) { - int j; - for(j = 0; j < xieValMaxBands; ++j) { - state->h_sample[j] = tec->horizontalSamples[j]; - state->v_sample[j] = tec->verticalSamples[j]; - } - } - } - /* calculate size of the input strip data map we will need */ - pbytes = (inf->pitch + 7) >> 3; - max_lines_in = flo->floTex->stripSize / pbytes; - - if (!max_lines_in) - max_lines_in = 1; /* in case a line was bigger than std stripsize */ - - return(InitReceptors(flo, ped, max_lines_in, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); - -} /* end common_init() */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -int ActivateEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &rcp->band[0]; /* "red" (or gray) input */ - bandPtr sbnd1 = &rcp->band[1]; /* optional "green" */ - bandPtr sbnd2 = &rcp->band[2]; /* optional "blue" */ - bandPtr dbnd = &pet->emitter[0]; - jpegPvtPtr texpvt=(jpegPvtPtr) pet->private; - int b, d, was_ready = 0, status; - - /* if the class of the src is SingleBand, we call sub_fun for band 0 */ - /* if the class of the src is TripleBand and the interleave is */ - /* BandByPlane, we call sub_fun 3 times, once for each band */ - /* if the class of the src is TripleBand, interleave BandByPixel, we */ - /* call subfun once, supplying it all three source bands */ - - if (texpvt->class == xieValSingleBand) { - JpegEncodeState *state = &(texpvt->state[0]); - - if (texpvt->notify) { - was_ready = ped->outFlo.ready; - } - - status = sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,NULL,NULL); - - if(texpvt->notify && ~was_ready & ped->outFlo.ready & 1 && - (texpvt->notify == xieValNewData || - (texpvt->notify == xieValFirstData && - !ped->outFlo.output[0].flink->start))) - SendExportAvailableEvent(flo,ped,0,0,0,0); - - return( status ); - } - - /* TripleBand */ - if (texpvt->colors_smushed) { /* BandByPixel */ - JpegEncodeState *state = &(texpvt->state[0]); - - if (texpvt->notify) { - was_ready = ped->outFlo.ready & 1; - } - if(texpvt->swizzle) - status = sub_fun(flo,ped,pet,texpvt,state,sbnd2,dbnd,sbnd1,sbnd); - else - status = sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,sbnd1,sbnd2); - - if(texpvt->notify && ~was_ready & ped->outFlo.ready & 1 && - (texpvt->notify == xieValNewData || - (texpvt->notify == xieValFirstData && - !ped->outFlo.output[0].flink->start))) - SendExportAvailableEvent(flo,ped,0,0,0,0); - - return( status ); - } - - /* TripleBand, BandByPlane */ - for(b = 0; b < xieValMaxBands; ++b) { - JpegEncodeState *state = &(texpvt->state[b]); - d = texpvt->swizzle ? xieValMaxBands - b - 1 : b; - sbnd = &rcp->band[b]; /* do each band independently */ - dbnd = &pet->emitter[d]; - - if (texpvt->notify) { - was_ready = ped->outFlo.ready & 1<notify && ~was_ready & ped->outFlo.ready & 1<notify == xieValNewData || - (texpvt->notify == xieValFirstData && - !ped->outFlo.output[d].flink->start))) - SendExportAvailableEvent(flo,ped,d,0,0,0); - - if (status == FALSE) - return( status ); - } - return(TRUE); -} -/*------------------------------------------------------------------------ --------------------- *really* crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int sub_fun( - floDefPtr flo, - peDefPtr ped, - peTexPtr pet, - jpegPvtPtr texpvt, - JpegEncodeState *state, - bandPtr sbnd, - bandPtr dbnd, - bandPtr sbnd1, - bandPtr sbnd2) -{ -BytePixel *dst; -int status; - -/*** This program can return due to the following reasons: - - 1) we have provided all the data an input strip has to the - encoder, and we are not at the end of the image. In this - case we can expect to return when more data comes. - - 2) We try to get another Destination strip, but GetDst - turns us down because the scheduler wants to activate - somebody else. Since we haven't set final yet, we - are ok. - - 3) after encoding, we notice the state is Done and there - is no data left to flush. We set final and return. - - 4) we finish flushing all of our data, and notice state - is Done. We set final and return. - - 5) we notice an error. - - Now, the scheduler will always keep calling us as long as - we either have input data or final isn't set. We only set - final when we have used all input data and flushed all - output data. So there is no way for us to exit without - coming back properly. -***/ - - (void) GetCurrentSrc(flo,pet,sbnd); - if (dbnd->final) { - /* be forgiving if extra data gets passed to us */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - while ((dst = (BytePixel*)GetDstBytes(flo,pet,dbnd,dbnd->current, - state->strip_req_newbytes,FLUSH)) != 0) { - if (state->flush_output) { - - status = FlushJpegEncodeData(dbnd,dst,state); - /* write as much as we can to output strip. This */ - /* also updates state->i_line and state->nl_coded. */ - - if (status == JPEG_FLUSH_FlushedAll) { - state->strip_req_newbytes = dbnd->maxLocal - dbnd->current; - state->cinfo->bytes_in_buffer = 0; - if (state->goal == JPEG_ENCODE_GOAL_Done) { - /* we're done and nothing to flush, so let's wrap up */ - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - if (sbnd1) { - FreeData(flo,pet,sbnd1,sbnd1->maxGlobal); - FreeData(flo,pet,sbnd2,sbnd2->maxGlobal); - } - return(TRUE); - } - continue; - /* go around loop again. Get another dst */ - /* (if needed) and encode some more */ - } - else if (status == JPEG_FLUSH_FlushedPart) { - /* go get another Destination strip */ - state->strip_req_newbytes = flo->floTex->stripSize; - PutData(flo,pet,dbnd,dbnd->current); - continue; - } - else - ImplementationError(flo,ped, return(FALSE)); - - } /* end of if flush */ - else { - state->nl_tocode = 0; - if (state->i_line < state->height) { - - /* haven't reached the end of the image yet */ - int nl_mappable = sbnd->maxLocal - sbnd->current; - - if (sbnd->current != state->i_line) - OperatorError(flo,ped,123,return(FALSE)) ; - - if (!MapData(flo,pet,sbnd,0,sbnd->current,nl_mappable,FLUSH)) { - FreeData(flo,pet,sbnd,sbnd->maxLocal); - if (sbnd1) { - FreeData(flo,pet,sbnd1,sbnd1->maxLocal); - FreeData(flo,pet,sbnd2,sbnd2->maxLocal); - } - return(TRUE); /* need another input strip */ - } - - state->i_lines[0] = (unsigned char **)sbnd->dataMap; - state->nl_tocode = sbnd->maxLocal - sbnd->current; - - if (sbnd1) { - - if (!MapData(flo,pet,sbnd1,0,sbnd1->current,nl_mappable,FLUSH)) { - FreeData(flo,pet,sbnd,sbnd->maxLocal); - FreeData(flo,pet,sbnd1,sbnd1->maxLocal); - FreeData(flo,pet,sbnd2,sbnd2->maxLocal); - return(TRUE); /* need another input strip */ - } - state->i_lines[1] = (unsigned char **)sbnd1->dataMap; - - if (!MapData(flo,pet,sbnd2,0,sbnd2->current,nl_mappable,FLUSH)) { - FreeData(flo,pet,sbnd,sbnd->maxLocal); - FreeData(flo,pet,sbnd1,sbnd1->maxLocal); - FreeData(flo,pet,sbnd2,sbnd2->maxLocal); - return(TRUE); /* need another input strip */ - } - state->i_lines[2] = (unsigned char **)sbnd2->dataMap; - } - } /* end of if (state->i_line < state->height) */ - - if (state->cinfo->bytes_in_buffer) { - /* this should not be possible if the flushing code is working */ - ImplementationError(flo,ped, return(FALSE)); - } - if ( (*(texpvt->encodptr))(state) < 0 ) - ImplementationError(flo,ped, return(FALSE)); - /* coding error. We should be able to encode anything! */ - - sbnd->current = state->i_line; - if (sbnd1) - sbnd1->current = sbnd2->current = state->i_line; - - if (state->flush_output) { - /* encoder wants us to flush its buffer before we call */ - /* it again. record position of where to start flushing */ - - state->jpeg_output_bpos = (unsigned char *) - state->cinfo->output_buffer; - continue; - } - if (state->goal == JPEG_ENCODE_GOAL_Done) { - /* we're done and nothing to flush, so let's wrap up */ - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - if (sbnd1) { - FreeData(flo,pet,sbnd1,sbnd1->maxGlobal); - FreeData(flo,pet,sbnd2,sbnd2->maxGlobal); - } - return(TRUE); - } - if (!state->nl_tocode) { - /* we have no input left */ - if (state->i_line < state->height) { - /* need another input strip */ - FreeData(flo,pet,sbnd,sbnd->current); - if (sbnd1) { - FreeData(flo,pet,sbnd1,sbnd1->current); - FreeData(flo,pet,sbnd2,sbnd2->current); - } - return(TRUE); - } - else - state->goal = JPEG_ENCODE_GOAL_EndFrame; - } - - } /* end of else !flush */ - - } /* end of while (GetDstBytes) */ - - return(TRUE); -} /* end ActivateEPhotoJPEGBaseline */ -/*------------------------------------------------------------------------ -------------------- flush JPEG buffer to output strip ------------------- -------------------------------------------------------------------------*/ -static int FlushJpegEncodeData( - bandPtr dbnd, - register unsigned char *dst, - JpegEncodeState *state) -{ -register unsigned char *jpeg_odata = state->jpeg_output_bpos; -int bytes_left_in_strip; -register int i,max_can_do; - - bytes_left_in_strip = dbnd->maxLocal - dbnd->current; - /* dbnd->current is the offset from start of strip, */ - /* so it represents the number of bytes used */ - max_can_do = (bytes_left_in_strip > state->flush_output)? - state->flush_output : bytes_left_in_strip; - - for (i=0; icurrent += max_can_do; - state->flush_output -= max_can_do; - state->jpeg_output_bpos += max_can_do; - - if (state->flush_output) - return(JPEG_FLUSH_FlushedPart); - else - return(JPEG_FLUSH_FlushedAll); -} -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -int ResetEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - ResetEmitter(ped); - - /* get rid of the any data malloc'd by JPEG encoder - */ - if(ped->peTex) { - jpegPvtPtr texpvt = (jpegPvtPtr) ped->peTex->private; - int b; - - /* JPEG code has its own global free routine - */ - for (b=0; bin_bands; ++b) { - if(texpvt->cinfo[b].emethods && texpvt->cinfo[b].emethods->c_free_all) - (*texpvt->cinfo[b].emethods->c_free_all)(& texpvt->cinfo[b]); - } - } - return(TRUE); -} /* end ResetEPhotoJPEGBaseline */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -int DestroyEPhotoJPEGBaseline(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyEPhotoJPEGBaseline */ -/* end module mejpeg.c */ Index: xc/programs/Xserver/XIE/mixie/export/melut.c diff -u xc/programs/Xserver/XIE/mixie/export/melut.c:3.6 xc/programs/Xserver/XIE/mixie/export/melut.c:removed --- xc/programs/Xserver/XIE/mixie/export/melut.c:3.6 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/melut.c Sat Feb 28 21:41:58 2004 @@ -1,219 +0,0 @@ -/* $Xorg: melut.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module melut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - melut.c -- DDXIE prototype export lut element - - Larry Hare -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/melut.c,v 3.6 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MELUT -#define _XIEC_ELUT - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines used internal to this module - */ -static int CreateELUT(floDefPtr flo, peDefPtr ped); -static int InitializeELUT(floDefPtr flo, peDefPtr ped); -static int ActivateELUT(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetELUT(floDefPtr flo, peDefPtr ped); -static int DestroyELUT(floDefPtr flo, peDefPtr ped); - -/* - * DDXIE ExportLUT entry points - */ -static ddElemVecRec ELUTVec = { - CreateELUT, - InitializeELUT, - ActivateELUT, - (xieIntProc)NULL, - ResetELUT, - DestroyELUT - }; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeELUT(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = ELUTVec; - - return(TRUE); -} /* end miAnalyzeELUT */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateELUT(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the lut element definition */ - return(MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC)); -} /* end CreateELUT */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeELUT(floDefPtr flo, peDefPtr ped) -{ - return InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeELUT */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateELUT(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp->inFlo->bands; - bandPtr sbnd = &rcp->band[0]; - bandPtr dbnd = &pet->emitter[0]; - CARD32 b; - - for(b = 0; b < bands; ++sbnd, ++dbnd, ++b) { - - /* get pointer to the initial src data (i.e. beginning of strip) - */ - if(GetCurrentSrc(flo,pet,sbnd)) { - - /* LUT only has 1 strip per band - */ - if(!PassStrip(flo,pet,dbnd,sbnd->strip)) - return(FALSE); - - /* free the amount of src strip(s) we've used - */ - FreeData(flo,pet,sbnd,sbnd->maxLocal); - } - } - return(TRUE); -} /* end ActivateELUT */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetELUT(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetELUT */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyELUT(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyELUT */ - -/* end module melut.c */ Index: xc/programs/Xserver/XIE/mixie/export/mephoto.c diff -u xc/programs/Xserver/XIE/mixie/export/mephoto.c:3.6 xc/programs/Xserver/XIE/mixie/export/mephoto.c:removed --- xc/programs/Xserver/XIE/mixie/export/mephoto.c:3.6 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/mephoto.c Sat Feb 28 21:41:58 2004 @@ -1,779 +0,0 @@ -/* $Xorg: mephoto.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module mephoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mephoto.c -- DDXIE prototype export photomap element - - Robert NC Shelley -- AGE Logic, Inc. June, 1993 - Dean && Ben - various additions to handle different techniques - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/mephoto.c,v 3.6 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MEPHOTO -#define _XIEC_EPHOTO - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * routines used internal to this module - */ -static int CreateEPhotoUncom(floDefPtr flo, peDefPtr ped); -static int InitializeEPhotoBypass(floDefPtr flo, peDefPtr ped); -static int InitializeEPhotoUncomByPlane(floDefPtr flo, peDefPtr ped); -static int ActivateEPhotoUncomByPlane(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetEPhoto(floDefPtr flo, peDefPtr ped); -static int DestroyEPhoto(floDefPtr flo, peDefPtr ped); - -#if XIE_FULL -static int InitializeEPhotoUncomByPixel(floDefPtr flo, peDefPtr ped); -static int ActivateEPhotoUncomByPixel(floDefPtr flo, peDefPtr ped, peTexPtr pet); -#endif /* XIE_FULL */ - - -/* - * routines we need from somewhere else - */ - -extern int CreateEPhotoJPEGBaseline(); -extern int InitializeEPhotoJPEGBaseline(); -extern int ActivateEPhotoJPEGBaseline(); -extern int ResetEPhotoJPEGBaseline(); -extern int DestroyEPhotoJPEGBaseline(); - -extern int CreateEPhotoFAX(); -extern int InitializeEPhotoFAX(); -extern int ActivateEPhotoFAX(); -extern int ResetEPhotoFAX(); -extern int DestroyEPhotoFAX(); - -/* - * DDXIE ExportPhotomap entry points - */ -static ddElemVecRec EPhotoBypassVec = { - CreateEPhotoUncom, - InitializeEPhotoBypass, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetEPhoto, - DestroyEPhoto - }; - -static ddElemVecRec EPhotoUncomByPlaneVec = { - CreateEPhotoUncom, - InitializeEPhotoUncomByPlane, - ActivateEPhotoUncomByPlane, - (xieIntProc)NULL, - ResetEPhoto, - DestroyEPhoto - }; - -static ddElemVecRec EPhotoFAXVec = { - CreateEPhotoFAX, - InitializeEPhotoFAX, - ActivateEPhotoFAX, - (xieIntProc)NULL, - ResetEPhotoFAX, - DestroyEPhotoFAX - }; - -#if XIE_FULL -static ddElemVecRec EPhotoUncomByPixelVec = { - CreateEPhotoUncom, - InitializeEPhotoUncomByPixel, - ActivateEPhotoUncomByPixel, - (xieIntProc)NULL, - ResetEPhoto, - DestroyEPhoto - }; - -static ddElemVecRec EPhotoJPEGBaselineVec = { - CreateEPhotoJPEGBaseline, - InitializeEPhotoJPEGBaseline, - ActivateEPhotoJPEGBaseline, - (xieIntProc)NULL, - ResetEPhotoJPEGBaseline, - DestroyEPhotoJPEGBaseline - }; -#endif /* XIE_FULL */ - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeEPhoto(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - if(pvt->congress) { - ped->ddVec = EPhotoBypassVec; - return(TRUE); - } - switch(pvt->encodeNumber) { - - case xieValEncodeUncompressedSingle: - ped->ddVec = EPhotoUncomByPlaneVec; - break; - - case xieValEncodeG31D: - case xieValEncodeG32D: - case xieValEncodeG42D: - case xieValEncodeTIFF2: - case xieValEncodeTIFFPackBits: - ped->ddVec = EPhotoFAXVec; - break; - -#if XIE_FULL - case xieValEncodeUncompressedTriple: - { - xieTecEncodeUncompressedTriple *tecParms = - (xieTecEncodeUncompressedTriple *)pvt->encodeParms; - if(tecParms->interleave == xieValBandByPlane) - ped->ddVec = EPhotoUncomByPlaneVec; - else - ped->ddVec = EPhotoUncomByPixelVec; - } - break; - case xieValEncodeJPEGBaseline: - { /*** JPEG for SI can only handle 8 bit image depths ***/ - inFloPtr inf = &ped->inFloLst[IMPORT]; - outFloPtr src = &inf->srcDef->outFlo; - int b; - for (b=0; b< src->bands; ++b) - if(src->format[b].depth != 8) { - xieFloExportPhotomap *raw = (xieFloExportPhotomap *)ped->elemRaw; - - TechniqueError(flo, ped, xieValEncode, - raw->encodeTechnique, raw->lenParams, return(FALSE)); - } - } - ped->ddVec = EPhotoJPEGBaselineVec; - break; - case xieValEncodeJPEGLossless: -#endif /* XIE_FULL */ - default: ImplementationError(flo,ped, return(FALSE)); - } - return(TRUE); -} /* end miAnalyzeEPhoto */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateEPhotoUncom(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, xieValMaxBands * sizeof(meUncompRec), - NO_SYNC, NO_SYNC)); -} /* end CreateEPhotoUncom */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEPhotoBypass(floDefPtr flo, peDefPtr ped) -{ - /* Allows data manager to bypass element entirely */ - return(InitReceptor(flo, ped, ped->peTex->receptor, - NO_DATAMAP, 1, NO_BANDS, ALL_BANDS)); -} /* end InitializeEPhotoBypass */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEPhotoUncomByPlane(floDefPtr flo, peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - meUncompPtr pvt = (meUncompPtr)pet->private; - formatPtr inf = ped->inFloLst[SRCtag].format; - bandPtr sbnd = pet->receptor->band; - CARD32 nbands = ped->outFlo.bands, b, s; - xieTypOrientation pixelOrder, fillOrder; - Bool inited = FALSE; - - if (nbands == 1) { - xieTecEncodeUncompressedSingle *tecParms = - (xieTecEncodeUncompressedSingle *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - pixelOrder = tecParms->pixelOrder; - fillOrder = tecParms->fillOrder; - pvt[0].bandMap = 0; - } else { - xieTecEncodeUncompressedTriple *tecParms = - (xieTecEncodeUncompressedTriple *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - pixelOrder = tecParms->pixelOrder; - fillOrder = tecParms->fillOrder; - if(tecParms->bandOrder == xieValLSFirst) - for(b = 0; b < xieValMaxBands; ++b) - pvt[b].bandMap = b; - else - for(s = 0, b = xieValMaxBands; b--; ++s) - pvt[s].bandMap = b; - } - for (b = 0; b < nbands; b++, pvt++, inf++, sbnd++) { - bandPtr dbnd = &pet->emitter[pvt->bandMap]; - formatPtr outf = &ped->outFlo.format[pvt->bandMap]; - CARD8 class = inf->class; - if (class == BIT_PIXEL) { - pvt->width = inf->width; -#if (IMAGE_BYTE_ORDER == MSBFirst) - if (outf->stride != 1) { - pvt->action = (fillOrder == xieValMSFirst) ? btoIS: sbtoIS; - } else { - pvt->action = (fillOrder == xieValMSFirst) ? - (void (*)())NULL : sbtoS; - } -#else - if (outf->stride != 1) { - pvt->action = (fillOrder == xieValLSFirst) ? btoIS: sbtoIS; - } else { - pvt->action = (fillOrder == xieValLSFirst) ? - (void (*)())NULL : sbtoS; - } -#endif - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } else if (class == BYTE_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 7)) { - if (outf->stride == 8) - pvt->action = BtoS; - else - pvt->action = BtoIS; - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = BtoLLUB; - else - pvt->action = BtoLMUB; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = BtoMLUB; - else - pvt->action = BtoMMUB; - } - pvt->bitOff = 0; /* Bit offset to first pixel on line */ - pvt->leftOver = 0; /* Left over bits from last line */ - pvt->depth = inf->depth; - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } - } else if (class == PAIR_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 15)) { -#if (IMAGE_BYTE_ORDER == LSBFirst) - if (outf->stride == 16) - pvt->action = (fillOrder == xieValLSFirst) ? - (void (*)())NULL : sPtoS; - else - pvt->action = (fillOrder == xieValLSFirst) ? PtoIS: sPtoIS; -#else - if (outf->stride == 16) - pvt->action = (fillOrder == xieValMSFirst) ? - (void (*)())NULL : sPtoS; - else - pvt->action = (fillOrder == xieValMSFirst) ? PtoIS: sPtoIS; -#endif - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = PtoLLUP; - else - pvt->action = PtoLMUP; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = PtoMLUP; - else - pvt->action = PtoMMUP; - } - pvt->bitOff = 0; /* Bit offset to first pixel on line */ - pvt->leftOver = 0; /* Left over bits from last line */ - pvt->depth = inf->depth; - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - } - } else if (class == QUAD_PIXEL) { - pvt->width = inf->width; - if (!(outf->stride & 31)) { -#if (IMAGE_BYTE_ORDER == LSBFirst) - if (outf->stride == 32) - pvt->action = (fillOrder == xieValLSFirst) ? - (void (*)())NULL : sQtoS; - else - pvt->action = (fillOrder == xieValLSFirst) ? QtoIS: sQtoIS; -#else - if (outf->stride == 32) - pvt->action = (fillOrder == xieValMSFirst) ? - (void (*)())NULL : sQtoS; - else - pvt->action = (fillOrder == xieValMSFirst) ? QtoIS: sQtoIS; -#endif - pvt->Bstride = outf->stride >> 3; - pvt->dstoffset = 0; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } else { - if (pixelOrder == xieValLSFirst) { - if (fillOrder == xieValLSFirst) - pvt->action = QtoLLUQ; - else - pvt->action = QtoLMUQ; - } else { - if (fillOrder == xieValLSFirst) - pvt->action = QtoMLUQ; - else - pvt->action = QtoMMUQ; - } - } - } else - ImplementationError(flo,ped, return(FALSE)); - - if (pvt->action) { - pvt->bitOff = 0; /* Bit offset to first pixel on line */ - pvt->leftOver = 0; /* Left over bits from last line */ - pvt->width = inf->width; - pvt->depth = inf->depth; - pvt->stride = outf->stride; - pvt->pitch = outf->pitch; - if(!InitBand(flo,ped,sbnd,NO_DATAMAP,(CARD32)1,NO_INPLACE) || - !InitBand(flo,ped,dbnd,NO_DATAMAP,(CARD32)0,NO_INPLACE)) - return(FALSE); - inited = TRUE; - } else { - *outf = *inf; /* Pass data into photomap in native format */ - sbnd->receptor->bypass |= 1<bandSync = NO_SYNC; - - return(inited ? TRUE : - /* Allows data manager to bypass element entirely */ - InitReceptor(flo,ped,pet->receptor,NO_DATAMAP,1,NO_BANDS,ALL_BANDS)); -} /* end InitializeEPhotoUncomByPlane */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateEPhotoUncomByPlane(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - meUncompPtr pvt = (meUncompPtr)pet->private; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp->inFlo->bands; - bandPtr sbnd = rcp->band, dbnd; - CARD32 b, olddlen, nextdlen, width, stride, pitch; - pointer src; - CARD8 *dst; - - for(b = 0; b < bands; ++sbnd, ++b, ++pvt) { - dbnd = &pet->emitter[pvt->bandMap]; - width = sbnd->format->width; - pitch = dbnd->format->pitch; - stride = dbnd->format->stride; - nextdlen = (pvt->bitOff + pitch + 7) >> 3; - - if (!(pet->scheduled & 1<current,nextdlen,KEEP); - - while(!ferrCode(flo) && src && dst) { - - (*pvt->action)(src,dst,pvt); - - src = GetNextSrc(flo,pet,sbnd,FLUSH); - pvt->bitOff = (pvt->bitOff + pitch) & 7; /* Set next */ - olddlen = (pvt->bitOff) ? nextdlen - 1: nextdlen; - nextdlen = (pvt->bitOff + pitch + 7) >> 3; - dst = (CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current+olddlen, - nextdlen,KEEP); - } - FreeData(flo,pet,sbnd,sbnd->current); - - if(!src && sbnd->final) { - if (pvt->bitOff) /* If we have any bits left, send them out now */ - *(CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current,1,KEEP)=pvt->leftOver; - - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); /* write the remaining data */ - } - } - return(TRUE); -} /* end ActivateEPhotoUncomByPlane */ - - -#if XIE_FULL -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEPhotoUncomByPixel(floDefPtr flo, peDefPtr ped) -{ - peTexPtr pet = ped->peTex; - meUncompPtr pvt = (meUncompPtr)pet->private; - xieTecEncodeUncompressedTriple *tec = - (xieTecEncodeUncompressedTriple *) - ((ePhotoDefPtr)ped->elemPvt)->encodeParms; - formatPtr outf = pet->emitter[0].format; - bandPtr sbnd1,sbnd2,sbnd3; - CARD32 depth1,depth2,depth3,dstride; - int s, d; - - pvt->unaligned = (tec->pixelStride[0] & 7) != 0; - - if(tec->bandOrder == xieValLSFirst) - for(d = 0; d < xieValMaxBands; ++d) - pvt[d].bandMap = d; - else - for(s = 0, d = xieValMaxBands; d--; ++s) - pvt[s].bandMap = d; - - sbnd1 = &pet->receptor[SRCtag].band[pvt[0].bandMap]; - sbnd2 = &pet->receptor[SRCtag].band[pvt[1].bandMap]; - sbnd3 = &pet->receptor[SRCtag].band[pvt[2].bandMap]; - depth1 = pvt[0].depth = sbnd1->format->depth; - depth2 = pvt[1].depth = sbnd2->format->depth; - depth3 = pvt[2].depth = sbnd3->format->depth; - dstride = tec->pixelStride[0]>>3; - pvt[0].width = pvt[1].width = pvt[2].width = sbnd1->format->width; - - if (!pvt->unaligned) { - /* Look for special cases */ - if (depth1 == 16 && depth2 == 16 && depth3 == 16) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? PtoIS : sPtoIS; -#else - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? sPtoIS : PtoIS; -#endif - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = pa; - pvt->Bstride = dstride; - pvt->dstoffset = s; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } - } else if (depth1 == 8 && depth2 == 8 && depth3 == 8) { - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = BtoIS; - pvt->Bstride = dstride; - pvt->dstoffset = s; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - pvt->clear_dst = FALSE; - } - } else if (depth1 == 4 && depth2 == 4 && depth3 == 4) { - if (tec->fillOrder == xieValMSFirst) { - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - (pvt++)->shift = 4; - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0x0f; - pvt->clear_dst = FALSE; - (pvt++)->shift = 0; - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 1; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - pvt->shift = 4; - } else { /* xieValLSFirst */ - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->clear_dst = FALSE; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = 0xf0; - pvt->clear_dst = FALSE; - (pvt++)->shift = 4; - pvt->action = BtoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 1; - pvt->mask = 0x0f; - pvt->clear_dst = FALSE; - pvt->shift = 0; - } - } else if (depth1 + depth2 + depth3 <= 8) { - CARD8 ones = 0xff,smask1,smask2,smask3,shift1,shift2,shift3; - if (tec->fillOrder == xieValMSFirst) { - smask1 = ~(ones>>depth1); - smask2 = ~(ones>>(depth1 + depth2) | smask1); - smask3 = ~(ones>>(depth1 + depth2 + depth3) | smask1 | smask2); - shift1 = 8 - depth1; - shift2 = 8 - (depth1 + depth2); - shift3 = 8 - (depth1 + depth2 + depth3); - } else { /* fillOrder == xieValLSFirst */ - smask3 = ~(ones<action = (depth1 > 1) ? BtoISb : btoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask1; - pvt->clear_dst = TRUE; - (pvt++)->shift = shift1; - pvt->action = (depth2 > 1) ? BtoISb : btoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask2; - pvt->clear_dst = TRUE; - (pvt++)->shift = shift2; - pvt->action = (depth3 > 1) ? BtoISb : btoISb; - pvt->Bstride = dstride; - pvt->dstoffset = 0; - pvt->mask = smask3; - pvt->clear_dst = TRUE; - pvt->shift = shift3; - } else - pvt->unaligned = TRUE; - } - pvt = (meUncompPtr)pet->private; - if (pvt->unaligned) { - /* No special cases, do it the hard way */ - pvt[0].pitch = outf->pitch; - pvt->action = EncodeTripleFuncs[tec->pixelOrder == xieValLSFirst ? 0 : 1] - [tec->fillOrder == xieValLSFirst ? 0 : 1] - [depth1 <= 8 ? 0 : 1] - [depth2 <= 8 ? 0 : 1] - [depth3 <= 8 ? 0 : 1]; - if((depth1 == 1 && !(pvt[0].buf = (pointer)XieMalloc(pvt[0].width+7))) || - (depth2 == 1 && !(pvt[1].buf = (pointer)XieMalloc(pvt[1].width+7))) || - (depth3 == 1 && !(pvt[2].buf = (pointer)XieMalloc(pvt[2].width+7)))) - AllocError(flo,ped, return(FALSE)); - } - pet->bandSync = SYNC; - - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeEPhotoUncomByPixel */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateEPhotoUncomByPixel(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - meUncompPtr pvt = (meUncompPtr)pet->private; - bandPtr sb0 = &pet->receptor[SRCtag].band[pvt[0].bandMap]; - bandPtr sb1 = &pet->receptor[SRCtag].band[pvt[1].bandMap]; - bandPtr sb2 = &pet->receptor[SRCtag].band[pvt[2].bandMap]; - bandPtr dbnd = &pet->emitter[0]; - CARD32 pitch = dbnd->format->pitch; - pointer sp0 = (pointer )NULL, sp1 = (pointer )NULL, sp2 = (pointer )NULL; - CARD8 *dst; - - - if (pvt->unaligned) { - CARD32 stride = dbnd->format->stride; - CARD32 width = dbnd->format->width; - CARD32 nextdlen = (pvt->bitOff + pitch + 7) >> 3, olddlen; - if((sp0 = GetCurrentSrc(flo,pet,sb0)) && - (sp1 = GetCurrentSrc(flo,pet,sb1)) && - (sp2 = GetCurrentSrc(flo,pet,sb2)) && - (dst = (BytePixel*)GetDstBytes(flo,pet,dbnd,dbnd->current, - nextdlen,KEEP))) - do { - if(pvt[0].buf) sp0 = bitexpand(sp0,pvt[0].buf,width,(char)0,(char)1); - if(pvt[1].buf) sp1 = bitexpand(sp1,pvt[1].buf,width,(char)0,(char)1); - if(pvt[2].buf) sp2 = bitexpand(sp2,pvt[2].buf,width,(char)0,(char)1); - - (*pvt->action)(sp0,sp1,sp2,dst,stride,pvt); - - sp0 = GetNextSrc(flo,pet,sb0,FLUSH); - sp1 = GetNextSrc(flo,pet,sb1,FLUSH); - sp2 = GetNextSrc(flo,pet,sb2,FLUSH); - pvt->bitOff = (pvt->bitOff + pitch) & 7; /* Set next */ - olddlen = (pvt->bitOff) ? nextdlen - 1 : nextdlen; - nextdlen = (pvt->bitOff + pitch + 7) >> 3; - dst = (BytePixel*)GetDstBytes(flo,pet,dbnd, - dbnd->current+olddlen,nextdlen,KEEP); - } while(dst && sp0 && sp1 && sp2); - - } else { - CARD32 dlen = pitch >> 3; /* For nicely aligned data */ - if((sp0 = GetCurrentSrc(flo,pet,sb0)) && - (sp1 = GetCurrentSrc(flo,pet,sb1)) && - (sp2 = GetCurrentSrc(flo,pet,sb2)) && - (dst = (BytePixel*)GetDstBytes(flo,pet,dbnd,dbnd->current,dlen,KEEP))) - - do { - - if (pvt[0].clear_dst) bzero(dst,(int)dlen); - - (*pvt[0].action)(sp0,dst,&pvt[0]); - (*pvt[1].action)(sp1,dst,&pvt[1]); - (*pvt[2].action)(sp2,dst,&pvt[2]); - - sp0 = GetNextSrc(flo,pet,sb0,FLUSH); - sp1 = GetNextSrc(flo,pet,sb1,FLUSH); - sp2 = GetNextSrc(flo,pet,sb2,FLUSH); - dst = (BytePixel*)GetDstBytes(flo,pet,dbnd,dbnd->current+dlen, - dlen,KEEP); - } while(dst && sp0 && sp1 && sp2); - } - - FreeData(flo,pet,sb0,sb0->current); - FreeData(flo,pet,sb1,sb1->current); - FreeData(flo,pet,sb2,sb2->current); - - if(!sp0 && sb0->final && !sp1 && sb1->final && !sp2 && sb2->final) { - if (pvt->bitOff) /* If we have any bits left, send them out now */ - *(CARD8*)GetDstBytes(flo,pet,dbnd,dbnd->current,1,KEEP) = pvt->leftOver; - - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,dbnd->maxGlobal); /* write the remaining data */ - } - - return(TRUE); -} /* end ActivateEPhotoUncomByPixel */ -#endif /* XIE_FULL */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetEPhoto(floDefPtr flo, peDefPtr ped) -{ - meUncompPtr pvt = (meUncompPtr)ped->peTex->private; - int i; - - for(i = 0; i < xieValMaxBands; ++i) - if(pvt[i].buf) pvt[i].buf = (pointer) XieFree(pvt[i].buf); - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetEPhoto */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyEPhoto(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyEPhoto */ - -/* end module mephoto.c */ Index: xc/programs/Xserver/XIE/mixie/export/meroi.c diff -u xc/programs/Xserver/XIE/mixie/export/meroi.c:3.6 xc/programs/Xserver/XIE/mixie/export/meroi.c:removed --- xc/programs/Xserver/XIE/mixie/export/meroi.c:3.6 Fri Dec 14 14:58:20 2001 +++ xc/programs/Xserver/XIE/mixie/export/meroi.c Sat Feb 28 21:41:58 2004 @@ -1,185 +0,0 @@ -/* $Xorg: meroi.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module meroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - meroi.c -- DDXIE export roi element - - Dean Verheiden -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/meroi.c,v 3.6 2001/12/14 19:58:20 dawes Exp $ */ - -#define _XIEC_MEROI - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - -/* - * routines used internal to this module - */ -static int CreateEROI(floDefPtr flo, peDefPtr ped); -static int InitializeEROI(floDefPtr flo, peDefPtr ped); -static int ResetEROI(floDefPtr flo, peDefPtr ped); -static int DestroyEROI(floDefPtr flo, peDefPtr ped); - -/* - * DDXIE ImportROI entry points - */ -static ddElemVecRec meROIVec = -{ - CreateEROI, - InitializeEROI, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetEROI, - DestroyEROI -}; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeEROI(floDefPtr flo, peDefPtr ped) -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = meROIVec; - return TRUE ; -} /* end miAnalyzeEROI */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateEROI(floDefPtr flo, peDefPtr ped) -{ - /* attach an execution context to the roi element definition */ - return MakePETex(flo,ped,NO_PRIVATE,NO_SYNC,NO_SYNC); -} /* end CreateEROI */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeEROI(floDefPtr flo, peDefPtr ped) -{ - /* Allows data manager to bypass element entirely */ - return(InitReceptor(flo, ped, ped->peTex->receptor, NO_DATAMAP, 1, NO_BANDS, - ALL_BANDS)); - -} /* end InitializeEROI */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetEROI(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - return TRUE; -} /* end ResetEROI */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyEROI(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - return TRUE; -} /* end DestroyEROI */ - -/* end module meroi.c */ Index: xc/programs/Xserver/XIE/mixie/export/meuncomp.c diff -u xc/programs/Xserver/XIE/mixie/export/meuncomp.c:1.6 xc/programs/Xserver/XIE/mixie/export/meuncomp.c:removed --- xc/programs/Xserver/XIE/mixie/export/meuncomp.c:1.6 Fri Dec 14 14:58:21 2001 +++ xc/programs/Xserver/XIE/mixie/export/meuncomp.c Sat Feb 28 21:41:58 2004 @@ -1,1352 +0,0 @@ -/* $Xorg: meuncomp.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module meuncomp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - meuncomp.c -- DDXIE routines for exporting uncompressed data - - Dean Verheiden -- AGE Logic, Inc. October 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/meuncomp.c,v 1.6 2001/12/14 19:58:21 dawes Exp $ */ - -#define _XIEC_MEUNCOMP - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/***********************************************************************/ -/****************** Aligned data conversion routines *******************/ -/***********************************************************************/ - -/* Band by Plane action routines */ - -/* bits to stream */ -void btoS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ - memcpy((char *)dst,(char *)src, (int)(pvt->width + 7) >> 3); -} - -/* swapped bits to stream */ -void sbtoS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -int i, count; - - count = (pvt->width + 7) >> 3; /* Pack down to bits */ - - for (i = 0; i < count; i++) *dst++ = _ByteReverseTable[*src++]; -} - -/* bits to stream with pad */ -void btoIS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -CARD32 stride = pvt->stride; -CARD32 width = pvt->width; -CARD32 pitch = pvt->pitch; -CARD32 j = pvt->bitOff; -CARD32 i; - - if (j) /* Don't bzero partial byte left from last scanline */ - bzero(dst + 1, ((j + pitch + 7) >> 3) - 1); - else - bzero(dst, (pitch + 7) >> 3); - - for (i = 0; i < width; i++, j += stride) { - if (LOGBYTE_tstbit(src,i) != 0) { - LOGBYTE_setbit(dst,j); - } - } -} - -/* swapped bits to stream with pad */ -void sbtoIS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -CARD32 stride = pvt->stride; -CARD32 width = pvt->width; -CARD32 pitch = pvt->pitch; -CARD32 j = pvt->bitOff; -CARD32 i, s; - - if (j) /* Don't bzero partial byte left from last scanline */ - bzero(dst + 1, ((j + pitch + 7) >> 3) - 1); - else - bzero(dst, (pitch + 7) >> 3); - - for (i = 0; i < width; i++, j += stride) { - s = j ^ 7; /* Larry swap */ - if (LOGBYTE_tstbit(src,i) != 0) { - LOGBYTE_setbit(dst,s); - } - } -} - -/* BytePixel to Stream, no offsets */ -void BtoS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -int width = pvt->width; - - memcpy((char *)dst,(char *)src,width); -} - -/* PairPixel to Stream, no swapping */ -void PtoS(PairPixel *src, PairPixel *dst, meUncompPtr pvt) -{ -int width = pvt->width << 1; - - memcpy((char *)dst,(char *)src,width); -} - -/* PairPixel to Stream, with swapping */ -void sPtoS(PairPixel *src, PairPixel *dst, meUncompPtr pvt) -{ -CARD32 i; - - for (i = 0; i < pvt->width; i++) { cpswaps(src[i],dst[i]); } -} - -/* QuadPixel to Stream, no swapping */ -void QtoS(QuadPixel *src, QuadPixel *dst, meUncompPtr pvt) -{ -int width = pvt->width << 2; - - memcpy((char *)dst,(char *)src,width); -} - -/* QuadPixel to Stream, with swapping */ -void sQtoS(QuadPixel *src, QuadPixel *dst, meUncompPtr pvt) -{ -CARD32 i; - - for (i = 0; i < pvt->width; i++) { cpswapl(src[i],dst[i]); } -} - -/* QuadPixel (unswapped) to padded Stream */ -void QtoIS(QuadPixel *src, QuadPixel *dst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD32 i; - for (i = 0; i < width; i++, dst += Bstride) *dst = *src++; -} - -/* QuadPixel (swapped) to padded Stream */ -void sQtoIS(QuadPixel *src, QuadPixel *dst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD32 i; - for (i = 0; i < width; i++, dst += Bstride) { cpswapl(src[i], *dst); } -} - -/* Triple Band Byte by Pixel Action routines */ - -/* Bits to Interleaved stream bits */ -void btoISb(BytePixel *isrc, BytePixel *dst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD8 mask = pvt->mask; -LogInt *src = (LogInt *)isrc; -int i; - - dst += pvt->dstoffset; - for (i = 0; i < width; i++, dst += Bstride) - if (LOG_tstbit(src,i) != 0) - *dst |= mask; -} - -/* BytePixels to Interleaved Stream in bits */ -void BtoISb(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD8 mask = pvt->mask; -CARD8 shift = pvt->shift; -CARD32 i; - - dst += pvt->dstoffset; - for (i = 0; i < width; i++, dst += Bstride) - *dst |= *src++ << shift & mask; -} - -/* BytePixel to Interleaved Stream */ -void BtoIS(BytePixel *src, BytePixel *dst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD32 i; - - dst += pvt->dstoffset; - for (i = 0; i < width; i++, dst += Bstride) - *dst = *src++; -} - -/* PairPixel (unswapped) to Interleaved Stream */ -void PtoIS(PairPixel *src, PairPixel *idst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD8 *dst = ((CARD8 *)idst) + pvt->dstoffset; -CARD32 i; - for (i = 0; i < width; i++, dst += Bstride) - *((PairPixel *)dst) = *src++; -} - -/* PairPixel (swapped) to Interleaved Stream */ -void sPtoIS(PairPixel *src, PairPixel *idst, meUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 width = pvt->width; -CARD8 *dst = ((CARD8 *)idst) + pvt->dstoffset; -CARD32 i; - for (i = 0; i < width; i++, dst += Bstride) { - PairPixel sval = *src++; - *dst = (sval >> 8) | (sval << 8); - } -} - -/***********************************************************************/ -/***************** Unaligned data conversion routines ******************/ -/***********************************************************************/ - -/* Pack a line of byte pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ -void BtoLLUB(src, dst, pvt) -BytePixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -BytePixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 stride = pvt->stride; -CARD16 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; - - while (src < send) { - outb |= (CARD16)*src++ << bits; - bits += stride; - while (bits > 7) { - *dst++ = (CARD8)outb; - outb >>= 8; - bits -= 8; - } - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of byte pixels */ -/* Pixel Order = LSB, Fill Order = MSB */ -void BtoLMUB(src, dst, pvt) -BytePixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -BytePixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 stride = pvt->stride; -CARD32 depth = pvt->depth; -CARD16 bits = pvt->bitOff; -CARD16 outb = pvt->leftOver; -CARD32 pad = stride - depth; - - while (src < send) { - CARD8 sval = *src++; - - if (bits + depth <= 8) { /* Pack into existing byte only */ - outb |= sval << (8 - bits - depth); - if (bits + depth == 8) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits += depth; - } else { /* Split between bytes */ - outb |= (CARD8)(sval << bits) >> bits;/* Chop off top bits*/ - *dst++ = (CARD8)outb; - if (bits + depth <= 16) { - outb = (CARD8)(sval >> (8 - bits)) << (16 - depth - bits); - bits = bits + depth - 8; /* watch those signs */ - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } - } - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of byte pixels */ -/* Pixel Order = MSB, Fill Order = LSB */ -void BtoMLUB(src, dst, pvt) -BytePixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -BytePixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD16 bits = pvt->bitOff; -CARD16 outb = pvt->leftOver; -CARD32 pad = stride - depth; - - while (src < send) { - CARD8 sval = *src++; - - if (bits + depth <= 8) { /* Pack into existing byte only */ - outb |= sval << bits; - if (bits + depth == 8) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits += depth; - } else if (bits + depth <= 16) { - outb |= (CARD8)(sval >> (depth + bits - 8)) << bits; - *dst++ = (CARD8)outb; - outb = (CARD8)(sval << (16 - depth - bits)) >> (16 - depth - bits); - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 8; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -void BtoMMUB(src, dst, pvt) -BytePixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -BytePixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD16 bits = pvt->bitOff; -CARD16 outb = pvt->leftOver; -CARD32 pad = stride - depth; - - while (src < send) { - CARD8 sval = *src++; - - if (bits + depth <= 8) { /* Pack into existing byte only */ - outb |= sval << (8 - depth - bits); - if (bits + depth == 8) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits += depth; - } else if (bits + depth <= 16) { - outb |= sval >> (depth + bits - 8); - *dst++ = (CARD8)outb; - outb = sval << (16 - depth - bits); - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 8; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of pair pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ -void PtoLLUP(src, dst, pvt) -PairPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -PairPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; - - while (src < send) { - outb |= *src++ << bits; - bits += stride; - while (bits > 7) { - *dst++ = (CARD8)outb; - outb >>= 8; - bits -= 8; - } - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of pair pixels */ -/* Pixel Order = LSB, Fill Order = MSB */ -void PtoLMUP(src, dst, pvt) -PairPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -PairPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD16 sval = *src++; - - if (bits + depth <= 16) { - outb |= (CARD16)(sval << (8 + bits)) >> (8 + bits); - *dst++ = (CARD8)outb; - outb = (CARD8)(sval >> (8 - bits)) << (16 - depth - bits); - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 8; /* watch those signs */ - } else { - outb |= (CARD16)(sval << (8 + bits)) >> (8 + bits); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)((CARD16)(sval << bits) >> 8); - outb = (CARD8)(sval >> (16 - bits)) << (24 - depth - bits); - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; /* watch those signs */ - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of pair pixels */ -/* Pixel Order = MSB, Fill Order = LSB */ -void PtoMLUP(src, dst, pvt) -PairPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -PairPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD16 sval = *src++; - - if (bits + depth <= 16) { - outb |= (sval >> (depth + bits - 8)) << bits; - *dst++ = (CARD8)outb; - outb = (CARD16)(sval << (24 - depth - bits)) >> (24 - depth - bits); - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 8; - } else { - outb |= (sval >> (depth + bits - 8)) << bits; - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - outb = (CARD8)(sval << (24 - depth - bits)) >> (24 - depth - bits); - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -void PtoMMUP(src, dst, pvt) -PairPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -PairPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD16 sval = *src++; - - if (bits + depth <= 16) { - outb |= sval >> (depth + bits - 8); - *dst++ = (CARD8)outb; - outb = sval << (16 - depth - bits); - if (bits + depth == 16) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 8; - } else { - outb |= sval >> (depth + bits - 8); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - outb = sval << (24 - depth - bits); - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = (CARD8)outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of quad pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ -void QtoLLUQ(src, dst, pvt) -QuadPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -QuadPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 stride = pvt->stride; -CARD32 outb0 = pvt->leftOver, outb1; -CARD16 bits = pvt->bitOff; - - while (src < send) { - if (bits) { /* Yuck, do a multi word shift */ - outb1 = *src >> (32 - bits); - outb0 |= *src++ << bits; - } else { - outb1 = 0; - outb0 = *src++; - } - bits += stride; - while (bits > 7) { - *dst++ = (CARD8)outb0; - outb0 >>= 8; - if (bits > 32) { - outb0 |= outb1 << 24; - outb1 >>= 8; - } - bits -= 8; - } - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = (CARD8)outb0; - } else { - *dst = (CARD8)outb0; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of quad pixels */ -/* Pixel Order = LSB, Fill Order = MSB */ -void QtoLMUQ(src, dst, pvt) -QuadPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -QuadPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 stride = pvt->stride; -CARD32 depth = pvt->depth; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD32 sval = *src++; - - if (bits + depth <= 24) { - outb |= (sval << (24 + bits)) >> (24 + bits); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (8 - bits)); - outb = (CARD8)(sval >> (16 - bits)) << (24 - depth - bits); - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; /* watch those signs */ - } else { - outb |= (sval << (24 + bits)) >> (24 + bits); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (8 - bits)); - *dst++ = (CARD8)(sval >> (16 - bits)); - outb = (CARD8)(sval >> (24 - bits)) << (32 - depth - bits); - if (bits + depth == 32) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 24; /* watch those signs */ - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = (CARD8)outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of quad pixels */ -/* Pixel Order = MSB, Fill Order = LSB */ -void QtoMLUQ(src, dst, pvt) -QuadPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -QuadPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD32 sval = *src++; - - if (bits + depth <= 24) { - outb |= (sval >> (depth + bits - 8)) << bits; - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - outb = (sval << (48 - depth - bits)) >> (48 - depth - bits); - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; - } else { - outb |= (sval >> (depth + bits - 8)) << bits; - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - *dst++ = (CARD8)(sval >> (depth + bits - 24)); - outb = (sval << (56 - depth - bits)) >> (56 - depth - bits); - if (bits + depth == 32) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 24; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a line of quad pixels */ -/* Pixel Order = MSB, Fill Order = MSB */ -void QtoMMUQ(src, dst, pvt) -QuadPixel *src; -CARD8 *dst; -meUncompPtr pvt; -{ -QuadPixel *send = &src[pvt->width]; -CARD32 pitch = pvt->pitch; -CARD32 depth = pvt->depth; -CARD32 stride = pvt->stride; -CARD32 outb = pvt->leftOver; -CARD16 bits = pvt->bitOff; -CARD32 pad = stride - depth; - - while (src < send) { - CARD32 sval = *src++; - - if (bits + depth <= 24) { - outb |= sval >> (depth + bits - 8); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - outb = (sval << (48 - depth - bits)) >> 24; - if (bits + depth == 24) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 16; - } else { - outb |= sval >> (depth + bits - 8); - *dst++ = (CARD8)outb; - *dst++ = (CARD8)(sval >> (depth + bits - 16)); - *dst++ = (CARD8)(sval >> (depth + bits - 24)); - outb = (sval << (56 - depth - bits)) >> 24; - if (bits + depth == 32) { - *dst++ = (CARD8)outb; - outb = 0; - bits = 0; - } else - bits = bits + depth - 24; - } - if (bits + pad > 8) { - *dst++ = outb; - outb = 0; - bits = bits + pad - 8; - while (bits > 7) { - *dst++ = 0; - bits -= 8; - } - } else - bits += pad; - } - - - /* If something leftover, either write it out or save for packing */ - if (bits) { - if (pitch & 7) { - pvt->leftOver = (CARD8)outb; - } else { - *dst = (CARD8)outb; - pvt->leftOver = 0; - } - } else - pvt->leftOver = 0; -} - -/* Pack a triple band by pixel line of pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ - -#define ProtoLLTB(fname,itype0,itype1,itype2) \ -void fname( \ - itype0 *src0, \ - itype1 *src1, \ - itype2 *src2, \ - CARD8 *dst, \ - CARD32 tristride, \ - meUncompPtr pvt) - -#define ConvertToLLTB(fname,itype0,itype1,itype2) \ -extern ProtoLLTB(fname,itype0,itype1,itype2); \ -ProtoLLTB(fname,itype0,itype1,itype2) \ -{ \ -itype0 *send = &src0[pvt->width];/* All three bands are same width */ \ -CARD32 pitch = pvt->pitch; \ -CARD32 outb = pvt->leftOver; \ -CARD16 bits = pvt->bitOff; \ -CARD32 depth0 = pvt[0].depth; \ -CARD32 depth1 = pvt[1].depth; \ -CARD32 tripad = tristride - pvt[0].depth - pvt[1].depth; \ - while (src0 < send) { \ - outb |= (CARD32)*src0++ << bits; \ - bits += depth0; \ - while (bits > 7) { \ - *dst++ = (CARD8)outb; \ - outb >>= 8; \ - bits -= 8; \ - } \ - outb |= (CARD32)*src1++ << bits; \ - bits += depth1; \ - while (bits > 7) { \ - *dst++ = (CARD8)outb; \ - outb >>= 8; \ - bits -= 8; \ - } \ - outb |= (CARD32)*src2++ << bits; \ - bits += tripad; \ - while (bits > 7) { \ - *dst++ = (CARD8)outb; \ - outb >>= 8; \ - bits -= 8; \ - } \ - } \ - if (bits) { \ - if (pitch & 7) { \ - pvt->leftOver = outb; \ - } else { \ - *dst = (CARD8)outb; \ - pvt->leftOver = 0; \ - } \ - } else \ - pvt->leftOver = 0; \ -} - -/* Pack a triple band by pixel line of pixels */ -/* Pixel Order = LSB, Fill Order = MSB */ -/* Broken in two parts because some preprocessors cannot handle the full size*/ -#define ConvertToLMTB2() \ - if (bits + tripad > 8) { \ - *dst++ = outb; \ - outb = 0; \ - bits = bits + tripad - 8; \ - while (bits > 7) { \ - *dst++ = 0; \ - bits -= 8; \ - } \ - } else \ - bits += tripad; \ - } \ - if (bits) { \ - if (pitch & 7) { \ - pvt->leftOver = outb; \ - } else { \ - *dst = (CARD8)outb; \ - pvt->leftOver = 0; \ - } \ - } else \ - pvt->leftOver = 0; - -#define ProtoLMTB(fname,xietype0,xietype1,xietype2) \ -void fname( \ - xietype0 *src0, \ - xietype1 *src1, \ - xietype2 *src2, \ - CARD8 *dst, \ - CARD32 tristride, \ - meUncompPtr pvt) - -#define ConvertToLMTB(fname,xietype0,xietype1,xietype2) \ -extern ProtoLMTB(fname,xietype0,xietype1,xietype2); \ -ProtoLMTB(fname,xietype0,xietype1,xietype2) \ -{ \ -xietype0 *send = &src0[pvt->width];/* All three bands are same width */ \ -CARD32 pitch = pvt->pitch; \ -CARD32 outb = pvt->leftOver; \ -CARD16 bits = pvt->bitOff; \ -CARD32 tripad = tristride - pvt[0].depth - pvt[1].depth - pvt[2].depth;\ -CARD32 b; \ - while (src0 < send) { \ - CARD16 svals[3]; \ - svals[0] = *src0++; svals[1] = *src1++; svals[2] = *src2++; \ - for (b = 0; b < 3; b++) { \ - CARD16 sval = svals[b]; \ - CARD32 depth = pvt[b].depth; \ - if (bits + depth <= 8) { /* Pack into existing byte only */\ - outb |= sval << (8 - depth - bits); \ - if (bits + depth == 8) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits += depth; \ - } else if (bits + depth <= 16) { \ - outb |= (CARD16)(sval << (8 + bits)) >> (8 + bits); \ - *dst++ = (CARD8)outb; \ - outb = (CARD8)(sval >> (8 - bits)) << (16 - depth - bits);\ - if (bits + depth == 16) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 8; /* watch those signs */ \ - } else { \ - outb |= (CARD16)(sval << (8 + bits)) >> (8 + bits); \ - *dst++ = (CARD8)outb; \ - *dst++ = (CARD8)((CARD16)(sval << bits) >> 8); \ - outb = (CARD8)(sval >> (16 - bits)) << (24 - depth - bits);\ - if (bits + depth == 24) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 16; /* watch those signs */ \ - } \ - } \ - ConvertToLMTB2() \ -} - -/* Pack a triple band by pixel line of pixels */ -/* Pixel Order = MSB, Fill Order = LSB */ -/* Broken in two parts because some preprocessors cannot handle the full size*/ -#define ConvertToMLTB2() \ - if (bits + tripad > 8) { \ - *dst++ = outb; \ - outb = 0; \ - bits = bits + tripad - 8; \ - while (bits > 7) { \ - *dst++ = 0; \ - bits -= 8; \ - } \ - } else \ - bits += tripad; \ - } \ - if (bits) { \ - if (pitch & 7) { \ - pvt->leftOver = outb; \ - } else { \ - *dst = (CARD8)outb; \ - pvt->leftOver = 0; \ - } \ - } else \ - pvt->leftOver = 0; - -#define ProtoMLTB(fname,itype0,itype1,itype2) \ -void fname( \ - itype0 *src0, \ - itype1 *src1, \ - itype2 *src2, \ - CARD8 *dst, \ - CARD32 tristride, \ - meUncompPtr pvt) - -#define ConvertToMLTB(fname,itype0,itype1,itype2) \ -extern ProtoMLTB(fname,itype0,itype1,itype2); \ -ProtoMLTB(fname,itype0,itype1,itype2) \ -{ \ -itype0 *send = &src0[pvt->width];/* All three bands are same width */ \ -CARD32 pitch = pvt->pitch; \ -CARD32 outb = pvt->leftOver; \ -CARD16 bits = pvt->bitOff; \ -CARD32 tripad = tristride - pvt[0].depth - pvt[1].depth - pvt[2].depth;\ -CARD32 b; \ - while (src0 < send) { \ - CARD16 svals[3]; \ - svals[0] = *src0++; svals[1] = *src1++; svals[2] = *src2++; \ - for (b = 0; b < 3; b++) { \ - CARD16 sval = svals[b]; \ - CARD32 depth = pvt[b].depth; \ - if (bits + depth <= 8) { /* Pack into existing byte only */\ - outb |= sval << bits; \ - if (bits + depth == 8) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits += depth; \ - } else if (bits + depth <= 16) { \ - outb |= (sval >> (depth + bits - 8)) << bits; \ - *dst++ = (CARD8)outb; \ - outb = (CARD16)(sval << (24 - depth - bits)) >> (24 - depth - bits); \ - if (bits + depth == 16) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 8; \ - } else { \ - outb |= (sval >> (depth + bits - 8)) << bits; \ - *dst++ = (CARD8)outb; \ - *dst++ = (CARD8)(sval >> (depth + bits - 16)); \ - outb = (CARD8)(sval << (24 - depth - bits)) >> (24 - depth - bits);\ - if (bits + depth == 24) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 16; \ - } \ - } \ - ConvertToMLTB2() \ -} - -/* Pack a triple band by pixel line of pixels */ -/* Pixel Order = MSB, Fill Order = MSB */ -/* Broken in two parts because some preprocessors cannot handle the full size*/ -#define ConvertToMMTB2() \ - if (bits + tripad > 8) { \ - *dst++ = outb; \ - outb = 0; \ - bits = bits + tripad - 8; \ - while (bits > 7) { \ - *dst++ = 0; \ - bits -= 8; \ - } \ - } else \ - bits += tripad; \ - } \ - if (bits) { \ - if (pitch & 7) { \ - pvt->leftOver = (CARD8)outb; \ - } else { \ - *dst = (CARD8)outb; \ - pvt->leftOver = 0; \ - } \ - } else \ - pvt->leftOver = 0; - -#define ProtoMMTB(fname,itype0,itype1,itype2) \ -void fname( \ - itype0 *src0, \ - itype1 *src1, \ - itype2 *src2, \ - CARD8 *dst, \ - CARD32 tristride, \ - meUncompPtr pvt) - -#define ConvertToMMTB(fname,itype0,itype1,itype2) \ -extern ProtoMMTB(fname,itype0,itype1,itype2); \ -ProtoMMTB(fname,itype0,itype1,itype2) \ -{ \ -itype0 *send = &src0[pvt->width];/* All three bands are same width */ \ -CARD32 pitch = pvt->pitch; \ -CARD32 outb = pvt->leftOver; \ -CARD16 bits = pvt->bitOff; \ -CARD32 tripad = tristride - pvt[0].depth - pvt[1].depth - pvt[2].depth;\ -CARD32 b; \ - while (src0 < send) { \ - CARD16 svals[3]; \ - svals[0] = *src0++; svals[1] = *src1++; svals[2] = *src2++; \ - for (b = 0; b < 3; b++) { \ - CARD16 sval = svals[b]; \ - CARD32 depth; \ - depth = pvt[b].depth; \ - if (bits + depth <= 8) {/* Pack into existing byte only */ \ - outb |= sval << (8 - depth - bits); \ - if (bits + depth == 8) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits += depth; \ - } else if (bits + depth <= 16) { \ - outb |= sval >> (depth + bits - 8); \ - *dst++ = (CARD8)outb; \ - outb = sval << (16 - depth - bits); \ - if (bits + depth == 16) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 8; \ - } else { \ - outb |= sval >> (depth + bits - 8); \ - *dst++ = (CARD8)outb; \ - *dst++ = (CARD8)(sval >> (depth + bits - 16)); \ - outb = sval << (24 - depth - bits); \ - if (bits + depth == 24) { \ - *dst++ = (CARD8)outb; \ - outb = 0; \ - bits = 0; \ - } else \ - bits = bits + depth - 16; \ - } \ - } \ - ConvertToMMTB2() \ -} - - -ConvertToLLTB(BBBtoLLTB,BytePixel,BytePixel,BytePixel) -ConvertToLMTB(BBBtoLMTB,BytePixel,BytePixel,BytePixel) -ConvertToMLTB(BBBtoMLTB,BytePixel,BytePixel,BytePixel) -ConvertToMMTB(BBBtoMMTB,BytePixel,BytePixel,BytePixel) - -ConvertToLLTB(BBPtoLLTB,BytePixel,BytePixel,PairPixel) -ConvertToLMTB(BBPtoLMTB,BytePixel,BytePixel,PairPixel) -ConvertToMLTB(BBPtoMLTB,BytePixel,BytePixel,PairPixel) -ConvertToMMTB(BBPtoMMTB,BytePixel,BytePixel,PairPixel) - -ConvertToLLTB(BPBtoLLTB,BytePixel,PairPixel,BytePixel) -ConvertToLMTB(BPBtoLMTB,BytePixel,PairPixel,BytePixel) -ConvertToMLTB(BPBtoMLTB,BytePixel,PairPixel,BytePixel) -ConvertToMMTB(BPBtoMMTB,BytePixel,PairPixel,BytePixel) - -ConvertToLLTB(BPPtoLLTB,BytePixel,PairPixel,PairPixel) -ConvertToLMTB(BPPtoLMTB,BytePixel,PairPixel,PairPixel) -ConvertToMLTB(BPPtoMLTB,BytePixel,PairPixel,PairPixel) -ConvertToMMTB(BPPtoMMTB,BytePixel,PairPixel,PairPixel) - -ConvertToLLTB(PBBtoLLTB,PairPixel,BytePixel,BytePixel) -ConvertToLMTB(PBBtoLMTB,PairPixel,BytePixel,BytePixel) -ConvertToMLTB(PBBtoMLTB,PairPixel,BytePixel,BytePixel) -ConvertToMMTB(PBBtoMMTB,PairPixel,BytePixel,BytePixel) - -ConvertToLLTB(PBPtoLLTB,PairPixel,BytePixel,PairPixel) -ConvertToLMTB(PBPtoLMTB,PairPixel,BytePixel,PairPixel) -ConvertToMLTB(PBPtoMLTB,PairPixel,BytePixel,PairPixel) -ConvertToMMTB(PBPtoMMTB,PairPixel,BytePixel,PairPixel) - -ConvertToLLTB(PPBtoLLTB,PairPixel,PairPixel,BytePixel) -ConvertToLMTB(PPBtoLMTB,PairPixel,PairPixel,BytePixel) -ConvertToMLTB(PPBtoMLTB,PairPixel,PairPixel,BytePixel) -ConvertToMMTB(PPBtoMMTB,PairPixel,PairPixel,BytePixel) - -ConvertToLLTB(PPPtoLLTB,PairPixel,PairPixel,PairPixel) -ConvertToLMTB(PPPtoLMTB,PairPixel,PairPixel,PairPixel) -ConvertToMLTB(PPPtoMLTB,PairPixel,PairPixel,PairPixel) -ConvertToMMTB(PPPtoMMTB,PairPixel,PairPixel,PairPixel) - -void (*EncodeTripleFuncs[2][2][2][2][2])() = -{ { { { { BBBtoLLTB, BBPtoLLTB }, { BPBtoLLTB, BPPtoLLTB } }, - { { PBBtoLLTB, PBPtoLLTB }, { PPBtoLLTB, PPPtoLLTB } } }, - { { { BBBtoLMTB, BBPtoLMTB }, { BPBtoLMTB, BPPtoLMTB } }, - { { PBBtoLMTB, PBPtoLMTB }, { PPBtoLMTB, PPPtoLMTB } } } }, - { { { { BBBtoMLTB, BBPtoMLTB }, { BPBtoMLTB, BPPtoMLTB } }, - { { PBBtoMLTB, PBPtoMLTB }, { PPBtoMLTB, PPPtoMLTB } } }, - { { { BBBtoMMTB, BBPtoMMTB }, { BPBtoMMTB, BPPtoMMTB } }, - { { PBBtoMMTB, PBPtoMMTB }, { PPBtoMMTB, PPPtoMMTB } } } } }; -/* end module meuncomp.c */ Index: xc/programs/Xserver/XIE/mixie/export/schoice.c diff -u xc/programs/Xserver/XIE/mixie/export/schoice.c:3.6 xc/programs/Xserver/XIE/mixie/export/schoice.c:removed --- xc/programs/Xserver/XIE/mixie/export/schoice.c:3.6 Fri Dec 14 14:58:21 2001 +++ xc/programs/Xserver/XIE/mixie/export/schoice.c Sat Feb 28 21:41:58 2004 @@ -1,348 +0,0 @@ -/* $Xorg: schoice.c,v 1.4 2001/02/09 02:04:24 xorgcvs Exp $ */ -/**** module schoice.c ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -**************************************************************************** - schoice.c: Routines to handle server choice encoding - - Dean Verheiden && Robert NC Shelley AGE Logic, Inc. Jan 1994 -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/export/schoice.c,v 3.6 2001/12/14 19:58:21 dawes Exp $ */ - -#define _XIEC_SCHOICE -#define _XIEC_IPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#define NEED_EVENTS -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include - -/* - * Element Specific Includes - */ -#include -#include -#include -#include -#include -#include - -static Bool PrepSCCanonic(floDefPtr flo, peDefPtr ped); -static Bool PrepSCSmuggle(floDefPtr flo, peDefPtr ped); -static Bool PrepSCPackBits(floDefPtr flo, peDefPtr ped); -static Bool PrepSCG42D(floDefPtr flo, peDefPtr ped); - - -extern Bool BuildDecodeFromEncode(); -extern pointer GetImportTechnique(); - - -/* REFORMAT_UNCOMPRESSED (options for prefer space) - * TRUE = convert uncompressed import data to canonic form before saving - * FALSE = save uncompressed import data "as is" - * - * COMPRESS_BITONAL - * PrepSCPackBits - * PrepSCG42D - * - * DEFAULT_PREFERENCE - * xieValPreferSpace - * xieValPreferTime - */ -#define REFORMAT_UNCOMPRESSED TRUE -#define COMPRESS_BITONAL PrepSCPackBits -#define DEFAULT_PREFERENCE xieValPreferTime - - -/*------------------------------------------------------------------------ ------------------------ choose an encode technique ----------------------- -------------------------------------------------------------------------*/ -xieBoolProc GetServerChoice(floDefPtr flo, peDefPtr eped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)eped->elemPvt; - xieFloExportPhotomap *raw = (xieFloExportPhotomap *)eped->elemRaw; - outFloPtr dst = &eped->outFlo; - inFloPtr inf = &eped->inFloLst[SRCtag]; - peDefPtr iped = inf->srcDef; - Bool smuggle = FALSE; - formatPtr fmt; - xieBoolProc scPrep; - CARD8 b, bands, preference; - CARD16 tecNum, tecLen; - pointer import; - - import = GetImportTechnique(iped,&tecNum,&tecLen); - - if(raw->lenParams) - preference = ((xieTecEncodeServerChoice*)&raw[1])->preference; - else - preference = xieValPreferDefault; - - switch(preference) { -#if (DEFAULT_PREFERENCE == xieValPreferSpace) - case xieValPreferDefault: -#endif - case xieValPreferSpace: - if(import) { - switch(tecNum) { -#if REFORMAT_UNCOMPRESSED - case xieValDecodeUncompressedSingle: - if(iped->outFlo.format[0].levels == 2) - scPrep = COMPRESS_BITONAL; - else - scPrep = PrepSCCanonic; - break; - - case xieValDecodeUncompressedTriple: - scPrep = PrepSCCanonic; - break; -#else - case xieValDecodeUncompressedSingle: - case xieValDecodeUncompressedTriple: -#endif - case xieValDecodeG31D: - case xieValDecodeG32D: - case xieValDecodeG42D: - case xieValDecodeJPEGBaseline: - case xieValDecodeTIFF2: - case xieValDecodeTIFFPackBits: - smuggle = TRUE; /* smuggle import encoding "as is" */ - scPrep = PrepSCSmuggle; - break; - default: - return((xieBoolProc)NULL); - } - } else if(iped->outFlo.bands == 1 && iped->outFlo.format[0].levels == 2) { - scPrep = COMPRESS_BITONAL; - } else { - scPrep = PrepSCCanonic; - } - break; - -#if (DEFAULT_PREFERENCE == xieValPreferTime) - case xieValPreferDefault: -#endif - case xieValPreferTime: - scPrep = PrepSCCanonic; /* keep uncompressed */ - break; - - default: - return((xieBoolProc)NULL); - } - /* grab a copy of the input attributes and propagate them to our output - */ - fmt = smuggle ? iped->inFloLst[SRCtag].format : iped->outFlo.format; - bands = smuggle ? iped->inFloLst[SRCtag].bands : iped->outFlo.bands; - - for(b = 0; b < bands; ++b) { - dst->format[b] = inf->format[b] = fmt[b]; - } - dst->bands = inf->bands = bands; - pvt->serverChose = TRUE; - - return(scPrep); -} - - -/*------------------------------------------------------------------------ ----------------------- server choice prep routines ----------------------- -------------------------------------------------------------------------*/ -static Bool PrepSCCanonic(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - - pvt->encodeNumber = xieValEncodeServerChoice; - pvt->encodeLen = 0; - pvt->congress = TRUE; - - if(ped->inFloLst[SRCtag].bands == 1) { - xieTecDecodeUncompressedSingle *dtec; - - if(!(dtec = ((xieTecDecodeUncompressedSingle *) - XieMalloc(sizeof(xieTecDecodeUncompressedSingle))))) - AllocError(flo,ped, return(FALSE)); - - pvt->decodeNumber = xieValDecodeUncompressedSingle; - pvt->decodeParms = (pointer)dtec; - pvt->decodeLen = sizeof(xieTecDecodeUncompressedSingle); -#if (IMAGE_BYTE_ORDER == MSBFirst) /* Conform to server's "native" format */ - dtec->fillOrder = xieValMSFirst; - dtec->pixelOrder = xieValMSFirst; -#else - dtec->fillOrder = xieValLSFirst; - dtec->pixelOrder = xieValLSFirst; -#endif - dtec->pixelStride = ped->outFlo.format[0].stride; - dtec->leftPad = 0; - dtec->scanlinePad = PITCH_MOD >> 3; - } else { - xieTecDecodeUncompressedTriple *dtec; - int i; - - if(!(dtec = ((xieTecDecodeUncompressedTriple *) - XieMalloc(sizeof(xieTecDecodeUncompressedTriple))))) - AllocError(flo,ped, return(FALSE)); - - pvt->decodeNumber = xieValDecodeUncompressedTriple; - pvt->decodeParms = (pointer)dtec; - pvt->decodeLen = sizeof(xieTecDecodeUncompressedTriple); -#if (IMAGE_BYTE_ORDER == MSBFirst) /* Conform to server's "native" format */ - dtec->fillOrder = xieValMSFirst; - dtec->pixelOrder = xieValMSFirst; -#else - dtec->fillOrder = xieValLSFirst; - dtec->pixelOrder = xieValLSFirst; -#endif - dtec->bandOrder = xieValLSFirst; - dtec->interleave = xieValBandByPlane; - for(i = 0; i < 3; i++) { - dtec->leftPad[i] = 0; - dtec->pixelStride[i] = ped->outFlo.format[i].stride; - dtec->scanlinePad[i] = PITCH_MOD >> 3; - } - } - return(TRUE); -} /* PrepSCCanonic */ - - -static Bool PrepSCSmuggle(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - peDefPtr iped = ped->inFloLst[SRCtag].srcDef; - pointer parms; - - pvt->encodeNumber = xieValEncodeServerChoice; - pvt->encodeLen = 0; - pvt->congress = TRUE; - - if(!(parms = GetImportTechnique(iped,&pvt->decodeNumber,&pvt->decodeLen)) || - !(pvt->decodeParms = (pointer)XieMalloc(pvt->decodeLen))) - return(FALSE); - - memcpy((char*)pvt->decodeParms, (char*)parms, (int)pvt->decodeLen); - - return(TRUE); -} /* PrepECSmuggle */ - - -static Bool PrepSCPackBits(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - formatPtr fmt = ped->outFlo.format; - xieTecEncodeTIFFPackBits *tp; - - pvt->encodeNumber = xieValEncodeTIFFPackBits; - pvt->encodeLen = sizeof(xieTecEncodeTIFFPackBits); - - if(!(tp = (xieTecEncodeTIFFPackBits*)XieMalloc(pvt->encodeLen))) - return(FALSE); - - pvt->encodeParms = (pointer)tp; - - tp->encodedOrder = xieValMSFirst; - fmt->interleaved = FALSE; - fmt->class = STREAM; - - return(BuildDecodeFromEncode(flo,ped)); -} /* PrepSCPackBits */ - - -static Bool PrepSCG42D(floDefPtr flo, peDefPtr ped) -{ - ePhotoDefPtr pvt = (ePhotoDefPtr)ped->elemPvt; - formatPtr fmt = ped->outFlo.format; - xieTecEncodeG42D *tp; - - pvt->encodeNumber = xieValEncodeG42D; - pvt->encodeLen = sizeof(xieTecEncodeG42D); - - if(!(tp = (xieTecEncodeG42D*)XieMalloc(pvt->encodeLen))) - return(FALSE); - - pvt->encodeParms = (pointer)tp; - tp->encodedOrder = xieValMSFirst; - tp->uncompressed = FALSE; - tp->radiometric = FALSE; - fmt->interleaved = FALSE; - fmt->class = STREAM; - - return(BuildDecodeFromEncode(flo,ped)); -} /* PrepSCG42D */ - -/* end module schoice.c */ Index: xc/programs/Xserver/XIE/mixie/fax/Imakefile diff -u xc/programs/Xserver/XIE/mixie/fax/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/fax/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/fax/Imakefile:3.6 Wed Jan 17 17:13:03 2001 +++ xc/programs/Xserver/XIE/mixie/fax/Imakefile Sat Feb 28 21:41:58 2004 @@ -1,53 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:36 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/fax/Imakefile,v 3.6 2001/01/17 22:13:03 dawes Exp $ - -XCOMM build device dependent machine independent fax processing element objects - -#define IHaveModules -#include - - SRCS = dg31d.c \ - dg32d.c \ - dg4.c \ - dtiff2.c \ - dtiffpb.c \ - eg31d.c \ - eg32d.c \ - etiff2.c \ - etiffpb.c \ - faxtabs.c \ - zeroeven.c - - OBJS = dg31d.o \ - dg32d.o \ - dg4.o \ - dtiff2.o \ - dtiffpb.o \ - eg31d.o \ - eg32d.o \ - etiff2.o \ - etiffpb.o \ - faxtabs.o \ - zeroeven.o - -#if BuildDIS - DEFINES = -DXIE_DIS -#endif - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(fax,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/fax/bits.h diff -u xc/programs/Xserver/XIE/mixie/fax/bits.h:1.2 xc/programs/Xserver/XIE/mixie/fax/bits.h:removed --- xc/programs/Xserver/XIE/mixie/fax/bits.h:1.2 Fri Dec 14 14:58:22 2001 +++ xc/programs/Xserver/XIE/mixie/fax/bits.h Sat Feb 28 21:41:58 2004 @@ -1,465 +0,0 @@ -/* $Xorg: bits.h,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module fax/bits.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/bits.h -- DDXIE G4 fax bitstream management macros - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - -#include "gbits.h" - -/* ------------------------------------------------------------------- */ -/* - * get_white_run_length(next_goal) - * get_black_run_length(next_goal) - * - * These macros try to determine run lengths in horizonal mode. - * All possible bit combinations have been previously coded in - * a lookup table, so it's not a very big deal. The only real - * complication arises from the fact I may run out of strip data - * before finishing. In this case I want to save my length - * accumulator and read it back in again. If I have finished - * with this length, I want to move on to the next goal specified - * by 'next_goal'. Otherwise my goal remains to accumulate the - * current desired run length. - */ - -#define get_white_run_length(next_goal) \ - { \ - register int code=0,nbits,makeup; \ - rl = 0; \ - while (1) { \ - code = get_wcode(byteptr,bitpos,endptr); \ - rl = _WhiteFaxTable[code].run_length; \ - nbits = _WhiteFaxTable[code].n_bits; \ - makeup = _WhiteFaxTable[code].makeup; \ - if (rl == BAD_RUN_LENGTH) { \ - length_acc = 0; \ - if (!code) { \ - /* could just be fill bits, try to recover */ \ - goal = FAX_GOAL_RecoverZero; \ - break; \ - } \ - else { \ - goal = FAX_GOAL_FallOnSword; \ - break; \ - } \ - } \ - if (rl != EOL_RUN_LENGTH) \ - length_acc += rl; \ - if (!makeup) \ - goal = next_goal; \ - /* just in case adjust_bitstream returns for more data */ \ - adjust_bitstream(nbits,byteptr,bitpos,endptr); \ - if (!makeup) \ - break; \ - } \ - } - -#define get_black_run_length(next_goal) \ - { \ - register int code=0,nbits,makeup; \ - rl = 0; \ - while (1) { \ - code = get_bcode(byteptr,bitpos,endptr); \ - rl = _BlackFaxTable[code].run_length; \ - nbits = _BlackFaxTable[code].n_bits; \ - makeup = _BlackFaxTable[code].makeup; \ - if (rl == BAD_RUN_LENGTH) { \ - length_acc = 0; \ - if (!code) { \ - /* could just be fill bits, will try to recover */ \ - goal = FAX_GOAL_RecoverZero; \ - break; \ - } \ - else { \ - goal = FAX_GOAL_FallOnSword; \ - break; \ - } \ - } \ - if (rl != EOL_RUN_LENGTH) \ - length_acc += rl; \ - /* if this is an EOL of terminating code, go to next goal */\ - if (!makeup) \ - goal = next_goal; \ - /* (set in case adjust_bitstream returns for more data) */\ - adjust_bitstream(nbits,byteptr,bitpos,endptr); \ - if (!makeup) \ - break; \ - } \ - } - -/* ------------------------------------------------------------------- */ -/* - * get_a0a1(next_goal) - * get_a1a2(next_goal) - * - * These macros try to determine run lengths in horizonal mode. - * They just leverage off of lower-level macros, so they're easy - */ -#define get_a0a1(next_goal) \ - { \ - if (a0_color == WHITE) \ - get_white_run_length(next_goal) /* ; */ \ - else \ - get_black_run_length(next_goal); \ - } -#define get_a1a2(next_goal) \ - { \ - if (a0_color == WHITE) \ - get_black_run_length(next_goal) /* ; */ \ - else \ - get_white_run_length(next_goal); \ - } -/* ------------------------------------------------------------------- */ -/* - * save_state_and_return(state); - * localize_state(state); - * - * These macros transfer state variables back and forth between - * the reentrant data structure 'state' and register variables. - * Hopefully neither will be called often, so we don't have to - * spend energy analyzing what is 'dirty' versus what hasn't been - * touched since the last save, etc. - * - * Strategy: - * brute force. - * - */ -#if defined(_G32D) -#define save_state_and_return(state) \ - { \ - state->a0_color = a0_color; \ - state->a0_pos = a0_pos; \ - state->a0a1 = a0a1; \ - state->bits.bitpos = bitpos; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->goal = goal; \ - state->n_old_trans = n_old_trans; \ - state->old_trans = old_trans; \ - state->n_new_trans = n_new_trans; \ - state->new_trans = new_trans; \ - state->length_acc = length_acc; \ - state->last_b1_idx = last_b1_idx; \ - state->width = width; \ - state->rl = rl; \ - state->g32d_horiz = g32d_horiz; \ - return(lines_found); \ - } - -#define localize_state(state) \ - a0_color = state->a0_color; \ - a0_pos = state->a0_pos; \ - a0a1 = state->a0a1; \ - bitpos = state->bits.bitpos; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - goal = state->goal; \ - n_old_trans = state->n_old_trans; \ - old_trans = state->old_trans; \ - n_new_trans = state->n_new_trans; \ - new_trans = state->new_trans; \ - length_acc = state->length_acc; \ - last_b1_idx = state->last_b1_idx; \ - width = state->width; \ - rl = state->rl; \ - g32d_horiz = state->g32d_horiz; -#endif /* if defined(_G32D) */ - -#if defined(_G31D) || defined(_G4) -#define save_state_and_return(state) \ - { \ - state->a0_color = a0_color; \ - state->a0_pos = a0_pos; \ - state->a0a1 = a0a1; \ - state->bits.bitpos = bitpos; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->goal = goal; \ - state->n_old_trans = n_old_trans; \ - state->old_trans = old_trans; \ - state->n_new_trans = n_new_trans; \ - state->new_trans = new_trans; \ - state->length_acc = length_acc; \ - state->last_b1_idx = last_b1_idx; \ - state->width = width; \ - state->rl = rl; \ - return(lines_found); \ - } - -#define localize_state(state) \ - a0_color = state->a0_color; \ - a0_pos = state->a0_pos; \ - a0a1 = state->a0a1; \ - bitpos = state->bits.bitpos; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - goal = state->goal; \ - n_old_trans = state->n_old_trans; \ - old_trans = state->old_trans; \ - n_new_trans = state->n_new_trans; \ - new_trans = state->new_trans; \ - length_acc = state->length_acc; \ - last_b1_idx = state->last_b1_idx; \ - width = state->width; \ - rl = state->rl; -#endif /* defined(_G31D) */ - -#if defined(_PBits) -#define save_state_and_return(state) \ - { \ - state->a0_color = a0_color; \ - state->a0_pos = a0_pos; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->goal = goal; \ - state->length_acc = length_acc; \ - state->width = width; \ - state->rl = rl; \ - return(lines_found); \ - } - -#define localize_state(state) \ - a0_color = state->a0_color; \ - a0_pos = state->a0_pos; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - goal = state->goal; \ - length_acc = state->length_acc; \ - width = state->width; \ - rl = state->rl; -#endif /* defined(_Pbits) */ - -/* ------------------------------------------------------------------- */ -/* - * reset_transitions(); - * - * Macro to trade old and new transition buffers - * - * Strategy: - * Do the obvious - */ -#define reset_transitions() \ - { \ - register int *tmp = old_trans; \ - old_trans = new_trans; \ - new_trans = tmp; \ - n_old_trans = n_new_trans; \ - n_new_trans = 0; \ - last_b1_idx = 0; \ - } - -/* ------------------------------------------------------------------- */ -/* - * get_mode_and_length(mode,length,byteptr,bitpos,endptr); - * - * Macro to get next coding mode (vertical or horizontal or ...) - * - * Strategy: the modes are encoded with 8 bits or less except - * for EOL, which is 001 (12 bits). However, none of - * the other modes use 00, so there's no conflict. - * - * We have precomputed a lookup table that tells us for - * any sequence of 8 bits, what mode and length goes - * along with that sequence. So all we have to do is - * get the 8 bits and run them through the lookup table - * and we're done. - * - * Note: I'm trying to write this so a decent compiler will only - * do one load to get both mode and length. Hopefully, your - * compiler will fetch '*entry' all at once, then shift and - * mask to get components. - * - * Very old compilers may have troubles with the struct = - * construction. You'll have to change entry to *entry - * and the entry.mode to entry->mode, etc. - */ - -#define get_mode_and_length(mode,length,byteptr,bitpos,endptr) \ - { register unsigned char bits=get_byte(byteptr,bitpos,endptr); \ - register TwoDTable entry; \ - entry = _TwoDFaxTable[bits]; \ - mode = entry.mode; \ - length = entry.n_bits; \ - } - -/* ------------------------------------------------------------------- */ - -/* - * find_b1pos(a0_pos,a0_color,n_old_trans,old_trans); - * - * Macro to find pixel of opposite color of a0, to right of a0, - * on the previous line. - * - * Strategy: b1 is more or less monotonically increasing. The - * only possible exception is during vertical coding when - * a1 is left of b1 by 2 or 3: - * - * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - * b1' b1 - * B B B B W W B B B B - * B B W B W B W - * a0 a1 - * - * In the diagram above, b1 is the first changing element to the - * right of a0 which goes from white to black. a1 is three to the - * left of b1. - * - * When we set a0'=a1 and proceed decoding, since the new a0' is - * black, we want the first changing element to the right of a0' - * which goes from black to white. This is b1', as pictured. Note - * that b1' < b1! So the b1 sequence is not monotically increasing, - * though it is close. - * - * At most we have to back up one transition to get the right - * changing element for a0'. This is because b1 is W->B, while - * the transition before is B-W, the one before that W->B, and - * so on. The transition before b1 is a candidate for b1', but - * not the one before that (it's the wrong color). The third - * transition before b1 must be at a position <= a0'. But the - * definition of b1' requires that b1' be to the right of a0'. - * Therefore, only the transition immediately before b1 could - * possibly server as b1'. - * - * Moral: If the last b1 we found was index last_b1_idx, then - * we can start searching for b1' at last_b1_idx-1, with complete - * assurance that we'll find it. (if it exists :) - * - * One more thing: WHITE is defined as 0. BLACK is 1. The 1st - * transition (last_b1_idx=0) is W->B, the 2nd (last_b1_idx=1) - * is B->W, etc. So an even transition is black, and odd is white. - * - * BLACK WHITE - * | 0 | 1 | bit1 of transition idx - * ----------|-------|-------| - * a0 WHITE(0) | ok | bad | - * color BLACK(1) | bad | ok | - * ----------|-------|-------| - * - * We need a transition which is opposite in color to a0_color. - * From the table above, if a0_color ^ (idx & 1), the colors - * match and we need to choose the next transition to the right. - */ -#define find_b1pos(a0_pos,a0_color,n_old,old) \ - { \ - if (last_b1_idx > 0) \ - --last_b1_idx; /* avoid gotcha from above evil case */ \ - \ - /* search for first changing element to right of a0_pos */ \ - while (old[last_b1_idx] <= a0_pos) \ - if (++last_b1_idx >= n_old) \ - break; /* if out of transitions, give up */ \ - \ - /* check out color - if matching, use next transition */ \ - if (a0_color ^ (last_b1_idx & 1)) \ - ++last_b1_idx; \ - \ - if (last_b1_idx < n_old) \ - b1_pos = old[last_b1_idx]; \ - else { \ - last_b1_idx = 0; \ - b1_pos = -1; \ - } \ - } - -/* ------------------------------------------------------------------- */ -/* - * find_b2pos(a0_pos,a0_color,n_old_trans,old_trans); - * - * Macro to find the end of a chunk of pixels in the previous line, - * which we passed by because they are uncorrelated with this line. - * - * Strategy: teeny tiny modification to find_b1pos. - * - */ -#define find_b2pos(a0_pos,a0_color,n_old,old) \ - { \ - if (last_b1_idx > 0) \ - --last_b1_idx; /* avoid gotcha from above evil case */ \ - \ - /* search for first changing element to right of a0_pos */ \ - while (old[last_b1_idx] <= a0_pos) \ - if (++last_b1_idx >= (n_old-1)) /* CHANGE */ \ - break; /* if out of transitions, give up */ \ - \ - /* check out color - if matching, use next transition */ \ - if (a0_color ^ (last_b1_idx & 1)) \ - ++last_b1_idx; \ - \ - if (last_b1_idx < n_old-1) /* CHANGE */ \ - b2_pos = old[last_b1_idx+1]; /* CHANGE */ \ - else { \ - last_b1_idx = 0; \ - b2_pos = -1; \ - } \ - } - -/* ------------------------------------------------------------------- */ -/**** module fax/bits.h ****/ Index: xc/programs/Xserver/XIE/mixie/fax/dg31d.c diff -u xc/programs/Xserver/XIE/mixie/fax/dg31d.c:1.2 xc/programs/Xserver/XIE/mixie/fax/dg31d.c:removed --- xc/programs/Xserver/XIE/mixie/fax/dg31d.c:1.2 Fri Dec 14 14:58:22 2001 +++ xc/programs/Xserver/XIE/mixie/fax/dg31d.c Sat Feb 28 21:41:58 2004 @@ -1,392 +0,0 @@ -/* $Xorg: dg31d.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module fax/dg31d.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/dg31d.c -- DDXIE G31D fax decode technique/element - - Ben Fahy -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ - - -#define lenient_decoder - - -/* the folling define causes extra stuff to be saved in state recorder */ -#define _G31D -#include "fax.h" -#include "faxint.h" -#include "bits.h" - -#include /* pick up the BITMAP_BIT_ORDER from Core X*/ - - -/**********************************************************************/ -int decode_g31d(state) -FaxState *state; -{ -register int bitpos; -register unsigned char *byteptr; -register unsigned char *endptr; -register int a0_color; -register int a0_pos; -register int a1_pos; -register int goal; -register int width; -register int rl; - -int lines_found=0; -int n_old_trans; -int n_new_trans; -int *old_trans; -int *new_trans; -int a0a1,a1a2; -int length_acc=0; -int last_b1_idx=0; -int code,nbits; - - if (state == (FaxState *)NULL) - return(-1); - - /* set up initial bitstream for the very first strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadStripper; - return(-1); - } - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size-4; - /* we will panic with four bytes to go */ - - state->bits.bitpos = 0; - state->bits.started = 1; - } - - localize_state(state); - - if (state->magic_needs) - finish_magic(state->final); - /* a magic strip was waiting for 1st word of next strip */ - - -/*** Main Decoding Loop ***/ - while(1) { - - switch(goal) { - case FAX_GOAL_SkipPastAnyToEOL: - code = 0; /* get gnu compiler to shut up */ - while (byteptr < endptr) { - /* look for EOL code */ - code = get_wcode(byteptr,bitpos,endptr); - rl = _WhiteFaxTable[code].run_length; - if (rl == EOL_RUN_LENGTH) - break; - else - /* move bitstream one bit further and try again */ - adjust_1bit(byteptr,bitpos,endptr); - } - if (byteptr >= endptr) { - state->decoder_done = FAX_DECODE_DONE_ErrorSkipPast; - return(lines_found); - } - nbits = _WhiteFaxTable[code].n_bits; - goal = FAX_GOAL_StartNewLine; - adjust_bitstream(nbits,byteptr,bitpos,endptr); - break; - - case FAX_GOAL_SeekFillAndEOL: - /* look for EOL code */ - code = 0; /* get gnu compiler to shut up */ - while (byteptr < endptr) { - /* look for EOL code */ - code = get_wcode(byteptr,bitpos,endptr); - rl = _WhiteFaxTable[code].run_length; - if (rl == EOL_RUN_LENGTH) - break; - else if (code) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadFill; - return(lines_found); - } - else - /* move bitstream one bit further and try again */ - adjust_1bit(byteptr,bitpos,endptr); - } - if (byteptr >= endptr) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadPtr; - return(-1); - } - nbits = _WhiteFaxTable[code].n_bits; - goal = FAX_GOAL_StartNewLine; - /* set goal before adjusting in case we run out of data */ - adjust_bitstream(nbits,byteptr,bitpos,endptr); - break; - - case FAX_GOAL_StartNewLine: - - if (lines_found >= state->nl_sought) - save_state_and_return(state); - - /* normal line initialization stuff */ - a0_pos = -1; - a0_color = WHITE; - goal = FAX_GOAL_HandleHoriz; - - reset_transitions(); - break; - - case FAX_GOAL_RecoverZero: - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - - case FAX_GOAL_HandleHoriz: - length_acc=0; - goal = FAX_GOAL_AccumulateA0A1; - /* in case I run out of data while getting a0-a1 distance */ - - case FAX_GOAL_AccumulateA0A1: - get_a0a1(FAX_GOAL_RecordA0A1); - /* If we have to return for data before getting the */ - /* whole a0a1 distance, we want to return to the a0a1 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a0a1 distance, then */ - /* we want to jump to state FAX_GOAL_RecordA0A1 when */ - /* we reenter the decoder. */ - - case FAX_GOAL_FallOnSword: - if (goal == FAX_GOAL_FallOnSword) { -#if defined(lenient_decoder) - goal = FAX_GOAL_SkipPastAnyToEOL; - FlushLineData(); - break; - -#else - state->decoder_done = FAX_DECODE_DONE_ErrorBadCode; - return(lines_found); -#endif - } - - case FAX_GOAL_RecordA0A1: - a0a1 = length_acc; - if (a0a1 < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada0a1; - return(-1); - } - if (a0_pos < 0) { - /* at start of line, a0a1 is the number of white pixels, */ - /* which is also the index on the line where white->black */ - new_trans[n_new_trans++] = a1_pos = a0a1; - } else { - /* in middle of the line, a0a1 is run-length, so - * a1_pos = a0_pos + a0a1, a2_pos = a1_pos + a1a2 - * - * 0 1 2 3 4 5 6 7 8 9 A B C D - * |w |w |w |b |b |b |b |b |w | | | | | - * a0 a1 a2 - */ - new_trans[n_new_trans++] = a1_pos = a0_pos + a0a1; - } - if (a1_pos >= width) { - if (a1_pos > width) { -#if defined(lenient_decoder) - /* we went too far, but we'll be forgiving */ - a1_pos = width; -#else - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - return(-1); -#endif - } - FlushLineData(); - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - } - if (new_trans[n_new_trans-1] < 0){ - state->decoder_done = FAX_DECODE_DONE_ErrorBadA0pos; - return(-1); - } - - - if (goal == FAX_GOAL_RecoverZero) { - - /* it's possible we got here by reading a zero in get_a0a1, */ - /* in which case 'goal' was set to FAX_GOAL_RecoverZero. We */ - /* must assume that the zero is an EOL pre-padded with a */ - /* variable number of zeros, which is legal according to */ - /* the coding spec. So we will record the increment in */ - /* line number and then attempt to recover. */ - goal = FAX_GOAL_SkipPastAnyToEOL; - FlushLineData(); - break; - /* break out of the switch, loop with the while */ - } - - if (rl == EOL_RUN_LENGTH) { - FlushLineData(); - goal = FAX_GOAL_StartNewLine; - /* if we got a non-zero length, remember the transition */ - /* in case the next line is coded in vertical mode */ - if (a0a1) - new_trans[n_new_trans++] = a0a1; - - /* notice we don't have to worry about a0_pos - - it will be reset when we start the new line - */ - break; - /* break out of the switch, loop with the while */ - } - length_acc=0; - goal = FAX_GOAL_AccumulateA1A2; - /* in case I run out of data while getting a1-a2 distance */ - - case FAX_GOAL_AccumulateA1A2: - get_a1a2(FAX_GOAL_FinishHoriz); - /* If we have to return for data before getting the */ - /* whole a1a2 distance, we want to return to the a1a2 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a1a2 distance, then */ - /* we want to jump to state FAX_GOAL_FinishHoriz when */ - /* we reenter the decoder. */ - - case FAX_GOAL_FinishHoriz: - a1a2 = length_acc; - /* XXX - I may regret not checking for a1a2 > 0 later... */ - if (a1a2 < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada1a2; - return(-1); - } - - - new_trans[n_new_trans] = a0_pos = new_trans[n_new_trans-1]+a1a2; - ++n_new_trans; - if (a0_pos < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadA0pos; - return(-1); - } - - /* it's possible we got here by reading a zero in get_a1a2, */ - /* in which case 'goal' was set to FAX_GOAL_RecoverZero. We */ - /* must assume that the zero is an EOL pre-padded with a */ - /* variable number of zeros, which is legal according to */ - /* the coding spec. So we will update the line count and */ - /* then attempt to recover. */ - if (goal == FAX_GOAL_FallOnSword) { -#if defined(lenient_decoder) - goal = FAX_GOAL_SkipPastAnyToEOL; - FlushLineData(); - break; - -#else - state->decoder_done = FAX_DECODE_DONE_ErrorBadCode; - return(lines_found); -#endif - } - if (goal == FAX_GOAL_RecoverZero ) { - /* assume we have hit the begining of an EOL */ - /* goal = FAX_GOAL_SeekFillAndEOL; */ - goal = FAX_GOAL_SkipPastAnyToEOL; - FlushLineData(); - break; - } - if (rl == EOL_RUN_LENGTH) { - FlushLineData(); - goal = FAX_GOAL_StartNewLine; - if (state->decoder_done) - save_state_and_return(state); - break; - } - if (a0_pos >= width) { - if (a0_pos > width) { -#if defined(lenient_decoder) - /* we went too far, but we'll be forgiving */ - a0_pos = width; -#else - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - return(lines_found); -#endif - } - FlushLineData(); - if (state->decoder_done) - save_state_and_return(state); - /* goal = FAX_GOAL_SeekFillAndEOL; */ - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - } - else { - goal = FAX_GOAL_HandleHoriz; - } - break; - - - default: - state->decoder_done = FAX_DECODE_DONE_ErrorBadGoal; - return(lines_found); - break; - } /* end of switch */ - } -/*** End, Main Decoding Loop ***/ -} -/**** module fax/g31d.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/dg32d.c diff -u xc/programs/Xserver/XIE/mixie/fax/dg32d.c:1.2 xc/programs/Xserver/XIE/mixie/fax/dg32d.c:removed --- xc/programs/Xserver/XIE/mixie/fax/dg32d.c:1.2 Fri Dec 14 14:58:22 2001 +++ xc/programs/Xserver/XIE/mixie/fax/dg32d.c Sat Feb 28 21:41:58 2004 @@ -1,488 +0,0 @@ -/* $Xorg: dg32d.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module fax/dg32d.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/dg32d.c -- DDXIE G32D fax decode technique/element - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - -#define lenient_decoder - -/* the folling define causes extra stuff to be saved in state recorder */ -#define _G32D - -#include "fax.h" -#include "faxint.h" -#include "bits.h" - -#include /* pick up the BITMAP_BIT_ORDER from Core X*/ - - -/**********************************************************************/ -int decode_g32d(state) -FaxState *state; -{ -register int bitpos; -register unsigned char *byteptr; -register unsigned char *endptr; -register int a0_color; -register int a0_pos,a1_pos; -register int goal; -register int mode; /* could overload goal, but will resist */ -register int length; -register int width; -register int g32d_horiz; -register int rl; - -int lines_found=0; -int n_old_trans; -int n_new_trans; -int *old_trans; -int *new_trans; -int a0a1,a1a2; -int length_acc=0; -int last_b1_idx=0; -int b1_pos,b2_pos; -int code,nbits; - - if (state == (FaxState *)NULL) - return(-1); - - /* set up initial bitstream for the very first strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - return(-1); - } - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size-4; - /* we will panic with four bytes to go */ - - state->bits.bitpos = 0; - state->bits.started = 1; - } - - localize_state(state); - - if (state->magic_needs) - finish_magic(state->final); - /* a magic strip was waiting for 1st word of next strip */ - - -/*** Main Decoding Loop ***/ - while(1) { - if (endptr < byteptr) { - return(-1); - } - switch(goal) { - - case FAX_GOAL_SkipPastAnyToEOL: - code = 0; /* get Gnu cc to shut up. */ - while (byteptr < endptr) { - /* look for EOL code */ - code = get_wcode(byteptr,bitpos,endptr); - rl = _WhiteFaxTable[code].run_length; - if (rl == EOL_RUN_LENGTH) - break; -#if defined(lenient_decoder) - else - /* move bitstream one bit further and try again */ - adjust_1bit(byteptr,bitpos,endptr); -#else - else if (!state->o_line && !lines_found) { - /* we'll be lenient starting out */ - adjust_1bit(byteptr,bitpos,endptr); - } - else { - state->decoder_done = FAX_DECODE_DONE_ErrorSkipPast; - save_state_and_return(state); - } -#endif - } - if (byteptr >= endptr) { - state->decoder_done = FAX_DECODE_DONE_ErrorSkipPast; - save_state_and_return(state); - } - nbits = _WhiteFaxTable[code].n_bits; - goal = FAX_GOAL_SeekTagBit; - adjust_bitstream(nbits,byteptr,bitpos,endptr); - break; - - case FAX_GOAL_SeekEOLandTag: - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - - case FAX_GOAL_SeekTagBit: - if (get_bit(byteptr,bitpos,endptr)) { - g32d_horiz = 1; - } - else { - g32d_horiz = 0; - } - goal = FAX_GOAL_AdjustTag; - /* have to set this goal in case adjusting throws us - back to the caller in order to get more data. */ - - adjust_1bit(byteptr,bitpos,endptr); - case FAX_GOAL_AdjustTag: - - - /*** ok, now start a new line ***/ - goal = FAX_GOAL_StartNewLine; - break; - - case FAX_GOAL_StartNewLine: - - /* if we got all the data we want, write it out */ - if (lines_found >= state->nl_sought) - save_state_and_return(state); - - /* normal line initialization stuff */ - a0_pos = -1; - a0_color = WHITE; - if (g32d_horiz) - goal = FAX_GOAL_HandleHoriz; - else - goal = FAX_GOAL_DetermineMode; - - reset_transitions(); - break; - case FAX_GOAL_DetermineMode: - get_mode_and_length(mode,length,byteptr,bitpos,endptr); - goal = mode; - /* our goal is now to handle whatever mode we're in! */ - - if (mode == FAX_MODE_Unknown) { - /* hopefully, we just hit the first 0 in an EOL */ - goal = FAX_GOAL_SeekEOLandTag; - } - else - adjust_bitstream_8(length,byteptr,bitpos,endptr); - break; - - case FAX_GOAL_RecoverZero: - - /* have to set new goal in case adjusting throws us */ - /* back to the caller (to get more data) */ - goal = FAX_GOAL_AdjustedButStillRecovering; - adjust_bitstream(nbits,byteptr,bitpos,endptr); - - case FAX_GOAL_AdjustedButStillRecovering: - { - int next_goal = FAX_GOAL_FoundOneEOL; - - while (1) { - if (*byteptr) { - register int mask; - /* important assumption: we only get here if we have */ - /* found at least twelve bits of zero leading up to */ - /* the current bitposition. Therefore, there can't */ - /* be any bits in the byte before the one we want */ - - mask = 1 << (7-bitpos); - while (bitpos < 8) { - if (mask & (*byteptr)) - break; - mask >>= 1; - ++bitpos; - } /* can't really reach bitpos = 8 above */ - goal = next_goal; - adjust_1bit(byteptr,bitpos,endptr); - break; - /* break out of while (1) */ - } - else { - bitpos = 0; - if (++byteptr >= endptr) - do_magic(byteptr,bitpos,endptr); - /* loop around to search some more */ - } - } /* end of while */ - - } - break; - - case FAX_GOAL_FoundOneEOL: - /* found an EOL. If this is RTC, there will be five more EOL's */ - /* on the way. If this is a normal EOL, next code will not */ - /* be an EOL, and we should interpret the next bit as tag bit */ - - - /* look for second EOL code */ - code = get_wcode(byteptr,bitpos,endptr); - rl = _WhiteFaxTable[code].run_length; - if (rl != EOL_RUN_LENGTH) { - goal = FAX_GOAL_SeekTagBit; - break; - } - - /* Got a second EOL code */ - return(-1); - break; - - case FAX_GOAL_HandleHoriz: - length_acc=0; - goal = FAX_GOAL_AccumulateA0A1; - /* in case I run out of data while getting a0-a1 distance */ - - - case FAX_GOAL_AccumulateA0A1: - get_a0a1(FAX_GOAL_RecordA0A1); - /* If we have to return for data before getting the */ - /* whole a0a1 distance, we want to return to the a0a1 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a0a1 distance, then */ - /* we want to jump to state FAX_GOAL_RecordA0A1 when */ - /* we reenter the decoder. */ - - case FAX_GOAL_RecordA0A1: - a0a1 = length_acc; - if (a0_pos < 0) { - /* at start of line, a0a1 is the number of white pixels, */ - /* which is also the index on the line where white->black */ - new_trans[n_new_trans++] = a1_pos = a0a1; - } else { - /* in middle of the line, a0a1 is run-length, so - * a1_pos = a0_pos + a0a1, a2_pos = a1_pos + a1a2 - * - * 0 1 2 3 4 5 6 7 8 9 A B C D - * |w |w |w |b |b |b |b |b |w | | | | | - * a0 a1 a2 - */ - new_trans[n_new_trans++] = a1_pos = a0_pos + a0a1; - } - if (a1_pos >= width) { - if (a1_pos > width) { -#if defined(lenient_decoder) - /* we went too far, but we'll be forgiving */ - a1_pos = width; -#else /* not so lenient */ - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - return(lines_found); -#endif - } - FlushLineData(); - goal = FAX_GOAL_SeekEOLandTag; - break; - } -#if defined(lenient_decoder) - if (rl < 0) { - FlushLineData(); - goal = FAX_GOAL_SeekTagBit; - /* if we got a non-zero length, remember the transition */ - /* in case the next line is coded in vertical mode */ - if (a0a1) - new_trans[n_new_trans++] = a0a1; - - /* notice we don't have to worry about a0_pos - - it will be reset when we start the new line - */ - break; - /* break out of the switch, loop with the while */ - } -#else /* not so lenient */ - if (goal == FAX_GOAL_RecoverZero) { - /* it's possible we got here by reading a zero in get_a0a1, */ - /* in which case 'goal' was set to FAX_GOAL_RecoverZero. We */ - /* must assume that the zero is an EOL pre-padded with a */ - /* variable number of zeros, which is legal according to */ - /* the coding spec. So we will record the increment in */ - /* line number and then attempt to recover. */ - FlushLineData(); - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - } else if(rl == BAD_RUN_LENGTH) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada0a1; - return(lines_found); - } -#endif - length_acc=0; - goal = FAX_GOAL_AccumulateA1A2; - /* in case I run out of data while getting a1-a2 distance */ - - case FAX_GOAL_AccumulateA1A2: - get_a1a2(FAX_GOAL_FinishHoriz); - /* If we have to return for data before getting the */ - /* whole a1a2 distance, we want to return to the a1a2 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a1a2 distance, then */ - /* we want to jump to state FAX_GOAL_FinishHoriz when */ - /* we reenter the decoder. */ - - case FAX_GOAL_FinishHoriz: - a1a2 = length_acc; - new_trans[n_new_trans] = a0_pos = new_trans[n_new_trans-1]+a1a2; - n_new_trans++; - -#if defined(lenient_decoder) - if (rl < 0) { - FlushLineData(); - goal = FAX_GOAL_SeekTagBit; - break; - } -#else /* not so lenient */ - /* it's possible we got here by reading a zero in get_a1a2, */ - /* in which case 'goal' was set to FAX_GOAL_RecoverZero. We */ - /* must assume that the zero is an EOL pre-padded with a */ - /* variable number of zeros, which is legal according to */ - /* the coding spec. So we will update the line count and */ - /* then attempt to recover. */ - if (goal == FAX_GOAL_RecoverZero) { - /* assume we have hit the begining of an EOL */ - FlushLineData(); - goal = FAX_GOAL_SkipPastAnyToEOL; - break; - } else if(rl == BAD_RUN_LENGTH) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada1a2; - return(lines_found); - } -#endif - if (a0_pos >= width) { - if (a0_pos > width) { -#if defined(lenient_decoder) - /* we went too far, but we'll be forgiving */ - a0_pos = width; -#else - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - return(lines_found); -#endif - } - FlushLineData(); - goal = FAX_GOAL_SeekEOLandTag; - break; - } else if(a0_pos > 0) { - if (g32d_horiz) - goal = FAX_GOAL_HandleHoriz; - else - goal = FAX_GOAL_DetermineMode; - } else { - state->decoder_done = FAX_DECODE_DONE_ErrorBadA0pos; - return(lines_found); - } - break; - - case FAX_MODE_Pass: - if (!n_old_trans) { /* line above all white */ - return(-1); - } - find_b2pos(a0_pos,a0_color,n_old_trans,old_trans); - - a0_pos = b2_pos; - if (a0_pos < 0 || a0_pos >= width) { - FlushLineData(); - goal = FAX_GOAL_SeekEOLandTag; - break; - } - goal = FAX_GOAL_DetermineMode; - break; - - case FAX_GOAL_HandleVertL3: - case FAX_GOAL_HandleVertL2: - case FAX_GOAL_HandleVertL1: - case FAX_GOAL_HandleVert0: - case FAX_GOAL_HandleVertR1: - case FAX_GOAL_HandleVertR2: - case FAX_GOAL_HandleVertR3: - if (n_old_trans) { /* line above not all white */ - find_b1pos(a0_pos,a0_color,n_old_trans,old_trans); - - if (b1_pos < 0) { - if (goal > FAX_GOAL_HandleVert0) { - return(-1); /* error! */ - } - b1_pos = width; - } - } else { - /* line above was all white. Since b1 was first non-white */ - /* b1 is imaginary transition off right edge. */ - b1_pos = width; - } - /* ok, we are guaranteed that 0 <= b1_pos <= width */ - /* set a0_pos = a1_pos, which is relative to b1_pos */ - a0_pos = b1_pos + (goal-FAX_GOAL_HandleVert0); - a0_color = 1-a0_color; - new_trans[n_new_trans++] = a0_pos > 0 ? a0_pos : 0; - if (a0_pos < 0 || a0_pos >= width) { - FlushLineData(); - goal = FAX_GOAL_SeekEOLandTag; - } else { - /* not at eol yet */ - goal = FAX_GOAL_DetermineMode; - } - break; - - default: - return(-1); - break; - } /* end of switch */ - } -/*** End, Main Decoding Loop ***/ -} -/**** module fax/g32d.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/dg4.c diff -u xc/programs/Xserver/XIE/mixie/fax/dg4.c:1.2 xc/programs/Xserver/XIE/mixie/fax/dg4.c:removed --- xc/programs/Xserver/XIE/mixie/fax/dg4.c:1.2 Fri Dec 14 14:58:22 2001 +++ xc/programs/Xserver/XIE/mixie/fax/dg4.c Sat Feb 28 21:41:58 2004 @@ -1,287 +0,0 @@ -/* $Xorg: dg4.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module fax/g4.c ****/ -/****************************************************************************** - -Copyright 1993, 1994,1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/g4.c -- DDXIE G4 fax decode technique/element - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - - -#define _G4 -#include "fax.h" -#include "faxint.h" -#include "bits.h" - -#include - /* pick up the BITMAP_BIT_ORDER from Core X*/ - - -/**********************************************************************/ -int decode_g4(state) -FaxState *state; -{ -register int bitpos; -register unsigned char *byteptr; -register unsigned char *endptr; -register int a0_color; -register int a0_pos; -register int goal; -register int mode; /* could overload goal, but will resist */ -register int length; -register int width; - -int lines_found=0; -int n_old_trans; -int n_new_trans; -int *old_trans; -int *new_trans; -int a0a1,a1a2; -int length_acc=0; -int last_b1_idx=0; -int b1_pos,b2_pos; -int rl; - - if (state == (FaxState *)NULL) - return(-1); - - /* set up initial bitstream for the very first strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadStripper; - return(-1); - } - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size-4; - /* we will panic with four bytes to go */ - - state->bits.bitpos = 0; - state->bits.started = 1; - } - - localize_state(state); - - if (state->magic_needs) - finish_magic(state->final); - /* a magic strip was waiting for 1st word of next strip */ - -/*** Main Decoding Loop ***/ - while(1) { - switch(goal) { - case FAX_GOAL_StartNewLine: - - /* if any data produced by previous states, write it out */ - if (lines_found >= state->nl_sought) - save_state_and_return(state); - - /* normal line initialization stuff */ - a0_pos = -1; - a0_color = WHITE; - goal = FAX_GOAL_DetermineMode; - reset_transitions(); - break; - case FAX_GOAL_DetermineMode: - get_mode_and_length(mode,length,byteptr,bitpos,endptr); - goal = mode; - /* our goal is now to handle whatever mode we're in! */ - - if (mode != FAX_MODE_Unknown) - adjust_bitstream_8(length,byteptr,bitpos,endptr); - break; - - case FAX_GOAL_HandleHoriz: - length_acc=0; - goal = FAX_GOAL_AccumulateA0A1; - /* in case I run out of data while getting a0-a1 distance */ - - - case FAX_GOAL_AccumulateA0A1: - get_a0a1(FAX_GOAL_RecordA0A1); - /* If we have to return for data before getting the */ - /* whole a0a1 distance, we want to return to the a0a1 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a0a1 distance, then */ - /* we want to jump to state FAX_GOAL_RecordA0A1 when */ - /* we reenter the decoder. */ - - case FAX_GOAL_RecordA0A1: - a0a1 = length_acc; - length_acc=0; - goal = FAX_GOAL_AccumulateA1A2; - /* in case I run out of data while getting a1-a2 distance */ - - case FAX_GOAL_AccumulateA1A2: - get_a1a2(FAX_GOAL_FinishHoriz); - /* If we have to return for data before getting the */ - /* whole a1a2 distance, we want to return to the a1a2 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a1a2 distance, then */ - /* we want to jump to state FAX_GOAL_FinishHoriz when */ - /* we reenter the decoder. */ - - case FAX_GOAL_FinishHoriz: - a1a2 = length_acc; - if (a0_pos < 0) { - /* at start of line, a0a1 is the number of white pixels, */ - /* which is also the index on the line where white->black */ - new_trans[n_new_trans++] = a0a1; - new_trans[n_new_trans] = a0_pos = a0a1 + a1a2; - ++n_new_trans; - } else { - /* in middle of the line, a0a1 is run-length, so - * a1_pos = a0_pos + a0a1, a2_pos = a1_pos + a1a2 - * - * 0 1 2 3 4 5 6 7 8 9 A B C D - * |w |w |w |b |b |b |b |b |w | | | | | - * a0 a1 a2 - */ - new_trans[n_new_trans++] = a0_pos + a0a1; - new_trans[n_new_trans] = a0_pos = a0_pos + a0a1 + a1a2; - ++n_new_trans; - } - if (a0_pos >= width) { - if (a0_pos > width) { - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - save_state_and_return(state); - } - goal = FAX_GOAL_StartNewLine; - FlushLineData(); - break; - } - else - goal = FAX_GOAL_DetermineMode; - break; - - case FAX_MODE_Pass: - if (!n_old_trans) { /* line above all white */ - state->decoder_done = FAX_DECODE_DONE_ErrorPassAboveAllWhite; - save_state_and_return(state); - } - find_b2pos(a0_pos,a0_color,n_old_trans,old_trans); - - a0_pos = b2_pos; - if (a0_pos < 0) { - FlushLineData(); - goal = FAX_GOAL_StartNewLine; - break; - } - if (a0_pos >= width) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadA0pos; - save_state_and_return(state); - } - goal = FAX_GOAL_DetermineMode; - break; - - case FAX_GOAL_HandleVertL3: - case FAX_GOAL_HandleVertL2: - case FAX_GOAL_HandleVertL1: - case FAX_GOAL_HandleVert0: - case FAX_GOAL_HandleVertR1: - case FAX_GOAL_HandleVertR2: - case FAX_GOAL_HandleVertR3: - if (n_old_trans) { /* line above not all white */ - find_b1pos(a0_pos,a0_color,n_old_trans,old_trans); - - if (b1_pos < 0) { - if (goal > FAX_GOAL_HandleVert0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadGoal; - save_state_and_return(state); - } - b1_pos = width; - } - } else { - /* line above was all white. Since b1 was first non-white */ - /* b1 is imaginary transition off right edge. */ - b1_pos = width; - } - /* ok, we are guaranteed that 0 <= b1_pos <= width */ - /* set a0_pos = a1_pos, which is relative to b1_pos */ - a0_pos = b1_pos + (goal-FAX_GOAL_HandleVert0); - a0_color = 1-a0_color; - new_trans[n_new_trans++] = a0_pos > 0 ? a0_pos : 0; - if (a0_pos >= width) { - FlushLineData(); - goal = FAX_GOAL_StartNewLine; - } - else { - /* not at eol yet */ - goal = FAX_GOAL_DetermineMode; - } - break; - - default: - state->decoder_done = FAX_DECODE_DONE_ErrorBadGoal; - save_state_and_return(state); - break; - } /* end of switch */ - } -/*** End, Main Decoding Loop ***/ -} -/**** module fax/g4.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/dtiff2.c diff -u xc/programs/Xserver/XIE/mixie/fax/dtiff2.c:1.2 xc/programs/Xserver/XIE/mixie/fax/dtiff2.c:removed --- xc/programs/Xserver/XIE/mixie/fax/dtiff2.c:1.2 Fri Dec 14 14:58:23 2001 +++ xc/programs/Xserver/XIE/mixie/fax/dtiff2.c Sat Feb 28 21:41:58 2004 @@ -1,285 +0,0 @@ -/* $Xorg: dtiff2.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module fax/dtiff2.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/dtiff2.c -- DDXIE TIFF2 fax decode technique/element - - Ben Fahy -- AGE Logic, Inc. Sept, 1993 - -*****************************************************************************/ - -/* the folling define causes extra stuff to be saved in state recorder */ -#define _G31D -#include "fax.h" -#include "faxint.h" -#include "bits.h" - -#include - /* pick up the BITMAP_BIT_ORDER from Core X*/ - -/**********************************************************************/ -int decode_tiff2(state) -FaxState *state; -{ -register int bitpos; -register unsigned char *byteptr; -register unsigned char *endptr; -register int a0_color; -register int a0_pos; -register int a1_pos; -register int goal; -register int width; -register int rl; -register int last_b1_idx = 0; - -int lines_found=0; -int n_old_trans; -int n_new_trans; -int *old_trans; -int *new_trans; -int a0a1,a1a2; -int length_acc=0; - - if (state == (FaxState *)NULL) - return(-1); - - /* set up initial bitstream for the very first strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadStripper; - return(-1); - } - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size-4; - /* we will panic with four bytes to go */ - - state->bits.bitpos = 0; - state->bits.started = 1; - } - - localize_state(state); - - if (state->magic_needs) - finish_magic(state->final); - /* a magic strip was waiting for 1st word of next strip */ - -/*** Main Decoding Loop ***/ - while(1) { - switch(goal) { - - case FAX_GOAL_StartNewLine: - - skip_bits_at_eol(byteptr,bitpos,endptr); - - if (lines_found >= state->nl_sought) - save_state_and_return(state); - - /* normal line initialization stuff */ - a0_pos = -1; - a0_color = WHITE; - goal = FAX_GOAL_HandleHoriz; - - reset_transitions(); - break; - - case FAX_GOAL_HandleHoriz: - length_acc=0; - goal = FAX_GOAL_AccumulateA0A1; - /* in case I run out of data while getting a0-a1 distance */ - - case FAX_GOAL_AccumulateA0A1: - get_a0a1(FAX_GOAL_RecordA0A1); - /* If we have to return for data before getting the */ - /* whole a0a1 distance, we want to return to the a0a1 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a0a1 distance, then */ - /* we want to jump to state FAX_GOAL_RecordA0A1 when */ - /* we reenter the decoder. */ - - case FAX_GOAL_FallOnSword: - if (goal == FAX_GOAL_FallOnSword) { - /* received a yucky code */ - state->decoder_done = FAX_DECODE_DONE_ErrorBadCode; - save_state_and_return(state); - } - - case FAX_GOAL_RecoverZero: - /* g31d can recover. tiff2, alas, cannot */ - if (goal == FAX_GOAL_RecoverZero) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadZero; - save_state_and_return(state); - } - - case FAX_GOAL_RecordA0A1: - a0a1 = length_acc; - if (a0a1 < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada0a1; - save_state_and_return(state); - } - if (a0_pos < 0) { - /* at start of line, a0a1 is the number of white pixels, */ - /* which is also the index on the line where white->black */ - new_trans[n_new_trans++] = a1_pos = a0a1; - } else { - /* in middle of the line, a0a1 is run-length, so - * a1_pos = a0_pos + a0a1, a2_pos = a1_pos + a1a2 - * - * 0 1 2 3 4 5 6 7 8 9 A B C D - * |w |w |w |b |b |b |b |b |w | | | | | - * a0 a1 a2 - */ - new_trans[n_new_trans++] = a1_pos = a0_pos + a0a1; - } - if (a1_pos >= width) { - if (a1_pos > width) { - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - save_state_and_return(state); - } - FlushLineData(); - goal = FAX_GOAL_StartNewLine; - break; - } - if (new_trans[n_new_trans-1] < 0){ - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - save_state_and_return(state); - } - - if (rl == EOL_RUN_LENGTH) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadEOL; - save_state_and_return(state); - break; - /* break out of the switch, loop with the while */ - } - length_acc=0; - goal = FAX_GOAL_AccumulateA1A2; - /* in case I run out of data while getting a1-a2 distance */ - - case FAX_GOAL_AccumulateA1A2: - get_a1a2(FAX_GOAL_FinishHoriz); - /* If we have to return for data before getting the */ - /* whole a1a2 distance, we want to return to the a1a2 */ - /* accumulate state when we reenter the decoder. If */ - /* adjusting the bitstream forces us to return after */ - /* getting the last part of the a1a2 distance, then */ - /* we want to jump to state FAX_GOAL_FinishHoriz when */ - /* we reenter the decoder. */ - - /* handle various possible errors found by get_a1a2 */ - if (goal == FAX_GOAL_FallOnSword) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadCode; - save_state_and_return(state); - } - if (goal == FAX_GOAL_RecoverZero ) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadZero; - save_state_and_return(state); - } - if (rl == EOL_RUN_LENGTH) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadEOL; - save_state_and_return(state); - break; - } - - case FAX_GOAL_FinishHoriz: - a1a2 = length_acc; - /* XXX - I may regret not checking for a1a2 > 0 later... */ - if (a1a2 < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBada1a2; - save_state_and_return(state); - } - - new_trans[n_new_trans] = a0_pos = new_trans[n_new_trans-1]+a1a2; - ++n_new_trans; - if (a0_pos < 0) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadA0pos; - save_state_and_return(state); - } - - if (a0_pos >= width) { - if (a0_pos > width) { - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - save_state_and_return(state); - } - FlushLineData(); - if (state->decoder_done) - save_state_and_return(state); - goal = FAX_GOAL_StartNewLine; - break; - } - else - goal = FAX_GOAL_HandleHoriz; - break; - - - default: - state->decoder_done = FAX_DECODE_DONE_ErrorBadGoal; - save_state_and_return(state); - break; - } /* end of switch */ - } -/*** End, Main Decoding Loop ***/ -} -/**** module fax/dtiff2.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/dtiffpb.c diff -u xc/programs/Xserver/XIE/mixie/fax/dtiffpb.c:1.2 xc/programs/Xserver/XIE/mixie/fax/dtiffpb.c:removed --- xc/programs/Xserver/XIE/mixie/fax/dtiffpb.c:1.2 Fri Dec 14 14:58:23 2001 +++ xc/programs/Xserver/XIE/mixie/fax/dtiffpb.c Sat Feb 28 21:41:58 2004 @@ -1,292 +0,0 @@ -/* $Xorg: dtiffpb.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module fax/tiffpb.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/tiffpb.c -- DDXIE TIFF Packbits decode technique/element - - Packbits is output-type independent. The compression algorithm - just compresses a stream. The 'strip_size' parameter should be - how many bytes long the strip is... - - Coding assumption: it is always valid to do val = *byteptr++; - But any code which does this is responsible for making sure - the next access will also be valid. Otherwise, we should - save state and return. - - Ben Fahy -- AGE Logic, Inc. Sept, 1993 - -*****************************************************************************/ - -/* the folling define causes extra stuff to be saved in state recorder */ -#define _PBits - -#include "fax.h" -#include "faxint.h" -#include "bits.h" -#include "xiemd.h" - -/* by decree of PackBits spec */ - -/**********************************************************************/ -int decode_tiffpb(state) -FaxState *state; -{ -register int a0_color,a0_pos; -register unsigned char *byteptr; -register unsigned char *endptr; -register int goal; -register int width,rnd_width; -register int rl; - -register int lines_found=0; -int length_acc=0; - -/*** output line stuff ***/ -register unsigned char *olp; -register int i,a0_in_bytes; - - if (state == (FaxState *)NULL) - return(-1); - - /* set up initial bitstream for the very first strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->decoder_done = FAX_DECODE_DONE_ErrorBadStripper; - return(-1); - } - - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of input strip */ - - state->bits.bitpos = 0; - state->bits.started = 1; - - } - - if (state->magic_needs) { - if (state->strip_state == StripStateNew) { - state->strip_state = StripStateInUse; - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of input strip */ - state->bits.bitpos = 0; - state->bits.started = 1; - } - else { - /* no new strip?? But... I *need* more data! */ - state->decoder_done = FAX_DECODE_DONE_ErrorBadMagic; - return(lines_found); - } - state->magic_needs = 0; - } - - localize_state(state); - rnd_width = 8 * ((width+7)/8); - - olp = (unsigned char *) state->o_lines[lines_found]; - -/*** Main Decoding Loop ***/ - while(1) { - switch(goal) { - case PB_GOAL_StartNewLine: - if (lines_found >= state->nl_sought) { - save_state_and_return(state); - } - - a0_pos = 0; - olp = (unsigned char *) state->o_lines[lines_found]; - goal = PB_GOAL_GetRunLength; - break; - - case PB_GOAL_GetRunLength: - -/*** Basic Packbits algorithm: - -code = *((signed char *)byteptr++); - -if (0 <= code && code <= 127) ===> length = code + 1; - -if (-127 <= code && code < 0) ===> length = 1 - code; - -else ===> length = 0 - -We can make things a little quicker (and avoid signed char compiler issues) -if we simply look for whether the high bit is on or off, and then compute -the result directly. Thus, - -if code && 0x80 => -128 <= code < 0 - - 0x80 + foo = -128 + foo - - so length = 1 - code = 1 - (-128 + foo) = 129 - foo. - - note foo=0 is code for runlength 0 (fill) - -The positive case is even easier. - -***/ - if (byteptr >= endptr) { - state->magic_needs = 1; - state->strip_state = StripStateDone; - save_state_and_return(state); - } - if (*byteptr & 0x80) { /* -128 <= code < 0 */ - register int foo = 0x7f & *byteptr; - if (foo) { - length_acc = 129 - foo ; - goal = PB_GOAL_GetRepeatByte; - } - else { - length_acc = 0; /* -128 => code = 0 */ - } - } - else { /* 0 <= code <= 127 */ - length_acc = 1 + *byteptr; - goal = PB_GOAL_GetLiteralBytes; - } - ++byteptr; - - /* make sure all the pixels fit on this output line */ - if (8*length_acc + a0_pos > rnd_width ) { - state->decoder_done = FAX_DECODE_DONE_ErrorPastWidth; - save_state_and_return(state); - } - break; - - case PB_GOAL_GetLiteralBytes: - /* Important Note!! we are guaranteed that output line - has enough space to hold output pixels here. We checked - in the GetRunLength state. However, it is possible we - may run out of input bytes, in which case we may have - to save state and return. - */ - a0_in_bytes = a0_pos / 8; - while (length_acc > 0) { - if (byteptr >= endptr) { - a0_pos = a0_in_bytes << 3; - state->magic_needs = 1; - state->strip_state = StripStateDone; - save_state_and_return(state); - } - a0_color = *byteptr++; length_acc--; -#if (IMAGE_BYTE_ORDER == MSBFirst) - olp[a0_in_bytes++] = a0_color; -#else - olp[a0_in_bytes++] = _ByteReverseTable[a0_color]; -#endif - } - a0_pos = a0_in_bytes << 3; - - if (a0_pos >= width) { - ++lines_found; - goal = PB_GOAL_StartNewLine; - } - else - goal = PB_GOAL_GetRunLength; - - break; - - case PB_GOAL_GetRepeatByte: - if (byteptr >= endptr) { - state->magic_needs = 1; - state->strip_state = StripStateDone; - save_state_and_return(state); - } - a0_color = *byteptr++; - - /* Important Note!! we are guaranteed that output line - has enough space to hold output pixels here. We checked - in the GetRunLength state - */ - - a0_in_bytes = a0_pos / 8; - for (i=0; i= width) { - ++lines_found; - goal = PB_GOAL_StartNewLine; - } - else - goal = PB_GOAL_GetRunLength; - - break; - - default: - state->decoder_done = FAX_DECODE_DONE_ErrorBadGoal; - save_state_and_return(state); - } /* end of switch */ - } /* end of main decoding loop */ -} - -/**** module fax/tiffpb.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/eg31d.c diff -u xc/programs/Xserver/XIE/mixie/fax/eg31d.c:1.2 xc/programs/Xserver/XIE/mixie/fax/eg31d.c:removed --- xc/programs/Xserver/XIE/mixie/fax/eg31d.c:1.2 Fri Dec 14 14:58:23 2001 +++ xc/programs/Xserver/XIE/mixie/fax/eg31d.c Sat Feb 28 21:41:58 2004 @@ -1,289 +0,0 @@ -/* $Xorg: eg31d.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module eg31d.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - eg31d.c -- DDXIE module for encoding g31d format - - Ben Fahy, AGE Logic, Oct 1993 - - XXX - this module should be merged with etiff2.c - the only - difference is the way EOL's are coded. - -******************************************************************************/ - -#include "fax.h" -#define _G31D -#include "fencode.h" -#include "xiemd.h" -#include "fetabs.h" - -/************************************************************************/ -encode_g31d(state) -FaxEncodeState *state; -{ -/* stuff exchanged with state variable */ -register int goal; -register unsigned char *byteptr; -register unsigned char *endptr; -register int bitpos; -register int width; -register int stager; -int rl; -register int a0_color; -G31DEncodePvt *epvt; - -/* stuff exchanged with private state variable */ -register int index; -register int nvals; -register int *counts; -register int nbits; -int rlcode; -int terminating; -register int codelength; - -register int lines_coded=0; -register int lines_to_code=0; - -int old_rl; - - if (state == (FaxEncodeState *) NULL) - return(-1); - - /* set up initial bitstream for the very first output strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->encoder_done = ENCODE_ERROR_StripStateNotNew; - return(-1); - } - - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - - state->bits.bitpos = 0; - state->bits.started = 1; - state->strip_state = StripStateInUse; - } - - /* or, reset bitstream for a new output strip */ - if (state->magic_needs) { - if (state->strip_state == StripStateNew) { - state->strip_state = StripStateInUse; - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - state->bits.started = 1; - } - else { - /* no new strip?? But... I *need* more data! */ - state->encoder_done = ENCODE_ERROR_BadMagic; - return(-1); - } - state->magic_needs = 0; - } - - localize_state(state); - - -/*** Main Encoding Loop ***/ - while (1) { - - switch(goal) { - - case ENCODE_FAX_GOAL_StartNewLine: - /* every new line need to write an EOL. Should call it BOL,huh? */ - - if (epvt->align_eol) { - /* advance bitpos to 4 + 8k, where k is an integer */ - bitpos = 4 + 8*( (bitpos+3)>>3 ); - } - - stager |= (EOL_CODE << (16-bitpos)); - bitpos += EOL_BIT_LENGTH; - - goal = ENCODE_FAX_GOAL_FlushEOL; - - case ENCODE_FAX_GOAL_FlushEOL: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - if (bitpos >=8) { - /* go around and flush some more */ - break; - } - - goal = ENCODE_FAX_GOAL_EOLWritten; - - if (lines_coded >= state->nl_tocode) { - /* We have read the whole input strip, need more data */ - save_state_and_return(state); - } - - case ENCODE_FAX_GOAL_EOLWritten: - - /* every new line we need to compute its runlength data */ - /* get the sequence of white and black run lengths */ - nvals = encode_runs( - state->i_lines[lines_coded], /* input data */ - width, /* # of bits */ - counts, /* where to put lengths */ - state->radiometric, /* if 1, white is 1 */ - width - ); - if (nvals < 0) { - state->encoder_done = ENCODE_ERROR_EncodeRunsFailure; - save_state_and_return(state); - } - a0_color = WHITE; - index = 0; - - case ENCODE_FAX_GOAL_OutputNextRunLength: - rl = counts[index++]; - old_rl = rl; - - case ENCODE_FAX_GOAL_DeduceCode: - nbits = deduce_code(a0_color,&rl,&rlcode,&terminating); - /* should be a macro but for now, a function */ - - /* shift code over so it merges with stager contents */ - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - if (bitpos >=8) { - goal = ENCODE_FAX_GOAL_FlushStager; - break; - } - if (terminating) { - /* all done with this runlength */ - if (index < nvals) { - a0_color = ~a0_color; - goal = ENCODE_FAX_GOAL_OutputNextRunLength; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* go around the loop again */ - goal = ENCODE_FAX_GOAL_DeduceCode; - old_rl = rl; - break; - - case ENCODE_FAX_GOAL_FlushStager: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - - if (bitpos >= 8) { - /* go around the loop again, trying to flush more */ - break; - } - /* if here, we have flushed stager to the point there is */ - /* at most a partial byte of data left in it. */ - if (terminating) { - /* all done with this runlength */ - if (index < nvals) { - a0_color = ~a0_color; - goal = ENCODE_FAX_GOAL_OutputNextRunLength; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* not done with this runlength yet */ - goal = ENCODE_FAX_GOAL_DeduceCode; - break; - - case ENCODE_FAX_GOAL_FinishLine: - ++lines_coded; - goal = ENCODE_FAX_GOAL_StartNewLine; - break; - - default: - state->encoder_done = ENCODE_ERROR_BadMagic; - save_state_and_return(state); - break; - - } /* end of switch(goal) in main decoding loop */ - - } /* end of main encoding loop */ -} -/************************************************************************/ Index: xc/programs/Xserver/XIE/mixie/fax/eg32d.c diff -u xc/programs/Xserver/XIE/mixie/fax/eg32d.c:1.2 xc/programs/Xserver/XIE/mixie/fax/eg32d.c:removed --- xc/programs/Xserver/XIE/mixie/fax/eg32d.c:1.2 Fri Dec 14 14:58:23 2001 +++ xc/programs/Xserver/XIE/mixie/fax/eg32d.c Sat Feb 28 21:41:58 2004 @@ -1,670 +0,0 @@ -/* $Xorg: eg32d.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module eg32d.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - eg32d.c -- DDXIE module for encoding g32d format. Since - g42d is so similar, we also do that in - this module. - - Ben Fahy, AGE Logic, Oct 1993 - -******************************************************************************/ - -#include "fax.h" -#define _G32D -#include "fencode.h" -#include "xiemd.h" -#include "fetabs.h" - -/************************************************************************/ -encode_g32d(state) -FaxEncodeState *state; -{ -/* stuff exchanged with state variable */ -register int goal,next_goal; -register unsigned char *byteptr; -register unsigned char *endptr; -register int bitpos; -register int width; -CARD32 stager; -unsigned rl; -register int a0_color,b1_color; -register int a0_pos,a1_pos,a2_pos,b1_pos,b2_pos; -register int length_acc; -register int a0a1,a1a2; -G32DEncodePvt *epvt; - -/* stuff exchanged with private state variable */ -register int index,aindex; -register int save_index,save_aindex; -register int nvals,avals; -register int *counts; -register int *above; -register int nbits; -int rlcode; -int terminating; -register int codelength; -register int k,kcnt,save_b1pos,save_b1color; - -register int lines_coded=0; -register int lines_to_code=0; -register int a1b1,abs_a1b1; -int old_rl; - - if (state == (FaxEncodeState *) NULL) { - return(-1); - } - - /* set up initial bitstream for the very first output strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->encoder_done = ENCODE_ERROR_StripStateNotNew; - return(-1); - } - - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - - state->bits.bitpos = 0; - state->bits.started = 1; - state->strip_state = StripStateInUse; - } - - /* or, reset bitstream for a new output strip */ - if (state->magic_needs) { - if (state->strip_state == StripStateNew) { - state->strip_state = StripStateInUse; - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - state->bits.started = 1; - } - else { - /* no new strip?? But... I *need* more data! */ - state->encoder_done = ENCODE_ERROR_BadMagic; - return(0); - } - state->magic_needs = 0; - } - - localize_state(state); - /* loads epvt and other variables */ - - -/*** Main Encoding Loop ***/ - while (1) { - - switch(goal) { - - case ENCODE_FAX_GOAL_StartNewLine: - /* every new line need to write an EOL. Should call it BOL,huh? */ - - /* make old counts the new reference line */ - { - int *foo; - foo = counts; - counts = above; - above = foo; - avals = nvals; - } - - if (epvt->really_g4) { - /* G4 doesn't write the silly EOL's except at very end */ - goal = ENCODE_FAX_GOAL_G4SneaksIn; - break; - } - - if (epvt->align_eol) { - /* advance bitpos to 4 + 8k, where k is an integer */ - bitpos = 4 + 8*( (bitpos+3)>>3 ); - } - - if (kcnt % k) { - - /* need to encode in 2-D mode */ - rlcode = EOL_2D_CODE; - - stager |= (EOL_2D_CODE << (16-bitpos)); - bitpos += EOL_2D_BIT_LENGTH; - - } - else { - rlcode = EOL_1D_CODE; - stager |= (EOL_1D_CODE << (16-bitpos)); - bitpos += EOL_1D_BIT_LENGTH; - } - - goal = ENCODE_FAX_GOAL_FlushEOL; - - case ENCODE_FAX_GOAL_FlushEOL: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - if (bitpos >=8) { - /* go around and flush some more */ - break; - } - - goal = ENCODE_FAX_GOAL_EOLWritten; - - case ENCODE_FAX_GOAL_G4SneaksIn: - if (lines_coded >= state->nl_tocode) { - /* We have read the whole input strip, need more data */ - save_state_and_return(state); - } - - case ENCODE_FAX_GOAL_EOLWritten: - - /* every new line we need to compute its runlength data */ - /* get the sequence of white and black run lengths */ - nvals = encode_runs( - state->i_lines[lines_coded], /* input data */ - width, /* # of bits */ - counts, /* where to put lengths */ - state->radiometric, /* if 1, white is 1 */ - width - ); - if (nvals < 0) { - state->encoder_done = ENCODE_ERROR_EncodeRunsFailure; - save_state_and_return(state); - } - a0_color = WHITE; - index = 0; - if (epvt->really_g4 || kcnt % k) { - aindex = 0; - a0_pos = -1; - b1_color = WHITE; - b1_pos = 0; - goal = ENCODE_FAX_GOAL_FindPositions; - length_acc = 0; - break; - } - - case ENCODE_FAX_GOAL_OutputNextRunLength: - rl = counts[index++]; - old_rl = rl; - next_goal = ENCODE_FAX_GOAL_OutputNextRunLength; - /* after we write code for this runlength, go to next */ - - case ENCODE_FAX_GOAL_DeduceCode: - nbits = deduce_code(a0_color,&rl,&rlcode,&terminating); - /* should be a macro but for now, a function */ - - /* shift code over so it merges with stager contents */ - - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - - if (bitpos >=8) { - goal = ENCODE_FAX_GOAL_FlushStager; - break; - } - if (terminating) { - /* all done with this runlength */ - if (next_goal != ENCODE_FAX_GOAL_OutputNextRunLength) { - goal = next_goal; - break; - } - - if (index < nvals) { - a0_color = ~a0_color; - goal = next_goal; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* go around the loop again */ - goal = ENCODE_FAX_GOAL_DeduceCode; - old_rl = rl; - break; - - case ENCODE_FAX_GOAL_FlushStager: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - - if (bitpos >= 8) { - /* go around the loop again, trying to flush more */ - break; - } - /* if here, we have flushed stager to the point there is */ - /* at most a partial byte of data left in it. */ - if (terminating) { - /* all done with this runlength */ - if (next_goal != ENCODE_FAX_GOAL_OutputNextRunLength) { - goal = next_goal; - break; - } - - if (index < nvals) { - a0_color = ~a0_color; - goal = next_goal; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* not done with this runlength yet */ - goal = ENCODE_FAX_GOAL_DeduceCode; - old_rl = rl; - break; - - case ENCODE_FAX_GOAL_FinishLine: - ++lines_coded; - ++kcnt; - goal = ENCODE_FAX_GOAL_StartNewLine; - break; - - case ENCODE_FAX_GOAL_FindPositions: - save_index = index; - save_aindex = aindex; - save_b1pos = b1_pos; - save_b1color = b1_color; - /* it's easier to just remember these than to back up */ - if (index >= nvals) { - a1_pos = a2_pos = state->width; - ++index; - /* this is for the sake of vertical mode below */ - } - else { - if (a0_pos < 0) - a1_pos = counts[index++]; - else - a1_pos = a0_pos + (counts[index++] - length_acc); - /* note: we need to subtract length_acc in case - we hit one or more pass modes for this index, - in which case a0_pos was incremented part of - the distance between a0 and a1... - */ - } - - if (index >= nvals) { - a2_pos = state->width; - ++index; - /* this is just so we can subtract to get a1's index */ - } - else - a2_pos = a1_pos + counts[index++]; - - /* now find b1, which is first changing element to right - of a0 of opposite color */ - - while (aindex < avals && - (b1_color == a0_color || b1_pos <= a0_pos) ) { - b1_pos += above[aindex++]; - b1_color = ~b1_color; - } - if (aindex >= avals) { - - /* if no b1 found, set it just past normal image data */ - /* now, the sum of all 'above[index]'s should be equal */ - /* to the image width, so this gives us a check that */ - /* the runlength algorithm is working */ - - if (b1_pos != width) { - state->encoder_done = ENCODE_ERROR_NoB1Found; - save_state_and_return(state); - } - b2_pos = width+1; - } - if (aindex >= avals) { - if (b1_pos == width) - b2_pos = state->width + 1; - else - b2_pos = state->width; - } - else - b2_pos = b1_pos + above[aindex]; - - if (b2_pos < a1_pos) { - goal = ENCODE_FAX_GOAL_PassMode; - break; - } - length_acc = 0; - /* we won't linger on this a0 anymore */ - - a1b1 = b1_pos-a1_pos; - abs_a1b1 = (a1b1 >=0)? a1b1 : -a1b1; - if (abs_a1b1 <= 3) { - goal = ENCODE_FAX_GOAL_VerticalMode; - } - else - goal = ENCODE_FAX_GOAL_HorizontalMode; - break; - - - case ENCODE_FAX_GOAL_PassMode: - /* pass mode is nice and simple. a0_pos = b2_pos */ - - rlcode = PASS_CODE; - nbits = PASS_CODE_BIT_LENGTH; - - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - /* before worrying about flushing, let's update positions */ - if (a0_pos < 0) - length_acc = b2_pos; - else - length_acc += b2_pos - a0_pos; - /* don't count passed length twice */ - - a0_pos = b2_pos; - index = save_index; - - b1_pos = b2_pos; - /* new b1_position will be old b2_position */ - b1_color = ~b1_color; - ++aindex; - - if (bitpos >=8) - goal = ENCODE_FAX_GOAL_Flush2DStager; - else { - - if (a0_pos >= width) { - goal = ENCODE_FAX_GOAL_FinishLine; - } - else { - goal = ENCODE_FAX_GOAL_FindPositions; - } - } - break; - - case ENCODE_FAX_GOAL_HorizontalMode: - - rlcode = HORIZONTAL_CODE; - nbits = HORIZONTAL_CODE_LENGTH; - - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - if (bitpos < 8) { - goal = ENCODE_FAX_GOAL_FlushedHCode; - break; - } - goal = ENCODE_FAX_GOAL_FlushHCode; - - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - - case ENCODE_FAX_GOAL_FlushHCode: - - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - - if (bitpos >= 8) { - /* go around the loop again, trying to flush more */ - break; - } - /* if here, we have flushed stager */ - - case ENCODE_FAX_GOAL_FlushedHCode: - a0a1 = a1_pos - a0_pos; - if (a0_pos == -1) - a0a1 -= 1; - a1a2 = a2_pos - a1_pos; - rl = old_rl = a0a1; - goal = ENCODE_FAX_GOAL_DeduceCode; - /* will loop through writing out the code for a0a1 */ - - next_goal = ENCODE_FAX_GOAL_DoneWithA0A1; - /* when done writing a0a1 codes, will go to DoneWithA0A1 */ - - /* before going on, let's set up for the next iteration */ - a0_pos = a2_pos; - /* a0 skips to a2, index adjusted automatically */ - - b1_pos = save_b1pos; - b1_color = save_b1color; - /* it's too painful to figure out what b1 was */ - - aindex = save_aindex; - /* we don't know enough to advance b1 */ - break; - - case ENCODE_FAX_GOAL_DoneWithA0A1: - rl = old_rl = a1a2; - a0_color = ~a0_color; - /* here, "a0_color" represents color of next rl */ - goal = ENCODE_FAX_GOAL_DeduceCode; - /* will loop through writing out the code for a0a1 */ - next_goal = ENCODE_FAX_GOAL_DoneWithA1A2; - /* when done writing a1a2 codes, will go to DoneWithA1A2 */ - break; - - case ENCODE_FAX_GOAL_DoneWithA1A2: - a0_color = ~a0_color; - /* restore "a0_color" to really meaning a0 color */ - if (a0_pos >= width) { - goal = ENCODE_FAX_GOAL_FinishLine; - } - else { - goal = ENCODE_FAX_GOAL_FindPositions; - } - break; - - case ENCODE_FAX_GOAL_VerticalMode: - - DEDUCE_Vcode(a1b1,rlcode,nbits); - - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - /* before picking next state, set new a0_position and - point indexes into 'count' and 'above' to the right - place. saved indexes help a lot here. - */ - a0a1 = a1_pos - a0_pos; - a0_pos = a1_pos; - - if (a1b1 > 0) { - /* b1 is to the right of a1. It is possible that - when we set a0' = a1, b1' will be left of b1: - - 0 1 2 3 4 - b1' b1 - O O 0 X 0 - O X O X - a0 a1 - a0' - - In the example above, b1 for the original a0 at 1 - is the X->O transition at 4. When a1 is coded, and - a1 becomes the new a0 (a0'), the O->X transition at - 3 is b1'. In other words, the progression of b1 is - *not* monotonic!! So we have to be careful... - - The condition under which backup is necessary is - when b1 is 2 or 3 to the right of a1, and there - was a transition just before b1, right of a1. To - get the next position on a line, we always take - - new_pos = old_pos + above[index++] - - Therefore, the previous position was - - old_pos = new_pos - above[index-1] - - We need to back up if above[index-1] < a1b1. - If we incremented index twice to get to b2, - then we have to consider above[index-2] - - */ - - /* things are simple if b1_pos was off the edge */ - if (b1_pos >= width && avals>=2 && above[avals-1] < a1b1) { - /* if b1_pos was off the edge, above[avals-1] */ - /* added to the previous b1 got us there. So */ - /* we get old b1 by subtracting above[avals-1] */ - b1_pos = width - above[avals-1]; - aindex = avals-2; - b1_color = ~b1_color; - } - else if (aindex >= 1 && above[aindex-1] < a1b1) { - b1_pos = b1_pos - above[aindex-1]; - /* note: we don't increment aindex after */ - /* computing b2_pos = b1_pos + above[aindex], */ - /* so above[aindex-1] is how we got b1_pos */ - aindex = aindex-1; - /* index for element before the b1 */ - b1_color = ~b1_color; - /* previous color */ - } - - } - else { - /* b1 is left of or over a1. - - 0 1 2 3 4 - b1 - O O X 0 - O X X X O X - a0 a1 - a0' - - Since the b1' for a0' must be to the right of a0'=a1, - b1' must be to the right of b1. However, if we set - our position to b2, we may go too far, so stay where - we are. Be coo'! - */ - - /* aindex was updated while seeking b2 */ - } - a0_color = ~a0_color; - --index; - /* in code above, we made sure we always increment index */ - /* after setting a2, even if a1 or a2 was off end of line */ - - if (bitpos >=8) - goal = ENCODE_FAX_GOAL_Flush2DStager; - else { - if (a0_pos >= width) { - goal = ENCODE_FAX_GOAL_FinishLine; - } - else { - goal = ENCODE_FAX_GOAL_FindPositions; - } - } - break; - - case ENCODE_FAX_GOAL_Flush2DStager: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - - if (bitpos >= 8) { - /* go around the loop again, trying to flush more */ - break; - } - /* if here, we have flushed stager to the point there is */ - /* at most a partial byte of data left in it. */ - if (a0_pos >= width) { - goal = ENCODE_FAX_GOAL_FinishLine; - } - else { - goal = ENCODE_FAX_GOAL_FindPositions; - } - break; - - default: - state->encoder_done = ENCODE_ERROR_BadMagic; - save_state_and_return(state); - - } /* end of switch(goal) in main decoding loop */ - - } /* end of main encoding loop */ -} -/************************************************************************/ Index: xc/programs/Xserver/XIE/mixie/fax/etiff2.c diff -u xc/programs/Xserver/XIE/mixie/fax/etiff2.c:1.2 xc/programs/Xserver/XIE/mixie/fax/etiff2.c:removed --- xc/programs/Xserver/XIE/mixie/fax/etiff2.c:1.2 Fri Dec 14 14:58:24 2001 +++ xc/programs/Xserver/XIE/mixie/fax/etiff2.c Sat Feb 28 21:41:58 2004 @@ -1,407 +0,0 @@ -/* $Xorg: etiff2.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module etiff2.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - etiff2.c -- DDXIE module for encoding tiff2 format - - Ben Fahy, AGE Logic, Sept 1993 - -******************************************************************************/ - -#include "fax.h" -#define _TIFF2 -#include "fencode.h" -#include "xiemd.h" -#define FETABS_OWNER -#include "fetabs.h" - -/************************************************************************/ -encode_tiff2(state) -FaxEncodeState *state; -{ -/* stuff exchanged with state variable */ -register int goal; -register unsigned char *byteptr; -register unsigned char *endptr; -register int bitpos; -register int width; -register int stager; -int rl; -register int a0_color; -Tiff2EncodePvt *epvt; - -/* stuff exchanged with private state variable */ -register int index; -register int nvals; -register int *counts; -register int nbits; -int rlcode; -int terminating; -register int codelength; - -register int lines_coded=0; -register int lines_to_code=0; -int old_rl; - - if (state == (FaxEncodeState *) NULL) - return(-1); - - /* set up initial bitstream for the very first output strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->encoder_done = ENCODE_ERROR_StripStateNotNew; - return(-1); - } - - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - - state->bits.bitpos = 0; - state->bits.started = 1; - state->strip_state = StripStateInUse; - } - - /* or, reset bitstream for a new output strip */ - if (state->magic_needs) { - if (state->strip_state == StripStateNew) { - state->strip_state = StripStateInUse; - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - state->bits.started = 1; - } - else { - /* no new strip?? But... I *need* more data! */ - state->encoder_done = ENCODE_ERROR_BadMagic; - return(-1); - } - state->magic_needs = 0; - } - - localize_state(state); - - -/*** Main Encoding Loop ***/ - while (1) { - - switch(goal) { - - case ENCODE_FAX_GOAL_StartNewLine: - /* every new line we need to compute its runlength data */ - - if (lines_coded >= state->nl_tocode) { - /* We have read the whole input strip, need more data */ - save_state_and_return(state); - } - - /* get the sequence of white and black run lengths */ - nvals = encode_runs( - state->i_lines[lines_coded], /* input data */ - width, /* # of bits */ - counts, /* where to put lengths */ - state->radiometric, /* if 1, white is 1 */ - width - ); - if (nvals < 0) { - state->encoder_done = ENCODE_ERROR_EncodeRunsFailure; - save_state_and_return(state); - } - a0_color = WHITE; - index = 0; - a0_color = WHITE; - - case ENCODE_FAX_GOAL_OutputNextRunLength: - rl = counts[index++]; - old_rl = rl; - - case ENCODE_FAX_GOAL_DeduceCode: - nbits = deduce_code(a0_color,&rl,&rlcode,&terminating); - /* should be a macro but for now, a function */ - - /* shift code over so it merges with stager contents */ - stager |= (rlcode << (16-bitpos)); - bitpos += nbits; - - if (bitpos >=8) { - goal = ENCODE_FAX_GOAL_FlushStager; - break; - } - if (terminating) { - /* all done with this runlength */ - if (index < nvals) { - a0_color = ~a0_color; - goal = ENCODE_FAX_GOAL_OutputNextRunLength; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* go around the loop again */ - goal = ENCODE_FAX_GOAL_DeduceCode; - old_rl = rl; - break; - - case ENCODE_FAX_GOAL_FlushStager: - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* if here, we know it is safe to flush at least one byte */ - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos -= 8; - - if (bitpos >= 8) { - /* go around the loop again, trying to flush more */ - break; - } - /* if here, we have flushed stager to the point there is */ - /* at most a partial byte of data left in it. */ - if (terminating) { - /* all done with this runlength */ - if (index < nvals) { - a0_color = ~a0_color; - goal = ENCODE_FAX_GOAL_OutputNextRunLength; - break; - } - else { - goal = ENCODE_FAX_GOAL_FinishLine; - break; - } - } - /* not done with this runlength yet */ - goal = ENCODE_FAX_GOAL_DeduceCode; - break; - - case ENCODE_FAX_GOAL_FinishLine: - if (bitpos) { - /* have to flush stager */ - if (byteptr >= endptr) { - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - /* make sure nothing bogus is happening */ - if (bitpos > 8) { - state->encoder_done = ENCODE_ERROR_BadStager; - save_state_and_return(state); - } - - *byteptr++ = (stager&0xff000000) >> 24; - stager <<= 8; - bitpos = 0; - } - ++lines_coded; - goal = ENCODE_FAX_GOAL_StartNewLine; - break; - - default: - state->encoder_done = ENCODE_ERROR_BadMagic; - save_state_and_return(state); - break; - - } /* end of switch(goal) in main decoding loop */ - - } /* end of main encoding loop */ -} -/************************************************************************/ -int encode_runs(src,nbits,counts,white_is_one,width) -LogInt *src; -unsigned int *counts; -register int nbits; -register int white_is_one; -register int width; -{ -register unsigned int white_count=0,black_count=0; -register int i,current_is_white=1; -register int n_runs=0; -register int total=0; - -register LogInt test_bit = LOGLEFT; - /* LOGLEFT = the logically left-most bit in a word in */ - /* the server, we allways fill the logically left-most */ - /* bit in a word first, the logically right-most last */ - -/*** handle first bit differently than others ***/ - - if (white_is_one) { - for (i=0; i> 6)].code; - nbits = table[63 + (*rl >> 6)].nbits; - *rl %= 64; - } - else { - *terminating = 0; - *rlcode = table[63 + 2560/64].code; - nbits = table[63 + 2560/64].nbits; - *rl -= 2560; - } - return(nbits); -} -/************************************************************************/ Index: xc/programs/Xserver/XIE/mixie/fax/etiffpb.c diff -u xc/programs/Xserver/XIE/mixie/fax/etiffpb.c:1.2 xc/programs/Xserver/XIE/mixie/fax/etiffpb.c:removed --- xc/programs/Xserver/XIE/mixie/fax/etiffpb.c:1.2 Fri Dec 14 14:58:24 2001 +++ xc/programs/Xserver/XIE/mixie/fax/etiffpb.c Sat Feb 28 21:41:59 2004 @@ -1,381 +0,0 @@ -/* $Xorg: etiffpb.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module etiffpb.h ****/ -/****************************************************************************** - -Copyright 1993, 1994,1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - etiffpb.c -- DDXIE module for encoding TIFF PackBits format - - Ben Fahy, AGE Logic, Sept 1993 - -******************************************************************************/ - - -#include "fax.h" -#define _PBits -#include "fencode.h" -#include "xiemd.h" - -/************************************************************************/ -encode_tiffpb(state) -FaxEncodeState *state; -{ -/* stuff exchanged with state variable */ -register int goal; -register unsigned char *byteptr; -register unsigned char *endptr; -register int width; -register int rl; -PackBitsEncodePvt *epvt; - -/* stuff exchanged with private state variable */ -int index; -int start; -int nlits; -int nvals; -register int *counts; -register int *values; - - -register int lines_coded=0; -register int lines_to_code=0; -register int rlcode,lits_to_write; -register int bytes_out; - - if (state == (FaxEncodeState *) NULL) - return(-1); - - /* set up initial bitstream for the very first output strip */ - if (!state->bits.started) { - if (state->strip_state != StripStateNew) { - state->encoder_done = ENCODE_ERROR_StripStateNotNew; - return(-1); - } - - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - - state->bits.bitpos = 0; - state->bits.started = 1; - state->strip_state = StripStateInUse; - } - - /* or, reset bitstream for a new output strip */ - if (state->magic_needs) { - if (state->strip_state == StripStateNew) { - state->strip_state = StripStateInUse; - state->bits.byteptr = (unsigned char *)state->strip; - state->bits.endptr = state->bits.byteptr + state->strip_size; - /* record end of output strip */ - state->bits.bitpos = 0; - state->bits.started = 1; - } - else { - /* no new strip?? But... I *need* more data! */ - state->encoder_done = ENCODE_ERROR_BadMagic; - return(-1); - } - state->magic_needs = 0; - } - localize_state(state); - - -/*** Main Encoding Loop ***/ - while (1) { - - switch(goal) { - - case ENCODE_PB_GOAL_StartNewLine: - /* every new line we need to compute its runlength data */ - - { - register unsigned char *ibptr=NULL; - register unsigned char *ebptr=NULL; - register int color0,color1, n_reps; - - if (lines_coded >= state->nl_tocode) { - /* We have read the whole input strip, need more data */ - save_state_and_return(state); - } - - ibptr = (unsigned char *) state->i_lines[lines_coded]; - ebptr = ibptr+(width+7)/8; - -#if (IMAGE_BYTE_ORDER == MSBFirst) - color0 = *ibptr++; -#else - color0 = _ByteReverseTable[*ibptr++]; -#endif - n_reps = 1; - nvals = 0; - epvt->values[nvals] = color0; - - while (ibptr < ebptr) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - color1 = *ibptr++; -#else - color1 = _ByteReverseTable[*ibptr++]; -#endif - if (color1 == color0) ++n_reps; - else { - epvt->counts[nvals++] = n_reps; - color0 = color1; - n_reps = 1; - epvt->values[nvals] = color0; - } - } - epvt->counts[nvals++] = n_reps; - epvt->nvals = nvals; - - } - /* now that we have an encoding of the line in runlengths, - we need to decide what we write out as R V, where R - is the runlength and V is the value, vs L V1 V2 ... VL - where Vi are individual values and L is the number of - literal values that follow. There isn't really any - advantage to coding runlengths of size 2 or less, so - we will only code as a runlength for runs of 3 or more. - */ - index = 0; /* where we are in our list of runs and values */ - start = 0; /* where we were when we started */ - nlits = 0; /* number of literals we will concatenate */ - goal = ENCODE_PB_GOAL_OutputNextRunLength; - - case ENCODE_PB_GOAL_OutputNextRunLength: - /* starting from the current index, search for the first - runlength of three or more. Everything before then will - be encoded as a string of literals. - */ - - start = index; - while (index < nvals && (rl = counts[index]) < 3) { - nlits += rl; - ++index; - } - - if (start != index) { - /* Note: we can never call FlushLiterals when start >= nvals, - because index <= nvals, and start < index if here */ - goal = ENCODE_PB_GOAL_FlushLiterals; - } - else { - /* found a suitable runlength */ - goal = ENCODE_PB_GOAL_FlushRunLength; - } - break; - - case ENCODE_PB_GOAL_FlushRunLength: - if (!rl) { - state->encoder_done = ENCODE_ERROR_BadRunLength; - save_state_and_return(state); - } - /* Packbits represents runlengths as rl = 1 - rlcode, where */ - /* rlcode is a negative number between -1 and -127. So we */ - /* may have to break a number larger than 128 into multiple */ - /* runlengths */ - if (rl <= 128) { - rlcode = 1-rl; /* encode the runlength */ - rl = 0; - } - else { - rlcode = -127; /* encode the maximum */ - rl -= 128; - } - /* before writing, make sure we aren't off end of strip */ - if ( byteptr >= endptr) { - goal = ENCODE_PB_GOAL_WriteCodeForRunLength; - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - - case ENCODE_PB_GOAL_WriteCodeForRunLength: - *byteptr++ = rlcode; - - /* before writing, make sure we aren't off end of strip */ - if ( byteptr >= endptr) { - goal = ENCODE_PB_GOAL_WriteValueForRunLength; - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - case ENCODE_PB_GOAL_WriteValueForRunLength: - *byteptr++ = values[index]; - if (!rl) { - if (++index >= nvals) { /* see if done with line */ - ++lines_coded; - goal = ENCODE_PB_GOAL_StartNewLine; - } - else - goal = ENCODE_PB_GOAL_OutputNextRunLength; - } - else - goal = ENCODE_PB_GOAL_FlushRunLength; - break; - case ENCODE_PB_GOAL_FlushLiterals: - /* Packbits represents literal lengths as rl = 1 + rlcode, */ - /* rlcode is a number between 0 and 127. So we have to break */ - /* break numbers larger than 128 into multiple runlengths */ - if (nlits <= 128) { - rlcode = nlits-1; /* encode the runlength */ - nlits = 0; - } - else { - rlcode = 127; /* encode the maximum */ - nlits -= 128; - } - rl = 1 + rlcode; /* need this for comparison later */ - bytes_out = 0; /* ditto. bytes_out must be <= rl */ - - /* before writing, make sure we aren't off end of strip */ - if ( byteptr >= endptr) { - goal = ENCODE_PB_GOAL_WriteNlits; - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - - case ENCODE_PB_GOAL_WriteNlits: - *byteptr++ = rlcode; - goal = ENCODE_PB_GOAL_WriteLiterals; - /* note that lits_to_write is always 1 or 2 */ - - case ENCODE_PB_GOAL_WriteLiterals: - /* this is actually a loop. 'start' gets incremented each */ - /* time through until it is equal to 'index'. We never get */ - /* to this point unless start < nvals, though */ - - lits_to_write = counts[start]; - goal = ENCODE_PB_GOAL_WriteThisLiteral; - - case ENCODE_PB_GOAL_WriteThisLiteral: - /* before writing, make sure we aren't off end of strip */ - if ( byteptr >= endptr) { - goal = ENCODE_PB_GOAL_WriteTheLiteral; - state->strip_state = StripStateDone; - state->magic_needs = 1; - save_state_and_return(state); - } - - case ENCODE_PB_GOAL_WriteTheLiteral: - *byteptr++ = values[start]; - if (++bytes_out >= 128 && nlits) { - /* we have written the maximum amount we can */ - /* write at a time, yet we know there are more */ - /* to write out. */ - - goal = ENCODE_PB_GOAL_FlushLiterals; - - /* If we need to write current value some more, */ - /* change count so we don't write extra */ - - if (--lits_to_write) - counts[start] = lits_to_write; - else { - /* otherwise, advance position */ - ++start; - } - - /* note that we KNOW we have to write more literals */ - /* so it is safe to increment 'start', which could */ - /* only be equal to 'index' if we were done */ - - break; - } - else if (--lits_to_write) { - /* loop back and write this value again */ - goal = ENCODE_PB_GOAL_WriteThisLiteral; - break; - } - - /* If here, we are done with this literal */ - if (++start < index) { - /* if other literals to write, loop back */ - goal = ENCODE_PB_GOAL_WriteLiterals; - break; - } - - /* ok, we wrote out all the literals */ - - if (index >= nvals) { /* see if done with line */ - ++lines_coded; - goal = ENCODE_PB_GOAL_StartNewLine; - } - else - goal = ENCODE_PB_GOAL_OutputNextRunLength; - break; - - default: - state->encoder_done = ENCODE_ERROR_BadMagic; - save_state_and_return(state); - break; - - } /* end of switch(goal) in main decoding loop */ - - } /* end of main encoding loop */ -} -/************************************************************************/ - Index: xc/programs/Xserver/XIE/mixie/fax/faxint.h diff -u xc/programs/Xserver/XIE/mixie/fax/faxint.h:1.2 xc/programs/Xserver/XIE/mixie/fax/faxint.h:removed --- xc/programs/Xserver/XIE/mixie/fax/faxint.h:1.2 Fri Dec 14 14:58:24 2001 +++ xc/programs/Xserver/XIE/mixie/fax/faxint.h Sat Feb 28 21:41:59 2004 @@ -1,95 +0,0 @@ -/* $Xorg: faxint.h,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module fax/faxint.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/faxint.h -- DDXIE internal fax definitions - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - -/* this should correspond to what is in pretab.h, except for code entry */ -typedef struct _FaxTable { -short run_length; /* run length for this code */ -char makeup; /* 1 if this code is makeup */ -unsigned char n_bits; /* how many bits this code used */ -} WhiteTable,BlackTable; - -typedef struct _TwoDTable { - char mode; /* what to do next */ -unsigned char n_bits; /* how many bits this code used */ -} TwoDTable; - -#ifdef FAX_TABLE_OWNER -#include "faxtabs.h" /* initializes tables */ -#else -extern unsigned char _ByteReverseTable[]; -extern BlackTable _BlackFaxTable[]; -extern WhiteTable _WhiteFaxTable[]; -extern TwoDTable _TwoDFaxTable[]; -#endif - -/**** module fax/faxint.h ****/ Index: xc/programs/Xserver/XIE/mixie/fax/faxtabs.c diff -u xc/programs/Xserver/XIE/mixie/fax/faxtabs.c:1.2 xc/programs/Xserver/XIE/mixie/fax/faxtabs.c:removed --- xc/programs/Xserver/XIE/mixie/fax/faxtabs.c:1.2 Fri Dec 14 14:58:24 2001 +++ xc/programs/Xserver/XIE/mixie/fax/faxtabs.c Sat Feb 28 21:41:59 2004 @@ -1,78 +0,0 @@ -/* $Xorg: faxtabs.c,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module fax/faxtabs.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/faxtabs.c -- DDXIE fax decode data - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - -#include "fax.h" -#define FAX_TABLE_OWNER -#include "faxint.h" - -/**** module fax/faxtabs.c ****/ Index: xc/programs/Xserver/XIE/mixie/fax/faxtabs.h diff -u xc/programs/Xserver/XIE/mixie/fax/faxtabs.h:1.2 xc/programs/Xserver/XIE/mixie/fax/faxtabs.h:removed --- xc/programs/Xserver/XIE/mixie/fax/faxtabs.h:1.2 Fri Dec 14 14:58:24 2001 +++ xc/programs/Xserver/XIE/mixie/fax/faxtabs.h Sat Feb 28 21:41:59 2004 @@ -1,12630 +0,0 @@ -/* $Xorg: faxtabs.h,v 1.4 2001/02/09 02:04:25 xorgcvs Exp $ */ -/**** module fax/bits.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/bits.h -- DDXIE G4 fax bitstream management macros - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* faxtabs.h - generated by mktab */ - - - -/* two D mode table */ -TwoDTable _TwoDFaxTable[]= { - /* 0 = 0 */ { 0, 8}, /* 0x00 => 0x00+(1)*/ - /* 1 = 1 */ { 0, 0}, /* 0x00 => 0x00+(256)*/ - /* 2 = 2 */ { 0, 7}, /* 0x01 => 0x02+(2)*/ - /* 3 = 3 */ { 0, 7}, /* 0x01 => 0x02+(2)*/ - /* 4 = 4 */ { 3, 7}, /* 0x02 => 0x04+(2)*/ - /* 5 = 5 */ { 3, 7}, /* 0x02 => 0x04+(2)*/ - /* 6 = 6 */ { 9, 7}, /* 0x03 => 0x06+(2)*/ - /* 7 = 7 */ { 9, 7}, /* 0x03 => 0x06+(2)*/ - /* 8 = 8 */ { 4, 6}, /* 0x02 => 0x08+(4)*/ - /* 9 = 9 */ { 4, 6}, /* 0x02 => 0x08+(4)*/ - /* 10 = a */ { 4, 6}, /* 0x02 => 0x08+(4)*/ - /* 11 = b */ { 4, 6}, /* 0x02 => 0x08+(4)*/ - /* 12 = c */ { 8, 6}, /* 0x03 => 0x0c+(4)*/ - /* 13 = d */ { 8, 6}, /* 0x03 => 0x0c+(4)*/ - /* 14 = e */ { 8, 6}, /* 0x03 => 0x0c+(4)*/ - /* 15 = f */ { 8, 6}, /* 0x03 => 0x0c+(4)*/ - /* 16 = 10 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 17 = 11 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 18 = 12 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 19 = 13 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 20 = 14 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 21 = 15 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 22 = 16 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 23 = 17 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 24 = 18 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 25 = 19 */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 26 = 1a */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 27 = 1b */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 28 = 1c */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 29 = 1d */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 30 = 1e */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 31 = 1f */ { 1, 4}, /* 0x01 => 0x10+(16)*/ - /* 32 = 20 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 33 = 21 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 34 = 22 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 35 = 23 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 36 = 24 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 37 = 25 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 38 = 26 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 39 = 27 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 40 = 28 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 41 = 29 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 42 = 2a */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 43 = 2b */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 44 = 2c */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 45 = 2d */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 46 = 2e */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 47 = 2f */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 48 = 30 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 49 = 31 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 50 = 32 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 51 = 33 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 52 = 34 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 53 = 35 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 54 = 36 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 55 = 37 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 56 = 38 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 57 = 39 */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 58 = 3a */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 59 = 3b */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 60 = 3c */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 61 = 3d */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 62 = 3e */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 63 = 3f */ { 2, 3}, /* 0x01 => 0x20+(32)*/ - /* 64 = 40 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 65 = 41 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 66 = 42 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 67 = 43 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 68 = 44 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 69 = 45 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 70 = 46 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 71 = 47 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 72 = 48 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 73 = 49 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 74 = 4a */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 75 = 4b */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 76 = 4c */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 77 = 4d */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 78 = 4e */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 79 = 4f */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 80 = 50 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 81 = 51 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 82 = 52 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 83 = 53 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 84 = 54 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 85 = 55 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 86 = 56 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 87 = 57 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 88 = 58 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 89 = 59 */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 90 = 5a */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 91 = 5b */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 92 = 5c */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 93 = 5d */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 94 = 5e */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 95 = 5f */ { 5, 3}, /* 0x02 => 0x40+(32)*/ - /* 96 = 60 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 97 = 61 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 98 = 62 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 99 = 63 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 100 = 64 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 101 = 65 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 102 = 66 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 103 = 67 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 104 = 68 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 105 = 69 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 106 = 6a */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 107 = 6b */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 108 = 6c */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 109 = 6d */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 110 = 6e */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 111 = 6f */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 112 = 70 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 113 = 71 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 114 = 72 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 115 = 73 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 116 = 74 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 117 = 75 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 118 = 76 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 119 = 77 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 120 = 78 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 121 = 79 */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 122 = 7a */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 123 = 7b */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 124 = 7c */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 125 = 7d */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 126 = 7e */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 127 = 7f */ { 7, 3}, /* 0x03 => 0x60+(32)*/ - /* 128 = 80 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 129 = 81 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 130 = 82 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 131 = 83 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 132 = 84 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 133 = 85 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 134 = 86 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 135 = 87 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 136 = 88 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 137 = 89 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 138 = 8a */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 139 = 8b */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 140 = 8c */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 141 = 8d */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 142 = 8e */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 143 = 8f */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 144 = 90 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 145 = 91 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 146 = 92 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 147 = 93 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 148 = 94 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 149 = 95 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 150 = 96 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 151 = 97 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 152 = 98 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 153 = 99 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 154 = 9a */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 155 = 9b */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 156 = 9c */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 157 = 9d */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 158 = 9e */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 159 = 9f */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 160 = a0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 161 = a1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 162 = a2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 163 = a3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 164 = a4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 165 = a5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 166 = a6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 167 = a7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 168 = a8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 169 = a9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 170 = aa */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 171 = ab */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 172 = ac */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 173 = ad */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 174 = ae */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 175 = af */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 176 = b0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 177 = b1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 178 = b2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 179 = b3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 180 = b4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 181 = b5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 182 = b6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 183 = b7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 184 = b8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 185 = b9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 186 = ba */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 187 = bb */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 188 = bc */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 189 = bd */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 190 = be */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 191 = bf */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 192 = c0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 193 = c1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 194 = c2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 195 = c3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 196 = c4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 197 = c5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 198 = c6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 199 = c7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 200 = c8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 201 = c9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 202 = ca */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 203 = cb */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 204 = cc */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 205 = cd */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 206 = ce */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 207 = cf */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 208 = d0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 209 = d1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 210 = d2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 211 = d3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 212 = d4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 213 = d5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 214 = d6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 215 = d7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 216 = d8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 217 = d9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 218 = da */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 219 = db */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 220 = dc */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 221 = dd */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 222 = de */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 223 = df */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 224 = e0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 225 = e1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 226 = e2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 227 = e3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 228 = e4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 229 = e5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 230 = e6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 231 = e7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 232 = e8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 233 = e9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 234 = ea */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 235 = eb */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 236 = ec */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 237 = ed */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 238 = ee */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 239 = ef */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 240 = f0 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 241 = f1 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 242 = f2 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 243 = f3 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 244 = f4 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 245 = f5 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 246 = f6 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 247 = f7 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 248 = f8 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 249 = f9 */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 250 = fa */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 251 = fb */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 252 = fc */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 253 = fd */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 254 = fe */ { 6, 1}, /* 0x01 => 0x80+(128)*/ - /* 255 = ff */ { 6, 1}, /* 0x01 => 0x80+(128)*/ -}; -/* white table */ -WhiteTable _WhiteFaxTable[] = { - /* 0 = 0 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 1 = 1 */ {-2, 0, 12}, /* 0x0001 => 0x0001+(1)*/ - /* 2 = 2 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 3 = 3 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 4 = 4 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 5 = 5 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 6 = 6 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 7 = 7 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 8 = 8 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 9 = 9 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 10 = a */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 11 = b */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 12 = c */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 13 = d */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 14 = e */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 15 = f */ {-1, 0, 0}, /* 0x0000 => 0x0000+(4096)*/ - /* 16 = 10 */ {1792, 1, 11}, /* 0x0008 => 0x0010+(2)*/ - /* 17 = 11 */ {1792, 1, 11}, /* 0x0008 => 0x0010+(2)*/ - /* 18 = 12 */ {1984, 1, 12}, /* 0x0012 => 0x0012+(1)*/ - /* 19 = 13 */ {2048, 1, 12}, /* 0x0013 => 0x0013+(1)*/ - /* 20 = 14 */ {2112, 1, 12}, /* 0x0014 => 0x0014+(1)*/ - /* 21 = 15 */ {2176, 1, 12}, /* 0x0015 => 0x0015+(1)*/ - /* 22 = 16 */ {2240, 1, 12}, /* 0x0016 => 0x0016+(1)*/ - /* 23 = 17 */ {2304, 1, 12}, /* 0x0017 => 0x0017+(1)*/ - /* 24 = 18 */ {1856, 1, 11}, /* 0x000c => 0x0018+(2)*/ - /* 25 = 19 */ {1856, 1, 11}, /* 0x000c => 0x0018+(2)*/ - /* 26 = 1a */ {1920, 1, 11}, /* 0x000d => 0x001a+(2)*/ - /* 27 = 1b */ {1920, 1, 11}, /* 0x000d => 0x001a+(2)*/ - /* 28 = 1c */ {2368, 1, 12}, /* 0x001c => 0x001c+(1)*/ - /* 29 = 1d */ {2432, 1, 12}, /* 0x001d => 0x001d+(1)*/ - /* 30 = 1e */ {2496, 1, 12}, /* 0x001e => 0x001e+(1)*/ - /* 31 = 1f */ {2560, 1, 12}, /* 0x001f => 0x001f+(1)*/ - /* 32 = 20 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 33 = 21 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 34 = 22 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 35 = 23 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 36 = 24 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 37 = 25 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 38 = 26 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 39 = 27 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 40 = 28 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 41 = 29 */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 42 = 2a */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 43 = 2b */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 44 = 2c */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 45 = 2d */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 46 = 2e */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 47 = 2f */ {29, 0, 8}, /* 0x0002 => 0x0020+(16)*/ - /* 48 = 30 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 49 = 31 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 50 = 32 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 51 = 33 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 52 = 34 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 53 = 35 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 54 = 36 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 55 = 37 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 56 = 38 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 57 = 39 */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 58 = 3a */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 59 = 3b */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 60 = 3c */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 61 = 3d */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 62 = 3e */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 63 = 3f */ {30, 0, 8}, /* 0x0003 => 0x0030+(16)*/ - /* 64 = 40 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 65 = 41 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 66 = 42 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 67 = 43 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 68 = 44 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 69 = 45 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 70 = 46 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 71 = 47 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 72 = 48 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 73 = 49 */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 74 = 4a */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 75 = 4b */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 76 = 4c */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 77 = 4d */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 78 = 4e */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 79 = 4f */ {45, 0, 8}, /* 0x0004 => 0x0040+(16)*/ - /* 80 = 50 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 81 = 51 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 82 = 52 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 83 = 53 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 84 = 54 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 85 = 55 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 86 = 56 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 87 = 57 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 88 = 58 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 89 = 59 */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 90 = 5a */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 91 = 5b */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 92 = 5c */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 93 = 5d */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 94 = 5e */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 95 = 5f */ {46, 0, 8}, /* 0x0005 => 0x0050+(16)*/ - /* 96 = 60 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 97 = 61 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 98 = 62 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 99 = 63 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 100 = 64 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 101 = 65 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 102 = 66 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 103 = 67 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 104 = 68 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 105 = 69 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 106 = 6a */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 107 = 6b */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 108 = 6c */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 109 = 6d */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 110 = 6e */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 111 = 6f */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 112 = 70 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 113 = 71 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 114 = 72 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 115 = 73 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 116 = 74 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 117 = 75 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 118 = 76 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 119 = 77 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 120 = 78 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 121 = 79 */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 122 = 7a */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 123 = 7b */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 124 = 7c */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 125 = 7d */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 126 = 7e */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 127 = 7f */ {22, 0, 7}, /* 0x0003 => 0x0060+(32)*/ - /* 128 = 80 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 129 = 81 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 130 = 82 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 131 = 83 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 132 = 84 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 133 = 85 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 134 = 86 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 135 = 87 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 136 = 88 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 137 = 89 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 138 = 8a */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 139 = 8b */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 140 = 8c */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 141 = 8d */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 142 = 8e */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 143 = 8f */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 144 = 90 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 145 = 91 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 146 = 92 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 147 = 93 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 148 = 94 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 149 = 95 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 150 = 96 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 151 = 97 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 152 = 98 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 153 = 99 */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 154 = 9a */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 155 = 9b */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 156 = 9c */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 157 = 9d */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 158 = 9e */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 159 = 9f */ {23, 0, 7}, /* 0x0004 => 0x0080+(32)*/ - /* 160 = a0 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 161 = a1 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 162 = a2 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 163 = a3 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 164 = a4 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 165 = a5 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 166 = a6 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 167 = a7 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 168 = a8 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 169 = a9 */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 170 = aa */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 171 = ab */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 172 = ac */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 173 = ad */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 174 = ae */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 175 = af */ {47, 0, 8}, /* 0x000a => 0x00a0+(16)*/ - /* 176 = b0 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 177 = b1 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 178 = b2 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 179 = b3 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 180 = b4 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 181 = b5 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 182 = b6 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 183 = b7 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 184 = b8 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 185 = b9 */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 186 = ba */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 187 = bb */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 188 = bc */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 189 = bd */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 190 = be */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 191 = bf */ {48, 0, 8}, /* 0x000b => 0x00b0+(16)*/ - /* 192 = c0 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 193 = c1 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 194 = c2 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 195 = c3 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 196 = c4 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 197 = c5 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 198 = c6 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 199 = c7 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 200 = c8 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 201 = c9 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 202 = ca */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 203 = cb */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 204 = cc */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 205 = cd */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 206 = ce */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 207 = cf */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 208 = d0 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 209 = d1 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 210 = d2 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 211 = d3 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 212 = d4 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 213 = d5 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 214 = d6 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 215 = d7 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 216 = d8 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 217 = d9 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 218 = da */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 219 = db */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 220 = dc */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 221 = dd */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 222 = de */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 223 = df */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 224 = e0 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 225 = e1 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 226 = e2 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 227 = e3 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 228 = e4 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 229 = e5 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 230 = e6 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 231 = e7 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 232 = e8 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 233 = e9 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 234 = ea */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 235 = eb */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 236 = ec */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 237 = ed */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 238 = ee */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 239 = ef */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 240 = f0 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 241 = f1 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 242 = f2 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 243 = f3 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 244 = f4 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 245 = f5 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 246 = f6 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 247 = f7 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 248 = f8 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 249 = f9 */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 250 = fa */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 251 = fb */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 252 = fc */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 253 = fd */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 254 = fe */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 255 = ff */ {13, 0, 6}, /* 0x0003 => 0x00c0+(64)*/ - /* 256 = 100 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 257 = 101 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 258 = 102 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 259 = 103 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 260 = 104 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 261 = 105 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 262 = 106 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 263 = 107 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 264 = 108 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 265 = 109 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 266 = 10a */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 267 = 10b */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 268 = 10c */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 269 = 10d */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 270 = 10e */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 271 = 10f */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 272 = 110 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 273 = 111 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 274 = 112 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 275 = 113 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 276 = 114 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 277 = 115 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 278 = 116 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 279 = 117 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 280 = 118 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 281 = 119 */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 282 = 11a */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 283 = 11b */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 284 = 11c */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 285 = 11d */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 286 = 11e */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 287 = 11f */ {20, 0, 7}, /* 0x0008 => 0x0100+(32)*/ - /* 288 = 120 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 289 = 121 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 290 = 122 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 291 = 123 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 292 = 124 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 293 = 125 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 294 = 126 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 295 = 127 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 296 = 128 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 297 = 129 */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 298 = 12a */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 299 = 12b */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 300 = 12c */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 301 = 12d */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 302 = 12e */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 303 = 12f */ {33, 0, 8}, /* 0x0012 => 0x0120+(16)*/ - /* 304 = 130 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 305 = 131 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 306 = 132 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 307 = 133 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 308 = 134 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 309 = 135 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 310 = 136 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 311 = 137 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 312 = 138 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 313 = 139 */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 314 = 13a */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 315 = 13b */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 316 = 13c */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 317 = 13d */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 318 = 13e */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 319 = 13f */ {34, 0, 8}, /* 0x0013 => 0x0130+(16)*/ - /* 320 = 140 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 321 = 141 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 322 = 142 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 323 = 143 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 324 = 144 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 325 = 145 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 326 = 146 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 327 = 147 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 328 = 148 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 329 = 149 */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 330 = 14a */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 331 = 14b */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 332 = 14c */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 333 = 14d */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 334 = 14e */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 335 = 14f */ {35, 0, 8}, /* 0x0014 => 0x0140+(16)*/ - /* 336 = 150 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 337 = 151 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 338 = 152 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 339 = 153 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 340 = 154 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 341 = 155 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 342 = 156 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 343 = 157 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 344 = 158 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 345 = 159 */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 346 = 15a */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 347 = 15b */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 348 = 15c */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 349 = 15d */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 350 = 15e */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 351 = 15f */ {36, 0, 8}, /* 0x0015 => 0x0150+(16)*/ - /* 352 = 160 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 353 = 161 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 354 = 162 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 355 = 163 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 356 = 164 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 357 = 165 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 358 = 166 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 359 = 167 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 360 = 168 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 361 = 169 */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 362 = 16a */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 363 = 16b */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 364 = 16c */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 365 = 16d */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 366 = 16e */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 367 = 16f */ {37, 0, 8}, /* 0x0016 => 0x0160+(16)*/ - /* 368 = 170 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 369 = 171 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 370 = 172 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 371 = 173 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 372 = 174 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 373 = 175 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 374 = 176 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 375 = 177 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 376 = 178 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 377 = 179 */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 378 = 17a */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 379 = 17b */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 380 = 17c */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 381 = 17d */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 382 = 17e */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 383 = 17f */ {38, 0, 8}, /* 0x0017 => 0x0170+(16)*/ - /* 384 = 180 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 385 = 181 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 386 = 182 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 387 = 183 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 388 = 184 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 389 = 185 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 390 = 186 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 391 = 187 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 392 = 188 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 393 = 189 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 394 = 18a */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 395 = 18b */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 396 = 18c */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 397 = 18d */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 398 = 18e */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 399 = 18f */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 400 = 190 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 401 = 191 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 402 = 192 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 403 = 193 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 404 = 194 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 405 = 195 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 406 = 196 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 407 = 197 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 408 = 198 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 409 = 199 */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 410 = 19a */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 411 = 19b */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 412 = 19c */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 413 = 19d */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 414 = 19e */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 415 = 19f */ {19, 0, 7}, /* 0x000c => 0x0180+(32)*/ - /* 416 = 1a0 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 417 = 1a1 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 418 = 1a2 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 419 = 1a3 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 420 = 1a4 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 421 = 1a5 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 422 = 1a6 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 423 = 1a7 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 424 = 1a8 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 425 = 1a9 */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 426 = 1aa */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 427 = 1ab */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 428 = 1ac */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 429 = 1ad */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 430 = 1ae */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 431 = 1af */ {31, 0, 8}, /* 0x001a => 0x01a0+(16)*/ - /* 432 = 1b0 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 433 = 1b1 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 434 = 1b2 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 435 = 1b3 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 436 = 1b4 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 437 = 1b5 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 438 = 1b6 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 439 = 1b7 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 440 = 1b8 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 441 = 1b9 */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 442 = 1ba */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 443 = 1bb */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 444 = 1bc */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 445 = 1bd */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 446 = 1be */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 447 = 1bf */ {32, 0, 8}, /* 0x001b => 0x01b0+(16)*/ - /* 448 = 1c0 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 449 = 1c1 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 450 = 1c2 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 451 = 1c3 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 452 = 1c4 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 453 = 1c5 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 454 = 1c6 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 455 = 1c7 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 456 = 1c8 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 457 = 1c9 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 458 = 1ca */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 459 = 1cb */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 460 = 1cc */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 461 = 1cd */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 462 = 1ce */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 463 = 1cf */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 464 = 1d0 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 465 = 1d1 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 466 = 1d2 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 467 = 1d3 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 468 = 1d4 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 469 = 1d5 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 470 = 1d6 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 471 = 1d7 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 472 = 1d8 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 473 = 1d9 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 474 = 1da */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 475 = 1db */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 476 = 1dc */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 477 = 1dd */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 478 = 1de */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 479 = 1df */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 480 = 1e0 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 481 = 1e1 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 482 = 1e2 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 483 = 1e3 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 484 = 1e4 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 485 = 1e5 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 486 = 1e6 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 487 = 1e7 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 488 = 1e8 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 489 = 1e9 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 490 = 1ea */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 491 = 1eb */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 492 = 1ec */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 493 = 1ed */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 494 = 1ee */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 495 = 1ef */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 496 = 1f0 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 497 = 1f1 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 498 = 1f2 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 499 = 1f3 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 500 = 1f4 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 501 = 1f5 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 502 = 1f6 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 503 = 1f7 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 504 = 1f8 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 505 = 1f9 */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 506 = 1fa */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 507 = 1fb */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 508 = 1fc */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 509 = 1fd */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 510 = 1fe */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 511 = 1ff */ {1, 0, 6}, /* 0x0007 => 0x01c0+(64)*/ - /* 512 = 200 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 513 = 201 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 514 = 202 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 515 = 203 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 516 = 204 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 517 = 205 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 518 = 206 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 519 = 207 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 520 = 208 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 521 = 209 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 522 = 20a */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 523 = 20b */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 524 = 20c */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 525 = 20d */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 526 = 20e */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 527 = 20f */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 528 = 210 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 529 = 211 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 530 = 212 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 531 = 213 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 532 = 214 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 533 = 215 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 534 = 216 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 535 = 217 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 536 = 218 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 537 = 219 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 538 = 21a */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 539 = 21b */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 540 = 21c */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 541 = 21d */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 542 = 21e */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 543 = 21f */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 544 = 220 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 545 = 221 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 546 = 222 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 547 = 223 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 548 = 224 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 549 = 225 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 550 = 226 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 551 = 227 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 552 = 228 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 553 = 229 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 554 = 22a */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 555 = 22b */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 556 = 22c */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 557 = 22d */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 558 = 22e */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 559 = 22f */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 560 = 230 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 561 = 231 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 562 = 232 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 563 = 233 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 564 = 234 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 565 = 235 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 566 = 236 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 567 = 237 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 568 = 238 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 569 = 239 */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 570 = 23a */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 571 = 23b */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 572 = 23c */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 573 = 23d */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 574 = 23e */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 575 = 23f */ {12, 0, 6}, /* 0x0008 => 0x0200+(64)*/ - /* 576 = 240 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 577 = 241 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 578 = 242 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 579 = 243 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 580 = 244 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 581 = 245 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 582 = 246 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 583 = 247 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 584 = 248 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 585 = 249 */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 586 = 24a */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 587 = 24b */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 588 = 24c */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 589 = 24d */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 590 = 24e */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 591 = 24f */ {53, 0, 8}, /* 0x0024 => 0x0240+(16)*/ - /* 592 = 250 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 593 = 251 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 594 = 252 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 595 = 253 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 596 = 254 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 597 = 255 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 598 = 256 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 599 = 257 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 600 = 258 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 601 = 259 */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 602 = 25a */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 603 = 25b */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 604 = 25c */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 605 = 25d */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 606 = 25e */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 607 = 25f */ {54, 0, 8}, /* 0x0025 => 0x0250+(16)*/ - /* 608 = 260 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 609 = 261 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 610 = 262 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 611 = 263 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 612 = 264 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 613 = 265 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 614 = 266 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 615 = 267 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 616 = 268 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 617 = 269 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 618 = 26a */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 619 = 26b */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 620 = 26c */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 621 = 26d */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 622 = 26e */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 623 = 26f */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 624 = 270 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 625 = 271 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 626 = 272 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 627 = 273 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 628 = 274 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 629 = 275 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 630 = 276 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 631 = 277 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 632 = 278 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 633 = 279 */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 634 = 27a */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 635 = 27b */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 636 = 27c */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 637 = 27d */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 638 = 27e */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 639 = 27f */ {26, 0, 7}, /* 0x0013 => 0x0260+(32)*/ - /* 640 = 280 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 641 = 281 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 642 = 282 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 643 = 283 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 644 = 284 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 645 = 285 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 646 = 286 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 647 = 287 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 648 = 288 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 649 = 289 */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 650 = 28a */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 651 = 28b */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 652 = 28c */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 653 = 28d */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 654 = 28e */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 655 = 28f */ {39, 0, 8}, /* 0x0028 => 0x0280+(16)*/ - /* 656 = 290 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 657 = 291 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 658 = 292 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 659 = 293 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 660 = 294 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 661 = 295 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 662 = 296 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 663 = 297 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 664 = 298 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 665 = 299 */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 666 = 29a */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 667 = 29b */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 668 = 29c */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 669 = 29d */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 670 = 29e */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 671 = 29f */ {40, 0, 8}, /* 0x0029 => 0x0290+(16)*/ - /* 672 = 2a0 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 673 = 2a1 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 674 = 2a2 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 675 = 2a3 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 676 = 2a4 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 677 = 2a5 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 678 = 2a6 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 679 = 2a7 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 680 = 2a8 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 681 = 2a9 */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 682 = 2aa */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 683 = 2ab */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 684 = 2ac */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 685 = 2ad */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 686 = 2ae */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 687 = 2af */ {41, 0, 8}, /* 0x002a => 0x02a0+(16)*/ - /* 688 = 2b0 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 689 = 2b1 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 690 = 2b2 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 691 = 2b3 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 692 = 2b4 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 693 = 2b5 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 694 = 2b6 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 695 = 2b7 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 696 = 2b8 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 697 = 2b9 */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 698 = 2ba */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 699 = 2bb */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 700 = 2bc */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 701 = 2bd */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 702 = 2be */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 703 = 2bf */ {42, 0, 8}, /* 0x002b => 0x02b0+(16)*/ - /* 704 = 2c0 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 705 = 2c1 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 706 = 2c2 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 707 = 2c3 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 708 = 2c4 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 709 = 2c5 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 710 = 2c6 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 711 = 2c7 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 712 = 2c8 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 713 = 2c9 */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 714 = 2ca */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 715 = 2cb */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 716 = 2cc */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 717 = 2cd */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 718 = 2ce */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 719 = 2cf */ {43, 0, 8}, /* 0x002c => 0x02c0+(16)*/ - /* 720 = 2d0 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 721 = 2d1 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 722 = 2d2 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 723 = 2d3 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 724 = 2d4 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 725 = 2d5 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 726 = 2d6 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 727 = 2d7 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 728 = 2d8 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 729 = 2d9 */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 730 = 2da */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 731 = 2db */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 732 = 2dc */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 733 = 2dd */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 734 = 2de */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 735 = 2df */ {44, 0, 8}, /* 0x002d => 0x02d0+(16)*/ - /* 736 = 2e0 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 737 = 2e1 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 738 = 2e2 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 739 = 2e3 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 740 = 2e4 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 741 = 2e5 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 742 = 2e6 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 743 = 2e7 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 744 = 2e8 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 745 = 2e9 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 746 = 2ea */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 747 = 2eb */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 748 = 2ec */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 749 = 2ed */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 750 = 2ee */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 751 = 2ef */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 752 = 2f0 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 753 = 2f1 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 754 = 2f2 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 755 = 2f3 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 756 = 2f4 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 757 = 2f5 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 758 = 2f6 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 759 = 2f7 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 760 = 2f8 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 761 = 2f9 */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 762 = 2fa */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 763 = 2fb */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 764 = 2fc */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 765 = 2fd */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 766 = 2fe */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 767 = 2ff */ {21, 0, 7}, /* 0x0017 => 0x02e0+(32)*/ - /* 768 = 300 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 769 = 301 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 770 = 302 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 771 = 303 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 772 = 304 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 773 = 305 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 774 = 306 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 775 = 307 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 776 = 308 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 777 = 309 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 778 = 30a */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 779 = 30b */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 780 = 30c */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 781 = 30d */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 782 = 30e */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 783 = 30f */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 784 = 310 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 785 = 311 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 786 = 312 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 787 = 313 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 788 = 314 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 789 = 315 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 790 = 316 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 791 = 317 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 792 = 318 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 793 = 319 */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 794 = 31a */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 795 = 31b */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 796 = 31c */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 797 = 31d */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 798 = 31e */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 799 = 31f */ {28, 0, 7}, /* 0x0018 => 0x0300+(32)*/ - /* 800 = 320 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 801 = 321 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 802 = 322 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 803 = 323 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 804 = 324 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 805 = 325 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 806 = 326 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 807 = 327 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 808 = 328 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 809 = 329 */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 810 = 32a */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 811 = 32b */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 812 = 32c */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 813 = 32d */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 814 = 32e */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 815 = 32f */ {61, 0, 8}, /* 0x0032 => 0x0320+(16)*/ - /* 816 = 330 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 817 = 331 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 818 = 332 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 819 = 333 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 820 = 334 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 821 = 335 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 822 = 336 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 823 = 337 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 824 = 338 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 825 = 339 */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 826 = 33a */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 827 = 33b */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 828 = 33c */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 829 = 33d */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 830 = 33e */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 831 = 33f */ {62, 0, 8}, /* 0x0033 => 0x0330+(16)*/ - /* 832 = 340 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 833 = 341 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 834 = 342 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 835 = 343 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 836 = 344 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 837 = 345 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 838 = 346 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 839 = 347 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 840 = 348 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 841 = 349 */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 842 = 34a */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 843 = 34b */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 844 = 34c */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 845 = 34d */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 846 = 34e */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 847 = 34f */ {63, 0, 8}, /* 0x0034 => 0x0340+(16)*/ - /* 848 = 350 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 849 = 351 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 850 = 352 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 851 = 353 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 852 = 354 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 853 = 355 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 854 = 356 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 855 = 357 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 856 = 358 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 857 = 359 */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 858 = 35a */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 859 = 35b */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 860 = 35c */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 861 = 35d */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 862 = 35e */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 863 = 35f */ {0, 0, 8}, /* 0x0035 => 0x0350+(16)*/ - /* 864 = 360 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 865 = 361 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 866 = 362 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 867 = 363 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 868 = 364 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 869 = 365 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 870 = 366 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 871 = 367 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 872 = 368 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 873 = 369 */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 874 = 36a */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 875 = 36b */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 876 = 36c */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 877 = 36d */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 878 = 36e */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 879 = 36f */ {320, 1, 8}, /* 0x0036 => 0x0360+(16)*/ - /* 880 = 370 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 881 = 371 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 882 = 372 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 883 = 373 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 884 = 374 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 885 = 375 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 886 = 376 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 887 = 377 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 888 = 378 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 889 = 379 */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 890 = 37a */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 891 = 37b */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 892 = 37c */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 893 = 37d */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 894 = 37e */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 895 = 37f */ {384, 1, 8}, /* 0x0037 => 0x0370+(16)*/ - /* 896 = 380 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 897 = 381 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 898 = 382 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 899 = 383 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 900 = 384 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 901 = 385 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 902 = 386 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 903 = 387 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 904 = 388 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 905 = 389 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 906 = 38a */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 907 = 38b */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 908 = 38c */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 909 = 38d */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 910 = 38e */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 911 = 38f */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 912 = 390 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 913 = 391 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 914 = 392 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 915 = 393 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 916 = 394 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 917 = 395 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 918 = 396 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 919 = 397 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 920 = 398 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 921 = 399 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 922 = 39a */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 923 = 39b */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 924 = 39c */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 925 = 39d */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 926 = 39e */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 927 = 39f */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 928 = 3a0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 929 = 3a1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 930 = 3a2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 931 = 3a3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 932 = 3a4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 933 = 3a5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 934 = 3a6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 935 = 3a7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 936 = 3a8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 937 = 3a9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 938 = 3aa */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 939 = 3ab */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 940 = 3ac */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 941 = 3ad */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 942 = 3ae */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 943 = 3af */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 944 = 3b0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 945 = 3b1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 946 = 3b2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 947 = 3b3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 948 = 3b4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 949 = 3b5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 950 = 3b6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 951 = 3b7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 952 = 3b8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 953 = 3b9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 954 = 3ba */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 955 = 3bb */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 956 = 3bc */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 957 = 3bd */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 958 = 3be */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 959 = 3bf */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 960 = 3c0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 961 = 3c1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 962 = 3c2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 963 = 3c3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 964 = 3c4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 965 = 3c5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 966 = 3c6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 967 = 3c7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 968 = 3c8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 969 = 3c9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 970 = 3ca */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 971 = 3cb */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 972 = 3cc */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 973 = 3cd */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 974 = 3ce */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 975 = 3cf */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 976 = 3d0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 977 = 3d1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 978 = 3d2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 979 = 3d3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 980 = 3d4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 981 = 3d5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 982 = 3d6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 983 = 3d7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 984 = 3d8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 985 = 3d9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 986 = 3da */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 987 = 3db */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 988 = 3dc */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 989 = 3dd */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 990 = 3de */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 991 = 3df */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 992 = 3e0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 993 = 3e1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 994 = 3e2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 995 = 3e3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 996 = 3e4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 997 = 3e5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 998 = 3e6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 999 = 3e7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1000 = 3e8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1001 = 3e9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1002 = 3ea */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1003 = 3eb */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1004 = 3ec */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1005 = 3ed */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1006 = 3ee */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1007 = 3ef */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1008 = 3f0 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1009 = 3f1 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1010 = 3f2 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1011 = 3f3 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1012 = 3f4 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1013 = 3f5 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1014 = 3f6 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1015 = 3f7 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1016 = 3f8 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1017 = 3f9 */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1018 = 3fa */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1019 = 3fb */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1020 = 3fc */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1021 = 3fd */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1022 = 3fe */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1023 = 3ff */ {10, 0, 5}, /* 0x0007 => 0x0380+(128)*/ - /* 1024 = 400 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1025 = 401 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1026 = 402 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1027 = 403 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1028 = 404 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1029 = 405 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1030 = 406 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1031 = 407 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1032 = 408 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1033 = 409 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1034 = 40a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1035 = 40b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1036 = 40c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1037 = 40d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1038 = 40e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1039 = 40f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1040 = 410 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1041 = 411 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1042 = 412 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1043 = 413 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1044 = 414 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1045 = 415 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1046 = 416 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1047 = 417 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1048 = 418 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1049 = 419 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1050 = 41a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1051 = 41b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1052 = 41c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1053 = 41d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1054 = 41e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1055 = 41f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1056 = 420 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1057 = 421 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1058 = 422 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1059 = 423 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1060 = 424 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1061 = 425 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1062 = 426 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1063 = 427 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1064 = 428 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1065 = 429 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1066 = 42a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1067 = 42b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1068 = 42c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1069 = 42d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1070 = 42e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1071 = 42f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1072 = 430 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1073 = 431 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1074 = 432 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1075 = 433 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1076 = 434 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1077 = 435 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1078 = 436 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1079 = 437 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1080 = 438 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1081 = 439 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1082 = 43a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1083 = 43b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1084 = 43c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1085 = 43d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1086 = 43e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1087 = 43f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1088 = 440 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1089 = 441 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1090 = 442 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1091 = 443 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1092 = 444 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1093 = 445 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1094 = 446 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1095 = 447 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1096 = 448 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1097 = 449 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1098 = 44a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1099 = 44b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1100 = 44c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1101 = 44d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1102 = 44e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1103 = 44f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1104 = 450 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1105 = 451 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1106 = 452 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1107 = 453 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1108 = 454 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1109 = 455 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1110 = 456 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1111 = 457 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1112 = 458 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1113 = 459 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1114 = 45a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1115 = 45b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1116 = 45c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1117 = 45d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1118 = 45e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1119 = 45f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1120 = 460 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1121 = 461 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1122 = 462 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1123 = 463 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1124 = 464 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1125 = 465 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1126 = 466 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1127 = 467 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1128 = 468 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1129 = 469 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1130 = 46a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1131 = 46b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1132 = 46c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1133 = 46d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1134 = 46e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1135 = 46f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1136 = 470 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1137 = 471 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1138 = 472 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1139 = 473 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1140 = 474 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1141 = 475 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1142 = 476 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1143 = 477 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1144 = 478 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1145 = 479 */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1146 = 47a */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1147 = 47b */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1148 = 47c */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1149 = 47d */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1150 = 47e */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1151 = 47f */ {11, 0, 5}, /* 0x0008 => 0x0400+(128)*/ - /* 1152 = 480 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1153 = 481 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1154 = 482 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1155 = 483 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1156 = 484 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1157 = 485 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1158 = 486 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1159 = 487 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1160 = 488 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1161 = 489 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1162 = 48a */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1163 = 48b */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1164 = 48c */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1165 = 48d */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1166 = 48e */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1167 = 48f */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1168 = 490 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1169 = 491 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1170 = 492 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1171 = 493 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1172 = 494 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1173 = 495 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1174 = 496 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1175 = 497 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1176 = 498 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1177 = 499 */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1178 = 49a */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1179 = 49b */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1180 = 49c */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1181 = 49d */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1182 = 49e */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1183 = 49f */ {27, 0, 7}, /* 0x0024 => 0x0480+(32)*/ - /* 1184 = 4a0 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1185 = 4a1 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1186 = 4a2 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1187 = 4a3 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1188 = 4a4 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1189 = 4a5 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1190 = 4a6 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1191 = 4a7 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1192 = 4a8 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1193 = 4a9 */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1194 = 4aa */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1195 = 4ab */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1196 = 4ac */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1197 = 4ad */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1198 = 4ae */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1199 = 4af */ {59, 0, 8}, /* 0x004a => 0x04a0+(16)*/ - /* 1200 = 4b0 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1201 = 4b1 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1202 = 4b2 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1203 = 4b3 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1204 = 4b4 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1205 = 4b5 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1206 = 4b6 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1207 = 4b7 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1208 = 4b8 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1209 = 4b9 */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1210 = 4ba */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1211 = 4bb */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1212 = 4bc */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1213 = 4bd */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1214 = 4be */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1215 = 4bf */ {60, 0, 8}, /* 0x004b => 0x04b0+(16)*/ - /* 1216 = 4c0 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1217 = 4c1 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1218 = 4c2 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1219 = 4c3 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1220 = 4c4 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1221 = 4c5 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1222 = 4c6 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1223 = 4c7 */ {1472, 1, 9}, /* 0x0098 => 0x04c0+(8)*/ - /* 1224 = 4c8 */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1225 = 4c9 */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1226 = 4ca */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1227 = 4cb */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1228 = 4cc */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1229 = 4cd */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1230 = 4ce */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1231 = 4cf */ {1536, 1, 9}, /* 0x0099 => 0x04c8+(8)*/ - /* 1232 = 4d0 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1233 = 4d1 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1234 = 4d2 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1235 = 4d3 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1236 = 4d4 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1237 = 4d5 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1238 = 4d6 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1239 = 4d7 */ {1600, 1, 9}, /* 0x009a => 0x04d0+(8)*/ - /* 1240 = 4d8 */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1241 = 4d9 */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1242 = 4da */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1243 = 4db */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1244 = 4dc */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1245 = 4dd */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1246 = 4de */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1247 = 4df */ {1728, 1, 9}, /* 0x009b => 0x04d8+(8)*/ - /* 1248 = 4e0 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1249 = 4e1 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1250 = 4e2 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1251 = 4e3 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1252 = 4e4 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1253 = 4e5 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1254 = 4e6 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1255 = 4e7 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1256 = 4e8 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1257 = 4e9 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1258 = 4ea */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1259 = 4eb */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1260 = 4ec */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1261 = 4ed */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1262 = 4ee */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1263 = 4ef */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1264 = 4f0 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1265 = 4f1 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1266 = 4f2 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1267 = 4f3 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1268 = 4f4 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1269 = 4f5 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1270 = 4f6 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1271 = 4f7 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1272 = 4f8 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1273 = 4f9 */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1274 = 4fa */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1275 = 4fb */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1276 = 4fc */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1277 = 4fd */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1278 = 4fe */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1279 = 4ff */ {18, 0, 7}, /* 0x0027 => 0x04e0+(32)*/ - /* 1280 = 500 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1281 = 501 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1282 = 502 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1283 = 503 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1284 = 504 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1285 = 505 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1286 = 506 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1287 = 507 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1288 = 508 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1289 = 509 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1290 = 50a */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1291 = 50b */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1292 = 50c */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1293 = 50d */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1294 = 50e */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1295 = 50f */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1296 = 510 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1297 = 511 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1298 = 512 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1299 = 513 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1300 = 514 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1301 = 515 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1302 = 516 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1303 = 517 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1304 = 518 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1305 = 519 */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1306 = 51a */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1307 = 51b */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1308 = 51c */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1309 = 51d */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1310 = 51e */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1311 = 51f */ {24, 0, 7}, /* 0x0028 => 0x0500+(32)*/ - /* 1312 = 520 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1313 = 521 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1314 = 522 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1315 = 523 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1316 = 524 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1317 = 525 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1318 = 526 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1319 = 527 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1320 = 528 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1321 = 529 */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1322 = 52a */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1323 = 52b */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1324 = 52c */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1325 = 52d */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1326 = 52e */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1327 = 52f */ {49, 0, 8}, /* 0x0052 => 0x0520+(16)*/ - /* 1328 = 530 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1329 = 531 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1330 = 532 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1331 = 533 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1332 = 534 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1333 = 535 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1334 = 536 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1335 = 537 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1336 = 538 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1337 = 539 */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1338 = 53a */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1339 = 53b */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1340 = 53c */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1341 = 53d */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1342 = 53e */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1343 = 53f */ {50, 0, 8}, /* 0x0053 => 0x0530+(16)*/ - /* 1344 = 540 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1345 = 541 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1346 = 542 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1347 = 543 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1348 = 544 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1349 = 545 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1350 = 546 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1351 = 547 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1352 = 548 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1353 = 549 */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1354 = 54a */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1355 = 54b */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1356 = 54c */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1357 = 54d */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1358 = 54e */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1359 = 54f */ {51, 0, 8}, /* 0x0054 => 0x0540+(16)*/ - /* 1360 = 550 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1361 = 551 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1362 = 552 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1363 = 553 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1364 = 554 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1365 = 555 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1366 = 556 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1367 = 557 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1368 = 558 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1369 = 559 */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1370 = 55a */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1371 = 55b */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1372 = 55c */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1373 = 55d */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1374 = 55e */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1375 = 55f */ {52, 0, 8}, /* 0x0055 => 0x0550+(16)*/ - /* 1376 = 560 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1377 = 561 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1378 = 562 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1379 = 563 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1380 = 564 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1381 = 565 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1382 = 566 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1383 = 567 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1384 = 568 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1385 = 569 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1386 = 56a */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1387 = 56b */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1388 = 56c */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1389 = 56d */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1390 = 56e */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1391 = 56f */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1392 = 570 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1393 = 571 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1394 = 572 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1395 = 573 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1396 = 574 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1397 = 575 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1398 = 576 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1399 = 577 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1400 = 578 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1401 = 579 */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1402 = 57a */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1403 = 57b */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1404 = 57c */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1405 = 57d */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1406 = 57e */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1407 = 57f */ {25, 0, 7}, /* 0x002b => 0x0560+(32)*/ - /* 1408 = 580 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1409 = 581 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1410 = 582 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1411 = 583 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1412 = 584 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1413 = 585 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1414 = 586 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1415 = 587 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1416 = 588 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1417 = 589 */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1418 = 58a */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1419 = 58b */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1420 = 58c */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1421 = 58d */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1422 = 58e */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1423 = 58f */ {55, 0, 8}, /* 0x0058 => 0x0580+(16)*/ - /* 1424 = 590 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1425 = 591 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1426 = 592 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1427 = 593 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1428 = 594 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1429 = 595 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1430 = 596 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1431 = 597 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1432 = 598 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1433 = 599 */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1434 = 59a */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1435 = 59b */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1436 = 59c */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1437 = 59d */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1438 = 59e */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1439 = 59f */ {56, 0, 8}, /* 0x0059 => 0x0590+(16)*/ - /* 1440 = 5a0 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1441 = 5a1 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1442 = 5a2 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1443 = 5a3 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1444 = 5a4 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1445 = 5a5 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1446 = 5a6 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1447 = 5a7 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1448 = 5a8 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1449 = 5a9 */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1450 = 5aa */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1451 = 5ab */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1452 = 5ac */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1453 = 5ad */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1454 = 5ae */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1455 = 5af */ {57, 0, 8}, /* 0x005a => 0x05a0+(16)*/ - /* 1456 = 5b0 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1457 = 5b1 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1458 = 5b2 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1459 = 5b3 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1460 = 5b4 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1461 = 5b5 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1462 = 5b6 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1463 = 5b7 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1464 = 5b8 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1465 = 5b9 */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1466 = 5ba */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1467 = 5bb */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1468 = 5bc */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1469 = 5bd */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1470 = 5be */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1471 = 5bf */ {58, 0, 8}, /* 0x005b => 0x05b0+(16)*/ - /* 1472 = 5c0 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1473 = 5c1 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1474 = 5c2 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1475 = 5c3 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1476 = 5c4 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1477 = 5c5 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1478 = 5c6 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1479 = 5c7 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1480 = 5c8 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1481 = 5c9 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1482 = 5ca */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1483 = 5cb */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1484 = 5cc */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1485 = 5cd */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1486 = 5ce */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1487 = 5cf */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1488 = 5d0 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1489 = 5d1 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1490 = 5d2 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1491 = 5d3 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1492 = 5d4 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1493 = 5d5 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1494 = 5d6 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1495 = 5d7 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1496 = 5d8 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1497 = 5d9 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1498 = 5da */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1499 = 5db */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1500 = 5dc */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1501 = 5dd */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1502 = 5de */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1503 = 5df */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1504 = 5e0 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1505 = 5e1 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1506 = 5e2 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1507 = 5e3 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1508 = 5e4 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1509 = 5e5 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1510 = 5e6 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1511 = 5e7 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1512 = 5e8 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1513 = 5e9 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1514 = 5ea */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1515 = 5eb */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1516 = 5ec */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1517 = 5ed */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1518 = 5ee */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1519 = 5ef */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1520 = 5f0 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1521 = 5f1 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1522 = 5f2 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1523 = 5f3 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1524 = 5f4 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1525 = 5f5 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1526 = 5f6 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1527 = 5f7 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1528 = 5f8 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1529 = 5f9 */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1530 = 5fa */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1531 = 5fb */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1532 = 5fc */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1533 = 5fd */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1534 = 5fe */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1535 = 5ff */ {192, 1, 6}, /* 0x0017 => 0x05c0+(64)*/ - /* 1536 = 600 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1537 = 601 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1538 = 602 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1539 = 603 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1540 = 604 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1541 = 605 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1542 = 606 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1543 = 607 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1544 = 608 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1545 = 609 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1546 = 60a */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1547 = 60b */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1548 = 60c */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1549 = 60d */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1550 = 60e */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1551 = 60f */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1552 = 610 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1553 = 611 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1554 = 612 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1555 = 613 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1556 = 614 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1557 = 615 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1558 = 616 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1559 = 617 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1560 = 618 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1561 = 619 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1562 = 61a */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1563 = 61b */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1564 = 61c */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1565 = 61d */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1566 = 61e */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1567 = 61f */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1568 = 620 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1569 = 621 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1570 = 622 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1571 = 623 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1572 = 624 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1573 = 625 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1574 = 626 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1575 = 627 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1576 = 628 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1577 = 629 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1578 = 62a */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1579 = 62b */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1580 = 62c */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1581 = 62d */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1582 = 62e */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1583 = 62f */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1584 = 630 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1585 = 631 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1586 = 632 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1587 = 633 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1588 = 634 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1589 = 635 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1590 = 636 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1591 = 637 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1592 = 638 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1593 = 639 */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1594 = 63a */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1595 = 63b */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1596 = 63c */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1597 = 63d */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1598 = 63e */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1599 = 63f */ {1664, 1, 6}, /* 0x0018 => 0x0600+(64)*/ - /* 1600 = 640 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1601 = 641 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1602 = 642 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1603 = 643 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1604 = 644 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1605 = 645 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1606 = 646 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1607 = 647 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1608 = 648 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1609 = 649 */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1610 = 64a */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1611 = 64b */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1612 = 64c */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1613 = 64d */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1614 = 64e */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1615 = 64f */ {448, 1, 8}, /* 0x0064 => 0x0640+(16)*/ - /* 1616 = 650 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1617 = 651 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1618 = 652 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1619 = 653 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1620 = 654 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1621 = 655 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1622 = 656 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1623 = 657 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1624 = 658 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1625 = 659 */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1626 = 65a */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1627 = 65b */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1628 = 65c */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1629 = 65d */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1630 = 65e */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1631 = 65f */ {512, 1, 8}, /* 0x0065 => 0x0650+(16)*/ - /* 1632 = 660 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1633 = 661 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1634 = 662 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1635 = 663 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1636 = 664 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1637 = 665 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1638 = 666 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1639 = 667 */ {704, 1, 9}, /* 0x00cc => 0x0660+(8)*/ - /* 1640 = 668 */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1641 = 669 */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1642 = 66a */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1643 = 66b */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1644 = 66c */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1645 = 66d */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1646 = 66e */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1647 = 66f */ {768, 1, 9}, /* 0x00cd => 0x0668+(8)*/ - /* 1648 = 670 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1649 = 671 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1650 = 672 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1651 = 673 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1652 = 674 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1653 = 675 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1654 = 676 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1655 = 677 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1656 = 678 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1657 = 679 */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1658 = 67a */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1659 = 67b */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1660 = 67c */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1661 = 67d */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1662 = 67e */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1663 = 67f */ {640, 1, 8}, /* 0x0067 => 0x0670+(16)*/ - /* 1664 = 680 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1665 = 681 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1666 = 682 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1667 = 683 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1668 = 684 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1669 = 685 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1670 = 686 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1671 = 687 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1672 = 688 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1673 = 689 */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1674 = 68a */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1675 = 68b */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1676 = 68c */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1677 = 68d */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1678 = 68e */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1679 = 68f */ {576, 1, 8}, /* 0x0068 => 0x0680+(16)*/ - /* 1680 = 690 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1681 = 691 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1682 = 692 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1683 = 693 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1684 = 694 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1685 = 695 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1686 = 696 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1687 = 697 */ {832, 1, 9}, /* 0x00d2 => 0x0690+(8)*/ - /* 1688 = 698 */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1689 = 699 */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1690 = 69a */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1691 = 69b */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1692 = 69c */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1693 = 69d */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1694 = 69e */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1695 = 69f */ {896, 1, 9}, /* 0x00d3 => 0x0698+(8)*/ - /* 1696 = 6a0 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1697 = 6a1 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1698 = 6a2 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1699 = 6a3 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1700 = 6a4 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1701 = 6a5 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1702 = 6a6 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1703 = 6a7 */ {960, 1, 9}, /* 0x00d4 => 0x06a0+(8)*/ - /* 1704 = 6a8 */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1705 = 6a9 */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1706 = 6aa */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1707 = 6ab */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1708 = 6ac */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1709 = 6ad */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1710 = 6ae */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1711 = 6af */ {1024, 1, 9}, /* 0x00d5 => 0x06a8+(8)*/ - /* 1712 = 6b0 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1713 = 6b1 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1714 = 6b2 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1715 = 6b3 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1716 = 6b4 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1717 = 6b5 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1718 = 6b6 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1719 = 6b7 */ {1088, 1, 9}, /* 0x00d6 => 0x06b0+(8)*/ - /* 1720 = 6b8 */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1721 = 6b9 */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1722 = 6ba */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1723 = 6bb */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1724 = 6bc */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1725 = 6bd */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1726 = 6be */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1727 = 6bf */ {1152, 1, 9}, /* 0x00d7 => 0x06b8+(8)*/ - /* 1728 = 6c0 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1729 = 6c1 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1730 = 6c2 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1731 = 6c3 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1732 = 6c4 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1733 = 6c5 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1734 = 6c6 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1735 = 6c7 */ {1216, 1, 9}, /* 0x00d8 => 0x06c0+(8)*/ - /* 1736 = 6c8 */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1737 = 6c9 */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1738 = 6ca */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1739 = 6cb */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1740 = 6cc */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1741 = 6cd */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1742 = 6ce */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1743 = 6cf */ {1280, 1, 9}, /* 0x00d9 => 0x06c8+(8)*/ - /* 1744 = 6d0 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1745 = 6d1 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1746 = 6d2 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1747 = 6d3 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1748 = 6d4 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1749 = 6d5 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1750 = 6d6 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1751 = 6d7 */ {1344, 1, 9}, /* 0x00da => 0x06d0+(8)*/ - /* 1752 = 6d8 */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1753 = 6d9 */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1754 = 6da */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1755 = 6db */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1756 = 6dc */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1757 = 6dd */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1758 = 6de */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1759 = 6df */ {1408, 1, 9}, /* 0x00db => 0x06d8+(8)*/ - /* 1760 = 6e0 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1761 = 6e1 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1762 = 6e2 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1763 = 6e3 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1764 = 6e4 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1765 = 6e5 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1766 = 6e6 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1767 = 6e7 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1768 = 6e8 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1769 = 6e9 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1770 = 6ea */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1771 = 6eb */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1772 = 6ec */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1773 = 6ed */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1774 = 6ee */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1775 = 6ef */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1776 = 6f0 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1777 = 6f1 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1778 = 6f2 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1779 = 6f3 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1780 = 6f4 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1781 = 6f5 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1782 = 6f6 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1783 = 6f7 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1784 = 6f8 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1785 = 6f9 */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1786 = 6fa */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1787 = 6fb */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1788 = 6fc */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1789 = 6fd */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1790 = 6fe */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1791 = 6ff */ {256, 1, 7}, /* 0x0037 => 0x06e0+(32)*/ - /* 1792 = 700 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1793 = 701 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1794 = 702 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1795 = 703 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1796 = 704 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1797 = 705 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1798 = 706 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1799 = 707 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1800 = 708 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1801 = 709 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1802 = 70a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1803 = 70b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1804 = 70c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1805 = 70d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1806 = 70e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1807 = 70f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1808 = 710 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1809 = 711 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1810 = 712 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1811 = 713 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1812 = 714 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1813 = 715 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1814 = 716 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1815 = 717 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1816 = 718 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1817 = 719 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1818 = 71a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1819 = 71b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1820 = 71c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1821 = 71d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1822 = 71e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1823 = 71f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1824 = 720 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1825 = 721 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1826 = 722 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1827 = 723 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1828 = 724 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1829 = 725 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1830 = 726 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1831 = 727 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1832 = 728 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1833 = 729 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1834 = 72a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1835 = 72b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1836 = 72c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1837 = 72d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1838 = 72e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1839 = 72f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1840 = 730 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1841 = 731 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1842 = 732 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1843 = 733 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1844 = 734 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1845 = 735 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1846 = 736 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1847 = 737 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1848 = 738 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1849 = 739 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1850 = 73a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1851 = 73b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1852 = 73c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1853 = 73d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1854 = 73e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1855 = 73f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1856 = 740 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1857 = 741 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1858 = 742 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1859 = 743 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1860 = 744 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1861 = 745 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1862 = 746 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1863 = 747 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1864 = 748 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1865 = 749 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1866 = 74a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1867 = 74b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1868 = 74c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1869 = 74d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1870 = 74e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1871 = 74f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1872 = 750 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1873 = 751 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1874 = 752 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1875 = 753 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1876 = 754 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1877 = 755 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1878 = 756 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1879 = 757 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1880 = 758 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1881 = 759 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1882 = 75a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1883 = 75b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1884 = 75c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1885 = 75d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1886 = 75e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1887 = 75f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1888 = 760 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1889 = 761 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1890 = 762 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1891 = 763 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1892 = 764 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1893 = 765 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1894 = 766 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1895 = 767 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1896 = 768 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1897 = 769 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1898 = 76a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1899 = 76b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1900 = 76c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1901 = 76d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1902 = 76e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1903 = 76f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1904 = 770 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1905 = 771 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1906 = 772 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1907 = 773 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1908 = 774 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1909 = 775 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1910 = 776 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1911 = 777 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1912 = 778 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1913 = 779 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1914 = 77a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1915 = 77b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1916 = 77c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1917 = 77d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1918 = 77e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1919 = 77f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1920 = 780 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1921 = 781 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1922 = 782 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1923 = 783 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1924 = 784 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1925 = 785 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1926 = 786 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1927 = 787 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1928 = 788 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1929 = 789 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1930 = 78a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1931 = 78b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1932 = 78c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1933 = 78d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1934 = 78e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1935 = 78f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1936 = 790 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1937 = 791 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1938 = 792 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1939 = 793 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1940 = 794 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1941 = 795 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1942 = 796 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1943 = 797 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1944 = 798 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1945 = 799 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1946 = 79a */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1947 = 79b */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1948 = 79c */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1949 = 79d */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1950 = 79e */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1951 = 79f */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1952 = 7a0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1953 = 7a1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1954 = 7a2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1955 = 7a3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1956 = 7a4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1957 = 7a5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1958 = 7a6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1959 = 7a7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1960 = 7a8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1961 = 7a9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1962 = 7aa */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1963 = 7ab */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1964 = 7ac */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1965 = 7ad */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1966 = 7ae */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1967 = 7af */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1968 = 7b0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1969 = 7b1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1970 = 7b2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1971 = 7b3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1972 = 7b4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1973 = 7b5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1974 = 7b6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1975 = 7b7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1976 = 7b8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1977 = 7b9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1978 = 7ba */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1979 = 7bb */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1980 = 7bc */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1981 = 7bd */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1982 = 7be */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1983 = 7bf */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1984 = 7c0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1985 = 7c1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1986 = 7c2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1987 = 7c3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1988 = 7c4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1989 = 7c5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1990 = 7c6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1991 = 7c7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1992 = 7c8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1993 = 7c9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1994 = 7ca */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1995 = 7cb */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1996 = 7cc */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1997 = 7cd */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1998 = 7ce */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 1999 = 7cf */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2000 = 7d0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2001 = 7d1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2002 = 7d2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2003 = 7d3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2004 = 7d4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2005 = 7d5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2006 = 7d6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2007 = 7d7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2008 = 7d8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2009 = 7d9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2010 = 7da */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2011 = 7db */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2012 = 7dc */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2013 = 7dd */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2014 = 7de */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2015 = 7df */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2016 = 7e0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2017 = 7e1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2018 = 7e2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2019 = 7e3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2020 = 7e4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2021 = 7e5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2022 = 7e6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2023 = 7e7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2024 = 7e8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2025 = 7e9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2026 = 7ea */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2027 = 7eb */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2028 = 7ec */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2029 = 7ed */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2030 = 7ee */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2031 = 7ef */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2032 = 7f0 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2033 = 7f1 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2034 = 7f2 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2035 = 7f3 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2036 = 7f4 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2037 = 7f5 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2038 = 7f6 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2039 = 7f7 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2040 = 7f8 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2041 = 7f9 */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2042 = 7fa */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2043 = 7fb */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2044 = 7fc */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2045 = 7fd */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2046 = 7fe */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2047 = 7ff */ {2, 0, 4}, /* 0x0007 => 0x0700+(256)*/ - /* 2048 = 800 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2049 = 801 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2050 = 802 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2051 = 803 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2052 = 804 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2053 = 805 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2054 = 806 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2055 = 807 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2056 = 808 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2057 = 809 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2058 = 80a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2059 = 80b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2060 = 80c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2061 = 80d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2062 = 80e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2063 = 80f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2064 = 810 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2065 = 811 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2066 = 812 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2067 = 813 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2068 = 814 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2069 = 815 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2070 = 816 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2071 = 817 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2072 = 818 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2073 = 819 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2074 = 81a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2075 = 81b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2076 = 81c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2077 = 81d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2078 = 81e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2079 = 81f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2080 = 820 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2081 = 821 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2082 = 822 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2083 = 823 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2084 = 824 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2085 = 825 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2086 = 826 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2087 = 827 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2088 = 828 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2089 = 829 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2090 = 82a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2091 = 82b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2092 = 82c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2093 = 82d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2094 = 82e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2095 = 82f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2096 = 830 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2097 = 831 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2098 = 832 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2099 = 833 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2100 = 834 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2101 = 835 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2102 = 836 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2103 = 837 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2104 = 838 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2105 = 839 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2106 = 83a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2107 = 83b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2108 = 83c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2109 = 83d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2110 = 83e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2111 = 83f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2112 = 840 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2113 = 841 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2114 = 842 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2115 = 843 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2116 = 844 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2117 = 845 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2118 = 846 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2119 = 847 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2120 = 848 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2121 = 849 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2122 = 84a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2123 = 84b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2124 = 84c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2125 = 84d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2126 = 84e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2127 = 84f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2128 = 850 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2129 = 851 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2130 = 852 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2131 = 853 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2132 = 854 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2133 = 855 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2134 = 856 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2135 = 857 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2136 = 858 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2137 = 859 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2138 = 85a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2139 = 85b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2140 = 85c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2141 = 85d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2142 = 85e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2143 = 85f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2144 = 860 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2145 = 861 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2146 = 862 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2147 = 863 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2148 = 864 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2149 = 865 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2150 = 866 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2151 = 867 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2152 = 868 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2153 = 869 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2154 = 86a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2155 = 86b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2156 = 86c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2157 = 86d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2158 = 86e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2159 = 86f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2160 = 870 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2161 = 871 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2162 = 872 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2163 = 873 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2164 = 874 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2165 = 875 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2166 = 876 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2167 = 877 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2168 = 878 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2169 = 879 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2170 = 87a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2171 = 87b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2172 = 87c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2173 = 87d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2174 = 87e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2175 = 87f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2176 = 880 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2177 = 881 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2178 = 882 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2179 = 883 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2180 = 884 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2181 = 885 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2182 = 886 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2183 = 887 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2184 = 888 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2185 = 889 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2186 = 88a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2187 = 88b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2188 = 88c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2189 = 88d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2190 = 88e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2191 = 88f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2192 = 890 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2193 = 891 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2194 = 892 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2195 = 893 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2196 = 894 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2197 = 895 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2198 = 896 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2199 = 897 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2200 = 898 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2201 = 899 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2202 = 89a */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2203 = 89b */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2204 = 89c */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2205 = 89d */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2206 = 89e */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2207 = 89f */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2208 = 8a0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2209 = 8a1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2210 = 8a2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2211 = 8a3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2212 = 8a4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2213 = 8a5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2214 = 8a6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2215 = 8a7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2216 = 8a8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2217 = 8a9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2218 = 8aa */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2219 = 8ab */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2220 = 8ac */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2221 = 8ad */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2222 = 8ae */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2223 = 8af */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2224 = 8b0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2225 = 8b1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2226 = 8b2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2227 = 8b3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2228 = 8b4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2229 = 8b5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2230 = 8b6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2231 = 8b7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2232 = 8b8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2233 = 8b9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2234 = 8ba */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2235 = 8bb */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2236 = 8bc */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2237 = 8bd */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2238 = 8be */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2239 = 8bf */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2240 = 8c0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2241 = 8c1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2242 = 8c2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2243 = 8c3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2244 = 8c4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2245 = 8c5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2246 = 8c6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2247 = 8c7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2248 = 8c8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2249 = 8c9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2250 = 8ca */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2251 = 8cb */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2252 = 8cc */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2253 = 8cd */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2254 = 8ce */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2255 = 8cf */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2256 = 8d0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2257 = 8d1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2258 = 8d2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2259 = 8d3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2260 = 8d4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2261 = 8d5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2262 = 8d6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2263 = 8d7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2264 = 8d8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2265 = 8d9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2266 = 8da */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2267 = 8db */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2268 = 8dc */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2269 = 8dd */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2270 = 8de */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2271 = 8df */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2272 = 8e0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2273 = 8e1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2274 = 8e2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2275 = 8e3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2276 = 8e4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2277 = 8e5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2278 = 8e6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2279 = 8e7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2280 = 8e8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2281 = 8e9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2282 = 8ea */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2283 = 8eb */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2284 = 8ec */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2285 = 8ed */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2286 = 8ee */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2287 = 8ef */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2288 = 8f0 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2289 = 8f1 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2290 = 8f2 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2291 = 8f3 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2292 = 8f4 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2293 = 8f5 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2294 = 8f6 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2295 = 8f7 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2296 = 8f8 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2297 = 8f9 */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2298 = 8fa */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2299 = 8fb */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2300 = 8fc */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2301 = 8fd */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2302 = 8fe */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2303 = 8ff */ {3, 0, 4}, /* 0x0008 => 0x0800+(256)*/ - /* 2304 = 900 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2305 = 901 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2306 = 902 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2307 = 903 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2308 = 904 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2309 = 905 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2310 = 906 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2311 = 907 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2312 = 908 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2313 = 909 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2314 = 90a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2315 = 90b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2316 = 90c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2317 = 90d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2318 = 90e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2319 = 90f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2320 = 910 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2321 = 911 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2322 = 912 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2323 = 913 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2324 = 914 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2325 = 915 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2326 = 916 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2327 = 917 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2328 = 918 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2329 = 919 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2330 = 91a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2331 = 91b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2332 = 91c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2333 = 91d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2334 = 91e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2335 = 91f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2336 = 920 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2337 = 921 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2338 = 922 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2339 = 923 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2340 = 924 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2341 = 925 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2342 = 926 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2343 = 927 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2344 = 928 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2345 = 929 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2346 = 92a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2347 = 92b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2348 = 92c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2349 = 92d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2350 = 92e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2351 = 92f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2352 = 930 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2353 = 931 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2354 = 932 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2355 = 933 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2356 = 934 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2357 = 935 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2358 = 936 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2359 = 937 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2360 = 938 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2361 = 939 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2362 = 93a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2363 = 93b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2364 = 93c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2365 = 93d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2366 = 93e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2367 = 93f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2368 = 940 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2369 = 941 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2370 = 942 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2371 = 943 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2372 = 944 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2373 = 945 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2374 = 946 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2375 = 947 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2376 = 948 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2377 = 949 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2378 = 94a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2379 = 94b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2380 = 94c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2381 = 94d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2382 = 94e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2383 = 94f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2384 = 950 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2385 = 951 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2386 = 952 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2387 = 953 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2388 = 954 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2389 = 955 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2390 = 956 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2391 = 957 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2392 = 958 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2393 = 959 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2394 = 95a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2395 = 95b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2396 = 95c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2397 = 95d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2398 = 95e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2399 = 95f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2400 = 960 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2401 = 961 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2402 = 962 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2403 = 963 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2404 = 964 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2405 = 965 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2406 = 966 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2407 = 967 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2408 = 968 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2409 = 969 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2410 = 96a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2411 = 96b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2412 = 96c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2413 = 96d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2414 = 96e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2415 = 96f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2416 = 970 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2417 = 971 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2418 = 972 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2419 = 973 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2420 = 974 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2421 = 975 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2422 = 976 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2423 = 977 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2424 = 978 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2425 = 979 */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2426 = 97a */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2427 = 97b */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2428 = 97c */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2429 = 97d */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2430 = 97e */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2431 = 97f */ {128, 1, 5}, /* 0x0012 => 0x0900+(128)*/ - /* 2432 = 980 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2433 = 981 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2434 = 982 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2435 = 983 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2436 = 984 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2437 = 985 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2438 = 986 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2439 = 987 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2440 = 988 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2441 = 989 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2442 = 98a */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2443 = 98b */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2444 = 98c */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2445 = 98d */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2446 = 98e */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2447 = 98f */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2448 = 990 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2449 = 991 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2450 = 992 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2451 = 993 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2452 = 994 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2453 = 995 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2454 = 996 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2455 = 997 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2456 = 998 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2457 = 999 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2458 = 99a */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2459 = 99b */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2460 = 99c */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2461 = 99d */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2462 = 99e */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2463 = 99f */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2464 = 9a0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2465 = 9a1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2466 = 9a2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2467 = 9a3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2468 = 9a4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2469 = 9a5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2470 = 9a6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2471 = 9a7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2472 = 9a8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2473 = 9a9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2474 = 9aa */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2475 = 9ab */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2476 = 9ac */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2477 = 9ad */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2478 = 9ae */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2479 = 9af */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2480 = 9b0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2481 = 9b1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2482 = 9b2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2483 = 9b3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2484 = 9b4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2485 = 9b5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2486 = 9b6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2487 = 9b7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2488 = 9b8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2489 = 9b9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2490 = 9ba */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2491 = 9bb */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2492 = 9bc */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2493 = 9bd */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2494 = 9be */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2495 = 9bf */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2496 = 9c0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2497 = 9c1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2498 = 9c2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2499 = 9c3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2500 = 9c4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2501 = 9c5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2502 = 9c6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2503 = 9c7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2504 = 9c8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2505 = 9c9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2506 = 9ca */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2507 = 9cb */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2508 = 9cc */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2509 = 9cd */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2510 = 9ce */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2511 = 9cf */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2512 = 9d0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2513 = 9d1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2514 = 9d2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2515 = 9d3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2516 = 9d4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2517 = 9d5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2518 = 9d6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2519 = 9d7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2520 = 9d8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2521 = 9d9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2522 = 9da */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2523 = 9db */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2524 = 9dc */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2525 = 9dd */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2526 = 9de */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2527 = 9df */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2528 = 9e0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2529 = 9e1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2530 = 9e2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2531 = 9e3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2532 = 9e4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2533 = 9e5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2534 = 9e6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2535 = 9e7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2536 = 9e8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2537 = 9e9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2538 = 9ea */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2539 = 9eb */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2540 = 9ec */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2541 = 9ed */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2542 = 9ee */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2543 = 9ef */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2544 = 9f0 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2545 = 9f1 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2546 = 9f2 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2547 = 9f3 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2548 = 9f4 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2549 = 9f5 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2550 = 9f6 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2551 = 9f7 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2552 = 9f8 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2553 = 9f9 */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2554 = 9fa */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2555 = 9fb */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2556 = 9fc */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2557 = 9fd */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2558 = 9fe */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2559 = 9ff */ {8, 0, 5}, /* 0x0013 => 0x0980+(128)*/ - /* 2560 = a00 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2561 = a01 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2562 = a02 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2563 = a03 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2564 = a04 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2565 = a05 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2566 = a06 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2567 = a07 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2568 = a08 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2569 = a09 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2570 = a0a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2571 = a0b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2572 = a0c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2573 = a0d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2574 = a0e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2575 = a0f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2576 = a10 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2577 = a11 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2578 = a12 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2579 = a13 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2580 = a14 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2581 = a15 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2582 = a16 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2583 = a17 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2584 = a18 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2585 = a19 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2586 = a1a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2587 = a1b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2588 = a1c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2589 = a1d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2590 = a1e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2591 = a1f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2592 = a20 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2593 = a21 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2594 = a22 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2595 = a23 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2596 = a24 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2597 = a25 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2598 = a26 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2599 = a27 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2600 = a28 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2601 = a29 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2602 = a2a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2603 = a2b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2604 = a2c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2605 = a2d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2606 = a2e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2607 = a2f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2608 = a30 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2609 = a31 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2610 = a32 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2611 = a33 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2612 = a34 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2613 = a35 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2614 = a36 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2615 = a37 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2616 = a38 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2617 = a39 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2618 = a3a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2619 = a3b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2620 = a3c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2621 = a3d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2622 = a3e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2623 = a3f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2624 = a40 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2625 = a41 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2626 = a42 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2627 = a43 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2628 = a44 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2629 = a45 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2630 = a46 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2631 = a47 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2632 = a48 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2633 = a49 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2634 = a4a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2635 = a4b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2636 = a4c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2637 = a4d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2638 = a4e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2639 = a4f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2640 = a50 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2641 = a51 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2642 = a52 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2643 = a53 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2644 = a54 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2645 = a55 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2646 = a56 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2647 = a57 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2648 = a58 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2649 = a59 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2650 = a5a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2651 = a5b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2652 = a5c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2653 = a5d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2654 = a5e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2655 = a5f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2656 = a60 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2657 = a61 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2658 = a62 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2659 = a63 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2660 = a64 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2661 = a65 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2662 = a66 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2663 = a67 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2664 = a68 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2665 = a69 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2666 = a6a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2667 = a6b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2668 = a6c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2669 = a6d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2670 = a6e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2671 = a6f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2672 = a70 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2673 = a71 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2674 = a72 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2675 = a73 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2676 = a74 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2677 = a75 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2678 = a76 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2679 = a77 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2680 = a78 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2681 = a79 */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2682 = a7a */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2683 = a7b */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2684 = a7c */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2685 = a7d */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2686 = a7e */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2687 = a7f */ {9, 0, 5}, /* 0x0014 => 0x0a00+(128)*/ - /* 2688 = a80 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2689 = a81 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2690 = a82 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2691 = a83 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2692 = a84 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2693 = a85 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2694 = a86 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2695 = a87 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2696 = a88 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2697 = a89 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2698 = a8a */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2699 = a8b */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2700 = a8c */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2701 = a8d */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2702 = a8e */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2703 = a8f */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2704 = a90 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2705 = a91 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2706 = a92 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2707 = a93 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2708 = a94 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2709 = a95 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2710 = a96 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2711 = a97 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2712 = a98 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2713 = a99 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2714 = a9a */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2715 = a9b */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2716 = a9c */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2717 = a9d */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2718 = a9e */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2719 = a9f */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2720 = aa0 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2721 = aa1 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2722 = aa2 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2723 = aa3 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2724 = aa4 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2725 = aa5 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2726 = aa6 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2727 = aa7 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2728 = aa8 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2729 = aa9 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2730 = aaa */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2731 = aab */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2732 = aac */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2733 = aad */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2734 = aae */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2735 = aaf */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2736 = ab0 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2737 = ab1 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2738 = ab2 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2739 = ab3 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2740 = ab4 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2741 = ab5 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2742 = ab6 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2743 = ab7 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2744 = ab8 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2745 = ab9 */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2746 = aba */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2747 = abb */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2748 = abc */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2749 = abd */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2750 = abe */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2751 = abf */ {16, 0, 6}, /* 0x002a => 0x0a80+(64)*/ - /* 2752 = ac0 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2753 = ac1 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2754 = ac2 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2755 = ac3 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2756 = ac4 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2757 = ac5 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2758 = ac6 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2759 = ac7 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2760 = ac8 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2761 = ac9 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2762 = aca */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2763 = acb */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2764 = acc */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2765 = acd */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2766 = ace */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2767 = acf */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2768 = ad0 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2769 = ad1 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2770 = ad2 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2771 = ad3 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2772 = ad4 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2773 = ad5 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2774 = ad6 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2775 = ad7 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2776 = ad8 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2777 = ad9 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2778 = ada */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2779 = adb */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2780 = adc */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2781 = add */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2782 = ade */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2783 = adf */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2784 = ae0 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2785 = ae1 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2786 = ae2 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2787 = ae3 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2788 = ae4 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2789 = ae5 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2790 = ae6 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2791 = ae7 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2792 = ae8 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2793 = ae9 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2794 = aea */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2795 = aeb */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2796 = aec */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2797 = aed */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2798 = aee */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2799 = aef */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2800 = af0 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2801 = af1 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2802 = af2 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2803 = af3 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2804 = af4 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2805 = af5 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2806 = af6 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2807 = af7 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2808 = af8 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2809 = af9 */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2810 = afa */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2811 = afb */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2812 = afc */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2813 = afd */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2814 = afe */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2815 = aff */ {17, 0, 6}, /* 0x002b => 0x0ac0+(64)*/ - /* 2816 = b00 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2817 = b01 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2818 = b02 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2819 = b03 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2820 = b04 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2821 = b05 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2822 = b06 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2823 = b07 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2824 = b08 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2825 = b09 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2826 = b0a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2827 = b0b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2828 = b0c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2829 = b0d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2830 = b0e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2831 = b0f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2832 = b10 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2833 = b11 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2834 = b12 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2835 = b13 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2836 = b14 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2837 = b15 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2838 = b16 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2839 = b17 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2840 = b18 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2841 = b19 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2842 = b1a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2843 = b1b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2844 = b1c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2845 = b1d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2846 = b1e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2847 = b1f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2848 = b20 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2849 = b21 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2850 = b22 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2851 = b23 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2852 = b24 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2853 = b25 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2854 = b26 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2855 = b27 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2856 = b28 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2857 = b29 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2858 = b2a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2859 = b2b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2860 = b2c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2861 = b2d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2862 = b2e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2863 = b2f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2864 = b30 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2865 = b31 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2866 = b32 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2867 = b33 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2868 = b34 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2869 = b35 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2870 = b36 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2871 = b37 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2872 = b38 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2873 = b39 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2874 = b3a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2875 = b3b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2876 = b3c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2877 = b3d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2878 = b3e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2879 = b3f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2880 = b40 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2881 = b41 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2882 = b42 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2883 = b43 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2884 = b44 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2885 = b45 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2886 = b46 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2887 = b47 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2888 = b48 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2889 = b49 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2890 = b4a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2891 = b4b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2892 = b4c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2893 = b4d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2894 = b4e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2895 = b4f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2896 = b50 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2897 = b51 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2898 = b52 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2899 = b53 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2900 = b54 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2901 = b55 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2902 = b56 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2903 = b57 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2904 = b58 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2905 = b59 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2906 = b5a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2907 = b5b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2908 = b5c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2909 = b5d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2910 = b5e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2911 = b5f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2912 = b60 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2913 = b61 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2914 = b62 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2915 = b63 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2916 = b64 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2917 = b65 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2918 = b66 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2919 = b67 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2920 = b68 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2921 = b69 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2922 = b6a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2923 = b6b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2924 = b6c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2925 = b6d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2926 = b6e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2927 = b6f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2928 = b70 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2929 = b71 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2930 = b72 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2931 = b73 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2932 = b74 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2933 = b75 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2934 = b76 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2935 = b77 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2936 = b78 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2937 = b79 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2938 = b7a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2939 = b7b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2940 = b7c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2941 = b7d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2942 = b7e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2943 = b7f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2944 = b80 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2945 = b81 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2946 = b82 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2947 = b83 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2948 = b84 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2949 = b85 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2950 = b86 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2951 = b87 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2952 = b88 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2953 = b89 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2954 = b8a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2955 = b8b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2956 = b8c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2957 = b8d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2958 = b8e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2959 = b8f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2960 = b90 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2961 = b91 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2962 = b92 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2963 = b93 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2964 = b94 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2965 = b95 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2966 = b96 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2967 = b97 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2968 = b98 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2969 = b99 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2970 = b9a */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2971 = b9b */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2972 = b9c */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2973 = b9d */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2974 = b9e */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2975 = b9f */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2976 = ba0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2977 = ba1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2978 = ba2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2979 = ba3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2980 = ba4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2981 = ba5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2982 = ba6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2983 = ba7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2984 = ba8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2985 = ba9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2986 = baa */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2987 = bab */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2988 = bac */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2989 = bad */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2990 = bae */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2991 = baf */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2992 = bb0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2993 = bb1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2994 = bb2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2995 = bb3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2996 = bb4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2997 = bb5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2998 = bb6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 2999 = bb7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3000 = bb8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3001 = bb9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3002 = bba */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3003 = bbb */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3004 = bbc */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3005 = bbd */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3006 = bbe */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3007 = bbf */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3008 = bc0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3009 = bc1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3010 = bc2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3011 = bc3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3012 = bc4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3013 = bc5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3014 = bc6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3015 = bc7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3016 = bc8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3017 = bc9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3018 = bca */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3019 = bcb */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3020 = bcc */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3021 = bcd */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3022 = bce */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3023 = bcf */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3024 = bd0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3025 = bd1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3026 = bd2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3027 = bd3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3028 = bd4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3029 = bd5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3030 = bd6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3031 = bd7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3032 = bd8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3033 = bd9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3034 = bda */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3035 = bdb */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3036 = bdc */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3037 = bdd */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3038 = bde */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3039 = bdf */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3040 = be0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3041 = be1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3042 = be2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3043 = be3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3044 = be4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3045 = be5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3046 = be6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3047 = be7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3048 = be8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3049 = be9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3050 = bea */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3051 = beb */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3052 = bec */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3053 = bed */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3054 = bee */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3055 = bef */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3056 = bf0 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3057 = bf1 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3058 = bf2 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3059 = bf3 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3060 = bf4 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3061 = bf5 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3062 = bf6 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3063 = bf7 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3064 = bf8 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3065 = bf9 */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3066 = bfa */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3067 = bfb */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3068 = bfc */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3069 = bfd */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3070 = bfe */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3071 = bff */ {4, 0, 4}, /* 0x000b => 0x0b00+(256)*/ - /* 3072 = c00 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3073 = c01 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3074 = c02 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3075 = c03 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3076 = c04 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3077 = c05 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3078 = c06 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3079 = c07 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3080 = c08 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3081 = c09 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3082 = c0a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3083 = c0b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3084 = c0c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3085 = c0d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3086 = c0e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3087 = c0f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3088 = c10 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3089 = c11 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3090 = c12 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3091 = c13 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3092 = c14 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3093 = c15 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3094 = c16 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3095 = c17 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3096 = c18 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3097 = c19 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3098 = c1a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3099 = c1b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3100 = c1c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3101 = c1d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3102 = c1e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3103 = c1f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3104 = c20 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3105 = c21 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3106 = c22 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3107 = c23 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3108 = c24 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3109 = c25 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3110 = c26 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3111 = c27 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3112 = c28 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3113 = c29 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3114 = c2a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3115 = c2b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3116 = c2c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3117 = c2d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3118 = c2e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3119 = c2f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3120 = c30 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3121 = c31 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3122 = c32 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3123 = c33 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3124 = c34 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3125 = c35 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3126 = c36 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3127 = c37 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3128 = c38 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3129 = c39 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3130 = c3a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3131 = c3b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3132 = c3c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3133 = c3d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3134 = c3e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3135 = c3f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3136 = c40 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3137 = c41 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3138 = c42 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3139 = c43 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3140 = c44 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3141 = c45 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3142 = c46 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3143 = c47 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3144 = c48 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3145 = c49 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3146 = c4a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3147 = c4b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3148 = c4c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3149 = c4d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3150 = c4e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3151 = c4f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3152 = c50 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3153 = c51 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3154 = c52 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3155 = c53 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3156 = c54 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3157 = c55 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3158 = c56 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3159 = c57 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3160 = c58 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3161 = c59 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3162 = c5a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3163 = c5b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3164 = c5c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3165 = c5d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3166 = c5e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3167 = c5f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3168 = c60 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3169 = c61 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3170 = c62 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3171 = c63 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3172 = c64 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3173 = c65 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3174 = c66 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3175 = c67 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3176 = c68 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3177 = c69 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3178 = c6a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3179 = c6b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3180 = c6c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3181 = c6d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3182 = c6e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3183 = c6f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3184 = c70 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3185 = c71 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3186 = c72 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3187 = c73 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3188 = c74 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3189 = c75 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3190 = c76 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3191 = c77 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3192 = c78 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3193 = c79 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3194 = c7a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3195 = c7b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3196 = c7c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3197 = c7d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3198 = c7e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3199 = c7f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3200 = c80 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3201 = c81 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3202 = c82 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3203 = c83 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3204 = c84 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3205 = c85 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3206 = c86 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3207 = c87 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3208 = c88 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3209 = c89 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3210 = c8a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3211 = c8b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3212 = c8c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3213 = c8d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3214 = c8e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3215 = c8f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3216 = c90 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3217 = c91 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3218 = c92 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3219 = c93 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3220 = c94 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3221 = c95 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3222 = c96 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3223 = c97 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3224 = c98 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3225 = c99 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3226 = c9a */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3227 = c9b */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3228 = c9c */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3229 = c9d */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3230 = c9e */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3231 = c9f */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3232 = ca0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3233 = ca1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3234 = ca2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3235 = ca3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3236 = ca4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3237 = ca5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3238 = ca6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3239 = ca7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3240 = ca8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3241 = ca9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3242 = caa */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3243 = cab */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3244 = cac */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3245 = cad */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3246 = cae */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3247 = caf */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3248 = cb0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3249 = cb1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3250 = cb2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3251 = cb3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3252 = cb4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3253 = cb5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3254 = cb6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3255 = cb7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3256 = cb8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3257 = cb9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3258 = cba */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3259 = cbb */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3260 = cbc */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3261 = cbd */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3262 = cbe */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3263 = cbf */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3264 = cc0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3265 = cc1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3266 = cc2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3267 = cc3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3268 = cc4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3269 = cc5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3270 = cc6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3271 = cc7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3272 = cc8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3273 = cc9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3274 = cca */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3275 = ccb */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3276 = ccc */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3277 = ccd */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3278 = cce */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3279 = ccf */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3280 = cd0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3281 = cd1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3282 = cd2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3283 = cd3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3284 = cd4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3285 = cd5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3286 = cd6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3287 = cd7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3288 = cd8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3289 = cd9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3290 = cda */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3291 = cdb */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3292 = cdc */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3293 = cdd */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3294 = cde */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3295 = cdf */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3296 = ce0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3297 = ce1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3298 = ce2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3299 = ce3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3300 = ce4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3301 = ce5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3302 = ce6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3303 = ce7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3304 = ce8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3305 = ce9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3306 = cea */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3307 = ceb */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3308 = cec */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3309 = ced */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3310 = cee */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3311 = cef */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3312 = cf0 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3313 = cf1 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3314 = cf2 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3315 = cf3 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3316 = cf4 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3317 = cf5 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3318 = cf6 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3319 = cf7 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3320 = cf8 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3321 = cf9 */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3322 = cfa */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3323 = cfb */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3324 = cfc */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3325 = cfd */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3326 = cfe */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3327 = cff */ {5, 0, 4}, /* 0x000c => 0x0c00+(256)*/ - /* 3328 = d00 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3329 = d01 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3330 = d02 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3331 = d03 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3332 = d04 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3333 = d05 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3334 = d06 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3335 = d07 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3336 = d08 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3337 = d09 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3338 = d0a */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3339 = d0b */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3340 = d0c */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3341 = d0d */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3342 = d0e */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3343 = d0f */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3344 = d10 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3345 = d11 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3346 = d12 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3347 = d13 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3348 = d14 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3349 = d15 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3350 = d16 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3351 = d17 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3352 = d18 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3353 = d19 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3354 = d1a */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3355 = d1b */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3356 = d1c */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3357 = d1d */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3358 = d1e */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3359 = d1f */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3360 = d20 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3361 = d21 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3362 = d22 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3363 = d23 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3364 = d24 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3365 = d25 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3366 = d26 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3367 = d27 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3368 = d28 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3369 = d29 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3370 = d2a */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3371 = d2b */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3372 = d2c */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3373 = d2d */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3374 = d2e */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3375 = d2f */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3376 = d30 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3377 = d31 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3378 = d32 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3379 = d33 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3380 = d34 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3381 = d35 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3382 = d36 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3383 = d37 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3384 = d38 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3385 = d39 */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3386 = d3a */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3387 = d3b */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3388 = d3c */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3389 = d3d */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3390 = d3e */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3391 = d3f */ {14, 0, 6}, /* 0x0034 => 0x0d00+(64)*/ - /* 3392 = d40 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3393 = d41 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3394 = d42 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3395 = d43 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3396 = d44 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3397 = d45 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3398 = d46 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3399 = d47 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3400 = d48 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3401 = d49 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3402 = d4a */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3403 = d4b */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3404 = d4c */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3405 = d4d */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3406 = d4e */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3407 = d4f */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3408 = d50 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3409 = d51 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3410 = d52 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3411 = d53 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3412 = d54 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3413 = d55 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3414 = d56 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3415 = d57 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3416 = d58 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3417 = d59 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3418 = d5a */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3419 = d5b */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3420 = d5c */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3421 = d5d */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3422 = d5e */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3423 = d5f */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3424 = d60 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3425 = d61 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3426 = d62 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3427 = d63 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3428 = d64 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3429 = d65 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3430 = d66 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3431 = d67 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3432 = d68 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3433 = d69 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3434 = d6a */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3435 = d6b */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3436 = d6c */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3437 = d6d */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3438 = d6e */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3439 = d6f */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3440 = d70 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3441 = d71 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3442 = d72 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3443 = d73 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3444 = d74 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3445 = d75 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3446 = d76 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3447 = d77 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3448 = d78 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3449 = d79 */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3450 = d7a */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3451 = d7b */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3452 = d7c */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3453 = d7d */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3454 = d7e */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3455 = d7f */ {15, 0, 6}, /* 0x0035 => 0x0d40+(64)*/ - /* 3456 = d80 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3457 = d81 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3458 = d82 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3459 = d83 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3460 = d84 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3461 = d85 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3462 = d86 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3463 = d87 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3464 = d88 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3465 = d89 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3466 = d8a */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3467 = d8b */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3468 = d8c */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3469 = d8d */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3470 = d8e */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3471 = d8f */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3472 = d90 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3473 = d91 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3474 = d92 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3475 = d93 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3476 = d94 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3477 = d95 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3478 = d96 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3479 = d97 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3480 = d98 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3481 = d99 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3482 = d9a */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3483 = d9b */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3484 = d9c */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3485 = d9d */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3486 = d9e */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3487 = d9f */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3488 = da0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3489 = da1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3490 = da2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3491 = da3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3492 = da4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3493 = da5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3494 = da6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3495 = da7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3496 = da8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3497 = da9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3498 = daa */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3499 = dab */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3500 = dac */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3501 = dad */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3502 = dae */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3503 = daf */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3504 = db0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3505 = db1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3506 = db2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3507 = db3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3508 = db4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3509 = db5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3510 = db6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3511 = db7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3512 = db8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3513 = db9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3514 = dba */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3515 = dbb */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3516 = dbc */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3517 = dbd */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3518 = dbe */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3519 = dbf */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3520 = dc0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3521 = dc1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3522 = dc2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3523 = dc3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3524 = dc4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3525 = dc5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3526 = dc6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3527 = dc7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3528 = dc8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3529 = dc9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3530 = dca */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3531 = dcb */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3532 = dcc */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3533 = dcd */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3534 = dce */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3535 = dcf */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3536 = dd0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3537 = dd1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3538 = dd2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3539 = dd3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3540 = dd4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3541 = dd5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3542 = dd6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3543 = dd7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3544 = dd8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3545 = dd9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3546 = dda */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3547 = ddb */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3548 = ddc */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3549 = ddd */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3550 = dde */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3551 = ddf */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3552 = de0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3553 = de1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3554 = de2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3555 = de3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3556 = de4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3557 = de5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3558 = de6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3559 = de7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3560 = de8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3561 = de9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3562 = dea */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3563 = deb */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3564 = dec */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3565 = ded */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3566 = dee */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3567 = def */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3568 = df0 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3569 = df1 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3570 = df2 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3571 = df3 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3572 = df4 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3573 = df5 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3574 = df6 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3575 = df7 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3576 = df8 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3577 = df9 */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3578 = dfa */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3579 = dfb */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3580 = dfc */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3581 = dfd */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3582 = dfe */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3583 = dff */ {64, 1, 5}, /* 0x001b => 0x0d80+(128)*/ - /* 3584 = e00 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3585 = e01 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3586 = e02 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3587 = e03 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3588 = e04 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3589 = e05 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3590 = e06 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3591 = e07 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3592 = e08 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3593 = e09 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3594 = e0a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3595 = e0b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3596 = e0c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3597 = e0d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3598 = e0e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3599 = e0f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3600 = e10 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3601 = e11 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3602 = e12 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3603 = e13 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3604 = e14 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3605 = e15 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3606 = e16 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3607 = e17 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3608 = e18 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3609 = e19 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3610 = e1a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3611 = e1b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3612 = e1c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3613 = e1d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3614 = e1e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3615 = e1f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3616 = e20 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3617 = e21 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3618 = e22 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3619 = e23 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3620 = e24 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3621 = e25 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3622 = e26 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3623 = e27 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3624 = e28 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3625 = e29 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3626 = e2a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3627 = e2b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3628 = e2c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3629 = e2d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3630 = e2e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3631 = e2f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3632 = e30 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3633 = e31 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3634 = e32 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3635 = e33 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3636 = e34 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3637 = e35 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3638 = e36 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3639 = e37 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3640 = e38 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3641 = e39 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3642 = e3a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3643 = e3b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3644 = e3c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3645 = e3d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3646 = e3e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3647 = e3f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3648 = e40 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3649 = e41 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3650 = e42 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3651 = e43 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3652 = e44 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3653 = e45 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3654 = e46 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3655 = e47 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3656 = e48 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3657 = e49 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3658 = e4a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3659 = e4b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3660 = e4c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3661 = e4d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3662 = e4e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3663 = e4f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3664 = e50 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3665 = e51 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3666 = e52 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3667 = e53 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3668 = e54 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3669 = e55 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3670 = e56 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3671 = e57 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3672 = e58 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3673 = e59 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3674 = e5a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3675 = e5b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3676 = e5c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3677 = e5d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3678 = e5e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3679 = e5f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3680 = e60 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3681 = e61 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3682 = e62 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3683 = e63 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3684 = e64 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3685 = e65 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3686 = e66 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3687 = e67 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3688 = e68 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3689 = e69 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3690 = e6a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3691 = e6b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3692 = e6c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3693 = e6d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3694 = e6e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3695 = e6f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3696 = e70 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3697 = e71 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3698 = e72 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3699 = e73 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3700 = e74 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3701 = e75 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3702 = e76 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3703 = e77 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3704 = e78 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3705 = e79 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3706 = e7a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3707 = e7b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3708 = e7c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3709 = e7d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3710 = e7e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3711 = e7f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3712 = e80 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3713 = e81 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3714 = e82 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3715 = e83 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3716 = e84 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3717 = e85 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3718 = e86 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3719 = e87 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3720 = e88 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3721 = e89 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3722 = e8a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3723 = e8b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3724 = e8c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3725 = e8d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3726 = e8e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3727 = e8f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3728 = e90 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3729 = e91 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3730 = e92 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3731 = e93 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3732 = e94 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3733 = e95 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3734 = e96 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3735 = e97 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3736 = e98 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3737 = e99 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3738 = e9a */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3739 = e9b */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3740 = e9c */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3741 = e9d */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3742 = e9e */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3743 = e9f */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3744 = ea0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3745 = ea1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3746 = ea2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3747 = ea3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3748 = ea4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3749 = ea5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3750 = ea6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3751 = ea7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3752 = ea8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3753 = ea9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3754 = eaa */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3755 = eab */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3756 = eac */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3757 = ead */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3758 = eae */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3759 = eaf */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3760 = eb0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3761 = eb1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3762 = eb2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3763 = eb3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3764 = eb4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3765 = eb5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3766 = eb6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3767 = eb7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3768 = eb8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3769 = eb9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3770 = eba */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3771 = ebb */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3772 = ebc */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3773 = ebd */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3774 = ebe */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3775 = ebf */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3776 = ec0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3777 = ec1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3778 = ec2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3779 = ec3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3780 = ec4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3781 = ec5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3782 = ec6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3783 = ec7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3784 = ec8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3785 = ec9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3786 = eca */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3787 = ecb */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3788 = ecc */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3789 = ecd */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3790 = ece */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3791 = ecf */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3792 = ed0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3793 = ed1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3794 = ed2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3795 = ed3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3796 = ed4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3797 = ed5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3798 = ed6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3799 = ed7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3800 = ed8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3801 = ed9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3802 = eda */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3803 = edb */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3804 = edc */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3805 = edd */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3806 = ede */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3807 = edf */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3808 = ee0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3809 = ee1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3810 = ee2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3811 = ee3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3812 = ee4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3813 = ee5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3814 = ee6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3815 = ee7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3816 = ee8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3817 = ee9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3818 = eea */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3819 = eeb */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3820 = eec */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3821 = eed */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3822 = eee */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3823 = eef */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3824 = ef0 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3825 = ef1 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3826 = ef2 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3827 = ef3 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3828 = ef4 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3829 = ef5 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3830 = ef6 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3831 = ef7 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3832 = ef8 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3833 = ef9 */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3834 = efa */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3835 = efb */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3836 = efc */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3837 = efd */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3838 = efe */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3839 = eff */ {6, 0, 4}, /* 0x000e => 0x0e00+(256)*/ - /* 3840 = f00 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3841 = f01 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3842 = f02 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3843 = f03 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3844 = f04 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3845 = f05 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3846 = f06 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3847 = f07 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3848 = f08 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3849 = f09 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3850 = f0a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3851 = f0b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3852 = f0c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3853 = f0d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3854 = f0e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3855 = f0f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3856 = f10 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3857 = f11 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3858 = f12 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3859 = f13 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3860 = f14 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3861 = f15 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3862 = f16 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3863 = f17 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3864 = f18 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3865 = f19 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3866 = f1a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3867 = f1b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3868 = f1c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3869 = f1d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3870 = f1e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3871 = f1f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3872 = f20 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3873 = f21 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3874 = f22 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3875 = f23 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3876 = f24 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3877 = f25 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3878 = f26 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3879 = f27 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3880 = f28 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3881 = f29 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3882 = f2a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3883 = f2b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3884 = f2c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3885 = f2d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3886 = f2e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3887 = f2f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3888 = f30 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3889 = f31 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3890 = f32 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3891 = f33 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3892 = f34 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3893 = f35 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3894 = f36 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3895 = f37 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3896 = f38 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3897 = f39 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3898 = f3a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3899 = f3b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3900 = f3c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3901 = f3d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3902 = f3e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3903 = f3f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3904 = f40 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3905 = f41 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3906 = f42 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3907 = f43 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3908 = f44 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3909 = f45 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3910 = f46 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3911 = f47 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3912 = f48 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3913 = f49 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3914 = f4a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3915 = f4b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3916 = f4c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3917 = f4d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3918 = f4e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3919 = f4f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3920 = f50 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3921 = f51 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3922 = f52 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3923 = f53 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3924 = f54 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3925 = f55 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3926 = f56 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3927 = f57 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3928 = f58 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3929 = f59 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3930 = f5a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3931 = f5b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3932 = f5c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3933 = f5d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3934 = f5e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3935 = f5f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3936 = f60 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3937 = f61 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3938 = f62 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3939 = f63 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3940 = f64 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3941 = f65 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3942 = f66 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3943 = f67 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3944 = f68 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3945 = f69 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3946 = f6a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3947 = f6b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3948 = f6c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3949 = f6d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3950 = f6e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3951 = f6f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3952 = f70 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3953 = f71 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3954 = f72 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3955 = f73 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3956 = f74 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3957 = f75 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3958 = f76 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3959 = f77 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3960 = f78 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3961 = f79 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3962 = f7a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3963 = f7b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3964 = f7c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3965 = f7d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3966 = f7e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3967 = f7f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3968 = f80 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3969 = f81 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3970 = f82 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3971 = f83 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3972 = f84 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3973 = f85 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3974 = f86 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3975 = f87 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3976 = f88 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3977 = f89 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3978 = f8a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3979 = f8b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3980 = f8c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3981 = f8d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3982 = f8e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3983 = f8f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3984 = f90 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3985 = f91 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3986 = f92 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3987 = f93 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3988 = f94 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3989 = f95 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3990 = f96 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3991 = f97 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3992 = f98 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3993 = f99 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3994 = f9a */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3995 = f9b */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3996 = f9c */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3997 = f9d */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3998 = f9e */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 3999 = f9f */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4000 = fa0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4001 = fa1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4002 = fa2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4003 = fa3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4004 = fa4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4005 = fa5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4006 = fa6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4007 = fa7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4008 = fa8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4009 = fa9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4010 = faa */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4011 = fab */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4012 = fac */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4013 = fad */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4014 = fae */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4015 = faf */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4016 = fb0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4017 = fb1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4018 = fb2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4019 = fb3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4020 = fb4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4021 = fb5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4022 = fb6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4023 = fb7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4024 = fb8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4025 = fb9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4026 = fba */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4027 = fbb */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4028 = fbc */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4029 = fbd */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4030 = fbe */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4031 = fbf */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4032 = fc0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4033 = fc1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4034 = fc2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4035 = fc3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4036 = fc4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4037 = fc5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4038 = fc6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4039 = fc7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4040 = fc8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4041 = fc9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4042 = fca */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4043 = fcb */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4044 = fcc */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4045 = fcd */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4046 = fce */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4047 = fcf */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4048 = fd0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4049 = fd1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4050 = fd2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4051 = fd3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4052 = fd4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4053 = fd5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4054 = fd6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4055 = fd7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4056 = fd8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4057 = fd9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4058 = fda */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4059 = fdb */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4060 = fdc */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4061 = fdd */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4062 = fde */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4063 = fdf */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4064 = fe0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4065 = fe1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4066 = fe2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4067 = fe3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4068 = fe4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4069 = fe5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4070 = fe6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4071 = fe7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4072 = fe8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4073 = fe9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4074 = fea */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4075 = feb */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4076 = fec */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4077 = fed */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4078 = fee */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4079 = fef */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4080 = ff0 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4081 = ff1 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4082 = ff2 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4083 = ff3 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4084 = ff4 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4085 = ff5 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4086 = ff6 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4087 = ff7 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4088 = ff8 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4089 = ff9 */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4090 = ffa */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4091 = ffb */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4092 = ffc */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4093 = ffd */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4094 = ffe */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ - /* 4095 = fff */ {7, 0, 4}, /* 0x000f => 0x0f00+(256)*/ -}; - -/* black table */ -BlackTable _BlackFaxTable[] = { - /* 0 = 0 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 1 = 1 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 2 = 2 */ {-2, 0, 12}, /* 0x0001 => 0x0002+(2)*/ - /* 3 = 3 */ {-2, 0, 12}, /* 0x0001 => 0x0002+(2)*/ - /* 4 = 4 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 5 = 5 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 6 = 6 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 7 = 7 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 8 = 8 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 9 = 9 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 10 = a */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 11 = b */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 12 = c */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 13 = d */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 14 = e */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 15 = f */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 16 = 10 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 17 = 11 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 18 = 12 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 19 = 13 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 20 = 14 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 21 = 15 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 22 = 16 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 23 = 17 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 24 = 18 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 25 = 19 */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 26 = 1a */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 27 = 1b */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 28 = 1c */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 29 = 1d */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 30 = 1e */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 31 = 1f */ {-1, 0, 0}, /* 0x0000 => 0x0000+(8192)*/ - /* 32 = 20 */ {1792, 1, 11}, /* 0x0008 => 0x0020+(4)*/ - /* 33 = 21 */ {1792, 1, 11}, /* 0x0008 => 0x0020+(4)*/ - /* 34 = 22 */ {1792, 1, 11}, /* 0x0008 => 0x0020+(4)*/ - /* 35 = 23 */ {1792, 1, 11}, /* 0x0008 => 0x0020+(4)*/ - /* 36 = 24 */ {1984, 1, 12}, /* 0x0012 => 0x0024+(2)*/ - /* 37 = 25 */ {1984, 1, 12}, /* 0x0012 => 0x0024+(2)*/ - /* 38 = 26 */ {2048, 1, 12}, /* 0x0013 => 0x0026+(2)*/ - /* 39 = 27 */ {2048, 1, 12}, /* 0x0013 => 0x0026+(2)*/ - /* 40 = 28 */ {2112, 1, 12}, /* 0x0014 => 0x0028+(2)*/ - /* 41 = 29 */ {2112, 1, 12}, /* 0x0014 => 0x0028+(2)*/ - /* 42 = 2a */ {2176, 1, 12}, /* 0x0015 => 0x002a+(2)*/ - /* 43 = 2b */ {2176, 1, 12}, /* 0x0015 => 0x002a+(2)*/ - /* 44 = 2c */ {2240, 1, 12}, /* 0x0016 => 0x002c+(2)*/ - /* 45 = 2d */ {2240, 1, 12}, /* 0x0016 => 0x002c+(2)*/ - /* 46 = 2e */ {2304, 1, 12}, /* 0x0017 => 0x002e+(2)*/ - /* 47 = 2f */ {2304, 1, 12}, /* 0x0017 => 0x002e+(2)*/ - /* 48 = 30 */ {1856, 1, 11}, /* 0x000c => 0x0030+(4)*/ - /* 49 = 31 */ {1856, 1, 11}, /* 0x000c => 0x0030+(4)*/ - /* 50 = 32 */ {1856, 1, 11}, /* 0x000c => 0x0030+(4)*/ - /* 51 = 33 */ {1856, 1, 11}, /* 0x000c => 0x0030+(4)*/ - /* 52 = 34 */ {1920, 1, 11}, /* 0x000d => 0x0034+(4)*/ - /* 53 = 35 */ {1920, 1, 11}, /* 0x000d => 0x0034+(4)*/ - /* 54 = 36 */ {1920, 1, 11}, /* 0x000d => 0x0034+(4)*/ - /* 55 = 37 */ {1920, 1, 11}, /* 0x000d => 0x0034+(4)*/ - /* 56 = 38 */ {2368, 1, 12}, /* 0x001c => 0x0038+(2)*/ - /* 57 = 39 */ {2368, 1, 12}, /* 0x001c => 0x0038+(2)*/ - /* 58 = 3a */ {2432, 1, 12}, /* 0x001d => 0x003a+(2)*/ - /* 59 = 3b */ {2432, 1, 12}, /* 0x001d => 0x003a+(2)*/ - /* 60 = 3c */ {2496, 1, 12}, /* 0x001e => 0x003c+(2)*/ - /* 61 = 3d */ {2496, 1, 12}, /* 0x001e => 0x003c+(2)*/ - /* 62 = 3e */ {2560, 1, 12}, /* 0x001f => 0x003e+(2)*/ - /* 63 = 3f */ {2560, 1, 12}, /* 0x001f => 0x003e+(2)*/ - /* 64 = 40 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 65 = 41 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 66 = 42 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 67 = 43 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 68 = 44 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 69 = 45 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 70 = 46 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 71 = 47 */ {18, 0, 10}, /* 0x0008 => 0x0040+(8)*/ - /* 72 = 48 */ {52, 0, 12}, /* 0x0024 => 0x0048+(2)*/ - /* 73 = 49 */ {52, 0, 12}, /* 0x0024 => 0x0048+(2)*/ - /* 74 = 4a */ {640, 1, 13}, /* 0x004a => 0x004a+(1)*/ - /* 75 = 4b */ {704, 1, 13}, /* 0x004b => 0x004b+(1)*/ - /* 76 = 4c */ {768, 1, 13}, /* 0x004c => 0x004c+(1)*/ - /* 77 = 4d */ {832, 1, 13}, /* 0x004d => 0x004d+(1)*/ - /* 78 = 4e */ {55, 0, 12}, /* 0x0027 => 0x004e+(2)*/ - /* 79 = 4f */ {55, 0, 12}, /* 0x0027 => 0x004e+(2)*/ - /* 80 = 50 */ {56, 0, 12}, /* 0x0028 => 0x0050+(2)*/ - /* 81 = 51 */ {56, 0, 12}, /* 0x0028 => 0x0050+(2)*/ - /* 82 = 52 */ {1280, 1, 13}, /* 0x0052 => 0x0052+(1)*/ - /* 83 = 53 */ {1344, 1, 13}, /* 0x0053 => 0x0053+(1)*/ - /* 84 = 54 */ {1408, 1, 13}, /* 0x0054 => 0x0054+(1)*/ - /* 85 = 55 */ {1472, 1, 13}, /* 0x0055 => 0x0055+(1)*/ - /* 86 = 56 */ {59, 0, 12}, /* 0x002b => 0x0056+(2)*/ - /* 87 = 57 */ {59, 0, 12}, /* 0x002b => 0x0056+(2)*/ - /* 88 = 58 */ {60, 0, 12}, /* 0x002c => 0x0058+(2)*/ - /* 89 = 59 */ {60, 0, 12}, /* 0x002c => 0x0058+(2)*/ - /* 90 = 5a */ {1536, 1, 13}, /* 0x005a => 0x005a+(1)*/ - /* 91 = 5b */ {1600, 1, 13}, /* 0x005b => 0x005b+(1)*/ - /* 92 = 5c */ {24, 0, 11}, /* 0x0017 => 0x005c+(4)*/ - /* 93 = 5d */ {24, 0, 11}, /* 0x0017 => 0x005c+(4)*/ - /* 94 = 5e */ {24, 0, 11}, /* 0x0017 => 0x005c+(4)*/ - /* 95 = 5f */ {24, 0, 11}, /* 0x0017 => 0x005c+(4)*/ - /* 96 = 60 */ {25, 0, 11}, /* 0x0018 => 0x0060+(4)*/ - /* 97 = 61 */ {25, 0, 11}, /* 0x0018 => 0x0060+(4)*/ - /* 98 = 62 */ {25, 0, 11}, /* 0x0018 => 0x0060+(4)*/ - /* 99 = 63 */ {25, 0, 11}, /* 0x0018 => 0x0060+(4)*/ - /* 100 = 64 */ {1664, 1, 13}, /* 0x0064 => 0x0064+(1)*/ - /* 101 = 65 */ {1728, 1, 13}, /* 0x0065 => 0x0065+(1)*/ - /* 102 = 66 */ {320, 1, 12}, /* 0x0033 => 0x0066+(2)*/ - /* 103 = 67 */ {320, 1, 12}, /* 0x0033 => 0x0066+(2)*/ - /* 104 = 68 */ {384, 1, 12}, /* 0x0034 => 0x0068+(2)*/ - /* 105 = 69 */ {384, 1, 12}, /* 0x0034 => 0x0068+(2)*/ - /* 106 = 6a */ {448, 1, 12}, /* 0x0035 => 0x006a+(2)*/ - /* 107 = 6b */ {448, 1, 12}, /* 0x0035 => 0x006a+(2)*/ - /* 108 = 6c */ {512, 1, 13}, /* 0x006c => 0x006c+(1)*/ - /* 109 = 6d */ {576, 1, 13}, /* 0x006d => 0x006d+(1)*/ - /* 110 = 6e */ {53, 0, 12}, /* 0x0037 => 0x006e+(2)*/ - /* 111 = 6f */ {53, 0, 12}, /* 0x0037 => 0x006e+(2)*/ - /* 112 = 70 */ {54, 0, 12}, /* 0x0038 => 0x0070+(2)*/ - /* 113 = 71 */ {54, 0, 12}, /* 0x0038 => 0x0070+(2)*/ - /* 114 = 72 */ {896, 1, 13}, /* 0x0072 => 0x0072+(1)*/ - /* 115 = 73 */ {960, 1, 13}, /* 0x0073 => 0x0073+(1)*/ - /* 116 = 74 */ {1024, 1, 13}, /* 0x0074 => 0x0074+(1)*/ - /* 117 = 75 */ {1088, 1, 13}, /* 0x0075 => 0x0075+(1)*/ - /* 118 = 76 */ {1152, 1, 13}, /* 0x0076 => 0x0076+(1)*/ - /* 119 = 77 */ {1216, 1, 13}, /* 0x0077 => 0x0077+(1)*/ - /* 120 = 78 */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 121 = 79 */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 122 = 7a */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 123 = 7b */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 124 = 7c */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 125 = 7d */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 126 = 7e */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 127 = 7f */ {64, 1, 10}, /* 0x000f => 0x0078+(8)*/ - /* 128 = 80 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 129 = 81 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 130 = 82 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 131 = 83 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 132 = 84 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 133 = 85 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 134 = 86 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 135 = 87 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 136 = 88 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 137 = 89 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 138 = 8a */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 139 = 8b */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 140 = 8c */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 141 = 8d */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 142 = 8e */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 143 = 8f */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 144 = 90 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 145 = 91 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 146 = 92 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 147 = 93 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 148 = 94 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 149 = 95 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 150 = 96 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 151 = 97 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 152 = 98 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 153 = 99 */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 154 = 9a */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 155 = 9b */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 156 = 9c */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 157 = 9d */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 158 = 9e */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 159 = 9f */ {13, 0, 8}, /* 0x0004 => 0x0080+(32)*/ - /* 160 = a0 */ {23, 0, 11}, /* 0x0028 => 0x00a0+(4)*/ - /* 161 = a1 */ {23, 0, 11}, /* 0x0028 => 0x00a0+(4)*/ - /* 162 = a2 */ {23, 0, 11}, /* 0x0028 => 0x00a0+(4)*/ - /* 163 = a3 */ {23, 0, 11}, /* 0x0028 => 0x00a0+(4)*/ - /* 164 = a4 */ {50, 0, 12}, /* 0x0052 => 0x00a4+(2)*/ - /* 165 = a5 */ {50, 0, 12}, /* 0x0052 => 0x00a4+(2)*/ - /* 166 = a6 */ {51, 0, 12}, /* 0x0053 => 0x00a6+(2)*/ - /* 167 = a7 */ {51, 0, 12}, /* 0x0053 => 0x00a6+(2)*/ - /* 168 = a8 */ {44, 0, 12}, /* 0x0054 => 0x00a8+(2)*/ - /* 169 = a9 */ {44, 0, 12}, /* 0x0054 => 0x00a8+(2)*/ - /* 170 = aa */ {45, 0, 12}, /* 0x0055 => 0x00aa+(2)*/ - /* 171 = ab */ {45, 0, 12}, /* 0x0055 => 0x00aa+(2)*/ - /* 172 = ac */ {46, 0, 12}, /* 0x0056 => 0x00ac+(2)*/ - /* 173 = ad */ {46, 0, 12}, /* 0x0056 => 0x00ac+(2)*/ - /* 174 = ae */ {47, 0, 12}, /* 0x0057 => 0x00ae+(2)*/ - /* 175 = af */ {47, 0, 12}, /* 0x0057 => 0x00ae+(2)*/ - /* 176 = b0 */ {57, 0, 12}, /* 0x0058 => 0x00b0+(2)*/ - /* 177 = b1 */ {57, 0, 12}, /* 0x0058 => 0x00b0+(2)*/ - /* 178 = b2 */ {58, 0, 12}, /* 0x0059 => 0x00b2+(2)*/ - /* 179 = b3 */ {58, 0, 12}, /* 0x0059 => 0x00b2+(2)*/ - /* 180 = b4 */ {61, 0, 12}, /* 0x005a => 0x00b4+(2)*/ - /* 181 = b5 */ {61, 0, 12}, /* 0x005a => 0x00b4+(2)*/ - /* 182 = b6 */ {256, 1, 12}, /* 0x005b => 0x00b6+(2)*/ - /* 183 = b7 */ {256, 1, 12}, /* 0x005b => 0x00b6+(2)*/ - /* 184 = b8 */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 185 = b9 */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 186 = ba */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 187 = bb */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 188 = bc */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 189 = bd */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 190 = be */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 191 = bf */ {16, 0, 10}, /* 0x0017 => 0x00b8+(8)*/ - /* 192 = c0 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 193 = c1 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 194 = c2 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 195 = c3 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 196 = c4 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 197 = c5 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 198 = c6 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 199 = c7 */ {17, 0, 10}, /* 0x0018 => 0x00c0+(8)*/ - /* 200 = c8 */ {48, 0, 12}, /* 0x0064 => 0x00c8+(2)*/ - /* 201 = c9 */ {48, 0, 12}, /* 0x0064 => 0x00c8+(2)*/ - /* 202 = ca */ {49, 0, 12}, /* 0x0065 => 0x00ca+(2)*/ - /* 203 = cb */ {49, 0, 12}, /* 0x0065 => 0x00ca+(2)*/ - /* 204 = cc */ {62, 0, 12}, /* 0x0066 => 0x00cc+(2)*/ - /* 205 = cd */ {62, 0, 12}, /* 0x0066 => 0x00cc+(2)*/ - /* 206 = ce */ {63, 0, 12}, /* 0x0067 => 0x00ce+(2)*/ - /* 207 = cf */ {63, 0, 12}, /* 0x0067 => 0x00ce+(2)*/ - /* 208 = d0 */ {30, 0, 12}, /* 0x0068 => 0x00d0+(2)*/ - /* 209 = d1 */ {30, 0, 12}, /* 0x0068 => 0x00d0+(2)*/ - /* 210 = d2 */ {31, 0, 12}, /* 0x0069 => 0x00d2+(2)*/ - /* 211 = d3 */ {31, 0, 12}, /* 0x0069 => 0x00d2+(2)*/ - /* 212 = d4 */ {32, 0, 12}, /* 0x006a => 0x00d4+(2)*/ - /* 213 = d5 */ {32, 0, 12}, /* 0x006a => 0x00d4+(2)*/ - /* 214 = d6 */ {33, 0, 12}, /* 0x006b => 0x00d6+(2)*/ - /* 215 = d7 */ {33, 0, 12}, /* 0x006b => 0x00d6+(2)*/ - /* 216 = d8 */ {40, 0, 12}, /* 0x006c => 0x00d8+(2)*/ - /* 217 = d9 */ {40, 0, 12}, /* 0x006c => 0x00d8+(2)*/ - /* 218 = da */ {41, 0, 12}, /* 0x006d => 0x00da+(2)*/ - /* 219 = db */ {41, 0, 12}, /* 0x006d => 0x00da+(2)*/ - /* 220 = dc */ {22, 0, 11}, /* 0x0037 => 0x00dc+(4)*/ - /* 221 = dd */ {22, 0, 11}, /* 0x0037 => 0x00dc+(4)*/ - /* 222 = de */ {22, 0, 11}, /* 0x0037 => 0x00dc+(4)*/ - /* 223 = df */ {22, 0, 11}, /* 0x0037 => 0x00dc+(4)*/ - /* 224 = e0 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 225 = e1 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 226 = e2 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 227 = e3 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 228 = e4 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 229 = e5 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 230 = e6 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 231 = e7 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 232 = e8 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 233 = e9 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 234 = ea */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 235 = eb */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 236 = ec */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 237 = ed */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 238 = ee */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 239 = ef */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 240 = f0 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 241 = f1 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 242 = f2 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 243 = f3 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 244 = f4 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 245 = f5 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 246 = f6 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 247 = f7 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 248 = f8 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 249 = f9 */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 250 = fa */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 251 = fb */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 252 = fc */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 253 = fd */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 254 = fe */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 255 = ff */ {14, 0, 8}, /* 0x0007 => 0x00e0+(32)*/ - /* 256 = 100 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 257 = 101 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 258 = 102 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 259 = 103 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 260 = 104 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 261 = 105 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 262 = 106 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 263 = 107 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 264 = 108 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 265 = 109 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 266 = 10a */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 267 = 10b */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 268 = 10c */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 269 = 10d */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 270 = 10e */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 271 = 10f */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 272 = 110 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 273 = 111 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 274 = 112 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 275 = 113 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 276 = 114 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 277 = 115 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 278 = 116 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 279 = 117 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 280 = 118 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 281 = 119 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 282 = 11a */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 283 = 11b */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 284 = 11c */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 285 = 11d */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 286 = 11e */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 287 = 11f */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 288 = 120 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 289 = 121 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 290 = 122 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 291 = 123 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 292 = 124 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 293 = 125 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 294 = 126 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 295 = 127 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 296 = 128 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 297 = 129 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 298 = 12a */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 299 = 12b */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 300 = 12c */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 301 = 12d */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 302 = 12e */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 303 = 12f */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 304 = 130 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 305 = 131 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 306 = 132 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 307 = 133 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 308 = 134 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 309 = 135 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 310 = 136 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 311 = 137 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 312 = 138 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 313 = 139 */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 314 = 13a */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 315 = 13b */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 316 = 13c */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 317 = 13d */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 318 = 13e */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 319 = 13f */ {10, 0, 7}, /* 0x0004 => 0x0100+(64)*/ - /* 320 = 140 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 321 = 141 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 322 = 142 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 323 = 143 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 324 = 144 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 325 = 145 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 326 = 146 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 327 = 147 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 328 = 148 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 329 = 149 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 330 = 14a */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 331 = 14b */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 332 = 14c */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 333 = 14d */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 334 = 14e */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 335 = 14f */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 336 = 150 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 337 = 151 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 338 = 152 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 339 = 153 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 340 = 154 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 341 = 155 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 342 = 156 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 343 = 157 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 344 = 158 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 345 = 159 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 346 = 15a */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 347 = 15b */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 348 = 15c */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 349 = 15d */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 350 = 15e */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 351 = 15f */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 352 = 160 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 353 = 161 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 354 = 162 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 355 = 163 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 356 = 164 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 357 = 165 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 358 = 166 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 359 = 167 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 360 = 168 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 361 = 169 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 362 = 16a */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 363 = 16b */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 364 = 16c */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 365 = 16d */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 366 = 16e */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 367 = 16f */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 368 = 170 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 369 = 171 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 370 = 172 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 371 = 173 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 372 = 174 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 373 = 175 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 374 = 176 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 375 = 177 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 376 = 178 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 377 = 179 */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 378 = 17a */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 379 = 17b */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 380 = 17c */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 381 = 17d */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 382 = 17e */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 383 = 17f */ {11, 0, 7}, /* 0x0005 => 0x0140+(64)*/ - /* 384 = 180 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 385 = 181 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 386 = 182 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 387 = 183 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 388 = 184 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 389 = 185 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 390 = 186 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 391 = 187 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 392 = 188 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 393 = 189 */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 394 = 18a */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 395 = 18b */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 396 = 18c */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 397 = 18d */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 398 = 18e */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 399 = 18f */ {15, 0, 9}, /* 0x0018 => 0x0180+(16)*/ - /* 400 = 190 */ {128, 1, 12}, /* 0x00c8 => 0x0190+(2)*/ - /* 401 = 191 */ {128, 1, 12}, /* 0x00c8 => 0x0190+(2)*/ - /* 402 = 192 */ {192, 1, 12}, /* 0x00c9 => 0x0192+(2)*/ - /* 403 = 193 */ {192, 1, 12}, /* 0x00c9 => 0x0192+(2)*/ - /* 404 = 194 */ {26, 0, 12}, /* 0x00ca => 0x0194+(2)*/ - /* 405 = 195 */ {26, 0, 12}, /* 0x00ca => 0x0194+(2)*/ - /* 406 = 196 */ {27, 0, 12}, /* 0x00cb => 0x0196+(2)*/ - /* 407 = 197 */ {27, 0, 12}, /* 0x00cb => 0x0196+(2)*/ - /* 408 = 198 */ {28, 0, 12}, /* 0x00cc => 0x0198+(2)*/ - /* 409 = 199 */ {28, 0, 12}, /* 0x00cc => 0x0198+(2)*/ - /* 410 = 19a */ {29, 0, 12}, /* 0x00cd => 0x019a+(2)*/ - /* 411 = 19b */ {29, 0, 12}, /* 0x00cd => 0x019a+(2)*/ - /* 412 = 19c */ {19, 0, 11}, /* 0x0067 => 0x019c+(4)*/ - /* 413 = 19d */ {19, 0, 11}, /* 0x0067 => 0x019c+(4)*/ - /* 414 = 19e */ {19, 0, 11}, /* 0x0067 => 0x019c+(4)*/ - /* 415 = 19f */ {19, 0, 11}, /* 0x0067 => 0x019c+(4)*/ - /* 416 = 1a0 */ {20, 0, 11}, /* 0x0068 => 0x01a0+(4)*/ - /* 417 = 1a1 */ {20, 0, 11}, /* 0x0068 => 0x01a0+(4)*/ - /* 418 = 1a2 */ {20, 0, 11}, /* 0x0068 => 0x01a0+(4)*/ - /* 419 = 1a3 */ {20, 0, 11}, /* 0x0068 => 0x01a0+(4)*/ - /* 420 = 1a4 */ {34, 0, 12}, /* 0x00d2 => 0x01a4+(2)*/ - /* 421 = 1a5 */ {34, 0, 12}, /* 0x00d2 => 0x01a4+(2)*/ - /* 422 = 1a6 */ {35, 0, 12}, /* 0x00d3 => 0x01a6+(2)*/ - /* 423 = 1a7 */ {35, 0, 12}, /* 0x00d3 => 0x01a6+(2)*/ - /* 424 = 1a8 */ {36, 0, 12}, /* 0x00d4 => 0x01a8+(2)*/ - /* 425 = 1a9 */ {36, 0, 12}, /* 0x00d4 => 0x01a8+(2)*/ - /* 426 = 1aa */ {37, 0, 12}, /* 0x00d5 => 0x01aa+(2)*/ - /* 427 = 1ab */ {37, 0, 12}, /* 0x00d5 => 0x01aa+(2)*/ - /* 428 = 1ac */ {38, 0, 12}, /* 0x00d6 => 0x01ac+(2)*/ - /* 429 = 1ad */ {38, 0, 12}, /* 0x00d6 => 0x01ac+(2)*/ - /* 430 = 1ae */ {39, 0, 12}, /* 0x00d7 => 0x01ae+(2)*/ - /* 431 = 1af */ {39, 0, 12}, /* 0x00d7 => 0x01ae+(2)*/ - /* 432 = 1b0 */ {21, 0, 11}, /* 0x006c => 0x01b0+(4)*/ - /* 433 = 1b1 */ {21, 0, 11}, /* 0x006c => 0x01b0+(4)*/ - /* 434 = 1b2 */ {21, 0, 11}, /* 0x006c => 0x01b0+(4)*/ - /* 435 = 1b3 */ {21, 0, 11}, /* 0x006c => 0x01b0+(4)*/ - /* 436 = 1b4 */ {42, 0, 12}, /* 0x00da => 0x01b4+(2)*/ - /* 437 = 1b5 */ {42, 0, 12}, /* 0x00da => 0x01b4+(2)*/ - /* 438 = 1b6 */ {43, 0, 12}, /* 0x00db => 0x01b6+(2)*/ - /* 439 = 1b7 */ {43, 0, 12}, /* 0x00db => 0x01b6+(2)*/ - /* 440 = 1b8 */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 441 = 1b9 */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 442 = 1ba */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 443 = 1bb */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 444 = 1bc */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 445 = 1bd */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 446 = 1be */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 447 = 1bf */ {0, 0, 10}, /* 0x0037 => 0x01b8+(8)*/ - /* 448 = 1c0 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 449 = 1c1 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 450 = 1c2 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 451 = 1c3 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 452 = 1c4 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 453 = 1c5 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 454 = 1c6 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 455 = 1c7 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 456 = 1c8 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 457 = 1c9 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 458 = 1ca */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 459 = 1cb */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 460 = 1cc */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 461 = 1cd */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 462 = 1ce */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 463 = 1cf */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 464 = 1d0 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 465 = 1d1 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 466 = 1d2 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 467 = 1d3 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 468 = 1d4 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 469 = 1d5 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 470 = 1d6 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 471 = 1d7 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 472 = 1d8 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 473 = 1d9 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 474 = 1da */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 475 = 1db */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 476 = 1dc */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 477 = 1dd */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 478 = 1de */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 479 = 1df */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 480 = 1e0 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 481 = 1e1 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 482 = 1e2 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 483 = 1e3 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 484 = 1e4 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 485 = 1e5 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 486 = 1e6 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 487 = 1e7 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 488 = 1e8 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 489 = 1e9 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 490 = 1ea */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 491 = 1eb */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 492 = 1ec */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 493 = 1ed */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 494 = 1ee */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 495 = 1ef */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 496 = 1f0 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 497 = 1f1 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 498 = 1f2 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 499 = 1f3 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 500 = 1f4 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 501 = 1f5 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 502 = 1f6 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 503 = 1f7 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 504 = 1f8 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 505 = 1f9 */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 506 = 1fa */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 507 = 1fb */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 508 = 1fc */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 509 = 1fd */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 510 = 1fe */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 511 = 1ff */ {12, 0, 7}, /* 0x0007 => 0x01c0+(64)*/ - /* 512 = 200 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 513 = 201 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 514 = 202 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 515 = 203 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 516 = 204 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 517 = 205 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 518 = 206 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 519 = 207 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 520 = 208 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 521 = 209 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 522 = 20a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 523 = 20b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 524 = 20c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 525 = 20d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 526 = 20e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 527 = 20f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 528 = 210 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 529 = 211 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 530 = 212 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 531 = 213 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 532 = 214 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 533 = 215 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 534 = 216 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 535 = 217 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 536 = 218 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 537 = 219 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 538 = 21a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 539 = 21b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 540 = 21c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 541 = 21d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 542 = 21e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 543 = 21f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 544 = 220 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 545 = 221 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 546 = 222 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 547 = 223 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 548 = 224 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 549 = 225 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 550 = 226 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 551 = 227 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 552 = 228 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 553 = 229 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 554 = 22a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 555 = 22b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 556 = 22c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 557 = 22d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 558 = 22e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 559 = 22f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 560 = 230 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 561 = 231 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 562 = 232 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 563 = 233 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 564 = 234 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 565 = 235 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 566 = 236 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 567 = 237 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 568 = 238 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 569 = 239 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 570 = 23a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 571 = 23b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 572 = 23c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 573 = 23d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 574 = 23e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 575 = 23f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 576 = 240 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 577 = 241 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 578 = 242 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 579 = 243 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 580 = 244 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 581 = 245 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 582 = 246 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 583 = 247 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 584 = 248 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 585 = 249 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 586 = 24a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 587 = 24b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 588 = 24c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 589 = 24d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 590 = 24e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 591 = 24f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 592 = 250 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 593 = 251 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 594 = 252 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 595 = 253 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 596 = 254 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 597 = 255 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 598 = 256 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 599 = 257 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 600 = 258 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 601 = 259 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 602 = 25a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 603 = 25b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 604 = 25c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 605 = 25d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 606 = 25e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 607 = 25f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 608 = 260 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 609 = 261 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 610 = 262 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 611 = 263 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 612 = 264 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 613 = 265 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 614 = 266 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 615 = 267 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 616 = 268 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 617 = 269 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 618 = 26a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 619 = 26b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 620 = 26c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 621 = 26d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 622 = 26e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 623 = 26f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 624 = 270 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 625 = 271 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 626 = 272 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 627 = 273 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 628 = 274 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 629 = 275 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 630 = 276 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 631 = 277 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 632 = 278 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 633 = 279 */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 634 = 27a */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 635 = 27b */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 636 = 27c */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 637 = 27d */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 638 = 27e */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 639 = 27f */ {9, 0, 6}, /* 0x0004 => 0x0200+(128)*/ - /* 640 = 280 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 641 = 281 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 642 = 282 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 643 = 283 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 644 = 284 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 645 = 285 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 646 = 286 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 647 = 287 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 648 = 288 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 649 = 289 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 650 = 28a */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 651 = 28b */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 652 = 28c */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 653 = 28d */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 654 = 28e */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 655 = 28f */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 656 = 290 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 657 = 291 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 658 = 292 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 659 = 293 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 660 = 294 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 661 = 295 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 662 = 296 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 663 = 297 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 664 = 298 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 665 = 299 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 666 = 29a */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 667 = 29b */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 668 = 29c */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 669 = 29d */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 670 = 29e */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 671 = 29f */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 672 = 2a0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 673 = 2a1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 674 = 2a2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 675 = 2a3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 676 = 2a4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 677 = 2a5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 678 = 2a6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 679 = 2a7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 680 = 2a8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 681 = 2a9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 682 = 2aa */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 683 = 2ab */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 684 = 2ac */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 685 = 2ad */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 686 = 2ae */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 687 = 2af */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 688 = 2b0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 689 = 2b1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 690 = 2b2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 691 = 2b3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 692 = 2b4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 693 = 2b5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 694 = 2b6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 695 = 2b7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 696 = 2b8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 697 = 2b9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 698 = 2ba */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 699 = 2bb */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 700 = 2bc */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 701 = 2bd */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 702 = 2be */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 703 = 2bf */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 704 = 2c0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 705 = 2c1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 706 = 2c2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 707 = 2c3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 708 = 2c4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 709 = 2c5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 710 = 2c6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 711 = 2c7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 712 = 2c8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 713 = 2c9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 714 = 2ca */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 715 = 2cb */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 716 = 2cc */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 717 = 2cd */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 718 = 2ce */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 719 = 2cf */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 720 = 2d0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 721 = 2d1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 722 = 2d2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 723 = 2d3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 724 = 2d4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 725 = 2d5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 726 = 2d6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 727 = 2d7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 728 = 2d8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 729 = 2d9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 730 = 2da */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 731 = 2db */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 732 = 2dc */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 733 = 2dd */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 734 = 2de */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 735 = 2df */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 736 = 2e0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 737 = 2e1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 738 = 2e2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 739 = 2e3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 740 = 2e4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 741 = 2e5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 742 = 2e6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 743 = 2e7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 744 = 2e8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 745 = 2e9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 746 = 2ea */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 747 = 2eb */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 748 = 2ec */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 749 = 2ed */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 750 = 2ee */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 751 = 2ef */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 752 = 2f0 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 753 = 2f1 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 754 = 2f2 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 755 = 2f3 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 756 = 2f4 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 757 = 2f5 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 758 = 2f6 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 759 = 2f7 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 760 = 2f8 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 761 = 2f9 */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 762 = 2fa */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 763 = 2fb */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 764 = 2fc */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 765 = 2fd */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 766 = 2fe */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 767 = 2ff */ {8, 0, 6}, /* 0x0005 => 0x0280+(128)*/ - /* 768 = 300 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 769 = 301 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 770 = 302 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 771 = 303 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 772 = 304 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 773 = 305 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 774 = 306 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 775 = 307 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 776 = 308 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 777 = 309 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 778 = 30a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 779 = 30b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 780 = 30c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 781 = 30d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 782 = 30e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 783 = 30f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 784 = 310 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 785 = 311 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 786 = 312 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 787 = 313 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 788 = 314 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 789 = 315 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 790 = 316 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 791 = 317 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 792 = 318 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 793 = 319 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 794 = 31a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 795 = 31b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 796 = 31c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 797 = 31d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 798 = 31e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 799 = 31f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 800 = 320 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 801 = 321 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 802 = 322 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 803 = 323 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 804 = 324 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 805 = 325 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 806 = 326 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 807 = 327 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 808 = 328 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 809 = 329 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 810 = 32a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 811 = 32b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 812 = 32c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 813 = 32d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 814 = 32e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 815 = 32f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 816 = 330 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 817 = 331 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 818 = 332 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 819 = 333 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 820 = 334 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 821 = 335 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 822 = 336 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 823 = 337 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 824 = 338 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 825 = 339 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 826 = 33a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 827 = 33b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 828 = 33c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 829 = 33d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 830 = 33e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 831 = 33f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 832 = 340 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 833 = 341 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 834 = 342 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 835 = 343 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 836 = 344 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 837 = 345 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 838 = 346 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 839 = 347 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 840 = 348 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 841 = 349 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 842 = 34a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 843 = 34b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 844 = 34c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 845 = 34d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 846 = 34e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 847 = 34f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 848 = 350 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 849 = 351 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 850 = 352 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 851 = 353 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 852 = 354 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 853 = 355 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 854 = 356 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 855 = 357 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 856 = 358 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 857 = 359 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 858 = 35a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 859 = 35b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 860 = 35c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 861 = 35d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 862 = 35e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 863 = 35f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 864 = 360 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 865 = 361 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 866 = 362 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 867 = 363 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 868 = 364 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 869 = 365 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 870 = 366 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 871 = 367 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 872 = 368 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 873 = 369 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 874 = 36a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 875 = 36b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 876 = 36c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 877 = 36d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 878 = 36e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 879 = 36f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 880 = 370 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 881 = 371 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 882 = 372 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 883 = 373 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 884 = 374 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 885 = 375 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 886 = 376 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 887 = 377 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 888 = 378 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 889 = 379 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 890 = 37a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 891 = 37b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 892 = 37c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 893 = 37d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 894 = 37e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 895 = 37f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 896 = 380 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 897 = 381 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 898 = 382 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 899 = 383 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 900 = 384 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 901 = 385 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 902 = 386 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 903 = 387 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 904 = 388 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 905 = 389 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 906 = 38a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 907 = 38b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 908 = 38c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 909 = 38d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 910 = 38e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 911 = 38f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 912 = 390 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 913 = 391 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 914 = 392 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 915 = 393 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 916 = 394 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 917 = 395 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 918 = 396 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 919 = 397 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 920 = 398 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 921 = 399 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 922 = 39a */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 923 = 39b */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 924 = 39c */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 925 = 39d */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 926 = 39e */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 927 = 39f */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 928 = 3a0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 929 = 3a1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 930 = 3a2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 931 = 3a3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 932 = 3a4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 933 = 3a5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 934 = 3a6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 935 = 3a7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 936 = 3a8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 937 = 3a9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 938 = 3aa */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 939 = 3ab */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 940 = 3ac */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 941 = 3ad */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 942 = 3ae */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 943 = 3af */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 944 = 3b0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 945 = 3b1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 946 = 3b2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 947 = 3b3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 948 = 3b4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 949 = 3b5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 950 = 3b6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 951 = 3b7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 952 = 3b8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 953 = 3b9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 954 = 3ba */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 955 = 3bb */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 956 = 3bc */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 957 = 3bd */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 958 = 3be */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 959 = 3bf */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 960 = 3c0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 961 = 3c1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 962 = 3c2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 963 = 3c3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 964 = 3c4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 965 = 3c5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 966 = 3c6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 967 = 3c7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 968 = 3c8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 969 = 3c9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 970 = 3ca */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 971 = 3cb */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 972 = 3cc */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 973 = 3cd */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 974 = 3ce */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 975 = 3cf */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 976 = 3d0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 977 = 3d1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 978 = 3d2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 979 = 3d3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 980 = 3d4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 981 = 3d5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 982 = 3d6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 983 = 3d7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 984 = 3d8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 985 = 3d9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 986 = 3da */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 987 = 3db */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 988 = 3dc */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 989 = 3dd */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 990 = 3de */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 991 = 3df */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 992 = 3e0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 993 = 3e1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 994 = 3e2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 995 = 3e3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 996 = 3e4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 997 = 3e5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 998 = 3e6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 999 = 3e7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1000 = 3e8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1001 = 3e9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1002 = 3ea */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1003 = 3eb */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1004 = 3ec */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1005 = 3ed */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1006 = 3ee */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1007 = 3ef */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1008 = 3f0 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1009 = 3f1 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1010 = 3f2 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1011 = 3f3 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1012 = 3f4 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1013 = 3f5 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1014 = 3f6 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1015 = 3f7 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1016 = 3f8 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1017 = 3f9 */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1018 = 3fa */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1019 = 3fb */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1020 = 3fc */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1021 = 3fd */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1022 = 3fe */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1023 = 3ff */ {7, 0, 5}, /* 0x0003 => 0x0300+(256)*/ - /* 1024 = 400 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1025 = 401 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1026 = 402 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1027 = 403 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1028 = 404 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1029 = 405 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1030 = 406 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1031 = 407 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1032 = 408 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1033 = 409 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1034 = 40a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1035 = 40b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1036 = 40c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1037 = 40d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1038 = 40e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1039 = 40f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1040 = 410 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1041 = 411 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1042 = 412 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1043 = 413 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1044 = 414 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1045 = 415 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1046 = 416 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1047 = 417 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1048 = 418 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1049 = 419 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1050 = 41a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1051 = 41b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1052 = 41c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1053 = 41d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1054 = 41e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1055 = 41f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1056 = 420 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1057 = 421 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1058 = 422 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1059 = 423 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1060 = 424 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1061 = 425 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1062 = 426 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1063 = 427 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1064 = 428 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1065 = 429 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1066 = 42a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1067 = 42b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1068 = 42c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1069 = 42d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1070 = 42e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1071 = 42f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1072 = 430 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1073 = 431 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1074 = 432 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1075 = 433 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1076 = 434 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1077 = 435 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1078 = 436 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1079 = 437 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1080 = 438 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1081 = 439 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1082 = 43a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1083 = 43b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1084 = 43c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1085 = 43d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1086 = 43e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1087 = 43f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1088 = 440 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1089 = 441 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1090 = 442 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1091 = 443 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1092 = 444 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1093 = 445 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1094 = 446 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1095 = 447 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1096 = 448 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1097 = 449 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1098 = 44a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1099 = 44b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1100 = 44c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1101 = 44d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1102 = 44e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1103 = 44f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1104 = 450 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1105 = 451 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1106 = 452 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1107 = 453 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1108 = 454 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1109 = 455 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1110 = 456 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1111 = 457 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1112 = 458 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1113 = 459 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1114 = 45a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1115 = 45b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1116 = 45c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1117 = 45d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1118 = 45e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1119 = 45f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1120 = 460 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1121 = 461 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1122 = 462 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1123 = 463 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1124 = 464 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1125 = 465 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1126 = 466 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1127 = 467 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1128 = 468 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1129 = 469 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1130 = 46a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1131 = 46b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1132 = 46c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1133 = 46d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1134 = 46e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1135 = 46f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1136 = 470 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1137 = 471 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1138 = 472 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1139 = 473 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1140 = 474 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1141 = 475 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1142 = 476 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1143 = 477 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1144 = 478 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1145 = 479 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1146 = 47a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1147 = 47b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1148 = 47c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1149 = 47d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1150 = 47e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1151 = 47f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1152 = 480 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1153 = 481 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1154 = 482 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1155 = 483 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1156 = 484 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1157 = 485 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1158 = 486 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1159 = 487 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1160 = 488 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1161 = 489 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1162 = 48a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1163 = 48b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1164 = 48c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1165 = 48d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1166 = 48e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1167 = 48f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1168 = 490 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1169 = 491 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1170 = 492 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1171 = 493 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1172 = 494 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1173 = 495 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1174 = 496 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1175 = 497 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1176 = 498 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1177 = 499 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1178 = 49a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1179 = 49b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1180 = 49c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1181 = 49d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1182 = 49e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1183 = 49f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1184 = 4a0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1185 = 4a1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1186 = 4a2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1187 = 4a3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1188 = 4a4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1189 = 4a5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1190 = 4a6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1191 = 4a7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1192 = 4a8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1193 = 4a9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1194 = 4aa */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1195 = 4ab */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1196 = 4ac */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1197 = 4ad */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1198 = 4ae */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1199 = 4af */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1200 = 4b0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1201 = 4b1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1202 = 4b2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1203 = 4b3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1204 = 4b4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1205 = 4b5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1206 = 4b6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1207 = 4b7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1208 = 4b8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1209 = 4b9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1210 = 4ba */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1211 = 4bb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1212 = 4bc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1213 = 4bd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1214 = 4be */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1215 = 4bf */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1216 = 4c0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1217 = 4c1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1218 = 4c2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1219 = 4c3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1220 = 4c4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1221 = 4c5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1222 = 4c6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1223 = 4c7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1224 = 4c8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1225 = 4c9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1226 = 4ca */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1227 = 4cb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1228 = 4cc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1229 = 4cd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1230 = 4ce */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1231 = 4cf */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1232 = 4d0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1233 = 4d1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1234 = 4d2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1235 = 4d3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1236 = 4d4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1237 = 4d5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1238 = 4d6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1239 = 4d7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1240 = 4d8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1241 = 4d9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1242 = 4da */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1243 = 4db */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1244 = 4dc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1245 = 4dd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1246 = 4de */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1247 = 4df */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1248 = 4e0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1249 = 4e1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1250 = 4e2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1251 = 4e3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1252 = 4e4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1253 = 4e5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1254 = 4e6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1255 = 4e7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1256 = 4e8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1257 = 4e9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1258 = 4ea */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1259 = 4eb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1260 = 4ec */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1261 = 4ed */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1262 = 4ee */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1263 = 4ef */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1264 = 4f0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1265 = 4f1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1266 = 4f2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1267 = 4f3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1268 = 4f4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1269 = 4f5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1270 = 4f6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1271 = 4f7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1272 = 4f8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1273 = 4f9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1274 = 4fa */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1275 = 4fb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1276 = 4fc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1277 = 4fd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1278 = 4fe */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1279 = 4ff */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1280 = 500 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1281 = 501 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1282 = 502 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1283 = 503 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1284 = 504 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1285 = 505 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1286 = 506 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1287 = 507 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1288 = 508 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1289 = 509 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1290 = 50a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1291 = 50b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1292 = 50c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1293 = 50d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1294 = 50e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1295 = 50f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1296 = 510 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1297 = 511 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1298 = 512 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1299 = 513 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1300 = 514 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1301 = 515 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1302 = 516 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1303 = 517 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1304 = 518 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1305 = 519 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1306 = 51a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1307 = 51b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1308 = 51c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1309 = 51d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1310 = 51e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1311 = 51f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1312 = 520 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1313 = 521 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1314 = 522 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1315 = 523 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1316 = 524 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1317 = 525 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1318 = 526 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1319 = 527 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1320 = 528 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1321 = 529 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1322 = 52a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1323 = 52b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1324 = 52c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1325 = 52d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1326 = 52e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1327 = 52f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1328 = 530 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1329 = 531 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1330 = 532 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1331 = 533 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1332 = 534 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1333 = 535 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1334 = 536 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1335 = 537 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1336 = 538 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1337 = 539 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1338 = 53a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1339 = 53b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1340 = 53c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1341 = 53d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1342 = 53e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1343 = 53f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1344 = 540 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1345 = 541 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1346 = 542 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1347 = 543 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1348 = 544 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1349 = 545 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1350 = 546 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1351 = 547 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1352 = 548 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1353 = 549 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1354 = 54a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1355 = 54b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1356 = 54c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1357 = 54d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1358 = 54e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1359 = 54f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1360 = 550 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1361 = 551 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1362 = 552 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1363 = 553 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1364 = 554 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1365 = 555 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1366 = 556 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1367 = 557 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1368 = 558 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1369 = 559 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1370 = 55a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1371 = 55b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1372 = 55c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1373 = 55d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1374 = 55e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1375 = 55f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1376 = 560 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1377 = 561 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1378 = 562 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1379 = 563 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1380 = 564 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1381 = 565 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1382 = 566 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1383 = 567 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1384 = 568 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1385 = 569 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1386 = 56a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1387 = 56b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1388 = 56c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1389 = 56d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1390 = 56e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1391 = 56f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1392 = 570 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1393 = 571 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1394 = 572 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1395 = 573 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1396 = 574 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1397 = 575 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1398 = 576 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1399 = 577 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1400 = 578 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1401 = 579 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1402 = 57a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1403 = 57b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1404 = 57c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1405 = 57d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1406 = 57e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1407 = 57f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1408 = 580 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1409 = 581 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1410 = 582 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1411 = 583 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1412 = 584 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1413 = 585 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1414 = 586 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1415 = 587 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1416 = 588 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1417 = 589 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1418 = 58a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1419 = 58b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1420 = 58c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1421 = 58d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1422 = 58e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1423 = 58f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1424 = 590 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1425 = 591 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1426 = 592 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1427 = 593 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1428 = 594 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1429 = 595 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1430 = 596 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1431 = 597 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1432 = 598 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1433 = 599 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1434 = 59a */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1435 = 59b */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1436 = 59c */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1437 = 59d */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1438 = 59e */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1439 = 59f */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1440 = 5a0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1441 = 5a1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1442 = 5a2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1443 = 5a3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1444 = 5a4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1445 = 5a5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1446 = 5a6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1447 = 5a7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1448 = 5a8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1449 = 5a9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1450 = 5aa */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1451 = 5ab */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1452 = 5ac */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1453 = 5ad */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1454 = 5ae */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1455 = 5af */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1456 = 5b0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1457 = 5b1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1458 = 5b2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1459 = 5b3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1460 = 5b4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1461 = 5b5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1462 = 5b6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1463 = 5b7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1464 = 5b8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1465 = 5b9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1466 = 5ba */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1467 = 5bb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1468 = 5bc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1469 = 5bd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1470 = 5be */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1471 = 5bf */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1472 = 5c0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1473 = 5c1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1474 = 5c2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1475 = 5c3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1476 = 5c4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1477 = 5c5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1478 = 5c6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1479 = 5c7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1480 = 5c8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1481 = 5c9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1482 = 5ca */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1483 = 5cb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1484 = 5cc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1485 = 5cd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1486 = 5ce */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1487 = 5cf */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1488 = 5d0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1489 = 5d1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1490 = 5d2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1491 = 5d3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1492 = 5d4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1493 = 5d5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1494 = 5d6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1495 = 5d7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1496 = 5d8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1497 = 5d9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1498 = 5da */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1499 = 5db */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1500 = 5dc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1501 = 5dd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1502 = 5de */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1503 = 5df */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1504 = 5e0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1505 = 5e1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1506 = 5e2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1507 = 5e3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1508 = 5e4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1509 = 5e5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1510 = 5e6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1511 = 5e7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1512 = 5e8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1513 = 5e9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1514 = 5ea */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1515 = 5eb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1516 = 5ec */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1517 = 5ed */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1518 = 5ee */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1519 = 5ef */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1520 = 5f0 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1521 = 5f1 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1522 = 5f2 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1523 = 5f3 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1524 = 5f4 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1525 = 5f5 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1526 = 5f6 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1527 = 5f7 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1528 = 5f8 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1529 = 5f9 */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1530 = 5fa */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1531 = 5fb */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1532 = 5fc */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1533 = 5fd */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1534 = 5fe */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1535 = 5ff */ {6, 0, 4}, /* 0x0002 => 0x0400+(512)*/ - /* 1536 = 600 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1537 = 601 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1538 = 602 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1539 = 603 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1540 = 604 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1541 = 605 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1542 = 606 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1543 = 607 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1544 = 608 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1545 = 609 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1546 = 60a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1547 = 60b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1548 = 60c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1549 = 60d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1550 = 60e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1551 = 60f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1552 = 610 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1553 = 611 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1554 = 612 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1555 = 613 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1556 = 614 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1557 = 615 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1558 = 616 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1559 = 617 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1560 = 618 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1561 = 619 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1562 = 61a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1563 = 61b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1564 = 61c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1565 = 61d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1566 = 61e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1567 = 61f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1568 = 620 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1569 = 621 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1570 = 622 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1571 = 623 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1572 = 624 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1573 = 625 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1574 = 626 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1575 = 627 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1576 = 628 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1577 = 629 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1578 = 62a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1579 = 62b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1580 = 62c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1581 = 62d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1582 = 62e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1583 = 62f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1584 = 630 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1585 = 631 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1586 = 632 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1587 = 633 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1588 = 634 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1589 = 635 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1590 = 636 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1591 = 637 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1592 = 638 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1593 = 639 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1594 = 63a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1595 = 63b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1596 = 63c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1597 = 63d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1598 = 63e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1599 = 63f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1600 = 640 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1601 = 641 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1602 = 642 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1603 = 643 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1604 = 644 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1605 = 645 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1606 = 646 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1607 = 647 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1608 = 648 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1609 = 649 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1610 = 64a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1611 = 64b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1612 = 64c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1613 = 64d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1614 = 64e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1615 = 64f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1616 = 650 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1617 = 651 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1618 = 652 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1619 = 653 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1620 = 654 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1621 = 655 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1622 = 656 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1623 = 657 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1624 = 658 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1625 = 659 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1626 = 65a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1627 = 65b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1628 = 65c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1629 = 65d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1630 = 65e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1631 = 65f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1632 = 660 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1633 = 661 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1634 = 662 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1635 = 663 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1636 = 664 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1637 = 665 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1638 = 666 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1639 = 667 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1640 = 668 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1641 = 669 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1642 = 66a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1643 = 66b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1644 = 66c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1645 = 66d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1646 = 66e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1647 = 66f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1648 = 670 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1649 = 671 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1650 = 672 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1651 = 673 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1652 = 674 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1653 = 675 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1654 = 676 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1655 = 677 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1656 = 678 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1657 = 679 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1658 = 67a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1659 = 67b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1660 = 67c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1661 = 67d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1662 = 67e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1663 = 67f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1664 = 680 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1665 = 681 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1666 = 682 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1667 = 683 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1668 = 684 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1669 = 685 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1670 = 686 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1671 = 687 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1672 = 688 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1673 = 689 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1674 = 68a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1675 = 68b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1676 = 68c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1677 = 68d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1678 = 68e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1679 = 68f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1680 = 690 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1681 = 691 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1682 = 692 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1683 = 693 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1684 = 694 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1685 = 695 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1686 = 696 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1687 = 697 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1688 = 698 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1689 = 699 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1690 = 69a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1691 = 69b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1692 = 69c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1693 = 69d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1694 = 69e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1695 = 69f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1696 = 6a0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1697 = 6a1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1698 = 6a2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1699 = 6a3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1700 = 6a4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1701 = 6a5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1702 = 6a6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1703 = 6a7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1704 = 6a8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1705 = 6a9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1706 = 6aa */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1707 = 6ab */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1708 = 6ac */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1709 = 6ad */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1710 = 6ae */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1711 = 6af */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1712 = 6b0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1713 = 6b1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1714 = 6b2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1715 = 6b3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1716 = 6b4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1717 = 6b5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1718 = 6b6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1719 = 6b7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1720 = 6b8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1721 = 6b9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1722 = 6ba */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1723 = 6bb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1724 = 6bc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1725 = 6bd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1726 = 6be */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1727 = 6bf */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1728 = 6c0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1729 = 6c1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1730 = 6c2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1731 = 6c3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1732 = 6c4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1733 = 6c5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1734 = 6c6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1735 = 6c7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1736 = 6c8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1737 = 6c9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1738 = 6ca */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1739 = 6cb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1740 = 6cc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1741 = 6cd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1742 = 6ce */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1743 = 6cf */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1744 = 6d0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1745 = 6d1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1746 = 6d2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1747 = 6d3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1748 = 6d4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1749 = 6d5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1750 = 6d6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1751 = 6d7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1752 = 6d8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1753 = 6d9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1754 = 6da */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1755 = 6db */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1756 = 6dc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1757 = 6dd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1758 = 6de */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1759 = 6df */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1760 = 6e0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1761 = 6e1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1762 = 6e2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1763 = 6e3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1764 = 6e4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1765 = 6e5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1766 = 6e6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1767 = 6e7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1768 = 6e8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1769 = 6e9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1770 = 6ea */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1771 = 6eb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1772 = 6ec */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1773 = 6ed */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1774 = 6ee */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1775 = 6ef */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1776 = 6f0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1777 = 6f1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1778 = 6f2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1779 = 6f3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1780 = 6f4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1781 = 6f5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1782 = 6f6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1783 = 6f7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1784 = 6f8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1785 = 6f9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1786 = 6fa */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1787 = 6fb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1788 = 6fc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1789 = 6fd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1790 = 6fe */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1791 = 6ff */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1792 = 700 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1793 = 701 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1794 = 702 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1795 = 703 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1796 = 704 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1797 = 705 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1798 = 706 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1799 = 707 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1800 = 708 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1801 = 709 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1802 = 70a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1803 = 70b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1804 = 70c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1805 = 70d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1806 = 70e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1807 = 70f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1808 = 710 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1809 = 711 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1810 = 712 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1811 = 713 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1812 = 714 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1813 = 715 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1814 = 716 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1815 = 717 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1816 = 718 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1817 = 719 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1818 = 71a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1819 = 71b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1820 = 71c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1821 = 71d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1822 = 71e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1823 = 71f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1824 = 720 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1825 = 721 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1826 = 722 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1827 = 723 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1828 = 724 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1829 = 725 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1830 = 726 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1831 = 727 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1832 = 728 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1833 = 729 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1834 = 72a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1835 = 72b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1836 = 72c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1837 = 72d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1838 = 72e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1839 = 72f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1840 = 730 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1841 = 731 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1842 = 732 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1843 = 733 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1844 = 734 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1845 = 735 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1846 = 736 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1847 = 737 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1848 = 738 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1849 = 739 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1850 = 73a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1851 = 73b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1852 = 73c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1853 = 73d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1854 = 73e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1855 = 73f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1856 = 740 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1857 = 741 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1858 = 742 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1859 = 743 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1860 = 744 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1861 = 745 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1862 = 746 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1863 = 747 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1864 = 748 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1865 = 749 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1866 = 74a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1867 = 74b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1868 = 74c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1869 = 74d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1870 = 74e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1871 = 74f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1872 = 750 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1873 = 751 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1874 = 752 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1875 = 753 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1876 = 754 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1877 = 755 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1878 = 756 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1879 = 757 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1880 = 758 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1881 = 759 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1882 = 75a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1883 = 75b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1884 = 75c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1885 = 75d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1886 = 75e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1887 = 75f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1888 = 760 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1889 = 761 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1890 = 762 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1891 = 763 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1892 = 764 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1893 = 765 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1894 = 766 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1895 = 767 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1896 = 768 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1897 = 769 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1898 = 76a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1899 = 76b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1900 = 76c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1901 = 76d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1902 = 76e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1903 = 76f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1904 = 770 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1905 = 771 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1906 = 772 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1907 = 773 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1908 = 774 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1909 = 775 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1910 = 776 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1911 = 777 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1912 = 778 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1913 = 779 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1914 = 77a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1915 = 77b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1916 = 77c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1917 = 77d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1918 = 77e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1919 = 77f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1920 = 780 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1921 = 781 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1922 = 782 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1923 = 783 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1924 = 784 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1925 = 785 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1926 = 786 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1927 = 787 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1928 = 788 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1929 = 789 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1930 = 78a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1931 = 78b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1932 = 78c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1933 = 78d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1934 = 78e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1935 = 78f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1936 = 790 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1937 = 791 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1938 = 792 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1939 = 793 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1940 = 794 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1941 = 795 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1942 = 796 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1943 = 797 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1944 = 798 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1945 = 799 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1946 = 79a */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1947 = 79b */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1948 = 79c */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1949 = 79d */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1950 = 79e */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1951 = 79f */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1952 = 7a0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1953 = 7a1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1954 = 7a2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1955 = 7a3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1956 = 7a4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1957 = 7a5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1958 = 7a6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1959 = 7a7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1960 = 7a8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1961 = 7a9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1962 = 7aa */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1963 = 7ab */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1964 = 7ac */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1965 = 7ad */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1966 = 7ae */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1967 = 7af */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1968 = 7b0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1969 = 7b1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1970 = 7b2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1971 = 7b3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1972 = 7b4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1973 = 7b5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1974 = 7b6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1975 = 7b7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1976 = 7b8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1977 = 7b9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1978 = 7ba */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1979 = 7bb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1980 = 7bc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1981 = 7bd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1982 = 7be */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1983 = 7bf */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1984 = 7c0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1985 = 7c1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1986 = 7c2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1987 = 7c3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1988 = 7c4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1989 = 7c5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1990 = 7c6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1991 = 7c7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1992 = 7c8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1993 = 7c9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1994 = 7ca */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1995 = 7cb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1996 = 7cc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1997 = 7cd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1998 = 7ce */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 1999 = 7cf */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2000 = 7d0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2001 = 7d1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2002 = 7d2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2003 = 7d3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2004 = 7d4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2005 = 7d5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2006 = 7d6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2007 = 7d7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2008 = 7d8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2009 = 7d9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2010 = 7da */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2011 = 7db */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2012 = 7dc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2013 = 7dd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2014 = 7de */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2015 = 7df */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2016 = 7e0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2017 = 7e1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2018 = 7e2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2019 = 7e3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2020 = 7e4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2021 = 7e5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2022 = 7e6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2023 = 7e7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2024 = 7e8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2025 = 7e9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2026 = 7ea */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2027 = 7eb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2028 = 7ec */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2029 = 7ed */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2030 = 7ee */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2031 = 7ef */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2032 = 7f0 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2033 = 7f1 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2034 = 7f2 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2035 = 7f3 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2036 = 7f4 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2037 = 7f5 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2038 = 7f6 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2039 = 7f7 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2040 = 7f8 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2041 = 7f9 */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2042 = 7fa */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2043 = 7fb */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2044 = 7fc */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2045 = 7fd */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2046 = 7fe */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2047 = 7ff */ {5, 0, 4}, /* 0x0003 => 0x0600+(512)*/ - /* 2048 = 800 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2049 = 801 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2050 = 802 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2051 = 803 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2052 = 804 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2053 = 805 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2054 = 806 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2055 = 807 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2056 = 808 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2057 = 809 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2058 = 80a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2059 = 80b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2060 = 80c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2061 = 80d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2062 = 80e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2063 = 80f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2064 = 810 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2065 = 811 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2066 = 812 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2067 = 813 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2068 = 814 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2069 = 815 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2070 = 816 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2071 = 817 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2072 = 818 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2073 = 819 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2074 = 81a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2075 = 81b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2076 = 81c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2077 = 81d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2078 = 81e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2079 = 81f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2080 = 820 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2081 = 821 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2082 = 822 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2083 = 823 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2084 = 824 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2085 = 825 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2086 = 826 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2087 = 827 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2088 = 828 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2089 = 829 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2090 = 82a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2091 = 82b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2092 = 82c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2093 = 82d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2094 = 82e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2095 = 82f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2096 = 830 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2097 = 831 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2098 = 832 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2099 = 833 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2100 = 834 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2101 = 835 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2102 = 836 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2103 = 837 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2104 = 838 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2105 = 839 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2106 = 83a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2107 = 83b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2108 = 83c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2109 = 83d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2110 = 83e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2111 = 83f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2112 = 840 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2113 = 841 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2114 = 842 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2115 = 843 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2116 = 844 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2117 = 845 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2118 = 846 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2119 = 847 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2120 = 848 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2121 = 849 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2122 = 84a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2123 = 84b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2124 = 84c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2125 = 84d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2126 = 84e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2127 = 84f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2128 = 850 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2129 = 851 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2130 = 852 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2131 = 853 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2132 = 854 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2133 = 855 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2134 = 856 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2135 = 857 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2136 = 858 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2137 = 859 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2138 = 85a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2139 = 85b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2140 = 85c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2141 = 85d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2142 = 85e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2143 = 85f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2144 = 860 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2145 = 861 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2146 = 862 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2147 = 863 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2148 = 864 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2149 = 865 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2150 = 866 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2151 = 867 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2152 = 868 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2153 = 869 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2154 = 86a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2155 = 86b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2156 = 86c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2157 = 86d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2158 = 86e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2159 = 86f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2160 = 870 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2161 = 871 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2162 = 872 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2163 = 873 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2164 = 874 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2165 = 875 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2166 = 876 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2167 = 877 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2168 = 878 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2169 = 879 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2170 = 87a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2171 = 87b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2172 = 87c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2173 = 87d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2174 = 87e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2175 = 87f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2176 = 880 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2177 = 881 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2178 = 882 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2179 = 883 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2180 = 884 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2181 = 885 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2182 = 886 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2183 = 887 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2184 = 888 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2185 = 889 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2186 = 88a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2187 = 88b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2188 = 88c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2189 = 88d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2190 = 88e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2191 = 88f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2192 = 890 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2193 = 891 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2194 = 892 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2195 = 893 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2196 = 894 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2197 = 895 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2198 = 896 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2199 = 897 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2200 = 898 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2201 = 899 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2202 = 89a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2203 = 89b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2204 = 89c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2205 = 89d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2206 = 89e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2207 = 89f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2208 = 8a0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2209 = 8a1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2210 = 8a2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2211 = 8a3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2212 = 8a4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2213 = 8a5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2214 = 8a6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2215 = 8a7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2216 = 8a8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2217 = 8a9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2218 = 8aa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2219 = 8ab */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2220 = 8ac */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2221 = 8ad */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2222 = 8ae */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2223 = 8af */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2224 = 8b0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2225 = 8b1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2226 = 8b2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2227 = 8b3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2228 = 8b4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2229 = 8b5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2230 = 8b6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2231 = 8b7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2232 = 8b8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2233 = 8b9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2234 = 8ba */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2235 = 8bb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2236 = 8bc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2237 = 8bd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2238 = 8be */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2239 = 8bf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2240 = 8c0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2241 = 8c1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2242 = 8c2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2243 = 8c3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2244 = 8c4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2245 = 8c5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2246 = 8c6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2247 = 8c7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2248 = 8c8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2249 = 8c9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2250 = 8ca */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2251 = 8cb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2252 = 8cc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2253 = 8cd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2254 = 8ce */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2255 = 8cf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2256 = 8d0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2257 = 8d1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2258 = 8d2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2259 = 8d3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2260 = 8d4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2261 = 8d5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2262 = 8d6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2263 = 8d7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2264 = 8d8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2265 = 8d9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2266 = 8da */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2267 = 8db */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2268 = 8dc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2269 = 8dd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2270 = 8de */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2271 = 8df */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2272 = 8e0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2273 = 8e1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2274 = 8e2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2275 = 8e3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2276 = 8e4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2277 = 8e5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2278 = 8e6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2279 = 8e7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2280 = 8e8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2281 = 8e9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2282 = 8ea */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2283 = 8eb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2284 = 8ec */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2285 = 8ed */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2286 = 8ee */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2287 = 8ef */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2288 = 8f0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2289 = 8f1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2290 = 8f2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2291 = 8f3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2292 = 8f4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2293 = 8f5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2294 = 8f6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2295 = 8f7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2296 = 8f8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2297 = 8f9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2298 = 8fa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2299 = 8fb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2300 = 8fc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2301 = 8fd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2302 = 8fe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2303 = 8ff */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2304 = 900 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2305 = 901 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2306 = 902 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2307 = 903 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2308 = 904 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2309 = 905 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2310 = 906 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2311 = 907 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2312 = 908 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2313 = 909 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2314 = 90a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2315 = 90b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2316 = 90c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2317 = 90d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2318 = 90e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2319 = 90f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2320 = 910 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2321 = 911 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2322 = 912 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2323 = 913 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2324 = 914 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2325 = 915 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2326 = 916 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2327 = 917 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2328 = 918 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2329 = 919 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2330 = 91a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2331 = 91b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2332 = 91c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2333 = 91d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2334 = 91e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2335 = 91f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2336 = 920 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2337 = 921 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2338 = 922 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2339 = 923 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2340 = 924 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2341 = 925 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2342 = 926 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2343 = 927 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2344 = 928 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2345 = 929 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2346 = 92a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2347 = 92b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2348 = 92c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2349 = 92d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2350 = 92e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2351 = 92f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2352 = 930 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2353 = 931 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2354 = 932 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2355 = 933 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2356 = 934 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2357 = 935 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2358 = 936 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2359 = 937 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2360 = 938 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2361 = 939 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2362 = 93a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2363 = 93b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2364 = 93c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2365 = 93d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2366 = 93e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2367 = 93f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2368 = 940 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2369 = 941 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2370 = 942 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2371 = 943 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2372 = 944 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2373 = 945 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2374 = 946 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2375 = 947 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2376 = 948 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2377 = 949 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2378 = 94a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2379 = 94b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2380 = 94c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2381 = 94d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2382 = 94e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2383 = 94f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2384 = 950 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2385 = 951 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2386 = 952 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2387 = 953 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2388 = 954 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2389 = 955 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2390 = 956 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2391 = 957 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2392 = 958 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2393 = 959 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2394 = 95a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2395 = 95b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2396 = 95c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2397 = 95d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2398 = 95e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2399 = 95f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2400 = 960 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2401 = 961 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2402 = 962 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2403 = 963 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2404 = 964 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2405 = 965 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2406 = 966 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2407 = 967 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2408 = 968 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2409 = 969 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2410 = 96a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2411 = 96b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2412 = 96c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2413 = 96d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2414 = 96e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2415 = 96f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2416 = 970 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2417 = 971 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2418 = 972 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2419 = 973 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2420 = 974 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2421 = 975 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2422 = 976 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2423 = 977 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2424 = 978 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2425 = 979 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2426 = 97a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2427 = 97b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2428 = 97c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2429 = 97d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2430 = 97e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2431 = 97f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2432 = 980 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2433 = 981 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2434 = 982 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2435 = 983 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2436 = 984 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2437 = 985 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2438 = 986 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2439 = 987 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2440 = 988 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2441 = 989 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2442 = 98a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2443 = 98b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2444 = 98c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2445 = 98d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2446 = 98e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2447 = 98f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2448 = 990 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2449 = 991 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2450 = 992 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2451 = 993 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2452 = 994 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2453 = 995 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2454 = 996 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2455 = 997 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2456 = 998 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2457 = 999 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2458 = 99a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2459 = 99b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2460 = 99c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2461 = 99d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2462 = 99e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2463 = 99f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2464 = 9a0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2465 = 9a1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2466 = 9a2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2467 = 9a3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2468 = 9a4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2469 = 9a5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2470 = 9a6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2471 = 9a7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2472 = 9a8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2473 = 9a9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2474 = 9aa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2475 = 9ab */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2476 = 9ac */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2477 = 9ad */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2478 = 9ae */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2479 = 9af */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2480 = 9b0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2481 = 9b1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2482 = 9b2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2483 = 9b3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2484 = 9b4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2485 = 9b5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2486 = 9b6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2487 = 9b7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2488 = 9b8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2489 = 9b9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2490 = 9ba */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2491 = 9bb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2492 = 9bc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2493 = 9bd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2494 = 9be */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2495 = 9bf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2496 = 9c0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2497 = 9c1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2498 = 9c2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2499 = 9c3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2500 = 9c4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2501 = 9c5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2502 = 9c6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2503 = 9c7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2504 = 9c8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2505 = 9c9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2506 = 9ca */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2507 = 9cb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2508 = 9cc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2509 = 9cd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2510 = 9ce */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2511 = 9cf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2512 = 9d0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2513 = 9d1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2514 = 9d2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2515 = 9d3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2516 = 9d4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2517 = 9d5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2518 = 9d6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2519 = 9d7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2520 = 9d8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2521 = 9d9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2522 = 9da */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2523 = 9db */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2524 = 9dc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2525 = 9dd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2526 = 9de */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2527 = 9df */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2528 = 9e0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2529 = 9e1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2530 = 9e2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2531 = 9e3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2532 = 9e4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2533 = 9e5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2534 = 9e6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2535 = 9e7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2536 = 9e8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2537 = 9e9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2538 = 9ea */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2539 = 9eb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2540 = 9ec */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2541 = 9ed */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2542 = 9ee */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2543 = 9ef */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2544 = 9f0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2545 = 9f1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2546 = 9f2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2547 = 9f3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2548 = 9f4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2549 = 9f5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2550 = 9f6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2551 = 9f7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2552 = 9f8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2553 = 9f9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2554 = 9fa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2555 = 9fb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2556 = 9fc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2557 = 9fd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2558 = 9fe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2559 = 9ff */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2560 = a00 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2561 = a01 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2562 = a02 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2563 = a03 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2564 = a04 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2565 = a05 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2566 = a06 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2567 = a07 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2568 = a08 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2569 = a09 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2570 = a0a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2571 = a0b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2572 = a0c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2573 = a0d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2574 = a0e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2575 = a0f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2576 = a10 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2577 = a11 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2578 = a12 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2579 = a13 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2580 = a14 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2581 = a15 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2582 = a16 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2583 = a17 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2584 = a18 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2585 = a19 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2586 = a1a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2587 = a1b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2588 = a1c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2589 = a1d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2590 = a1e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2591 = a1f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2592 = a20 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2593 = a21 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2594 = a22 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2595 = a23 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2596 = a24 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2597 = a25 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2598 = a26 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2599 = a27 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2600 = a28 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2601 = a29 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2602 = a2a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2603 = a2b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2604 = a2c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2605 = a2d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2606 = a2e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2607 = a2f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2608 = a30 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2609 = a31 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2610 = a32 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2611 = a33 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2612 = a34 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2613 = a35 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2614 = a36 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2615 = a37 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2616 = a38 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2617 = a39 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2618 = a3a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2619 = a3b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2620 = a3c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2621 = a3d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2622 = a3e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2623 = a3f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2624 = a40 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2625 = a41 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2626 = a42 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2627 = a43 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2628 = a44 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2629 = a45 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2630 = a46 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2631 = a47 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2632 = a48 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2633 = a49 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2634 = a4a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2635 = a4b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2636 = a4c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2637 = a4d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2638 = a4e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2639 = a4f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2640 = a50 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2641 = a51 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2642 = a52 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2643 = a53 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2644 = a54 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2645 = a55 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2646 = a56 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2647 = a57 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2648 = a58 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2649 = a59 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2650 = a5a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2651 = a5b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2652 = a5c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2653 = a5d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2654 = a5e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2655 = a5f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2656 = a60 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2657 = a61 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2658 = a62 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2659 = a63 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2660 = a64 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2661 = a65 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2662 = a66 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2663 = a67 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2664 = a68 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2665 = a69 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2666 = a6a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2667 = a6b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2668 = a6c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2669 = a6d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2670 = a6e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2671 = a6f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2672 = a70 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2673 = a71 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2674 = a72 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2675 = a73 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2676 = a74 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2677 = a75 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2678 = a76 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2679 = a77 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2680 = a78 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2681 = a79 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2682 = a7a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2683 = a7b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2684 = a7c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2685 = a7d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2686 = a7e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2687 = a7f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2688 = a80 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2689 = a81 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2690 = a82 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2691 = a83 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2692 = a84 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2693 = a85 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2694 = a86 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2695 = a87 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2696 = a88 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2697 = a89 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2698 = a8a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2699 = a8b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2700 = a8c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2701 = a8d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2702 = a8e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2703 = a8f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2704 = a90 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2705 = a91 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2706 = a92 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2707 = a93 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2708 = a94 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2709 = a95 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2710 = a96 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2711 = a97 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2712 = a98 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2713 = a99 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2714 = a9a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2715 = a9b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2716 = a9c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2717 = a9d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2718 = a9e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2719 = a9f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2720 = aa0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2721 = aa1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2722 = aa2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2723 = aa3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2724 = aa4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2725 = aa5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2726 = aa6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2727 = aa7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2728 = aa8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2729 = aa9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2730 = aaa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2731 = aab */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2732 = aac */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2733 = aad */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2734 = aae */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2735 = aaf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2736 = ab0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2737 = ab1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2738 = ab2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2739 = ab3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2740 = ab4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2741 = ab5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2742 = ab6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2743 = ab7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2744 = ab8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2745 = ab9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2746 = aba */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2747 = abb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2748 = abc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2749 = abd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2750 = abe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2751 = abf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2752 = ac0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2753 = ac1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2754 = ac2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2755 = ac3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2756 = ac4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2757 = ac5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2758 = ac6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2759 = ac7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2760 = ac8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2761 = ac9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2762 = aca */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2763 = acb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2764 = acc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2765 = acd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2766 = ace */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2767 = acf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2768 = ad0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2769 = ad1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2770 = ad2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2771 = ad3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2772 = ad4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2773 = ad5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2774 = ad6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2775 = ad7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2776 = ad8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2777 = ad9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2778 = ada */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2779 = adb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2780 = adc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2781 = add */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2782 = ade */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2783 = adf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2784 = ae0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2785 = ae1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2786 = ae2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2787 = ae3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2788 = ae4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2789 = ae5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2790 = ae6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2791 = ae7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2792 = ae8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2793 = ae9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2794 = aea */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2795 = aeb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2796 = aec */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2797 = aed */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2798 = aee */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2799 = aef */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2800 = af0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2801 = af1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2802 = af2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2803 = af3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2804 = af4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2805 = af5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2806 = af6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2807 = af7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2808 = af8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2809 = af9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2810 = afa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2811 = afb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2812 = afc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2813 = afd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2814 = afe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2815 = aff */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2816 = b00 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2817 = b01 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2818 = b02 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2819 = b03 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2820 = b04 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2821 = b05 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2822 = b06 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2823 = b07 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2824 = b08 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2825 = b09 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2826 = b0a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2827 = b0b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2828 = b0c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2829 = b0d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2830 = b0e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2831 = b0f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2832 = b10 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2833 = b11 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2834 = b12 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2835 = b13 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2836 = b14 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2837 = b15 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2838 = b16 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2839 = b17 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2840 = b18 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2841 = b19 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2842 = b1a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2843 = b1b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2844 = b1c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2845 = b1d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2846 = b1e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2847 = b1f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2848 = b20 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2849 = b21 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2850 = b22 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2851 = b23 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2852 = b24 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2853 = b25 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2854 = b26 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2855 = b27 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2856 = b28 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2857 = b29 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2858 = b2a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2859 = b2b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2860 = b2c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2861 = b2d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2862 = b2e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2863 = b2f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2864 = b30 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2865 = b31 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2866 = b32 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2867 = b33 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2868 = b34 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2869 = b35 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2870 = b36 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2871 = b37 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2872 = b38 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2873 = b39 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2874 = b3a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2875 = b3b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2876 = b3c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2877 = b3d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2878 = b3e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2879 = b3f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2880 = b40 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2881 = b41 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2882 = b42 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2883 = b43 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2884 = b44 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2885 = b45 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2886 = b46 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2887 = b47 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2888 = b48 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2889 = b49 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2890 = b4a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2891 = b4b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2892 = b4c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2893 = b4d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2894 = b4e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2895 = b4f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2896 = b50 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2897 = b51 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2898 = b52 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2899 = b53 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2900 = b54 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2901 = b55 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2902 = b56 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2903 = b57 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2904 = b58 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2905 = b59 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2906 = b5a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2907 = b5b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2908 = b5c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2909 = b5d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2910 = b5e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2911 = b5f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2912 = b60 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2913 = b61 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2914 = b62 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2915 = b63 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2916 = b64 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2917 = b65 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2918 = b66 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2919 = b67 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2920 = b68 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2921 = b69 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2922 = b6a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2923 = b6b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2924 = b6c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2925 = b6d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2926 = b6e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2927 = b6f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2928 = b70 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2929 = b71 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2930 = b72 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2931 = b73 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2932 = b74 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2933 = b75 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2934 = b76 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2935 = b77 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2936 = b78 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2937 = b79 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2938 = b7a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2939 = b7b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2940 = b7c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2941 = b7d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2942 = b7e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2943 = b7f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2944 = b80 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2945 = b81 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2946 = b82 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2947 = b83 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2948 = b84 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2949 = b85 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2950 = b86 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2951 = b87 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2952 = b88 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2953 = b89 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2954 = b8a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2955 = b8b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2956 = b8c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2957 = b8d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2958 = b8e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2959 = b8f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2960 = b90 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2961 = b91 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2962 = b92 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2963 = b93 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2964 = b94 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2965 = b95 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2966 = b96 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2967 = b97 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2968 = b98 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2969 = b99 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2970 = b9a */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2971 = b9b */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2972 = b9c */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2973 = b9d */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2974 = b9e */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2975 = b9f */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2976 = ba0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2977 = ba1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2978 = ba2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2979 = ba3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2980 = ba4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2981 = ba5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2982 = ba6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2983 = ba7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2984 = ba8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2985 = ba9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2986 = baa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2987 = bab */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2988 = bac */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2989 = bad */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2990 = bae */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2991 = baf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2992 = bb0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2993 = bb1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2994 = bb2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2995 = bb3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2996 = bb4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2997 = bb5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2998 = bb6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 2999 = bb7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3000 = bb8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3001 = bb9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3002 = bba */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3003 = bbb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3004 = bbc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3005 = bbd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3006 = bbe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3007 = bbf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3008 = bc0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3009 = bc1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3010 = bc2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3011 = bc3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3012 = bc4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3013 = bc5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3014 = bc6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3015 = bc7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3016 = bc8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3017 = bc9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3018 = bca */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3019 = bcb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3020 = bcc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3021 = bcd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3022 = bce */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3023 = bcf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3024 = bd0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3025 = bd1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3026 = bd2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3027 = bd3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3028 = bd4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3029 = bd5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3030 = bd6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3031 = bd7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3032 = bd8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3033 = bd9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3034 = bda */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3035 = bdb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3036 = bdc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3037 = bdd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3038 = bde */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3039 = bdf */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3040 = be0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3041 = be1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3042 = be2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3043 = be3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3044 = be4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3045 = be5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3046 = be6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3047 = be7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3048 = be8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3049 = be9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3050 = bea */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3051 = beb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3052 = bec */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3053 = bed */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3054 = bee */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3055 = bef */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3056 = bf0 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3057 = bf1 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3058 = bf2 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3059 = bf3 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3060 = bf4 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3061 = bf5 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3062 = bf6 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3063 = bf7 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3064 = bf8 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3065 = bf9 */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3066 = bfa */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3067 = bfb */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3068 = bfc */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3069 = bfd */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3070 = bfe */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3071 = bff */ {1, 0, 3}, /* 0x0002 => 0x0800+(1024)*/ - /* 3072 = c00 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3073 = c01 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3074 = c02 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3075 = c03 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3076 = c04 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3077 = c05 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3078 = c06 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3079 = c07 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3080 = c08 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3081 = c09 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3082 = c0a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3083 = c0b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3084 = c0c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3085 = c0d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3086 = c0e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3087 = c0f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3088 = c10 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3089 = c11 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3090 = c12 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3091 = c13 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3092 = c14 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3093 = c15 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3094 = c16 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3095 = c17 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3096 = c18 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3097 = c19 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3098 = c1a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3099 = c1b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3100 = c1c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3101 = c1d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3102 = c1e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3103 = c1f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3104 = c20 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3105 = c21 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3106 = c22 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3107 = c23 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3108 = c24 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3109 = c25 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3110 = c26 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3111 = c27 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3112 = c28 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3113 = c29 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3114 = c2a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3115 = c2b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3116 = c2c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3117 = c2d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3118 = c2e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3119 = c2f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3120 = c30 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3121 = c31 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3122 = c32 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3123 = c33 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3124 = c34 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3125 = c35 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3126 = c36 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3127 = c37 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3128 = c38 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3129 = c39 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3130 = c3a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3131 = c3b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3132 = c3c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3133 = c3d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3134 = c3e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3135 = c3f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3136 = c40 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3137 = c41 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3138 = c42 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3139 = c43 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3140 = c44 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3141 = c45 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3142 = c46 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3143 = c47 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3144 = c48 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3145 = c49 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3146 = c4a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3147 = c4b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3148 = c4c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3149 = c4d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3150 = c4e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3151 = c4f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3152 = c50 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3153 = c51 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3154 = c52 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3155 = c53 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3156 = c54 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3157 = c55 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3158 = c56 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3159 = c57 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3160 = c58 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3161 = c59 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3162 = c5a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3163 = c5b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3164 = c5c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3165 = c5d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3166 = c5e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3167 = c5f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3168 = c60 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3169 = c61 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3170 = c62 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3171 = c63 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3172 = c64 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3173 = c65 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3174 = c66 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3175 = c67 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3176 = c68 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3177 = c69 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3178 = c6a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3179 = c6b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3180 = c6c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3181 = c6d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3182 = c6e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3183 = c6f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3184 = c70 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3185 = c71 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3186 = c72 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3187 = c73 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3188 = c74 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3189 = c75 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3190 = c76 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3191 = c77 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3192 = c78 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3193 = c79 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3194 = c7a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3195 = c7b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3196 = c7c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3197 = c7d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3198 = c7e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3199 = c7f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3200 = c80 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3201 = c81 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3202 = c82 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3203 = c83 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3204 = c84 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3205 = c85 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3206 = c86 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3207 = c87 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3208 = c88 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3209 = c89 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3210 = c8a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3211 = c8b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3212 = c8c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3213 = c8d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3214 = c8e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3215 = c8f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3216 = c90 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3217 = c91 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3218 = c92 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3219 = c93 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3220 = c94 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3221 = c95 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3222 = c96 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3223 = c97 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3224 = c98 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3225 = c99 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3226 = c9a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3227 = c9b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3228 = c9c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3229 = c9d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3230 = c9e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3231 = c9f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3232 = ca0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3233 = ca1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3234 = ca2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3235 = ca3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3236 = ca4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3237 = ca5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3238 = ca6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3239 = ca7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3240 = ca8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3241 = ca9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3242 = caa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3243 = cab */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3244 = cac */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3245 = cad */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3246 = cae */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3247 = caf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3248 = cb0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3249 = cb1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3250 = cb2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3251 = cb3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3252 = cb4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3253 = cb5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3254 = cb6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3255 = cb7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3256 = cb8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3257 = cb9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3258 = cba */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3259 = cbb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3260 = cbc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3261 = cbd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3262 = cbe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3263 = cbf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3264 = cc0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3265 = cc1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3266 = cc2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3267 = cc3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3268 = cc4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3269 = cc5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3270 = cc6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3271 = cc7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3272 = cc8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3273 = cc9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3274 = cca */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3275 = ccb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3276 = ccc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3277 = ccd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3278 = cce */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3279 = ccf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3280 = cd0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3281 = cd1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3282 = cd2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3283 = cd3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3284 = cd4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3285 = cd5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3286 = cd6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3287 = cd7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3288 = cd8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3289 = cd9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3290 = cda */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3291 = cdb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3292 = cdc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3293 = cdd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3294 = cde */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3295 = cdf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3296 = ce0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3297 = ce1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3298 = ce2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3299 = ce3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3300 = ce4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3301 = ce5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3302 = ce6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3303 = ce7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3304 = ce8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3305 = ce9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3306 = cea */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3307 = ceb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3308 = cec */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3309 = ced */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3310 = cee */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3311 = cef */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3312 = cf0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3313 = cf1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3314 = cf2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3315 = cf3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3316 = cf4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3317 = cf5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3318 = cf6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3319 = cf7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3320 = cf8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3321 = cf9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3322 = cfa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3323 = cfb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3324 = cfc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3325 = cfd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3326 = cfe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3327 = cff */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3328 = d00 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3329 = d01 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3330 = d02 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3331 = d03 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3332 = d04 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3333 = d05 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3334 = d06 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3335 = d07 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3336 = d08 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3337 = d09 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3338 = d0a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3339 = d0b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3340 = d0c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3341 = d0d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3342 = d0e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3343 = d0f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3344 = d10 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3345 = d11 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3346 = d12 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3347 = d13 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3348 = d14 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3349 = d15 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3350 = d16 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3351 = d17 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3352 = d18 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3353 = d19 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3354 = d1a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3355 = d1b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3356 = d1c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3357 = d1d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3358 = d1e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3359 = d1f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3360 = d20 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3361 = d21 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3362 = d22 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3363 = d23 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3364 = d24 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3365 = d25 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3366 = d26 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3367 = d27 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3368 = d28 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3369 = d29 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3370 = d2a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3371 = d2b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3372 = d2c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3373 = d2d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3374 = d2e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3375 = d2f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3376 = d30 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3377 = d31 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3378 = d32 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3379 = d33 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3380 = d34 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3381 = d35 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3382 = d36 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3383 = d37 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3384 = d38 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3385 = d39 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3386 = d3a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3387 = d3b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3388 = d3c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3389 = d3d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3390 = d3e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3391 = d3f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3392 = d40 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3393 = d41 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3394 = d42 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3395 = d43 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3396 = d44 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3397 = d45 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3398 = d46 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3399 = d47 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3400 = d48 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3401 = d49 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3402 = d4a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3403 = d4b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3404 = d4c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3405 = d4d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3406 = d4e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3407 = d4f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3408 = d50 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3409 = d51 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3410 = d52 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3411 = d53 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3412 = d54 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3413 = d55 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3414 = d56 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3415 = d57 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3416 = d58 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3417 = d59 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3418 = d5a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3419 = d5b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3420 = d5c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3421 = d5d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3422 = d5e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3423 = d5f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3424 = d60 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3425 = d61 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3426 = d62 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3427 = d63 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3428 = d64 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3429 = d65 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3430 = d66 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3431 = d67 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3432 = d68 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3433 = d69 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3434 = d6a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3435 = d6b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3436 = d6c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3437 = d6d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3438 = d6e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3439 = d6f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3440 = d70 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3441 = d71 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3442 = d72 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3443 = d73 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3444 = d74 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3445 = d75 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3446 = d76 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3447 = d77 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3448 = d78 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3449 = d79 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3450 = d7a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3451 = d7b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3452 = d7c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3453 = d7d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3454 = d7e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3455 = d7f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3456 = d80 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3457 = d81 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3458 = d82 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3459 = d83 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3460 = d84 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3461 = d85 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3462 = d86 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3463 = d87 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3464 = d88 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3465 = d89 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3466 = d8a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3467 = d8b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3468 = d8c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3469 = d8d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3470 = d8e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3471 = d8f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3472 = d90 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3473 = d91 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3474 = d92 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3475 = d93 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3476 = d94 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3477 = d95 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3478 = d96 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3479 = d97 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3480 = d98 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3481 = d99 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3482 = d9a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3483 = d9b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3484 = d9c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3485 = d9d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3486 = d9e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3487 = d9f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3488 = da0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3489 = da1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3490 = da2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3491 = da3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3492 = da4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3493 = da5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3494 = da6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3495 = da7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3496 = da8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3497 = da9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3498 = daa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3499 = dab */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3500 = dac */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3501 = dad */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3502 = dae */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3503 = daf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3504 = db0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3505 = db1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3506 = db2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3507 = db3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3508 = db4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3509 = db5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3510 = db6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3511 = db7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3512 = db8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3513 = db9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3514 = dba */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3515 = dbb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3516 = dbc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3517 = dbd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3518 = dbe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3519 = dbf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3520 = dc0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3521 = dc1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3522 = dc2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3523 = dc3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3524 = dc4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3525 = dc5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3526 = dc6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3527 = dc7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3528 = dc8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3529 = dc9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3530 = dca */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3531 = dcb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3532 = dcc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3533 = dcd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3534 = dce */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3535 = dcf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3536 = dd0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3537 = dd1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3538 = dd2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3539 = dd3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3540 = dd4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3541 = dd5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3542 = dd6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3543 = dd7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3544 = dd8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3545 = dd9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3546 = dda */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3547 = ddb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3548 = ddc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3549 = ddd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3550 = dde */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3551 = ddf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3552 = de0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3553 = de1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3554 = de2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3555 = de3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3556 = de4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3557 = de5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3558 = de6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3559 = de7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3560 = de8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3561 = de9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3562 = dea */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3563 = deb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3564 = dec */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3565 = ded */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3566 = dee */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3567 = def */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3568 = df0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3569 = df1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3570 = df2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3571 = df3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3572 = df4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3573 = df5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3574 = df6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3575 = df7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3576 = df8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3577 = df9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3578 = dfa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3579 = dfb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3580 = dfc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3581 = dfd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3582 = dfe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3583 = dff */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3584 = e00 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3585 = e01 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3586 = e02 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3587 = e03 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3588 = e04 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3589 = e05 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3590 = e06 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3591 = e07 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3592 = e08 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3593 = e09 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3594 = e0a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3595 = e0b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3596 = e0c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3597 = e0d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3598 = e0e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3599 = e0f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3600 = e10 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3601 = e11 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3602 = e12 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3603 = e13 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3604 = e14 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3605 = e15 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3606 = e16 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3607 = e17 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3608 = e18 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3609 = e19 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3610 = e1a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3611 = e1b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3612 = e1c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3613 = e1d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3614 = e1e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3615 = e1f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3616 = e20 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3617 = e21 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3618 = e22 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3619 = e23 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3620 = e24 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3621 = e25 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3622 = e26 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3623 = e27 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3624 = e28 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3625 = e29 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3626 = e2a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3627 = e2b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3628 = e2c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3629 = e2d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3630 = e2e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3631 = e2f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3632 = e30 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3633 = e31 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3634 = e32 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3635 = e33 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3636 = e34 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3637 = e35 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3638 = e36 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3639 = e37 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3640 = e38 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3641 = e39 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3642 = e3a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3643 = e3b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3644 = e3c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3645 = e3d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3646 = e3e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3647 = e3f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3648 = e40 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3649 = e41 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3650 = e42 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3651 = e43 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3652 = e44 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3653 = e45 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3654 = e46 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3655 = e47 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3656 = e48 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3657 = e49 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3658 = e4a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3659 = e4b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3660 = e4c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3661 = e4d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3662 = e4e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3663 = e4f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3664 = e50 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3665 = e51 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3666 = e52 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3667 = e53 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3668 = e54 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3669 = e55 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3670 = e56 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3671 = e57 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3672 = e58 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3673 = e59 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3674 = e5a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3675 = e5b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3676 = e5c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3677 = e5d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3678 = e5e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3679 = e5f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3680 = e60 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3681 = e61 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3682 = e62 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3683 = e63 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3684 = e64 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3685 = e65 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3686 = e66 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3687 = e67 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3688 = e68 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3689 = e69 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3690 = e6a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3691 = e6b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3692 = e6c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3693 = e6d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3694 = e6e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3695 = e6f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3696 = e70 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3697 = e71 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3698 = e72 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3699 = e73 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3700 = e74 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3701 = e75 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3702 = e76 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3703 = e77 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3704 = e78 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3705 = e79 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3706 = e7a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3707 = e7b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3708 = e7c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3709 = e7d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3710 = e7e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3711 = e7f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3712 = e80 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3713 = e81 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3714 = e82 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3715 = e83 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3716 = e84 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3717 = e85 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3718 = e86 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3719 = e87 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3720 = e88 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3721 = e89 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3722 = e8a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3723 = e8b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3724 = e8c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3725 = e8d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3726 = e8e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3727 = e8f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3728 = e90 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3729 = e91 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3730 = e92 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3731 = e93 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3732 = e94 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3733 = e95 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3734 = e96 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3735 = e97 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3736 = e98 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3737 = e99 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3738 = e9a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3739 = e9b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3740 = e9c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3741 = e9d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3742 = e9e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3743 = e9f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3744 = ea0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3745 = ea1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3746 = ea2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3747 = ea3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3748 = ea4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3749 = ea5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3750 = ea6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3751 = ea7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3752 = ea8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3753 = ea9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3754 = eaa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3755 = eab */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3756 = eac */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3757 = ead */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3758 = eae */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3759 = eaf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3760 = eb0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3761 = eb1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3762 = eb2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3763 = eb3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3764 = eb4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3765 = eb5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3766 = eb6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3767 = eb7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3768 = eb8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3769 = eb9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3770 = eba */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3771 = ebb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3772 = ebc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3773 = ebd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3774 = ebe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3775 = ebf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3776 = ec0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3777 = ec1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3778 = ec2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3779 = ec3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3780 = ec4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3781 = ec5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3782 = ec6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3783 = ec7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3784 = ec8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3785 = ec9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3786 = eca */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3787 = ecb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3788 = ecc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3789 = ecd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3790 = ece */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3791 = ecf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3792 = ed0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3793 = ed1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3794 = ed2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3795 = ed3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3796 = ed4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3797 = ed5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3798 = ed6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3799 = ed7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3800 = ed8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3801 = ed9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3802 = eda */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3803 = edb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3804 = edc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3805 = edd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3806 = ede */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3807 = edf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3808 = ee0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3809 = ee1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3810 = ee2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3811 = ee3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3812 = ee4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3813 = ee5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3814 = ee6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3815 = ee7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3816 = ee8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3817 = ee9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3818 = eea */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3819 = eeb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3820 = eec */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3821 = eed */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3822 = eee */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3823 = eef */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3824 = ef0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3825 = ef1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3826 = ef2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3827 = ef3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3828 = ef4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3829 = ef5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3830 = ef6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3831 = ef7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3832 = ef8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3833 = ef9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3834 = efa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3835 = efb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3836 = efc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3837 = efd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3838 = efe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3839 = eff */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3840 = f00 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3841 = f01 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3842 = f02 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3843 = f03 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3844 = f04 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3845 = f05 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3846 = f06 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3847 = f07 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3848 = f08 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3849 = f09 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3850 = f0a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3851 = f0b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3852 = f0c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3853 = f0d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3854 = f0e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3855 = f0f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3856 = f10 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3857 = f11 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3858 = f12 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3859 = f13 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3860 = f14 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3861 = f15 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3862 = f16 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3863 = f17 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3864 = f18 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3865 = f19 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3866 = f1a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3867 = f1b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3868 = f1c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3869 = f1d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3870 = f1e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3871 = f1f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3872 = f20 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3873 = f21 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3874 = f22 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3875 = f23 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3876 = f24 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3877 = f25 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3878 = f26 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3879 = f27 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3880 = f28 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3881 = f29 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3882 = f2a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3883 = f2b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3884 = f2c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3885 = f2d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3886 = f2e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3887 = f2f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3888 = f30 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3889 = f31 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3890 = f32 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3891 = f33 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3892 = f34 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3893 = f35 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3894 = f36 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3895 = f37 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3896 = f38 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3897 = f39 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3898 = f3a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3899 = f3b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3900 = f3c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3901 = f3d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3902 = f3e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3903 = f3f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3904 = f40 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3905 = f41 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3906 = f42 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3907 = f43 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3908 = f44 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3909 = f45 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3910 = f46 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3911 = f47 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3912 = f48 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3913 = f49 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3914 = f4a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3915 = f4b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3916 = f4c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3917 = f4d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3918 = f4e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3919 = f4f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3920 = f50 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3921 = f51 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3922 = f52 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3923 = f53 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3924 = f54 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3925 = f55 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3926 = f56 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3927 = f57 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3928 = f58 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3929 = f59 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3930 = f5a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3931 = f5b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3932 = f5c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3933 = f5d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3934 = f5e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3935 = f5f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3936 = f60 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3937 = f61 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3938 = f62 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3939 = f63 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3940 = f64 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3941 = f65 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3942 = f66 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3943 = f67 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3944 = f68 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3945 = f69 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3946 = f6a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3947 = f6b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3948 = f6c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3949 = f6d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3950 = f6e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3951 = f6f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3952 = f70 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3953 = f71 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3954 = f72 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3955 = f73 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3956 = f74 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3957 = f75 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3958 = f76 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3959 = f77 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3960 = f78 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3961 = f79 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3962 = f7a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3963 = f7b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3964 = f7c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3965 = f7d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3966 = f7e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3967 = f7f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3968 = f80 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3969 = f81 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3970 = f82 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3971 = f83 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3972 = f84 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3973 = f85 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3974 = f86 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3975 = f87 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3976 = f88 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3977 = f89 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3978 = f8a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3979 = f8b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3980 = f8c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3981 = f8d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3982 = f8e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3983 = f8f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3984 = f90 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3985 = f91 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3986 = f92 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3987 = f93 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3988 = f94 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3989 = f95 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3990 = f96 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3991 = f97 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3992 = f98 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3993 = f99 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3994 = f9a */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3995 = f9b */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3996 = f9c */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3997 = f9d */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3998 = f9e */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 3999 = f9f */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4000 = fa0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4001 = fa1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4002 = fa2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4003 = fa3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4004 = fa4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4005 = fa5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4006 = fa6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4007 = fa7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4008 = fa8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4009 = fa9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4010 = faa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4011 = fab */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4012 = fac */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4013 = fad */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4014 = fae */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4015 = faf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4016 = fb0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4017 = fb1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4018 = fb2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4019 = fb3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4020 = fb4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4021 = fb5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4022 = fb6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4023 = fb7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4024 = fb8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4025 = fb9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4026 = fba */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4027 = fbb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4028 = fbc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4029 = fbd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4030 = fbe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4031 = fbf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4032 = fc0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4033 = fc1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4034 = fc2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4035 = fc3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4036 = fc4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4037 = fc5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4038 = fc6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4039 = fc7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4040 = fc8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4041 = fc9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4042 = fca */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4043 = fcb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4044 = fcc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4045 = fcd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4046 = fce */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4047 = fcf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4048 = fd0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4049 = fd1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4050 = fd2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4051 = fd3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4052 = fd4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4053 = fd5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4054 = fd6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4055 = fd7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4056 = fd8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4057 = fd9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4058 = fda */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4059 = fdb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4060 = fdc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4061 = fdd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4062 = fde */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4063 = fdf */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4064 = fe0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4065 = fe1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4066 = fe2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4067 = fe3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4068 = fe4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4069 = fe5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4070 = fe6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4071 = fe7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4072 = fe8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4073 = fe9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4074 = fea */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4075 = feb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4076 = fec */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4077 = fed */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4078 = fee */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4079 = fef */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4080 = ff0 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4081 = ff1 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4082 = ff2 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4083 = ff3 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4084 = ff4 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4085 = ff5 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4086 = ff6 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4087 = ff7 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4088 = ff8 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4089 = ff9 */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4090 = ffa */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4091 = ffb */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4092 = ffc */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4093 = ffd */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4094 = ffe */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4095 = fff */ {4, 0, 3}, /* 0x0003 => 0x0c00+(1024)*/ - /* 4096 = 1000 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4097 = 1001 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4098 = 1002 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4099 = 1003 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4100 = 1004 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4101 = 1005 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4102 = 1006 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4103 = 1007 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4104 = 1008 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4105 = 1009 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4106 = 100a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4107 = 100b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4108 = 100c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4109 = 100d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4110 = 100e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4111 = 100f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4112 = 1010 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4113 = 1011 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4114 = 1012 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4115 = 1013 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4116 = 1014 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4117 = 1015 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4118 = 1016 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4119 = 1017 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4120 = 1018 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4121 = 1019 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4122 = 101a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4123 = 101b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4124 = 101c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4125 = 101d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4126 = 101e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4127 = 101f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4128 = 1020 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4129 = 1021 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4130 = 1022 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4131 = 1023 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4132 = 1024 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4133 = 1025 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4134 = 1026 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4135 = 1027 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4136 = 1028 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4137 = 1029 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4138 = 102a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4139 = 102b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4140 = 102c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4141 = 102d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4142 = 102e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4143 = 102f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4144 = 1030 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4145 = 1031 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4146 = 1032 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4147 = 1033 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4148 = 1034 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4149 = 1035 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4150 = 1036 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4151 = 1037 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4152 = 1038 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4153 = 1039 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4154 = 103a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4155 = 103b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4156 = 103c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4157 = 103d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4158 = 103e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4159 = 103f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4160 = 1040 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4161 = 1041 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4162 = 1042 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4163 = 1043 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4164 = 1044 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4165 = 1045 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4166 = 1046 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4167 = 1047 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4168 = 1048 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4169 = 1049 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4170 = 104a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4171 = 104b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4172 = 104c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4173 = 104d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4174 = 104e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4175 = 104f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4176 = 1050 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4177 = 1051 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4178 = 1052 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4179 = 1053 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4180 = 1054 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4181 = 1055 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4182 = 1056 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4183 = 1057 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4184 = 1058 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4185 = 1059 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4186 = 105a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4187 = 105b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4188 = 105c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4189 = 105d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4190 = 105e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4191 = 105f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4192 = 1060 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4193 = 1061 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4194 = 1062 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4195 = 1063 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4196 = 1064 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4197 = 1065 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4198 = 1066 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4199 = 1067 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4200 = 1068 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4201 = 1069 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4202 = 106a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4203 = 106b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4204 = 106c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4205 = 106d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4206 = 106e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4207 = 106f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4208 = 1070 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4209 = 1071 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4210 = 1072 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4211 = 1073 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4212 = 1074 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4213 = 1075 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4214 = 1076 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4215 = 1077 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4216 = 1078 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4217 = 1079 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4218 = 107a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4219 = 107b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4220 = 107c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4221 = 107d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4222 = 107e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4223 = 107f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4224 = 1080 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4225 = 1081 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4226 = 1082 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4227 = 1083 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4228 = 1084 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4229 = 1085 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4230 = 1086 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4231 = 1087 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4232 = 1088 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4233 = 1089 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4234 = 108a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4235 = 108b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4236 = 108c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4237 = 108d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4238 = 108e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4239 = 108f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4240 = 1090 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4241 = 1091 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4242 = 1092 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4243 = 1093 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4244 = 1094 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4245 = 1095 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4246 = 1096 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4247 = 1097 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4248 = 1098 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4249 = 1099 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4250 = 109a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4251 = 109b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4252 = 109c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4253 = 109d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4254 = 109e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4255 = 109f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4256 = 10a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4257 = 10a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4258 = 10a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4259 = 10a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4260 = 10a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4261 = 10a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4262 = 10a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4263 = 10a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4264 = 10a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4265 = 10a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4266 = 10aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4267 = 10ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4268 = 10ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4269 = 10ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4270 = 10ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4271 = 10af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4272 = 10b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4273 = 10b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4274 = 10b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4275 = 10b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4276 = 10b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4277 = 10b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4278 = 10b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4279 = 10b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4280 = 10b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4281 = 10b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4282 = 10ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4283 = 10bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4284 = 10bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4285 = 10bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4286 = 10be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4287 = 10bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4288 = 10c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4289 = 10c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4290 = 10c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4291 = 10c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4292 = 10c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4293 = 10c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4294 = 10c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4295 = 10c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4296 = 10c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4297 = 10c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4298 = 10ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4299 = 10cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4300 = 10cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4301 = 10cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4302 = 10ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4303 = 10cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4304 = 10d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4305 = 10d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4306 = 10d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4307 = 10d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4308 = 10d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4309 = 10d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4310 = 10d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4311 = 10d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4312 = 10d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4313 = 10d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4314 = 10da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4315 = 10db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4316 = 10dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4317 = 10dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4318 = 10de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4319 = 10df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4320 = 10e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4321 = 10e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4322 = 10e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4323 = 10e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4324 = 10e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4325 = 10e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4326 = 10e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4327 = 10e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4328 = 10e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4329 = 10e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4330 = 10ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4331 = 10eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4332 = 10ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4333 = 10ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4334 = 10ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4335 = 10ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4336 = 10f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4337 = 10f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4338 = 10f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4339 = 10f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4340 = 10f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4341 = 10f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4342 = 10f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4343 = 10f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4344 = 10f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4345 = 10f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4346 = 10fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4347 = 10fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4348 = 10fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4349 = 10fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4350 = 10fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4351 = 10ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4352 = 1100 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4353 = 1101 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4354 = 1102 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4355 = 1103 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4356 = 1104 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4357 = 1105 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4358 = 1106 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4359 = 1107 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4360 = 1108 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4361 = 1109 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4362 = 110a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4363 = 110b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4364 = 110c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4365 = 110d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4366 = 110e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4367 = 110f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4368 = 1110 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4369 = 1111 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4370 = 1112 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4371 = 1113 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4372 = 1114 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4373 = 1115 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4374 = 1116 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4375 = 1117 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4376 = 1118 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4377 = 1119 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4378 = 111a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4379 = 111b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4380 = 111c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4381 = 111d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4382 = 111e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4383 = 111f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4384 = 1120 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4385 = 1121 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4386 = 1122 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4387 = 1123 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4388 = 1124 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4389 = 1125 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4390 = 1126 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4391 = 1127 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4392 = 1128 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4393 = 1129 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4394 = 112a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4395 = 112b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4396 = 112c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4397 = 112d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4398 = 112e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4399 = 112f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4400 = 1130 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4401 = 1131 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4402 = 1132 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4403 = 1133 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4404 = 1134 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4405 = 1135 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4406 = 1136 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4407 = 1137 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4408 = 1138 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4409 = 1139 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4410 = 113a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4411 = 113b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4412 = 113c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4413 = 113d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4414 = 113e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4415 = 113f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4416 = 1140 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4417 = 1141 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4418 = 1142 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4419 = 1143 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4420 = 1144 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4421 = 1145 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4422 = 1146 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4423 = 1147 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4424 = 1148 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4425 = 1149 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4426 = 114a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4427 = 114b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4428 = 114c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4429 = 114d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4430 = 114e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4431 = 114f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4432 = 1150 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4433 = 1151 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4434 = 1152 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4435 = 1153 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4436 = 1154 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4437 = 1155 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4438 = 1156 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4439 = 1157 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4440 = 1158 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4441 = 1159 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4442 = 115a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4443 = 115b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4444 = 115c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4445 = 115d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4446 = 115e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4447 = 115f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4448 = 1160 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4449 = 1161 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4450 = 1162 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4451 = 1163 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4452 = 1164 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4453 = 1165 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4454 = 1166 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4455 = 1167 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4456 = 1168 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4457 = 1169 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4458 = 116a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4459 = 116b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4460 = 116c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4461 = 116d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4462 = 116e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4463 = 116f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4464 = 1170 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4465 = 1171 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4466 = 1172 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4467 = 1173 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4468 = 1174 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4469 = 1175 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4470 = 1176 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4471 = 1177 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4472 = 1178 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4473 = 1179 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4474 = 117a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4475 = 117b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4476 = 117c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4477 = 117d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4478 = 117e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4479 = 117f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4480 = 1180 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4481 = 1181 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4482 = 1182 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4483 = 1183 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4484 = 1184 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4485 = 1185 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4486 = 1186 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4487 = 1187 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4488 = 1188 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4489 = 1189 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4490 = 118a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4491 = 118b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4492 = 118c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4493 = 118d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4494 = 118e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4495 = 118f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4496 = 1190 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4497 = 1191 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4498 = 1192 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4499 = 1193 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4500 = 1194 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4501 = 1195 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4502 = 1196 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4503 = 1197 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4504 = 1198 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4505 = 1199 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4506 = 119a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4507 = 119b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4508 = 119c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4509 = 119d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4510 = 119e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4511 = 119f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4512 = 11a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4513 = 11a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4514 = 11a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4515 = 11a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4516 = 11a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4517 = 11a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4518 = 11a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4519 = 11a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4520 = 11a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4521 = 11a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4522 = 11aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4523 = 11ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4524 = 11ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4525 = 11ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4526 = 11ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4527 = 11af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4528 = 11b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4529 = 11b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4530 = 11b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4531 = 11b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4532 = 11b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4533 = 11b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4534 = 11b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4535 = 11b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4536 = 11b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4537 = 11b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4538 = 11ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4539 = 11bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4540 = 11bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4541 = 11bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4542 = 11be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4543 = 11bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4544 = 11c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4545 = 11c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4546 = 11c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4547 = 11c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4548 = 11c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4549 = 11c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4550 = 11c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4551 = 11c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4552 = 11c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4553 = 11c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4554 = 11ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4555 = 11cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4556 = 11cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4557 = 11cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4558 = 11ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4559 = 11cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4560 = 11d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4561 = 11d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4562 = 11d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4563 = 11d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4564 = 11d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4565 = 11d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4566 = 11d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4567 = 11d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4568 = 11d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4569 = 11d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4570 = 11da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4571 = 11db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4572 = 11dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4573 = 11dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4574 = 11de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4575 = 11df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4576 = 11e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4577 = 11e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4578 = 11e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4579 = 11e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4580 = 11e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4581 = 11e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4582 = 11e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4583 = 11e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4584 = 11e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4585 = 11e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4586 = 11ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4587 = 11eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4588 = 11ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4589 = 11ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4590 = 11ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4591 = 11ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4592 = 11f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4593 = 11f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4594 = 11f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4595 = 11f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4596 = 11f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4597 = 11f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4598 = 11f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4599 = 11f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4600 = 11f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4601 = 11f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4602 = 11fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4603 = 11fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4604 = 11fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4605 = 11fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4606 = 11fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4607 = 11ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4608 = 1200 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4609 = 1201 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4610 = 1202 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4611 = 1203 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4612 = 1204 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4613 = 1205 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4614 = 1206 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4615 = 1207 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4616 = 1208 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4617 = 1209 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4618 = 120a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4619 = 120b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4620 = 120c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4621 = 120d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4622 = 120e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4623 = 120f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4624 = 1210 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4625 = 1211 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4626 = 1212 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4627 = 1213 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4628 = 1214 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4629 = 1215 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4630 = 1216 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4631 = 1217 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4632 = 1218 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4633 = 1219 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4634 = 121a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4635 = 121b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4636 = 121c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4637 = 121d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4638 = 121e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4639 = 121f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4640 = 1220 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4641 = 1221 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4642 = 1222 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4643 = 1223 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4644 = 1224 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4645 = 1225 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4646 = 1226 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4647 = 1227 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4648 = 1228 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4649 = 1229 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4650 = 122a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4651 = 122b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4652 = 122c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4653 = 122d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4654 = 122e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4655 = 122f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4656 = 1230 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4657 = 1231 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4658 = 1232 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4659 = 1233 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4660 = 1234 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4661 = 1235 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4662 = 1236 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4663 = 1237 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4664 = 1238 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4665 = 1239 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4666 = 123a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4667 = 123b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4668 = 123c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4669 = 123d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4670 = 123e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4671 = 123f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4672 = 1240 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4673 = 1241 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4674 = 1242 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4675 = 1243 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4676 = 1244 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4677 = 1245 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4678 = 1246 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4679 = 1247 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4680 = 1248 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4681 = 1249 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4682 = 124a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4683 = 124b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4684 = 124c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4685 = 124d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4686 = 124e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4687 = 124f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4688 = 1250 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4689 = 1251 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4690 = 1252 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4691 = 1253 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4692 = 1254 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4693 = 1255 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4694 = 1256 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4695 = 1257 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4696 = 1258 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4697 = 1259 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4698 = 125a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4699 = 125b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4700 = 125c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4701 = 125d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4702 = 125e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4703 = 125f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4704 = 1260 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4705 = 1261 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4706 = 1262 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4707 = 1263 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4708 = 1264 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4709 = 1265 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4710 = 1266 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4711 = 1267 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4712 = 1268 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4713 = 1269 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4714 = 126a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4715 = 126b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4716 = 126c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4717 = 126d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4718 = 126e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4719 = 126f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4720 = 1270 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4721 = 1271 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4722 = 1272 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4723 = 1273 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4724 = 1274 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4725 = 1275 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4726 = 1276 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4727 = 1277 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4728 = 1278 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4729 = 1279 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4730 = 127a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4731 = 127b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4732 = 127c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4733 = 127d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4734 = 127e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4735 = 127f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4736 = 1280 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4737 = 1281 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4738 = 1282 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4739 = 1283 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4740 = 1284 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4741 = 1285 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4742 = 1286 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4743 = 1287 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4744 = 1288 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4745 = 1289 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4746 = 128a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4747 = 128b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4748 = 128c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4749 = 128d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4750 = 128e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4751 = 128f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4752 = 1290 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4753 = 1291 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4754 = 1292 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4755 = 1293 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4756 = 1294 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4757 = 1295 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4758 = 1296 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4759 = 1297 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4760 = 1298 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4761 = 1299 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4762 = 129a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4763 = 129b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4764 = 129c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4765 = 129d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4766 = 129e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4767 = 129f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4768 = 12a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4769 = 12a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4770 = 12a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4771 = 12a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4772 = 12a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4773 = 12a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4774 = 12a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4775 = 12a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4776 = 12a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4777 = 12a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4778 = 12aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4779 = 12ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4780 = 12ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4781 = 12ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4782 = 12ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4783 = 12af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4784 = 12b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4785 = 12b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4786 = 12b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4787 = 12b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4788 = 12b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4789 = 12b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4790 = 12b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4791 = 12b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4792 = 12b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4793 = 12b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4794 = 12ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4795 = 12bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4796 = 12bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4797 = 12bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4798 = 12be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4799 = 12bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4800 = 12c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4801 = 12c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4802 = 12c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4803 = 12c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4804 = 12c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4805 = 12c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4806 = 12c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4807 = 12c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4808 = 12c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4809 = 12c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4810 = 12ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4811 = 12cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4812 = 12cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4813 = 12cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4814 = 12ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4815 = 12cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4816 = 12d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4817 = 12d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4818 = 12d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4819 = 12d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4820 = 12d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4821 = 12d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4822 = 12d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4823 = 12d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4824 = 12d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4825 = 12d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4826 = 12da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4827 = 12db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4828 = 12dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4829 = 12dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4830 = 12de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4831 = 12df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4832 = 12e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4833 = 12e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4834 = 12e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4835 = 12e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4836 = 12e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4837 = 12e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4838 = 12e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4839 = 12e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4840 = 12e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4841 = 12e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4842 = 12ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4843 = 12eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4844 = 12ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4845 = 12ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4846 = 12ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4847 = 12ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4848 = 12f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4849 = 12f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4850 = 12f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4851 = 12f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4852 = 12f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4853 = 12f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4854 = 12f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4855 = 12f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4856 = 12f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4857 = 12f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4858 = 12fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4859 = 12fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4860 = 12fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4861 = 12fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4862 = 12fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4863 = 12ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4864 = 1300 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4865 = 1301 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4866 = 1302 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4867 = 1303 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4868 = 1304 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4869 = 1305 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4870 = 1306 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4871 = 1307 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4872 = 1308 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4873 = 1309 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4874 = 130a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4875 = 130b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4876 = 130c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4877 = 130d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4878 = 130e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4879 = 130f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4880 = 1310 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4881 = 1311 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4882 = 1312 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4883 = 1313 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4884 = 1314 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4885 = 1315 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4886 = 1316 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4887 = 1317 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4888 = 1318 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4889 = 1319 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4890 = 131a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4891 = 131b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4892 = 131c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4893 = 131d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4894 = 131e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4895 = 131f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4896 = 1320 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4897 = 1321 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4898 = 1322 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4899 = 1323 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4900 = 1324 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4901 = 1325 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4902 = 1326 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4903 = 1327 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4904 = 1328 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4905 = 1329 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4906 = 132a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4907 = 132b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4908 = 132c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4909 = 132d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4910 = 132e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4911 = 132f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4912 = 1330 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4913 = 1331 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4914 = 1332 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4915 = 1333 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4916 = 1334 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4917 = 1335 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4918 = 1336 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4919 = 1337 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4920 = 1338 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4921 = 1339 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4922 = 133a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4923 = 133b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4924 = 133c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4925 = 133d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4926 = 133e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4927 = 133f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4928 = 1340 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4929 = 1341 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4930 = 1342 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4931 = 1343 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4932 = 1344 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4933 = 1345 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4934 = 1346 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4935 = 1347 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4936 = 1348 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4937 = 1349 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4938 = 134a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4939 = 134b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4940 = 134c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4941 = 134d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4942 = 134e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4943 = 134f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4944 = 1350 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4945 = 1351 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4946 = 1352 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4947 = 1353 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4948 = 1354 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4949 = 1355 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4950 = 1356 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4951 = 1357 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4952 = 1358 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4953 = 1359 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4954 = 135a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4955 = 135b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4956 = 135c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4957 = 135d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4958 = 135e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4959 = 135f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4960 = 1360 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4961 = 1361 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4962 = 1362 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4963 = 1363 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4964 = 1364 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4965 = 1365 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4966 = 1366 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4967 = 1367 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4968 = 1368 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4969 = 1369 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4970 = 136a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4971 = 136b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4972 = 136c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4973 = 136d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4974 = 136e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4975 = 136f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4976 = 1370 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4977 = 1371 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4978 = 1372 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4979 = 1373 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4980 = 1374 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4981 = 1375 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4982 = 1376 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4983 = 1377 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4984 = 1378 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4985 = 1379 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4986 = 137a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4987 = 137b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4988 = 137c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4989 = 137d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4990 = 137e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4991 = 137f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4992 = 1380 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4993 = 1381 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4994 = 1382 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4995 = 1383 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4996 = 1384 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4997 = 1385 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4998 = 1386 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 4999 = 1387 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5000 = 1388 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5001 = 1389 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5002 = 138a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5003 = 138b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5004 = 138c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5005 = 138d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5006 = 138e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5007 = 138f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5008 = 1390 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5009 = 1391 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5010 = 1392 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5011 = 1393 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5012 = 1394 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5013 = 1395 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5014 = 1396 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5015 = 1397 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5016 = 1398 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5017 = 1399 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5018 = 139a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5019 = 139b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5020 = 139c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5021 = 139d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5022 = 139e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5023 = 139f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5024 = 13a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5025 = 13a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5026 = 13a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5027 = 13a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5028 = 13a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5029 = 13a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5030 = 13a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5031 = 13a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5032 = 13a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5033 = 13a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5034 = 13aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5035 = 13ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5036 = 13ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5037 = 13ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5038 = 13ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5039 = 13af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5040 = 13b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5041 = 13b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5042 = 13b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5043 = 13b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5044 = 13b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5045 = 13b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5046 = 13b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5047 = 13b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5048 = 13b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5049 = 13b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5050 = 13ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5051 = 13bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5052 = 13bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5053 = 13bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5054 = 13be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5055 = 13bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5056 = 13c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5057 = 13c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5058 = 13c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5059 = 13c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5060 = 13c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5061 = 13c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5062 = 13c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5063 = 13c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5064 = 13c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5065 = 13c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5066 = 13ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5067 = 13cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5068 = 13cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5069 = 13cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5070 = 13ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5071 = 13cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5072 = 13d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5073 = 13d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5074 = 13d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5075 = 13d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5076 = 13d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5077 = 13d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5078 = 13d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5079 = 13d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5080 = 13d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5081 = 13d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5082 = 13da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5083 = 13db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5084 = 13dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5085 = 13dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5086 = 13de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5087 = 13df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5088 = 13e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5089 = 13e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5090 = 13e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5091 = 13e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5092 = 13e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5093 = 13e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5094 = 13e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5095 = 13e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5096 = 13e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5097 = 13e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5098 = 13ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5099 = 13eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5100 = 13ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5101 = 13ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5102 = 13ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5103 = 13ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5104 = 13f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5105 = 13f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5106 = 13f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5107 = 13f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5108 = 13f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5109 = 13f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5110 = 13f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5111 = 13f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5112 = 13f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5113 = 13f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5114 = 13fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5115 = 13fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5116 = 13fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5117 = 13fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5118 = 13fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5119 = 13ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5120 = 1400 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5121 = 1401 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5122 = 1402 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5123 = 1403 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5124 = 1404 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5125 = 1405 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5126 = 1406 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5127 = 1407 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5128 = 1408 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5129 = 1409 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5130 = 140a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5131 = 140b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5132 = 140c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5133 = 140d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5134 = 140e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5135 = 140f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5136 = 1410 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5137 = 1411 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5138 = 1412 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5139 = 1413 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5140 = 1414 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5141 = 1415 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5142 = 1416 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5143 = 1417 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5144 = 1418 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5145 = 1419 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5146 = 141a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5147 = 141b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5148 = 141c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5149 = 141d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5150 = 141e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5151 = 141f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5152 = 1420 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5153 = 1421 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5154 = 1422 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5155 = 1423 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5156 = 1424 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5157 = 1425 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5158 = 1426 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5159 = 1427 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5160 = 1428 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5161 = 1429 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5162 = 142a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5163 = 142b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5164 = 142c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5165 = 142d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5166 = 142e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5167 = 142f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5168 = 1430 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5169 = 1431 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5170 = 1432 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5171 = 1433 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5172 = 1434 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5173 = 1435 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5174 = 1436 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5175 = 1437 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5176 = 1438 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5177 = 1439 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5178 = 143a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5179 = 143b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5180 = 143c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5181 = 143d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5182 = 143e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5183 = 143f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5184 = 1440 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5185 = 1441 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5186 = 1442 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5187 = 1443 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5188 = 1444 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5189 = 1445 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5190 = 1446 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5191 = 1447 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5192 = 1448 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5193 = 1449 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5194 = 144a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5195 = 144b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5196 = 144c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5197 = 144d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5198 = 144e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5199 = 144f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5200 = 1450 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5201 = 1451 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5202 = 1452 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5203 = 1453 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5204 = 1454 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5205 = 1455 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5206 = 1456 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5207 = 1457 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5208 = 1458 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5209 = 1459 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5210 = 145a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5211 = 145b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5212 = 145c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5213 = 145d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5214 = 145e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5215 = 145f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5216 = 1460 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5217 = 1461 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5218 = 1462 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5219 = 1463 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5220 = 1464 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5221 = 1465 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5222 = 1466 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5223 = 1467 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5224 = 1468 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5225 = 1469 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5226 = 146a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5227 = 146b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5228 = 146c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5229 = 146d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5230 = 146e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5231 = 146f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5232 = 1470 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5233 = 1471 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5234 = 1472 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5235 = 1473 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5236 = 1474 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5237 = 1475 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5238 = 1476 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5239 = 1477 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5240 = 1478 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5241 = 1479 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5242 = 147a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5243 = 147b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5244 = 147c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5245 = 147d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5246 = 147e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5247 = 147f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5248 = 1480 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5249 = 1481 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5250 = 1482 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5251 = 1483 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5252 = 1484 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5253 = 1485 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5254 = 1486 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5255 = 1487 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5256 = 1488 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5257 = 1489 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5258 = 148a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5259 = 148b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5260 = 148c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5261 = 148d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5262 = 148e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5263 = 148f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5264 = 1490 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5265 = 1491 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5266 = 1492 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5267 = 1493 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5268 = 1494 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5269 = 1495 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5270 = 1496 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5271 = 1497 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5272 = 1498 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5273 = 1499 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5274 = 149a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5275 = 149b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5276 = 149c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5277 = 149d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5278 = 149e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5279 = 149f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5280 = 14a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5281 = 14a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5282 = 14a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5283 = 14a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5284 = 14a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5285 = 14a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5286 = 14a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5287 = 14a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5288 = 14a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5289 = 14a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5290 = 14aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5291 = 14ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5292 = 14ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5293 = 14ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5294 = 14ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5295 = 14af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5296 = 14b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5297 = 14b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5298 = 14b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5299 = 14b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5300 = 14b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5301 = 14b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5302 = 14b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5303 = 14b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5304 = 14b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5305 = 14b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5306 = 14ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5307 = 14bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5308 = 14bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5309 = 14bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5310 = 14be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5311 = 14bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5312 = 14c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5313 = 14c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5314 = 14c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5315 = 14c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5316 = 14c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5317 = 14c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5318 = 14c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5319 = 14c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5320 = 14c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5321 = 14c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5322 = 14ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5323 = 14cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5324 = 14cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5325 = 14cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5326 = 14ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5327 = 14cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5328 = 14d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5329 = 14d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5330 = 14d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5331 = 14d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5332 = 14d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5333 = 14d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5334 = 14d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5335 = 14d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5336 = 14d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5337 = 14d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5338 = 14da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5339 = 14db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5340 = 14dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5341 = 14dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5342 = 14de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5343 = 14df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5344 = 14e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5345 = 14e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5346 = 14e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5347 = 14e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5348 = 14e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5349 = 14e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5350 = 14e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5351 = 14e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5352 = 14e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5353 = 14e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5354 = 14ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5355 = 14eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5356 = 14ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5357 = 14ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5358 = 14ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5359 = 14ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5360 = 14f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5361 = 14f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5362 = 14f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5363 = 14f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5364 = 14f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5365 = 14f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5366 = 14f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5367 = 14f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5368 = 14f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5369 = 14f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5370 = 14fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5371 = 14fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5372 = 14fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5373 = 14fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5374 = 14fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5375 = 14ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5376 = 1500 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5377 = 1501 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5378 = 1502 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5379 = 1503 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5380 = 1504 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5381 = 1505 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5382 = 1506 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5383 = 1507 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5384 = 1508 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5385 = 1509 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5386 = 150a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5387 = 150b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5388 = 150c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5389 = 150d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5390 = 150e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5391 = 150f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5392 = 1510 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5393 = 1511 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5394 = 1512 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5395 = 1513 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5396 = 1514 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5397 = 1515 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5398 = 1516 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5399 = 1517 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5400 = 1518 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5401 = 1519 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5402 = 151a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5403 = 151b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5404 = 151c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5405 = 151d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5406 = 151e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5407 = 151f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5408 = 1520 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5409 = 1521 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5410 = 1522 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5411 = 1523 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5412 = 1524 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5413 = 1525 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5414 = 1526 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5415 = 1527 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5416 = 1528 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5417 = 1529 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5418 = 152a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5419 = 152b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5420 = 152c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5421 = 152d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5422 = 152e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5423 = 152f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5424 = 1530 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5425 = 1531 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5426 = 1532 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5427 = 1533 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5428 = 1534 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5429 = 1535 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5430 = 1536 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5431 = 1537 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5432 = 1538 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5433 = 1539 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5434 = 153a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5435 = 153b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5436 = 153c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5437 = 153d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5438 = 153e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5439 = 153f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5440 = 1540 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5441 = 1541 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5442 = 1542 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5443 = 1543 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5444 = 1544 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5445 = 1545 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5446 = 1546 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5447 = 1547 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5448 = 1548 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5449 = 1549 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5450 = 154a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5451 = 154b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5452 = 154c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5453 = 154d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5454 = 154e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5455 = 154f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5456 = 1550 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5457 = 1551 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5458 = 1552 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5459 = 1553 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5460 = 1554 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5461 = 1555 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5462 = 1556 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5463 = 1557 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5464 = 1558 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5465 = 1559 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5466 = 155a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5467 = 155b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5468 = 155c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5469 = 155d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5470 = 155e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5471 = 155f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5472 = 1560 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5473 = 1561 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5474 = 1562 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5475 = 1563 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5476 = 1564 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5477 = 1565 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5478 = 1566 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5479 = 1567 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5480 = 1568 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5481 = 1569 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5482 = 156a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5483 = 156b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5484 = 156c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5485 = 156d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5486 = 156e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5487 = 156f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5488 = 1570 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5489 = 1571 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5490 = 1572 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5491 = 1573 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5492 = 1574 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5493 = 1575 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5494 = 1576 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5495 = 1577 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5496 = 1578 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5497 = 1579 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5498 = 157a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5499 = 157b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5500 = 157c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5501 = 157d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5502 = 157e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5503 = 157f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5504 = 1580 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5505 = 1581 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5506 = 1582 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5507 = 1583 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5508 = 1584 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5509 = 1585 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5510 = 1586 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5511 = 1587 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5512 = 1588 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5513 = 1589 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5514 = 158a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5515 = 158b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5516 = 158c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5517 = 158d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5518 = 158e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5519 = 158f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5520 = 1590 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5521 = 1591 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5522 = 1592 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5523 = 1593 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5524 = 1594 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5525 = 1595 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5526 = 1596 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5527 = 1597 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5528 = 1598 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5529 = 1599 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5530 = 159a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5531 = 159b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5532 = 159c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5533 = 159d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5534 = 159e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5535 = 159f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5536 = 15a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5537 = 15a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5538 = 15a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5539 = 15a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5540 = 15a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5541 = 15a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5542 = 15a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5543 = 15a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5544 = 15a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5545 = 15a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5546 = 15aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5547 = 15ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5548 = 15ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5549 = 15ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5550 = 15ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5551 = 15af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5552 = 15b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5553 = 15b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5554 = 15b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5555 = 15b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5556 = 15b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5557 = 15b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5558 = 15b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5559 = 15b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5560 = 15b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5561 = 15b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5562 = 15ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5563 = 15bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5564 = 15bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5565 = 15bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5566 = 15be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5567 = 15bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5568 = 15c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5569 = 15c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5570 = 15c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5571 = 15c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5572 = 15c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5573 = 15c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5574 = 15c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5575 = 15c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5576 = 15c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5577 = 15c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5578 = 15ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5579 = 15cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5580 = 15cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5581 = 15cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5582 = 15ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5583 = 15cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5584 = 15d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5585 = 15d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5586 = 15d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5587 = 15d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5588 = 15d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5589 = 15d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5590 = 15d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5591 = 15d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5592 = 15d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5593 = 15d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5594 = 15da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5595 = 15db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5596 = 15dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5597 = 15dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5598 = 15de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5599 = 15df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5600 = 15e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5601 = 15e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5602 = 15e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5603 = 15e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5604 = 15e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5605 = 15e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5606 = 15e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5607 = 15e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5608 = 15e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5609 = 15e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5610 = 15ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5611 = 15eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5612 = 15ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5613 = 15ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5614 = 15ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5615 = 15ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5616 = 15f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5617 = 15f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5618 = 15f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5619 = 15f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5620 = 15f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5621 = 15f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5622 = 15f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5623 = 15f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5624 = 15f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5625 = 15f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5626 = 15fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5627 = 15fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5628 = 15fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5629 = 15fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5630 = 15fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5631 = 15ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5632 = 1600 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5633 = 1601 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5634 = 1602 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5635 = 1603 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5636 = 1604 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5637 = 1605 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5638 = 1606 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5639 = 1607 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5640 = 1608 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5641 = 1609 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5642 = 160a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5643 = 160b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5644 = 160c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5645 = 160d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5646 = 160e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5647 = 160f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5648 = 1610 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5649 = 1611 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5650 = 1612 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5651 = 1613 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5652 = 1614 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5653 = 1615 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5654 = 1616 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5655 = 1617 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5656 = 1618 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5657 = 1619 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5658 = 161a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5659 = 161b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5660 = 161c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5661 = 161d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5662 = 161e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5663 = 161f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5664 = 1620 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5665 = 1621 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5666 = 1622 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5667 = 1623 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5668 = 1624 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5669 = 1625 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5670 = 1626 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5671 = 1627 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5672 = 1628 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5673 = 1629 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5674 = 162a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5675 = 162b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5676 = 162c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5677 = 162d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5678 = 162e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5679 = 162f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5680 = 1630 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5681 = 1631 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5682 = 1632 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5683 = 1633 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5684 = 1634 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5685 = 1635 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5686 = 1636 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5687 = 1637 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5688 = 1638 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5689 = 1639 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5690 = 163a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5691 = 163b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5692 = 163c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5693 = 163d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5694 = 163e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5695 = 163f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5696 = 1640 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5697 = 1641 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5698 = 1642 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5699 = 1643 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5700 = 1644 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5701 = 1645 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5702 = 1646 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5703 = 1647 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5704 = 1648 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5705 = 1649 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5706 = 164a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5707 = 164b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5708 = 164c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5709 = 164d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5710 = 164e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5711 = 164f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5712 = 1650 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5713 = 1651 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5714 = 1652 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5715 = 1653 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5716 = 1654 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5717 = 1655 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5718 = 1656 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5719 = 1657 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5720 = 1658 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5721 = 1659 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5722 = 165a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5723 = 165b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5724 = 165c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5725 = 165d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5726 = 165e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5727 = 165f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5728 = 1660 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5729 = 1661 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5730 = 1662 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5731 = 1663 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5732 = 1664 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5733 = 1665 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5734 = 1666 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5735 = 1667 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5736 = 1668 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5737 = 1669 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5738 = 166a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5739 = 166b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5740 = 166c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5741 = 166d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5742 = 166e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5743 = 166f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5744 = 1670 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5745 = 1671 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5746 = 1672 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5747 = 1673 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5748 = 1674 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5749 = 1675 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5750 = 1676 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5751 = 1677 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5752 = 1678 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5753 = 1679 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5754 = 167a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5755 = 167b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5756 = 167c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5757 = 167d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5758 = 167e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5759 = 167f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5760 = 1680 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5761 = 1681 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5762 = 1682 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5763 = 1683 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5764 = 1684 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5765 = 1685 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5766 = 1686 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5767 = 1687 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5768 = 1688 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5769 = 1689 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5770 = 168a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5771 = 168b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5772 = 168c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5773 = 168d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5774 = 168e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5775 = 168f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5776 = 1690 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5777 = 1691 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5778 = 1692 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5779 = 1693 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5780 = 1694 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5781 = 1695 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5782 = 1696 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5783 = 1697 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5784 = 1698 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5785 = 1699 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5786 = 169a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5787 = 169b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5788 = 169c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5789 = 169d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5790 = 169e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5791 = 169f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5792 = 16a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5793 = 16a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5794 = 16a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5795 = 16a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5796 = 16a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5797 = 16a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5798 = 16a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5799 = 16a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5800 = 16a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5801 = 16a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5802 = 16aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5803 = 16ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5804 = 16ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5805 = 16ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5806 = 16ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5807 = 16af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5808 = 16b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5809 = 16b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5810 = 16b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5811 = 16b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5812 = 16b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5813 = 16b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5814 = 16b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5815 = 16b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5816 = 16b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5817 = 16b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5818 = 16ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5819 = 16bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5820 = 16bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5821 = 16bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5822 = 16be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5823 = 16bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5824 = 16c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5825 = 16c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5826 = 16c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5827 = 16c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5828 = 16c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5829 = 16c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5830 = 16c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5831 = 16c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5832 = 16c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5833 = 16c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5834 = 16ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5835 = 16cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5836 = 16cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5837 = 16cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5838 = 16ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5839 = 16cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5840 = 16d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5841 = 16d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5842 = 16d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5843 = 16d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5844 = 16d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5845 = 16d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5846 = 16d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5847 = 16d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5848 = 16d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5849 = 16d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5850 = 16da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5851 = 16db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5852 = 16dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5853 = 16dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5854 = 16de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5855 = 16df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5856 = 16e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5857 = 16e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5858 = 16e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5859 = 16e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5860 = 16e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5861 = 16e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5862 = 16e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5863 = 16e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5864 = 16e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5865 = 16e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5866 = 16ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5867 = 16eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5868 = 16ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5869 = 16ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5870 = 16ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5871 = 16ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5872 = 16f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5873 = 16f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5874 = 16f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5875 = 16f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5876 = 16f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5877 = 16f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5878 = 16f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5879 = 16f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5880 = 16f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5881 = 16f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5882 = 16fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5883 = 16fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5884 = 16fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5885 = 16fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5886 = 16fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5887 = 16ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5888 = 1700 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5889 = 1701 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5890 = 1702 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5891 = 1703 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5892 = 1704 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5893 = 1705 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5894 = 1706 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5895 = 1707 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5896 = 1708 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5897 = 1709 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5898 = 170a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5899 = 170b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5900 = 170c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5901 = 170d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5902 = 170e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5903 = 170f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5904 = 1710 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5905 = 1711 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5906 = 1712 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5907 = 1713 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5908 = 1714 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5909 = 1715 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5910 = 1716 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5911 = 1717 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5912 = 1718 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5913 = 1719 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5914 = 171a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5915 = 171b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5916 = 171c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5917 = 171d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5918 = 171e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5919 = 171f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5920 = 1720 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5921 = 1721 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5922 = 1722 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5923 = 1723 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5924 = 1724 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5925 = 1725 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5926 = 1726 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5927 = 1727 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5928 = 1728 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5929 = 1729 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5930 = 172a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5931 = 172b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5932 = 172c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5933 = 172d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5934 = 172e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5935 = 172f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5936 = 1730 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5937 = 1731 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5938 = 1732 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5939 = 1733 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5940 = 1734 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5941 = 1735 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5942 = 1736 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5943 = 1737 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5944 = 1738 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5945 = 1739 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5946 = 173a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5947 = 173b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5948 = 173c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5949 = 173d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5950 = 173e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5951 = 173f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5952 = 1740 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5953 = 1741 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5954 = 1742 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5955 = 1743 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5956 = 1744 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5957 = 1745 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5958 = 1746 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5959 = 1747 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5960 = 1748 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5961 = 1749 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5962 = 174a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5963 = 174b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5964 = 174c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5965 = 174d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5966 = 174e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5967 = 174f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5968 = 1750 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5969 = 1751 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5970 = 1752 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5971 = 1753 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5972 = 1754 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5973 = 1755 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5974 = 1756 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5975 = 1757 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5976 = 1758 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5977 = 1759 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5978 = 175a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5979 = 175b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5980 = 175c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5981 = 175d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5982 = 175e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5983 = 175f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5984 = 1760 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5985 = 1761 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5986 = 1762 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5987 = 1763 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5988 = 1764 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5989 = 1765 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5990 = 1766 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5991 = 1767 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5992 = 1768 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5993 = 1769 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5994 = 176a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5995 = 176b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5996 = 176c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5997 = 176d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5998 = 176e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 5999 = 176f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6000 = 1770 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6001 = 1771 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6002 = 1772 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6003 = 1773 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6004 = 1774 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6005 = 1775 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6006 = 1776 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6007 = 1777 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6008 = 1778 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6009 = 1779 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6010 = 177a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6011 = 177b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6012 = 177c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6013 = 177d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6014 = 177e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6015 = 177f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6016 = 1780 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6017 = 1781 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6018 = 1782 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6019 = 1783 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6020 = 1784 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6021 = 1785 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6022 = 1786 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6023 = 1787 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6024 = 1788 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6025 = 1789 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6026 = 178a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6027 = 178b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6028 = 178c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6029 = 178d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6030 = 178e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6031 = 178f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6032 = 1790 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6033 = 1791 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6034 = 1792 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6035 = 1793 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6036 = 1794 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6037 = 1795 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6038 = 1796 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6039 = 1797 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6040 = 1798 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6041 = 1799 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6042 = 179a */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6043 = 179b */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6044 = 179c */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6045 = 179d */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6046 = 179e */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6047 = 179f */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6048 = 17a0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6049 = 17a1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6050 = 17a2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6051 = 17a3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6052 = 17a4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6053 = 17a5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6054 = 17a6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6055 = 17a7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6056 = 17a8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6057 = 17a9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6058 = 17aa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6059 = 17ab */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6060 = 17ac */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6061 = 17ad */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6062 = 17ae */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6063 = 17af */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6064 = 17b0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6065 = 17b1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6066 = 17b2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6067 = 17b3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6068 = 17b4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6069 = 17b5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6070 = 17b6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6071 = 17b7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6072 = 17b8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6073 = 17b9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6074 = 17ba */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6075 = 17bb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6076 = 17bc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6077 = 17bd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6078 = 17be */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6079 = 17bf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6080 = 17c0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6081 = 17c1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6082 = 17c2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6083 = 17c3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6084 = 17c4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6085 = 17c5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6086 = 17c6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6087 = 17c7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6088 = 17c8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6089 = 17c9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6090 = 17ca */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6091 = 17cb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6092 = 17cc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6093 = 17cd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6094 = 17ce */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6095 = 17cf */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6096 = 17d0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6097 = 17d1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6098 = 17d2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6099 = 17d3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6100 = 17d4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6101 = 17d5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6102 = 17d6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6103 = 17d7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6104 = 17d8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6105 = 17d9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6106 = 17da */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6107 = 17db */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6108 = 17dc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6109 = 17dd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6110 = 17de */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6111 = 17df */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6112 = 17e0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6113 = 17e1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6114 = 17e2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6115 = 17e3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6116 = 17e4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6117 = 17e5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6118 = 17e6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6119 = 17e7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6120 = 17e8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6121 = 17e9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6122 = 17ea */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6123 = 17eb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6124 = 17ec */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6125 = 17ed */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6126 = 17ee */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6127 = 17ef */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6128 = 17f0 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6129 = 17f1 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6130 = 17f2 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6131 = 17f3 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6132 = 17f4 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6133 = 17f5 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6134 = 17f6 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6135 = 17f7 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6136 = 17f8 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6137 = 17f9 */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6138 = 17fa */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6139 = 17fb */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6140 = 17fc */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6141 = 17fd */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6142 = 17fe */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6143 = 17ff */ {3, 0, 2}, /* 0x0002 => 0x1000+(2048)*/ - /* 6144 = 1800 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6145 = 1801 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6146 = 1802 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6147 = 1803 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6148 = 1804 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6149 = 1805 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6150 = 1806 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6151 = 1807 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6152 = 1808 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6153 = 1809 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6154 = 180a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6155 = 180b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6156 = 180c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6157 = 180d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6158 = 180e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6159 = 180f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6160 = 1810 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6161 = 1811 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6162 = 1812 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6163 = 1813 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6164 = 1814 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6165 = 1815 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6166 = 1816 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6167 = 1817 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6168 = 1818 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6169 = 1819 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6170 = 181a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6171 = 181b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6172 = 181c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6173 = 181d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6174 = 181e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6175 = 181f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6176 = 1820 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6177 = 1821 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6178 = 1822 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6179 = 1823 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6180 = 1824 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6181 = 1825 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6182 = 1826 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6183 = 1827 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6184 = 1828 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6185 = 1829 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6186 = 182a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6187 = 182b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6188 = 182c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6189 = 182d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6190 = 182e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6191 = 182f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6192 = 1830 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6193 = 1831 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6194 = 1832 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6195 = 1833 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6196 = 1834 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6197 = 1835 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6198 = 1836 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6199 = 1837 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6200 = 1838 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6201 = 1839 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6202 = 183a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6203 = 183b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6204 = 183c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6205 = 183d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6206 = 183e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6207 = 183f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6208 = 1840 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6209 = 1841 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6210 = 1842 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6211 = 1843 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6212 = 1844 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6213 = 1845 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6214 = 1846 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6215 = 1847 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6216 = 1848 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6217 = 1849 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6218 = 184a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6219 = 184b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6220 = 184c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6221 = 184d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6222 = 184e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6223 = 184f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6224 = 1850 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6225 = 1851 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6226 = 1852 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6227 = 1853 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6228 = 1854 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6229 = 1855 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6230 = 1856 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6231 = 1857 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6232 = 1858 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6233 = 1859 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6234 = 185a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6235 = 185b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6236 = 185c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6237 = 185d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6238 = 185e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6239 = 185f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6240 = 1860 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6241 = 1861 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6242 = 1862 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6243 = 1863 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6244 = 1864 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6245 = 1865 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6246 = 1866 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6247 = 1867 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6248 = 1868 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6249 = 1869 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6250 = 186a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6251 = 186b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6252 = 186c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6253 = 186d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6254 = 186e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6255 = 186f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6256 = 1870 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6257 = 1871 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6258 = 1872 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6259 = 1873 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6260 = 1874 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6261 = 1875 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6262 = 1876 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6263 = 1877 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6264 = 1878 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6265 = 1879 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6266 = 187a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6267 = 187b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6268 = 187c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6269 = 187d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6270 = 187e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6271 = 187f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6272 = 1880 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6273 = 1881 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6274 = 1882 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6275 = 1883 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6276 = 1884 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6277 = 1885 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6278 = 1886 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6279 = 1887 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6280 = 1888 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6281 = 1889 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6282 = 188a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6283 = 188b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6284 = 188c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6285 = 188d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6286 = 188e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6287 = 188f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6288 = 1890 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6289 = 1891 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6290 = 1892 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6291 = 1893 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6292 = 1894 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6293 = 1895 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6294 = 1896 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6295 = 1897 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6296 = 1898 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6297 = 1899 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6298 = 189a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6299 = 189b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6300 = 189c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6301 = 189d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6302 = 189e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6303 = 189f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6304 = 18a0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6305 = 18a1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6306 = 18a2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6307 = 18a3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6308 = 18a4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6309 = 18a5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6310 = 18a6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6311 = 18a7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6312 = 18a8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6313 = 18a9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6314 = 18aa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6315 = 18ab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6316 = 18ac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6317 = 18ad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6318 = 18ae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6319 = 18af */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6320 = 18b0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6321 = 18b1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6322 = 18b2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6323 = 18b3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6324 = 18b4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6325 = 18b5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6326 = 18b6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6327 = 18b7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6328 = 18b8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6329 = 18b9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6330 = 18ba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6331 = 18bb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6332 = 18bc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6333 = 18bd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6334 = 18be */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6335 = 18bf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6336 = 18c0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6337 = 18c1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6338 = 18c2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6339 = 18c3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6340 = 18c4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6341 = 18c5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6342 = 18c6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6343 = 18c7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6344 = 18c8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6345 = 18c9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6346 = 18ca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6347 = 18cb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6348 = 18cc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6349 = 18cd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6350 = 18ce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6351 = 18cf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6352 = 18d0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6353 = 18d1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6354 = 18d2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6355 = 18d3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6356 = 18d4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6357 = 18d5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6358 = 18d6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6359 = 18d7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6360 = 18d8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6361 = 18d9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6362 = 18da */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6363 = 18db */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6364 = 18dc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6365 = 18dd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6366 = 18de */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6367 = 18df */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6368 = 18e0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6369 = 18e1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6370 = 18e2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6371 = 18e3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6372 = 18e4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6373 = 18e5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6374 = 18e6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6375 = 18e7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6376 = 18e8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6377 = 18e9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6378 = 18ea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6379 = 18eb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6380 = 18ec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6381 = 18ed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6382 = 18ee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6383 = 18ef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6384 = 18f0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6385 = 18f1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6386 = 18f2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6387 = 18f3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6388 = 18f4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6389 = 18f5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6390 = 18f6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6391 = 18f7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6392 = 18f8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6393 = 18f9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6394 = 18fa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6395 = 18fb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6396 = 18fc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6397 = 18fd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6398 = 18fe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6399 = 18ff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6400 = 1900 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6401 = 1901 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6402 = 1902 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6403 = 1903 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6404 = 1904 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6405 = 1905 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6406 = 1906 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6407 = 1907 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6408 = 1908 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6409 = 1909 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6410 = 190a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6411 = 190b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6412 = 190c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6413 = 190d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6414 = 190e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6415 = 190f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6416 = 1910 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6417 = 1911 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6418 = 1912 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6419 = 1913 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6420 = 1914 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6421 = 1915 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6422 = 1916 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6423 = 1917 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6424 = 1918 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6425 = 1919 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6426 = 191a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6427 = 191b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6428 = 191c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6429 = 191d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6430 = 191e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6431 = 191f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6432 = 1920 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6433 = 1921 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6434 = 1922 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6435 = 1923 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6436 = 1924 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6437 = 1925 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6438 = 1926 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6439 = 1927 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6440 = 1928 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6441 = 1929 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6442 = 192a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6443 = 192b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6444 = 192c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6445 = 192d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6446 = 192e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6447 = 192f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6448 = 1930 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6449 = 1931 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6450 = 1932 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6451 = 1933 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6452 = 1934 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6453 = 1935 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6454 = 1936 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6455 = 1937 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6456 = 1938 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6457 = 1939 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6458 = 193a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6459 = 193b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6460 = 193c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6461 = 193d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6462 = 193e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6463 = 193f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6464 = 1940 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6465 = 1941 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6466 = 1942 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6467 = 1943 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6468 = 1944 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6469 = 1945 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6470 = 1946 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6471 = 1947 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6472 = 1948 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6473 = 1949 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6474 = 194a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6475 = 194b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6476 = 194c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6477 = 194d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6478 = 194e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6479 = 194f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6480 = 1950 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6481 = 1951 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6482 = 1952 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6483 = 1953 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6484 = 1954 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6485 = 1955 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6486 = 1956 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6487 = 1957 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6488 = 1958 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6489 = 1959 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6490 = 195a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6491 = 195b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6492 = 195c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6493 = 195d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6494 = 195e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6495 = 195f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6496 = 1960 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6497 = 1961 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6498 = 1962 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6499 = 1963 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6500 = 1964 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6501 = 1965 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6502 = 1966 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6503 = 1967 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6504 = 1968 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6505 = 1969 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6506 = 196a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6507 = 196b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6508 = 196c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6509 = 196d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6510 = 196e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6511 = 196f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6512 = 1970 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6513 = 1971 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6514 = 1972 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6515 = 1973 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6516 = 1974 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6517 = 1975 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6518 = 1976 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6519 = 1977 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6520 = 1978 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6521 = 1979 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6522 = 197a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6523 = 197b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6524 = 197c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6525 = 197d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6526 = 197e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6527 = 197f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6528 = 1980 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6529 = 1981 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6530 = 1982 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6531 = 1983 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6532 = 1984 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6533 = 1985 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6534 = 1986 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6535 = 1987 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6536 = 1988 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6537 = 1989 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6538 = 198a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6539 = 198b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6540 = 198c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6541 = 198d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6542 = 198e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6543 = 198f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6544 = 1990 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6545 = 1991 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6546 = 1992 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6547 = 1993 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6548 = 1994 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6549 = 1995 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6550 = 1996 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6551 = 1997 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6552 = 1998 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6553 = 1999 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6554 = 199a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6555 = 199b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6556 = 199c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6557 = 199d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6558 = 199e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6559 = 199f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6560 = 19a0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6561 = 19a1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6562 = 19a2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6563 = 19a3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6564 = 19a4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6565 = 19a5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6566 = 19a6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6567 = 19a7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6568 = 19a8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6569 = 19a9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6570 = 19aa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6571 = 19ab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6572 = 19ac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6573 = 19ad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6574 = 19ae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6575 = 19af */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6576 = 19b0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6577 = 19b1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6578 = 19b2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6579 = 19b3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6580 = 19b4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6581 = 19b5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6582 = 19b6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6583 = 19b7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6584 = 19b8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6585 = 19b9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6586 = 19ba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6587 = 19bb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6588 = 19bc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6589 = 19bd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6590 = 19be */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6591 = 19bf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6592 = 19c0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6593 = 19c1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6594 = 19c2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6595 = 19c3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6596 = 19c4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6597 = 19c5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6598 = 19c6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6599 = 19c7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6600 = 19c8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6601 = 19c9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6602 = 19ca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6603 = 19cb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6604 = 19cc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6605 = 19cd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6606 = 19ce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6607 = 19cf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6608 = 19d0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6609 = 19d1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6610 = 19d2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6611 = 19d3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6612 = 19d4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6613 = 19d5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6614 = 19d6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6615 = 19d7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6616 = 19d8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6617 = 19d9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6618 = 19da */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6619 = 19db */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6620 = 19dc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6621 = 19dd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6622 = 19de */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6623 = 19df */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6624 = 19e0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6625 = 19e1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6626 = 19e2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6627 = 19e3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6628 = 19e4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6629 = 19e5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6630 = 19e6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6631 = 19e7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6632 = 19e8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6633 = 19e9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6634 = 19ea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6635 = 19eb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6636 = 19ec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6637 = 19ed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6638 = 19ee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6639 = 19ef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6640 = 19f0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6641 = 19f1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6642 = 19f2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6643 = 19f3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6644 = 19f4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6645 = 19f5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6646 = 19f6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6647 = 19f7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6648 = 19f8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6649 = 19f9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6650 = 19fa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6651 = 19fb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6652 = 19fc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6653 = 19fd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6654 = 19fe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6655 = 19ff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6656 = 1a00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6657 = 1a01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6658 = 1a02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6659 = 1a03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6660 = 1a04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6661 = 1a05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6662 = 1a06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6663 = 1a07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6664 = 1a08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6665 = 1a09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6666 = 1a0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6667 = 1a0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6668 = 1a0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6669 = 1a0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6670 = 1a0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6671 = 1a0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6672 = 1a10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6673 = 1a11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6674 = 1a12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6675 = 1a13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6676 = 1a14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6677 = 1a15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6678 = 1a16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6679 = 1a17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6680 = 1a18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6681 = 1a19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6682 = 1a1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6683 = 1a1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6684 = 1a1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6685 = 1a1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6686 = 1a1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6687 = 1a1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6688 = 1a20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6689 = 1a21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6690 = 1a22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6691 = 1a23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6692 = 1a24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6693 = 1a25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6694 = 1a26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6695 = 1a27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6696 = 1a28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6697 = 1a29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6698 = 1a2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6699 = 1a2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6700 = 1a2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6701 = 1a2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6702 = 1a2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6703 = 1a2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6704 = 1a30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6705 = 1a31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6706 = 1a32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6707 = 1a33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6708 = 1a34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6709 = 1a35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6710 = 1a36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6711 = 1a37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6712 = 1a38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6713 = 1a39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6714 = 1a3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6715 = 1a3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6716 = 1a3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6717 = 1a3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6718 = 1a3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6719 = 1a3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6720 = 1a40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6721 = 1a41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6722 = 1a42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6723 = 1a43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6724 = 1a44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6725 = 1a45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6726 = 1a46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6727 = 1a47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6728 = 1a48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6729 = 1a49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6730 = 1a4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6731 = 1a4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6732 = 1a4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6733 = 1a4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6734 = 1a4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6735 = 1a4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6736 = 1a50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6737 = 1a51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6738 = 1a52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6739 = 1a53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6740 = 1a54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6741 = 1a55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6742 = 1a56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6743 = 1a57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6744 = 1a58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6745 = 1a59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6746 = 1a5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6747 = 1a5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6748 = 1a5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6749 = 1a5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6750 = 1a5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6751 = 1a5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6752 = 1a60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6753 = 1a61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6754 = 1a62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6755 = 1a63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6756 = 1a64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6757 = 1a65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6758 = 1a66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6759 = 1a67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6760 = 1a68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6761 = 1a69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6762 = 1a6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6763 = 1a6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6764 = 1a6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6765 = 1a6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6766 = 1a6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6767 = 1a6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6768 = 1a70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6769 = 1a71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6770 = 1a72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6771 = 1a73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6772 = 1a74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6773 = 1a75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6774 = 1a76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6775 = 1a77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6776 = 1a78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6777 = 1a79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6778 = 1a7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6779 = 1a7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6780 = 1a7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6781 = 1a7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6782 = 1a7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6783 = 1a7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6784 = 1a80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6785 = 1a81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6786 = 1a82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6787 = 1a83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6788 = 1a84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6789 = 1a85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6790 = 1a86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6791 = 1a87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6792 = 1a88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6793 = 1a89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6794 = 1a8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6795 = 1a8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6796 = 1a8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6797 = 1a8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6798 = 1a8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6799 = 1a8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6800 = 1a90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6801 = 1a91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6802 = 1a92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6803 = 1a93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6804 = 1a94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6805 = 1a95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6806 = 1a96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6807 = 1a97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6808 = 1a98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6809 = 1a99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6810 = 1a9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6811 = 1a9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6812 = 1a9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6813 = 1a9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6814 = 1a9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6815 = 1a9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6816 = 1aa0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6817 = 1aa1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6818 = 1aa2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6819 = 1aa3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6820 = 1aa4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6821 = 1aa5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6822 = 1aa6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6823 = 1aa7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6824 = 1aa8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6825 = 1aa9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6826 = 1aaa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6827 = 1aab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6828 = 1aac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6829 = 1aad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6830 = 1aae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6831 = 1aaf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6832 = 1ab0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6833 = 1ab1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6834 = 1ab2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6835 = 1ab3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6836 = 1ab4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6837 = 1ab5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6838 = 1ab6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6839 = 1ab7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6840 = 1ab8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6841 = 1ab9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6842 = 1aba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6843 = 1abb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6844 = 1abc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6845 = 1abd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6846 = 1abe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6847 = 1abf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6848 = 1ac0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6849 = 1ac1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6850 = 1ac2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6851 = 1ac3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6852 = 1ac4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6853 = 1ac5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6854 = 1ac6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6855 = 1ac7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6856 = 1ac8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6857 = 1ac9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6858 = 1aca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6859 = 1acb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6860 = 1acc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6861 = 1acd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6862 = 1ace */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6863 = 1acf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6864 = 1ad0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6865 = 1ad1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6866 = 1ad2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6867 = 1ad3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6868 = 1ad4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6869 = 1ad5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6870 = 1ad6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6871 = 1ad7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6872 = 1ad8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6873 = 1ad9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6874 = 1ada */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6875 = 1adb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6876 = 1adc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6877 = 1add */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6878 = 1ade */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6879 = 1adf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6880 = 1ae0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6881 = 1ae1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6882 = 1ae2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6883 = 1ae3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6884 = 1ae4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6885 = 1ae5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6886 = 1ae6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6887 = 1ae7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6888 = 1ae8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6889 = 1ae9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6890 = 1aea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6891 = 1aeb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6892 = 1aec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6893 = 1aed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6894 = 1aee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6895 = 1aef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6896 = 1af0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6897 = 1af1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6898 = 1af2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6899 = 1af3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6900 = 1af4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6901 = 1af5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6902 = 1af6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6903 = 1af7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6904 = 1af8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6905 = 1af9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6906 = 1afa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6907 = 1afb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6908 = 1afc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6909 = 1afd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6910 = 1afe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6911 = 1aff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6912 = 1b00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6913 = 1b01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6914 = 1b02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6915 = 1b03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6916 = 1b04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6917 = 1b05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6918 = 1b06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6919 = 1b07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6920 = 1b08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6921 = 1b09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6922 = 1b0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6923 = 1b0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6924 = 1b0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6925 = 1b0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6926 = 1b0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6927 = 1b0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6928 = 1b10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6929 = 1b11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6930 = 1b12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6931 = 1b13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6932 = 1b14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6933 = 1b15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6934 = 1b16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6935 = 1b17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6936 = 1b18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6937 = 1b19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6938 = 1b1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6939 = 1b1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6940 = 1b1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6941 = 1b1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6942 = 1b1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6943 = 1b1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6944 = 1b20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6945 = 1b21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6946 = 1b22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6947 = 1b23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6948 = 1b24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6949 = 1b25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6950 = 1b26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6951 = 1b27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6952 = 1b28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6953 = 1b29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6954 = 1b2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6955 = 1b2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6956 = 1b2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6957 = 1b2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6958 = 1b2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6959 = 1b2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6960 = 1b30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6961 = 1b31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6962 = 1b32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6963 = 1b33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6964 = 1b34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6965 = 1b35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6966 = 1b36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6967 = 1b37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6968 = 1b38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6969 = 1b39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6970 = 1b3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6971 = 1b3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6972 = 1b3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6973 = 1b3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6974 = 1b3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6975 = 1b3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6976 = 1b40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6977 = 1b41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6978 = 1b42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6979 = 1b43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6980 = 1b44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6981 = 1b45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6982 = 1b46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6983 = 1b47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6984 = 1b48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6985 = 1b49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6986 = 1b4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6987 = 1b4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6988 = 1b4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6989 = 1b4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6990 = 1b4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6991 = 1b4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6992 = 1b50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6993 = 1b51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6994 = 1b52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6995 = 1b53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6996 = 1b54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6997 = 1b55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6998 = 1b56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 6999 = 1b57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7000 = 1b58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7001 = 1b59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7002 = 1b5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7003 = 1b5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7004 = 1b5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7005 = 1b5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7006 = 1b5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7007 = 1b5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7008 = 1b60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7009 = 1b61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7010 = 1b62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7011 = 1b63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7012 = 1b64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7013 = 1b65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7014 = 1b66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7015 = 1b67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7016 = 1b68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7017 = 1b69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7018 = 1b6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7019 = 1b6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7020 = 1b6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7021 = 1b6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7022 = 1b6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7023 = 1b6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7024 = 1b70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7025 = 1b71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7026 = 1b72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7027 = 1b73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7028 = 1b74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7029 = 1b75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7030 = 1b76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7031 = 1b77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7032 = 1b78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7033 = 1b79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7034 = 1b7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7035 = 1b7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7036 = 1b7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7037 = 1b7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7038 = 1b7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7039 = 1b7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7040 = 1b80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7041 = 1b81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7042 = 1b82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7043 = 1b83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7044 = 1b84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7045 = 1b85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7046 = 1b86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7047 = 1b87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7048 = 1b88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7049 = 1b89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7050 = 1b8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7051 = 1b8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7052 = 1b8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7053 = 1b8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7054 = 1b8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7055 = 1b8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7056 = 1b90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7057 = 1b91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7058 = 1b92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7059 = 1b93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7060 = 1b94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7061 = 1b95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7062 = 1b96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7063 = 1b97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7064 = 1b98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7065 = 1b99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7066 = 1b9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7067 = 1b9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7068 = 1b9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7069 = 1b9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7070 = 1b9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7071 = 1b9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7072 = 1ba0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7073 = 1ba1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7074 = 1ba2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7075 = 1ba3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7076 = 1ba4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7077 = 1ba5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7078 = 1ba6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7079 = 1ba7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7080 = 1ba8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7081 = 1ba9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7082 = 1baa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7083 = 1bab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7084 = 1bac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7085 = 1bad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7086 = 1bae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7087 = 1baf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7088 = 1bb0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7089 = 1bb1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7090 = 1bb2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7091 = 1bb3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7092 = 1bb4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7093 = 1bb5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7094 = 1bb6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7095 = 1bb7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7096 = 1bb8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7097 = 1bb9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7098 = 1bba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7099 = 1bbb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7100 = 1bbc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7101 = 1bbd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7102 = 1bbe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7103 = 1bbf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7104 = 1bc0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7105 = 1bc1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7106 = 1bc2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7107 = 1bc3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7108 = 1bc4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7109 = 1bc5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7110 = 1bc6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7111 = 1bc7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7112 = 1bc8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7113 = 1bc9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7114 = 1bca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7115 = 1bcb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7116 = 1bcc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7117 = 1bcd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7118 = 1bce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7119 = 1bcf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7120 = 1bd0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7121 = 1bd1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7122 = 1bd2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7123 = 1bd3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7124 = 1bd4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7125 = 1bd5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7126 = 1bd6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7127 = 1bd7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7128 = 1bd8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7129 = 1bd9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7130 = 1bda */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7131 = 1bdb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7132 = 1bdc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7133 = 1bdd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7134 = 1bde */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7135 = 1bdf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7136 = 1be0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7137 = 1be1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7138 = 1be2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7139 = 1be3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7140 = 1be4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7141 = 1be5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7142 = 1be6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7143 = 1be7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7144 = 1be8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7145 = 1be9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7146 = 1bea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7147 = 1beb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7148 = 1bec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7149 = 1bed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7150 = 1bee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7151 = 1bef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7152 = 1bf0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7153 = 1bf1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7154 = 1bf2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7155 = 1bf3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7156 = 1bf4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7157 = 1bf5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7158 = 1bf6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7159 = 1bf7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7160 = 1bf8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7161 = 1bf9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7162 = 1bfa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7163 = 1bfb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7164 = 1bfc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7165 = 1bfd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7166 = 1bfe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7167 = 1bff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7168 = 1c00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7169 = 1c01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7170 = 1c02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7171 = 1c03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7172 = 1c04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7173 = 1c05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7174 = 1c06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7175 = 1c07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7176 = 1c08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7177 = 1c09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7178 = 1c0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7179 = 1c0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7180 = 1c0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7181 = 1c0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7182 = 1c0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7183 = 1c0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7184 = 1c10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7185 = 1c11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7186 = 1c12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7187 = 1c13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7188 = 1c14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7189 = 1c15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7190 = 1c16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7191 = 1c17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7192 = 1c18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7193 = 1c19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7194 = 1c1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7195 = 1c1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7196 = 1c1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7197 = 1c1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7198 = 1c1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7199 = 1c1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7200 = 1c20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7201 = 1c21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7202 = 1c22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7203 = 1c23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7204 = 1c24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7205 = 1c25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7206 = 1c26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7207 = 1c27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7208 = 1c28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7209 = 1c29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7210 = 1c2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7211 = 1c2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7212 = 1c2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7213 = 1c2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7214 = 1c2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7215 = 1c2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7216 = 1c30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7217 = 1c31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7218 = 1c32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7219 = 1c33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7220 = 1c34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7221 = 1c35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7222 = 1c36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7223 = 1c37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7224 = 1c38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7225 = 1c39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7226 = 1c3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7227 = 1c3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7228 = 1c3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7229 = 1c3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7230 = 1c3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7231 = 1c3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7232 = 1c40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7233 = 1c41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7234 = 1c42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7235 = 1c43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7236 = 1c44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7237 = 1c45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7238 = 1c46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7239 = 1c47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7240 = 1c48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7241 = 1c49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7242 = 1c4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7243 = 1c4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7244 = 1c4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7245 = 1c4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7246 = 1c4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7247 = 1c4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7248 = 1c50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7249 = 1c51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7250 = 1c52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7251 = 1c53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7252 = 1c54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7253 = 1c55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7254 = 1c56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7255 = 1c57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7256 = 1c58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7257 = 1c59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7258 = 1c5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7259 = 1c5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7260 = 1c5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7261 = 1c5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7262 = 1c5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7263 = 1c5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7264 = 1c60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7265 = 1c61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7266 = 1c62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7267 = 1c63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7268 = 1c64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7269 = 1c65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7270 = 1c66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7271 = 1c67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7272 = 1c68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7273 = 1c69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7274 = 1c6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7275 = 1c6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7276 = 1c6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7277 = 1c6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7278 = 1c6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7279 = 1c6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7280 = 1c70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7281 = 1c71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7282 = 1c72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7283 = 1c73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7284 = 1c74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7285 = 1c75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7286 = 1c76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7287 = 1c77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7288 = 1c78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7289 = 1c79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7290 = 1c7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7291 = 1c7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7292 = 1c7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7293 = 1c7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7294 = 1c7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7295 = 1c7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7296 = 1c80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7297 = 1c81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7298 = 1c82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7299 = 1c83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7300 = 1c84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7301 = 1c85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7302 = 1c86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7303 = 1c87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7304 = 1c88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7305 = 1c89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7306 = 1c8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7307 = 1c8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7308 = 1c8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7309 = 1c8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7310 = 1c8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7311 = 1c8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7312 = 1c90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7313 = 1c91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7314 = 1c92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7315 = 1c93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7316 = 1c94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7317 = 1c95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7318 = 1c96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7319 = 1c97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7320 = 1c98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7321 = 1c99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7322 = 1c9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7323 = 1c9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7324 = 1c9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7325 = 1c9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7326 = 1c9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7327 = 1c9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7328 = 1ca0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7329 = 1ca1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7330 = 1ca2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7331 = 1ca3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7332 = 1ca4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7333 = 1ca5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7334 = 1ca6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7335 = 1ca7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7336 = 1ca8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7337 = 1ca9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7338 = 1caa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7339 = 1cab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7340 = 1cac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7341 = 1cad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7342 = 1cae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7343 = 1caf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7344 = 1cb0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7345 = 1cb1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7346 = 1cb2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7347 = 1cb3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7348 = 1cb4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7349 = 1cb5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7350 = 1cb6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7351 = 1cb7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7352 = 1cb8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7353 = 1cb9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7354 = 1cba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7355 = 1cbb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7356 = 1cbc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7357 = 1cbd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7358 = 1cbe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7359 = 1cbf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7360 = 1cc0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7361 = 1cc1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7362 = 1cc2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7363 = 1cc3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7364 = 1cc4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7365 = 1cc5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7366 = 1cc6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7367 = 1cc7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7368 = 1cc8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7369 = 1cc9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7370 = 1cca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7371 = 1ccb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7372 = 1ccc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7373 = 1ccd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7374 = 1cce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7375 = 1ccf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7376 = 1cd0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7377 = 1cd1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7378 = 1cd2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7379 = 1cd3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7380 = 1cd4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7381 = 1cd5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7382 = 1cd6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7383 = 1cd7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7384 = 1cd8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7385 = 1cd9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7386 = 1cda */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7387 = 1cdb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7388 = 1cdc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7389 = 1cdd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7390 = 1cde */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7391 = 1cdf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7392 = 1ce0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7393 = 1ce1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7394 = 1ce2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7395 = 1ce3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7396 = 1ce4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7397 = 1ce5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7398 = 1ce6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7399 = 1ce7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7400 = 1ce8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7401 = 1ce9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7402 = 1cea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7403 = 1ceb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7404 = 1cec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7405 = 1ced */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7406 = 1cee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7407 = 1cef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7408 = 1cf0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7409 = 1cf1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7410 = 1cf2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7411 = 1cf3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7412 = 1cf4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7413 = 1cf5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7414 = 1cf6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7415 = 1cf7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7416 = 1cf8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7417 = 1cf9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7418 = 1cfa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7419 = 1cfb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7420 = 1cfc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7421 = 1cfd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7422 = 1cfe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7423 = 1cff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7424 = 1d00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7425 = 1d01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7426 = 1d02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7427 = 1d03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7428 = 1d04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7429 = 1d05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7430 = 1d06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7431 = 1d07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7432 = 1d08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7433 = 1d09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7434 = 1d0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7435 = 1d0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7436 = 1d0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7437 = 1d0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7438 = 1d0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7439 = 1d0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7440 = 1d10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7441 = 1d11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7442 = 1d12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7443 = 1d13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7444 = 1d14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7445 = 1d15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7446 = 1d16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7447 = 1d17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7448 = 1d18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7449 = 1d19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7450 = 1d1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7451 = 1d1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7452 = 1d1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7453 = 1d1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7454 = 1d1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7455 = 1d1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7456 = 1d20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7457 = 1d21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7458 = 1d22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7459 = 1d23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7460 = 1d24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7461 = 1d25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7462 = 1d26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7463 = 1d27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7464 = 1d28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7465 = 1d29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7466 = 1d2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7467 = 1d2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7468 = 1d2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7469 = 1d2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7470 = 1d2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7471 = 1d2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7472 = 1d30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7473 = 1d31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7474 = 1d32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7475 = 1d33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7476 = 1d34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7477 = 1d35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7478 = 1d36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7479 = 1d37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7480 = 1d38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7481 = 1d39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7482 = 1d3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7483 = 1d3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7484 = 1d3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7485 = 1d3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7486 = 1d3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7487 = 1d3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7488 = 1d40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7489 = 1d41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7490 = 1d42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7491 = 1d43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7492 = 1d44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7493 = 1d45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7494 = 1d46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7495 = 1d47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7496 = 1d48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7497 = 1d49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7498 = 1d4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7499 = 1d4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7500 = 1d4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7501 = 1d4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7502 = 1d4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7503 = 1d4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7504 = 1d50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7505 = 1d51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7506 = 1d52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7507 = 1d53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7508 = 1d54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7509 = 1d55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7510 = 1d56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7511 = 1d57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7512 = 1d58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7513 = 1d59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7514 = 1d5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7515 = 1d5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7516 = 1d5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7517 = 1d5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7518 = 1d5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7519 = 1d5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7520 = 1d60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7521 = 1d61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7522 = 1d62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7523 = 1d63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7524 = 1d64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7525 = 1d65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7526 = 1d66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7527 = 1d67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7528 = 1d68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7529 = 1d69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7530 = 1d6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7531 = 1d6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7532 = 1d6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7533 = 1d6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7534 = 1d6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7535 = 1d6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7536 = 1d70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7537 = 1d71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7538 = 1d72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7539 = 1d73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7540 = 1d74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7541 = 1d75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7542 = 1d76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7543 = 1d77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7544 = 1d78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7545 = 1d79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7546 = 1d7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7547 = 1d7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7548 = 1d7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7549 = 1d7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7550 = 1d7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7551 = 1d7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7552 = 1d80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7553 = 1d81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7554 = 1d82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7555 = 1d83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7556 = 1d84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7557 = 1d85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7558 = 1d86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7559 = 1d87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7560 = 1d88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7561 = 1d89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7562 = 1d8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7563 = 1d8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7564 = 1d8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7565 = 1d8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7566 = 1d8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7567 = 1d8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7568 = 1d90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7569 = 1d91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7570 = 1d92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7571 = 1d93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7572 = 1d94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7573 = 1d95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7574 = 1d96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7575 = 1d97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7576 = 1d98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7577 = 1d99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7578 = 1d9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7579 = 1d9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7580 = 1d9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7581 = 1d9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7582 = 1d9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7583 = 1d9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7584 = 1da0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7585 = 1da1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7586 = 1da2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7587 = 1da3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7588 = 1da4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7589 = 1da5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7590 = 1da6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7591 = 1da7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7592 = 1da8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7593 = 1da9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7594 = 1daa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7595 = 1dab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7596 = 1dac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7597 = 1dad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7598 = 1dae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7599 = 1daf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7600 = 1db0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7601 = 1db1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7602 = 1db2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7603 = 1db3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7604 = 1db4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7605 = 1db5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7606 = 1db6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7607 = 1db7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7608 = 1db8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7609 = 1db9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7610 = 1dba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7611 = 1dbb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7612 = 1dbc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7613 = 1dbd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7614 = 1dbe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7615 = 1dbf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7616 = 1dc0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7617 = 1dc1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7618 = 1dc2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7619 = 1dc3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7620 = 1dc4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7621 = 1dc5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7622 = 1dc6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7623 = 1dc7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7624 = 1dc8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7625 = 1dc9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7626 = 1dca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7627 = 1dcb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7628 = 1dcc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7629 = 1dcd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7630 = 1dce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7631 = 1dcf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7632 = 1dd0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7633 = 1dd1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7634 = 1dd2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7635 = 1dd3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7636 = 1dd4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7637 = 1dd5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7638 = 1dd6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7639 = 1dd7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7640 = 1dd8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7641 = 1dd9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7642 = 1dda */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7643 = 1ddb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7644 = 1ddc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7645 = 1ddd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7646 = 1dde */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7647 = 1ddf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7648 = 1de0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7649 = 1de1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7650 = 1de2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7651 = 1de3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7652 = 1de4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7653 = 1de5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7654 = 1de6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7655 = 1de7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7656 = 1de8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7657 = 1de9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7658 = 1dea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7659 = 1deb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7660 = 1dec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7661 = 1ded */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7662 = 1dee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7663 = 1def */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7664 = 1df0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7665 = 1df1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7666 = 1df2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7667 = 1df3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7668 = 1df4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7669 = 1df5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7670 = 1df6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7671 = 1df7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7672 = 1df8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7673 = 1df9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7674 = 1dfa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7675 = 1dfb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7676 = 1dfc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7677 = 1dfd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7678 = 1dfe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7679 = 1dff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7680 = 1e00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7681 = 1e01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7682 = 1e02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7683 = 1e03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7684 = 1e04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7685 = 1e05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7686 = 1e06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7687 = 1e07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7688 = 1e08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7689 = 1e09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7690 = 1e0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7691 = 1e0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7692 = 1e0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7693 = 1e0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7694 = 1e0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7695 = 1e0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7696 = 1e10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7697 = 1e11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7698 = 1e12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7699 = 1e13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7700 = 1e14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7701 = 1e15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7702 = 1e16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7703 = 1e17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7704 = 1e18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7705 = 1e19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7706 = 1e1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7707 = 1e1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7708 = 1e1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7709 = 1e1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7710 = 1e1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7711 = 1e1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7712 = 1e20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7713 = 1e21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7714 = 1e22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7715 = 1e23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7716 = 1e24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7717 = 1e25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7718 = 1e26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7719 = 1e27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7720 = 1e28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7721 = 1e29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7722 = 1e2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7723 = 1e2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7724 = 1e2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7725 = 1e2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7726 = 1e2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7727 = 1e2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7728 = 1e30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7729 = 1e31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7730 = 1e32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7731 = 1e33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7732 = 1e34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7733 = 1e35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7734 = 1e36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7735 = 1e37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7736 = 1e38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7737 = 1e39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7738 = 1e3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7739 = 1e3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7740 = 1e3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7741 = 1e3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7742 = 1e3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7743 = 1e3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7744 = 1e40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7745 = 1e41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7746 = 1e42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7747 = 1e43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7748 = 1e44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7749 = 1e45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7750 = 1e46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7751 = 1e47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7752 = 1e48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7753 = 1e49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7754 = 1e4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7755 = 1e4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7756 = 1e4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7757 = 1e4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7758 = 1e4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7759 = 1e4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7760 = 1e50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7761 = 1e51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7762 = 1e52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7763 = 1e53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7764 = 1e54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7765 = 1e55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7766 = 1e56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7767 = 1e57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7768 = 1e58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7769 = 1e59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7770 = 1e5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7771 = 1e5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7772 = 1e5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7773 = 1e5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7774 = 1e5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7775 = 1e5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7776 = 1e60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7777 = 1e61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7778 = 1e62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7779 = 1e63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7780 = 1e64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7781 = 1e65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7782 = 1e66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7783 = 1e67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7784 = 1e68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7785 = 1e69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7786 = 1e6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7787 = 1e6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7788 = 1e6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7789 = 1e6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7790 = 1e6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7791 = 1e6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7792 = 1e70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7793 = 1e71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7794 = 1e72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7795 = 1e73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7796 = 1e74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7797 = 1e75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7798 = 1e76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7799 = 1e77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7800 = 1e78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7801 = 1e79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7802 = 1e7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7803 = 1e7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7804 = 1e7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7805 = 1e7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7806 = 1e7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7807 = 1e7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7808 = 1e80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7809 = 1e81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7810 = 1e82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7811 = 1e83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7812 = 1e84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7813 = 1e85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7814 = 1e86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7815 = 1e87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7816 = 1e88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7817 = 1e89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7818 = 1e8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7819 = 1e8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7820 = 1e8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7821 = 1e8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7822 = 1e8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7823 = 1e8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7824 = 1e90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7825 = 1e91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7826 = 1e92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7827 = 1e93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7828 = 1e94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7829 = 1e95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7830 = 1e96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7831 = 1e97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7832 = 1e98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7833 = 1e99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7834 = 1e9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7835 = 1e9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7836 = 1e9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7837 = 1e9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7838 = 1e9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7839 = 1e9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7840 = 1ea0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7841 = 1ea1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7842 = 1ea2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7843 = 1ea3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7844 = 1ea4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7845 = 1ea5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7846 = 1ea6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7847 = 1ea7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7848 = 1ea8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7849 = 1ea9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7850 = 1eaa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7851 = 1eab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7852 = 1eac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7853 = 1ead */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7854 = 1eae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7855 = 1eaf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7856 = 1eb0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7857 = 1eb1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7858 = 1eb2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7859 = 1eb3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7860 = 1eb4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7861 = 1eb5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7862 = 1eb6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7863 = 1eb7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7864 = 1eb8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7865 = 1eb9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7866 = 1eba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7867 = 1ebb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7868 = 1ebc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7869 = 1ebd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7870 = 1ebe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7871 = 1ebf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7872 = 1ec0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7873 = 1ec1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7874 = 1ec2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7875 = 1ec3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7876 = 1ec4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7877 = 1ec5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7878 = 1ec6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7879 = 1ec7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7880 = 1ec8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7881 = 1ec9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7882 = 1eca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7883 = 1ecb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7884 = 1ecc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7885 = 1ecd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7886 = 1ece */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7887 = 1ecf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7888 = 1ed0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7889 = 1ed1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7890 = 1ed2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7891 = 1ed3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7892 = 1ed4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7893 = 1ed5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7894 = 1ed6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7895 = 1ed7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7896 = 1ed8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7897 = 1ed9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7898 = 1eda */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7899 = 1edb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7900 = 1edc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7901 = 1edd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7902 = 1ede */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7903 = 1edf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7904 = 1ee0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7905 = 1ee1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7906 = 1ee2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7907 = 1ee3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7908 = 1ee4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7909 = 1ee5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7910 = 1ee6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7911 = 1ee7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7912 = 1ee8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7913 = 1ee9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7914 = 1eea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7915 = 1eeb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7916 = 1eec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7917 = 1eed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7918 = 1eee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7919 = 1eef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7920 = 1ef0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7921 = 1ef1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7922 = 1ef2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7923 = 1ef3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7924 = 1ef4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7925 = 1ef5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7926 = 1ef6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7927 = 1ef7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7928 = 1ef8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7929 = 1ef9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7930 = 1efa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7931 = 1efb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7932 = 1efc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7933 = 1efd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7934 = 1efe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7935 = 1eff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7936 = 1f00 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7937 = 1f01 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7938 = 1f02 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7939 = 1f03 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7940 = 1f04 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7941 = 1f05 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7942 = 1f06 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7943 = 1f07 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7944 = 1f08 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7945 = 1f09 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7946 = 1f0a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7947 = 1f0b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7948 = 1f0c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7949 = 1f0d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7950 = 1f0e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7951 = 1f0f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7952 = 1f10 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7953 = 1f11 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7954 = 1f12 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7955 = 1f13 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7956 = 1f14 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7957 = 1f15 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7958 = 1f16 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7959 = 1f17 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7960 = 1f18 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7961 = 1f19 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7962 = 1f1a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7963 = 1f1b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7964 = 1f1c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7965 = 1f1d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7966 = 1f1e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7967 = 1f1f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7968 = 1f20 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7969 = 1f21 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7970 = 1f22 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7971 = 1f23 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7972 = 1f24 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7973 = 1f25 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7974 = 1f26 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7975 = 1f27 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7976 = 1f28 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7977 = 1f29 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7978 = 1f2a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7979 = 1f2b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7980 = 1f2c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7981 = 1f2d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7982 = 1f2e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7983 = 1f2f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7984 = 1f30 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7985 = 1f31 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7986 = 1f32 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7987 = 1f33 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7988 = 1f34 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7989 = 1f35 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7990 = 1f36 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7991 = 1f37 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7992 = 1f38 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7993 = 1f39 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7994 = 1f3a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7995 = 1f3b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7996 = 1f3c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7997 = 1f3d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7998 = 1f3e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 7999 = 1f3f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8000 = 1f40 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8001 = 1f41 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8002 = 1f42 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8003 = 1f43 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8004 = 1f44 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8005 = 1f45 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8006 = 1f46 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8007 = 1f47 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8008 = 1f48 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8009 = 1f49 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8010 = 1f4a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8011 = 1f4b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8012 = 1f4c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8013 = 1f4d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8014 = 1f4e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8015 = 1f4f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8016 = 1f50 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8017 = 1f51 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8018 = 1f52 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8019 = 1f53 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8020 = 1f54 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8021 = 1f55 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8022 = 1f56 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8023 = 1f57 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8024 = 1f58 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8025 = 1f59 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8026 = 1f5a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8027 = 1f5b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8028 = 1f5c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8029 = 1f5d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8030 = 1f5e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8031 = 1f5f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8032 = 1f60 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8033 = 1f61 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8034 = 1f62 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8035 = 1f63 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8036 = 1f64 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8037 = 1f65 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8038 = 1f66 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8039 = 1f67 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8040 = 1f68 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8041 = 1f69 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8042 = 1f6a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8043 = 1f6b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8044 = 1f6c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8045 = 1f6d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8046 = 1f6e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8047 = 1f6f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8048 = 1f70 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8049 = 1f71 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8050 = 1f72 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8051 = 1f73 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8052 = 1f74 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8053 = 1f75 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8054 = 1f76 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8055 = 1f77 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8056 = 1f78 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8057 = 1f79 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8058 = 1f7a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8059 = 1f7b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8060 = 1f7c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8061 = 1f7d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8062 = 1f7e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8063 = 1f7f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8064 = 1f80 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8065 = 1f81 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8066 = 1f82 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8067 = 1f83 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8068 = 1f84 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8069 = 1f85 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8070 = 1f86 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8071 = 1f87 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8072 = 1f88 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8073 = 1f89 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8074 = 1f8a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8075 = 1f8b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8076 = 1f8c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8077 = 1f8d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8078 = 1f8e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8079 = 1f8f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8080 = 1f90 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8081 = 1f91 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8082 = 1f92 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8083 = 1f93 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8084 = 1f94 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8085 = 1f95 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8086 = 1f96 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8087 = 1f97 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8088 = 1f98 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8089 = 1f99 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8090 = 1f9a */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8091 = 1f9b */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8092 = 1f9c */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8093 = 1f9d */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8094 = 1f9e */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8095 = 1f9f */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8096 = 1fa0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8097 = 1fa1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8098 = 1fa2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8099 = 1fa3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8100 = 1fa4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8101 = 1fa5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8102 = 1fa6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8103 = 1fa7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8104 = 1fa8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8105 = 1fa9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8106 = 1faa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8107 = 1fab */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8108 = 1fac */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8109 = 1fad */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8110 = 1fae */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8111 = 1faf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8112 = 1fb0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8113 = 1fb1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8114 = 1fb2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8115 = 1fb3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8116 = 1fb4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8117 = 1fb5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8118 = 1fb6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8119 = 1fb7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8120 = 1fb8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8121 = 1fb9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8122 = 1fba */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8123 = 1fbb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8124 = 1fbc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8125 = 1fbd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8126 = 1fbe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8127 = 1fbf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8128 = 1fc0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8129 = 1fc1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8130 = 1fc2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8131 = 1fc3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8132 = 1fc4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8133 = 1fc5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8134 = 1fc6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8135 = 1fc7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8136 = 1fc8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8137 = 1fc9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8138 = 1fca */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8139 = 1fcb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8140 = 1fcc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8141 = 1fcd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8142 = 1fce */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8143 = 1fcf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8144 = 1fd0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8145 = 1fd1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8146 = 1fd2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8147 = 1fd3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8148 = 1fd4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8149 = 1fd5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8150 = 1fd6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8151 = 1fd7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8152 = 1fd8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8153 = 1fd9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8154 = 1fda */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8155 = 1fdb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8156 = 1fdc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8157 = 1fdd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8158 = 1fde */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8159 = 1fdf */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8160 = 1fe0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8161 = 1fe1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8162 = 1fe2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8163 = 1fe3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8164 = 1fe4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8165 = 1fe5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8166 = 1fe6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8167 = 1fe7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8168 = 1fe8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8169 = 1fe9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8170 = 1fea */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8171 = 1feb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8172 = 1fec */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8173 = 1fed */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8174 = 1fee */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8175 = 1fef */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8176 = 1ff0 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8177 = 1ff1 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8178 = 1ff2 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8179 = 1ff3 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8180 = 1ff4 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8181 = 1ff5 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8182 = 1ff6 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8183 = 1ff7 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8184 = 1ff8 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8185 = 1ff9 */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8186 = 1ffa */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8187 = 1ffb */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8188 = 1ffc */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8189 = 1ffd */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8190 = 1ffe */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ - /* 8191 = 1fff */ {2, 0, 2}, /* 0x0003 => 0x1800+(2048)*/ -}; Index: xc/programs/Xserver/XIE/mixie/fax/fencode.h diff -u xc/programs/Xserver/XIE/mixie/fax/fencode.h:1.2 xc/programs/Xserver/XIE/mixie/fax/fencode.h:removed --- xc/programs/Xserver/XIE/mixie/fax/fencode.h:1.2 Fri Dec 14 14:58:25 2001 +++ xc/programs/Xserver/XIE/mixie/fax/fencode.h Sat Feb 28 21:41:59 2004 @@ -1,371 +0,0 @@ -/* $Xorg: fencode.h,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module fencode.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - fencode.h -- DDXIE header module for FAX encoders - - Ben Fahy, AGE Logic, Sept 1993 - -******************************************************************************/ - -#include "misc.h" /* for pointer */ -#include /* for CARD32 */ - -/*** entry points */ -int encode_g4(); -int encode_g32d(); -int encode_g31d(); -int encode_tiffpb(); -int encode_tiff2(); - -#define FAX_ENCODE_DONE_NOT 0 -#define FAX_ENCODE_DONE_OK 1 -#define ENCODE_ERROR_BadMagic 2 -#define ENCODE_ERROR_BadGoal 3 -#define ENCODE_ERROR_BadStager 4 -#define ENCODE_ERROR_BadRunLength 5 -#define ENCODE_ERROR_BadState 6 -#define ENCODE_ERROR_StripStateNotNew 7 -#define ENCODE_ERROR_NoB1Found 8 -#define ENCODE_ERROR_EncodeRunsFailure 9 - -#define ENCODE_FAX_GOAL_StartNewLine 1 -#define ENCODE_FAX_GOAL_OutputNextRunLength 2 -#define ENCODE_FAX_GOAL_DeduceCode 3 -#define ENCODE_FAX_GOAL_FlushStager 4 -#define ENCODE_FAX_GOAL_FinishLine 5 -#define ENCODE_FAX_GOAL_FlushEOL 6 -#define ENCODE_FAX_GOAL_EOLWritten 7 -#define ENCODE_FAX_GOAL_FindPositions 8 -#define ENCODE_FAX_GOAL_PassMode 9 -#define ENCODE_FAX_GOAL_VerticalMode 10 -#define ENCODE_FAX_GOAL_HorizontalMode 11 -#define ENCODE_FAX_GOAL_Flush2DStager 12 -#define ENCODE_FAX_GOAL_DoneWithA0A1 13 -#define ENCODE_FAX_GOAL_DoneWithA1A2 14 -#define ENCODE_FAX_GOAL_FlushHCode 15 -#define ENCODE_FAX_GOAL_FlushedHCode 16 -#define ENCODE_FAX_GOAL_G4SneaksIn 17 - -#define ENCODE_PB_GOAL_StartNewLine 1 -#define ENCODE_PB_GOAL_OutputNextRunLength 2 -#define ENCODE_PB_GOAL_FlushRunLength 3 -#define ENCODE_PB_GOAL_FlushLiterals 4 -#define ENCODE_PB_GOAL_WriteLiterals 5 -#define ENCODE_PB_GOAL_WriteCodeForRunLength 6 -#define ENCODE_PB_GOAL_WriteValueForRunLength 7 -#define ENCODE_PB_GOAL_WriteNlits 8 -#define ENCODE_PB_GOAL_WriteThisLiteral 9 -#define ENCODE_PB_GOAL_WriteTheLiteral 10 - -typedef struct _fax_encode_state { - int final; /* if final = 1, all input data is available */ - int encoder_done;/* if done = 1, all data sent has been encoded */ - - char **i_lines; /* pointers to beginning of input lines */ - int i_line; /* absolute input line position */ - int nl_tocode; /* how many lines we want encoded */ - - unsigned char *strip; /* latest available *output* strip */ - int strip_size; /* size of that strips */ - int strip_state; /* whether strip is new, being used, or done */ - int use_magic; /* 1 means we are using magic strip */ - int magic_needs; /* 1 means magic strip only have filled */ - unsigned char magicStrip[8]; - /* "pretend" strip for handling strip edges */ - BitStream bits; /* definition of bitstream, current strip */ - - pointer private;/* private data, depends on encoding scheme */ - - int goal; /* our current goal */ - int a0_pos; /* starting changing position on coding line */ - int a1_pos; /* next changing position to right of a0_pos */ - int a0a1; /* distance from a0 to a1 */ - int b1_pos; /* first change above and right of a0, ~color */ - int b2_pos; /* next change above and right of a0, ao_color */ - int a0_color; /* color of a0, either WHITE or BLACK */ - int n_old_trans; /* number of transitions, line above us */ - int *old_trans; /* list of transitions on line above us */ - int n_new_trans; /* number of transitions, current line (so far)*/ - int *new_trans; /* list of transitions on current line */ - int last_b1_idx; /* index of last saved transition we looked at */ - int length_acc; /* accumulates run-lengths for a0a1 or a1a2 */ - int width; /* width of image. So we know end of line */ - int g32d_horiz; /* only relevant for g32d encoding */ - int rl; /* needed if I get EOL in get_a0a1 or get_a1a2 */ - CARD32 stager; /* place for bits to be merged into bytes */ - int radiometric; /* if 1, then white is bright (1) */ -} FaxEncodeState; - -typedef struct _tiff2_epvt { - int *counts; /* runlengths for W/B runs */ - int nvals; /* number of entries in tables */ - int index; /* current position in tables */ - int rlcode; /* code we need to write out */ - int terminating; /* whether this is end or not */ - int codelength; /* how many bits a code takes */ - int align_eol; /* pad last byte in a line w/0 */ - -} Tiff2EncodePvt,G31DEncodePvt; - -typedef struct _packbits_epvt { - int *values; /* array of byte values */ - int *counts; /* runlengths for byte values */ - int nvals; /* number of entries in tables */ - int nlits; /* number of literals to write */ - int index; /* current position in tables */ - int start; /* start position in tables */ - int lits_to_write; /* how many to write at one time*/ - int rlcode; /* code we need to write out */ - int bytes_out; /* sum of literals flushed */ - -} PackBitsEncodePvt; - -typedef struct _g32d_epvt { - int *counts; /* runlengths for W/B runs */ - int nvals; /* number of entries in tables */ - int index; /* current position in tables */ - int save_index; /* save for recovery of index */ - int *above; /* runlengths for lines above */ - int avals; /* number of values, above */ - int aindex; /* current position in above */ - int save_aindex; /* save for recover of aindex */ - int rlcode; /* code we need to write out */ - int terminating; /* whether this is end or not */ - int codelength; /* how many bits a code takes */ - int k; /* do 1-D every K lines */ - int kcnt; /* count of what k we are on */ - int next_goal; /* what to do after rl encode */ - int a1a2; /* second distance in Hmode */ - int a2_pos; /* next position to right of a1 */ - int save_b1pos; /* makes it easier to back up */ - int save_b1color; /* makes it easier to back up */ - int b1_color; /* not a part of state */ - int align_eol; /* pad last byte in a line w/0 */ - int uncompressed; /* not that we should use it... */ - int really_g4; /* if (1), skip EOL junk */ - -} G32DEncodePvt,G42DEncodePvt; - -#if defined(_G32D) - -#define save_state_and_return(state) \ - { \ - state->private = (pointer) epvt; \ - epvt->counts = counts; \ - epvt->above = above; \ - epvt->nvals = nvals; \ - epvt->avals = avals; \ - epvt->index = index; \ - epvt->aindex = aindex; \ - epvt->rlcode = rlcode; \ - epvt->terminating = terminating; \ - epvt->codelength = codelength; \ - epvt->save_index = save_index; \ - epvt->save_aindex = save_aindex; \ - epvt->k = k; \ - epvt->kcnt = kcnt; \ - epvt->a1a2 = a1a2; \ - epvt->save_b1pos = save_b1pos; \ - epvt->save_b1color = save_b1color; \ - epvt->next_goal = next_goal; \ - epvt->b1_color = b1_color; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->bits.bitpos = bitpos; \ - state->rl = rl; \ - state->goal = goal; \ - state->stager = stager; \ - state->a0_color = a0_color; \ - state->a0a1 = a0a1; \ - state->a0_pos = a0_pos; \ - state->a1_pos = a1_pos; \ - epvt->a2_pos = a2_pos; \ - state->b1_pos = b1_pos; \ - state->length_acc = length_acc; \ - return(lines_coded); \ - } - -#define localize_state(state) \ - epvt = (G32DEncodePvt *) state->private; \ - counts = epvt->counts; \ - nvals = epvt->nvals; \ - index = epvt->index; \ - above = epvt->above; \ - avals = epvt->avals; \ - aindex = epvt->aindex; \ - rlcode = epvt->rlcode; \ - terminating = epvt->terminating; \ - codelength = epvt->codelength; \ - save_index = epvt->save_index; \ - save_aindex = epvt->save_aindex; \ - k = epvt->k; \ - kcnt = epvt->kcnt; \ - a1a2 = epvt->a1a2; \ - save_b1pos = epvt->save_b1pos; \ - save_b1color = epvt->save_b1color; \ - next_goal = epvt->next_goal; \ - b1_color = epvt->b1_color; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - bitpos = state->bits.bitpos; \ - goal = state->goal; \ - stager = state->stager; \ - width = state->width; \ - lines_to_code = state->nl_tocode; \ - a0_color = state->a0_color; \ - a0a1 = state->a0a1; \ - a0_pos = state->a0_pos; \ - a1_pos = state->a1_pos; \ - a2_pos = epvt->a2_pos; \ - b1_pos = state->b1_pos; \ - length_acc = state->length_acc; \ - rl = state->rl; - -#endif /* defined(_G32D) */ - -#if defined(_TIFF2) || defined(_G31D) - -#define save_state_and_return(state) \ - { \ - state->private = (pointer) epvt; \ - epvt->counts = counts; \ - epvt->nvals = nvals; \ - epvt->index = index; \ - epvt->rlcode = rlcode; \ - epvt->terminating = terminating; \ - epvt->codelength = codelength; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->bits.bitpos = bitpos; \ - state->rl = rl; \ - state->goal = goal; \ - state->stager = stager; \ - state->a0_color = a0_color; \ - return(lines_coded); \ - } - -#define localize_state(state) \ - epvt = (Tiff2EncodePvt *) state->private; \ - counts = epvt->counts; \ - nvals = epvt->nvals; \ - index = epvt->index; \ - rlcode = epvt->rlcode; \ - terminating = epvt->terminating; \ - codelength = epvt->codelength; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - bitpos = state->bits.bitpos; \ - goal = state->goal; \ - stager = state->stager; \ - width = state->width; \ - lines_to_code = state->nl_tocode; \ - a0_color = state->a0_color; \ - rl = state->rl; - -#endif /* defined(_TIFF2) */ - -#if defined(_PBits) - - -#define save_state_and_return(state) \ - { \ - state->private = (pointer) epvt; \ - epvt->index = index; \ - epvt->start = start; \ - epvt->nlits = nlits; \ - epvt->nvals = nvals; \ - epvt->counts = counts; \ - epvt->values = values; \ - epvt->lits_to_write = lits_to_write; \ - epvt->bytes_out = bytes_out; \ - epvt->rlcode = rlcode; \ - state->bits.byteptr = byteptr; \ - state->bits.endptr = endptr; \ - state->rl = rl; \ - state->goal = goal; \ - return(lines_coded); \ - } - -#define localize_state(state) \ - epvt = (PackBitsEncodePvt *) state->private; \ - index = epvt->index; \ - start = epvt->start; \ - nlits = epvt->nlits; \ - nvals = epvt->nvals; \ - counts = epvt->counts; \ - values = epvt->values; \ - lits_to_write = epvt->lits_to_write; \ - bytes_out = epvt->bytes_out; \ - rlcode = epvt->rlcode; \ - byteptr = state->bits.byteptr; \ - endptr = state->bits.endptr; \ - goal = state->goal; \ - width = state->width; \ - lines_to_code = state->nl_tocode; \ - rl = state->rl; - -#endif /* defined(_Pbits) */ Index: xc/programs/Xserver/XIE/mixie/fax/fetabs.h diff -u xc/programs/Xserver/XIE/mixie/fax/fetabs.h:1.2 xc/programs/Xserver/XIE/mixie/fax/fetabs.h:removed --- xc/programs/Xserver/XIE/mixie/fax/fetabs.h:1.2 Fri Dec 14 14:58:25 2001 +++ xc/programs/Xserver/XIE/mixie/fax/fetabs.h Sat Feb 28 21:41:59 2004 @@ -1,329 +0,0 @@ -/* $Xorg: fetabs.h,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module fetabs.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - fetabs.h -- header file holding fax encoding tables - - Ben Fahy, AGE Logic, Sept 1993 - -******************************************************************************/ - -typedef struct _shifted_codes { - unsigned short code; - unsigned short nbits; -} ShiftedCodes; - -#define EOL_CODE (0x001 << 4) -#define EOL_BIT_LENGTH 12 - -#define EOL_1D_CODE (0x0018) -#define EOL_1D_BIT_LENGTH 13 - -#define EOL_2D_CODE (0x0010) -#define EOL_2D_BIT_LENGTH 13 - -#define PASS_CODE (0x1 << 12) -#define PASS_CODE_BIT_LENGTH 4 - -#define HORIZONTAL_CODE (0x1 << 13) -#define HORIZONTAL_CODE_LENGTH 3 - -#define DEDUCE_Vcode(b1_minus_a1,rlcode,nmbits) \ - { rlcode = VerticalCodes[3+b1_minus_a1].code; \ - nmbits = VerticalCodes[3+b1_minus_a1].nbits; \ - } - - -#ifdef FETABS_OWNER -ShiftedCodes VerticalCodes[] = { - (0x03 << 9), 7, /* a1 3 rite of b1 */ - (0x03 <<10), 6, /* a1 2 rite of b1 */ - (0x03 <<13), 3, /* a1 1 rite of b1 */ - (0x01 <<15), 1, /* a1 0 left of b1 */ - (0x02 <<13), 3, /* a1 1 left of b1 */ - (0x02 <<10), 6, /* a1 2 left of b1 */ - (0x02 << 9), 7, /* a1 3 left of b1 */ -}; - -ShiftedCodes ShiftedWhites[] = { - (0x35 << 8), 8, /* run length of zero */ - (0x07 <<10), 6, /* run length of 1 */ - (0x07 <<12), 4, /* run length of 2 */ - (0x08 <<12), 4, /* run length of 3 */ - (0x0b <<12), 4, /* run length of 4 */ - (0x0c <<12), 4, /* run length of 5 */ - (0x0e <<12), 4, /* run length of 6 */ - (0x0f <<12), 4, /* run length of 7 */ - (0x13 <<11), 5, /* run length of 8 */ - (0x14 <<11), 5, /* run length of 9 */ - (0x07 <<11), 5, /* run length of 10 */ - (0x08 <<11), 5, /* run length of 11 */ - (0x08 <<10), 6, /* run length of 12 */ - (0x03 <<10), 6, /* run length of 13 */ - (0x34 <<10), 6, /* run length of 14 */ - (0x35 <<10), 6, /* run length of 15 */ - (0x2a <<10), 6, /* run length of 16 */ - (0x2b <<10), 6, /* run length of 17 */ - (0x27 << 9), 7, /* run length of 18 */ - (0x0c << 9), 7, /* run length of 19 */ - (0x08 << 9), 7, /* run length of 20 */ - (0x17 << 9), 7, /* run length of 21 */ - (0x03 << 9), 7, /* run length of 22 */ - (0x04 << 9), 7, /* run length of 23 */ - (0x28 << 9), 7, /* run length of 24 */ - (0x2b << 9), 7, /* run length of 25 */ - (0x13 << 9), 7, /* run length of 26 */ - (0x24 << 9), 7, /* run length of 27 */ - (0x18 << 9), 7, /* run length of 28 */ - (0x02 << 8), 8, /* run length of 29 */ - (0x03 << 8), 8, /* run length of 30 */ - (0x1a << 8), 8, /* run length of 31 */ - (0x1b << 8), 8, /* run length of 32 */ - (0x12 << 8), 8, /* run length of 33 */ - (0x13 << 8), 8, /* run length of 34 */ - (0x14 << 8), 8, /* run length of 35 */ - (0x15 << 8), 8, /* run length of 36 */ - (0x16 << 8), 8, /* run length of 37 */ - (0x17 << 8), 8, /* run length of 38 */ - (0x28 << 8), 8, /* run length of 39 */ - (0x29 << 8), 8, /* run length of 40 */ - (0x2a << 8), 8, /* run length of 41 */ - (0x2b << 8), 8, /* run length of 42 */ - (0x2c << 8), 8, /* run length of 43 */ - (0x2d << 8), 8, /* run length of 44 */ - (0x04 << 8), 8, /* run length of 45 */ - (0x05 << 8), 8, /* run length of 46 */ - (0x0a << 8), 8, /* run length of 47 */ - (0x0b << 8), 8, /* run length of 48 */ - (0x52 << 8), 8, /* run length of 49 */ - (0x53 << 8), 8, /* run length of 50 */ - (0x54 << 8), 8, /* run length of 51 */ - (0x55 << 8), 8, /* run length of 52 */ - (0x24 << 8), 8, /* run length of 53 */ - (0x25 << 8), 8, /* run length of 54 */ - (0x58 << 8), 8, /* run length of 55 */ - (0x59 << 8), 8, /* run length of 56 */ - (0x5a << 8), 8, /* run length of 57 */ - (0x5b << 8), 8, /* run length of 58 */ - (0x4a << 8), 8, /* run length of 59 */ - (0x4b << 8), 8, /* run length of 60 */ - (0x32 << 8), 8, /* run length of 61 */ - (0x33 << 8), 8, /* run length of 62 */ - (0x34 << 8), 8, /* run length of 63 */ - (0x1b << 11),5, /* run length of 64 */ - (0x12 << 11),5, /* run length of 2*64 = 128 */ - (0x17 << 10),6, /* run length of 3*64 = 192 */ - (0x37 << 9), 7, /* run length of 4*64 = 256 */ - (0x36 << 8), 8, /* run length of 5*64 = 320 */ - (0x37 << 8), 8, /* run length of 6*64 = 384 */ - (0x64 << 8), 8, /* run length of 7*64 = 448 */ - (0x65 << 8), 8, /* run length of 8*64 = 512 */ - (0x68 << 8), 8, /* run length of 9*64 = 576 */ - (0x67 << 8), 8, /* run length of 10*64 = 640 */ - (0x0cc<< 7), 9, /* run length of 11*64 = 704 */ - (0x0cd<< 7), 9, /* run length of 12*64 = 768 */ - (0x0d2<< 7), 9, /* run length of 13*64 = 832 */ - (0x0d3<< 7), 9, /* run length of 14*64 = 896 */ - (0x0d4<< 7), 9, /* run length of 15*64 = 960 */ - (0x0d5<< 7), 9, /* run length of 16*64 = 1024 */ - (0x0d6<< 7), 9, /* run length of 17*64 = 1088 */ - (0x0d7<< 7), 9, /* run length of 18*64 = 1152 */ - (0x0d8<< 7), 9, /* run length of 19*64 = 1216 */ - (0x0d9<< 7), 9, /* run length of 20*64 = 1280 */ - (0x0da<< 7), 9, /* run length of 21*64 = 1344 */ - (0x0db<< 7), 9, /* run length of 22*64 = 1408 */ - (0x098<< 7), 9, /* run length of 23*64 = 1472 */ - (0x099<< 7), 9, /* run length of 24*64 = 1536 */ - (0x09a<< 7), 9, /* run length of 25*64 = 1600 */ - (0x18 <<10), 6, /* run length of 26*64 = 1664 */ - (0x09b<< 7), 9, /* run length of 27*64 = 1728 */ - (0x08 << 5), 11, /* run length of 28*64 = 1792 */ - (0x0c << 5), 11, /* run length of 29*64 = 1856 */ - (0x0d << 5), 11, /* run length of 30*64 = 1920 */ - (0x12 << 4), 12, /* run length of 31*64 = 1984 */ - (0x13 << 4), 12, /* run length of 32*64 = 2048 */ - (0x14 << 4), 12, /* run length of 33*64 = 2112 */ - (0x15 << 4), 12, /* run length of 34*64 = 2176 */ - (0x16 << 4), 12, /* run length of 35*64 = 2240 */ - (0x17 << 4), 12, /* run length of 36*64 = 2304 */ - (0x1c << 4), 12, /* run length of 37*64 = 2368 */ - (0x1d << 4), 12, /* run length of 38*64 = 2432 */ - (0x1e << 4), 12, /* run length of 39*64 = 2496 */ - (0x1f << 4), 12, /* run length of 40*64 = 2560 */ -}; - -ShiftedCodes ShiftedBlacks[] = { - (0x37 << 6),10, /* run length of zero */ - (0x2 <<13), 3, /* run length of 1 */ - (0x3 <<14), 2, /* run length of 2 */ - (0x2 <<14), 2, /* run length of 3 */ - (0x03 <<13), 3, /* run length of 4 */ - (0x03 <<12), 4, /* run length of 5 */ - (0x02 <<12), 4, /* run length of 6 */ - (0x03 <<11), 5, /* run length of 7 */ - (0x05 <<10), 6, /* run length of 8 */ - (0x04 <<10), 6, /* run length of 9 */ - (0x04 << 9), 7, /* run length of 10 */ - (0x05 << 9), 7, /* run length of 11 */ - (0x07 << 9), 7, /* run length of 12 */ - (0x04 << 8), 8, /* run length of 13 */ - (0x07 << 8), 8, /* run length of 14 */ - (0x18 << 7), 9, /* run length of 15 */ - (0x17 << 6),10, /* run length of 16 */ - (0x18 << 6),10, /* run length of 17 */ - (0x08 << 6),10, /* run length of 18 */ - (0x67 << 5),11, /* run length of 19 */ - (0x68 << 5),11, /* run length of 20 */ - (0x6c << 5),11, /* run length of 21 */ - (0x37 << 5),11, /* run length of 22 */ - (0x28 << 5),11, /* run length of 23 */ - (0x17 << 5),11, /* run length of 24 */ - (0x18 << 5),11, /* run length of 25 */ - (0xca << 4),12, /* run length of 26 */ - (0xcb << 4),12, /* run length of 27 */ - (0xcc << 4),12, /* run length of 28 */ - (0xcd << 4),12, /* run length of 29 */ - (0x68 << 4),12, /* run length of 30 */ - (0x69 << 4),12, /* run length of 31 */ - (0x6a << 4),12, /* run length of 32 */ - (0x6b << 4),12, /* run length of 33 */ - (0xd2 << 4),12, /* run length of 34 */ - (0xd3 << 4),12, /* run length of 35 */ - (0xd4 << 4),12, /* run length of 36 */ - (0xd5 << 4),12, /* run length of 37 */ - (0xd6 << 4),12, /* run length of 38 */ - (0xd7 << 4),12, /* run length of 39 */ - (0x6c << 4),12, /* run length of 40 */ - (0x6d << 4),12, /* run length of 41 */ - (0xda << 4),12, /* run length of 42 */ - (0xdb << 4),12, /* run length of 43 */ - (0x54 << 4),12, /* run length of 44 */ - (0x55 << 4),12, /* run length of 45 */ - (0x56 << 4),12, /* run length of 46 */ - (0x57 << 4),12, /* run length of 47 */ - (0x64 << 4),12, /* run length of 48 */ - (0x65 << 4),12, /* run length of 49 */ - (0x52 << 4),12, /* run length of 50 */ - (0x53 << 4),12, /* run length of 51 */ - (0x24 << 4),12, /* run length of 52 */ - (0x37 << 4),12, /* run length of 53 */ - (0x38 << 4),12, /* run length of 54 */ - (0x27 << 4),12, /* run length of 55 */ - (0x28 << 4),12, /* run length of 56 */ - (0x58 << 4),12, /* run length of 57 */ - (0x59 << 4),12, /* run length of 58 */ - (0x2b << 4),12, /* run length of 59 */ - (0x2c << 4),12, /* run length of 60 */ - (0x5a << 4),12, /* run length of 61 */ - (0x66 << 4),12, /* run length of 62 */ - (0x67 << 4),12, /* run length of 63 */ - (0x0f << 6),10, /* run length of 64 */ - (0xc8 << 4),12, /* run length of 2*64 = 128 */ - (0xc9 << 4),12, /* run length of 3*64 = 192 */ - (0x5b << 4),12, /* run length of 4*64 = 256 */ - (0x33 << 4),12, /* run length of 5*64 = 320 */ - (0x34 << 4),12, /* run length of 6*64 = 384 */ - (0x35 << 4),12, /* run length of 7*64 = 448 */ - (0x6c << 3),13, /* run length of 8*64 = 512 */ - (0x6d << 3),13, /* run length of 9*64 = 576 */ - (0x4a << 3),13, /* run length of 10*64 = 640 */ - (0x4b << 3),13, /* run length of 11*64 = 704 */ - (0x4c << 3),13, /* run length of 12*64 = 768 */ - (0x4d << 3),13, /* run length of 13*64 = 832 */ - (0x72 << 3),13, /* run length of 14*64 = 896 */ - (0x73 << 3),13, /* run length of 15*64 = 960 */ - (0x74 << 3),13, /* run length of 16*64 = 1024 */ - (0x75 << 3),13, /* run length of 17*64 = 1088 */ - (0x76 << 3),13, /* run length of 18*64 = 1152 */ - (0x77 << 3),13, /* run length of 19*64 = 1216 */ - (0x52 << 3),13, /* run length of 20*64 = 1280 */ - (0x53 << 3),13, /* run length of 21*64 = 1344 */ - (0x54 << 3),13, /* run length of 22*64 = 1408 */ - (0x55 << 3),13, /* run length of 23*64 = 1472 */ - (0x5a << 3),13, /* run length of 24*64 = 1536 */ - (0x5b << 3),13, /* run length of 25*64 = 1600 */ - (0x64 << 3),13, /* run length of 26*64 = 1664 */ - (0x65 << 3),13, /* run length of 27*64 = 1728 */ - (0x08 << 5), 11, /* run length of 28*64 = 1792 */ - (0x0c << 5), 11, /* run length of 29*64 = 1856 */ - (0x0d << 5), 11, /* run length of 30*64 = 1920 */ - (0x12 << 4), 12, /* run length of 31*64 = 1984 */ - (0x13 << 4), 12, /* run length of 32*64 = 2048 */ - (0x14 << 4), 12, /* run length of 33*64 = 2112 */ - (0x15 << 4), 12, /* run length of 34*64 = 2176 */ - (0x16 << 4), 12, /* run length of 35*64 = 2240 */ - (0x17 << 4), 12, /* run length of 36*64 = 2304 */ - (0x1c << 4), 12, /* run length of 37*64 = 2368 */ - (0x1d << 4), 12, /* run length of 38*64 = 2432 */ - (0x1e << 4), 12, /* run length of 39*64 = 2496 */ - (0x1f << 4), 12, /* run length of 40*64 = 2560 */ -}; - -#else -extern ShiftedCodes VerticalCodes[]; -extern ShiftedCodes ShiftedWhites[]; -extern ShiftedCodes ShiftedBlacks[]; -#endif Index: xc/programs/Xserver/XIE/mixie/fax/gbits.h diff -u xc/programs/Xserver/XIE/mixie/fax/gbits.h:1.2 xc/programs/Xserver/XIE/mixie/fax/gbits.h:removed --- xc/programs/Xserver/XIE/mixie/fax/gbits.h:1.2 Fri Dec 14 14:58:25 2001 +++ xc/programs/Xserver/XIE/mixie/fax/gbits.h Sat Feb 28 21:41:59 2004 @@ -1,465 +0,0 @@ -/* $Xorg: gbits.h,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module fax/gbits.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/gbits.h -- DDXIE fax decode bitstream - get macros - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - -/* - * gbits.h - sub-include file of bits.h, the 'g' stands for "get" - * as in: - * - * bit = get_bit( byteptr,bitpos,endptr); - * byte = get_byte(byteptr,bitpos,endptr); - * code = get_wcode(byteptr,bitpos,endptr); - * code = get_bcode(byteptr,bitpos,endptr); - * - * but I am also including: - * - * adjust_bitstream_8(n,byteptr,bitpos,endptr); - * adjust_bitstream( n,byteptr,bitpos,endptr); - * adjust_1bit( byteptr,bitpos,endptr); - * -*/ - -/* ------------------------------------------------------------------- */ -/* - * do_magic(byteptr,bitpos,endptr); - * - * Macro to attempt to recover from an end-of-strip condition. - * It bridges the gap between current strip and the next by - * copying the last 4 bytes of current strip, together with the - * first four bytes of the next strip, into a 'magic strip', - * which consists of at 8 bytes. Since no FAX codes are longer - * than 13 bits in length, this implies that we have plenty of - * room in the magic strip to finish off decoding everything that - * was copied from the first strip. When we hit the second long - * word in the magic strip, we will trip the endptr condition for - * it and then restore the logical next strip, marking the first - * one as done. - * - * The nice thing about this method is that we don't have to do - * any copying of real-life strips. We just insert a pseudo-strip - * for a very brief amount of time, and the behavior is more or - * less hidden from routines outside this module. - * - */ - -#define do_magic(byteptr,bitpos,endptr) \ - { \ - int o; \ - if (state->use_magic) { \ - /* already using magic strip, switch back to normal */ \ - \ - if (state->strip_state == StripStateNoMore) { \ - /* we are out of data! return number of lines found */ \ - state->decoder_done = 1; \ - } \ - else { \ - /* switch over to next input strip */ \ - o = byteptr - endptr; \ - byteptr = (unsigned char *)state->strip + o; \ - endptr = (unsigned char *)state->strip+state->strip_size-4;\ - state->use_magic = 0; /* aw - the magic is gone :-( */ \ - } \ - } \ - else { \ - /* will switch over to using magic strip */ \ - state->use_magic = 1; \ - state->magicStrip[0] = *(endptr); \ - state->magicStrip[1] = *(endptr+1); \ - state->magicStrip[2] = *(endptr+2); \ - state->magicStrip[3] = *(endptr+3); \ - \ - /* set byteptr in equivalent position in the magic strip */ \ - o = byteptr - endptr; \ - byteptr = o + (unsigned char *)&state->magicStrip[0]; \ - endptr = (unsigned char *)&state->magicStrip[4]; \ - /* will swap back after magicStrip[3] is done */ \ - \ - /* now signal to caller that we want a new strip */ \ - state->magic_needs = 1; \ - state->strip_state = StripStateDone; \ - /* you can toss the old one */ \ - \ - save_state_and_return(state); \ - } /* end of if already magic */ \ - } - -/* ------------------------------------------------------------------- */ -/* - * finish_magic(final); - * - * This macro finishes the job of assembling the magic strip. - * It plugs in the first long word of the new strip in as the - * second long word of the magic strip. - * - * Note that when 'magic_needs' is set, the caller MUST NOT call - * the decoder again until that strip is available, unless final - * is 1 (no more strips coming). - */ - -#define finish_magic(final) \ - { \ - if (state->strip_state == StripStateNew) { \ - /* what a guy! he gave me a new strip. :-) */ \ - state->magicStrip[4] = *(state->strip); \ - state->magicStrip[5] = *(state->strip+1); \ - state->magicStrip[6] = *(state->strip+2); \ - state->magicStrip[7] = *(state->strip+3); \ - state->strip_state = StripStateInUse; \ - } \ - else { \ - /* no new strip?? Better have a good reason! */ \ - if (final) { \ - /* Out of data (good reason), set 2nd magic word to 0 */ \ - state->magicStrip[4] = 0; \ - state->magicStrip[5] = 0; \ - state->magicStrip[6] = 0; \ - state->magicStrip[7] = 0; \ - } \ - else { \ - /* strips left, but I am DENIED?? Shocking! */ \ - state->decoder_done = FAX_DECODE_DONE_ErrorBadMagic; \ - return(lines_found); \ - } \ - } /* end of if (final) */ \ - /* byteptr, bitpos, endptr should already be set up ok */ \ - state->magic_needs = 0; \ - } /* end of finish_magic(final) */ - -/* ------------------------------------------------------------------- */ -/* - * skip_bits_at_eol(byteptr,bitpos,endptr); - * - * Macro to move bitstream position forward to the next even byte - * boundary, if necessary - * - */ -#define skip_bits_at_eol(byteptr,bitpos,endptr) \ - { \ - if (bitpos) { \ - bitpos = 0; \ - if (++byteptr >= endptr) \ - do_magic(byteptr,bitpos,endptr); \ - } \ - } - -/* ------------------------------------------------------------------- */ -/* - * adjust_bitstream_8(n,byteptr,bitpos,endptr); - * - * Macro to move bitstream position forward n bits, where n is - * known to be <= 8. - * - * Strategy: - * There are only two cases: - * - * bitpos+n < 8, => byteptr same, adjust bitpos - * - * bitpos+n >= 8, => bitpos = (bitpos+n)%8, ++byteptr, - * need to check endptr. - */ - -#define adjust_bitstream_8(n,byteptr,bitpos,endptr) \ - { register int tmp=n+bitpos; \ - if (tmp < 8) \ - bitpos=tmp ; /* staying in same byte */ \ - else { /* moving to new byte */ \ - bitpos=tmp%8; /* adjust bitpos */ \ - if (++byteptr >= endptr) \ - do_magic(byteptr,bitpos,endptr); \ - } \ - } - -/* ------------------------------------------------------------------- */ -/* - * adjust_1bit(byteptr,bitpos,endptr); - * - * Macro to move bitstream position forward 1 bit - * - * Strategy: - * oh, poo! Just leverage adjust_bitstream_8( ) - * - */ - -#define adjust_1bit(byteptr,bitpos,endptr) \ - adjust_bitstream_8(1,byteptr,bitpos,endptr) - -/* ------------------------------------------------------------------- */ -/* - * adjust_bitstream(n,byteptr,bitpos,endptr); - * - * Macro to move bitstream position forward n bits, where n is - * known to be <= 13. - * - * Strategy: - * We may need to adjust from 1 to 13 bits. It's easy - * to calculate the new bitpos - it's just (n+bitpos)%8. - * Similarly, the number of bytes to move over is given - * by (n+bitpos)/8. - * - */ - -#define adjust_bitstream(n,byteptr,bitpos,endptr) \ - { register int tmp=n+bitpos; \ - if (tmp < 8) \ - bitpos=tmp ; /* staying in same byte */ \ - else { /* moving to new byte */ \ - bitpos = tmp%8; \ - byteptr += tmp/8; \ - if (byteptr >= endptr) \ - do_magic(byteptr,bitpos,endptr); \ - } \ - } - -/* ------------------------------------------------------------------- */ -/* - * bit = get_bit(byteptr,bitpos,endptr); - * - * Macro to get next coding bit (when searching for tag bit, g32d). - * - * Strategy: - * mask everything but current bitpos, where bitpos counts - * from msbit to lsbit (bitpos=0 means msbit) - * - * NOTE: we do *not* try to align the bit in any way. It is - * assumed that the whole masked byte will be inspected - * at once for non-zero status. - * - */ -#define get_bit(byteptr,bitpos,endptr) \ - ( (*byteptr) & ((unsigned char) 0x080 >> bitpos) ) - - /* Notice endptr isn't actually used, it's just there for show */ -/* ------------------------------------------------------------------- */ -/* - * byte = get_byte(byteptr,bitpos,endptr); - * - * Macro to get next coding byte. - * - * IMPORTANT!! There is no check to make sure that byteptr+1 - * actually point to valid data in the macro below. It - * is assumed this macro will never be called unless it - * has already been verified it is safe to do so. - * - * Strategy: - * If bitpos is 0, all data available in this byte, and - * it's trivial. So let's assume bitpos != 0, so that the - * 8 bits we want straddles two bytes, as below: - * - * bitpos = 3, counting from the left: - * - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X X Y Y Y - * - * We want to form an 8-bit byte out of bits XXXXXYYY as - * shown. By inspection, we need to shift the first byte to - * the left three bits, and add the second byte shifted to - * the right the complementary number of times. Thus: - */ -#define get_byte(byteptr,bitpos,endptr) \ - ( bitpos? ( (*byteptr) << bitpos ) | \ - ( (*(byteptr+1))>> (8-bitpos) ) : \ - *byteptr \ - ) - - /* Notice endptr isn't actually used, it's just there for show */ - -#define get_pbyte(byteptr,endptr) \ - ( *byteptr ) - - -/* ------------------------------------------------------------------- */ -/* - * code = get_wcode(byteptr,bitpos,endptr); - * - * Macro to get next white run length - * - * IMPORTANT!! There is no check to make sure that byteptr+1 or - * byteptr+2 actually point to valid data in the macro - * below. It is assumed this macro will never be called - * unless it has already been verified it is safe to do so. - * - * Strategy: - * For the white table we need 12 bits. If bitpos <=4, - * then the first byte will have at least four bits, so - * we only need two bytes. If bitpos >4, we need three - * bytes. - * - * bitpos = 4, starting from 0 counting from the left: - * - * 0 1 2 3 4 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X Y Y Y Y Y Y Y Y - * - * bitpos = 5, starting from 0 counting from the left: - * - * 0 1 2 3 4 5 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X Y Y Y Y Y Y Y Y Z - * - * Supose bitpos <=4. For example, suppose bitpos = 3, - * as is pictured below: - * - * 0 1 2 3 4 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X X Y Y Y Y Y Y Y - * - * We need to form a 12 bit word out of XXXXXYYYYYYY. By - * inspection it is easy to see that (4-bitpos) represents - * the number of bits "spilled" to the left of bitpos=4. - * The left-most bit needs to be shifted right to the bit4 - * position, so the solution is to form a word from the - * first two bytes, shift right by (4-bitpos) and mask. - * - * For the case of bitpos=5 (above), (bitpos-4) bits have - * "spilled" into the third byte. We need to form a word - * out of the three consecutive bytes and right shift by - * the amount (8-spill) = 8 - (bitpos-4) = 12-bitpos, then - * mask. - */ -#define two_bytes \ - ( (((unsigned int)*byteptr)<<8) | (*(byteptr+1)) ) - -#define three_bytes \ - ( (((unsigned int)*byteptr)<<16) | \ - (((unsigned int)*(byteptr+1))<<8) | \ - (*(byteptr+2)) ) - -#define get_wcode(byteptr,bitpos,endptr) \ - ( 0x0fff & \ - ( bitpos>4? ( three_bytes >> (12-bitpos) ) \ - : ( two_bytes >> ( 4-bitpos) ) \ - ) \ - ) - - /* Notice endptr isn't actually used, it's just there for show */ - -/* ------------------------------------------------------------------- */ -/* - * code = get_bcode(byteptr,bitpos,endptr); - * - * Macro to get next black run length. - * - * IMPORTANT!! There is no check to make sure that byteptr+1 or - * byteptr+2 actually point to valid data in the macro - * below. It is assumed this macro will never be called - * unless it has already been verified it is safe to do so. - * - * Strategy: - * For the black table we need 13 bits. If bitpos <=3, - * then the first byte will have at least five bits, so - * we only need two bytes. If bitpos >=4, we need three - * bytes. - * - * bitpos = 3, starting from 0 counting from the left: - * - * 0 1 2 3 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X X Y Y Y Y Y Y Y Y - * - * bitpos = 4, starting from 0 counting from the left: - * - * 0 1 2 3 4 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X Y Y Y Y Y Y Y Y Z - * - * Supose bitpos <=3. For example, suppose bitpos = 2, - * as is pictured below: - * - * 0 1 2 3 - * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 - * X X X X X X Y Y Y Y Y Y Y - * - * We need to form a 13 bit word out of XXXXXXYYYYYYY. By - * inspection it is easy to see that (3-bitpos) represents - * the number of bits "spilled" to the left of bitpos=3. - * The left-most bit needs to be shifted right to the bit3 - * position, so the solution is to form a word from the - * first two bytes, shift right by (3-bitpos) and mask. - * - * For the case of bitpos=4 (above), (bitpos-3) bits have - * "spilled" into the third byte. We need to form a word - * out of the three consecutive bytes and right shift by - * the amount (8-spill) = 8 - (bitpos-3) = 11-bitpos, then - * mask. - */ - -#define get_bcode(byteptr,bitpos,endptr) \ - ( 0x1fff & \ - ( bitpos>3? ( three_bytes >> (11-bitpos) ) \ - : ( two_bytes >> ( 3-bitpos) ) \ - ) \ - ) - - /* Notice endptr isn't actually used, it's just there for show */ - -/* ------------------------------------------------------------------- */ -/**** module fax/gbits.h ****/ Index: xc/programs/Xserver/XIE/mixie/fax/zeroeven.c diff -u xc/programs/Xserver/XIE/mixie/fax/zeroeven.c:1.5 xc/programs/Xserver/XIE/mixie/fax/zeroeven.c:removed --- xc/programs/Xserver/XIE/mixie/fax/zeroeven.c:1.5 Fri Dec 14 14:58:25 2001 +++ xc/programs/Xserver/XIE/mixie/fax/zeroeven.c Sat Feb 28 21:41:59 2004 @@ -1,129 +0,0 @@ -/* $Xorg: zeroeven.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module fax/zeroeven.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - fax/zeroeven.c -- DDXIE fax utility - - Ben && Larry -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ - - -/*** zero_even.c - zero out even transitions. - - The array wbtrans is arranged as a table of positions at which - the input changes from white to black, then black to white, then - white to black, and so on. We assume all output pixels have - already been set white. Therefore we only have to fill the - black ranges with zeros... - - W->B B->W W->B B->W W->B B->W W->B B->W - - 12 17 29 30 65 68 90 92 - - bit positions 12-16, 29, 65-67, and 90-91 in the above - example are black. It should be clear from the example - that the size of the run length is t[w]-t[b], where - w=b+1 and b is the index of a transition from white to - black. Note that if the line was only 92 pixels wide, - setting the imaginary pixel with index = image width - B->W still gives us the right answer. - -***/ - -#include -#include "macro.h" - -/**********************************************************************/ - -void -zero_even(cp,t,nt,w,white) -register LogInt *cp; -register int *t, nt,w,white; -{ -unsigned int sbit,ebit; -LogInt *sbyt, *ebyt, black; - -#define ONES ~((LogInt)0) - - memset(cp, white ? 0xff: 0, (w+7)>>3); - black = white ? 0 : ONES; - - for (nt = (nt>>1) - 1; nt >= 0; nt--) { - sbit = *t++; - ebit = *t++; /* if (!nt && (ebit > w)) ebit = w; */ - sbyt = cp + (sbit >> LOGSHIFT); sbit &= LOGMASK; - ebyt = cp + (ebit >> LOGSHIFT); ebit &= LOGMASK; - - if (sbyt < ebyt) { - if (sbit) *sbyt++ ^= BitRight(ONES,sbit); - while (sbyt < ebyt) *sbyt++ = black; - if (ebit) *sbyt ^= ~BitRight(ONES,ebit); - } else - *sbyt ^= BitRight(ONES,sbit) & ~(BitRight(ONES,ebit)); - } -} -/**** module fax/zeroeven.c ****/ Index: xc/programs/Xserver/XIE/mixie/import/Imakefile diff -u xc/programs/Xserver/XIE/mixie/import/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/import/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/import/Imakefile:3.6 Wed Jan 17 17:13:04 2001 +++ xc/programs/Xserver/XIE/mixie/import/Imakefile Sat Feb 28 21:41:59 2004 @@ -1,42 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:44 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/import/Imakefile,v 3.6 2001/01/17 22:13:04 dawes Exp $ - -XCOMM build device dependent machine independent import element objects - -#define IHaveModules -#include - -SRCS1 = mifax.c miclut.c micphoto.c midraw.c \ - milut.c miphoto.c miuncomp.c - -OBJS1 = mifax.o miclut.o micphoto.o midraw.o \ - milut.o miphoto.o miuncomp.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = microi.c miroi.c miregion.c mijpeg.c -OBJS2 = microi.o miroi.o miregion.o mijpeg.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions -I../jpeg - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(mimp,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/import/miclut.c diff -u xc/programs/Xserver/XIE/mixie/import/miclut.c:3.6 xc/programs/Xserver/XIE/mixie/import/miclut.c:removed --- xc/programs/Xserver/XIE/mixie/import/miclut.c:3.6 Fri Dec 14 14:58:27 2001 +++ xc/programs/Xserver/XIE/mixie/import/miclut.c Sat Feb 28 21:41:59 2004 @@ -1,269 +0,0 @@ -/* $Xorg: miclut.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module miclut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miclut.c -- DDXIE prototype import client lut element - - Ben Fahy -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/miclut.c,v 3.6 2001/12/14 19:58:27 dawes Exp $ */ - -#define _XIEC_MICLUT -#define _XIEC_ICLUT - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ - -/* - * routines used internal to this module - */ - -static int CreateICLUT(floDefPtr flo, peDefPtr ped); -static int InitializeICLUT(floDefPtr flo, peDefPtr ped); -static int ActivateICLUT(floDefPtr flo, peDefPtr ped, peTexPtr pet); -static int ResetICLUT(floDefPtr flo, peDefPtr ped); -static int DestroyICLUT(floDefPtr flo, peDefPtr ped); - -/* - * DDXIE ImportClientLUT entry points - */ - -static ddElemVecRec ICLUTVec = { - CreateICLUT, - InitializeICLUT, - ActivateICLUT, - (xieIntProc)NULL, - ResetICLUT, - DestroyICLUT - }; - -/* - * Local Declarations - */ - -typedef struct _lutpvt { - int byteptr; /* current number of bytes received */ - int bytelength; /* selects total size of array */ - int striplength; /* actual strip size, round up to power of 2 */ - int bytetype; /* selects array element size */ - int bandnum; /* for interleave, to swizzle bands */ -} lutPvtRec, *lutPvtPtr; - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeICLUT(floDefPtr flo, peDefPtr ped) -{ - /* for now just copy our entry point vector into the peDef */ - ped->ddVec = ICLUTVec; - - return(TRUE); -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateICLUT(floDefPtr flo, peDefPtr ped) -{ - return MakePETex(flo,ped,xieValMaxBands * sizeof(lutPvtRec),NO_SYNC,NO_SYNC); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeICLUT(floDefPtr flo, peDefPtr ped) -{ - xieFloImportClientLUT *raw = (xieFloImportClientLUT *)ped->elemRaw; - lutPvtPtr ext = (lutPvtPtr) ped->peTex->private; - int band, nbands = ped->peTex->receptor[SRCtag].inFlo->bands; - CARD32 *lengths = &(raw->length0); - CARD32 *levels = &(raw->levels0); - - for (band = 0; band < nbands; band++, ext++, lengths++, levels++) { - int deep; - ext->byteptr = 0; - ext->bytetype = LutPitch(*levels); - ext->bytelength = *lengths * ext->bytetype; - SetDepthFromLevels(ext->bytelength, deep); - ext->striplength = (1 << deep); - ext->bandnum = (raw->class == xieValSingleBand || - raw->bandOrder == xieValLSFirst) - ? band : (xieValMaxBands - band - 1); - } - return InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateICLUT(floDefPtr flo, peDefPtr ped, peTexPtr pet) -{ - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - lutPvtPtr ext = (lutPvtPtr) pet->private; - - for(band = 0; band < nbands; band++, ext++, iband++) { - bandPtr oband = &(pet->emitter[ext->bandnum]); - pointer ivoid, ovoid; - int ilen, icopy; - - if(!(pet->scheduled & 1<striplength,FALSE))) - return(FALSE); - /* - ** We have no guarantee to get all the output in one packet. In - ** fact we have no guarantee we will ever get all the output, or - ** that perhaps we might get too much. If we do get too much we - ** would like to notify the user but the protocol doesn't provide - ** something similar to a decodeNotify. - */ - for(ilen = 0; - (ivoid = GetSrcBytes(flo,pet,iband,iband->current+ilen,1,FALSE)) != 0;) { - icopy = ilen = iband->strip->length; - - if ((ext->byteptr + ilen) > ext->bytelength) - icopy = ext->bytelength - ext->byteptr; - - if (icopy) { - memcpy( ((char *) ovoid) + ext->byteptr, (char *) ivoid, icopy); - ext->byteptr += icopy; - } - } - FreeData(flo, pet, iband, iband->maxLocal); - - /* if final, process the data received */ - if (iband->final) { - SetBandFinal(oband); - PutData(flo,pet,oband,ext->striplength); - } - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetICLUT(floDefPtr flo, peDefPtr ped) -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyICLUT(floDefPtr flo, peDefPtr ped) -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.flush = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} - -/* end module miclut.c */ - Index: xc/programs/Xserver/XIE/mixie/import/micphoto.c diff -u xc/programs/Xserver/XIE/mixie/import/micphoto.c:3.5 xc/programs/Xserver/XIE/mixie/import/micphoto.c:removed --- xc/programs/Xserver/XIE/mixie/import/micphoto.c:3.5 Fri Dec 14 14:58:27 2001 +++ xc/programs/Xserver/XIE/mixie/import/micphoto.c Sat Feb 28 21:41:59 2004 @@ -1,814 +0,0 @@ -/* $Xorg: micphoto.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module micphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - micphoto.c -- DDXIE import client photo element - - Robert NC Shelley && Dean Verheiden -- AGE Logic, Inc. April, 1993 - - Fax stuff added by Ben Fahy - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/micphoto.c,v 3.5 2001/12/14 19:58:27 dawes Exp $ */ - -#define _XIEC_MICPHOTO -#define _XIEC_ICPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * Local Declarations. - */ - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeICPhoto(); -bandMsk miImportCanonic(); -bandMsk miImportStream(); - -/* - * routines used internal to this module - */ -static int CreateICPhotoUn(); -static int InitializeICPhotoUncomByPlane(); -static int ActivateICPhotoUncomByPlane(); -static int ResetICPhoto(); -static int DestroyICPhotoUn(); - -static int CreateICPhotoStream(); -static int InitializeICPhotoStream(); -static int ActivateICPhotoStream(); - -#if XIE_FULL -static int InitializeICPhotoUncomByPixel(); -static int ActivateICPhotoUncomByPixel(); -#endif - - -/* - * routines we need from somewhere else - */ -extern int CreateICPhotoFax(); -extern int InitializeICPhotoFax(); -extern int ActivateICPhotoFax(); -extern int ResetICPhotoFax(); -extern int DestroyICPhotoFax(); - -#if XIE_FULL -extern int CreateIPhotoJpegBase(); -extern int InitializeICPhotoJpegBase(); -extern int ActivateIPhotoJpegBase(); -extern int ResetIPhotoJpegBase(); -extern int DestroyIPhotoJpegBase(); - -#ifdef optional_non_SI -static int CreateICPhotoJPEGLossless(); -static int InitializeICPhotoJPEGLossless(); -static int ActivateICPhotoJPEGLossless(); -static int DestroyICPhotoJPEGLossless(); -#endif -#endif /* XIE_FULL */ - -/* - * DDXIE ImportClientPhoto entry points - */ -static ddElemVecRec ICPhotoUncomByPlaneVec = { - CreateICPhotoUn, - InitializeICPhotoUncomByPlane, - ActivateICPhotoUncomByPlane, - (xieIntProc)NULL, - ResetICPhoto, - DestroyICPhotoUn - }; - -static ddElemVecRec ICPhotoStreamVec = { - CreateICPhotoStream, - InitializeICPhotoStream, - ActivateICPhotoStream, - (xieIntProc)NULL, - ResetICPhoto, - DestroyICPhotoUn - }; - -static ddElemVecRec ICPhotoFaxVec = { - CreateICPhotoFax, - InitializeICPhotoFax, - ActivateICPhotoFax, - (xieIntProc)NULL, - ResetICPhotoFax, - DestroyICPhotoFax - }; - -#if XIE_FULL -static ddElemVecRec ICPhotoUncomByPixelVec = { - CreateICPhotoUn, - InitializeICPhotoUncomByPixel, - ActivateICPhotoUncomByPixel, - (xieIntProc)NULL, - ResetICPhoto, - DestroyICPhotoUn - }; - -static ddElemVecRec ICPhotoJpegBaseVec = { - CreateIPhotoJpegBase, - InitializeICPhotoJpegBase, /* only thing not shared with ImportPhotomap */ - ActivateIPhotoJpegBase, - (xieIntProc)NULL, - ResetIPhotoJpegBase, - DestroyIPhotoJpegBase - }; -#endif /* XIE_FULL */ - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeICPhoto(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; - - if(!miImportCanonic(flo,ped)) { - ped->ddVec = ICPhotoStreamVec; - return(TRUE); - } - switch(raw->decodeTechnique) { - case xieValDecodeUncompressedSingle: - ped->ddVec = ICPhotoUncomByPlaneVec; - break; - - case xieValDecodeG31D: - case xieValDecodeG32D: - case xieValDecodeG42D: - case xieValDecodeTIFF2: - case xieValDecodeTIFFPackBits: - ped->ddVec = ICPhotoFaxVec; - break; - -#if XIE_FULL - case xieValDecodeUncompressedTriple: - - if(((xieTecDecodeUncompressedTriple*)&raw[1]) - ->interleave == xieValBandByPlane) - ped->ddVec = ICPhotoUncomByPlaneVec; - else { /* xieValBandByPixel */ - ped->ddVec = ICPhotoUncomByPixelVec; - break; - } - break; - - case xieValDecodeJPEGBaseline: - ped->ddVec = ICPhotoJpegBaseVec; - break; -#endif /* XIE_FULL */ - - default: - ImplementationError(flo,ped, return(FALSE)); - } - return(TRUE); -} /* end miAnalyzeICPhoto */ - - -/*------------------------------------------------------------------------ --------- utility routines: see what kind data should be forwarded -------- -------------------------------------------------------------------------*/ -bandMsk miImportCanonic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - bandMsk mask = NO_BANDS, all = (1<outFlo.bands)-1; - inFloPtr inf; - int b; - - /* find recipients that want canonic data - */ - for(inf = ped->outFlo.outChain; inf && mask != all; inf = inf->outChain) - for(b = 0; b < inf->bands; ++b) - if(IsCanonic(inf->format[b].class)) - mask |= 1<outFlo.bands)-1; - inFloPtr inf; - int b; - - /* find recipients that want stream data - */ - for(inf = ped->outFlo.outChain; inf && mask != all; inf = inf->outChain) - for(b = 0; b < inf->bands; ++b) - if(inf->format[b].class == STREAM) - mask |= 1<elemRaw; - peTexPtr pet = ped->peTex; - miUncompPtr pvt = (miUncompPtr)pet->private; - CARD32 nbands = ped->outFlo.bands,b,s; - formatPtr inf = ped->inFloLst[IMPORT].format; - xieTypOrientation pixelOrder, fillOrder; - CARD8 *ppad; - - if (nbands == 1) { - xieTecDecodeUncompressedSingle *tec = ((xieTecDecodeUncompressedSingle*) - &raw[1]); - pixelOrder = tec->pixelOrder; - fillOrder = tec->fillOrder; - pvt->bandMap = 0; - ppad = &tec->leftPad; - } else { - xieTecDecodeUncompressedTriple *tec = ((xieTecDecodeUncompressedTriple*) - &raw[1]); - pixelOrder = tec->pixelOrder; - fillOrder = tec->fillOrder; - ppad = tec->leftPad; - if (tec->bandOrder == xieValLSFirst) - for(b = 0; b < xieValMaxBands; ++b) - pvt[b].bandMap = b; - else - for(s = 0, b = xieValMaxBands; b--; ++s) - pvt[s].bandMap = b; - } - - for (b = 0; b < nbands; b++, pvt++, ppad++, inf++) { - pvt->bitOff = pvt->leftPad = *ppad; - if (inf->depth == 1) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - if (pvt->leftPad & 7 || inf->stride != 1) { - pvt->action = (fillOrder == xieValMSFirst) ? CPextractstreambits: - CPextractswappedstreambits; - } else { - pvt->action = (fillOrder == xieValMSFirst) ? CPpass_bits : - CPreverse_bits; - } -#else - if (pvt->leftPad & 7 || inf->stride != 1) { - pvt->action = (fillOrder == xieValLSFirst) ? CPextractstreambits: - CPextractswappedstreambits; - } else { - pvt->action = (fillOrder == xieValLSFirst) ? CPpass_bits : - CPreverse_bits; - } -#endif - } else if (inf->depth <= 8) { - if (pvt->leftPad & 7 || inf->stride & 7) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUBtoB; - else - pvt->action = MLUBtoB; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUBtoB; - else - pvt->action = LLUBtoB; - } - } else { - /* They chose wisely */ - pvt->action = CPpass_bytes; - } - } else if (inf->depth <= 16) { - if (pvt->leftPad & 15 || inf->stride & 15) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUPtoP; - else - pvt->action = MLUPtoP; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUPtoP; - else - pvt->action = LLUPtoP; - } - } else { - /* They chose wisely */ -#if (IMAGE_BYTE_ORDER == MSBFirst) - pvt->action = (fillOrder==xieValMSFirst) ? CPpass_pairs : CPswap_pairs; -#else - pvt->action = (fillOrder==xieValLSFirst) ? CPpass_pairs : CPswap_pairs; -#endif - } - } else if (inf->depth <= 24) { - if (pvt->leftPad & 31 || inf->stride & 31) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUQtoQ; - else - pvt->action = MLUQtoQ; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUQtoQ; - else - pvt->action = LLUQtoQ; - } - } else { - /* They chose wisely */ -#if (IMAGE_BYTE_ORDER == MSBFirst) - pvt->action = (fillOrder==xieValMSFirst) ? CPpass_quads : CPswap_quads; -#else - pvt->action = (fillOrder==xieValLSFirst) ? CPpass_quads : CPswap_quads; -#endif - } - } else { - ImplementationError(flo,ped, return(FALSE)); - } - } - pet->receptor->forward = miImportStream(flo,ped); - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeICPhotoUnSingle */ - - -static int InitializeICPhotoStream(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* tell the data manager to forward our input data to downstream elements - */ - ped->peTex->receptor->forward = miImportStream(flo,ped); - - return(InitReceptors(flo, ped, NO_DATAMAP, 1)); -} /* end InitializeICPhotoStream */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateICPhotoUncomByPlane(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; - miUncompPtr pvt = (miUncompPtr)pet->private; - CARD32 nbands = ped->inFloLst[IMPORT].bands; - bandPtr sbnd = pet->receptor[IMPORT].band, dbnd; - CARD32 oldslen, nextslen, b; - pointer src = (pointer)NULL, dst = (pointer)NULL; - - for(b = 0; b < nbands; ++sbnd, ++b, pvt++) { - void (*action)() = pvt->action; - - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - dbnd = &pet->emitter[pvt->bandMap]; - if(pet->scheduled & 1<current,nextslen,KEEP)) && - (dst = GetCurrentDst(flo,pet,dbnd))) { - do { - - (*action)(src, dst, sbnd->format->width, pvt->bitOff, - (CARD32)sbnd->format->depth, - sbnd->format->stride); - - pvt->bitOff = pvt->bitOff + sbnd->format->pitch & 7; /* Set next */ - oldslen = (pvt->bitOff) ? nextslen - 1 : nextslen; - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - src = GetSrcBytes(flo,pet,sbnd,sbnd->current+oldslen,nextslen,KEEP); - dst = GetNextDst(flo,pet,dbnd,FLUSH); - } while(src && dst); - } - - if(!src && sbnd->final && dbnd->current < dbnd->format->height) { - /* - * the client lied about the image size! - */ - if(raw->notify) - SendDecodeNotifyEvent(flo, ped, dbnd->band, - xieValDecodeUncompressedSingle, - dbnd->format->width, dbnd->current, TRUE); - /* - * If the client didn't send enough data, we could zero-fill the - * remaining lines. Since we sent the "aborted" status, we won't - * bother (the protocol offers both choices). - */ - ValueError(flo,ped,dbnd->format->height, return(FALSE)); - } - if (!src || dbnd->final) { - /* free whatever we've used so far and - * set the threshold to one byte more than whatever is left over - */ - FreeData(flo, pet, sbnd, sbnd->final ? sbnd->maxGlobal : sbnd->current); - SetBandThreshold(sbnd, sbnd->available + 1); - } - } - return(TRUE); -} /* end ActivateICPhotoUncomByPlane */ - - -static int ActivateICPhotoStream(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - CARD32 nbands = ped->inFloLst[IMPORT].bands; - bandPtr bnd = pet->receptor[IMPORT].band; - CARD32 b; - - for(b = 0; b < nbands; ++bnd, ++b) { - if(GetSrcBytes(flo,pet,bnd,bnd->current,1,KEEP)) - FreeData(flo,pet,bnd,bnd->maxGlobal); - } - return(TRUE); -} /* end ActivateICPhotoStream */ - - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetICPhoto(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetICPhoto */ - - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyICPhotoUn(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyICPhotoUn */ - - -#if XIE_FULL -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeICPhotoUncomByPixel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; - peTexPtr pet = ped->peTex; - miUncompPtr pvt = (miUncompPtr)pet->private; - bandPtr sbnd = &ped->peTex->receptor[IMPORT].band[0]; - CARD32 sstride = sbnd->format->stride>>3; - xieTecDecodeUncompressedTriple *tec = ((xieTecDecodeUncompressedTriple*) - &raw[1]); - CARD8 leftPad = tec->leftPad[0]>>3; - CARD32 depth1, depth2, depth3; - int s, d; - - pvt->unaligned = FALSE; /* Hope for the best */ - - if(tec->bandOrder == xieValLSFirst) - for(d = 0; d < xieValMaxBands; ++d) - pvt[d].bandMap = d; - else - for(s = 0, d = xieValMaxBands; d--; ++s) - pvt[s].bandMap = d; - - depth1 = pet->emitter[pvt[0].bandMap].format->depth; - depth2 = pet->emitter[pvt[1].bandMap].format->depth; - depth3 = pet->emitter[pvt[2].bandMap].format->depth; - - pvt->bitOff = pvt->leftPad = tec->leftPad[0]; - - /* See if data is nicely aligned */ - if (!(tec->leftPad[0] & 7) && !(sbnd->format->stride & 7)) { - if (depth1 == 16 && depth2 == 16 && depth3 == 16) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? StoP : StosP; -#else - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? StosP : StoP; -#endif - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = pa; - pvt->Bstride = sstride; - pvt->srcoffset = s + leftPad; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - } - } else if (depth1 == 8 && depth2 == 8 && depth3 == 8) { - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = StoB; - pvt->Bstride = sstride; - pvt->srcoffset = s + leftPad; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - } - } else if (depth1 == 4 && depth2 == 4 && depth3 == 4) { - if (tec->fillOrder == xieValMSFirst) { - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0xf0; - (pvt++)->shift = 4; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = 1 + leftPad; - pvt->mask = 0xf0; - pvt->shift = 4; - } else { /* xieValLSFirst */ - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0xf0; - (pvt++)->shift = 4; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = 1 + leftPad; - pvt->mask = 0x0f; - pvt->shift = 0; - } - } else if (depth1 + depth2 + depth3 <= 8) { - CARD8 ones = 0xff,smask1,smask2,smask3,shift1,shift2,shift3; - if (tec->fillOrder == xieValMSFirst) { - smask1 = ~(ones>>depth1); - smask2 = ~(ones>>(depth1 + depth2) | smask1); - smask3 = ~(ones>>(depth1 + depth2 + depth3) | smask1 | smask2); - shift1 = 8 - depth1; - shift2 = 8 - (depth1 + depth2); - shift3 = 8 - (depth1 + depth2 + depth3); - } else { /* fillOrder == xieValLSFirst */ - smask3 = ~(ones<action = (depth1 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask1; - (pvt++)->shift = shift1; - pvt->action = (depth2 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask2; - (pvt++)->shift = shift2; - pvt->action = (depth3 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask3; - pvt->shift = shift3; - } else { - pvt->unaligned = TRUE; - } - } else { - pvt->unaligned = TRUE; - } - - /* Wasn't nicely aligned, do it the hard way */ - if (((miUncompPtr)pet->private)->unaligned) { - pvt->action = - ExtractTripleFuncs[(tec->pixelOrder == xieValLSFirst) ? 0 : 1] - [(tec->fillOrder == xieValLSFirst) ? 0 : 1] - [(depth1 <= 8) ? 0 : 1] - [(depth2 <= 8) ? 0 : 1] - [(depth3 <= 8) ? 0 : 1]; - } - pet->receptor->forward = miImportStream(flo,ped); - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeICPhotoUnTriple */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateICPhotoUncomByPixel(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; - miUncompPtr pvt = (miUncompPtr) (pet->private); - bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - bandPtr db0 = &pet->emitter[pvt[0].bandMap]; - bandPtr db1 = &pet->emitter[pvt[1].bandMap]; - bandPtr db2 = &pet->emitter[pvt[2].bandMap]; - CARD32 width = db0->format->width; - pointer src = NULL, dp0 = NULL, dp1 = NULL, dp2 = NULL; - - if (pvt->unaligned) { - CARD32 oldslen, nextslen; - void (*action)() = pvt->action; - CARD32 depth0 = db0->format->depth; - CARD32 depth1 = db1->format->depth; - CARD32 depth2 = db2->format->depth; - CARD32 stride = sbnd->format->stride; - - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - if((src = GetSrcBytes(flo,pet,sbnd,sbnd->current,nextslen,KEEP)) - && (dp0 = GetCurrentDst(flo,pet,db0)) && - (dp1 = GetCurrentDst(flo,pet,db1)) && - (dp2 = GetCurrentDst(flo,pet,db2))) - do { - - (*action)(src,dp0,dp1,dp2,width,pvt->bitOff,depth0,depth1,depth2, - stride); - - pvt->bitOff = pvt->bitOff + sbnd->format->pitch & 7; /* Set next */ - oldslen = (pvt->bitOff) ? nextslen - 1 : nextslen; - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - src = GetSrcBytes(flo,pet,sbnd,sbnd->current+oldslen,nextslen,KEEP); - dp0 = GetNextDst(flo,pet,db0,FLUSH); - dp1 = GetNextDst(flo,pet,db1,FLUSH); - dp2 = GetNextDst(flo,pet,db2,FLUSH); - } while(src && dp0 && dp1 && dp2); - } else { - CARD32 slen = sbnd->format->pitch+7>>3; - if((src = GetSrcBytes(flo,pet,sbnd,sbnd->current,slen,KEEP)) && - (dp0 = GetCurrentDst(flo,pet,db0)) && - (dp1 = GetCurrentDst(flo,pet,db1)) && - (dp2 = GetCurrentDst(flo,pet,db2))) - do { - - (*pvt[0].action)(src,dp0,width,&pvt[0]); - (*pvt[1].action)(src,dp1,width,&pvt[1]); - (*pvt[2].action)(src,dp2,width,&pvt[2]); - - src = GetSrcBytes(flo,pet,sbnd,sbnd->current+slen,slen,KEEP); - dp0 = GetNextDst(flo,pet,db0,FLUSH); - dp1 = GetNextDst(flo,pet,db1,FLUSH); - dp2 = GetNextDst(flo,pet,db2,FLUSH); - } while(src && dp0 && dp1 && dp2); - } - if(!src && sbnd->final && db0->current < db0->format->height) { - /* - * the client lied about the image size! - */ - if(raw->notify) - SendDecodeNotifyEvent(flo, ped, 0, xieValDecodeUncompressedTriple, - db0->format->width, db0->current, TRUE); - /* - * If the client didn't send enough data, we could zero-fill the - * remaining lines. Since we sent the "aborted" status, we won't - * bother (the protocol offers both choices). - */ - ValueError(flo,ped,db0->format->height, return(FALSE)); - } - if (!src || db0->final && db1->final && db2->final) { - /* free whatever we've used so far and - * set the threshold to one byte more than whatever is left over - */ - FreeData(flo, pet, sbnd, sbnd->final ? sbnd->maxGlobal : sbnd->current); - SetBandThreshold(sbnd, sbnd->available + 1); - } - return(TRUE); -} /* end ActivateICPhotoUncomByPixel */ -#endif /* XIE_FULL */ - -/* end module micphoto.c */ Index: xc/programs/Xserver/XIE/mixie/import/microi.c diff -u xc/programs/Xserver/XIE/mixie/import/microi.c:3.5 xc/programs/Xserver/XIE/mixie/import/microi.c:removed --- xc/programs/Xserver/XIE/mixie/import/microi.c:3.5 Fri Dec 14 14:58:27 2001 +++ xc/programs/Xserver/XIE/mixie/import/microi.c Sat Feb 28 21:41:59 2004 @@ -1,390 +0,0 @@ -/* $Xorg: microi.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module microi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - microi.c -- DDXIE import client roi element - - Dean Verheiden -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/microi.c,v 3.5 2001/12/14 19:58:27 dawes Exp $ */ - -#define _XIEC_MICROI - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include - -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeICROI(); - -/* - * routines used internal to this module - */ -static int CreateICROI(); -static int InitializeICROI(); -static int ActivateICROI(); -static int ResetICROI(); -static int DestroyICROI(); - -static void rectCvt(); - -/* - * DDXIE ImportClientROI entry points - */ -static ddElemVecRec ICROIVec = -{ - CreateICROI, - InitializeICROI, - ActivateICROI, - (xieIntProc)NULL, - ResetICROI, - DestroyICROI -}; - - -typedef struct _microidef { - XieRegionPtr roireg; - CARD32 currentRect; /* Current rectangle from input stream */ -} miCROIDefRec, *miCROIDefPtr; - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeICROI(flo,ped) -floDefPtr flo; -peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = ICROIVec; - return(TRUE); -} /* end miAnalyzeICROI */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateICROI(flo,ped) -floDefPtr flo; -peDefPtr ped; -{ - /* attach an execution context to the roi element definition */ - return MakePETex(flo,ped,sizeof(miCROIDefRec),NO_SYNC,NO_SYNC); -} /* end CreateICROI */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeICROI(flo,ped) -floDefPtr flo; -peDefPtr ped; -{ - xieFloImportClientROI *raw = (xieFloImportClientROI *)ped->elemRaw; - miCROIDefPtr rp = (miCROIDefPtr)ped->peTex->private; - XieRegionPtr miXieRegionCreate(); - - /* init icroi private data */ - if (!(rp->roireg = miXieRegionCreate((XieBoxRec *)NULL, - (int)raw->rectangles))) - AllocError(flo,ped, return(FALSE)); - - rp->currentRect = 0; - if (raw->rectangles > 1) - rp->roireg->data->numRects = raw->rectangles; - - return InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeICROI */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateICROI(flo,ped,pet) -floDefPtr flo; -peDefPtr ped; -peTexPtr pet; -{ - miCROIDefPtr rp = (miCROIDefPtr) pet->private; - bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - bandPtr dbnd = &pet->emitter[0]; - CARD32 maxRect = ((xieFloImportClientROI *)ped->elemRaw)->rectangles; - xieTypRectangle *irect = (xieTypRectangle*)GetSrcBytes(flo,pet,sbnd, - sbnd->current, sizeof(xieTypRectangle),KEEP); - XieBoxRec *rects, *br; - CARD32 yxbands, size; - ROIPtr roi; - - if(dbnd->final) { - /* the client is being over generous, quietly discard the extra data */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - - /* Stuff rectangles into XieBoxRec struct - */ - if (irect && maxRect == 1) { - rectCvt(irect,&rp->roireg->extents); - rp->currentRect++; - } else { - rects = (XieBoxRec *)&rp->roireg->data[1]; - br = &rects[rp->currentRect]; - while (irect && rp->currentRect < maxRect) { - rectCvt(irect,br++); - rp->currentRect++; - irect = (xieTypRectangle*)GetSrcBytes(flo,pet,sbnd, - sbnd->current + sizeof(xieTypRectangle), - sizeof(xieTypRectangle),KEEP); - } - } - - /* Ran out of rectangles, see if all have arrived - */ - if(!irect && sbnd->final || rp->currentRect >= maxRect) { - if(rp->currentRect < maxRect) { - /* the client lied about the number of rectangles! */ - ValueError(flo,ped,maxRect,return(FALSE)); - } else { /* All rectangles received, band them */ - Bool Overlap; - if (!miXieRegionValidate(rp->roireg,&Overlap)) - AllocError(flo,ped,return(FALSE)); /* Best guess */ - } - SetBandThreshold(sbnd,1); - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - } else if (!irect) { - /* free whatever we've used so far and - * set the threshold to one byte more than whatever is left over - */ - FreeData(flo,pet,sbnd,sbnd->current); - SetBandThreshold(sbnd,sbnd->available + 1); - return(TRUE); - } - - /* At this point, all rectangles are here and everything appears to be OK - */ - if (rp->roireg->data && rp->roireg->data->numRects) { - rects = (XieBoxRec *)&rp->roireg->data[1]; - maxRect = rp->roireg->data->numRects; - } else { /* Only one box */ - rects = &rp->roireg->extents; - maxRect = 1; - } - - /* Step through rectangles and count up the total number of (y-x) bands - */ - if (maxRect) { - CARD32 r = 1; - INT32 y = rects[0].y1; - - yxbands = 1; - while (1) { - while (r < maxRect && y == rects[r].y1) r++; - if (r == maxRect) break; - y = rects[r].y1; - yxbands++; - } - } else { - yxbands = 0; - } - - /* Allocate storage for run length table - */ - size = sizeof(ROIRec)+sizeof(lineRec)*yxbands+sizeof(runRec)*maxRect; - - if(!(roi = (ROIRec*)GetDstBytes(flo,pet,dbnd,0,size,FALSE))) - AllocError(flo,ped,return(FALSE)); - - roi->x = rp->roireg->extents.x1; - roi->y = rp->roireg->extents.y1; - roi->width = rp->roireg->extents.x2 - roi->x; - roi->height = rp->roireg->extents.y2 - roi->y; - roi->nrects = maxRect; - roi->lend = LEND(dbnd); - - /* Fill in the run lengths - */ - if (maxRect) { - CARD32 r = 1; - INT32 y = rects[0].y1; - linePtr lp = (linePtr)&roi[1]; - runPtr rp = (runPtr)&lp[1]; - - lp->y = rects[0].y1; - lp->nline = rects[0].y2 - rects[0].y1; - lp->nrun = 1; - rp->dstart = rects[0].x1 - roi->x; - (rp++)->length = rects[0].x2 - rects[0].x1; - - while (1) { - while (r < maxRect && y == rects[r].y1) { - rp->dstart = rects[r].x1 - rects[r-1].x2; - (rp++)->length = rects[r].x2 - rects[r].x1; - lp->nrun++; - r++; - } - if (r == maxRect) break; - - lp = (linePtr)rp; - rp = (runPtr)&lp[1]; - lp->y = rects[r].y1; - lp->nline = rects[r].y2 - rects[r].y1; - lp->nrun = 1; - rp->dstart = (CARD32)rects[r].x1 - (CARD32)roi->x; - (rp++)->length = rects[r].x2 - rects[r].x1; - y = rects[r++].y1; - } - } - - SetBandFinal(dbnd); - PutData(flo,pet,dbnd,size); - - return (TRUE); -} /* end ActivateICROI */ - -/*------------------------------------------------------------------------ -------------------------- rectangle to box converter --------------------- -------------------------------------------------------------------------*/ -static void rectCvt(irect,br) -xieTypRectangle *irect; -XieBoxRec *br; -{ - br->x1 = irect->x; - br->y1 = irect->y; - br->x2 = br->x1 + irect->width; - br->y2 = br->y1 + irect->height; -} - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetICROI(flo,ped) -floDefPtr flo; -peDefPtr ped; -{ - miCROIDefPtr rp = (miCROIDefPtr)ped->peTex->private; - - if (rp && rp->roireg) { - miXieRegionDestroy(rp->roireg); - rp->roireg = (XieRegionPtr)NULL; - } - ResetReceptors(ped); - ResetEmitter(ped); - return TRUE; -} /* end ResetICROI */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyICROI(flo,ped) -floDefPtr flo; -peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return TRUE; -} /* end DestroyICROI */ - -/* end module microi.c */ Index: xc/programs/Xserver/XIE/mixie/import/midraw.c diff -u xc/programs/Xserver/XIE/mixie/import/midraw.c:3.6 xc/programs/Xserver/XIE/mixie/import/midraw.c:removed --- xc/programs/Xserver/XIE/mixie/import/midraw.c:3.6 Fri Dec 14 14:58:27 2001 +++ xc/programs/Xserver/XIE/mixie/import/midraw.c Sat Feb 28 21:41:59 2004 @@ -1,624 +0,0 @@ -/* $Xorg: midraw.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module midraw.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - midraw.c -- DDXIE prototype import drawable element - - Larry Hare -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/midraw.c,v 3.6 2001/12/14 19:58:27 dawes Exp $ */ - -#define _XIEC_IDRAW -#define _XIEC_MIDRAW - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - - -DrawablePtr ValDrawable(); - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeIDraw(); - -/* - * routines used internal to this module - */ -static int CreateIDraw(); -static int InitializeIDraw(); -static int ActivateIDrawStrip(); -static int ActivateIDrawAlign(); -static int ActivateIDrawP(); -static int ResetIDraw(); -static int DestroyIDraw(); - -static void adjustStride4to8(); -static void adjustStride24to32(); - -static Bool XIEGetImage(); - - -/* - * DDXIE ImportDrawable && ImportDrawablePlane entry points - */ -static ddElemVecRec miDrawVec = { - CreateIDraw, - InitializeIDraw, - ActivateIDrawStrip, - (xieIntProc)NULL, - ResetIDraw, - DestroyIDraw - }; - -static ddElemVecRec miDrawPVec = { - CreateIDraw, - InitializeIDraw, - ActivateIDrawP, - (xieIntProc)NULL, - ResetIDraw, - DestroyIDraw - }; - -typedef struct _midraw { - RegionPtr pExposed; - RegionRec Exposed; - xieVoidProc adjust; -} miDrawRec, *miDrawPtr; - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeIDraw(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = miDrawVec; - return(TRUE); -} /* end miAnalyzeIDraw */ - -int miAnalyzeIDrawP(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = miDrawPVec; - return(TRUE); -} /* end miAnalyzeIDrawP */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateIDraw(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, sizeof(miDrawRec), NO_SYNC, NO_SYNC); -} /* end CreateIDraw */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeIDraw(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - iDrawDefPtr dix = (iDrawDefPtr) ped->elemPvt; - miDrawPtr ddx = (miDrawPtr) ped->peTex->private; - formatPtr sf = &ped->inFloLst[SRCtag].format[0]; - formatPtr df = &ped->outFlo.format[0]; - BOOL notify; - - if(((xieFloImportDrawable*)ped->elemRaw)->elemType==xieElemImportDrawable) { - Bool adj_stride = sf->stride != df->stride; - Bool adj_pitch = sf->pitch != df->pitch; - - if(adj_stride || adj_pitch) { - ped->ddVec.activate = ActivateIDrawAlign; - - if(adj_stride) { - if(sf->stride == 24 && df->stride == 32) - ddx->adjust = adjustStride24to32; - - else if(sf->stride == 4 && df->stride == 8) - ddx->adjust = adjustStride4to8; - - /* add more adjustment routines as required */ - } - } else { - ped->ddVec.activate = ActivateIDrawStrip; - } - notify = ((xieFloImportDrawable*)ped->elemRaw)->notify; - } else - notify = ((xieFloImportDrawablePlane*)ped->elemRaw)->notify; - - if(notify && dix->pDraw->type != DRAWABLE_PIXMAP) { - ddx->pExposed = &ddx->Exposed; - REGION_INIT(dix->pDraw->pScreen, ddx->pExposed, NullBox, 0); - } - /* note: ImportResource elements don't use their receptors */ - return InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeIDraw */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateIDrawAlign(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportDrawable *raw = (xieFloImportDrawable *) ped->elemRaw; - miDrawPtr ddx = (miDrawPtr) pet->private; - bandPtr bnd = &pet->emitter[0]; - DrawablePtr pDraw = ValDrawable(flo,ped,raw->drawable); - char *dst = (char*)GetCurrentDst(flo,pet,bnd); - CARD16 width = bnd->format->width; - - if(!pDraw || !dst) return FALSE; - - do { - if(!XIEGetImage(pDraw, /* drawable */ - (CARD16) raw->srcX, /* drawable-x */ - (CARD16)(raw->srcY+bnd->current), /* drawable-y */ - (CARD16) width, (CARD16)1, /* width, height */ - (CARD32)ZPixmap, /* data format */ - (CARD32)~0, /* plane mask */ - dst, /* data buffer */ - raw->fill, /* augment */ - ddx->pExposed /* accumulate */ - )) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - if(ddx->adjust) - (*ddx->adjust)(dst, width); - - } while(dst = (char*)GetNextDst(flo,pet,bnd,FLUSH)); - - return TRUE; -} /* end ActivateIDrawAlign */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateIDrawStrip(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportDrawable *raw = (xieFloImportDrawable *) ped->elemRaw; - miDrawPtr ddx = (miDrawPtr) pet->private; - bandPtr bnd = &pet->emitter[0]; - char *dst; - DrawablePtr pDraw; - - if (!(pDraw = ValDrawable(flo,ped,raw->drawable))) - return FALSE; - - if (!(dst = (char*)GetCurrentDst(flo,pet,bnd))) - return FALSE; - - if(!XIEGetImage( pDraw, /* drawable */ - (CARD16) raw->srcX, /* drawable-x */ - (CARD16)(raw->srcY+bnd->minLocal), /* drawable-y */ - (CARD16)(bnd->format->width), /* width */ - (CARD16)(bnd->strip->length), /* height */ - (CARD32)ZPixmap, /* data format */ - (CARD32)~0, /* plane mask */ - dst, /* data buffer */ - raw->fill, /* augment */ - ddx->pExposed /* accumulate */ - )) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - - PutData(flo,pet,bnd,bnd->maxLocal); - - return TRUE; -} /* end ActivateIDrawStrip */ - -static int ActivateIDrawP(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportDrawablePlane *raw = (xieFloImportDrawablePlane *) ped->elemRaw; - miDrawPtr ddx = (miDrawPtr) pet->private; - bandPtr bnd = &pet->emitter[0]; - char *dst; - DrawablePtr pDraw; - - if (!(pDraw = ValDrawable(flo,ped,raw->drawable))) - return FALSE; - - if(!(dst = (char*)GetCurrentDst(flo,pet,bnd))) - return FALSE; - - if(!XIEGetImage( pDraw, /* drawable */ - (CARD16)(raw->srcX), /* drawable-x */ - (CARD16)(raw->srcY+bnd->minLocal), /* drawable-y */ - (CARD16)(bnd->format->width), /* width */ - (CARD16)(bnd->strip->length), /* height */ - (CARD32)XYPixmap, /* data format */ - raw->bitPlane, /* plane mask */ - dst, /* data buffer */ - raw->fill, /* augment */ - ddx->pExposed /* accumulate */ - )) - DrawableError(flo,ped,raw->drawable, return(FALSE)); - -#if (BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER) - { - int nb = bnd->pitch * bnd->strip->length; - while (nb--) *dst++ = (char)_ByteReverseTable[*dst]; - } -#endif - - PutData(flo,pet,bnd,bnd->maxLocal); - - return TRUE; -} /* end ActivateIDrawP */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static void FlushExposeEvents(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloImportDrawablePlane *raw = (xieFloImportDrawablePlane *) ped->elemRaw; - miDrawPtr pvt = (miDrawPtr) ped->peTex->private; - - if (pvt->pExposed) { - RegionPtr rp = pvt->pExposed; - DrawablePtr pDraw = ValDrawable(flo,ped,raw->drawable); - int numrects = REGION_NUM_RECTS(rp); - - if (pDraw) { - if (numrects > 0 && !ferrCode(flo) && !flo->flags.aborted) { - BoxPtr rects = REGION_RECTS(rp); - - /* if numrects is large, send 1 event for extents ?? */ - for ( ; numrects > 0; numrects--, rects++) { - SendImportObscuredEvent(flo,ped,raw->drawable, - rects->x1, - rects->y1, - rects->x2 - rects->x1, - rects->y2 - rects->y1); - } - } - REGION_UNINIT(pDraw->pScreen, rp); - } /* else Memory Leak */ - pvt->pExposed = NullRegion; - } -} /* end FlushExposeEvents */ - - -static int ResetIDraw(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - FlushExposeEvents(flo,ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetIDraw */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyIDraw(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyIDraw */ - -/*------------------------------------------------------------------------ ---- similar to GetGCAndDrawableAndValidate (from extension.h) --- ---- made callable because the macro version returned standard X errors --- -------------------------------------------------------------------------*/ -DrawablePtr ValDrawable(flo,ped,draw_id) - floDefPtr flo; - peDefPtr ped; - Drawable draw_id; -{ - register ClientPtr client = flo->runClient; - register DrawablePtr draw; - - if (client->clientGone) return(NULL); - - if (client->lastDrawableID != draw_id) { - draw = (DrawablePtr)LookupIDByClass(draw_id, RC_DRAWABLE); - if (draw->type == UNDRAWABLE_WINDOW) - MatchError(flo,ped, return(NULL)); - - client->lastDrawable = draw; - client->lastDrawableID = draw_id; - } else { - draw = client->lastDrawable; - } - if(!draw) { - client->errorValue = draw_id; - DrawableError(flo,ped,draw_id, return(NULL)); - } - return draw; -} /* end ValDrawable */ - - -/* -** In order to support 'fill' and 'expose events' we must layer some -** code on top of the normal screen GetImage procedure. Use the defined -** backing store interface that aid's in copy expose processing, to try -** to knowingly recover backing store. Keep track of remaining regions -** which were not visible or in backing store. Always fill such leftover -** regions, and queue them up for later expose event processing. -*/ - -static Bool -XIEGetImage (pDrawable, sx, sy, w, h, format, pmask, pdst, fill, Exposed) - DrawablePtr pDrawable; - CARD16 sx, sy, w, h; - CARD32 format; - CARD32 pmask; - char *pdst; - CARD32 fill; - RegionPtr Exposed; -{ - ScreenPtr pScreen = pDrawable->pScreen; - BoxRec bounds; - unsigned char depth; - - if(pDrawable->type != DRAWABLE_PIXMAP && (sx + w > pDrawable->width || - sy + h > pDrawable->height)) - return(FALSE); - - if(pDrawable->type != DRAWABLE_PIXMAP && - ((WindowPtr)pDrawable)->visibility != VisibilityUnobscured) { - PixmapPtr pPixmap; - GCPtr pGC; - WindowPtr pWin, pSrcWin; - RegionRec Remaining; - BoxPtr pBox; - int i; - int x, y; - xRectangle *pRect; - int numRects; - - pWin = (WindowPtr) pDrawable; - pPixmap = 0; - depth = pDrawable->depth; - bounds.x1 = sx + pDrawable->x; - bounds.y1 = sy + pDrawable->y; - bounds.x2 = bounds.x1 + w; - bounds.y2 = bounds.y1 + h; - REGION_INIT(pScreen, &Remaining, &bounds, 0); - if (!(pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, depth))) - goto punt; - if(!(pGC = GetScratchGC (depth, pScreen))) { - (*pScreen->DestroyPixmap) (pPixmap); - goto punt; - } - if (pWin->viewable && - RECT_IN_REGION(pScreen, &Remaining, - REGION_EXTENTS(pScreen, &pWin->borderSize)) != rgnOUT) { - XID subWindowMode = IncludeInferiors; - ChangeGC (pGC, GCSubwindowMode, &subWindowMode); - ValidateGC ((DrawablePtr)pPixmap, pGC); - pSrcWin = (WindowPtr) pDrawable; - x = sx; - y = sy; - if (pSrcWin->parent) { - x += pSrcWin->origin.x; - y += pSrcWin->origin.y; - pSrcWin = pSrcWin->parent; - } - (*pGC->ops->CopyArea) ((DrawablePtr)pSrcWin, - (DrawablePtr)pPixmap, pGC, - x, y, w, h, - 0, 0); - REGION_SUBTRACT(pScreen, &Remaining, &Remaining, - &((WindowPtr) pDrawable)->borderClip); - if (REGION_NUM_RECTS(&Remaining) == 0) goto done; - } - REGION_TRANSLATE(pScreen, &Remaining, - -pWin->drawable.x, -pWin->drawable.y); - - /* Copy in Backstore now */ - if (pWin->backStorage) { - (*pWin->drawable.pScreen->ExposeCopy) (pWin, - (DrawablePtr)pPixmap, - pGC, &Remaining, - sx, sy, - 0, 0, - 0); - - } - - /* Fill in Remaining Area now */ - ChangeGC (pGC, GCForeground, &fill); - ValidateGC ((DrawablePtr)pPixmap, pGC); - numRects = REGION_NUM_RECTS(&Remaining); - pBox = REGION_RECTS(&Remaining); - pRect = (xRectangle *)ALLOCATE_LOCAL(numRects * sizeof(xRectangle)); - if (pRect) { - for (i = numRects; --i >= 0; pBox++, pRect++) { - pRect->x = pBox->x1 - sx; - pRect->y = pBox->y1 - sy; - pRect->width = pBox->x2 - pBox->x1; - pRect->height = pBox->y2 - pBox->y1; - } - pRect -= numRects; - (*pGC->ops->PolyFillRect) ((DrawablePtr)pPixmap, pGC, - numRects, pRect); - DEALLOCATE_LOCAL (pRect); - } - - /* Accumulate Exposures if requested */ - if (REGION_NUM_RECTS(&Remaining) > 0) { - if (Exposed) { - REGION_UNION(pScreen, Exposed, Exposed, &Remaining); - } - } - -done: - REGION_UNINIT(pScreen, &Remaining); - (*pScreen->GetImage) ((DrawablePtr) pPixmap, 0, 0, w, h, - format, pmask, pdst); - (*pScreen->DestroyPixmap) (pPixmap); - FreeScratchGC (pGC); - } - else - { -punt: ; - (*pScreen->GetImage) (pDrawable, sx, sy, w, h, - format, pmask, pdst); - } - return(TRUE); -} - -static void adjustStride24to32(buf,width) - char *buf; - CARD32 width; -{ - register BytePixel *ip = (BytePixel*)(&buf[3 * width]); - register QuadPixel *op = (QuadPixel*)(&buf[4 * width]); - int i; - - for(i = width; i; --i) -#if (IMAGE_BYTE_ORDER == LSBFirst && IMAGE_BYTE_ORDER == BITMAP_BIT_ORDER || IMAGE_BYTE_ORDER == MSBFirst && IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER) - { ip -= 3; *(--op) = (int)ip[2]<<16 | (int)ip[1]<<8 | (int)ip[0]; } -#else - { ip -= 3; *(--op) = (int)ip[0]<<16 | (int)ip[1]<<8 | (int)ip[2]; } -#endif -} - -static void adjustStride4to8(buf,width) - char *buf; - CARD32 width; -{ - register BytePixel *ip = (BytePixel*)(&buf[1 * width]); - register BytePixel *op = (BytePixel*)(&buf[2 * width]); - int i; - - for(i = width; i; --i) -#if (IMAGE_BYTE_ORDER == LSBFirst && IMAGE_BYTE_ORDER == BITMAP_BIT_ORDER || IMAGE_BYTE_ORDER == MSBFirst && IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER) - { *(--op) = *(--ip) & (BytePixel)0x0f; *(--op) = *ip >> 4; } -#else - { *(--op) = *(--ip) >> 4; *(--op) = *ip & (BytePixel)0x0f; } -#endif -} - - -/* end module midraw.c */ Index: xc/programs/Xserver/XIE/mixie/import/mifax.c diff -u xc/programs/Xserver/XIE/mixie/import/mifax.c:3.5 xc/programs/Xserver/XIE/mixie/import/mifax.c:removed --- xc/programs/Xserver/XIE/mixie/import/mifax.c:3.5 Fri Dec 14 14:58:27 2001 +++ xc/programs/Xserver/XIE/mixie/import/mifax.c Sat Feb 28 21:41:59 2004 @@ -1,581 +0,0 @@ -/* $Xorg: mifax.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mifax.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mifax.c -- DDXIE prototype import client photo and - import photomap element, portions specific - to FAX decompression - - Ben Fahy -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/mifax.c,v 3.5 2001/12/14 19:58:27 dawes Exp $ */ - -#define _XIEC_MICPHOTO -#define _XIEC_ICPHOTO -#define _XIEC_MIPHOTO -#define _XIEC_IPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -/* XXX - this should be cleaned up. */ -#include "../fax/faxint.h" - -/* - * routines referenced by other DDXIE modules - */ -int CreateICPhotoFax(); -int InitializeICPhotoFax(); -int InitializeIPhotoFax(); -int ActivateICPhotoFax(); -int ResetICPhotoFax(); -int DestroyICPhotoFax(); - - -extern bandMsk miImportStream(); - -/* - * Local Declarations - */ - -static int common_init(); - - -#define LENIENCY_LIMIT 16 - -#define MAX_STRIPS_INC 20 -typedef struct _faxpvt { - FaxState state; - int width,height; /* not strictly necessary, but handy */ - int max_strips; /* how many we've allocated space for */ - int n_strips; /* how many strips we've seen so far */ - int next_byte; /* next input byte we are looking for */ - int max_lines; /* maximum number of lines/output strip */ - char **o_lines; /* array of pointers to output lines */ - int (*decodptr)(); /* function used to decode the data */ - xieTypOrientation encodedOrder; - int notify; /* (ICP) we might have to send an event */ - int normal; /* if not, swap the output bit order */ - photomapPtr map; /* (IP) just in case we need it */ - unsigned char *buf; /* in case we have to bit reverse src */ - int bufsize; /* buffer size has to vary with input */ - /* strip size, alas and alak. :-( */ - xieTypDecodeTechnique technique; -} faxPvtRec, *faxPvtPtr; - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -int CreateICPhotoFax(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo,ped, sizeof(faxPvtRec), NO_SYNC, NO_SYNC); -} /* end CreateICPhotoFax */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeIPhotoFax(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; -peTexPtr pet = ped->peTex; -faxPvtPtr texpvt=(faxPvtPtr) pet->private; -bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - - if (!common_init(flo,ped,(pointer)map->tecParms,map->technique)) - return(0); - - texpvt->map = map; /* can be used as flag in Activate routine */ - - return( - ImportStrips(flo,pet,&pet->receptor[0].band[0],&map->strips[0]) - ); -} /* end InitializeIPhotoFax */ -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeICPhotoFax(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *) ped->elemRaw; -peTexPtr pet = ped->peTex; -faxPvtPtr texpvt = (faxPvtPtr) pet->private; - - if( !common_init(flo,ped,(pointer) &raw[1],raw->decodeTechnique) ) - return(0); - - texpvt->notify = raw->notify; - return(1); -} /* end InitializeICPhotoFax */ -/*------------------------------------------------------------------------ -------- lots of stuff shared between ICPhoto and IPhoto. . . ------------- -------------------------------------------------------------------------*/ -static int common_init(flo,ped,tec,technique) -floDefPtr flo; -peDefPtr ped; -pointer tec; /* we won't know the type until later */ -xieTypDecodeTechnique technique; - /* (but we can get it from this :-) */ -{ -peTexPtr pet = ped->peTex; -faxPvtPtr texpvt = (faxPvtPtr) pet->private; -formatPtr inf = pet->receptor[IMPORT].band[0].format; -int pbytes; - -/* Start over with clean structure */ - bzero(texpvt,sizeof(faxPvtRec)); - - -/* Now start adding what we know */ - texpvt->width = inf->width; - texpvt->height = inf->height; - texpvt->state.width = inf->width; - /* nice thing about using receptor format is that it doesn't matter */ - /* whether you are importing from a client or a photomap */ - - switch(texpvt->technique = technique) { - case xieValDecodeG31D: - { - xieTecDecodeG31D *tecG31D=(xieTecDecodeG31D *) tec; - texpvt->decodptr = decode_g31d; - texpvt->encodedOrder = tecG31D->encodedOrder; - texpvt->state.goal = FAX_GOAL_SkipPastAnyToEOL; - texpvt->state.radiometric = tecG31D->radiometric; - texpvt->normal = tecG31D->normal; - } - break; - case xieValDecodeG32D: - { - xieTecDecodeG32D *tecG32D=(xieTecDecodeG32D *) tec; - texpvt->decodptr = decode_g32d; - texpvt->encodedOrder = tecG32D->encodedOrder; - texpvt->state.goal = FAX_GOAL_SeekEOLandTag; - texpvt->state.radiometric = tecG32D->radiometric; - texpvt->normal = tecG32D->normal; - } - break; - case xieValDecodeG42D: - { - xieTecDecodeG42D *tecG42D=(xieTecDecodeG42D *) tec; - texpvt->decodptr = decode_g4; - texpvt->encodedOrder = tecG42D->encodedOrder; - texpvt->state.goal = FAX_GOAL_StartNewLine; - texpvt->state.radiometric = tecG42D->radiometric; - texpvt->normal = tecG42D->normal; - } - break; - case xieValDecodeTIFF2: - { - xieTecDecodeTIFF2 *tecTIFF2=(xieTecDecodeTIFF2 *) tec; - texpvt->decodptr = decode_tiff2; - texpvt->encodedOrder = tecTIFF2->encodedOrder; - texpvt->state.goal = FAX_GOAL_StartNewLine; - texpvt->state.radiometric = tecTIFF2->radiometric; - texpvt->normal = tecTIFF2->normal; - } - break; - case xieValDecodeTIFFPackBits: - { - xieTecDecodeTIFFPackBits *tecTIFFPackBits= - (xieTecDecodeTIFFPackBits *)tec; - texpvt->decodptr = decode_tiffpb; - texpvt->encodedOrder = tecTIFFPackBits->encodedOrder; - texpvt->state.goal = PB_GOAL_StartNewLine; - texpvt->normal = tecTIFFPackBits->normal; - } - break; - } - texpvt->state.a0_color = WHITE; - texpvt->state.a0_pos = (-1); - -/* things that are zero don't really need to be initialized - consider - * these comments. - */ - texpvt->state.magic_needs = 0; - texpvt->state.strip_state = StripStateNone; - texpvt->state.strip = 0; - texpvt->state.strip_size = 0; - texpvt->state.final = 0; - texpvt->state.o_line = 0; - -/* - * Things that do need to be initialized - */ - texpvt->state.write_data = 1; - texpvt->max_strips = MAX_STRIPS_INC; - - -/* the following must be freed explicitly */ - - texpvt->state.old_trans = (int *) XieMalloc(texpvt->width * sizeof(int)); - if (!texpvt->state.old_trans) AllocError(flo,ped, return(FALSE)); - - texpvt->state.new_trans = (int *) XieMalloc(texpvt->width * sizeof(int)); - if (!texpvt->state.new_trans) AllocError(flo,ped, return(FALSE)); - -/* - * I suppose this will make Bob mad at me, but... how else do I - * figure out the output map size? - */ - - pbytes = (ped->outFlo.format[0].pitch + 7) >> 3; - - texpvt->max_lines = flo->floTex->stripSize / pbytes; - - if (!texpvt->max_lines) - texpvt->max_lines++; - -/* see if data manager should forward our input data to downstream elements */ - pet->receptor[IMPORT].forward = miImportStream(flo,ped); - -/* set output emitter to map texpvt->max_lines lines of data */ - return( InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, texpvt->max_lines, NO_INPLACE) ); - -} /* end common_init() */ -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -int ActivateICPhotoFax(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - bandPtr dbnd = &pet->emitter[0]; - faxPvtPtr texpvt = (faxPvtPtr) ped->peTex->private; - FaxState *state = &(texpvt->state); - BytePixel *src, *dst; - int lines_found; - Bool ok, aborted; - int (*decodptr)() = texpvt->decodptr; - - -/* - * get current input and output strips - */ - if (dbnd->final && dbnd->current >= dbnd->format->height) { - /* be forgiving if extra data gets passed to us */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - - /* - * Important! As long as there is source data available, we'd better - * deal with it, because it may be owned by Core X and will die if we - * let the scheduler go away. It's ok to exit with TRUE to let an - * output strip be written (we'll be called back). It is death to - * exit with FALSE unless we are absolutely sure we are done with all - * current input strips. - */ - - /* - * Note that state->strip holds the current src strip. We only get - * more bytes when we are done with a strip and need another one - * (or if we are just starting) - */ - if (!state->strip) { - src = (BytePixel*)GetSrcBytes(flo,pet,sbnd,sbnd->current,1,KEEP); - - state->strip_state = StripStateNew; - state->strip_size = sbnd->maxLocal - sbnd->minLocal; - state->final = sbnd->strip ? sbnd->strip->final : sbnd->final; - - if (texpvt->encodedOrder == xieValMSFirst) - state->strip = src; - else { - /* to avoid rewriting a zillion macros, we arbitrarily pick MSFirst - as the encode/decode format. Byte Reversal of the small amount - of compressed data is almost always going to take trivial time. - The only nasty part is, the input strip cannot be corrupted so - we have to copy to a buffer, whose size may be variable since - this is stream data (not canonical). - */ - register int i,size=state->strip_size; - register unsigned char *flipped; - - if ( AlterSrc(flo,ped,sbnd->strip) ) - flipped = src; - else { - /* make sure buffer is big enough to hold data */ - if (!texpvt->buf) { - texpvt->buf = (unsigned char *) XieMalloc(size); - if (!texpvt->buf) - AllocError(flo,ped, return(FALSE)); - } - else if (texpvt->bufsize < size) { - texpvt->buf = (unsigned char *) XieRealloc(texpvt->buf,size); - if (!texpvt->buf) - AllocError(flo,ped, return(FALSE)); - } - texpvt->bufsize = size; - flipped = texpvt->buf; - } - - for (i=0; istrip = flipped; - } - } - /* - * We have some data to decode, anything to write to? - */ - while (dst = (BytePixel*)GetDst(flo,pet,dbnd,state->o_line,KEEP)) { - - - /* - * Now, as much as I'd like to use our nifty line-oriented macros, - * it would kill performance. So instead we ask the decoder to - * decode as much as remains in the output line as it can get. - * We ask the data manager to map all the lines of data in the - * current output strip to a convenient array. - */ - - state->nl_sought = dbnd->maxLocal - state->o_line; - - ok = MapData(flo,pet,dbnd,0,dbnd->current,state->nl_sought,KEEP); - /* map desired lines into an array starting at 0 */ - if (!ok) - ImplementationError(flo,ped, return(FALSE)); - - state->o_lines = (char **) dbnd->dataMap; - - lines_found = (*decodptr)(state); - if (lines_found < 0) { - /* decoder hit unknown error. Pass error code to client */ - ValueError(flo,ped,(state->o_line + (state->decoder_done << 16)), - return(FALSE)); - } else { - if (!texpvt->normal) { - /* have to swap bit order on output */ - int pbytes = (ped->outFlo.format[0].pitch + 7) >> 3; - register int i; - for (i=0; idataMap[i]; - register int size=pbytes; - while (size--) - { - *ucp = _ByteReverseTable[*ucp]; - ucp++; - } - } - } - state->o_line += lines_found; - if (PutData(flo,pet,dbnd,state->o_line)) - return(TRUE); - } - if (state->decoder_done) { - /* Decoders sometimes return errors near the end of an image. - Don't report an error if we got almost all the lines we wanted. - */ - if (state->decoder_done > FAX_DECODE_DONE_OK) { - aborted = state->o_line + LENIENCY_LIMIT < texpvt->height; - - if(texpvt->notify && (texpvt->height != state->o_line || - texpvt->width != state->width)) { - SendDecodeNotifyEvent(flo, ped, 0, texpvt->technique, - state->width, state->o_line, aborted); - } - if (aborted) { - ValueError(flo, ped, (state->o_line + (state->decoder_done<<16)), - return(FALSE)); - } else if(state->o_line < texpvt->height) { - int bytes = (ped->outFlo.format[0].pitch + 7) >> 3; - - while(dst = ((BytePixel*) - GetDst(flo,pet,dbnd,state->o_line++,KEEP))) { - memset(dst, state->radiometric ? 0xff: 0, bytes); - PutData(flo,pet,dbnd,state->o_line); - } - break; - } - } - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - break; - } - - if (state->magic_needs) { - /* decoder needs a new strip */ - if (state->strip_state != StripStateDone) { - ImplementationError(flo,ped, return(FALSE)); - } - FreeData(flo,pet,sbnd,sbnd->maxLocal); - - texpvt->state.strip_state = StripStateNone; - texpvt->state.strip = 0; - texpvt->state.strip_size = 0; - - if (!state->final) - break; - else - state->strip_state = StripStateNoMore; - /* need to live with what you've got */ - } - } /* end of while(dst = ...) */ - /* - * No more dst or need another src strip? three possible reasons: - * - * 1: we're done with output image. Just shut down and be happy - * 2: scheduler has noticed a downstream element can run. In this - * case, we should be a good guy and return TRUE so the scheduler - * gives us back control again later (without going back to Core - * X, which would cause our input strip to vanish). - * 3: we ran out of src. - */ - if (!dst && dbnd->final) { - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - } - SetBandThreshold(sbnd, !dst ? 1 : sbnd->available + 1); - - /* - * if here, we ran out of src. Scheduler will wake us up again - * when a PutClientData request comes along. - */ - return TRUE; -} /* end ActivateICPhotoFax */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -int ResetICPhotoFax(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - - /* get rid of the peTex structures malloc'd by Initialize */ - if(ped->peTex) { - faxPvtPtr texpvt = (faxPvtPtr) ped->peTex->private; - - /* only have to nuke parts of private structure which were malloc'd */ - if (texpvt->state.old_trans) - texpvt->state.old_trans = (int *)XieFree(texpvt->state.old_trans); - if (texpvt->state.new_trans) - texpvt->state.new_trans = (int *)XieFree(texpvt->state.new_trans); - if (texpvt->buf) - texpvt->buf = (unsigned char *)XieFree(texpvt->buf); - } - return(TRUE); -} /* end ResetICPhotoFax */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -int DestroyICPhotoFax(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - if(ped->peTex) { - ped->peTex = (peTexPtr) XieFree(ped->peTex); - } - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.flush = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyICPhoto */ - -/* end module mifax.c */ Index: xc/programs/Xserver/XIE/mixie/import/mijpeg.c diff -u xc/programs/Xserver/XIE/mixie/import/mijpeg.c:3.7 xc/programs/Xserver/XIE/mixie/import/mijpeg.c:removed --- xc/programs/Xserver/XIE/mixie/import/mijpeg.c:3.7 Fri Dec 14 14:58:28 2001 +++ xc/programs/Xserver/XIE/mixie/import/mijpeg.c Sat Feb 28 21:41:59 2004 @@ -1,626 +0,0 @@ -/* $Xorg: mijpeg.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module mijpeg.c ****/ -/****************************************************************************** -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mijpeg.c -- DDXIE import photomap element, portions - specific to JPEG decompression - - Ben Fahy -- AGE Logic, Inc. Oct, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/mijpeg.c,v 3.7 2001/12/14 19:58:28 dawes Exp $ */ - -#define _XIEC_MIPHOTO -#define _XIEC_IPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ - -#ifndef XIE -#define XIE -#endif - -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int CreateIPhotoJpegBase(); -int InitializeIPhotoJpegBase(); -int InitializeICPhotoJpegBase(); -int ActivateIPhotoJpegBase(); -int ResetIPhotoJpegBase(); -int DestroyIPhotoJpegBase(); - - -extern bandMsk miImportStream(); - -/* - * Local Declarations - */ - -static int common_init(); -static int sub_fun(); -typedef struct _jpeg_decode_pvt { - - int (*decodptr)(); /* function used to decode the data */ - int format_checked; /* have to wait until JPEG header read */ - - xieTypDataClass dataClass; /* SingleBand or TripleBand */ - int colors_smushed; /* if color and interleave = False */ - int in_bands; /* bands of input (from photomap) data */ - int out_bands; /* bands of output data */ - int swizzle; /* true if bandOrder is MSFirst */ - int notify; /* in case the client wants an event */ - photomapPtr map; /* for ImportPhotomap only */ - - xieTecDecodeJPEGBaseline *decodeParams; /* decoding parameters */ - - /* the following are used by JPEG private routines */ - struct Decompress_methods_struct dc_methods; - struct External_methods_struct e_methods; - - /* we potentially need one of the following per band */ - JpegDecodeState state[3]; - struct Decompress_info_struct cinfo[3]; - char ibuffer[3][JPEG_BUF_SIZE + MIN_UNGET]; - -} jpegPvtRec, *jpegPvtPtr; - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -int CreateIPhotoJpegBase(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo,ped, sizeof(jpegPvtRec), NO_SYNC, NO_SYNC); -} /* end CreateIPhotoJpegBase */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeIPhotoJpegBase(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - xieTecDecodeJPEGBaseline *tec = (xieTecDecodeJPEGBaseline *) map->tecParms; - xieFloImportPhotomap *raw = (xieFloImportPhotomap *)ped->elemRaw; - int in_bands = ped->inFloLst[SRCtag].bands; /* # of input bands */ - peTexPtr pet = ped->peTex; - jpegPvtPtr texpvt = (jpegPvtPtr) pet->private; - bandPtr bnd = pet->receptor[IMPORT].band; - - if(!common_init(flo,ped,map->dataClass,tec,raw->notify)) - return(FALSE); - - texpvt->map = map; - /* has to come after common_init, which bzeros texpvt */ - - return(ImportStrips(flo, pet, &bnd[0], &map->strips[0]) && - (in_bands == 1 ? TRUE : - ImportStrips(flo, pet, &bnd[1], &map->strips[1]) && - ImportStrips(flo, pet, &bnd[2], &map->strips[2]))); -} /* end InitializeIPhotoJpegBase */ - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -int InitializeICPhotoJpegBase(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -xieFloImportClientPhoto *raw = (xieFloImportClientPhoto *)ped->elemRaw; -xieTecDecodeJPEGBaseline *tec= (xieTecDecodeJPEGBaseline*)&raw[1]; - - return (common_init(flo,ped,raw->class,tec,raw->notify) ); - -} /* end InitializeICPhotoJpegBase */ -/*------------------------------------------------------------------------ ------------------------ shared initialization code ---------------------- -------------------------------------------------------------------------*/ -static int common_init(flo,ped,class,tec,notify) - floDefPtr flo; - peDefPtr ped; - xieTypDataClass class; - xieTecDecodeJPEGBaseline *tec; - int notify; -{ - peTexPtr pet = ped->peTex; - jpegPvtPtr texpvt = (jpegPvtPtr) pet->private; - int pbytes; - int out_bands = ped->outFlo.bands; /* # of output bands */ - int in_bands = ped->inFloLst[SRCtag].bands; /* # of input bands */ - int lines_in_output_strip; /* max number of lines/output strip*/ - int b; - - /*** every time we rerun the element, have to reset it ***/ - - bzero(texpvt,sizeof(jpegPvtRec)); - /* this does 99% of what we want */ - - /*** do generic stuff first ***/ - texpvt->in_bands = in_bands; - texpvt->out_bands = out_bands; - texpvt->dataClass = class; - texpvt->decodeParams = tec; - texpvt->notify = notify; - - if(in_bands != out_bands) { /* ie, if photo has 1 band, output 3 */ - texpvt->colors_smushed = 1; - texpvt->decodptr = decode_jpeg_lossy_color; - } else { /* SingleBand or TripleBand-BandByPlane */ - texpvt->colors_smushed = 0; - texpvt->decodptr = decode_jpeg_lossy_gray; - } - texpvt->swizzle = tec->bandOrder == xieValMSFirst; - - /* Now for every input (photomap) band, we need to set up state stuff */ - for (b=0; b < in_bands; ++b) { - JpegDecodeState *state = &(texpvt->state[b]); - - state->goal = JPEG_DECODE_GOAL_Startup; - state->up_sample = tec->upSample; - state->dc_methods = &texpvt->dc_methods; - state->e_methods = &texpvt->e_methods; - state->cinfo = &texpvt->cinfo[b]; - state->needs_input_strip = 1; - state->cinfo->input_buffer = texpvt->ibuffer[b]; - } - - /*** Note: the JPEG code allocates an additional buffer after the - header data is read. The size of the buffer depends on - the image dimenstions, so this needs to be deallocated - in the Reset entry point. The rest of the above is of - fixed size, and will disappear automatically at Destroy - ***/ - - /* Calculate how many lines fit in an output strip - */ - pbytes = (ped->outFlo.format[0].pitch + 7) >> 3; - lines_in_output_strip = flo->floTex->stripSize / pbytes; - - if (!lines_in_output_strip) - lines_in_output_strip++; - - /* see if data manager should forward our input data to downstream elements - */ - pet->receptor[IMPORT].forward = miImportStream(flo,ped); - - /* set output emitter to allocate a map big enough to hold whole strip - */ - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, lines_in_output_strip, NO_INPLACE)); - -} /* end InitializeIPhotoJpegBase */ - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -int ActivateIPhotoJpegBase(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - jpegPvtPtr texpvt = (jpegPvtPtr) ped->peTex->private; - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - bandPtr dbnd = &pet->emitter[0]; - bandPtr dbnd1 = &pet->emitter[1]; - bandPtr dbnd2 = &pet->emitter[2]; - int b; - - /* dbnd and dst are used to deal with non-interleaved color data */ - /* if the class of the src is SingleBand, we call sub_fun for band 0 */ - /* if the class of the src is TripleBand and the interleave is */ - /* BandByPlane, we call sub_fun 3 times, once for each band */ - /* if the class of the src is TripleBand, interleave BandByPixel, we */ - /* call subfun once: it will produce all three dst bands */ - - if (texpvt->dataClass == xieValSingleBand) { - JpegDecodeState *state = &(texpvt->state[0]); - return( sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,NULL,NULL) ); - } - - /* TripleBand */ - if (texpvt->colors_smushed) { /* BandByPixel */ - JpegDecodeState *state = &(texpvt->state[0]); - if(texpvt->swizzle) - return( sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd2,dbnd1,dbnd) ); - else - return( sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,dbnd1,dbnd2) ); - } - - /* TripleBand, BandByPlane */ - for(b = 0; b < xieValMaxBands; ++b) { - JpegDecodeState *state = &(texpvt->state[b]); - sbnd = &rcp->band[b]; /* do each band independently */ - dbnd = &pet->emitter[texpvt->swizzle ? xieValMaxBands - b - 1 : b]; - if ( sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,NULL,NULL)==FALSE) - return(FALSE); - } - return(TRUE); -} - -/*------------------------------------------------------------------------ --------------------- *really* crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int sub_fun(flo,ped,pet,texpvt,state,sbnd,dbnd,dbnd1,dbnd2) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; - jpegPvtPtr texpvt; - JpegDecodeState *state; - bandPtr sbnd,dbnd,dbnd1,dbnd2; -{ -BytePixel *src, *dst,*dst1,*dst2; -int (*decodptr)() = texpvt->decodptr; - -/* - * get current input and output strips - */ - if (dbnd->final && dbnd->current >= dbnd->format->height) { - /* be forgiving if extra data gets passed to us */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return(TRUE); - } - - src=(BytePixel*)GetSrcBytes(flo,pet,sbnd,sbnd->current,sbnd->available,KEEP); - - if ( state->needs_input_strip ) { - /* NOTE: state->needs_input_strip is ONLY set after checking */ - /* to ensure that state->final != 1. In other words, we only */ - /* arrive here when we are sure there will be source data */ - - /* we left because we needed more input. The other case */ - /* would be if we left to allow downstream elements to run */ - - state->strip = src; - state->sptr = src; - state->strip_size = sbnd->maxLocal - sbnd->minLocal; - - state->i_strip++; /* just for debugging */ - - state->final = sbnd->strip ? sbnd->strip->final : sbnd->final; - state->needs_input_strip = 0; - } - - /* - * We have some data to decode, anything to write to? - */ - - while (dst = (BytePixel*)GetDst(flo,pet,dbnd,state->o_line,FLUSH)) { - - /* if tripleband interleaved data, make sure other bands cool */ - if (dbnd1) - if (!(dst1=(BytePixel*)GetDst(flo,pet,dbnd1,state->o_line,FLUSH)) || - !(dst2=(BytePixel*)GetDst(flo,pet,dbnd2,state->o_line,FLUSH)) ) - ImplementationError(flo,ped, return(FALSE)); - - /* - * If we reenter this loop after having decoded some data, - * it's important to check to see if we need to flush the - * decoder's output buffer. It's big trouble to call the - * decoder if its output buffer isn't flushed. nl_found - * indicates how many lines are left in the buffer - */ - - if (state->nl_found) { - JSAMPIMAGE jpeg_odata = state->cinfo->output_workspace; - register int ci,row; - int max_can_do; - int nl_mappable; - unsigned char **o_lines; - - /* this is possibly the first time we can check to see */ - /* if the data agrees with the output format */ - /* we don't get to check the JPEG data format until the */ - /* header has been read. The first time some output lines */ - /* are produced, we make sure all is copasetic... er... ok */ - - if (!texpvt->format_checked) { - - /* XXX - width, height must be same, all bands */ - if ( dbnd->format->width != (int)state->cinfo->image_width ) - ImplementationError(flo,ped, return(FALSE)); - - if ( dbnd->format->height != (int)state->cinfo->image_height ) - ImplementationError(flo,ped, return(FALSE)); - - if ( texpvt->dataClass == xieValSingleBand && - state->cinfo->num_components != 1 ) - ImplementationError(flo,ped, return(FALSE)); - - /* due to !*(!(! interleave option, checking bands is harder */ - if ( - (texpvt->dataClass == xieValTripleBand && - texpvt->colors_smushed && - state->cinfo->num_components != 3) || - (texpvt->dataClass == xieValTripleBand && - !texpvt->colors_smushed && - state->cinfo->num_components != 1) ) - ImplementationError(flo,ped, return(FALSE)); - - texpvt->format_checked = 1; - } - - /* Map current output strip to an array of lines, current->0 */ - nl_mappable = dbnd->maxLocal - state->o_line; - if (!MapData(flo,pet,dbnd,0,dbnd->current,nl_mappable,KEEP)) - ImplementationError(flo,ped, return(FALSE)); - - if (dbnd1) { - /* same for other two bands. Notice that we rely on */ - /* all three bands being synchronous with each other */ - - if (!MapData(flo,pet,dbnd1,0,dbnd1->current,nl_mappable,KEEP)) - ImplementationError(flo,ped, return(FALSE)); - if (!MapData(flo,pet,dbnd2,0,dbnd2->current,nl_mappable,KEEP)) - ImplementationError(flo,ped, return(FALSE)); - } - - /* limit flushing to as much as fits in a strip */ - max_can_do = (nl_mappable < state->nl_found)? - nl_mappable : state->nl_found; - - - /* at this point, we have checked enough to make sure */ - /* the following data copying stuff is appropriate */ - - o_lines = (unsigned char **) dbnd->dataMap; - for (row=0; rownl_flushed]; - register npix = state->cinfo->image_width; - while (npix--) - *o_line++ = (unsigned char) *jptr++; - } - - for (ci=1; ci < state->cinfo->num_components; ++ci) { - o_lines = (unsigned char **) ((ci==1)? dbnd1 : dbnd2)->dataMap; - for (row=0; rownl_flushed]; - register npix = state->cinfo->image_width; - while (npix--) - *o_line++ = (unsigned char) *jptr++; - } - } - - state->o_line += max_can_do; - state->nl_found -= max_can_do; - state->nl_flushed += max_can_do; - - dbnd->current = state->o_line; - if (dbnd1) { - dbnd1->current = state->o_line; - dbnd2->current = state->o_line; - } - - /* if we are done with this output strip, deliver it */ - if (state->o_line >= (int) dbnd->maxLocal) { - /* if PutData returns True, there is someone ready to - be scheduled downstream. We should return to yield - */ - if (dbnd1) { - PutData(flo,pet,dbnd, (unsigned) state->o_line); - PutData(flo,pet,dbnd1,(unsigned) state->o_line); - PutData(flo,pet,dbnd2,(unsigned) state->o_line); - } - else - if (PutData(flo,pet,dbnd, (unsigned) state->o_line) ) - return(TRUE); - } - - if (state->nl_found) /* couldn't flush all of it */ - continue; /* need another output strip */ - - - /* if here, flushed everything */ - if (state->goal != JPEG_DECODE_GOAL_Done) - continue; /* go around loop again. get */ - /* more dst if necessary */ - - /* all done!! free up all the src data */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return TRUE; - - } /* end of if (state->nl_found) */ - - else { - /* shouldn't call decoder if it wants something to */ - /* decode but there is nothing available to decode! */ - if (state->needs_input_strip) - ImplementationError(flo,ped, return(FALSE)); - - if ( (*decodptr)(state) < 0 ) { - /* if client wanted to be notified, give him the bad news */ - if(texpvt->notify) - SendDecodeNotifyEvent(flo, ped, dbnd->band, - xieValDecodeJPEGBaseline, - dbnd->format->width, dbnd->current, TRUE); - - /* have to send some error. We didn't get the right */ - /* number of lines, so complain about the height */ - ValueError(flo,ped,dbnd->format->height, return(FALSE)); - } - - if (state->needs_input_strip) { - FreeData(flo,pet,sbnd,sbnd->maxLocal); - return TRUE; - } - - /* if we have more work to do or need to flush, carry on */ - if (state->goal != JPEG_DECODE_GOAL_Done || state->nl_found) - continue; - - /* all done!! free up all the src data */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return TRUE; - - } /* end of else (!state->nl_found) */ - - } /* end of while(dst = ...) */ - - /* - * No more dst? Then either we are: - * - * 1: done with output image. Just shut down and be happy - * 2: scheduler has noticed a downstream element can run. In this - * case, we should be a good guy and return TRUE so the scheduler - * gives us back control again later (without going back to Core - * X, which would cause our input strip to vanish). - */ - if (dbnd->final) { - /* all done!! free up all the src data */ - FreeData(flo,pet,sbnd,sbnd->maxGlobal); - return TRUE; - } - -/* - * if here, we ran out of src. Scheduler will wake us up again - * when a PutClientData request comes along. - */ - return TRUE; /* Hmmm. Well, I think I did my part ok... */ -} /* end ActivateIPhotoJpegBase */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -int ResetIPhotoJpegBase(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - - /* get rid of the any data malloc'd by JPEG decoder */ - if(ped->peTex) { - jpegPvtPtr texpvt = (jpegPvtPtr) ped->peTex->private; - int b; - - /*** JPEG code has its own global free routine ***/ - for (b=0; bin_bands; ++b) { - if (texpvt->cinfo[b].emethods) - (*texpvt->cinfo[b].emethods->d_free_all)(& texpvt->cinfo[b]); - } - } - return(TRUE); -} /* end ResetIPhotoJpegBase */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -int DestroyIPhotoJpegBase(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.flush = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return TRUE; -} /* end DestroyIPhotoJpegBase */ - -/**** module mijpeg.c ****/ Index: xc/programs/Xserver/XIE/mixie/import/milut.c diff -u xc/programs/Xserver/XIE/mixie/import/milut.c:3.5 xc/programs/Xserver/XIE/mixie/import/milut.c:removed --- xc/programs/Xserver/XIE/mixie/import/milut.c:3.5 Fri Dec 14 14:58:28 2001 +++ xc/programs/Xserver/XIE/mixie/import/milut.c Sat Feb 28 21:41:59 2004 @@ -1,231 +0,0 @@ -/* $Xorg: milut.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module milut.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - milut.c -- DDXIE prototype import client lut element - - Larry Hare -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/milut.c,v 3.5 2001/12/14 19:58:28 dawes Exp $ */ - -#define _XIEC_ILUT -#define _XIEC_MILUT - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeILUT(); - -/* - * routines used internal to this module - */ -static int CreateILUT(); -static int InitializeILUT(); -static int ActivateILUT(); -static int ResetILUT(); -static int DestroyILUT(); - -/* - * DDXIE ImportLUT entry points - */ -static ddElemVecRec miLUTVec = { - CreateILUT, - InitializeILUT, - ActivateILUT, - (xieIntProc)NULL, - ResetILUT, - DestroyILUT - }; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeILUT(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = miLUTVec; - - return(TRUE); -} /* end miAnalyzeILUT */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateILUT(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the import lut element definition */ - return(MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC)); -} /* end CreateILUT */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeILUT(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* note: ImportResource elements don't use their receptors */ - return(InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeILUT */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateILUT(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - lutPtr lut = ((iLUTDefPtr)ped->elemPvt)->lut; - bandPtr bnd = pet->emitter; - CARD32 b; - - for(b = 0; b < lut->lutCnt; ++bnd, ++b) - if(!bnd->final) { - - if(ListEmpty(&lut->strips[b])) - AccessError(flo,ped, return(FALSE)); - - if(!PassStrip(flo,pet,bnd,lut->strips[b].flink)) - return(FALSE); /* alloc error */ - } - return(TRUE); -} /* end ActivateILUT */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetILUT(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetEmitter(ped); - - return(TRUE); -} /* end ResetILUT */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyILUT(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.flush = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyILUT */ - -/* end module milut.c */ - Index: xc/programs/Xserver/XIE/mixie/import/miphoto.c diff -u xc/programs/Xserver/XIE/mixie/import/miphoto.c:3.5 xc/programs/Xserver/XIE/mixie/import/miphoto.c:removed --- xc/programs/Xserver/XIE/mixie/import/miphoto.c:3.5 Fri Dec 14 14:58:28 2001 +++ xc/programs/Xserver/XIE/mixie/import/miphoto.c Sat Feb 28 21:41:59 2004 @@ -1,858 +0,0 @@ -/* $Xorg: miphoto.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module miphoto.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miphoto.c -- DDXIE prototype import client photomap element - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/miphoto.c,v 3.5 2001/12/14 19:58:28 dawes Exp $ */ - -#define _XIEC_MIPHOTO -#define _XIEC_IPHOTO - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeIPhoto(); - -/* - * routines used internal to this module - */ -static int CreateIPhotoUncom(); -static int InitializeIPhotoUncomByPlane(); -static int ActivateIPhotoUncomByPlane(); -static int ResetIPhoto(); -static int DestroyIPhoto(); - -static int CreateIPhotoStream(); -static int InitializeIPhotoStream(); -static int ActivateIPhotoStream(); -static int ResetIPhotoStream(); - -#if XIE_FULL -static int InitializeIPhotoUncomByPixel(); -static int ActivateIPhotoUncomByPixel(); -#endif -/* - * routines we need from somewhere else - */ -extern bandMsk miImportCanonic(); -extern bandMsk miImportStream(); - -extern int CreateICPhotoFax(); -extern int InitializeIPhotoFax(); -extern int ActivateICPhotoFax(); -extern int ResetICPhotoFax(); -extern int DestroyICPhotoFax(); - -#if XIE_FULL -extern int CreateIPhotoJpegBase(); -extern int InitializeIPhotoJpegBase(); -extern int ActivateIPhotoJpegBase(); -extern int ResetIPhotoJpegBase(); -extern int DestroyIPhotoJpegBase(); -#endif - -/* - * DDXIE ImportPhotomap entry points - */ -static ddElemVecRec IPhotoUncomByPlaneVec = { - CreateIPhotoUncom, - InitializeIPhotoUncomByPlane, - ActivateIPhotoUncomByPlane, - (xieIntProc)NULL, - ResetIPhoto, - DestroyIPhoto - }; - -static ddElemVecRec IPhotoStreamVec = { - CreateIPhotoStream, - InitializeIPhotoStream, - ActivateIPhotoStream, - (xieIntProc)NULL, - ResetIPhotoStream, - DestroyIPhoto - }; - -static ddElemVecRec IPhotoFaxVec = { - CreateICPhotoFax, /* share this with ICphoto stuff */ - InitializeIPhotoFax, /* note that only this is unshared */ - ActivateICPhotoFax, - (xieIntProc)NULL, - ResetICPhotoFax, - DestroyICPhotoFax - }; - -#if XIE_FULL -static ddElemVecRec IPhotoUncomByPixelVec = { - CreateIPhotoUncom, - InitializeIPhotoUncomByPixel, - ActivateIPhotoUncomByPixel, - (xieIntProc)NULL, - ResetIPhoto, - DestroyIPhoto - }; - -static ddElemVecRec IPhotoJPEGBaselineVec = { - CreateIPhotoJpegBase, - InitializeIPhotoJpegBase, - ActivateIPhotoJpegBase, - (xieIntProc)NULL, - ResetIPhotoJpegBase, - DestroyIPhotoJpegBase - }; -#endif /* XIE_FULL */ - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeIPhoto(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - - if(!miImportCanonic(flo,ped)) { - ped->ddVec = IPhotoStreamVec; - return(TRUE); - } - switch(map->technique) { - case xieValDecodeUncompressedSingle: - ped->ddVec = IPhotoUncomByPlaneVec; - break; - -#if XIE_FULL - case xieValDecodeUncompressedTriple: - if(((xieTecDecodeUncompressedTriple *) - map->tecParms)->interleave == xieValBandByPlane) - ped->ddVec = IPhotoUncomByPlaneVec; - else - ped->ddVec = IPhotoUncomByPixelVec; - - break; - case xieValDecodeJPEGBaseline: - ped->ddVec = IPhotoJPEGBaselineVec; - break; -#endif /* XIE_FULL */ - case xieValDecodeTIFFPackBits: - case xieValDecodeTIFF2: - case xieValDecodeG31D: - case xieValDecodeG32D: - case xieValDecodeG42D: - ped->ddVec = IPhotoFaxVec; - break; - default: - ImplementationError(flo,ped, return(FALSE)); - } - return(TRUE); -} /* end miAnalyzeIPhoto */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateIPhotoUncom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return(MakePETex(flo, ped, xieValMaxBands * sizeof(miUncompRec), - NO_SYNC, NO_SYNC) ); -} /* end CreateIPhotoUncom */ - - -static int CreateIPhotoStream(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return( MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC) ); -} /* end CreateIPhotoStream */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeIPhotoUncomByPlane(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - peTexPtr pet = ped->peTex; - miUncompPtr pvt = (miUncompPtr)pet->private; - CARD32 nbands = ped->outFlo.bands,b,s; - formatPtr inf = ped->inFloLst[IMPORT].format; - bandMsk import = NO_BANDS; - bandMsk reformat = miImportCanonic(flo,ped); - xieTypOrientation pixelOrder, fillOrder; - CARD8 *ppad; - - if (nbands == 1) { - xieTecDecodeUncompressedSingle *tec = ((xieTecDecodeUncompressedSingle*) - map->tecParms); - pixelOrder = tec->pixelOrder; - fillOrder = tec->fillOrder; - pvt->bandMap = 0; - ppad = &tec->leftPad; - } else { -#if XIE_FULL - xieTecDecodeUncompressedTriple *tec = ((xieTecDecodeUncompressedTriple*) - map->tecParms); - pixelOrder = tec->pixelOrder; - fillOrder = tec->fillOrder; - ppad = tec->leftPad; - if (tec->bandOrder == xieValLSFirst) - for(b = 0; b < xieValMaxBands; ++b) - pvt[b].bandMap = b; - else - for(s = 0, b = xieValMaxBands; b--; ++s) - pvt[s].bandMap = b; -#else - ImplementationError(flo,ped, return(FALSE)); -#endif - } - - for (b = 0; b < nbands; b++, pvt++, ppad++, inf++) { - pvt->next_strip = map->strips[b].flink; - if (IsCanonic(inf->class))/* If data was passed through then no decoding*/ - continue; - - import |= 1<reformat = TRUE; - else - continue; - - pvt->bitOff = pvt->leftPad = *ppad; - if(inf->depth == 1) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - if (pvt->leftPad & 7 || inf->stride != 1) { - pvt->action = (fillOrder == xieValMSFirst) ? CPextractstreambits: - CPextractswappedstreambits; - } else { - pvt->action = (fillOrder == xieValMSFirst) ? CPpass_bits : - CPreverse_bits; - } -#else - if (pvt->leftPad & 7 || inf->stride != 1) { - pvt->action = (fillOrder == xieValLSFirst) ? CPextractstreambits: - CPextractswappedstreambits; - } else { - pvt->action = (fillOrder == xieValLSFirst) ? CPpass_bits : - CPreverse_bits; - } -#endif - } else if (inf->depth <= 8) { - if (pvt->leftPad & 7 || inf->stride & 7) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUBtoB; - else - pvt->action = MLUBtoB; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUBtoB; - else - pvt->action = LLUBtoB; - } - } else { - /* They chose wisely */ - pvt->action = CPpass_bytes; - } - } else if (inf->depth <= 16) { - if (pvt->leftPad & 15 || inf->stride & 15) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUPtoP; - else - pvt->action = MLUPtoP; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUPtoP; - else - pvt->action = LLUPtoP; - } - } else { - /* They chose wisely */ -#if (IMAGE_BYTE_ORDER == MSBFirst) - pvt->action = fillOrder == xieValMSFirst ? CPpass_pairs : CPswap_pairs; -#else - pvt->action = fillOrder == xieValLSFirst ? CPpass_pairs : CPswap_pairs; -#endif - } - } else if (inf->depth <= 24) { - if (pvt->leftPad & 31 || inf->stride & 31) { - /* They chose . . . poorly */ - if (pixelOrder == xieValMSFirst) { - if(fillOrder == xieValMSFirst) - pvt->action = MMUQtoQ; - else - pvt->action = MLUQtoQ; - } else { - if(fillOrder == xieValMSFirst) - pvt->action = LMUQtoQ; - else - pvt->action = LLUQtoQ; - } - } else { - /* They chose wisely */ -#if (IMAGE_BYTE_ORDER == MSBFirst) - pvt->action = fillOrder == xieValMSFirst ? CPpass_quads : CPswap_quads; -#else - pvt->action = fillOrder == xieValLSFirst ? CPpass_quads : CPswap_quads; -#endif - } - } else { - ImplementationError(flo,ped, return(FALSE)); - } - } - if(import) { - bandMsk smuggle = import & ~reformat; /* bands that will bypass emitter */ - receptorPtr rcp = pet->receptor; - - rcp->forward = miImportStream(flo,ped); - - return( InitReceptor(flo, ped, rcp, NO_DATAMAP, 1, import, smuggle) && - (!(import & 1) || - ImportStrips(flo, pet,&rcp->band[0], &map->strips[0])) && - (!(import & 2) || - ImportStrips(flo, pet,&rcp->band[1], &map->strips[1])) && - (!(import & 4) || - ImportStrips(flo, pet,&rcp->band[2], &map->strips[2])) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); - } else { - return(InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); - } -} /* end InitializeIPhotoUncomByPlane */ - - -static int InitializeIPhotoStream(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - int b, nbands = ped->inFloLst[IMPORT].bands; - - /* tell data manager to forward our input data to downstream elements - */ - rcp->forward = miImportStream(flo,ped); - - if(!InitReceptor(flo, ped, rcp, NO_DATAMAP, 1, rcp->forward, ~rcp->forward)) - return(FALSE); - - for(b = 0; b < nbands; ++b) - if(!ImportStrips(flo, pet, &rcp->band[b], &map->strips[b])) - return(FALSE); - - return(InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeIPhotoStream */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateIPhotoUncomByPlane(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - xieFloImportPhotomap *raw = (xieFloImportPhotomap *)ped->elemRaw; - miUncompPtr pvt = (miUncompPtr)pet->private; - formatPtr fmt = ped->inFloLst[IMPORT].format; - bandPtr bnd = &pet->emitter[0]; - bandPtr sbnd = pet->receptor[SRCtag].band; - bandPtr dbnd; - CARD32 oldslen, final, nextslen, b; - - for(b = 0; b < map->bands; b++, pvt++, fmt++, sbnd++, bnd++) - if(!bnd->final) - if(pet->receptor[SRCtag].active & 1<action; - pointer src, dst; - - if(!pvt->reformat) { - FreeData(flo, pet, sbnd, sbnd->maxGlobal); - continue; - } - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - dbnd = &pet->emitter[pvt->bandMap]; - if((src = GetSrcBytes(flo,pet,sbnd,sbnd->current,nextslen,KEEP)) - && (dst = GetCurrentDst(flo,pet,dbnd))) - - do { - (*action)(src, dst, sbnd->format->width, - (CARD32)pvt->bitOff, - (CARD32)sbnd->format->depth, - sbnd->format->stride); - - pvt->bitOff = pvt->bitOff + sbnd->format->pitch & 7; - oldslen = (pvt->bitOff) ? nextslen - 1 : nextslen; - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - src = GetSrcBytes(flo,pet,sbnd,sbnd->current+oldslen, - nextslen,KEEP); - dst = GetNextDst(flo,pet,dbnd,FLUSH); - } while(src && dst); - - final = sbnd->strip && sbnd->strip->final; - if(!src && final && dbnd->current < dbnd->format->height) { - /* - * the client lied about the image size! - */ - if(raw->notify) - SendDecodeNotifyEvent(flo, ped, 0, map->technique, - dbnd->format->width, dbnd->current, TRUE); - /* - * If the client didn't send enough data, we could zero-fill the - * remaining lines. Since we sent the "aborted" status, we won't - * bother (the protocol offers both choices). - */ - ValueError(flo,ped,dbnd->format->height, return(FALSE)); - } - if(!src || dbnd->final) { - /* free whatever we've used so far - */ - FreeData(flo, pet, sbnd, final ? sbnd->maxGlobal : sbnd->current); - } - } else { - stripPtr strip = pvt->next_strip; - pvt->next_strip = strip->flink; - - if(ListEnd(strip,&map->strips[b])) - AccessError(flo,ped, return(FALSE)); - - /* pass a clone of the current strip to our recipients - */ - if(!PassStrip(flo,pet,bnd,strip)) - return(FALSE); /* alloc error */ - } - return(TRUE); -} /* end ActivateIPhotoUncomByPlane */ - - -static int ActivateIPhotoStream(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - CARD32 nbands = ped->inFloLst[IMPORT].bands; - bandPtr bnd = pet->receptor[IMPORT].band; - CARD32 b; - - for(b = 0; b < nbands; ++bnd, ++b) { - if(GetSrcBytes(flo,pet,bnd,bnd->current,1,KEEP)) { - FreeData(flo,pet,bnd,bnd->maxLocal); - if(ListEmpty(&bnd->stripLst)) - DisableDst(flo,pet,&pet->emitter[b]); - } - } - return(TRUE); -} /* end ActivateIPhotoStream */ - - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetIPhoto(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - miUncompPtr pvt = (miUncompPtr)ped->peTex->private; - int i; - - for(i = 0; i < xieValMaxBands; ++i) - if(pvt[i].buf) pvt[i].buf = (pointer) XieFree(pvt[i].buf); - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetIPhoto */ - - -static int ResetIPhotoStream(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetIPhotoStream */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyIPhoto(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return(TRUE); -} /* end DestroyIPhoto */ - - -#if XIE_FULL -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeIPhotoUncomByPixel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - photomapPtr map = ((iPhotoDefPtr)ped->elemPvt)->map; - xieTecDecodeUncompressedTriple *tec = ((xieTecDecodeUncompressedTriple *) - map->tecParms); - peTexPtr pet = ped->peTex; - miUncompPtr pvt = (miUncompPtr)pet->private; - bandPtr sbnd = &ped->peTex->receptor[IMPORT].band[0]; - CARD32 sstride = sbnd->format->stride>>3; - CARD8 leftPad = tec->leftPad[0]>>3; - xieTypOrientation pixelOrder, fillOrder; - CARD32 depth0, depth1, depth2; - int s, d; - - pvt->unaligned = FALSE; /* Hope for the best */ - - if(tec->bandOrder == xieValLSFirst) - for(d = 0; d < xieValMaxBands; ++d) - pvt[d].bandMap = d; - else - for(s = 0, d = xieValMaxBands; d--; ++s) - pvt[s].bandMap = d; - - depth0 = pet->emitter[pvt[0].bandMap].format->depth; - depth1 = pet->emitter[pvt[1].bandMap].format->depth; - depth2 = pet->emitter[pvt[2].bandMap].format->depth; - - pixelOrder = tec->pixelOrder; - fillOrder = tec->fillOrder; - pvt[0].next_strip = map->strips[0].flink; - - pvt->bitOff = pvt->leftPad = tec->leftPad[0]; - - /* See if data is nicely aligned */ - if (!(tec->leftPad[0] & 7) && !(sbnd->format->stride & 7)) { - if (depth0 == 16 && depth1 == 16 && depth2 == 16) { -#if (IMAGE_BYTE_ORDER == MSBFirst) - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? StoP : StosP; -#else - void (*pa)() = (tec->pixelOrder == xieValMSFirst) ? StosP : StoP; -#endif - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = pa; - pvt->Bstride = sstride; - pvt->srcoffset = s + leftPad; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - } - } else if (depth0 == 8 && depth1 == 8 && depth2 == 8) { - for(s = 0; s < xieValMaxBands; s++, pvt++) { - pvt->action = StoB; - pvt->Bstride = sstride; - pvt->srcoffset = s + leftPad; - pvt->mask = 0; /* Unused */ - pvt->shift = 0; /* Unused */ - } - } else if (depth0 == 4 && depth1 == 4 && depth2 == 4) { - if (tec->fillOrder == xieValMSFirst) { - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0xf0; - (pvt++)->shift = 4; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = 1 + leftPad; - pvt->mask = 0xf0; - pvt->shift = 4; - } else { /* xieValLSFirst */ - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0x0f; - (pvt++)->shift = 0; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = 0xf0; - (pvt++)->shift = 4; - pvt->action = SbtoB; - pvt->Bstride = sstride; - pvt->srcoffset = 1 + leftPad; - pvt->mask = 0x0f; - pvt->shift = 0; - } - } else if (depth0 + depth1 + depth2 <= 8) { - CARD8 ones = 0xff,smask0,smask1,smask2,shift0,shift1,shift2; - if (tec->fillOrder == xieValMSFirst) { - smask0 = ~(ones>>depth0); - smask1 = ~(ones>>(depth0 + depth1) | smask0); - smask2 = ~(ones>>(depth0 + depth1 + depth2) | smask0 | smask1); - shift0 = 8 - depth0; - shift1 = 8 - (depth0 + depth1); - shift2 = 8 - (depth0 + depth1 + depth2); - } else { /* fillOrder == xieValLSFirst */ - smask2 = ~(ones<action = (depth0 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask0; - (pvt++)->shift = shift0; - pvt->action = (depth1 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask1; - (pvt++)->shift = shift1; - pvt->action = (depth2 > 1) ? SbtoB : Sbtob; - pvt->Bstride = sstride; - pvt->srcoffset = leftPad; - pvt->mask = smask2; - pvt->shift = shift2; - } else { - pvt->unaligned = TRUE; - } - } else { - pvt->unaligned = TRUE; - } - pvt = (miUncompPtr)pet->private; - pvt->reformat = TRUE; - - if(pvt->unaligned) { - /* since it's unaligned and somebody wants our data, do it the hard way */ - CARD32 width = sbnd->format->width; - pvt->action = ExtractTripleFuncs[tec->pixelOrder == xieValLSFirst ? 0 : 1] - [tec->fillOrder == xieValLSFirst ? 0 : 1] - [depth0 <= 8 ? 0 : 1] - [depth1 <= 8 ? 0 : 1] - [depth2 <= 8 ? 0 : 1]; - if(depth0 == 1 && !(pvt[0].buf = (pointer)XieMalloc(width+7)) || - depth1 == 1 && !(pvt[1].buf = (pointer)XieMalloc(width+7)) || - depth2 == 1 && !(pvt[2].buf = (pointer)XieMalloc(width+7))) - AllocError(flo,ped, return(FALSE)); - } - /* see if data manager should forward our input data to downstream elements - */ - pet->receptor->forward = miImportStream(flo,ped); - - return(InitReceptor(flo,ped, pet->receptor,NO_DATAMAP,1,1,NO_BANDS) && - ImportStrips(flo,pet,&pet->receptor[0].band[0],&map->strips[0]) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE)); -} /* end InitializeIPhotoUnTriple */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateIPhotoUncomByPixel(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloImportPhotomap *raw = (xieFloImportPhotomap *)ped->elemRaw; - miUncompPtr pvt = (miUncompPtr) (pet->private); - bandPtr sbnd = &pet->receptor[IMPORT].band[0]; - bandPtr db0 = &pet->emitter[pvt[0].bandMap]; - bandPtr db1 = &pet->emitter[pvt[1].bandMap]; - bandPtr db2 = &pet->emitter[pvt[2].bandMap]; - CARD32 final, width = db0->format->width; - pointer src, dp0, dp1, dp2; - - if(pvt->unaligned) { - CARD32 oldslen, nextslen; - void (*action)() = pvt->action; - CARD32 depth0 = db0->format->depth; - CARD32 depth1 = db1->format->depth; - CARD32 depth2 = db2->format->depth; - CARD32 stride = sbnd->format->stride; - - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - if((src = GetSrcBytes(flo,pet,sbnd,sbnd->current,nextslen,KEEP)) && - (dp0 = GetCurrentDst(flo,pet,db0)) && - (dp1 = GetCurrentDst(flo,pet,db1)) && - (dp2 = GetCurrentDst(flo,pet,db2))) - do { - - (*action)(src, - pvt[0].buf ? pvt[0].buf : dp0, - pvt[1].buf ? pvt[1].buf : dp1, - pvt[2].buf ? pvt[2].buf : dp2, - width, pvt->bitOff, depth0, depth1, depth2, stride); - - if(pvt[0].buf) bitshrink(pvt[0].buf,dp0,width,(BytePixel)1); - if(pvt[1].buf) bitshrink(pvt[1].buf,dp1,width,(BytePixel)1); - if(pvt[2].buf) bitshrink(pvt[2].buf,dp2,width,(BytePixel)1); - - pvt->bitOff = pvt->bitOff + sbnd->format->pitch & 7; - oldslen = pvt->bitOff ? nextslen - 1 : nextslen; - nextslen = pvt->bitOff + sbnd->format->pitch + 7 >> 3; - src = GetSrcBytes(flo,pet,sbnd,sbnd->current+oldslen,nextslen,KEEP); - dp0 = GetNextDst(flo,pet,db0,FLUSH); - dp1 = GetNextDst(flo,pet,db1,FLUSH); - dp2 = GetNextDst(flo,pet,db2,FLUSH); - } while(src && dp0 && dp1 && dp2); - } else { - CARD32 slen = sbnd->format->pitch+7>>3; - if((src = GetSrcBytes(flo,pet,sbnd,sbnd->current,slen,KEEP)) && - (dp0 = GetCurrentDst(flo,pet,db0)) && - (dp1 = GetCurrentDst(flo,pet,db1)) && - (dp2 = GetCurrentDst(flo,pet,db2))) - do { - - (*pvt[0].action)(src,dp0,width,&pvt[0]); - (*pvt[1].action)(src,dp1,width,&pvt[1]); - (*pvt[2].action)(src,dp2,width,&pvt[2]); - - src =GetSrcBytes(flo,pet,sbnd,sbnd->current+slen,slen,KEEP); - dp0 = GetNextDst(flo,pet,db0,FLUSH); - dp1 = GetNextDst(flo,pet,db1,FLUSH); - dp2 = GetNextDst(flo,pet,db2,FLUSH); - } while(src && dp0 && dp1 && dp2); - } - final = sbnd->strip && sbnd->strip->final; - if(!src && final && db0->current < db0->format->height) { - /* - * the client lied about the image size! - */ - if(raw->notify) - SendDecodeNotifyEvent(flo, ped, 0, xieValDecodeUncompressedTriple, - db0->format->width, db0->current, TRUE); - /* - * If the client didn't send enough data, we could zero-fill the - * remaining lines. Since we sent the "aborted" status, we won't - * bother (the protocol offers both choices). - */ - ValueError(flo,ped,db0->format->height, return(FALSE)); - } - if(!src || db0->final && db1->final && db2->final) { - /* free whatever we've used so far - */ - FreeData(flo, pet, sbnd, final ? sbnd->maxGlobal : sbnd->current); - } - return(TRUE); -} /* end ActivateIPhotoUncomByPixel */ -#endif /* XIE_FULL */ - -/* end module miphoto.c */ Index: xc/programs/Xserver/XIE/mixie/import/miregion.c diff -u xc/programs/Xserver/XIE/mixie/import/miregion.c:3.7 xc/programs/Xserver/XIE/mixie/import/miregion.c:removed --- xc/programs/Xserver/XIE/mixie/import/miregion.c:3.7 Fri Dec 14 14:58:28 2001 +++ xc/programs/Xserver/XIE/mixie/import/miregion.c Sat Feb 28 21:41:59 2004 @@ -1,1092 +0,0 @@ -/* $Xorg: miregion.c,v 1.3 2000/08/17 19:47:45 cpqbld Exp $ */ -/**** module miregion.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miregion.c -- ddx/mi/miregion code converted over to XIE for rectangles - of interest. "Minimal" conversion made to support - rectangles defined by INT32s instead of shorts. Unused - routines from the general code have been removed. - - Dean Verheiden -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/*********************************************************** - -Copyright 1987, 1988, 1989 The Open Group - -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 -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1988, 1989 by -Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/miregion.c,v 3.7 2001/12/14 19:58:28 dawes Exp $ */ - -#define _XIEC_MIREGION - -#include - -#include "miscstruct.h" -#include "regionstr.h" -#include "Xprotostr.h" -#include "gc.h" - -#include "microi.h" -#include "macro.h" - -#if defined (__GNUC__) && !defined (NO_INLINES) -#define INLINE __inline -#else -#define INLINE -#endif - -/* - * hack until callers of these functions can deal with out-of-memory - */ - -extern Bool Must_have_memory; - -#undef assert -#define assert(expr) - -#define good(reg) assert(miXieValidRegion(reg)) - -/* - * The functions in this file implement the Region abstraction used extensively - * throughout the X11 sample server. A Region is simply a set of disjoint - * (non-overlapping) rectangles, plus an "extent" rectangle which is the - * smallest single rectangle that contains all the non-overlapping rectangles. - * - * A Region is implemented as a "y-x-banded" array of rectangles. This array - * imposes two degrees of order. First, all rectangles are sorted by top side - * y coordinate first (y1), and then by left side x coordinate (x1). - * - * Furthermore, the rectangles are grouped into "bands". Each rectangle in a - * band has the same top y coordinate (y1), and each has the same bottom y - * coordinate (y2). Thus all rectangles in a band differ only in their left - * and right side (x1 and x2). Bands are implicit in the array of rectangles: - * there is no separate list of band start pointers. - * - * The y-x band representation does not minimize rectangles. In particular, - * if a rectangle vertically crosses a band (the rectangle has scanlines in - * the y1 to y2 area spanned by the band), then the rectangle may be broken - * down into two or more smaller rectangles stacked one atop the other. - * - * ----------- ----------- - * | | | | band 0 - * | | -------- ----------- -------- - * | | | | in y-x banded | | | | band 1 - * | | | | form is | | | | - * ----------- | | ----------- -------- - * | | | | band 2 - * -------- -------- - * - * An added constraint on the rectangles is that they must cover as much - * horizontal area as possible: no two rectangles within a band are allowed - * to touch. - * - * Whenever possible, bands will be merged together to cover a greater vertical - * distance (and thus reduce the number of rectangles). Two bands can be merged - * only if the bottom of one touches the top of the other and they have - * rectangles in the same places (of the same width, of course). - * - * Adam de Boor wrote most of the original region code. Joel McCormack - * substantially modified or rewrote most of the core arithmetic routines, - * and added miXieRegionValidate in order to support several speed improvements - * to miXieValidateTree. Bob Scheifler changed the representation to be more - * compact when empty or a single rectangle, and did a bunch of gratuitous - * reformatting. - */ - -#define xallocData(n) (XieRegDataPtr)XieMalloc(XIEREGION_SZOF(n)) -#define xfreeData(reg) if ((reg)->data && (reg)->data->size) XieFree((reg)->data) - -#define RECTALLOC(pReg,n) \ -if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ - miXieRectAlloc(pReg, n) - -#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \ -{ \ - pNextRect->x1 = nx1; \ - pNextRect->y1 = ny1; \ - pNextRect->x2 = nx2; \ - pNextRect->y2 = ny2; \ - pNextRect++; \ -} - -#define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2) \ -{ \ - if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\ - { \ - miXieRectAlloc(pReg, 1); \ - pNextRect = XIEREGION_TOP(pReg); \ - } \ - ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \ - pReg->data->numRects++; \ - assert(pReg->data->numRects<=pReg->data->size); \ -} - - -#define DOWNSIZE(reg,numRects) \ -if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ -{ \ - XieRegDataPtr NewData; \ - NewData = (XieRegDataPtr)XieRealloc((reg)->data, XIEREGION_SZOF(numRects)); \ - if (NewData) \ - { \ - NewData->size = (numRects); \ - (reg)->data = NewData; \ - } \ -} - -static XieBoxRec EmptyBox = {0, 0, 0, 0}; -static XieRegDataRec EmptyData = {0, 0}; - -/***************************************************************** - * XieRegionCreate(rect, size) - * This routine does a simple XieMalloc to make a structure of - * REGION of "size" number of rectangles. - *****************************************************************/ - -XieRegionPtr -miXieRegionCreate(rect, size) - XieBoxPtr rect; - int size; -{ - register XieRegionPtr pReg; - - Must_have_memory = TRUE; /* XXX */ - pReg = (XieRegionPtr)XieMalloc(sizeof(XieRegionRec)); - Must_have_memory = FALSE; /* XXX */ - if (rect) - { - pReg->extents = *rect; - pReg->data = (XieRegDataPtr)NULL; - } - else - { - pReg->extents = EmptyBox; - if ((size > 1) && (pReg->data = xallocData(size))) - { - pReg->data->size = size; - pReg->data->numRects = 0; - } - else - pReg->data = &EmptyData; - } - return(pReg); -} - -void -miXieRegionDestroy(pReg) - XieRegionPtr pReg; -{ - good(pReg); - xfreeData(pReg); - XieFree(pReg); -} - -Bool -miXieRectAlloc(pRgn, n) - register XieRegionPtr pRgn; - int n; -{ - Must_have_memory = TRUE; /* XXX */ - if (!pRgn->data) - { - n++; - pRgn->data = xallocData(n); - pRgn->data->numRects = 1; - *XIEREGION_BOXPTR(pRgn) = pRgn->extents; - } - else if (!pRgn->data->size) - { - pRgn->data = xallocData(n); - pRgn->data->numRects = 0; - } - else - { - if (n == 1) - { - n = pRgn->data->numRects; - if (n > 500) /* XXX pick numbers out of a hat */ - n = 250; - } - n += pRgn->data->numRects; - pRgn->data = (XieRegDataPtr)XieRealloc(pRgn->data, XIEREGION_SZOF(n)); - } - Must_have_memory = FALSE; /* XXX */ - pRgn->data->size = n; - return TRUE; -} - - -/*====================================================================== - * Generic XieRegion Operator - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miXieCoalesce -- - * Attempt to merge the boxes in the current band with those in the - * previous one. We are guaranteed that the current band extends to - * the end of the rects array. Used only by miXieRegionOp. - * - * Results: - * The new index for the previous band. - * - * Side Effects: - * If coalescing takes place: - * - rectangles in the previous band will have their y2 fields - * altered. - * - pReg->data->numRects will be decreased. - * - *----------------------------------------------------------------------- - */ -INLINE static int -miXieCoalesce (pReg, prevStart, curStart) - register XieRegionPtr pReg; /* Region to coalesce */ - int prevStart; /* Index of start of previous band */ - int curStart; /* Index of start of current band */ -{ - register XieBoxPtr pPrevBox; /* Current box in previous band */ - register XieBoxPtr pCurBox; /* Current box in current band */ - register int numRects; /* Number rectangles in both bands */ - register int y2; /* Bottom of current band */ - /* - * Figure out how many rectangles are in the band. - */ - numRects = curStart - prevStart; - assert(numRects == pReg->data->numRects - curStart); - - if (!numRects) return curStart; - - /* - * The bands may only be coalesced if the bottom of the previous - * matches the top scanline of the current. - */ - pPrevBox = XIEREGION_BOX(pReg, prevStart); - pCurBox = XIEREGION_BOX(pReg, curStart); - if (pPrevBox->y2 != pCurBox->y1) return curStart; - - /* - * Make sure the bands have boxes in the same places. This - * assumes that boxes have been added in such a way that they - * cover the most area possible. I.e. two boxes in a band must - * have some horizontal space between them. - */ - y2 = pCurBox->y2; - - do { - if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { - return (curStart); - } - pPrevBox++; - pCurBox++; - numRects--; - } while (numRects); - - /* - * The bands may be merged, so set the bottom y of each box - * in the previous band to the bottom y of the current band. - */ - numRects = curStart - prevStart; - pReg->data->numRects -= numRects; - do { - pPrevBox--; - pPrevBox->y2 = y2; - numRects--; - } while (numRects); - return prevStart; -} - - -/* Quicky macro to avoid trivial reject procedure calls to miXieCoalesce */ - -#define Coalesce(newReg, prevBand, curBand) \ - if (curBand - prevBand == newReg->data->numRects - curBand) { \ - prevBand = miXieCoalesce(newReg, prevBand, curBand); \ - } else { \ - prevBand = curBand; \ - } - -/*- - *----------------------------------------------------------------------- - * miXieAppendNonO -- - * Handle a non-overlapping band for the union and subtract operations. - * Just adds the (top/bottom-clipped) rectangles into the region. - * Doesn't have to check for subsumption or anything. - * - * Results: - * None. - * - * Side Effects: - * pReg->data->numRects is incremented and the rectangles overwritten - * with the rectangles we're passed. - * - *----------------------------------------------------------------------- - */ - -INLINE static Bool -miXieAppendNonO (pReg, r, rEnd, y1, y2) - register XieRegionPtr pReg; - register XieBoxPtr r; - XieBoxPtr rEnd; - register int y1; - register int y2; -{ - register XieBoxPtr pNextRect; - register int newRects; - - newRects = rEnd - r; - - assert(y1 < y2); - assert(newRects != 0); - - /* Make sure we have enough space for all rectangles to be added */ - RECTALLOC(pReg, newRects); - pNextRect = XIEREGION_TOP(pReg); - pReg->data->numRects += newRects; - do { - assert(r->x1 < r->x2); - ADDRECT(pNextRect, r->x1, y1, r->x2, y2); - r++; - } while (r != rEnd); - - return TRUE; -} - -#define FindBand(r, rBandEnd, rEnd, ry1) \ -{ \ - ry1 = r->y1; \ - rBandEnd = r+1; \ - while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) { \ - rBandEnd++; \ - } \ -} - -#define AppendRegions(newReg, r, rEnd) \ -{ \ - int newRects; \ - if (newRects = rEnd - r) { \ - RECTALLOC(newReg, newRects); \ - memcpy((char *)XIEREGION_TOP(newReg), (char *)r, \ - newRects * sizeof(XieBoxRec)); \ - newReg->data->numRects += newRects; \ - } \ -} - -/*- - *----------------------------------------------------------------------- - * miXieRegionOp -- - * Apply an operation to two regions. Called by miXieUnion, miXieInverse, - * miXieSubtract, miXieIntersect.... Both regions MUST have at least one - * rectangle, and cannot be the same object. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * The new region is overwritten. - * pOverlap set to TRUE if overlapFunc ever returns TRUE. - * - * Notes: - * The idea behind this function is to view the two regions as sets. - * Together they cover a rectangle of area that this function divides - * into horizontal bands where points are covered only by one region - * or by both. For the first case, the nonOverlapFunc is called with - * each the band and the band's upper and lower extents. For the - * second, the overlapFunc is called to process the entire band. It - * is responsible for clipping the rectangles in the band, though - * this function provides the boundaries. - * At the end of each band, the new region is coalesced, if possible, - * to reduce the number of rectangles in the region. - * - *----------------------------------------------------------------------- - */ -static Bool -miXieRegionOp(newReg, reg1, reg2, overlapFunc, appendNon1, appendNon2, pOverlap) - XieRegionPtr newReg; /* Place to store result */ - XieRegionPtr reg1; /* First region in operation */ - XieRegionPtr reg2; /* 2d region in operation */ - Bool (*overlapFunc)(); /* Function to call for over- - * lapping bands */ - Bool appendNon1; /* Append non-overlapping bands */ - /* in region 1 ? */ - Bool appendNon2; /* Append non-overlapping bands */ - /* in region 2 ? */ - Bool *pOverlap; -{ - register XieBoxPtr r1; /* Pointer into first region */ - register XieBoxPtr r2; /* Pointer into 2d region */ - XieBoxPtr r1End; /* End of 1st region */ - XieBoxPtr r2End; /* End of 2d region */ - INT32 ybot; /* Bottom of intersection */ - INT32 ytop; /* Top of intersection */ - XieRegDataPtr oldData; /* Old data for newReg */ - int prevBand; /* Index of start of - * previous band in newReg */ - int curBand; /* Index of start of current - * band in newReg */ - register XieBoxPtr r1BandEnd; /* End of current band in r1 */ - register XieBoxPtr r2BandEnd; /* End of current band in r2 */ - INT32 top; /* Top of non-overlapping band */ - INT32 bot; /* Bottom of non-overlapping band*/ - register int r1y1; /* Temps for r1->y1 and r2->y1 */ - register int r2y1; - int newSize; - int numRects; - - /* - * Initialization: - * set r1, r2, r1End and r2End appropriately, save the rectangles - * of the destination region until the end in case it's one of - * the two source regions, then mark the "new" region empty, allocating - * another array of rectangles for it to use. - */ - - r1 = XIEREGION_RECTS(reg1); - newSize = XIEREGION_NUM_RECTS(reg1); - r1End = r1 + newSize; - numRects = XIEREGION_NUM_RECTS(reg2); - r2 = XIEREGION_RECTS(reg2); - r2End = r2 + numRects; - assert(r1 != r1End); - assert(r2 != r2End); - - oldData = (XieRegDataPtr)NULL; - if (((newReg == reg1) && (newSize > 1)) || - ((newReg == reg2) && (numRects > 1))) - { - oldData = newReg->data; - newReg->data = &EmptyData; - } - /* guess at new size */ - if (numRects > newSize) - newSize = numRects; - newSize <<= 1; - if (!newReg->data) - newReg->data = &EmptyData; - else if (newReg->data->size) - newReg->data->numRects = 0; - if (newSize > newReg->data->size) - miXieRectAlloc(newReg, newSize); - - /* - * Initialize ybot. - * In the upcoming loop, ybot and ytop serve different functions depending - * on whether the band being handled is an overlapping or non-overlapping - * band. - * In the case of a non-overlapping band (only one of the regions - * has points in the band), ybot is the bottom of the most recent - * intersection and thus clips the top of the rectangles in that band. - * ytop is the top of the next intersection between the two regions and - * serves to clip the bottom of the rectangles in the current band. - * For an overlapping band (where the two regions intersect), ytop clips - * the top of the rectangles of both regions and ybot clips the bottoms. - */ - - ybot = min(r1->y1, r2->y1); - - /* - * prevBand serves to mark the start of the previous band so rectangles - * can be coalesced into larger rectangles. qv. miXieCoalesce, above. - * In the beginning, there is no previous band, so prevBand == curBand - * (curBand is set later on, of course, but the first band will always - * start at index 0). prevBand and curBand must be indices because of - * the possible expansion, and resultant moving, of the new region's - * array of rectangles. - */ - prevBand = 0; - - do { - /* - * This algorithm proceeds one source-band (as opposed to a - * destination band, which is determined by where the two regions - * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the - * rectangle after the last one in the current band for their - * respective regions. - */ - assert(r1 != r1End); - assert(r2 != r2End); - - FindBand(r1, r1BandEnd, r1End, r1y1); - FindBand(r2, r2BandEnd, r2End, r2y1); - - /* - * First handle the band that doesn't intersect, if any. - * - * Note that attention is restricted to one band in the - * non-intersecting region at once, so if a region has n - * bands between the current position and the next place it overlaps - * the other, this entire loop will be passed through n times. - */ - if (r1y1 < r2y1) { - if (appendNon1) { - top = max(r1y1, ybot); - bot = min(r1->y2, r2y1); - if (top != bot) { - curBand = newReg->data->numRects; - miXieAppendNonO(newReg, r1, r1BandEnd, top, bot); - Coalesce(newReg, prevBand, curBand); - } - } - ytop = r2y1; - } else if (r2y1 < r1y1) { - if (appendNon2) { - top = max(r2y1, ybot); - bot = min(r2->y2, r1y1); - if (top != bot) { - curBand = newReg->data->numRects; - miXieAppendNonO(newReg, r2, r2BandEnd, top, bot); - Coalesce(newReg, prevBand, curBand); - } - } - ytop = r1y1; - } else { - ytop = r1y1; - } - - /* - * Now see if we've hit an intersecting band. The two bands only - * intersect if ybot > ytop - */ - ybot = min(r1->y2, r2->y2); - if (ybot > ytop) { - curBand = newReg->data->numRects; - (* overlapFunc)(newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot, - pOverlap); - Coalesce(newReg, prevBand, curBand); - } - - /* - * If we've finished with a band (y2 == ybot) we skip forward - * in the region to the next band. - */ - if (r1->y2 == ybot) r1 = r1BandEnd; - if (r2->y2 == ybot) r2 = r2BandEnd; - - } while (r1 != r1End && r2 != r2End); - - /* - * Deal with whichever region (if any) still has rectangles left. - * - * We only need to worry about banding and coalescing for the very first - * band left. After that, we can just group all remaining boxes, - * regardless of how many bands, into one final append to the list. - */ - - if ((r1 != r1End) && appendNon1) { - /* Do first nonOverlap1Func call, which may be able to coalesce */ - FindBand(r1, r1BandEnd, r1End, r1y1); - curBand = newReg->data->numRects; - miXieAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); - Coalesce(newReg, prevBand, curBand); - /* Just append the rest of the boxes */ - AppendRegions(newReg, r1BandEnd, r1End); - - } else if ((r2 != r2End) && appendNon2) { - /* Do first nonOverlap2Func call, which may be able to coalesce */ - FindBand(r2, r2BandEnd, r2End, r2y1); - curBand = newReg->data->numRects; - miXieAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); - Coalesce(newReg, prevBand, curBand); - /* Append rest of boxes */ - AppendRegions(newReg, r2BandEnd, r2End); - } - - if (oldData) - XieFree(oldData); - - if (!(numRects = newReg->data->numRects)) - { - xfreeData(newReg); - newReg->data = &EmptyData; - } - else if (numRects == 1) - { - newReg->extents = *XIEREGION_BOXPTR(newReg); - xfreeData(newReg); - newReg->data = (XieRegDataPtr)NULL; - } - else - { - DOWNSIZE(newReg, numRects); - } - - return TRUE; -} - -#define MERGERECT(r) \ -{ \ - if (r->x1 <= x2) { \ - /* Merge with current rectangle */ \ - if (r->x1 < x2) *pOverlap = TRUE; \ - if (x2 < r->x2) x2 = r->x2; \ - } else { \ - /* Add current rectangle, start new one */ \ - NEWRECT(pReg, pNextRect, x1, y1, x2, y2); \ - x1 = r->x1; \ - x2 = r->x2; \ - } \ - r++; \ -} - -/*====================================================================== - * XieRegion Union - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miXieUnionO -- - * Handle an overlapping band for the union operation. Picks the - * left-most rectangle each time and merges it into the region. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * pReg is overwritten. - * pOverlap is set to TRUE if any boxes overlap. - * - *----------------------------------------------------------------------- - */ -static Bool -miXieUnionO (pReg, r1, r1End, r2, r2End, y1, y2, pOverlap) - register XieRegionPtr pReg; - register XieBoxPtr r1; - XieBoxPtr r1End; - register XieBoxPtr r2; - XieBoxPtr r2End; - INT32 y1; - INT32 y2; - Bool *pOverlap; -{ - register XieBoxPtr pNextRect; - register int x1; /* left and right side of current union */ - register int x2; - - assert (y1 < y2); - assert(r1 != r1End && r2 != r2End); - - pNextRect = XIEREGION_TOP(pReg); - - /* Start off current rectangle */ - if (r1->x1 < r2->x1) - { - x1 = r1->x1; - x2 = r1->x2; - r1++; - } - else - { - x1 = r2->x1; - x2 = r2->x2; - r2++; - } - while (r1 != r1End && r2 != r2End) - { - if (r1->x1 < r2->x1) MERGERECT(r1) else MERGERECT(r2); - } - - /* Finish off whoever (if any) is left */ - if (r1 != r1End) - { - do - { - MERGERECT(r1); - } while (r1 != r1End); - } - else if (r2 != r2End) - { - do - { - MERGERECT(r2); - } while (r2 != r2End); - } - - /* Add current rectangle */ - NEWRECT(pReg, pNextRect, x1, y1, x2, y2); - - return TRUE; -} - -#define ExchangeRects(a, b) \ -{ \ - XieBoxRec t; \ - t = rects[a]; \ - rects[a] = rects[b]; \ - rects[b] = t; \ -} - -static void -QuickSortRects(rects, numRects) - register XieBoxRec rects[]; - register int numRects; -{ - register int y1; - register int x1; - register int i, j; - register XieBoxPtr r; - - /* Always called with numRects > 1 */ - - do - { - if (numRects == 2) - { - if (rects[0].y1 > rects[1].y1 || - (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1)) - ExchangeRects(0, 1); - return; - } - - /* Choose partition element, stick in location 0 */ - ExchangeRects(0, numRects >> 1); - y1 = rects[0].y1; - x1 = rects[0].x1; - - /* Partition array */ - i = 0; - j = numRects; - do - { - r = &(rects[i]); - do - { - r++; - i++; - } while (i != numRects && - (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1))); - r = &(rects[j]); - do - { - r--; - j--; - } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1)); - if (i < j) - ExchangeRects(i, j); - } while (i < j); - - /* Move partition element back to middle */ - ExchangeRects(0, j); - - /* Recurse */ - if (numRects-j-1 > 1) - QuickSortRects(&rects[j+1], numRects-j-1); - numRects = j; - } while (numRects > 1); -} - -/*- - *----------------------------------------------------------------------- - * miXieRegionValidate -- - * - * Take a ``region'' which is a non-y-x-banded random collection of - * rectangles, and compute a nice region which is the union of all the - * rectangles. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * The passed-in ``region'' may be modified. - * pOverlap set to TRUE if any retangles overlapped, else FALSE; - * - * Strategy: - * Step 1. Sort the rectangles into ascending order with primary key y1 - * and secondary key x1. - * - * Step 2. Split the rectangles into the minimum number of proper y-x - * banded regions. This may require horizontally merging - * rectangles, and vertically coalescing bands. With any luck, - * this step in an identity tranformation (ala the Box widget), - * or a coalescing into 1 box (ala Menus). - * - * Step 3. Merge the separate regions down to a single region by calling - * miXieUnion. Maximize the work each miXieUnion call does by using - * a binary merge. - * - *----------------------------------------------------------------------- - */ - -Bool -miXieRegionValidate(badreg, pOverlap) - XieRegionPtr badreg; - Bool *pOverlap; -{ - /* Descriptor for regions under construction in Step 2. */ - typedef struct { - XieRegionRec reg; - int prevBand; - int curBand; - } XieRegionInfo; - - int numRects; /* Original numRects for badreg */ - XieRegionInfo *ri; /* Array of current regions */ - int numRI; /* Number of entries used in ri */ - int sizeRI; /* Number of entries available in ri */ - int i; /* Index into rects */ - register int j; /* Index into ri */ - register XieRegionInfo *rit; /* &ri[j] */ - register XieRegionPtr reg; /* ri[j].reg */ - register XieBoxPtr box; /* Current box in rects */ - register XieBoxPtr riBox; /* Last box in ri[j].reg */ - register XieRegionPtr hreg; /* ri[j_half].reg */ - - *pOverlap = FALSE; - if (!badreg->data) - { - good(badreg); - return TRUE; - } - numRects = badreg->data->numRects; - if (!numRects) - { - good(badreg); - return TRUE; - } - if (badreg->extents.x1 < badreg->extents.x2) - { - if ((numRects) == 1) - { - xfreeData(badreg); - badreg->data = (XieRegDataPtr) NULL; - } - else - { - DOWNSIZE(badreg, numRects); - } - good(badreg); - return TRUE; - } - - /* Step 1: Sort the rects array into ascending (y1, x1) order */ - QuickSortRects(XIEREGION_BOXPTR(badreg), numRects); - - /* Step 2: Scatter the sorted array into the minimum number of regions */ - - /* Set up the first region to be the first rectangle in badreg */ - /* Note that step 2 code will never overflow the ri[0].reg rects array */ - Must_have_memory = TRUE; /* XXX */ - ri = (XieRegionInfo *) XieMalloc(4 * sizeof(XieRegionInfo)); - Must_have_memory = FALSE; /* XXX */ - sizeRI = 4; - numRI = 1; - ri[0].prevBand = 0; - ri[0].curBand = 0; - ri[0].reg = *badreg; - box = XIEREGION_BOXPTR(&ri[0].reg); - ri[0].reg.extents = *box; - ri[0].reg.data->numRects = 1; - - /* Now scatter rectangles into the minimum set of valid regions. If the - next rectangle to be added to a region would force an existing rectangle - in the region to be split up in order to maintain y-x banding, just - forget it. Try the next region. If it doesn't fit cleanly into any - region, make a new one. */ - - for (i = numRects; --i > 0;) - { - box++; - /* Look for a region to append box to */ - for (j = numRI, rit = ri; --j >= 0; rit++) - { - reg = &rit->reg; - riBox = XIEREGION_END(reg); - - if (box->y1 == riBox->y1 && box->y2 == riBox->y2) - { - /* box is in same band as riBox. Merge or append it */ - if (box->x1 <= riBox->x2) - { - /* Merge it with riBox */ - if (box->x1 < riBox->x2) *pOverlap = TRUE; - if (box->x2 > riBox->x2) riBox->x2 = box->x2; - } - else - { - RECTALLOC(reg, 1); - *XIEREGION_TOP(reg) = *box; - reg->data->numRects++; - } - goto NextRect; /* So sue me */ - } - else if (box->y1 >= riBox->y2) - { - /* Put box into new band */ - if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; - if (reg->extents.x1 > box->x1) reg->extents.x1 = box->x1; - Coalesce(reg, rit->prevBand, rit->curBand); - rit->curBand = reg->data->numRects; - RECTALLOC(reg, 1); - *XIEREGION_TOP(reg) = *box; - reg->data->numRects++; - goto NextRect; - } - /* Well, this region was inappropriate. Try the next one. */ - } /* for j */ - - /* Uh-oh. No regions were appropriate. Create a new one. */ - if (sizeRI == numRI) - { - /* Oops, allocate space for new region information */ - sizeRI <<= 1; - Must_have_memory = TRUE; /* XXX */ - ri = (XieRegionInfo *) XieRealloc(ri, sizeRI * sizeof(XieRegionInfo)); - Must_have_memory = FALSE; /* XXX */ - rit = &ri[numRI]; - } - numRI++; - rit->prevBand = 0; - rit->curBand = 0; - rit->reg.extents = *box; - rit->reg.data = (XieRegDataPtr)NULL; - miXieRectAlloc(&rit->reg, (i+numRI) / numRI); /* MUST force allocation */ -NextRect: ; - } /* for i */ - - /* Make a final pass over each region in order to Coalesce and set - extents.x2 and extents.y2 */ - - for (j = numRI, rit = ri; --j >= 0; rit++) - { - reg = &rit->reg; - riBox = XIEREGION_END(reg); - reg->extents.y2 = riBox->y2; - if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; - Coalesce(reg, rit->prevBand, rit->curBand); - if (reg->data->numRects == 1) /* keep unions happy below */ - { - xfreeData(reg); - reg->data = (XieRegDataPtr)NULL; - } - } - - /* Step 3: Union all regions into a single region */ - while (numRI > 1) - { - int half = numRI/2; - for (j = numRI & 1; j < (half + (numRI & 1)); j++) - { - reg = &ri[j].reg; - hreg = &ri[j+half].reg; - miXieRegionOp(reg, reg, hreg, miXieUnionO, TRUE, TRUE, pOverlap); - if (hreg->extents.x1 < reg->extents.x1) - reg->extents.x1 = hreg->extents.x1; - if (hreg->extents.y1 < reg->extents.y1) - reg->extents.y1 = hreg->extents.y1; - if (hreg->extents.x2 > reg->extents.x2) - reg->extents.x2 = hreg->extents.x2; - if (hreg->extents.y2 > reg->extents.y2) - reg->extents.y2 = hreg->extents.y2; - xfreeData(hreg); - } - numRI -= half; - } - *badreg = ri[0].reg; - XieFree(ri); - good(badreg); - return TRUE; -} Index: xc/programs/Xserver/XIE/mixie/import/miroi.c diff -u xc/programs/Xserver/XIE/mixie/import/miroi.c:3.5 xc/programs/Xserver/XIE/mixie/import/miroi.c:removed --- xc/programs/Xserver/XIE/mixie/import/miroi.c:3.5 Fri Dec 14 14:58:29 2001 +++ xc/programs/Xserver/XIE/mixie/import/miroi.c Sat Feb 28 21:41:59 2004 @@ -1,233 +0,0 @@ -/* $Xorg: miroi.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module miroi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miroi.c -- DDXIE prototype import client roi element - - Robert NC Shelley -- AGE Logic, Inc. April, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/miroi.c,v 3.5 2001/12/14 19:58:29 dawes Exp $ */ - -#define _XIEC_MIROI -#define _XIEC_IROI - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeIROI(); - -/* - * routines used internal to this module - */ -static int CreateIROI(); -static int InitializeIROI(); -static int ActivateIROI(); -static int ResetIROI(); -static int DestroyIROI(); - -/* - * DDXIE ImportROI entry points - */ -static ddElemVecRec miROIVec = { - CreateIROI, - InitializeIROI, - ActivateIROI, - (xieIntProc)NULL, - ResetIROI, - DestroyIROI - }; - -/* - * Private stuff. peTex extension for the ImportClientROI element. - */ -typedef struct _miroidef { - stripPtr next_strip; -} -miROIDefRec, *miROIDefPtr; - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeIROI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = miROIVec; - return TRUE ; -} /* end miAnalyzeIROI */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateIROI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the roi element definition */ - return MakePETex(flo,ped,sizeof(miROIDefRec),NO_SYNC,NO_SYNC); -} /* end CreateIROI */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeIROI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - roiPtr roi = ((iROIDefPtr)ped->elemPvt)->roi; - miROIDefPtr pvt = (miROIDefPtr)ped->peTex->private; - - pvt->next_strip = roi->strips.flink; - - return InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); -} /* end InitializeIROI */ - - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateIROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - miROIDefPtr pvt = (miROIDefPtr)pet->private; - bandPtr bnd = &pet->emitter[0]; - - /* pass a clone of the current/only strip to our recipients */ - - if(!PassStrip(flo,pet,bnd,pvt->next_strip)) - return FALSE; /* alloc error */ - - return TRUE; -} /* end ActivateIROI */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetIROI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetEmitter(ped); - return TRUE; -} /* end ResetIROI */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyIROI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - return TRUE; -} /* end DestroyIROI */ - -/* end module miroi.c */ - Index: xc/programs/Xserver/XIE/mixie/import/miuncomp.c diff -u xc/programs/Xserver/XIE/mixie/import/miuncomp.c:1.6 xc/programs/Xserver/XIE/mixie/import/miuncomp.c:removed --- xc/programs/Xserver/XIE/mixie/import/miuncomp.c:1.6 Fri Dec 14 14:58:29 2001 +++ xc/programs/Xserver/XIE/mixie/import/miuncomp.c Sat Feb 28 21:41:59 2004 @@ -1,960 +0,0 @@ -/* $Xorg: miuncomp.c,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module miuncomp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miuncomp.c -- DDXIE routines for importing uncompressed data - - Dean Verheiden -- AGE Logic, Inc. September 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/import/miuncomp.c,v 1.6 2001/12/14 19:58:29 dawes Exp $ */ - -#define _XIEC_MIUNCOMP - -/* - * Include files - */ -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/***********************************************************************/ -/****************** Aligned data conversion routines *******************/ -/***********************************************************************/ - -/* Single band action routines */ - -void CPreverse_bits( - BytePixel *src, - BytePixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 i; - count = (count + 7) >> 3;/* Pack down to bits */ - - src += leftpad>>3; - for (i = 0; i < count; i++) *dst++ = _ByteReverseTable[*src++]; -} - -void CPpass_bits( - BytePixel *src, - BytePixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ - src += leftpad >> 3; - memcpy((char *)dst,(char *)src, (int)(count + 7) >> 3); -} - -void CPextractstreambits( - BytePixel *src, - BytePixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 i,j; - - bzero(dst, (count + 7) >> 3); - - for (i = 0, j = leftpad; i < count; i++, j += stride) { - if (LOGBYTE_tstbit(src,j) != 0) { - LOGBYTE_setbit(dst,i); - } - } -} - -void CPextractswappedstreambits( - BytePixel *src, - BytePixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 i,j,s; - - bzero(dst, (count + 7) >> 3); - - for (i = 0, j = leftpad; i < count; i++, j += stride) { - s = j ^ 7; /* Larry swap */ - if (LOGBYTE_tstbit(src,s) != 0) { - LOGBYTE_setbit(dst,i); - } - } -} - - -void CPpass_bytes( - BytePixel *src, - BytePixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ - src += leftpad >> 3; - if (stride == 8) - memcpy((char *)dst, (char *)src, (int)count); - else { - CARD32 i; - CARD32 Bstride = stride >> 3; - for (i = 0; i < count; i++, src += Bstride) - *dst++ = *src; - } -} - -void CPswap_pairs( - PairPixel *src, - PairPixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 i; - src += leftpad >> 4; - if (stride == 16) { - for (i = 0; i < count; i++) { - cpswaps(src[i],dst[i]); - } - } else { - int j; - CARD32 Bstride = stride >> 4; - for (i = 0, j = 0; i < count; i++, j += Bstride) { - cpswaps(src[j],dst[i]); - } - } -} - -void CPpass_pairs( - PairPixel *src, - PairPixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ - src += leftpad >> 4; - if (stride == 16) - memcpy((char *)dst, (char *)src, (int)count << 1); - else { - CARD32 i,j; - CARD32 Bstride = stride >> 4; - for (i = 0, j = 0; i < count; i++, j += Bstride) - dst[i] = src[j]; - } -} - -void CPswap_quads( - QuadPixel *src, - QuadPixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 i; - src += leftpad >> 5; - if (stride == 32) { - for (i = 0; i < count; i++) { - cpswapl(src[i],dst[i]); - } - } else { - int j; - CARD32 Bstride = stride >> 5; - for (i = 0, j = 0; i < count; i++, j += Bstride) { - cpswapl(src[j],dst[i]); - } - } -} - -void CPpass_quads( - QuadPixel *src, - QuadPixel *dst, - CARD32 count, - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ - src += leftpad >> 5; - if (stride == 32) - memcpy((char *)dst, (char *)src, (int)count << 2); - else { - CARD32 i,j; - CARD32 Bstride = stride >> 5; - for (i = 0, j = 0; i < count; i++, j += Bstride) - dst[i] = src[j]; - } -} - -#if XIE_FULL -/* Triple Band Byte by Pixel Action routines */ - -/* Stream bits to bits */ -void Sbtob( - BytePixel *src, - BytePixel *idst, - CARD32 count, - miUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD8 mask = pvt->mask; -LogInt *dst = (LogInt *)idst; -int i; - - bzero(dst, (count + 7) >>3); /* zero out the output, only set ones */ - src += pvt->srcoffset; - for (i = 0; i < count; i++, src += Bstride) - if ((*src & mask) != 0) - LOG_setbit(dst,i); -} - -/* Stream in nibbles to BytePixels */ -void SbtoB( - BytePixel *src, - BytePixel *dst, - CARD32 count, - miUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD8 mask = pvt->mask; -CARD8 shift = pvt->shift; -CARD32 i; - - src += pvt->srcoffset; - for (i = 0; i < count; i++, src += Bstride) - *dst++ = (*src & mask) >> shift; -} - -/* Stream to BytePixel */ -void StoB( - BytePixel *src, - BytePixel *dst, - CARD32 count, - miUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD32 i; - - src += pvt->srcoffset; - for (i = 0; i < count; i++, src += Bstride) - *dst++ = *src; -} - -/* Stream to PairPixel (unswapped) */ -void StoP( - PairPixel *isrc, - PairPixel *dst, - CARD32 count, - miUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD8 *src = ((CARD8 *)isrc) + pvt->srcoffset; -CARD32 i; - for (i = 0; i < count; i++, src += Bstride) - *dst++ = *(PairPixel *)src; -} - -/* Stream to PairPixel (swapped) */ -void StosP( - PairPixel *isrc, - PairPixel *dst, - CARD32 count, - miUncompPtr pvt) -{ -CARD32 Bstride = pvt->Bstride; -CARD8 *src = ((CARD8 *)isrc) + pvt->srcoffset; -CARD32 i; - for (i = 0; i < count; i++, src += Bstride) { - PairPixel sval = *(PairPixel *)src; - *dst++ = (sval >> 8) | (sval << 8); - } -} - -#endif /* XIE_FULL */ - - -/***********************************************************************/ -/***************** Unaligned data conversion routines ******************/ -/***********************************************************************/ - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = LSB, Fill Order = LSB */ -void LLUBtoB( - CARD8 *src, /* source byte stream */ - BytePixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD8 bits, wval = 16 - depth, wval2 = 8 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 8) - *dst++ = *src >> bits | (CARD8)(*(src+1) << (wval - bits)) >> wval2; - else { - *dst++ = (CARD8)(*src << (wval2 - bits)) >> wval2; - } - - if ((longbits += stride) > 7) { - src += longbits >> 3; - longbits &= 7; - } - } -} - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = LSB, Fill Order = MSB */ -void LMUBtoB( - CARD8 *src, /* source byte stream */ - BytePixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD8 bits, wval = 16 - depth, wval2 = 8 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 8) - *dst++ = (CARD8)(*src << bits) >> bits | - (CARD8)(*(src + 1) >> (wval - bits)) << (8 - bits); - else - *dst++ = (CARD8)(*src << bits) >> wval2; - - if ((longbits += stride) > 7) { - src += longbits >> 3; - longbits &= 7; - } - } -} - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = MSB, Fill Order = LSB */ -void MLUBtoB( - CARD8 *src, /* source byte stream */ - BytePixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD8 bits, wval = 16 - depth, wval2 = 8 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 8) - *dst++ = (CARD8)(*src >> bits) << (depth + bits - 8) | - (CARD8)(*(src + 1) << (wval - bits)) >> (wval - bits); - else - *dst++ = (CARD8)(*src << (wval2 - bits)) >> wval2; - - if ((longbits += stride) > 7) { - src += longbits >> 3; - longbits &= 7; - } - } -} - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = MSB, Fill Order = MSB */ -void MMUBtoB( - CARD8 *src, /* source byte stream */ - BytePixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD8 bits, wval = 16 - depth, wval2 = 8 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 8) - *dst++ = (CARD8)(*src << bits) >> wval2 | - (CARD8)*(src + 1) >> (wval - bits); - else - *dst++ = (CARD8)(*src << bits) >> wval2; - - if ((longbits += stride) > 7) { - src += longbits >> 3; - longbits &= 7; - } - } -} - -/* Convert a single plane of unaligned pair pixels to pair pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ -void LLUPtoP( - CARD8 *src, /* source byte stream */ - PairPixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD16 bits, wval1 = 32 - depth, wval2 = 24 - depth, wval3 = 16 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 16) - *dst++ = (CARD16)*src >> bits | - (CARD16)*(src + 1) << (8 - bits) | - (CARD16)((CARD16)*(src + 2) << (wval1 - bits)) >> wval3; - else - *dst++ = (CARD16)*src >> bits | - (CARD16)((CARD16)*(src + 1) << (wval2 - bits)) >> wval3; - - longbits += stride; - src += longbits >> 3; - longbits &= 7; - } -} - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = LSB, Fill Order = MSB */ -void LMUPtoP( - CARD8 *src, /* source byte stream */ - PairPixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD16 bits, wval2 = 24 - depth, wval3 = 16 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 16) - *dst++ = (CARD16)((CARD16)*src << (8 + bits)) >> (8 + bits) | - (CARD16)*(src + 1) << (8 - bits) | - (CARD16)((CARD16)*(src + 2) >> (wval2 - bits)) << (16 - bits); - else - *dst++ = (CARD16)((CARD16)*src << (8 + bits)) >> (8 + bits) | - (CARD16)((CARD16)*(src + 1) >> (wval3 - bits)) << (8 - bits); - - longbits += stride; - src += longbits >> 3; - longbits &= 7; - } -} - - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = MSB, Fill Order = LSB */ -void MLUPtoP( - CARD8 *src, /* source byte stream */ - PairPixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD16 bits, wval1 = 32 - depth, wval2 = 24 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 16) - *dst++ = (CARD16)((CARD16)*src >> bits) << (depth + bits - 8) | - (CARD16)*(src + 1) << (depth + bits - 16) | - (CARD16)((CARD16)*(src + 2) << (wval1 - bits)) >> - (wval1 - bits); - else - *dst++ = (CARD16)((CARD16)*src >> bits) << (depth + bits - 8) | - (CARD16)((CARD16)*(src + 1) << (wval2 - bits)) - >> (wval2 - bits); - - longbits += stride; - src += longbits >> 3; - longbits &= 7; - } -} - -/* Convert a single plane of unaligned bytes to bytes */ -/* Pixel Order = MSB, Fill Order = MSB */ -void MMUPtoP( - CARD8 *src, /* source byte stream */ - PairPixel *dst, /* destination byte stream */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, longbits; -CARD16 bits, wval2 = 24 - depth, wval3 = 16 - depth; - - if (leftpad > 7) { - src += leftpad >> 3; - longbits = leftpad & 7; - } else - longbits = leftpad; - - for (p = 0; p < numcmp; p++) { - bits = longbits; - if (bits + depth > 16) - *dst++ = (CARD16)((CARD16)*src << (8 + bits)) >> (wval2 - bits) | - (CARD16)*(src + 1) << (depth + bits - 16) | - (CARD16)*(src + 2) >> (wval2 - bits); - else - *dst++ = (CARD16)((CARD16)*src << (8 + bits)) >> wval3 | - (CARD16)*(src + 1) >> (wval3 - bits); - - longbits += stride; - src += longbits >> 3; - longbits &= 7; - } -} - - -/* Convert a single plane of unaligned quad pixels to quad pixels */ -/* Pixel Order = LSB, Fill Order = LSB */ -void LLUQtoQ( - CARD8 *src, /* source byte stream */ - QuadPixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, bits, wval1 = 56 - depth, wval2 = 48 - depth, wval3 = 32 - depth; - - /* Note: Maximum depth is 24 bits */ - - if (leftpad > 7) { - src += leftpad >> 3; - bits = leftpad & 7; - } else - bits = leftpad; - - for (p = 0; p < numcmp; p++) { - if (bits + depth > 24) - *dst++ = (CARD32)*src >> bits | - (CARD32)*(src + 1) << (8 - bits) | - (CARD32)*(src + 2) << (16 - bits) | - ((CARD32)*(src + 3) << (wval1 - bits)) >> wval3; - else - *dst++ = (CARD32)*src >> bits | - (CARD32)*(src + 1) << (8 - bits) | - ((CARD32)*(src + 2) << (wval2 - bits)) >> wval3; - - bits += stride; - src += bits >> 3; - bits &= 7; - } -} - -/* Convert a single plane of unaligned quad pixels to quad pixels */ -/* Pixel Order = LSB, Fill Order = MSB */ -void LMUQtoQ( - CARD8 *src, /* source byte stream */ - QuadPixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, bits, wval1 = 32 - depth, wval2 = 24 - depth; - - /* Note: Maximum depth is 24 bits */ - - if (leftpad > 7) { - src += leftpad >> 3; - bits = leftpad & 7; - } else - bits = leftpad; - - for (p = 0; p < numcmp; p++) { - if (bits + depth > 24) - *dst++ = ((CARD32)*src << (24 + bits)) >> (24 + bits) | - (CARD32)*(src + 1) << (8 - bits) | - (CARD32)*(src + 2) << (16 - bits) | - ((CARD32)*(src + 3) >> (wval1 - bits)) << (24 - bits); - else - *dst++ = ((CARD32)*src << (24 + bits)) >> (24 + bits) | - (CARD32)*(src + 1) << (8 - bits) | - ((CARD32)*(src + 2) >> (wval2 - bits)) << (16 - bits); - - bits += stride; - src += bits >> 3; - bits &= 7; - } -} - -/* Convert a single plane of unaligned quad pixels to quad pixels */ -/* Pixel Order = MSB, Fill Order = LSB */ -void MLUQtoQ( - CARD8 *src, /* source byte stream */ - QuadPixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, bits, wval1 = 56 - depth, wval2 = 48 - depth; - - /* Note: Maximum depth is 24 bits */ - - if (leftpad > 7) { - src += leftpad >> 3; - bits = leftpad & 7; - } else - bits = leftpad; - - for (p = 0; p < numcmp; p++) { - if (bits + depth > 24) - *dst++ = ((CARD32)*src >> bits) << (depth + bits - 8) | - (CARD32)*(src + 1) << (depth + bits - 16) | - (CARD32)*(src + 2) << (depth + bits - 24) | - ((CARD32)*(src + 3) << (wval1 - bits)) >> (wval1 - bits); - else - *dst++ = ((CARD32)*src >> bits) << (depth + bits - 8) | - (CARD32)*(src + 1) << (depth + bits - 16) | - ((CARD32)*(src + 2) << (wval2 - bits)) >> (wval2 - bits); - - bits += stride; - src += bits >> 3; - bits &= 7; - } -} - -/* Convert a single plane of unaligned quad pixels to quad pixels */ -/* Pixel Order = MSB, Fill Order = MSB */ -void MMUQtoQ( - CARD8 *src, /* source byte stream */ - QuadPixel *dst, /* destination line */ - CARD32 numcmp, /* number of pixels on to be converted */ - CARD32 leftpad, /* bit offset to start of first pixel */ - CARD32 depth, /* number of bits per pixel */ - CARD32 stride) /* number of bits needed for this band */ -{ -CARD32 p, bits, wval1 = 56 - depth, wval2 = 32 - depth; - - /* Note: Maximum depth is 24 bits */ - - if (leftpad > 7) { - src += leftpad >> 3; - bits = leftpad & 7; - } else - bits = leftpad; - - for (p = 0; p < numcmp; p++) { - if (bits + depth > 24) - *dst++ = ((CARD32)*src << (24 + bits) >> wval2) | - (CARD32)*(src + 1) << (depth + bits - 16) | - (CARD32)*(src + 2) << (depth + bits - 24) | - (CARD32)*(src + 3) >> (wval2 - bits); - else - *dst++ = ((CARD32)*src << (24 + bits) >> wval2) | - (CARD32)*(src + 1) << (depth + bits - 16) | - (CARD32)*(src + 2) >> (wval1 - bits); - - bits += stride; - src += bits >> 3; - bits &= 7; - } -} - -#if XIE_FULL -/* Triple band by pixel single unaligned pixel extraction routines */ - -#define getLLByte(src,bits,depth) \ - (BytePixel)((bits + depth > 8) ? \ - (*src >> bits | (CARD8)(*(src + 1) \ - << (16 - depth - bits)) >> (8 - depth)) : \ - ((CARD8)(*src << (8 - depth - bits)) >> (8 - depth))) - -#define getLMByte(src,bits,depth) \ - (BytePixel)((bits + depth > 8) ? \ - ((CARD8)(*src << bits) >> bits | \ - (CARD8)(*(src + 1) >> (16 - depth - bits)) << (8 - bits)) : \ - ((CARD8)(*src << bits) >> (8 - depth))) - -#define getMLByte(src,bits,depth) \ - (BytePixel)((bits + depth > 8) ? \ - ((CARD8)(*src >> bits) << (depth + bits - 8) | \ - (CARD8)(*(src + 1) << (16 - depth - bits)) \ - >> (16 - depth - bits)) : \ - ((CARD8)(*src << (8 - depth - bits)) >> (8 - depth))) - -#define getMMByte(src,bits,depth) \ - (BytePixel)((bits + depth > 8) ? \ - ((CARD8)(*src << bits) >> (8 - depth) | \ - (CARD8)*(src + 1) >> (16 - depth - bits)) : \ - ((CARD8)(*src << bits) >> (8 - depth))) - -#define getLLPair(src,bits,depth) \ - (PairPixel)((bits + depth > 16) ? \ - ((CARD16)*src >> bits | \ - (CARD16)*(src + 1) << (8 - bits) | \ - (CARD16)((CARD16)*(src + 2) << (32 - depth - bits))\ - >> (16 - depth)) : \ - ((CARD16)*src >> bits | \ - (CARD16)((CARD16)*(src + 1) \ - << (24 - depth - bits)) >> (16 - depth))) - -#define getLMPair(src,bits,depth) \ - (PairPixel)((bits + depth > 16) ? \ - ((CARD16)((CARD16)*src << (8 + bits)) >> (8 + bits) | \ - (CARD16)*(src + 1) << (8 - bits) | \ - (CARD16)((CARD16)*(src + 2) >> (24 - depth - bits))\ - << (16 - bits)) : \ - ((CARD16)((CARD16)*src << (8 + bits)) >> (8 + bits) | \ - (CARD16)((CARD16)*(src + 1) >> (16 - depth - bits))\ - << (8 - bits))) - -#define getMLPair(src,bits,depth) \ - (PairPixel)((bits + depth > 16) ? \ - ((CARD16)((CARD16)*src >> bits) << (depth + bits - 8) | \ - (CARD16)*(src + 1) << (depth + bits - 16) | \ - (CARD16)((CARD16)*(src + 2) << \ - (32 - depth - bits)) >> (32 - depth - bits)) : \ - ((CARD16)((CARD16)*src >> bits) << (depth + bits - 8) | \ - (CARD16)((CARD16)*(src + 1) << (24 - depth - bits))\ - >> (24 - depth - bits))) - -#define getMMPair(src,bits,depth) \ - (PairPixel)((bits + depth > 16) ? \ - ((CARD16)((CARD16)*src << (8 + bits)) >> (16 - depth) | \ - (CARD16)*(src + 1) << (depth + bits - 16) | \ - (CARD16)*(src + 2) >> (24 - depth - bits)) : \ - ((CARD16)((CARD16)*src << (8 + bits)) >> (16 - depth) | \ - (CARD16)*(src + 1) >> (16 - depth - bits))) - - -/* Convert a triple band by pixel line to three lines of BytePixels */ -#define ProtoThree(fname,dtype0,dtype1,dtype2) \ -void fname( \ - CARD8 *src0, /* source byte stream */ \ - dtype0 *dst0, /* destination line */ \ - dtype1 *dst1, /* destination line */ \ - dtype2 *dst2, /* destination line */ \ - CARD32 numcmp, /* number of triple pixels on to be converted */ \ - CARD32 leftpad, /* bit offset to start of first pixel */ \ - CARD32 depth0, /* number of bits per pixel */ \ - CARD32 depth1, /* number of bits per pixel */ \ - CARD32 depth2, /* number of bits per pixel */ \ - CARD32 stride /* number of bits between triples */ \ - ) - -#define ExtractThree(fname,dtype0,dtype1,dtype2,extract0,extract1,extract2) \ -extern ProtoThree(fname,dtype0,dtype1,dtype2); \ -ProtoThree(fname,dtype0,dtype1,dtype2) \ -{ \ -CARD32 p, bits; \ - if (leftpad > 7) { \ - src0 += (leftpad >> 3); \ - bits = (leftpad & 7); \ - } else \ - bits = leftpad; \ - for (p = 0; p < numcmp; p++) { \ - CARD32 offset1 = (bits + depth0) & 7; \ - CARD32 offset2 = (bits + depth0 + depth1) & 7; \ - CARD8 *src1 = src0 + ((bits + depth0) >> 3); \ - CARD8 *src2 = src0 + ((bits + depth0 + depth1) >> 3); \ - *dst0++ = extract0(src0, bits, depth0); \ - *dst1++ = extract1(src1, offset1, depth1); \ - *dst2++ = extract2(src2, offset2, depth2); \ - if ((bits += stride) > 7) { \ - src0 += (bits >> 3); \ - bits &= 7; \ - } \ - } \ -} - -ExtractThree(LLTBtoBBB,BytePixel,BytePixel,BytePixel,getLLByte,getLLByte,getLLByte) -ExtractThree(LLTBtoBBP,BytePixel,BytePixel,PairPixel,getLLByte,getLLByte,getLLPair) -ExtractThree(LLTBtoBPB,BytePixel,PairPixel,BytePixel,getLLByte,getLLPair,getLLByte) -ExtractThree(LLTBtoBPP,BytePixel,PairPixel,PairPixel,getLLByte,getLLPair,getLLPair) - -ExtractThree(LLTBtoPBB,PairPixel,BytePixel,BytePixel,getLLPair,getLLByte,getLLByte) -ExtractThree(LLTBtoPBP,PairPixel,BytePixel,PairPixel,getLLPair,getLLByte,getLLPair) -ExtractThree(LLTBtoPPB,PairPixel,PairPixel,BytePixel,getLLPair,getLLPair,getLLByte) -ExtractThree(LLTBtoPPP,PairPixel,PairPixel,PairPixel,getLLPair,getLLPair,getLLPair) - -ExtractThree(LMTBtoBBB,BytePixel,BytePixel,BytePixel,getLMByte,getLMByte,getLMByte) -ExtractThree(LMTBtoBBP,BytePixel,BytePixel,PairPixel,getLMByte,getLMByte,getLMPair) -ExtractThree(LMTBtoBPB,BytePixel,PairPixel,BytePixel,getLMByte,getLMPair,getLMByte) -ExtractThree(LMTBtoBPP,BytePixel,PairPixel,PairPixel,getLMByte,getLMPair,getLMPair) - -ExtractThree(LMTBtoPBB,PairPixel,BytePixel,BytePixel,getLMPair,getLMByte,getLMByte) -ExtractThree(LMTBtoPBP,PairPixel,BytePixel,PairPixel,getLMPair,getLMByte,getLMPair) -ExtractThree(LMTBtoPPB,PairPixel,PairPixel,BytePixel,getLMPair,getLMPair,getLMByte) -ExtractThree(LMTBtoPPP,PairPixel,PairPixel,PairPixel,getLMPair,getLMPair,getLMPair) - -ExtractThree(MLTBtoBBB,BytePixel,BytePixel,BytePixel,getMLByte,getMLByte,getMLByte) -ExtractThree(MLTBtoBBP,BytePixel,BytePixel,PairPixel,getMLByte,getMLByte,getMLPair) -ExtractThree(MLTBtoBPB,BytePixel,PairPixel,BytePixel,getMLByte,getMLPair,getMLByte) -ExtractThree(MLTBtoBPP,BytePixel,PairPixel,PairPixel,getMLByte,getMLPair,getMLPair) - -ExtractThree(MLTBtoPBB,PairPixel,BytePixel,BytePixel,getMLPair,getMLByte,getMLByte) -ExtractThree(MLTBtoPBP,PairPixel,BytePixel,PairPixel,getMLPair,getMLByte,getMLPair) -ExtractThree(MLTBtoPPB,PairPixel,PairPixel,BytePixel,getMLPair,getMLPair,getMLByte) -ExtractThree(MLTBtoPPP,PairPixel,PairPixel,PairPixel,getMLPair,getMLPair,getMLPair) - -ExtractThree(MMTBtoBBB,BytePixel,BytePixel,BytePixel,getMMByte,getMMByte,getMMByte) -ExtractThree(MMTBtoBBP,BytePixel,BytePixel,PairPixel,getMMByte,getMMByte,getMMPair) -ExtractThree(MMTBtoBPB,BytePixel,PairPixel,BytePixel,getMMByte,getMMPair,getMMByte) -ExtractThree(MMTBtoBPP,BytePixel,PairPixel,PairPixel,getMMByte,getMMPair,getMMPair) - -ExtractThree(MMTBtoPBB,PairPixel,BytePixel,BytePixel,getMMPair,getMMByte,getMMByte) -ExtractThree(MMTBtoPBP,PairPixel,BytePixel,PairPixel,getMMPair,getMMByte,getMMPair) -ExtractThree(MMTBtoPPB,PairPixel,PairPixel,BytePixel,getMMPair,getMMPair,getMMByte) -ExtractThree(MMTBtoPPP,PairPixel,PairPixel,PairPixel,getMMPair,getMMPair,getMMPair) - -void (*ExtractTripleFuncs[2][2][2][2][2])() = -{ { { { { LLTBtoBBB, LLTBtoBBP }, { LLTBtoBPB, LLTBtoBPP } }, - { { LLTBtoPBB, LLTBtoPBP }, { LLTBtoPPB, LLTBtoPPP } } }, - { { { LMTBtoBBB, LMTBtoBBP }, { LMTBtoBPB, LMTBtoBPP } }, - { { LMTBtoPBB, LMTBtoPBP }, { LMTBtoPPB, LMTBtoPPP } } } }, - { { { { MLTBtoBBB, MLTBtoBBP }, { MLTBtoBPB, MLTBtoBPP } }, - { { MLTBtoPBB, MLTBtoPBP }, { MLTBtoPPB, MLTBtoPPP } } }, - { { { MMTBtoBBB, MMTBtoBBP }, { MMTBtoBPB, MMTBtoBPP } }, - { { MMTBtoPBB, MMTBtoPBP }, { MMTBtoPPB, MMTBtoPPP } } } } }; -#endif /* XIE_FULL */ - -/* end module miuncomp.c */ - - Index: xc/programs/Xserver/XIE/mixie/include/domain.h diff -u xc/programs/Xserver/XIE/mixie/include/domain.h:1.5 xc/programs/Xserver/XIE/mixie/include/domain.h:removed --- xc/programs/Xserver/XIE/mixie/include/domain.h:1.5 Fri Dec 14 14:58:30 2001 +++ xc/programs/Xserver/XIE/mixie/include/domain.h Sat Feb 28 21:41:59 2004 @@ -1,121 +0,0 @@ -/* $Xorg: domain.h,v 1.4 2001/02/09 02:04:27 xorgcvs Exp $ */ -/**** module domain.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - domain.h -- DDXIE MI Process Domain definitions - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/domain.h,v 1.5 2001/12/14 19:58:30 dawes Exp $ */ - - -#ifndef _XIEH_DOMAIN -#define _XIEH_DOMAIN - -#if !defined(_XIEC_DOMAIN) - -#define SyncDomain (*pet->roiinit) -#define GetRun (*pet->roiget) - -extern Bool InitProcDomain( - floDefPtr flo, - peDefPtr ped, - xieTypPhototag dtag, - INT32 offX, - INT32 offY); -extern void ResetProcDomain(peDefPtr ped); - -#endif /* ! defined _XIEC_DOMAIN */ - -/* - * Rectangles of Interest structure definitions - */ - -#define RUNPTR(idx) (&((runPtr)&lp[1])[idx]) -#define LEND(rband) ((linePtr)&rband->strip->data[rband->strip->length]) - -typedef struct _runRec { - CARD32 dstart; /* delta to start of run */ - CARD32 length; /* length of run */ -} runRec, *runPtr; - -typedef struct _linerec { - INT32 y; /* starting y coodinate of this y-x band */ - CARD32 nline; /* height of y-x band */ - CARD32 nrun; /* number of runRecs for this y-x band */ -/* runRec run[nrun]; */ -} lineRec, *linePtr; - -typedef struct _ROIrec { - INT32 x, y; /* min x and y coordinates of bounding box */ - CARD32 width; /* width of bounding box */ - CARD32 height; /* height of bounding box */ - CARD32 nrects; /* number of rectangles in this ROI */ - linePtr lend; /* first address past end of ROI table */ -} ROIRec, *ROIPtr; - -#endif /* module _XIEH_DOMAIN */ Index: xc/programs/Xserver/XIE/mixie/include/fax.h diff -u xc/programs/Xserver/XIE/mixie/include/fax.h:1.4 xc/programs/Xserver/XIE/mixie/include/fax.h:removed --- xc/programs/Xserver/XIE/mixie/include/fax.h:1.4 Fri Dec 14 14:58:30 2001 +++ xc/programs/Xserver/XIE/mixie/include/fax.h Sat Feb 28 21:41:59 2004 @@ -1,226 +0,0 @@ -/* $Xorg: fax.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module fax.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - fax.h -- DDXIE common include file for new spiffy fax modules - - Ben Fahy -- AGE Logic, Inc. May 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/fax.h,v 1.4 2001/12/14 19:58:30 dawes Exp $ */ - -#ifndef XFree86LOADER -#include -#else -#ifndef NULL -#define NULL 0 -#endif -#endif - -/*** entry points */ -extern int decode_g4(); -extern int decode_g32d(); -extern int decode_g31d(); -extern int decode_tiff2(); -extern int decode_tiffpb(); - -/* must match what is in pretab.h */ -#define FAX_MODE_Unknown 0 -#define FAX_MODE_Pass 1 -#define FAX_MODE_Horizontal 2 -#define FAX_MODE_Vertical_L3 3 -#define FAX_MODE_Vertical_L2 4 -#define FAX_MODE_Vertical_L1 5 -#define FAX_MODE_Vertical_C0 6 -#define FAX_MODE_Vertical_R1 7 -#define FAX_MODE_Vertical_R2 8 -#define FAX_MODE_Vertical_R3 9 - -/* extension stuff is optional, so not part of SI ***/ -#define FAX_MODE_Extension_1D FAX_MODE_Unknown -#define FAX_MODE_Extension_2D FAX_MODE_Unknown - -#define FAX_GOAL_StartNewLine 12 -#define FAX_GOAL_DetermineMode 13 -#define FAX_GOAL_HandleVertL3 FAX_MODE_Vertical_L3 -#define FAX_GOAL_HandleVertL2 FAX_MODE_Vertical_L2 -#define FAX_GOAL_HandleVertL1 FAX_MODE_Vertical_L1 -#define FAX_GOAL_HandleVert0 FAX_MODE_Vertical_C0 -#define FAX_GOAL_HandleVertR1 FAX_MODE_Vertical_R1 -#define FAX_GOAL_HandleVertR2 FAX_MODE_Vertical_R2 -#define FAX_GOAL_HandleVertR3 FAX_MODE_Vertical_R3 -#define FAX_GOAL_HandlePass FAX_MODE_Pass -#define FAX_GOAL_HandleHoriz FAX_MODE_Horizontal -#define FAX_GOAL_AccumulateA0A1 14 -#define FAX_GOAL_RecordA0A1 15 -#define FAX_GOAL_AccumulateA1A2 16 -#define FAX_GOAL_RecordA1A2 17 -#define FAX_GOAL_FinishHoriz 18 -#define FAX_GOAL_SeekEOLandTag 19 -#define FAX_GOAL_SeekTagBit 20 -#define FAX_GOAL_AdjustTag 21 -#define FAX_GOAL_RecoverZero 22 -#define FAX_GOAL_AdjustedButStillRecovering 23 -#define FAX_GOAL_FoundOneEOL 24 -#define FAX_GOAL_SkipPastAnyToEOL 25 -#define FAX_GOAL_SeekFillAndEOL 26 -#define FAX_GOAL_FallOnSword 27 - -#define FAX_DECODE_DONE_NOT 0 -#define FAX_DECODE_DONE_OK 1 -#define FAX_DECODE_DONE_ErrorSkipPast 2 -#define FAX_DECODE_DONE_ErrorBadFill 3 -#define FAX_DECODE_DONE_ErrorBadGoal 4 -#define FAX_DECODE_DONE_ErrorBadMagic 5 -#define FAX_DECODE_DONE_ErrorBadStripper 6 -#define FAX_DECODE_DONE_ErrorPastWidth 7 -#define FAX_DECODE_DONE_ErrorBadCode 8 -#define FAX_DECODE_DONE_ErrorBadPtr 9 -#define FAX_DECODE_DONE_ErrorBadZero 10 -#define FAX_DECODE_DONE_ErrorBada0a1 11 -#define FAX_DECODE_DONE_ErrorBada1a2 12 -#define FAX_DECODE_DONE_ErrorBadEOL 13 -#define FAX_DECODE_DONE_ErrorBadA0pos 14 -#define FAX_DECODE_DONE_ErrorPassAboveAllWhite 15 -#define FAX_DECODE_DONE_ErrorMissingEOL 16 - - -#define PB_GOAL_StartNewLine 0 -#define PB_GOAL_GetRunLength 1 -#define PB_GOAL_GetLiteralBytes 2 -#define PB_GOAL_GetRepeatByte 3 -#define PB_GOAL_RepeatBytes 4 - -typedef struct _bit_stream { - int started; /* 0 if requires initialization */ - unsigned char *byteptr; /* address of current byte in strip */ - unsigned char *endptr; /* 1 past last byte in strip */ - int bitpos; /* address of bit in byte (left->r) */ -} BitStream; - -#define StripStateNone 0 /* no strip available yet */ -#define StripStateNew 1 /* offered to decoder for first time */ -#define StripStateInUse 2 /* decoder is using the strip */ -#define StripStateDone 3 /* decoder is done with the strip */ -#define StripStateNoMore 4 /* that's all, folks. */ - -typedef struct _fax_state { - int final; /* if final = 1, all input data is available */ - int decoder_done;/* if done = 1, all data sent has been decoded */ - int write_data; /* distinguish between decode only */ - unsigned char *strip; /* latest available strip */ - int strip_size; /* size of that strips */ - int strip_state; /* whether strip is new, being used, or done */ - int use_magic; /* 1 means we are using magic strip */ - int magic_needs; /* 1 means magic strip only have filled */ - unsigned char magicStrip[8]; - /* "pretend" strip for handling strip edges */ - int o_line; /* absolute output line position */ - int nl_sought; /* how many lines we want, this decode round */ - char **o_lines; /* pointers to beginning of output lines */ - BitStream bits; /* definition of bitstream, current strip */ - int goal; /* our current goal */ - int a0_pos; /* starting changing position on coding line */ - int a1_pos; /* next changing position to right of a0_pos */ - int a0a1; /* distance from a0 to a1 */ - int b1_pos; /* first change above and right of a0, ~color */ - int b2_pos; /* next change above and right of a0, ao_color */ - int a0_color; /* color of a0, either WHITE or BLACK */ - int n_old_trans; /* number of transitions, line above us */ - int *old_trans; /* list of transitions on line above us */ - int n_new_trans; /* number of transitions, current line (so far)*/ - int *new_trans; /* list of transitions on current line */ - int last_b1_idx; /* index of last saved transition we looked at */ - int length_acc; /* accumulates run-lengths for a0a1 or a1a2 */ - int width; /* width of image. So we know end of line */ - int g32d_horiz; /* only relevant for g32d encoding */ - int rl; /* needed if I get EOL in get_a0a1 or get_a1a2 */ - int radiometric; /* if 1, then expand white as 1, else 0 */ -} FaxState; - -/* these definitions should agree with what is in pretab.h */ -#define BAD_RUN_LENGTH (-1) -#define EOL_RUN_LENGTH (-2) -#define WHITE ( 0) -#define BLACK (~WHITE) -#define MIN_BYTES_NEEDED 7 - /* sorry, we can't handle strips of less than 7 bytes. :-( */ - /* it wreaks havoc with our magic strips if we try to go lower */ - -#define WriteLineData(olp,w) \ - zero_even(olp,new_trans,n_new_trans,w,state->radiometric); - -#define FlushLineData() \ - { \ - WriteLineData((char *)state->o_lines[lines_found],width); \ - ++lines_found; \ - } -/* - note: I'm declaring this with no functions, so the caller won't - be tempted to call with lines_found++, which wouldn't work -*/ - -/**** module fax.h ****/ Index: xc/programs/Xserver/XIE/mixie/include/floman.h diff -u xc/programs/Xserver/XIE/mixie/include/floman.h:1.2 xc/programs/Xserver/XIE/mixie/include/floman.h:removed --- xc/programs/Xserver/XIE/mixie/include/floman.h:1.2 Fri Dec 14 14:58:31 2001 +++ xc/programs/Xserver/XIE/mixie/include/floman.h Sat Feb 28 21:41:59 2004 @@ -1,84 +0,0 @@ -/* $Xorg: floman.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module floman.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - floman.h -- DDXIE photoflo manager definitions - - Robert NC Shelley -- AGE Logic, Inc. May 1993 - -******************************************************************************/ - -#ifndef _XIEH_FLOMAN -#define _XIEH_FLOMAN - -#define Create(flo,ped) (*ped->ddVec.create)(flo,ped) -#define Initialize(flo,ped) (*ped->ddVec.initialize)(flo,ped) -#define Activate(flo,ped,pet) (*ped->ddVec.activate)(flo,ped,pet) -#define Flush(flo,ped) (*ped->ddVec.flush)(flo,ped) -#define Reset(flo,ped) (ped->peTex ? (*ped->ddVec.reset)(flo,ped) : 0) -#define Destroy(flo,ped) (ped->peTex ? (*ped->ddVec.destroy)(flo,ped) : 0) - -#endif /* end _XIEH_FLOMAN */ Index: xc/programs/Xserver/XIE/mixie/include/jpeg.h diff -u xc/programs/Xserver/XIE/mixie/include/jpeg.h:1.2 xc/programs/Xserver/XIE/mixie/include/jpeg.h:removed --- xc/programs/Xserver/XIE/mixie/include/jpeg.h:1.2 Fri Dec 14 14:58:31 2001 +++ xc/programs/Xserver/XIE/mixie/include/jpeg.h Sat Feb 28 21:41:59 2004 @@ -1,91 +0,0 @@ -/* $Xorg: jpeg.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - jpeg.h -- DDXIE common include file for jpeg interface code - - Ben Fahy -- AGE Logic, Inc. Oct 1993 - -******************************************************************************/ - - -#ifndef XIE -#define XIE -#endif -#include - -JSAMPIMAGE alloc_sampimage(); - -#define JPEG_BUFFER_BufferError (-1) -#define JPEG_BUFFER_BufferFilled 0 -#define JPEG_BUFFER_NeedAnotherStrip 1 -#define JPEG_BUFFER_LastBuffer 2 - -#define JPEG_FLUSH_Error (-1) -#define JPEG_FLUSH_FlushedAll 1 -#define JPEG_FLUSH_FlushedPart 2 - -#include "jpegd.h" -#include "jpege.h" Index: xc/programs/Xserver/XIE/mixie/include/jpegd.h diff -u xc/programs/Xserver/XIE/mixie/include/jpegd.h:1.2 xc/programs/Xserver/XIE/mixie/include/jpegd.h:removed --- xc/programs/Xserver/XIE/mixie/include/jpegd.h:1.2 Fri Dec 14 14:58:31 2001 +++ xc/programs/Xserver/XIE/mixie/include/jpegd.h Sat Feb 28 21:41:59 2004 @@ -1,155 +0,0 @@ -/* $Xorg: jpegd.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - jpegd.h - common include file for jpeg decoders - - Ben Fahy -- AGE Logic, Inc. Oct 1993 - -******************************************************************************/ - -#define JPEG_DECODE_GOAL_Startup 0 -#define JPEG_DECODE_GOAL_Done 1 -#define JPEG_DECODE_GOAL_ReadDataForInit 2 -#define JPEG_DECODE_GOAL_TryToInit 3 -#define JPEG_DECODE_GOAL_InitDone 4 -#define JPEG_DECODE_GOAL_ProcessData 5 -#define JPEG_DECODE_GOAL_ReadDataForProcess 6 -#define JPEG_DECODE_GOAL_WriteDataForProcess 7 -#define JPEG_DECODE_GOAL_EndOfInput 8 -#define JPEG_DECODE_GOAL_FlushData 9 - -#define JPEG_DECODE_ERROR_BadGoal 1 -#define JPEG_DECODE_ERROR_DecoderIsFreakingOut 2 -#define JPEG_DECODE_ERROR_CouldNotStart 3 -#define JPEG_DECODE_ERROR_CouldNotInit 4 -#define JPEG_DECODE_ERROR_BadInitRetCode 5 -#define JPEG_DECODE_ERROR_BadOutputAlloc 6 -#define JPEG_DECODE_ERROR_DecodeError 7 -#define JPEG_DECODE_ERROR_NoMoreProcessData 8 -#define JPEG_DECODE_ERROR_ColorMismatch 9 -#define JPEG_DECODE_ERROR_WidthMismatch 10 -#define JPEG_DECODE_ERROR_HeightMismatch 11 - -typedef struct _jpeg_decode_state { - int goal; /* what to do next */ - int error_code; /* ooops */ - - int up_sample; /* allow up-sampling or leave as is? */ - int color; /* color image or grayscale? */ - int width,height; /* available elsewhere, but I'm lazy */ - - int o_line; /* absolute output line position */ - int nl_flushed; /* how many lines we have flusehd */ - int nl_found; /* how many lines we have, this round */ - unsigned char **o_lines[3]; - /* pointers to output lines, 3 bands */ - - decompress_info_ptr cinfo; - /* decoder's private state */ - decompress_methods_ptr dc_methods; - external_methods_ptr e_methods; - /* decoder's private methods */ - - unsigned char *jpeg_input_buffer; - unsigned char *jpeg_output_buffer; - /* names self-explanatory? */ - - int strip_size; /* size of currently available strip */ - unsigned char *strip; /* start of currently available strip */ - unsigned char *sptr; /* position within the strip */ - int needs_input_strip; /* need a new strip */ - int i_strip; /* input strip #. nice for debugging */ - int o_strip; /* output strip #. nice for debugging */ - int final; /* this is the last strip */ - int no_more_strips; /* flag saying you can't have any more */ - -} JpegDecodeState; - -extern int decode_jpeg_lossless_color( -#ifdef NEED_PROTOTYPES - JPegDecodeState * /* state */ -#endif -); - -extern int decode_jpeg_lossy_color( -#ifdef NEED_PROTOTYPES - JPegDecodetSate * /* state */ -#endif -); - -extern int decode_jpeg_lossless_gray( -#ifdef NEED_PROTOTYPES - JPegDecodeState * /* state */ -#endif -); - -extern int decode_jpeg_lossy_gray( -#ifdef NEED_PROTOTYPES - JPegDecodeState * /* state */ -#endif -); - - Index: xc/programs/Xserver/XIE/mixie/include/jpege.h diff -u xc/programs/Xserver/XIE/mixie/include/jpege.h:1.2 xc/programs/Xserver/XIE/mixie/include/jpege.h:removed --- xc/programs/Xserver/XIE/mixie/include/jpege.h:1.2 Fri Dec 14 14:58:31 2001 +++ xc/programs/Xserver/XIE/mixie/include/jpege.h Sat Feb 28 21:41:59 2004 @@ -1,173 +0,0 @@ -/* $Xorg: jpege.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - jpege.h - common include file for jpeg encoder - - Ben Fahy -- AGE Logic, Inc. Oct 1993 - -******************************************************************************/ - - -#define JPEG_ENCODE_GOAL_Startup 0 -#define JPEG_ENCODE_GOAL_Done 1 -#define JPEG_ENCODE_GOAL_TryToBeginFrame 2 -#define JPEG_ENCODE_GOAL_WriteHdrData 3 -#define JPEG_ENCODE_GOAL_BeginFrameDone 4 -#define JPEG_ENCODE_GOAL_ProcessData 5 -#define JPEG_ENCODE_GOAL_ReadDataForProcess 6 -#define JPEG_ENCODE_GOAL_WriteDataForProcess 7 -#define JPEG_ENCODE_GOAL_EndOfInput 8 -#define JPEG_ENCODE_GOAL_FlushData 9 -#define JPEG_ENCODE_GOAL_EncodeRGB 10 -#define JPEG_ENCODE_GOAL_EncodeGray 11 -#define JPEG_ENCODE_GOAL_CheckStatus 12 -#define JPEG_ENCODE_GOAL_EndFrame 13 - -#define JPEG_ENCODE_ERROR_BadGoal 1 -#define JPEG_ENCODE_ERROR_EncoderIsFreakingOut 2 -#define JPEG_ENCODE_ERROR_CouldNotStart 3 -#define JPEG_ENCODE_ERROR_CouldNotBeginFrame 4 -#define JPEG_ENCODE_ERROR_BadBeginFrameRetCode 5 -#define JPEG_ENCODE_ERROR_BadOutputAlloc 6 -#define JPEG_ENCODE_ERROR_EncodeError 7 -#define JPEG_ENCODE_ERROR_NoMoreProcessData 8 -#define JPEG_ENCODE_ERROR_ColorMismatch 9 -#define JPEG_ENCODE_ERROR_EndFrameError 10 -#define JPEG_ENCODE_ERROR_EndFrameFreakOut 11 - -typedef struct _jpeg_encode_state { - int goal; /* what to do next */ - int error_code; /* ooops */ - - int n_bands; /* color image or grayscale? */ - int width,height; /* available elsewhere, but I'm lazy */ - - int flush_output; /* how many bytes left to flush */ - int nl_coded; /* how many lines we have, this round */ - int nl_tocode; /* how many lines we want, this round */ - int i_line; /* absolute input line position */ - unsigned char **i_lines[3]; - /* pointers to input lines, 3 bands */ - - compress_info_ptr cinfo; - /* decoder's private state */ - compress_methods_ptr c_methods; - external_methods_ptr e_methods; - /* decoder's private methods */ - - unsigned char *jpeg_input_buffer; - unsigned char *jpeg_output_buffer; - /* names self-explanatory? */ - unsigned char *jpeg_output_bpos; - /* output buffer position during flush */ - - int strip_size; /* size of currently available strip */ - unsigned char *strip; /* start of currently available strip */ - unsigned char *sptr; /* position within the strip */ - int needs_input_strip; /* need a new strip */ - int i_strip; /* input strip #. nice for debugging */ - int o_strip; /* output strip #. nice for debugging */ - int final; /* this is the last strip */ - int no_more_strips; /* flag saying you can't have any more */ - - int strip_req_newbytes;/* number of destination bytes we want */ - - short h_sample[3]; /* horizontal sample factors */ - short v_sample[3]; /* vertical sample factors */ - - int lenQtable; - int lenACtable; - int lenDCtable; - - unsigned char *Qtable; - unsigned char *ACtable; - unsigned char *DCtable; - -} JpegEncodeState; - -extern int encode_jpeg_lossless_color( -#ifdef NEED_PROTOTYPES - JPegEncodeState * /* state */ -#endif -); - -extern int encode_jpeg_lossy_color( -#ifdef NEED_PROTOTYPES - JPegEncodeState * /* state */ -#endif -); - -extern int encode_jpeg_lossless_gray( -#ifdef NEED_PROTOTYPES - JPegEncodeState * /* state */ -#endif -); - -extern int encode_jpeg_lossy_gray( -#ifdef NEED_PROTOTYPES - JPegEncodeState * /* state */ -#endif -); Index: xc/programs/Xserver/XIE/mixie/include/meuncomp.h diff -u xc/programs/Xserver/XIE/mixie/include/meuncomp.h:1.5 xc/programs/Xserver/XIE/mixie/include/meuncomp.h:removed --- xc/programs/Xserver/XIE/mixie/include/meuncomp.h:1.5 Fri Dec 14 14:58:32 2001 +++ xc/programs/Xserver/XIE/mixie/include/meuncomp.h Sat Feb 28 21:41:59 2004 @@ -1,144 +0,0 @@ -/* $Xorg: meuncomp.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module miuncomp.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - meuncomp.c -- DDXIE includes for exporting uncompressed data - - Dean Verheiden -- AGE Logic, Inc. October 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/meuncomp.h,v 1.5 2001/12/14 19:58:32 dawes Exp $ */ - -typedef struct _meuncompdef { - void (*action)(); - CARD32 Bstride; - CARD8 dstoffset; /* Number of bytes offset to this pixel's band */ - CARD8 mask; /* For obtaining subbyte pixels */ - CARD8 shift; /* Necessary shift after obtaining pixel */ - CARD8 bandMap; - CARD8 clear_dst; /* Scanline pad (in bits) */ - CARD8 bitOff; /* more that we can chew? */ - CARD8 leftOver; - CARD8 depth; - CARD16 stride; - CARD8 unaligned; - CARD8 pad; - CARD32 width; - CARD32 pitch; - pointer buf; -} meUncompRec, *meUncompPtr; - -#define MEUNCOMP_BP_ARGS BytePixel *src, BytePixel *dst, meUncompPtr pvt -#define MEUNCOMP_PP_ARGS PairPixel *src, PairPixel *dst, meUncompPtr pvt -#define MEUNCOMP_QP_ARGS QuadPixel *src, QuadPixel *dst, meUncompPtr pvt - -/* Action routines for encoding pixel planes */ -extern void btoS(MEUNCOMP_BP_ARGS); -extern void sbtoS(MEUNCOMP_BP_ARGS); -extern void btoIS(MEUNCOMP_BP_ARGS); -extern void sbtoIS(MEUNCOMP_BP_ARGS); -extern void BtoS(MEUNCOMP_BP_ARGS); -extern void PtoS(MEUNCOMP_PP_ARGS); -extern void sPtoS(MEUNCOMP_PP_ARGS); -extern void QtoS(MEUNCOMP_QP_ARGS); -extern void sQtoS(MEUNCOMP_QP_ARGS); -extern void QtoIS(MEUNCOMP_QP_ARGS); -extern void sQtoIS(MEUNCOMP_QP_ARGS); - -/* Action routines used by Triple band by pixel encoding */ -extern void BtoIS(MEUNCOMP_BP_ARGS); -extern void PtoIS(MEUNCOMP_PP_ARGS); -extern void sPtoIS(MEUNCOMP_PP_ARGS); -extern void BtoISb(MEUNCOMP_BP_ARGS); -extern void btoISb(MEUNCOMP_BP_ARGS); - -#define MEUNCOMP_UB_ARGS BytePixel *src, CARD8 *dst, meUncompPtr pvt -#define MEUNCOMP_UP_ARGS PairPixel *src, CARD8 *dst, meUncompPtr pvt -#define MEUNCOMP_UQ_ARGS QuadPixel *src, CARD8 *dst, meUncompPtr pvt - -/* Unaligned data packing routines */ -extern void BtoLLUB(MEUNCOMP_UB_ARGS); -extern void BtoLMUB(MEUNCOMP_UB_ARGS); -extern void BtoMLUB(MEUNCOMP_UB_ARGS); -extern void BtoMMUB(MEUNCOMP_UB_ARGS); -extern void PtoLLUP(MEUNCOMP_UP_ARGS); -extern void PtoLMUP(MEUNCOMP_UP_ARGS); -extern void PtoMLUP(MEUNCOMP_UP_ARGS); -extern void PtoMMUP(MEUNCOMP_UP_ARGS); -extern void QtoLLUQ(MEUNCOMP_UQ_ARGS); -extern void QtoLMUQ(MEUNCOMP_UQ_ARGS); -extern void QtoMLUQ(MEUNCOMP_UQ_ARGS); -extern void QtoMMUQ(MEUNCOMP_UQ_ARGS); - - -#ifndef _XIEC_MEUNCOMP - -#if XIE_FULL -/* Array of pointers to actions routines for unaligned triple band by pixel */ -extern void (*EncodeTripleFuncs[2][2][2][2][2])(); -#endif - -#endif /* ifdef _XIEC_MEUNCOMP */ Index: xc/programs/Xserver/XIE/mixie/include/microi.h diff -u xc/programs/Xserver/XIE/mixie/include/microi.h:1.2 xc/programs/Xserver/XIE/mixie/include/microi.h:removed --- xc/programs/Xserver/XIE/mixie/include/microi.h:1.2 Fri Dec 14 14:58:32 2001 +++ xc/programs/Xserver/XIE/mixie/include/microi.h Sat Feb 28 21:41:59 2004 @@ -1,119 +0,0 @@ -/* $Xorg: microi.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module microi.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - microi.h -- DDXIE MI ImportClientROI definitions - - Dean Verheiden -- AGE Logic, Inc. August 1993 - -*****************************************************************************/ - -#ifndef _XIEH_MICROI -#define _XIEH_MICROI - - -typedef struct _XieDDXPoint { - INT32 x, y; -} XieDDXPointRec, *XieDDXPointPtr; - -typedef struct _XieBox { - INT32 x1, y1, x2, y2; -} XieBoxRec, *XieBoxPtr; - -typedef struct _XieRegData { - long size; - long numRects; -/* BoxRec rects[size]; in memory but not explicitly declared */ -} XieRegDataRec, *XieRegDataPtr; - -typedef struct _XieRegion { - XieBoxRec extents; - XieRegDataPtr data; -} XieRegionRec, *XieRegionPtr; - -#ifdef _XIEC_MIREGION - -#define XieNullRegion ((XieRegionPtr)0) - -#define XIEREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) -#define XIEREGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) -#define XIEREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) -#define XIEREGION_RECTS(reg) ((reg)->data ? (XieBoxPtr)((reg)->data + 1) \ - : &(reg)->extents) -#define XIEREGION_BOXPTR(reg) ((XieBoxPtr)((reg)->data + 1)) -#define XIEREGION_BOX(reg,i) (&XIEREGION_BOXPTR(reg)[i]) -#define XIEREGION_TOP(reg) XIEREGION_BOX(reg, (reg)->data->numRects) -#define XIEREGION_END(reg) XIEREGION_BOX(reg, (reg)->data->numRects - 1) -#define XIEREGION_SZOF(n) (sizeof(XieRegDataRec) + ((n) * sizeof(XieBoxRec))) - -#else /* defined _XIEC_MIREGION */ - -extern XieRegionPtr miXieRegionCreate(); -extern Bool miXieRegionValidate(); - -#endif - -#endif /* module _XIEH_MICROI */ Index: xc/programs/Xserver/XIE/mixie/include/miphoto.h diff -u xc/programs/Xserver/XIE/mixie/include/miphoto.h:1.2 xc/programs/Xserver/XIE/mixie/include/miphoto.h:removed --- xc/programs/Xserver/XIE/mixie/include/miphoto.h:1.2 Fri Dec 14 14:58:32 2001 +++ xc/programs/Xserver/XIE/mixie/include/miphoto.h Sat Feb 28 21:41:59 2004 @@ -1,85 +0,0 @@ -/* $Xorg: miphoto.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module miphoto.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - miphoto.h -- DDXIE MI prototype ImportPhotomap definitions - - Robert NC Shelley -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ - -#ifndef _XIEH_MIPHOTO -#define _XIEH_MIPHOTO - -/* - * peTex extension for the ImportClientPhotomap element - */ -typedef struct _miphotodef { - stripPtr next_strip[xieValMaxBands]; -} miPhotoDefRec, *miPhotoDefPtr; - -#endif /* module _XIEH_MIPHOTO */ - Index: xc/programs/Xserver/XIE/mixie/include/miuncomp.h diff -u xc/programs/Xserver/XIE/mixie/include/miuncomp.h:1.5 xc/programs/Xserver/XIE/mixie/include/miuncomp.h:removed --- xc/programs/Xserver/XIE/mixie/include/miuncomp.h:1.5 Fri Dec 14 14:58:32 2001 +++ xc/programs/Xserver/XIE/mixie/include/miuncomp.h Sat Feb 28 21:41:59 2004 @@ -1,240 +0,0 @@ -/* $Xorg: miuncomp.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module miuncomp.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - miuncomp.c -- DDXIE includes for importing uncompressed data - - Dean Verheiden -- AGE Logic, Inc. September 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/miuncomp.h,v 1.5 2001/12/14 19:58:32 dawes Exp $ */ - -#define MIUNCOMP_BP_ARGS \ - BytePixel *src, \ - BytePixel *dst, \ - CARD32 count, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -typedef struct _miuncompdef { - stripPtr next_strip; /* used by import photomap only */ - void (*action)(/*MIUNCOMP_BP_ARGS*/); - void (*tripleaction)(MIUNCOMP_BP_ARGS); /* (unknown params; not used?) */ - CARD32 Bstride; - CARD8 srcoffset; /* Number of bytes offset to this pixel's band*/ - CARD8 mask; /* For obtaining subbyte pixels */ - CARD8 shift; /* Necessary shift after obtaining pixel */ - CARD8 bandMap; - CARD8 leftPad; /* Scanline pad (in bits) */ - CARD8 bitOff; /* more that we can chew? */ - BOOL unaligned; /* Flag used by band-by-pixel decoding */ - BOOL reformat; /* Flag used to request data re-formatting */ - pointer buf; -} miUncompRec, *miUncompPtr; - -#ifdef _XIEC_MIUNCOMP - -/* Bit reversal routine for single band uncompressed bitonal images */ -extern void CPreverse_bits(MIUNCOMP_BP_ARGS); -extern void CPpass_bits(MIUNCOMP_BP_ARGS); -extern void CPextractstreambits(MIUNCOMP_BP_ARGS); -extern void CPextractswappedstreambits(MIUNCOMP_BP_ARGS); - -/* Byte copy routine for nicely aligned data */ -extern void CPpass_bytes(MIUNCOMP_BP_ARGS); - -#define MIUNCOMP_PP_ARGS \ - PairPixel *src, \ - PairPixel *dst, \ - CARD32 count, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -/* Pairpixel copy routine for nicely aligned data */ -extern void CPpass_pairs(MIUNCOMP_PP_ARGS); -extern void CPswap_pairs(MIUNCOMP_PP_ARGS); - -#define MIUNCOMP_QP_ARGS \ - QuadPixel *src, \ - QuadPixel *dst, \ - CARD32 count, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -/* Quadpixel copy routine for nicely aligned data */ -extern void CPpass_quads(MIUNCOMP_QP_ARGS); -extern void CPswap_quads(MIUNCOMP_QP_ARGS); - -#if XIE_FULL - -#define MIUNCOMP_SP_ARGS \ - PairPixel *isrc, \ - PairPixel *dst, \ - CARD32 count, \ - miUncompPtr pvt - -#define MIUNCOMP_SB_ARGS \ - BytePixel *src, \ - BytePixel *dst, \ - CARD32 count, \ - miUncompPtr pvt - -/* Action routines used by Triple band by pixel decoding */ -extern void StoB(MIUNCOMP_SB_ARGS); -extern void StoP(MIUNCOMP_SP_ARGS); -extern void StosP(MIUNCOMP_SP_ARGS); -extern void SbtoB(MIUNCOMP_SB_ARGS); -extern void Sbtob(MIUNCOMP_SB_ARGS); -#endif /* XIE_FULL */ - -#define MIUNCOMP_UB_ARGS \ - CARD8 *src, \ - BytePixel *dst, \ - CARD32 numcmp, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -#define MIUNCOMP_UP_ARGS \ - CARD8 *src, \ - PairPixel *dst, \ - CARD32 numcmp, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -#define MIUNCOMP_UQ_ARGS \ - CARD8 *src, \ - QuadPixel *dst, \ - CARD32 numcmp, \ - CARD32 leftpad, \ - CARD32 depth, \ - CARD32 stride - -/* Single band unaligned Stream to Pixel conversion routines */ -extern void LLUBtoB(MIUNCOMP_UB_ARGS); -extern void LMUBtoB(MIUNCOMP_UB_ARGS); -extern void MLUBtoB(MIUNCOMP_UB_ARGS); -extern void MMUBtoB(MIUNCOMP_UB_ARGS); -extern void LLUPtoP(MIUNCOMP_UP_ARGS); -extern void LMUPtoP(MIUNCOMP_UP_ARGS); -extern void MLUPtoP(MIUNCOMP_UP_ARGS); -extern void MMUPtoP(MIUNCOMP_UP_ARGS); -extern void LLUQtoQ(MIUNCOMP_UQ_ARGS); -extern void LMUQtoQ(MIUNCOMP_UQ_ARGS); -extern void MLUQtoQ(MIUNCOMP_UQ_ARGS); -extern void MMUQtoQ(MIUNCOMP_UQ_ARGS); - -#else /* ifdef _XIEC_MIUNCOMP */ - -/* Bit reversal routine for single band uncompressed bitonal images */ -extern void CPreverse_bits(); -extern void CPpass_bits(); -extern void CPextractstreambits(); -extern void CPextractswappedstreambits(); - -/* Byte copy routine for nicely aligned data */ -extern void CPpass_bytes(); - -/* Pairpixel copy routine for nicely aligned data */ -extern void CPpass_pairs(); -extern void CPswap_pairs(); - -/* Quadpixel copy routine for nicely aligned data */ -extern void CPpass_quads(); -extern void CPswap_quads(); - -#if XIE_FULL -/* Action routines used by Triple band by pixel decoding */ -extern void StoB(); -extern void StoP(); -extern void StosP(); -extern void SbtoB(); -extern void Sbtob(); - -/* Array of pointers to actions routines for unaligned triple band by pixel */ -extern void (*ExtractTripleFuncs[2][2][2][2][2])(); - -#endif /* XIE_FULL */ - -/* Single band unaligned Stream to Pixel conversion routines */ -extern void LLUBtoB(); -extern void LMUBtoB(); -extern void MLUBtoB(); -extern void MMUBtoB(); -extern void LLUPtoP(); -extern void LMUPtoP(); -extern void MLUPtoP(); -extern void MMUPtoP(); -extern void LLUQtoQ(); -extern void LMUQtoQ(); -extern void MLUQtoQ(); -extern void MMUQtoQ(); - -#endif /* ifdef _XIEC_MIUNCOMP */ Index: xc/programs/Xserver/XIE/mixie/include/mpgeom.h diff -u xc/programs/Xserver/XIE/mixie/include/mpgeom.h:1.2 xc/programs/Xserver/XIE/mixie/include/mpgeom.h:removed --- xc/programs/Xserver/XIE/mixie/include/mpgeom.h:1.2 Fri Dec 14 14:58:32 2001 +++ xc/programs/Xserver/XIE/mixie/include/mpgeom.h Sat Feb 28 21:41:59 2004 @@ -1,126 +0,0 @@ -/* $Xorg: mpgeom.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module mpgeom.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - mpgeom.h -- DDXIE MI prototype Geometry definitions - - Ben Fahy -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ - -#ifndef _XIEH_MPGEOM -#define _XIEH_MPGEOM - -/* - * peTex extension for the Geometry element - */ -typedef struct _mpgeombanddef { - int finished; /* done with this band */ - int yOut; /* what output line we are on */ - int out_of_bounds; /* if entire input image is missed */ - - double first_mlow, /* lowest input line mapped by first output */ - first_mhigh; /* highest input line mapped by first output */ - double last_mlow, /* lowest input line mapped by last output */ - last_mhigh; /* highest input line mapped by last output */ - double global_mlow, /* lowest input line mapped, overall */ - global_mhigh; /* highest input line mapped, overall */ - - int first_ilow, /* rounded first_mlow */ - first_ihigh; /* rounded first_mhigh */ - int last_ilow, /* rounded last_mlow */ - last_ihigh; /* rounded last_mlow */ - int global_ilow, /* rounded global_mlow */ - global_ihigh; /* rounded global_mlow */ - - /* useful data precalculated for scaling */ - int *x_locs; - int x_start; - int x_end; - int int_constant; /* precalculated for Constrained data fill */ - RealPixel flt_constant; /* precalculated for UnConstrained data fill */ - - /* required by general line filling routine */ - int in_width; - int in_height; - - /* keep track of what input lines we've come across */ - int lo_src_available; - int hi_src_available; - - void (*linefunc) (); - void (*fillfunc) (); - } - mpGeometryBandRec, *mpGeometryBandPtr; - -typedef struct _mpgeometrydef { - int input_line_increases_as_output_line_increases; - int input_map_size; - mpGeometryBandPtr bandInfo[xieValMaxBands]; - } - mpGeometryDefRec, *mpGeometryDefPtr; - -#endif /* module _XIEH_MPGEOM */ Index: xc/programs/Xserver/XIE/mixie/include/mppoint.h diff -u xc/programs/Xserver/XIE/mixie/include/mppoint.h:1.2 xc/programs/Xserver/XIE/mixie/include/mppoint.h:removed --- xc/programs/Xserver/XIE/mixie/include/mppoint.h:1.2 Fri Dec 14 14:58:33 2001 +++ xc/programs/Xserver/XIE/mixie/include/mppoint.h Sat Feb 28 21:41:59 2004 @@ -1,85 +0,0 @@ -/* $Xorg: mppoint.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module mppoint.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - mppoint.h -- DDXIE MI prototype Point definitions - - Ben Fahy -- AGE Logic, Inc. May 1993 - -*****************************************************************************/ - -#ifndef _XIEH_MPPOINT -#define _XIEH_MPPOINT - -#include -/* - * peTex extension for the Point element - */ -typedef struct _mppointdef { - lutPtr lut; -} mpPointDefRec, *mpPointDefPtr; - -#endif /* module _XIEH_MPPOINT */ Index: xc/programs/Xserver/XIE/mixie/include/sched.h diff -u xc/programs/Xserver/XIE/mixie/include/sched.h:1.5 xc/programs/Xserver/XIE/mixie/include/sched.h:removed --- xc/programs/Xserver/XIE/mixie/include/sched.h:1.5 Fri Dec 14 14:58:33 2001 +++ xc/programs/Xserver/XIE/mixie/include/sched.h Sat Feb 28 21:41:59 2004 @@ -1,128 +0,0 @@ -/* $Xorg: sched.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module sched.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - sched.h -- DDXIE machine independent scheduler definitions - - Robert NC Shelley -- AGE Logic, Inc. May 1993 - -******************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/sched.h,v 1.5 2001/12/14 19:58:33 dawes Exp $ */ - -#ifndef _XIEH_SCHED -#define _XIEH_SCHED - -/* scheduler interface - */ -struct _petex; -typedef bandMsk (*xieBandProc)(floDefPtr flo, struct _petex *pet); -typedef struct _schedvec { - xieBoolProc execute; - xieBandProc runnable; -} schedVecRec; - -/* call scheduler to execute until out of data; - * returns Bool: true if flo still active - */ -#define Execute(flo,import_pet) \ - (*flo->schedVec->execute)(flo,import_pet) - -/* detect execution suspension/resumption - * returns Bool: true if scheduler has exited to core X since last checked - * (useful for determining if fresh lookups are needed for core X resources) - */ -#define Resumed(flo,pet) \ - (pet->schedCnt == flo->floTex->exitCnt ? FALSE \ - : ((pet->schedCnt = flo->floTex->exitCnt), TRUE)) - -/* toggle the band's ready bit if "available >= threshold" status has changed - * and return the updated ready mask; - * if the ready bit doesn't toggle, return NO_BANDS - */ -#define CheckSrcReady(bnd,bmsk) \ - (bnd->receptor->ready & (bmsk) \ - ? (bnd->available < bnd->threshold \ - ? (bnd->receptor->ready &= ~(bmsk)) : NO_BANDS) \ - : (bnd->available >= bnd->threshold \ - ? (bnd->receptor->ready |= (bmsk)) : NO_BANDS)) - -/* try to schedule the specified element based on new data arriving for: - * receptorPtr rcp, bandPtr bnd, and bandMsk bmsk - * nothing is returned, but pet->scheduled indicates which bands are runnable - */ -#define Schedule(flo,pet,rcp,bnd,bmsk) \ - { bandMsk r = CheckSrcReady(bnd,bmsk) & rcp->attend; \ - if(r && !pet->scheduled) { \ - if(!pet->inSync) { \ - if(!pet->bandSync || r == (rcp->active & rcp->attend)) {\ - pet->scheduled |= r; \ - InsertMember(pet, &flo->floTex->schedHead); \ - } \ - } else if((r = (*flo->schedVec->runnable)(flo,pet)) != 0) { \ - pet->scheduled = r; \ - InsertMember(pet,&flo->floTex->schedHead); \ - } } } -#endif /* end _XIEH_SCHED */ Index: xc/programs/Xserver/XIE/mixie/include/strip.h diff -u xc/programs/Xserver/XIE/mixie/include/strip.h:1.2 xc/programs/Xserver/XIE/mixie/include/strip.h:removed --- xc/programs/Xserver/XIE/mixie/include/strip.h:1.2 Fri Dec 14 14:58:33 2001 +++ xc/programs/Xserver/XIE/mixie/include/strip.h Sat Feb 28 21:42:00 2004 @@ -1,334 +0,0 @@ -/* $Xorg: strip.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module strip.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - strip.h -- DDXIE machine independent data manager definitions - - Robert NC Shelley -- AGE Logic, Inc. May 1993 - -******************************************************************************/ - -#ifndef _XIEH_STRIP -#define _XIEH_STRIP - -#define STANDARD_STRIP_SIZE 8192 /* temporary hack */ - -/* data management interface */ -typedef struct _stripvec { - xieDataProc make_bytes; - xieDataProc make_lines; - xieBoolProc map_data; - xieDataProc get_data; - xieBoolProc put_data; - xieVoidProc free_data; - xieBoolProc pass_strip; - xieBoolProc import_strips; - xieBoolProc alter_src; - xieVoidProc bypass_src; - xieVoidProc disable_src; - xieVoidProc disable_dst; -} stripVecRec; - -/* per-band scanline/byte data management info - */ -typedef struct _band { - stripLstRec stripLst; /* strips available for processing */ - stripPtr strip; /* strip of most recent access */ - CARD8 *data; /* pointer to most recent line/byte access */ - CARD32 minGlobal; /* lowest available line/byte in stripLst */ - CARD32 minLocal; /* lowest available line/byte in strip */ - CARD32 current; /* line/byte of most recent access */ - CARD32 maxLocal; /* one beyond highest line/byte in strip */ - CARD32 maxGlobal; /* one beyond highest line/byte in stripLst */ - CARD32 pitch; /* number of bytes to start of next line */ - CARD32 mapSize; /* size of dataMap */ - CARD8 **dataMap; /* pointers for multi-line random access */ - CARD32 threshold; /* line/bytes needed for execution */ - CARD32 available; /* line/bytes available in stripLst */ - bandMsk replicate; /* replicate data from band 0 to bands 1 & 2*/ - CARD8 band; /* band number */ - BOOL final; /* true when last line/byte is in stripLst */ - BOOL isInput; /* band type: true = input, false = output */ - struct _receptor *receptor; /* receptor if isInput, otherwise NULL */ - formatPtr format; /* common format info for all strips */ - struct _band *inPlace; /* what to clone to make in-place strips */ - pointer pcroi; /* pointer to ROI entry for current line */ - CARD32 xindex; /* index into pcroi ROI for current x pos */ - INT32 xcount; /* current x location in output band */ - BOOL ypass; /* True = no processing domain this line */ - BOOL inside; /* indicates if inside or outside domain */ - BOOL allpass; /* indicates no lines fall in ROI */ - CARD8 pad; -} bandRec, *bandPtr; - -/************************************************************************** - * Photoflo data manager convenience macros - * - * pointer GetCurrentSrc(flo,pet,bnd) single Src line/byte - * pointer GetCurrentDst(flo,pet,bnd) single Dst line/byte - * pointer GetNextSrc(flo,pet,bnd,purge) single Src line/byte - * pointer GetNextDst(flo,pet,bnd,purge) single Dst line/byte - * pointer GetSrc(flo,pet,bnd,unit,purge) single Src line/byte - * pointer GetDst(flo,pet,bnd,unit,purge) single Dst line/byte - * pointer GetSrcBytes(flo,pet,bnd,unit,len,purge) contiguous Src bytes - * pointer GetDstBytes(flo,pet,bnd,unit,len,purge) contiguous Dst bytes - * Bool MapData(flo,pet,bnd,map,unit,len,purge) map multi-lines/bytes - * Bool PutData(flo,pet,bnd,unit) put multi-lines/bytes - * void FreeData(flo,pet,bnd,unit) free multi-lines/bytes - * Bool PassStrip(flo,pet,bnd,strip) forward clone of strip - * Bool ImportStrips(flo,pet,bnd,strips) import Photomap strips - * Bool AlterSrc(flo,pet,strip) see if Src is mutable - * void BypassSrc(flo,pet,bnd) bypass element for bnd - * void DisableSrc(flo,pet,bnd,purge) disable input for bnd - * void DisableDst(flo,pet,bnd) signal no bnd output - * - * key to common arguments: - * flo floDefPtr - * pet peTexPtr - * bnd bandPtr - * unit line number within canonic image, or - * byte number within non-canonic data stream - * len number of units (lines or bytes) - * purge if the requested data is not in the current strip and purge is - * true, all data preceding the first line or byte in the current - * request is freed (receptor band) or forwarded (emitter band). - * NOTE: purge does not update scheduler info, so FreeData should be - * called for receptor bands prior to returning from the element. - * - * Additional macros: - * AttendBand(bnd) ------- scheduler will consider this band (default) - * IgnoreBand(bnd) ------- scheduler will ignore this band - * AttendReceptor(rcp) --- scheduler will consider this receptor (default) - * IgnoreReceptor(rcp) --- scheduler will ignore this receptor - * SetBandFinal(bnd) ----- set final "true" for band and current strip - * SetBandThreshold(bnd,value) -- set new threshold value - * TruncateStrip(bnd,value) ----- adjust end of strip to value - **************************************************************************/ - -/* utility macros for strip manager internal use only - */ -#define _is_local(bnd) ((bnd)->minLocal <= (bnd)->current && \ - (bnd)->current < (bnd)->maxLocal) -#define _is_global(bnd) ((bnd)->minGlobal <= (bnd)->current && \ - (bnd)->current < (bnd)->maxGlobal) -#define _is_local_contig(bnd,len) ((bnd)->minLocal <= (bnd)->current && \ - (bnd)->current+len <= (bnd)->maxLocal) -#define _is_global_contig(bnd,len) ((bnd)->minGlobal <= (bnd)->current && \ - (bnd)->current+len <= (bnd)->maxGlobal) -#define _byte_ptr(bnd) \ - (&(bnd)->strip->data[(bnd)->current - (bnd)->strip->start]) -#define _line_ptr(bnd) \ - (&(bnd)->strip->data \ - [(bnd)->pitch * ((bnd)->current - (bnd)->strip->start)]) -#define _release_ok(bnd) \ - (!ListEmpty(&(bnd)->stripLst) && \ - ((bnd)->current > (bnd)->stripLst.flink->end || !(bnd)->maxGlobal)) - -/************************************************************************** - * public data management macros for handling strip/scanline/other data - */ -#define AttendBand(bnd) ((bnd)->receptor->attend |= \ - (bnd)->receptor->active & 1<<(bnd)->band) -#define AttendReceptor(rcp) (rcp->attend = rcp->active) -#define IgnoreBand(bnd) ((bnd)->receptor->attend &= ~(1<<(bnd)->band)) -#define IgnoreReceptor(rcp) (rcp->attend = NO_BANDS) -#define SetBandFinal(bnd) ((bnd)->strip \ - ? ((bnd)->final = (bnd)->strip->final = TRUE) \ - : ((bnd)->final = TRUE)) -#define SetBandThreshold(bnd,value) \ - if( ((bnd)->threshold = value) > (bnd)->available) \ - (bnd)->receptor->ready &= ~(1<<(bnd)->band); \ - else (bnd)->receptor->ready |= 1<<(bnd)->band -#define TruncateStrip(bnd,value) \ - {(bnd)->current = (value); \ - if((bnd)->strip && _is_local(bnd)) { \ - int q = (bnd)->maxLocal - (value); \ - (bnd)->strip->length -= q; (bnd)->strip->end -= q; \ - (bnd)->available -= q + (bnd)->maxGlobal - (bnd)->maxLocal;\ - (bnd)->maxGlobal = (bnd)->maxLocal = value; }} - -/* return the current line/byte pointer (NULL if not currently available) - * floDefPtr flo; peTexPtr pet; bandPtr bnd; - */ -#define GetCurrentSrc(flo,pet,bnd) \ - (pointer)((bnd)->data ? (bnd)->data \ - : _is_global(bnd) \ - ? (*flo->stripVec->get_data)(flo,pet,bnd,1,FALSE) \ - : ((bnd)->data = NULL)) -#define GetCurrentDst(flo,pet,bnd) \ - (pointer)((bnd)->data ? (bnd)->data \ - : (*flo->stripVec->make_lines)(flo,pet,bnd,FALSE)) - -/* return the next sequential line/byte pointer (NULL if not available) - * floDefPtr flo; peTexPtr pet; bandPtr bnd; Bool purge; - */ -#define GetNextSrc(flo,pet,bnd,purge) \ - (pointer)(++(bnd)->current < (bnd)->maxLocal \ - ? ((bnd)->data += (bnd)->pitch) \ - : _is_global(bnd) \ - ? (*flo->stripVec->get_data)(flo,pet,bnd,1,purge) \ - : ((bnd)->data = NULL)) -#define GetNextDst(flo,pet,bnd,purge) \ - (pointer)(++(bnd)->current < (bnd)->maxLocal \ - ? ((bnd)->data += (bnd)->pitch) \ - : (*flo->stripVec->make_lines)(flo,pet,bnd,purge)) - -/* return the specified line/byte pointer (random access) - * (returns NULL if not available) - * floDefPtr flo; peTexPtr pet; bandPtr bnd; CARD32 unit; Bool purge; - */ -#define GetSrc(flo,pet,bnd,unit,purge) \ - (pointer)((bnd)->current = unit, _is_local(bnd) \ - ? ((bnd)->data = _line_ptr(bnd)) \ - : _is_global(bnd) \ - ? (*flo->stripVec->get_data)(flo,pet,bnd,1,purge) \ - : ((bnd)->data = NULL)) -#define GetDst(flo,pet,bnd,unit,purge) \ - (pointer)((bnd)->current = unit, _is_local(bnd) \ - ? ((bnd)->data = _line_ptr(bnd)) \ - : (*flo->stripVec->make_lines)(flo,pet,bnd,purge)) - -/* return the specified byte pointer with len contiguous bytes available - * (returns NULL if not available) - * floDefPtr flo; peTexPtr pet; bandPtr bnd; CARD32 unit, len; Bool purge; - * len -- number of contiguous bytes required - */ -#define GetSrcBytes(flo,pet,bnd,unit,len,purge) \ - (pointer)((bnd)->current = unit, _is_local_contig(bnd,len) \ - ? ((bnd)->data = _byte_ptr(bnd)) : _is_global(bnd) \ - ? (*flo->stripVec->get_data)(flo,pet,bnd,len,purge) \ - : ((bnd)->data = NULL)) -#define GetDstBytes(flo,pet,bnd,unit,len,purge) \ - (pointer)((bnd)->current = unit, _is_local_contig(bnd,len) \ - ? ((bnd)->data = _byte_ptr(bnd)) \ - : (*flo->stripVec->make_bytes)(flo,pet,bnd,len,purge)) - -/* load the data map with pointers to a range of lines - * upon return, bnd info points to unit (the first line mapped) - * returns TRUE if all requested lines are available, otherwise FALSE - * floDefPtr flo; peTexPtr pet; bandPtr bnd; - * CARD32 map, unit, len; Bool purge; - * map --- first dataMap index to use (normally 0), - * unit -- first line/byte number to map, - * len --- number of lines/bytes to map; - */ -#define MapData(flo,pet,bnd,map,unit,len,purge) \ - (*flo->stripVec->map_data)(flo,pet,bnd,map,unit,len,purge) - -/* release lines/bytes to downstream recipients (up to but not including unit), - * bnd->data is updated if unit is in current strip (else it is NULLed) - * returns TRUE if the element should suspend itself - * floDefPtr flo; peTexPtr pet; bandPtr bnd; CARD32 unit; - */ -#define PutData(flo,pet,bnd,unit) \ - ((bnd)->data = (bnd)->current == unit ? (bnd)->data \ - : ((bnd)->current = unit, _is_local(bnd) ? _line_ptr(bnd) : NULL), \ - _release_ok(bnd) ? (*flo->stripVec->put_data)(flo,pet,bnd) : FALSE) - -/* free lines/bytes (up to but not including unit) - * upon return, bnd info points to unit, if previously available - * floDefPtr flo; peTexPtr pet; bandPtr bnd; CARD32 unit; - */ -#define FreeData(flo,pet,bnd,unit) \ - ((bnd)->current = unit, (*flo->stripVec->free_data)(flo,pet,bnd)) - -/* import a list of strips from a Photomap - * floDefPtr flo; peTexPtr pet; bandPtr bnd; stripLstPtr strips; - */ -#define ImportStrips(flo,pet,bnd,strips) \ - (*flo->stripVec->import_strips)(flo,pet,bnd,strips) - -/* clone a strip and pass it on to downstream elements - * floDefPtr flo; peTexPtr pet; bandPtr bnd; stripPtr strip; - */ -#define PassStrip(flo,pet,bnd,strip) \ - (*flo->stripVec->pass_strip)(flo,pet,bnd,strip) - -/* check Src strip to see if its data can be over written - * floDefPtr flo; peTexPtr pet; bandPtr bnd; stripPtr strip; - */ -#define AlterSrc(flo,pet,strip) \ - (*flo->stripVec->alter_src)(flo,pet,strip) - -/* flush data from bnd to downstream elements, then set bnd in bypass mode - * floDefPtr flo; peTexPtr pet; bandPtr bnd; - */ -#define BypassSrc(flo,pet,bnd) \ - (*flo->stripVec->bypass_src)(flo,pet,bnd) - -/* disable any further input from bnd, and discard data if purge is true - * floDefPtr flo; peTexPtr pet; bandPtr bnd; Bool purge; - */ -#define DisableSrc(flo,pet,bnd,purge) \ - (*flo->stripVec->disable_src)(flo,pet,bnd,purge) - -/* disable any further output from bnd (i.e. send final, but no data) - * floDefPtr flo; peTexPtr pet; bandPtr bnd; - */ -#define DisableDst(flo,pet,bnd) \ - (*flo->stripVec->disable_dst)(flo,pet,bnd) - -#endif /* end _XIEH_STRIP */ Index: xc/programs/Xserver/XIE/mixie/include/tex.h diff -u xc/programs/Xserver/XIE/mixie/include/tex.h:1.5 xc/programs/Xserver/XIE/mixie/include/tex.h:removed --- xc/programs/Xserver/XIE/mixie/include/tex.h:1.5 Fri Dec 14 14:58:34 2001 +++ xc/programs/Xserver/XIE/mixie/include/tex.h Sat Feb 28 21:42:00 2004 @@ -1,191 +0,0 @@ -/* $Xorg: tex.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module tex.h ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - tex.h -- generic device dependent photoflo definitions - - Dean Verheiden -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/include/tex.h,v 1.5 2001/12/14 19:58:34 dawes Exp $ */ - -#ifndef _XIEH_TEX -#define _XIEH_TEX - -/* symbolic constants -- for flo manager initialization routines - */ - /* Band mask constants for specifying all posible bands or no bands. - */ -#define ALL_BANDS ((bandMsk)~0) -#define NO_BANDS ((bandMsk) 0) - - /* Constant for specifying that in-place operations are not wanted - * (i.e. use new Dst buffers). The alternative is to specify a Src - * (e.g. SRCtag or SRCt1) whose buffer contents can be replaced with - * the result. When requesting a Dst line, the data manager will map - * the requested Dst line to the corresponding Src line (the Src and - * Dst canonic data types must match for this to work). - */ -#define NO_INPLACE ((INT32)-1) - - /* Constant for specifying that no space needs to be allotted for a - * data manager DataMap (i.e. data will be accessed on a line by line - * basis). The alternative is to specify the maximum number of lines - * that will be needed in the DataMap (anywhere from a few lines to - * the full image). - */ -#define NO_DATAMAP ((CARD32) 0) - - /* Constant for specifying that the element does not require any - * private parameter space. The alternative is to specify the number - * of bytes of private storage that will be needed for parameters etc. - * The private area is allocated as contiguous bytes beyond the peTex - * structure, and therefore should not be freed explicitly. - */ -#define NO_PRIVATE ((CARD32) 0) - - /* Constants for specifying whether or not the data manager and - * scheduler should cooperate to keep inputs and/or bands in sync. - */ -#define SYNC ((Bool) 1) -#define NO_SYNC ((Bool) 0) - - -/* symbolic constants -- for data manager macros - */ - /* The following pair of constants can be supplied for the "purge" - * argument in many of the data manager's strip access macros. - * - * KEEP specifies that all data currently owned by the Src or Dst - * should be retained (either the data will be needed again or there - * is no advantage in releasing the data as it is consumed). - * - * FLUSH specifies that all data that precedes the current unit (line - * or byte) can be dispensed with. Src data may be freed, whereas Dst - * data may be forwarded to downstream elements. FLUSH is a suggestion - * rather than a command. Whether or not the data is actually flushed - * depends on the crossing of strip boundaries. If one or more strips - * precede the strip containing the current unit, they will be flushed. - * If a downstream element becomes runnable as a result of forwarding - * a Dst strip, the data manager will signal to the calling element - * that it should defer to the downstream element(s). - */ -#define KEEP ((Bool) 0) -#define FLUSH ((Bool) 1) - - -#ifndef _XIEC_FLOMAN -struct _band; -struct _receptor; - -extern int InitFloManager(floDefPtr flo); -extern int MakePETex( - floDefPtr flo, - peDefPtr ped, - CARD32 extend, - Bool inSync, - Bool bandSync); -extern Bool InitReceptors( - floDefPtr flo, - peDefPtr ped, - CARD32 mapSize, - CARD32 threshold); -extern Bool InitReceptor( - floDefPtr flo, - peDefPtr ped, - struct _receptor * rcp, - CARD32 mapSize, - CARD32 threshold, - unsigned process, - unsigned bypass); -extern Bool InitEmitter( - floDefPtr flo, - peDefPtr ped, - CARD32 mapSize, - INT32 inPlace); -extern Bool InitBand( - floDefPtr flo, - peDefPtr ped, - struct _band * bnd, - CARD32 mapSize, - CARD32 threshold, - INT32 inPlace); -extern void ResetBand(struct _band * bnd); -extern void ResetReceptors(peDefPtr ped); -extern void ResetEmitter(peDefPtr ped); -#endif - -#ifndef _XIEC_SCHED -extern int InitScheduler(floDefPtr flo); -#endif - -#ifndef _XIEC_STRIP -extern int InitStripManager(floDefPtr flo); -extern int DebriefStrips(stripLstPtr i_head, stripLstPtr o_head); -extern void FreeStrips(stripLstPtr head); -#endif - -#endif /* end _XIEH_TEX */ Index: xc/programs/Xserver/XIE/mixie/include/texstr.h diff -u xc/programs/Xserver/XIE/mixie/include/texstr.h:1.2 xc/programs/Xserver/XIE/mixie/include/texstr.h:removed --- xc/programs/Xserver/XIE/mixie/include/texstr.h:1.2 Fri Dec 14 14:58:34 2001 +++ xc/programs/Xserver/XIE/mixie/include/texstr.h Sat Feb 28 21:42:00 2004 @@ -1,150 +0,0 @@ -/* $Xorg: texstr.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/**** module texstr.h ****/ -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - texstr.h -- DDXIE generic photoflo execution context structures - - Dean Verheiden, Robert NC Shelley -- AGE Logic, Inc. April 1993 - -*****************************************************************************/ - -#ifndef _XIEH_TEXSTR -#define _XIEH_TEXSTR - -#include -#include -#include -#include - -#include - -/* - * link-pair for managing a circular doubly linked list of peTexRecs - */ -typedef struct _petlst { - struct _petex *flink; - struct _petex *blink; -} petLstRec, *petLstPtr; - -/* - * photoflo execution context structure - */ -typedef struct _flotex { - CARD32 imports; /* number of bands receiving client data */ - CARD32 exports; /* number of bands supplying client data */ - CARD32 exitCnt; /* incremented each time scheduler exits */ - petLstRec schedHead; /* list of scheduled elements */ - stripLstRec stripHead; /* list of reusable strips */ - CARD32 stripSize; /* size of standard cachable strips */ - CARD32 putCnt; /* incremented each time a strip is "Put" */ - pointer yieldPtr; /* yielding info ptr */ -} floTexRec, *floTexPtr; - -/* - * receptor data structure - */ -typedef struct _receptor { - /* set of per-band Boolean flags: */ - bandMsk admit; /* bands that will admit more data */ - bandMsk ready; /* bands with available >= threshold */ - bandMsk active; /* bands that will produce more data */ - bandMsk attend; /* bands to consider when scheduling */ - bandMsk bypass; /* bands that bypass this element */ - bandMsk forward; /* bands that forward input when freed*/ - CARD8 pad[2]; - inFloPtr inFlo; /* pointer to receptor's inFlo */ - bandRec band[xieValMaxBands]; /* per-band input context */ -} receptorRec, *receptorPtr; - -/* - * photo element execution context structure - */ -typedef struct _petex { - struct _petex *flink; /* foreword link for scheduler list */ - struct _petex *blink; /* backword link for scheduler list */ - peDefPtr peDef; /* pointer to the DIXIE element def */ - outFloPtr outFlo; /* pointer to element's outFlo */ - receptorPtr receptor; /* pointer to in-line receptors */ - pointer private; /* pointer to in-line private info */ - CARD32 schedCnt; /* to detect that scheduler has resumed */ - CARD32 admissionCnt; /* number of receptors expecting data */ - BOOL inSync; /* true if inputs must be kept in sync */ - BOOL bandSync; /* true if bands must be kept in sync */ - bandMsk scheduled; /* bits set if element is on ready-list */ - bandMsk emitting; /* mask of bands that are emitting data */ - bandRec emitter[xieValMaxBands]; /* per-band output context */ - pointer roi; /* pointer to run length/control plane */ - Bool (*roiinit)(); /* process domain line setup function */ - INT32 (*roiget)(); /* process domain run length function */ - INT32 domXoff; /* processing domain x offset */ - INT32 domYoff; /* processing domain y offset */ -#if 0 - receptorRec receptor[inCnt]; /* array of in-line input receptors */ - void private_info; /* in-line element-private data */ -#endif -} peTexRec, *peTexPtr; - -#endif /* end _XIEH_TEXSTR */ Index: xc/programs/Xserver/XIE/mixie/include/xiemd.h diff -u xc/programs/Xserver/XIE/mixie/include/xiemd.h:1.2 xc/programs/Xserver/XIE/mixie/include/xiemd.h:removed --- xc/programs/Xserver/XIE/mixie/include/xiemd.h:1.2 Fri Dec 14 14:58:34 2001 +++ xc/programs/Xserver/XIE/mixie/include/xiemd.h Sat Feb 28 21:42:00 2004 @@ -1,226 +0,0 @@ -/* $Xorg: xiemd.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module xiemd.h ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -****************************************************************************** - - xiemd.h -- DDXIE MI prototype Machine Dependent definitions - - Larry Hare -- AGE Logic, Inc. June 1993 - -*****************************************************************************/ - -#ifndef _XIEH_MD -#define _XIEH_MD - -#include -#include -#include "misc.h" /* for pointer */ -#include - -#ifndef _XIEC_MPBITFUN -extern unsigned char _ByteReverseTable[]; -#endif - -/* -** Bit operations: -** -** DATATYPE DEPENDENT: -** LogInt - Should be chosen as the largest efficient unsigned type which -** supports C based logical operations, as well as loads and -** stores. This will usually be 32 bit unsigned long, but -** might conceivably be an 64 bit type on some newer machines. -** If you change this, update LOGSHIFT. -** LOGSHIFT - Log2 of LOGSIZE -** LOGSIZE - Size of LogInt in bits. You should make sure your compiler -** knows that this is really 32 and not (4<<3). -** LOGMASK - Make sure your compiler thinks this is 31 and not ((4<<3)-1) -** -** ENDIAN DEPENDENT: -** LOGLEFT - LeftMost bit (from screen perspective) in a LogInt. -** LOGRIGHT - In place shift of a LogInt right 1 bit (in screen perspective)> -** -** LOGINDX,LOGBIT - Used by LOG_xxxbit macros for individual access to bits. -** LOG_tstbit - test if a bit from memory is set. -** LOG_chgbit - test if a bit in memory differs from a constant. -** LOG_setbit,LOG_clrbit,LOG_xorbit - set, clr, or xor a bit in memory. -** -** Some pieces of bit related code have been written to use word loops -** using LogInt Bits at a time. Some algorithms use LOG_xxxbit macros -** to access individual bits. -*/ - -#ifdef LONG64 -typedef CARD64 LogInt; -#define LOGSHIFT (6) -#else -typedef CARD32 LogInt; -#define LOGSHIFT (5) -#endif -#define LOGSIZE (sizeof(LogInt)<<3) -#define LOGMASK (LOGSIZE-1) - -#if (IMAGE_BYTE_ORDER == MSBFirst) -#define BitLeft(V,N) ((V) << (N)) -#define BitRight(V,N) ((V) >> (N)) -#else -#define BitLeft(V,N) ((V) >> (N)) -#define BitRight(V,N) ((V) << (N)) -#endif /* endian type */ - -#define LOGLEFT BitLeft(((LogInt)~0),LOGMASK) -#define LOGRIGHT(M) (M=BitRight(M,1)) -#define LOGONES ~((LogInt)0) -#define LOGZERO ((LogInt)0) - -#define LOGINDX(X) ((X)>>LOGSHIFT) -#define LOGBIT(X) BitRight(LOGLEFT,(X) & LOGMASK) -#define LOG_chgbit(P,N,C) (((P)[LOGINDX(N)] ^ C) & LOGBIT(N)) -#define LOG_tstbit(P,N) ((P)[LOGINDX(N)] & LOGBIT(N)) -#define LOG_clrbit(P,N) ((P)[LOGINDX(N)] &= ~LOGBIT(N)) -#define LOG_setbit(P,N) ((P)[LOGINDX(N)] |= LOGBIT(N)) -#define LOG_xorbit(P,N) ((P)[LOGINDX(N)] ^= LOGBIT(N)) - -/* Special version for unsigned bytes used for byte streams that might not be - LogInt aligned -*/ -typedef unsigned char LogByte; -#define LOGBYTESHIFT (3) -#define LOGBYTESIZE (sizeof(LogByte)<<3) -#define LOGBYTEMASK (LOGBYTESIZE-1) - -#define LOGBYTELEFT (LogByte)BitLeft(((LogByte)~0),LOGBYTEMASK) -#define LOGBYTERIGHT(M) (LogByte)(M=BitRight(M,1)) -#define LOGBYTEONES ~((LogByte)0) -#define LOGBYTEZERO ((LogByte)0) - -#define LOGBYTEINDX(X) ((X)>>LOGBYTESHIFT) -#define LOGBYTEBIT(X) BitRight(LOGBYTELEFT,(X) & LOGBYTEMASK) -#define LOGBYTE_chgbit(P,N,C) (((P)[LOGBYTEINDX(N)] ^ C) & LOGBYTEBIT(N)) -#define LOGBYTE_tstbit(P,N) ((P)[LOGBYTEINDX(N)] & LOGBYTEBIT(N)) -#define LOGBYTE_clrbit(P,N) ((P)[LOGBYTEINDX(N)] &= ~LOGBYTEBIT(N)) -#define LOGBYTE_setbit(P,N) ((P)[LOGBYTEINDX(N)] |= LOGBYTEBIT(N)) -#define LOGBYTE_xorbit(P,N) ((P)[LOGBYTEINDX(N)] ^= LOGBYTEBIT(N)) -/* -** Bit Fun. Fun with Bits. Functions for bits: -** -** bitexpand() - expand a bunch of bits to fg,bg bytes. -*/ - -pointer bitexpand(); -void bitshrink(); -void action_clear(); -void action_set(); -void action_invert(); -void zero_even(); - -/* -** Floating Point Considerations. -** -** The following definitions are used in individual modules. We might -** want to regularaize all these in this one file, or even make these -** into one tyepdef like ProcessFloat. The goal is so that the server -** can consistently use floats instead of doubles on machines which -** can do floats quicker than doubles: -** -** typedef float BlendFloat; (see mpblend.c) -** typedef float ConstrainFloat; (see mpcnst.c) -** typedef float DitherFloat; (see mpdither.c) -** typedef float ConvolveFloat; (see element.h) -** typedef float PasteUpFloat; (see element.h) -** -** Some functions are not yet written to this standard. For instance -** geometry is susceptible to roundoff errors keeping track of scanline -** threshold data maps. -** -** typedef RealPixel GeomFloat; -*/ - -/* -** USE_FLOATS is used in mpcnst.c to enable the originaly easy to -** program floating point ClipScale routines. The current integer -** based routine no longer does a divide and is hence probably faster -** on all rational machines. We may come up with other choices for -** integer versus floating algorithms in the future. We would perhaps -** like to select between them here. -** -** #define USE_FLOATS -*/ - -/* -** SF_DITHER - use scaled fractions in floyd steinberg dither for byte -** and pair pixels; quad pixel operations are still done with floats. -** If you have software floating point, you will definitely want to turn -** this code on. Machines with an fpu generally perform at least as good -** with the floating point code. -** -** #define SF_DITHER -*/ - -#if defined(_AM29K) || defined(__i960__) || defined(_LR33020_) || defined(gsp) -#define SF_DITHER -#endif - -#endif /* module _XIEH_MD */ Index: xc/programs/Xserver/XIE/mixie/jpeg/Imakefile diff -u xc/programs/Xserver/XIE/mixie/jpeg/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/jpeg/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/jpeg/Imakefile:3.6 Wed Jan 17 17:13:07 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/Imakefile Sat Feb 28 21:42:00 2004 @@ -1,73 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:46 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/Imakefile,v 3.6 2001/01/17 22:13:07 dawes Exp $ - -XCOMM build device dependent machine independent fax processing element objects - -#define IHaveModules -#include - - SRCS = jcdeflts.c \ - jcexpand.c \ - jchuff.c \ - jcmcu.c \ - jcsample.c \ - jcxie.c \ - jcxief.c \ - jdbuffer.c \ - jddeflts.c \ - jdhuff.c \ - jdlossy.c \ - jdmcu.c \ - jdsample.c \ - jdxie.c \ - jdxief.c \ - jelossy.c \ - jfwddct.c \ - jmemmgr.c \ - jmemsys.c \ - jrdjfif.c \ - jrevdct.c \ - jutils.c \ - jwrjfif.c - - OBJS = jcdeflts.o \ - jcexpand.o \ - jchuff.o \ - jcmcu.o \ - jcsample.o \ - jcxie.o \ - jcxief.o \ - jdbuffer.o \ - jddeflts.o \ - jdhuff.o \ - jdlossy.o \ - jdmcu.o \ - jdsample.o \ - jdxie.o \ - jdxief.o \ - jelossy.o \ - jfwddct.o \ - jmemmgr.o \ - jmemsys.o \ - jrdjfif.o \ - jrevdct.o \ - jutils.o \ - jwrjfif.o - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions -I../jpeg - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(jpeg,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/jpeg/README diff -u xc/programs/Xserver/XIE/mixie/jpeg/README:1.2 xc/programs/Xserver/XIE/mixie/jpeg/README:removed --- xc/programs/Xserver/XIE/mixie/jpeg/README:1.2 Fri Nov 23 14:50:41 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/README Sat Feb 28 21:42:00 2004 @@ -1,402 +0,0 @@ -/* $Xorg: README,v 1.3 2000/08/17 19:47:46 cpqbld Exp $ */ -The Independent JPEG Group's JPEG software -========================================== - -README for release 4 of 10-Dec-92 -================================= - -This distribution contains the fourth public release of the Independent JPEG -Group's free JPEG software. You are welcome to redistribute this software and -to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. - -For installation instructions, see file SETUP. - -For usage instructions, see file USAGE (or the cjpeg.1 and djpeg.1 manual -pages; but USAGE contains a "hints" section not found in the manual pages). -Useful information can also be found in the JPEG FAQ (Frequently Asked -Questions) article; see ARCHIVE LOCATIONS below to obtain the FAQ article. - -This software is still undergoing revision. Updated versions may be obtained -by FTP or UUCP to UUNET and other archive sites; see ARCHIVE LOCATIONS below -for details. - -Serious users of this software (particularly those incorporating it into -larger programs) should contact jpeg-info@uunet.uu.net to be added to our -electronic mailing list. Mailing list members are notified of updates and -have a chance to participate in technical discussions, etc. - -This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz, -Lee Crocker, Ge' Weijers, and other members of the Independent JPEG Group. - - -DISCLAIMER -========== - -THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED. It is not guaranteed to be -useful for anything, nor to be compatible with subsequent releases, nor to be -an accurate implementation of the JPEG standard. (See LEGAL ISSUES for even -more disclaimers.) - -Despite that, we believe that this software is pretty good, and if you find -any problems with it, we'd like to know about them. Please report problems -by e-mail to jpeg-info@uunet.uu.net. - - -WHAT'S HERE -=========== - -This distribution contains C software to implement JPEG image compression and -decompression. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and gray-scale images. JPEG is intended for compressing -"real-world" scenes; cartoons and other non-realistic images are not its -strong suit. JPEG is lossy, meaning that the output image is not necessarily -identical to the input image. Hence you must not use JPEG if you have to have -identical output bits. However, on typical images of real-world scenes, very -good compression levels can be obtained with no visible change, and amazingly -high compression levels are possible if you can tolerate a low-quality image. -For more details, see the references, or just experiment with various -compression settings. - -The software implements JPEG baseline and extended-sequential compression -processes. Provision is made for supporting all variants of these processes, -although some uncommon parameter settings aren't implemented yet. For legal -reasons, we are not distributing code for the arithmetic-coding process; see -LEGAL ISSUES. At present we have made no provision for supporting the -progressive, hierarchical, or lossless processes defined in the standard. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out if not -required for a particular application. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) While we hope that the entire -package will someday be industrial-strength code, much remains to be done in -performance tuning and in improving the capabilities of individual modules. - - -This software can be used on several levels: - -* As canned software for JPEG compression and decompression. Just edit the - Makefile and configuration files as needed (see file SETUP), compile and go. - Members of the Independent JPEG Group will improve the out-of-the-box - functionality and speed as time goes on. - -* As the basis for other JPEG programs. For example, you could incorporate - the decompressor into a general image viewing package by replacing the - output module with write-to-screen functions. For an implementation on - specific hardware, you might want to replace some of the inner loops with - assembly code. For a non-command-line-driven system, you might want a - different user interface. (Members of the group will be producing Macintosh - and Amiga versions with more appropriate user interfaces, for example.) - -* As a toolkit for experimentation with JPEG and JPEG-like algorithms. Most - of the individual decisions you might want to mess with are packaged up into - separate modules. For example, the details of color-space conversion and - subsampling techniques are each localized in one compressor and one - decompressor module. You'd probably also want to extend the user interface - to give you more detailed control over the JPEG compression parameters. - -In particular, we welcome the use of this software as a component of commercial -products; no royalty is required. - - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is ftp.uu.net (Internet -address 137.39.1.9 or 192.48.96.9). The most recent released version can -always be found there in directory graphics/jpeg. This particular version -will be archived as jpegsrc.v4.tar.Z. If you are on the Internet, you can -retrieve files from UUNET by anonymous FTP. If you don't have FTP access, -UUNET's archives are also available via UUCP; contact postmaster@uunet.uu.net -for information on retrieving files that way. - -Numerous Internet sites maintain copies of the UUNET files; in particular, -you can probably find a copy at any site that archives comp.sources.misc -submissions. However, only ftp.uu.net is guaranteed to have the latest -official version. - -You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum -(GO PICS), library 15; this version will be file jpsrc4.zip. Again, -CompuServe is not guaranteed to have the very latest version. - -The JPEG FAQ (Frequently Asked Questions) article is a useful source of -general information about JPEG. It is updated constantly and therefore -is not included in this distribution. The FAQ is posted every two weeks -to Usenet newsgroups comp.graphics, news.answers, and other groups. You -can always obtain the latest version from the news.answers archive at -rtfm.mit.edu (18.172.1.27). By FTP, fetch /pub/usenet/news.answers/jpeg-faq. -If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu with body -"send usenet/news.answers/jpeg-faq". - - -SUPPORTING SOFTWARE -=================== - -You will probably want Jef Poskanzer's PBMPLUS image software, which provides -many useful operations on PPM-format image files. In particular, it can -convert PPM images to and from a wide range of other formats. You can FTP -this free software from export.lcs.mit.edu (contrib/pbmplus*.tar.Z) or -ftp.ee.lbl.gov (pbmplus*.tar.Z). Unfortunately PBMPLUS is not nearly as -portable as the JPEG software is; you are likely to have difficulty making it -work on any non-Unix machine. - -If you are using the X Window System you might want to use the xv or -xloadimage viewers to save yourself the trouble of converting PPM to some other -format. Both of these can be found in the contrib directory at -export.lcs.mit.edu. Actually, xv version 2.00 and up incorporates our software -and thus can read and write JPEG files directly. (NOTE: since xv internally -reduces all images to 8 bits/pixel, a JPEG file written by xv will not be very -high quality; and xv cannot fully exploit a 24-bit display. These problems are -expected to go away in the next xv release, planned for early 1993. In the -meantime, use xloadimage for 24-bit displays.) - -For DOS machines, Lee Crocker's free Piclab program is a useful companion to -the JPEG software. The latest version, currently 1.91, is available by FTP -from SIMTEL20 and its various mirror sites, file piclb191.zip. -CompuServe also has it, in the same library as the JPEG software. - - -SOFTWARE THAT'S NO HELP AT ALL -============================== - -Handmade Software's shareware PC program GIF2JPG produces files that are -totally incompatible with our programs. They use a proprietary format that is -an amalgam of GIF and JPEG representations. However, you can force GIF2JPG -to produce compatible files with its -j switch, and their decompression -program JPG2GIF can read our files (at least ones produced with our default -option settings). - -Some commercial JPEG implementations are also incompatible as of this writing, -especially programs released before summer 1991. The root of the problem is -that the ISO JPEG committee failed to specify a concrete file format. Some -vendors "filled in the blanks" on their own, creating proprietary formats that -no one else could read. (For example, none of the early commercial JPEG -implementations for the Macintosh were able to exchange compressed files.) - -The file format we have adopted is called JFIF (see REFERENCES). This format -has been agreed to by a number of major commercial JPEG vendors, and we expect -that it will become the de facto standard. JFIF is a minimal representation; -work is also going forward to incorporate JPEG compression into the TIFF 6.0 -standard, for use in "high end" applications that need to record a lot of -additional data about an image. We intend to support TIFF 6.0 in the future. -We hope that these two formats will be sufficient and that other, incompatible -JPEG file formats will not proliferate. - -Indeed, part of the reason for developing and releasing this free software is -to help force rapid convergence to de facto standards for JPEG file formats. -SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF 6.0! - - -USING JPEG AS A SUBROUTINE IN A LARGER PROGRAM -============================================== - -You can readily incorporate the JPEG compression and decompression routines in -a larger program. The file example.c provides a skeleton of the interface -routines you'll need for this purpose. Essentially, you replace jcmain.c (for -compression) and/or jdmain.c (for decompression) with your own code. Note -that the fewer JPEG options you allow the user to twiddle, the less code you -need; all the default options are set up automatically. (Alternately, if you -know a lot about JPEG or have a special application, you may want to twiddle -the default options even more extensively than jcmain/jdmain do.) - -Most likely, you will want the uncompressed image to come from memory (for -compression) or go to memory or the screen (for decompression). For this -purpose you must provide image reading or writing routines that match the -interface used by the image file I/O modules (jrdXXX or jwrXXX); again, -example.c shows a skeleton of what is required. In this situation, you -won't need any of the non-JPEG image file I/O modules used by cjpeg and djpeg. - -By default, any error detected inside the JPEG routines will cause a message -to be printed on stderr, followed by exit(). You can override this behavior -by supplying your own message-printing and/or error-exit routines; again, -example.c shows how. - -We recommend you create libjpeg.a as shown in the Makefile, then link that -with your surrounding program. (If your linker is at all reasonable, only the -code you actually need will get loaded.) Include the files jconfig.h and -jpegdata.h in C files that need to call the JPEG routines. - -CAUTION: some people have tried to compile JPEG and their surrounding code -with different compilers, e.g., cc for JPEG and c++ or gcc for the rest. This -is a Real Bad Move and you will deserve what happens to you if you try it. -(Hint: the parameter structures can get laid out differently with no warning.) - -Read our "architecture" file for more info. If it seems to you that the -software structure doesn't accommodate what you want to do, please contact -the authors. - -Beginning with version 3, we will endeavor to hold the interface described by -example.c constant, so that you can plug in updated versions of the JPEG code -just by recompiling. However, we can't guarantee this, especially if you -choose to twiddle any JPEG options not listed in example.c. Check the -CHANGELOG when installing any new version, and compare example.c against the -prior version. Recompile your calling software (don't just relink), as we may -add or subtract fields in the parameter structures. - - -REFERENCES -========== - -We highly recommend reading one or more of these references before trying to -understand the innards of any JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PostScript file containing a revised version of the article is -available at ftp.uu.net, graphics/jpeg/wallace.ps.Z. The file (actually a -preprint for an article to appear in IEEE Trans. Consumer Electronics) omits -the sample images that appeared in CACM, but it includes corrections and some -added material. Note: the Wallace article is copyright ACM and IEEE, and it -may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood -City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and -example C code for a multitude of compression methods including JPEG. It is -an excellent source if you are comfortable reading C code but don't know much -about data compression in general. The book's JPEG sample code is far from -industrial-strength, but when you are ready to look at a full implementation, -you've got one here... - -A new textbook about JPEG is "JPEG Still Image Data Compression Standard" by -William B. Pennebaker and Joan L. Mitchell, published by Van Nostrand -Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95. This book includes the -complete text of the ISO JPEG standards (DIS 10918-1 and draft DIS 10918-2). -This is by far the most complete exposition of JPEG in existence, and I highly -recommend it. If you read the entire book, you will probably know more about -JPEG than I do. - -The JPEG standard itself is not available electronically; you must order a -paper copy through ISO. (Unless you are concerned about having a certified -official copy, I recommend buying the Pennebaker and Mitchell book instead; -it's much cheaper and includes a great deal of useful explanatory material.) -In the US, copies of the standard may be ordered from ANSI Sales at (212) -642-4900. It's not cheap: as of 1992, Part 1 is $95 and Part 2 is $47, plus -7% shipping/handling. The standard is divided into two parts, Part 1 being -the actual specification, while Part 2 covers compliance testing methods. -As of early 1992, Part 1 has Draft International Standard status. It is -titled "Digital Compression and Coding of Continuous-tone Still Images, Part -1: Requirements and guidelines" and has document number ISO/IEC DIS 10918-1. -Part 2 is still at Committee Draft status. It is titled "Digital Compression -and Coding of Continuous-tone Still Images, Part 2: Compliance testing" and -has document number ISO/IEC CD 10918-2. (NOTE: I'm told that the final -version of Part 2 will differ considerably from the CD draft.) - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. A copy of the JFIF spec is available from: - Literature Department - C-Cube Microsystems, Inc. - 399A West Trimble Road - San Jose, CA 95131 - (408) 944-6300 -A PostScript version of this document is available at ftp.uu.net, file -graphics/jpeg/jfif.ps.Z. It can also be obtained by e-mail from the C-Cube -mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg" -to the server to obtain the JFIF document; send the message "help" if you have -trouble. - -The TIFF 6.0 file format specification can be obtained by FTP from sgi.com -(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy -from Aldus Corp. at (206) 628-6593. It should be noted that the TIFF 6.0 spec -of 3-June-92 has a number of serious problems in its JPEG features. A -clarification note will probably be needed to ensure that TIFF JPEG files are -compatible across different implementations. The IJG does not intend to -support TIFF 6.0 until these problems are resolved. - -If you want to understand this implementation, start by reading the -"architecture" documentation file. Please read "codingrules" if you want to -contribute any code. - - -LEGAL ISSUES -============ - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991, 1992, Thomas G. Lane. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - - -ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, -sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. -ansi2knr.c is NOT covered by the above copyright and conditions, but instead -by the usual distribution terms of the Free Software Foundation; principally, -that you must include source code if you redistribute it. (See the file -ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part -of any program generated from the JPEG code, this does not limit you more than -the foregoing paragraphs do. - - -It appears that the arithmetic coding option of the JPEG spec is covered by -patents owned by IBM and AT&T, as well as a pending Japanese patent of -Mitsubishi. Hence arithmetic coding cannot legally be used without obtaining -one or more licenses. For this reason, support for arithmetic coding has been -removed from the free JPEG software. (Since arithmetic coding provides only a -marginal gain over the unpatented Huffman mode, it is unlikely that very many -implementors will support it. If you do obtain the necessary licenses, -contact jpeg-info@uunet.uu.net for a copy of our arithmetic coding modules.) -So far as we are aware, there are no patent restrictions on the remaining -code. - - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - - -TO DO -===== - -The next major release will probably be a significant rewrite to allow use of -this code in conjunction with Sam Leffler's free TIFF library (assuming the -bugs in the TIFF 6.0 specification get resolved). - -Many of the modules need fleshing out to provide more complete -implementations, or to provide faster paths for common cases. -Speeding things up is still high on our priority list. - -We'd appreciate it if people would compile and check out the code on as wide a -variety of systems as possible, and report any portability problems -encountered (with solutions, if possible). Checks of file compatibility with -other JPEG implementations would also be of interest. Finally, we would -appreciate code profiles showing where the most time is spent, especially on -unusual systems. - -Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net. Index: xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c:1.5 Fri Dec 14 14:58:35 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c Sat Feb 28 21:42:00 2004 @@ -1,633 +0,0 @@ -/* $Xorg: jcdeflts.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcdeflts.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/jcdeflts.c,v 1.5 2001/12/14 19:58:35 dawes Exp $ */ -/* - * jcdeflts.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains optional default-setting code for the JPEG compressor. - * User interfaces do not have to use this file, but those that don't use it - * must know a lot more about the innards of the JPEG code. - */ - -#include "jinclude.h" -#include "macro.h" - -#ifndef XIE_SUPPORTED -/* Default do-nothing progress monitoring routine. - * This can be overridden by a user interface that wishes to - * provide progress monitoring; just set methods->progress_monitor - * after j_c_defaults is done. The routine will be called periodically - * during the compression process. - * - * During any one pass, loopcounter increases from 0 up to (not including) - * looplimit; the step size is not necessarily 1. Both the step size and - * the limit may differ between passes. The expected total number of passes - * is in cinfo->total_passes, and the number of passes already completed is - * in cinfo->completed_passes. Thus the fraction of work completed may be - * estimated as - * completed_passes + (loopcounter/looplimit) - * ------------------------------------------ - * total_passes - * ignoring the fact that the passes may not be equal amounts of work. - */ - -METHODDEF void -progress_monitor (compress_info_ptr cinfo, long loopcounter, long looplimit) -{ - /* do nothing */ -} -#endif /* XIE_SUPPORTED */ - - -/* - * Huffman table setup routines - */ - -#ifdef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -add_huff_table (compress_info_ptr cinfo, - HUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) -#else -add_huff_table (cinfo, htblptr, bits, val) - compress_info_ptr cinfo; - HUFF_TBL **htblptr; - const UINT8 *bits; - const UINT8 *val; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -add_huff_table (compress_info_ptr cinfo, - HUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) -#endif /* XIE_SUPPORTED */ -/* Define a Huffman table */ -{ -#ifdef XIE_SUPPORTED - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->c_alloc_small) - (cinfo, SIZEOF(HUFF_TBL)); - if (*htblptr == NULL) - return(XIE_ERR); -#else - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->alloc_small) (SIZEOF(HUFF_TBL)); -#endif /* XIE_SUPPORTED */ - - MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); - MEMCOPY((*htblptr)->huffval, val, SIZEOF((*htblptr)->huffval)); - - /* Initialize sent_table FALSE so table will be written to JPEG file. - * In an application where we are writing non-interchange JPEG files, - * it might be desirable to save space by leaving default Huffman tables - * out of the file. To do that, just initialize sent_table = TRUE... - */ - - (*htblptr)->sent_table = FALSE; -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -std_huff_tables (compress_info_ptr cinfo) -#else -std_huff_tables (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -std_huff_tables (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ -/* IMPORTANT: these are only valid for 8-bit data precision! */ -{ - static const UINT8 dc_luminance_bits[17] = - { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; - static const UINT8 dc_luminance_val[] = - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - - static const UINT8 dc_chrominance_bits[17] = - { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; - static const UINT8 dc_chrominance_val[] = - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - - static const UINT8 ac_luminance_bits[17] = - { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; - static const UINT8 ac_luminance_val[] = - { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, - 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }; - - static const UINT8 ac_chrominance_bits[17] = - { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; - static const UINT8 ac_chrominance_val[] = - { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, - 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, - 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, - 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, - 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }; - -#ifdef XIE_SUPPORTED - if(XIE_ERR == add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], - dc_luminance_bits, dc_luminance_val)) - return(XIE_ERR); - if(XIE_ERR == add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], - ac_luminance_bits, ac_luminance_val)) - return(XIE_ERR); - if(XIE_ERR == add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], - dc_chrominance_bits, dc_chrominance_val)) - return(XIE_ERR); - if(XIE_ERR == add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], - ac_chrominance_bits, ac_chrominance_val)) - return(XIE_ERR); - return(0); -#else - add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], - dc_luminance_bits, dc_luminance_val); - add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], - ac_luminance_bits, ac_luminance_val); - add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], - dc_chrominance_bits, dc_chrominance_val); - add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], - ac_chrominance_bits, ac_chrominance_val); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Quantization table setup routines - */ - -#ifdef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -j_add_quant_table (compress_info_ptr cinfo, int which_tbl, - const QUANT_VAL *basic_table, int scale_factor, - boolean force_baseline) -#else -j_add_quant_table (cinfo, which_tbl, basic_table, scale_factor, force_baseline) - compress_info_ptr cinfo; - int which_tbl; - const QUANT_VAL *basic_table; - int scale_factor; - boolean force_baseline; -#endif /* NeedFunctionPrototypes */ -#else -GLOBAL void -j_add_quant_table (compress_info_ptr cinfo, int which_tbl, - const QUANT_VAL *basic_table, int scale_factor, - boolean force_baseline) -#endif /* XIE_SUPPORTED */ -/* Define a quantization table equal to the basic_table times - * a scale factor (given as a percentage). - * If force_baseline is TRUE, the computed quantization table entries - * are limited to 1..255 for JPEG baseline compatibility. - */ -{ - QUANT_TBL_PTR * qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; - int i; - long temp; - -#ifdef XIE_SUPPORTED - if (*qtblptr == NULL) - *qtblptr = (QUANT_TBL_PTR) (*cinfo->emethods->c_alloc_small) - (cinfo, SIZEOF(QUANT_TBL)); - if (*qtblptr == NULL) - return(XIE_ERR); -#else - if (*qtblptr == NULL) - *qtblptr = (QUANT_TBL_PTR) (*cinfo->emethods->alloc_small) (SIZEOF(QUANT_TBL)); -#endif /* XIE_SUPPORTED */ - - for (i = 0; i < DCTSIZE2; i++) { - temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; - /* limit the values to the valid range */ - if (temp <= 0L) temp = 1L; -#ifdef EIGHT_BIT_SAMPLES - if (temp > 32767L) temp = 32767L; /* QUANT_VALs are 'short' */ -#else - if (temp > 65535L) temp = 65535L; /* QUANT_VALs are 'UINT16' */ -#endif - if (force_baseline && temp > 255L) - temp = 255L; /* limit to baseline range if requested */ - (*qtblptr)[i] = (QUANT_VAL) temp; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -GLOBAL int -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -j_quality_scaling (int quality) -#else -j_quality_scaling (quality) - int quality; -#endif /* NeedFunctionPrototypes */ -#else -j_quality_scaling (int quality) -#endif /* XIE_SUPPORTED */ -/* Convert a user-specified quality rating to a percentage scaling factor - * for an underlying quantization table, using our recommended scaling curve. - * The input 'quality' factor should be 0 (terrible) to 100 (very good). - */ -{ - /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ - if (quality <= 0) quality = 1; - if (quality > 100) quality = 100; - - /* The basic table is used as-is (scaling 100) for a quality of 50. - * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; - * note that at Q=100 the scaling is 0, which will cause j_add_quant_table - * to make all the table entries 1 (hence, no quantization loss). - * Qualities 1..50 are converted to scaling percentage 5000/Q. - */ - if (quality < 50) - quality = 5000 / quality; - else - quality = 200 - quality*2; - - return quality; -} - - -#ifdef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -j_set_quality (compress_info_ptr cinfo, int quality, boolean force_baseline) -#else -j_set_quality (cinfo, quality, force_baseline) - compress_info_ptr cinfo; - int quality; - boolean force_baseline; -#endif /* NeedFunctionPrototypes */ -#else -GLOBAL void -j_set_quality (compress_info_ptr cinfo, int quality, boolean force_baseline) -#endif /* XIE_SUPPORTED */ -/* Set or change the 'quality' (quantization) setting, using default tables. - * This is the standard quality-adjusting entry point for typical user - * interfaces; only those who want detailed control over quantization tables - * would use the preceding two routines directly. - */ -{ - /* This is the sample quantization table given in the JPEG spec section K.1, - * but expressed in zigzag order (as are all of our quant. tables). - * The spec says that the values given produce "good" quality, and - * when divided by 2, "very good" quality. (These two settings are - * selected by quality=50 and quality=75 respectively.) - */ - static const QUANT_VAL std_luminance_quant_tbl[DCTSIZE2] = { - 16, 11, 12, 14, 12, 10, 16, 14, - 13, 14, 18, 17, 16, 19, 24, 40, - 26, 24, 22, 22, 24, 49, 35, 37, - 29, 40, 58, 51, 61, 60, 57, 51, - 56, 55, 64, 72, 92, 78, 64, 68, - 87, 69, 55, 56, 80, 109, 81, 87, - 95, 98, 103, 104, 103, 62, 77, 113, - 121, 112, 100, 120, 92, 101, 103, 99 - }; - static const QUANT_VAL std_chrominance_quant_tbl[DCTSIZE2] = { - 17, 18, 18, 24, 21, 24, 47, 26, - 26, 47, 99, 66, 56, 66, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 - }; - - /* Convert user 0-100 rating to percentage scaling */ - quality = j_quality_scaling(quality); - - /* Set up two quantization tables using the specified quality scaling */ -#ifdef XIE_SUPPORTED - if (j_add_quant_table(cinfo, 0, std_luminance_quant_tbl, - quality, force_baseline) == XIE_ERR) - return(XIE_ERR); - if(j_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, - quality, force_baseline) == XIE_ERR) - return(XIE_ERR); - - return(0); -#else - j_add_quant_table(cinfo, 0, std_luminance_quant_tbl, - quality, force_baseline); - j_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, - quality, force_baseline); -#endif /* XIE_SUPPORTED */ -} - - - -/* Default parameter setup for compression. - * - * User interfaces that don't choose to use this routine must do their - * own setup of all these parameters. Alternately, you can call this - * to establish defaults and then alter parameters selectively. This - * is the recommended approach since, if we add any new parameters, - * your code will still work (they'll be set to reasonable defaults). - * - * See above for the meaning of the 'quality' and 'force_baseline' parameters. - * Typically, the application's default quality setting will be passed to this - * routine. A later call on j_set_quality() can be used to change to a - * user-specified quality setting. - * - * This routine sets up for a color image; to output a grayscale image, - * do this first and call j_monochrome_default() afterwards. - * (The latter can be called within c_ui_method_selection, so the - * choice can depend on the input file header.) - * Note that if you want a JPEG colorspace other than GRAYSCALE or YCbCr, - * you should also change the component ID codes, and you should NOT emit - * a JFIF header (set write_JFIF_header = FALSE). - * - * CAUTION: if you want to compress multiple images per run, it's necessary - * to call j_c_defaults before *each* call to jpeg_compress, since subsidiary - * structures like the Huffman tables are automatically freed during cleanup. - */ - -#ifdef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -j_c_defaults (compress_info_ptr cinfo, int quality, boolean force_baseline) -#else -j_c_defaults (cinfo, quality, force_baseline) - compress_info_ptr cinfo; - int quality; - boolean force_baseline; -#endif /* NeedFunctionPrototypes */ -#else -GLOBAL void -j_c_defaults (compress_info_ptr cinfo, int quality, boolean force_baseline) -#endif /* XIE_SUPPORTED */ -/* NB: the external methods must already be set up. */ -{ - short i; - jpeg_component_info * compptr; - - /* Initialize pointers as needed to mark stuff unallocated. */ - cinfo->comp_info = NULL; - for (i = 0; i < NUM_QUANT_TBLS; i++) - cinfo->quant_tbl_ptrs[i] = NULL; - for (i = 0; i < NUM_HUFF_TBLS; i++) { - cinfo->dc_huff_tbl_ptrs[i] = NULL; - cinfo->ac_huff_tbl_ptrs[i] = NULL; - } - - cinfo->data_precision = BITS_IN_JSAMPLE; /* default; can be overridden by input_init */ - cinfo->density_unit = 0; /* Pixel size is unknown by default */ - cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ - cinfo->Y_density = 1; - - cinfo->input_gamma = 1.0; /* no gamma correction by default */ - - /* Prepare three color components; first is luminance which is also usable */ - /* for grayscale. The others are assumed to be UV or similar chrominance. */ - cinfo->write_JFIF_header = TRUE; - cinfo->jpeg_color_space = CS_YCbCr; - cinfo->num_components = 3; -#ifdef XIE_SUPPORTED - cinfo->comp_info = (jpeg_component_info *) - (*cinfo->emethods->c_alloc_small) - (cinfo, (4 * SIZEOF(jpeg_component_info))); - if (cinfo->comp_info == NULL) - return(XIE_ERR); -#else - cinfo->comp_info = (jpeg_component_info *) - (*cinfo->emethods->alloc_small) (4 * SIZEOF(jpeg_component_info)); -#endif /* XIE_SUPPORTED */ - /* Note: we allocate a 4-entry comp_info array so that user interface can - * easily change over to CMYK color space if desired. - */ - - compptr = &cinfo->comp_info[0]; - compptr->component_index = 0; - compptr->component_id = 1; /* JFIF specifies IDs 1,2,3 */ -#ifdef XIE_SUPPORTED - compptr->h_samp_factor = cinfo->xie_h_samp_factor[0]; - compptr->v_samp_factor = cinfo->xie_v_samp_factor[0]; -#else - compptr->h_samp_factor = 2; /* default to 2x2 subsamples of chrominance */ - compptr->v_samp_factor = 2; -#endif /* XIE_SUPPORTED */ - compptr->quant_tbl_no = 0; /* use tables 0 for luminance */ - compptr->dc_tbl_no = 0; - compptr->ac_tbl_no = 0; - - compptr = &cinfo->comp_info[1]; - compptr->component_index = 1; - compptr->component_id = 2; -#ifdef XIE_SUPPORTED - compptr->h_samp_factor = cinfo->xie_h_samp_factor[1]; - compptr->v_samp_factor = cinfo->xie_v_samp_factor[1]; -#else - compptr->h_samp_factor = 1; - compptr->v_samp_factor = 1; -#endif /* XIE_SUPPORTED */ - compptr->quant_tbl_no = 1; /* use tables 1 for chrominance */ - compptr->dc_tbl_no = 1; - compptr->ac_tbl_no = 1; - - compptr = &cinfo->comp_info[2]; - compptr->component_index = 2; - compptr->component_id = 3; -#ifdef XIE_SUPPORTED - compptr->h_samp_factor = cinfo->xie_h_samp_factor[2]; - compptr->v_samp_factor = cinfo->xie_v_samp_factor[2]; -#else - compptr->h_samp_factor = 1; - compptr->v_samp_factor = 1; -#endif /* XIE_SUPPORTED */ - compptr->quant_tbl_no = 1; /* use tables 1 for chrominance */ - compptr->dc_tbl_no = 1; - compptr->ac_tbl_no = 1; - - /* Set up two quantization tables using the specified quality scaling */ -#ifdef XIE_SUPPORTED - if (j_set_quality(cinfo, quality, force_baseline) == XIE_ERR) - return(XIE_ERR); -#else - j_set_quality(cinfo, quality, force_baseline); -#endif /* XIE_SUPPORTED */ - - /* Set up two Huffman tables in case user interface wants Huffman coding */ -#ifdef XIE_SUPPORTED - if(std_huff_tables(cinfo) == XIE_ERR) - return(XIE_ERR); -#else - std_huff_tables(cinfo); -#endif /* XIE_SUPPORTED */ - - /* Initialize default arithmetic coding conditioning */ - for (i = 0; i < NUM_ARITH_TBLS; i++) { - cinfo->arith_dc_L[i] = 0; - cinfo->arith_dc_U[i] = 1; - cinfo->arith_ac_K[i] = 5; - } - - /* Use Huffman coding, not arithmetic coding, by default */ - cinfo->arith_code = FALSE; - - /* Color images are interleaved by default */ - cinfo->interleave = TRUE; - - /* By default, don't do extra passes to optimize entropy coding */ - cinfo->optimize_coding = FALSE; - - /* By default, use the simpler non-cosited sampling alignment */ - cinfo->CCIR601_sampling = FALSE; - - /* No input smoothing */ - cinfo->smoothing_factor = 0; - - /* No restart markers */ - cinfo->restart_interval = 0; - cinfo->restart_in_rows = 0; - -#ifdef XIE_SUPPORTED - return(0); -#else - /* Install default do-nothing progress monitoring method. */ - cinfo->methods->progress_monitor = progress_monitor; -#endif /* XIE_SUPPORTED */ -} - - - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -j_monochrome_default (compress_info_ptr cinfo) -#else -j_monochrome_default (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -j_monochrome_default (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Change the j_c_defaults() values to emit a monochrome JPEG file. */ -{ - jpeg_component_info * compptr; - - cinfo->jpeg_color_space = CS_GRAYSCALE; - cinfo->num_components = 1; - /* Set single component to 1x1 subsampling */ - compptr = &cinfo->comp_info[0]; - compptr->h_samp_factor = 1; - compptr->v_samp_factor = 1; -} - Index: xc/programs/Xserver/XIE/mixie/jpeg/jcexpand.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcexpand.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jcexpand.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcexpand.c:1.2 Fri Dec 14 14:58:36 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcexpand.c Sat Feb 28 21:42:00 2004 @@ -1,174 +0,0 @@ -/* $Xorg: jcexpand.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcexpand.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jcexpand.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains image edge-expansion routines. - * These routines are invoked via the edge_expand method. - */ - -#include "jinclude.h" - - -/* - * Expand an image so that it is a multiple of the MCU dimensions. - * This is to be accomplished by duplicating the rightmost column - * and/or bottommost row of pixels. The image has not yet been - * downsampled, so all components have the same dimensions. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -edge_expand (compress_info_ptr cinfo, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPIMAGE image_data) -#else -edge_expand (cinfo, input_cols, input_rows, output_cols, output_rows, image_data) - compress_info_ptr cinfo; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPIMAGE image_data; -#endif /* NeedFunctionPrototypes */ -#else -edge_expand (compress_info_ptr cinfo, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPIMAGE image_data) -#endif /* XIE_SUPPORTED */ -{ - /* Expand horizontally */ - if (input_cols < output_cols) { - register JSAMPROW ptr; - register JSAMPLE pixval; - register long count; - register int row; - short ci; - long numcols = output_cols - input_cols; - - for (ci = 0; ci < cinfo->num_components; ci++) { - for (row = 0; row < input_rows; row++) { - ptr = image_data[ci][row] + (input_cols-1); - pixval = GETJSAMPLE(*ptr++); - for (count = numcols; count > 0; count--) - *ptr++ = pixval; - } - } - } - - /* Expand vertically */ - /* This happens only once at the bottom of the image, */ - /* so it needn't be super-efficient */ - if (input_rows < output_rows) { - register int row; - short ci; - JSAMPARRAY this_component; - - for (ci = 0; ci < cinfo->num_components; ci++) { - this_component = image_data[ci]; - for (row = input_rows; row < output_rows; row++) { - jcopy_sample_rows(this_component, input_rows-1, this_component, row, - 1, output_cols); - } - } - } -} - - -/* - * The method selection routine for edge expansion. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselexpand (compress_info_ptr cinfo) -#else -jselexpand (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselexpand (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* just one implementation for now */ - cinfo->methods->edge_expand = edge_expand; -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jchuff.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jchuff.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jchuff.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jchuff.c:1.5 Fri Dec 14 14:58:36 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jchuff.c Sat Feb 28 21:42:00 2004 @@ -1,1030 +0,0 @@ -/* $Xorg: jchuff.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jchuff.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jchuff.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy encoding routines. - * These routines are invoked via the methods entropy_encode, - * entropy_encode_init/term, and entropy_optimize. - */ - -#include "jinclude.h" -#include "macro.h" - - -/* Static variables to avoid passing 'round extra parameters */ - -static compress_info_ptr cinfo; - -static INT32 huff_put_buffer; /* current bit-accumulation buffer */ -static int huff_put_bits; /* # of bits now in it */ - -#ifndef XIE_SUPPORTED -static char * output_buffer; /* output buffer */ -static int bytes_in_buffer; -#endif /* XIE_SUPPORTED */ - - -LOCAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fix_huff_tbl (HUFF_TBL * htbl) -#else -fix_huff_tbl (htbl) - HUFF_TBL * htbl; -#endif /* NeedFunctionPrototypes */ -#else -fix_huff_tbl (HUFF_TBL * htbl) -#endif /* XIE_SUPPORTED */ -/* Compute derived values for a Huffman table */ -{ - int p, i, l, lastp, si; - char huffsize[257]; - UINT16 huffcode[257]; - UINT16 code; - - /* Figure C.1: make table of Huffman code length for each symbol */ - /* Note that this is in code-length order. */ - - p = 0; - for (l = 1; l <= 16; l++) { - for (i = 1; i <= (int) htbl->bits[l]; i++) - huffsize[p++] = (char) l; - } - huffsize[p] = 0; - lastp = p; - - /* Figure C.2: generate the codes themselves */ - /* Note that this is in code-length order. */ - - code = 0; - si = huffsize[0]; - p = 0; - while (huffsize[p]) { - while (((int) huffsize[p]) == si) { - huffcode[p++] = code; - code++; - } - code <<= 1; - si++; - } - - /* Figure C.3: generate encoding tables */ - /* These are code and size indexed by symbol value */ - - /* Set any codeless symbols to have code length 0; - * this allows emit_bits to detect any attempt to emit such symbols. - */ - MEMZERO(htbl->ehufsi, SIZEOF(htbl->ehufsi)); - - for (p = 0; p < lastp; p++) { - htbl->ehufco[htbl->huffval[p]] = huffcode[p]; - htbl->ehufsi[htbl->huffval[p]] = huffsize[p]; - } - - /* We don't bother to fill in the decoding tables mincode[], maxcode[], */ - /* and valptr[], since they are not used for encoding. */ -} - - -/* Outputting bytes to the file */ - -#ifdef XIE_SUPPORTED -LOCAL void -#if NeedFunctionPrototypes -flush_bytes (void) -#else -flush_bytes () -#endif /* NeedFunctionPrototypes */ -{ -} - -#define emit_byte(val) \ - MAKESTMT( if (cinfo->bytes_in_buffer >= cinfo->jpeg_buf_size) \ - return(-1); \ - cinfo->output_buffer[cinfo->bytes_in_buffer++] = (char) (val); ) - -#else -LOCAL void -flush_bytes (void) -{ - if (bytes_in_buffer) - (*cinfo->methods->entropy_output) (cinfo, output_buffer, bytes_in_buffer); - bytes_in_buffer = 0; -} - -#define emit_byte(val) \ - MAKESTMT( if (bytes_in_buffer >= JPEG_BUF_SIZE) \ - flush_bytes(); \ - output_buffer[bytes_in_buffer++] = (char) (val); ) - -#endif /* XIE_SUPPORTED */ - -/* Outputting bits to the file */ - -/* Only the right 24 bits of huff_put_buffer are used; the valid bits are - * left-justified in this part. At most 16 bits can be passed to emit_bits - * in one call, and we never retain more than 7 bits in huff_put_buffer - * between calls, so 24 bits are sufficient. - */ - -INLINE -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_bits (UINT16 code, int size) -#else -emit_bits (code, size) - UINT16 code; - int size; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_bits (UINT16 code, int size) -#endif /* XIE_SUPPORTED */ -{ - /* This routine is heavily used, so it's worth coding tightly. */ - register INT32 put_buffer = code; -#ifdef XIE_SUPPORTED - register int put_bits = cinfo->huff_put_bits; -#else - register int put_bits = huff_put_bits; -#endif /* XIE_SUPPORTED */ - - /* if size is 0, caller used an invalid Huffman table entry */ - if (size == 0) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Missing Huffman code table entry"); -#endif /* XIE_SUPPORTED */ - - put_buffer &= (((INT32) 1) << size) - 1; /* Mask off any excess bits in code */ - - put_bits += size; /* new number of bits in buffer */ - - put_buffer <<= 24 - put_bits; /* align incoming bits */ - -#ifdef XIE_SUPPORTED - put_buffer |= cinfo->huff_put_buffer; /* and merge with old buffer contents */ -#else - put_buffer |= huff_put_buffer; /* and merge with old buffer contents */ -#endif /* XIE_SUPPORTED */ - - while (put_bits >= 8) { - int c = (int) ((put_buffer >> 16) & 0xFF); - - emit_byte(c); - if (c == 0xFF) { /* need to stuff a zero byte? */ - emit_byte(0); - } - put_buffer <<= 8; - put_bits -= 8; - } - -#ifdef XIE_SUPPORTED - cinfo->huff_put_buffer = put_buffer; /* Update global variables */ - cinfo->huff_put_bits = put_bits; - return(0); -#else - huff_put_buffer = put_buffer; /* Update global variables */ - huff_put_bits = put_bits; -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -flush_bits (void) -#else -flush_bits () -#endif /* NeedFunctionPrototypes */ -{ - register int status; - - /* fill any partial byte with ones */ - if ((status = emit_bits((UINT16) 0x7F, 7)) < 0) - return(status); - cinfo->huff_put_buffer = 0; /* and reset bit-buffer to empty */ - cinfo->huff_put_bits = 0; - return(0); -} -#else -LOCAL void -flush_bits (void) -{ - emit_bits((UINT16) 0x7F, 7); /* fill any partial byte with ones */ - huff_put_buffer = 0; /* and reset bit-buffer to empty */ - huff_put_bits = 0; -} -#endif /* XIE_SUPPORTED */ - - - -/* Encode a single block's worth of coefficients */ -/* Note that the DC coefficient has already been converted to a difference */ - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -encode_one_block (JBLOCK block, HUFF_TBL *dctbl, HUFF_TBL *actbl) -#else -encode_one_block (block, dctbl, actbl) - JBLOCK block; - HUFF_TBL *dctbl; - HUFF_TBL *actbl; -#endif /* NeedFunctionPrototypes */ -{ - register int status; -#else -LOCAL void -encode_one_block (JBLOCK block, HUFF_TBL *dctbl, HUFF_TBL *actbl) -{ -#endif /* XIE_SUPPORTED */ - register int temp, temp2; - register int nbits; - register int k, r, i; - - /* Encode the DC coefficient difference per section F.1.2.1 */ - - temp = temp2 = block[0]; - - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - /* For a negative input, want temp2 = bitwise complement of abs(input) */ - /* This code assumes we are on a two's complement machine */ - temp2--; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 0; - while (temp) { - nbits++; - temp >>= 1; - } - - /* Emit the Huffman-coded symbol for the number of bits */ -#ifdef XIE_SUPPORTED - if ((status = emit_bits(dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) < 0) - return(status); -#else - emit_bits(dctbl->ehufco[nbits], dctbl->ehufsi[nbits]); -#endif /* XIE_SUPPORTED */ - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ - if (nbits) /* emit_bits rejects calls with size 0 */ -#ifdef XIE_SUPPORTED - { - if ((status = emit_bits((UINT16) temp2, nbits)) < 0) - return(status); - } -#else - emit_bits((UINT16) temp2, nbits); -#endif /* XIE_SUPPORTED */ - - /* Encode the AC coefficients per section F.1.2.2 */ - - r = 0; /* r = run length of zeros */ - - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[k]) == 0) { - r++; - } else { - /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { -#ifdef XIE_SUPPORTED - if ((status = emit_bits(actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) < 0) - return(status); -#else - emit_bits(actbl->ehufco[0xF0], actbl->ehufsi[0xF0]); -#endif /* XIE_SUPPORTED */ - r -= 16; - } - - temp2 = temp; - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - /* This code assumes we are on a two's complement machine */ - temp2--; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1; /* there must be at least one 1 bit */ - while (temp >>= 1) - nbits++; - - /* Emit Huffman symbol for run length / number of bits */ - i = (r << 4) + nbits; -#ifdef XIE_SUPPORTED - if ((status = emit_bits(actbl->ehufco[i], actbl->ehufsi[i])) < 0) - return(status); -#else - emit_bits(actbl->ehufco[i], actbl->ehufsi[i]); -#endif /* XIE_SUPPORTED */ - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ -#ifdef XIE_SUPPORTED - if ((status = emit_bits((UINT16) temp2, nbits)) < 0) - return(status); -#else - emit_bits((UINT16) temp2, nbits); -#endif /* XIE_SUPPORTED */ - - r = 0; - } - } - - /* If the last coef(s) were zero, emit an end-of-block code */ - if (r > 0) -#ifdef XIE_SUPPORTED - { - if ((status = emit_bits(actbl->ehufco[0], actbl->ehufsi[0])) < 0) - return(status); - } - return(0); -#else - emit_bits(actbl->ehufco[0], actbl->ehufsi[0]); -#endif /* XIE_SUPPORTED */ -} - - - -/* - * Initialize for a Huffman-compressed scan. - * This is invoked after writing the SOS marker. - * The pipeline controller must establish the entropy_output method pointer - * before calling this routine. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -huff_init (compress_info_ptr xinfo) -#else -huff_init (xinfo) - compress_info_ptr xinfo; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -huff_init (compress_info_ptr xinfo) -#endif /* XIE_SUPPORTED */ -{ - short ci; - jpeg_component_info * compptr; - - /* Initialize static variables */ - cinfo = xinfo; - -#ifdef XIE_SUPPORTED - cinfo->huff_put_buffer = 0; - cinfo->huff_put_bits = 0; - cinfo->bytes_in_buffer = 0; -#else - huff_put_buffer = 0; - huff_put_bits = 0; - - /* Initialize the output buffer */ - output_buffer = (char *) (*cinfo->emethods->alloc_small) - ((size_t) JPEG_BUF_SIZE); - bytes_in_buffer = 0; -#endif /* XIE_SUPPORTED */ - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Make sure requested tables are present */ - if (cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no] == NULL || - cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no] == NULL) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Use of undefined Huffman table"); -#endif /* XIE_SUPPORTED */ - /* Compute derived values for Huffman tables */ - /* We may do this more than once for same table, but it's not a big deal */ - fix_huff_tbl(cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no]); - fix_huff_tbl(cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no]); - /* Initialize DC predictions to 0 */ - cinfo->last_dc_val[ci] = 0; - } - - /* Initialize restart stuff */ - cinfo->restarts_to_go = cinfo->restart_interval; - cinfo->next_restart_num = 0; -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Emit a restart marker & resynchronize predictions. - */ - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_restart (compress_info_ptr cinfo) -#else -emit_restart (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; -#else -LOCAL void -emit_restart (compress_info_ptr cinfo) -{ -#endif /* XIE_SUPPORTED */ - short ci; - -#ifdef XIE_SUPPORTED - if ((status = flush_bits()) < 0) - return(status); -#else - flush_bits(); -#endif /* XIE_SUPPORTED */ - - emit_byte(0xFF); - emit_byte(RST0 + cinfo->next_restart_num); - - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = 0; - - /* Update restart state */ - cinfo->restarts_to_go = cinfo->restart_interval; - cinfo->next_restart_num++; - cinfo->next_restart_num &= 7; -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Encode and output one MCU's worth of Huffman-compressed coefficients. - */ -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -huff_encode (compress_info_ptr xinfo, JBLOCK *MCU_data) -#else -huff_encode (xinfo, MCU_data) - compress_info_ptr xinfo; - JBLOCK *MCU_data; -#endif /* NeedFunctionPrototypes */ -{ - int status; -#else -METHODDEF void -huff_encode (compress_info_ptr xinfo, JBLOCK *MCU_data) -{ -#endif /* XIE_SUPPORTED */ - short blkn, ci; - jpeg_component_info * compptr; - JCOEF temp; -#ifdef XIE_SUPPORTED - JCOEF last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each comp */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - last_dc_val[ci] = cinfo->last_dc_val[ci]; - - /* Initialize static variables */ - cinfo = xinfo; - huff_put_buffer = cinfo->huff_put_buffer; - huff_put_bits = cinfo->huff_put_bits; -#endif /* XIE_SUPPORTED */ - - /* Account for restart interval, emit restart marker if needed */ - if (cinfo->restart_interval) { - if (cinfo->restarts_to_go == 0) -#ifdef XIE_SUPPORTED - if ((status = emit_restart(cinfo)) < 0) { - if (status != XIE_ERR) { - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = last_dc_val[ci]; - cinfo->huff_put_buffer = huff_put_buffer; - cinfo->huff_put_bits = huff_put_bits; - } - return(status); - } -#else - emit_restart(cinfo); -#endif /* XIE_SUPPORTED */ - cinfo->restarts_to_go--; - } - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - /* Convert DC value to difference, update last_dc_val */ - temp = MCU_data[blkn][0]; - MCU_data[blkn][0] -= cinfo->last_dc_val[ci]; - cinfo->last_dc_val[ci] = temp; -#ifdef XIE_SUPPORTED - if ((status = encode_one_block(MCU_data[blkn], - cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no], - cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no])) < 0) { - /* Reset global variables for restart */ - if (status != XIE_ERR) { - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = last_dc_val[ci]; - cinfo->huff_put_buffer = huff_put_buffer; - cinfo->huff_put_bits = huff_put_bits; - } - return(status); - } -#else - encode_one_block(MCU_data[blkn], - cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no], - cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no]); -#endif /* XIE_SUPPORTED */ - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Finish up at the end of a Huffman-compressed scan. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -huff_term (compress_info_ptr xinfo) -#else -huff_term (xinfo) - compress_info_ptr xinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; -#else -METHODDEF void -huff_term (compress_info_ptr xinfo) -{ -#endif /* XIE_SUPPORTED */ -#ifdef XIE_SUPPORTED - /* Initialize static variables */ - cinfo = xinfo; - /* Flush out the last data */ - if ((status = flush_bits()) < 0) - return(status); -#else - /* Flush out the last data */ - flush_bits(); -#endif /* XIE_SUPPORTED */ - flush_bytes(); - /* Release the I/O buffer */ -#ifdef XIE_SUPPORTED - return(0); -#else - (*cinfo->emethods->free_small) ((pointer ) output_buffer); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Huffman coding optimization. - * - * This actually is optimization, in the sense that we find the best possible - * Huffman table(s) for the given data. We first scan the supplied data and - * count the number of uses of each symbol that is to be Huffman-coded. - * (This process must agree with the code above.) Then we build an - * optimal Huffman coding tree for the observed counts. - */ - -#ifndef XIE_SUPPORTED -#ifdef ENTROPY_OPT_SUPPORTED - - -/* These are static so htest_one_block can find 'em */ -static long * dc_count_ptrs[NUM_HUFF_TBLS]; -static long * ac_count_ptrs[NUM_HUFF_TBLS]; - - -LOCAL void -gen_huff_coding (compress_info_ptr cinfo, HUFF_TBL *htbl, long freq[]) -/* Generate the optimal coding for the given counts */ -{ -#define MAX_CLEN 32 /* assumed maximum initial code length */ - UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ - short codesize[257]; /* codesize[k] = code length of symbol k */ - short others[257]; /* next symbol in current branch of tree */ - int c1, c2; - int p, i, j; - long v; - - /* This algorithm is explained in section K.2 of the JPEG standard */ - - MEMZERO(bits, SIZEOF(bits)); - MEMZERO(codesize, SIZEOF(codesize)); - for (i = 0; i < 257; i++) - others[i] = -1; /* init links to empty */ - - freq[256] = 1; /* make sure there is a nonzero count */ - /* including the pseudo-symbol 256 in the Huffman procedure guarantees - * that no real symbol is given code-value of all ones, because 256 - * will be placed in the largest codeword category. - */ - - /* Huffman's basic algorithm to assign optimal code lengths to symbols */ - - for (;;) { - /* Find the smallest nonzero frequency, set c1 = its symbol */ - /* In case of ties, take the larger symbol number */ - c1 = -1; - v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v) { - v = freq[i]; - c1 = i; - } - } - - /* Find the next smallest nonzero frequency, set c2 = its symbol */ - /* In case of ties, take the larger symbol number */ - c2 = -1; - v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v && i != c1) { - v = freq[i]; - c2 = i; - } - } - - /* Done if we've merged everything into one frequency */ - if (c2 < 0) - break; - - /* Else merge the two counts/trees */ - freq[c1] += freq[c2]; - freq[c2] = 0; - - /* Increment the codesize of everything in c1's tree branch */ - codesize[c1]++; - while (others[c1] >= 0) { - c1 = others[c1]; - codesize[c1]++; - } - - others[c1] = c2; /* chain c2 onto c1's tree branch */ - - /* Increment the codesize of everything in c2's tree branch */ - codesize[c2]++; - while (others[c2] >= 0) { - c2 = others[c2]; - codesize[c2]++; - } - } - - /* Now count the number of symbols of each code length */ - for (i = 0; i <= 256; i++) { - if (codesize[i]) { - /* The JPEG standard seems to think that this can't happen, */ - /* but I'm paranoid... */ - if (codesize[i] > MAX_CLEN) - ERREXIT(cinfo->emethods, "Huffman code size table overflow"); - - bits[codesize[i]]++; - } - } - - /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure - * Huffman procedure assigned any such lengths, we must adjust the coding. - * Here is what the JPEG spec says about how this next bit works: - * Since symbols are paired for the longest Huffman code, the symbols are - * removed from this length category two at a time. The prefix for the pair - * (which is one bit shorter) is allocated to one of the pair; then, - * skipping the BITS entry for that prefix length, a code word from the next - * shortest nonzero BITS entry is converted into a prefix for two code words - * one bit longer. - */ - - for (i = MAX_CLEN; i > 16; i--) { - while (bits[i] > 0) { - j = i - 2; /* find length of new prefix to be used */ - while (bits[j] == 0) - j--; - - bits[i] -= 2; /* remove two symbols */ - bits[i-1]++; /* one goes in this length */ - bits[j+1] += 2; /* two new symbols in this length */ - bits[j]--; /* symbol of this length is now a prefix */ - } - } - - /* Remove the count for the pseudo-symbol 256 from the largest codelength */ - while (bits[i] == 0) /* find largest codelength still in use */ - i--; - bits[i]--; - - /* Return final symbol counts (only for lengths 0..16) */ - MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); - - /* Return a list of the symbols sorted by code length */ - /* It's not real clear to me why we don't need to consider the codelength - * changes made above, but the JPEG spec seems to think this works. - */ - p = 0; - for (i = 1; i <= MAX_CLEN; i++) { - for (j = 0; j <= 255; j++) { - if (codesize[j] == i) { - htbl->huffval[p] = (UINT8) j; - p++; - } - } - } -} - - -/* Process a single block's worth of coefficients */ -/* Note that the DC coefficient has already been converted to a difference */ - -LOCAL void -htest_one_block (JBLOCK block, JCOEF block0, - long dc_counts[], long ac_counts[]) -{ - register INT32 temp; - register int nbits; - register int k, r; - - /* Encode the DC coefficient difference per section F.1.2.1 */ - - /* Find the number of bits needed for the magnitude of the coefficient */ - temp = block0; - if (temp < 0) temp = -temp; - - for (nbits = 0; temp; nbits++) - temp >>= 1; - - /* Count the Huffman symbol for the number of bits */ - dc_counts[nbits]++; - - /* Encode the AC coefficients per section F.1.2.2 */ - - r = 0; /* r = run length of zeros */ - - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[k]) == 0) { - r++; - } else { - /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { - ac_counts[0xF0]++; - r -= 16; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - if (temp < 0) temp = -temp; - - for (nbits = 0; temp; nbits++) - temp >>= 1; - - /* Count Huffman symbol for run length / number of bits */ - ac_counts[(r << 4) + nbits]++; - - r = 0; - } - } - - /* If the last coef(s) were zero, emit an end-of-block code */ - if (r > 0) - ac_counts[0]++; -} - - - -/* - * Trial-encode one MCU's worth of Huffman-compressed coefficients. - */ - -LOCAL void -htest_encode (compress_info_ptr cinfo, JBLOCK *MCU_data) -{ - short blkn, ci; - jpeg_component_info * compptr; - - /* Take care of restart intervals if needed */ - if (cinfo->restart_interval) { - if (cinfo->restarts_to_go == 0) { - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = 0; - /* Update restart state */ - cinfo->restarts_to_go = cinfo->restart_interval; - } - cinfo->restarts_to_go--; - } - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - /* NB: unlike the real entropy encoder, we may not change the input data */ - htest_one_block(MCU_data[blkn], - (JCOEF) (MCU_data[blkn][0] - cinfo->last_dc_val[ci]), - dc_count_ptrs[compptr->dc_tbl_no], - ac_count_ptrs[compptr->ac_tbl_no]); - cinfo->last_dc_val[ci] = MCU_data[blkn][0]; - } -} - - - -/* - * Find the best coding parameters for a Huffman-coded scan. - * When called, the scan data has already been converted to a sequence of - * MCU groups of quantized coefficients, which are stored in a "big" array. - * The source_method knows how to iterate through that array. - * On return, the MCU data is unmodified, but the Huffman tables referenced - * by the scan components may have been altered. - */ - -METHODDEF void -huff_optimize (compress_info_ptr xinfo, MCU_output_caller_ptr source_method) -/* Optimize Huffman-coding parameters (Huffman symbol table) */ -{ - int i, tbl; - HUFF_TBL **htblptr; - - /* Allocate and zero the count tables */ - /* Note that gen_huff_coding expects 257 entries in each table! */ - - for (i = 0; i < NUM_HUFF_TBLS; i++) { - dc_count_ptrs[i] = NULL; - ac_count_ptrs[i] = NULL; - } - - for (i = 0; i < cinfo->comps_in_scan; i++) { - /* Create DC table */ - tbl = cinfo->cur_comp_info[i]->dc_tbl_no; - if (dc_count_ptrs[tbl] == NULL) { - dc_count_ptrs[tbl] = (long *) (*cinfo->emethods->alloc_small) - (257 * SIZEOF(long)); - MEMZERO(dc_count_ptrs[tbl], 257 * SIZEOF(long)); - } - /* Create AC table */ - tbl = cinfo->cur_comp_info[i]->ac_tbl_no; - if (ac_count_ptrs[tbl] == NULL) { - ac_count_ptrs[tbl] = (long *) (*cinfo->emethods->alloc_small) - (257 * SIZEOF(long)); - MEMZERO(ac_count_ptrs[tbl], 257 * SIZEOF(long)); - } - } - - /* Initialize DC predictions to 0 */ - for (i = 0; i < cinfo->comps_in_scan; i++) { - cinfo->last_dc_val[i] = 0; - } - /* Initialize restart stuff */ - cinfo->restarts_to_go = cinfo->restart_interval; - - /* Scan the MCU data, count symbol uses */ - (*source_method) (cinfo, htest_encode); - - /* Now generate optimal Huffman tables */ - for (tbl = 0; tbl < NUM_HUFF_TBLS; tbl++) { - if (dc_count_ptrs[tbl] != NULL) { - htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->alloc_small) (SIZEOF(HUFF_TBL)); - /* Set sent_table FALSE so updated table will be written to JPEG file. */ - (*htblptr)->sent_table = FALSE; - /* Compute the optimal Huffman encoding */ - gen_huff_coding(cinfo, *htblptr, dc_count_ptrs[tbl]); - /* Release the count table */ - (*cinfo->emethods->free_small) ((pointer ) dc_count_ptrs[tbl]); - } - if (ac_count_ptrs[tbl] != NULL) { - htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->alloc_small) (SIZEOF(HUFF_TBL)); - /* Set sent_table FALSE so updated table will be written to JPEG file. */ - (*htblptr)->sent_table = FALSE; - /* Compute the optimal Huffman encoding */ - gen_huff_coding(cinfo, *htblptr, ac_count_ptrs[tbl]); - /* Release the count table */ - (*cinfo->emethods->free_small) ((pointer ) ac_count_ptrs[tbl]); - } - } -} - - -#endif /* ENTROPY_OPT_SUPPORTED */ -#endif /* XIE_SUPPORTED */ - - -/* - * The method selection routine for Huffman entropy encoding. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselchuffman (compress_info_ptr cinfo) -#else -jselchuffman (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselchuffman (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - if (! cinfo->arith_code) { - cinfo->methods->entropy_encode_init = huff_init; - cinfo->methods->entropy_encode = huff_encode; - cinfo->methods->entropy_encode_term = huff_term; -#ifndef XIE_SUPPORTED -#ifdef ENTROPY_OPT_SUPPORTED - cinfo->methods->entropy_optimize = huff_optimize; - /* The standard Huffman tables are only valid for 8-bit data precision. - * If the precision is higher, force optimization on so that usable - * tables will be computed. This test can be removed if default tables - * are supplied that are valid for the desired precision. - */ - if (cinfo->data_precision > 8) - cinfo->optimize_coding = TRUE; - if (cinfo->optimize_coding) - cinfo->total_passes++; /* one pass needed for entropy optimization */ -#endif -#endif /* XIE_SUPPORTED */ - } -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jcmcu.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcmcu.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jcmcu.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcmcu.c:1.2 Fri Dec 14 14:58:36 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcmcu.c Sat Feb 28 21:42:00 2004 @@ -1,394 +0,0 @@ -/* $Xorg: jcmcu.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcmcu.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jcmcu.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains MCU extraction routines and quantization scaling. - * These routines are invoked via the extract_MCUs and - * extract_init/term methods. - */ - -#include "jinclude.h" - - -/* - * If this file is compiled with -DDCT_ERR_STATS, it will reverse-DCT each - * block and sum the total errors across the whole picture. This provides - * a convenient method of using real picture data to test the roundoff error - * of a DCT algorithm. DCT_ERR_STATS should *not* be defined for a production - * compression program, since compression is much slower with it defined. - * Also note that jrevdct.o must be linked into the compressor when this - * switch is defined. - */ - -#ifndef XIE_SUPPORTED -#ifdef DCT_ERR_STATS -static int dcterrorsum; /* these hold the error statistics */ -static int dcterrormax; -static int dctcoefcount; /* This will probably overflow on a 16-bit-int machine */ -#endif -#endif /* XIE_SUPPORTED */ - - -/* ZAG[i] is the natural-order position of the i'th element of zigzag order. */ - -static const short ZAG[DCTSIZE2] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - - -LOCAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -extract_block (JSAMPARRAY input_data, int start_row, long start_col, - JBLOCK output_data, QUANT_TBL_PTR quanttbl) -#else -extract_block (input_data, start_row, start_col, output_data, quanttbl) - JSAMPARRAY input_data; - int start_row; - long start_col; - JBLOCK output_data; - QUANT_TBL_PTR quanttbl; -#endif /* NeedFunctionPrototypes */ -#else -extract_block (JSAMPARRAY input_data, int start_row, long start_col, - JBLOCK output_data, QUANT_TBL_PTR quanttbl) -#endif /* XIE_SUPPORTED */ -/* Extract one 8x8 block from the specified location in the sample array; */ -/* perform forward DCT, quantization scaling, and zigzag reordering on it. */ -{ - /* This routine is heavily used, so it's worth coding it tightly. */ - DCTBLOCK block; -#ifdef DCT_ERR_STATS - DCTBLOCK svblock; /* saves input data for comparison */ -#endif - - { register JSAMPROW elemptr; - register DCTELEM *localblkptr = block; -#if DCTSIZE != 8 - register int elemc; -#endif - register int elemr; - - for (elemr = DCTSIZE; elemr > 0; elemr--) { - elemptr = input_data[start_row++] + start_col; -#if DCTSIZE == 8 /* unroll the inner loop */ - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); -#else - for (elemc = DCTSIZE; elemc > 0; elemc--) { - *localblkptr++ = (DCTELEM) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - } -#endif - } - } - -#ifdef DCT_ERR_STATS - MEMCOPY(svblock, block, SIZEOF(DCTBLOCK)); -#endif - - j_fwd_dct(block); - - { register JCOEF temp; - register short i; - - for (i = 0; i < DCTSIZE2; i++) { - temp = (JCOEF) block[ZAG[i]]; - /* divide by *quanttbl, ensuring proper rounding */ - if (temp < 0) { - temp = -temp; - temp += *quanttbl>>1; - temp /= *quanttbl; - temp = -temp; - } else { - temp += *quanttbl>>1; - temp /= *quanttbl; - } - *output_data++ = temp; - quanttbl++; - } - } - -#ifdef DCT_ERR_STATS - j_rev_dct(block); - - { register int diff; - register short i; - - for (i = 0; i < DCTSIZE2; i++) { - diff = block[i] - svblock[i]; - if (diff < 0) diff = -diff; - dcterrorsum += diff; - if (dcterrormax < diff) dcterrormax = diff; - } - dctcoefcount += DCTSIZE2; - } -#endif -} - - -/* - * Extract samples in MCU order, process & hand off to output_method. - * The input is always exactly N MCU rows worth of data. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -extract_MCUs (compress_info_ptr cinfo, - JSAMPIMAGE image_data, - int num_mcu_rows, - MCU_output_method_ptr output_method) -#else -extract_MCUs (cinfo, image_data, num_mcu_rows, output_method) - compress_info_ptr cinfo; - JSAMPIMAGE image_data; - int num_mcu_rows; - MCU_output_method_ptr output_method; -#endif /* NeedFunctionPrototypes */ -{ - JBLOCK MCU_data[MAX_BLOCKS_IN_MCU]; - int mcurow; - long mcuindex; - int startrow; - long startindex; - short blkn, ci, xpos, ypos; - jpeg_component_info * compptr; - QUANT_TBL_PTR quant_ptr; - - if (cinfo->XIErestart == XIE_RMCU) { - startrow = cinfo->XIEmcurow; - startindex = cinfo->XIEmcuindex; - cinfo->XIErestart = XIE_RNUL; - } else { - startrow = 0; - startindex = 0; - } - for (mcurow = startrow; mcurow < num_mcu_rows; mcurow++) { - for (mcuindex = startindex; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Extract data from the image array, DCT it, and quantize it */ - blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - quant_ptr = cinfo->quant_tbl_ptrs[compptr->quant_tbl_no]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - for (xpos = 0; xpos < compptr->MCU_width; xpos++) { - extract_block(image_data[ci], - (mcurow * compptr->MCU_height + ypos)*DCTSIZE, - (mcuindex * compptr->MCU_width + xpos)*DCTSIZE, - MCU_data[blkn], quant_ptr); - blkn++; - } - } - } - /* Send the MCU whereever the pipeline controller wants it to go */ - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - if ((*output_method) (cinfo, MCU_data) < 0) { - cinfo->XIErestart = XIE_RMCU; - cinfo->XIEmcurow = mcurow; - cinfo->XIEmcuindex = mcuindex; - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - return(-1); - } - } - } - return(0); -} -#else -METHODDEF void -extract_MCUs (compress_info_ptr cinfo, - JSAMPIMAGE image_data, - int num_mcu_rows, - MCU_output_method_ptr output_method) -{ - JBLOCK MCU_data[MAX_BLOCKS_IN_MCU]; - int mcurow; - long mcuindex; - short blkn, ci, xpos, ypos; - jpeg_component_info * compptr; - QUANT_TBL_PTR quant_ptr; - - for (mcurow = 0; mcurow < num_mcu_rows; mcurow++) { - for (mcuindex = 0; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Extract data from the image array, DCT it, and quantize it */ - blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - quant_ptr = cinfo->quant_tbl_ptrs[compptr->quant_tbl_no]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - for (xpos = 0; xpos < compptr->MCU_width; xpos++) { - extract_block(image_data[ci], - (mcurow * compptr->MCU_height + ypos)*DCTSIZE, - (mcuindex * compptr->MCU_width + xpos)*DCTSIZE, - MCU_data[blkn], quant_ptr); - blkn++; - } - } - } - /* Send the MCU whereever the pipeline controller wants it to go */ - (*output_method) (cinfo, MCU_data); - } - } -} -#endif - - -/* - * Initialize for processing a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -extract_init (compress_info_ptr cinfo) -#else -extract_init (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -extract_init (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -#ifdef DCT_ERR_STATS - dcterrorsum = dcterrormax = dctcoefcount = 0; -#endif -} - - -/* - * Clean up after a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -extract_term (compress_info_ptr cinfo) -#else -extract_term (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -extract_term (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -#ifndef XIE_SUPPORTED -#ifdef DCT_ERR_STATS - TRACEMS3(cinfo->emethods, 0, "DCT roundoff errors = %d/%d, max = %d", - dcterrorsum, dctcoefcount, dcterrormax); -#endif -#endif /* XIE_SUPPORTED */ -} - - - -/* - * The method selection routine for MCU extraction. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselcmcu (compress_info_ptr cinfo) -#else -jselcmcu (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselcmcu (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* just one implementation for now */ - cinfo->methods->extract_init = extract_init; - cinfo->methods->extract_MCUs = extract_MCUs; - cinfo->methods->extract_term = extract_term; -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h diff -u xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h:1.7 xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h:1.7 Fri Dec 14 14:58:36 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h Sat Feb 28 21:42:00 2004 @@ -1,480 +0,0 @@ -/* $Xorg: jconfig.h,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jconfig.h */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., Ocober 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/jconfig.h,v 1.7 2001/12/14 19:58:36 dawes Exp $ */ - -/* - * jconfig.h - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains preprocessor declarations that help customize - * the JPEG software for a particular application, machine, or compiler. - * Edit these declarations as needed (or add -D flags to the Makefile). - */ - - -/* - * These symbols indicate the properties of your machine or compiler. - * The conditional definitions given may do the right thing already, - * but you'd best look them over closely, especially if your compiler - * does not handle full ANSI C. An ANSI-compliant C compiler should - * provide all the necessary features; __STDC__ is supposed to be - * predefined by such compilers. - */ - -/* - * HAVE_STDC is tested below to see whether ANSI features are available. - * We avoid testing __STDC__ directly for arcane reasons of portability. - * (On some compilers, __STDC__ is only defined if a switch is given, - * but the switch also disables machine-specific features we need to get at. - * In that case, -DHAVE_STDC in the Makefile is a convenient solution.) - */ - -#ifdef __STDC__ /* if compiler claims to be ANSI, believe it */ -#define HAVE_STDC -#endif - - -/* Does your compiler support function prototypes? */ -/* (If not, you also need to use ansi2knr, see SETUP) */ - -#ifdef HAVE_STDC /* ANSI C compilers always have prototypes */ -#define PROTO -#else -#ifdef __cplusplus /* So do C++ compilers */ -#define PROTO -#endif -#endif - -/* Does your compiler support the declaration "unsigned char" ? */ -/* How about "unsigned short" ? */ - -#ifdef HAVE_STDC /* ANSI C compilers must support both */ -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -#endif - -/* Define this if an ordinary "char" type is unsigned. - * If you're not sure, leaving it undefined will work at some cost in speed. - * If you defined HAVE_UNSIGNED_CHAR then it doesn't matter very much. - */ - -/* #define CHAR_IS_UNSIGNED */ - -/* Define this if your compiler implements ">>" on signed values as a logical - * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, - * which is the normal and rational definition. - */ - -/* #define RIGHT_SHIFT_IS_UNSIGNED */ - -/* Define "void" as "char" if your compiler doesn't know about type void. - * NOTE: be sure to define void such that "void *" represents the most general - * pointer type, e.g., that returned by malloc(). - */ - -/* #define void char */ - -/* Define const as empty if your compiler doesn't know the "const" keyword. */ -/* (Even if it does, defining const as empty won't break anything.) */ - -#ifndef HAVE_STDC /* ANSI C and C++ compilers should know it. */ -#ifndef __cplusplus -#define const -#endif -#endif - -/* For 80x86 machines, you need to define NEED_FAR_POINTERS, - * unless you are using a large-data memory model or 80386 flat-memory mode. - * On less brain-damaged CPUs this symbol must not be defined. - * (Defining this symbol causes large data structures to be referenced through - * "far" pointers and to be allocated with a special version of malloc.) - */ - -#ifdef XIE_SUPPORTED -#ifdef MSDOS -#undef MSDOS -#endif /* MSDOS */ - -/* Make sure that HAVE_UNSIGNED_CHAR and HAVE_UNSIGNED_SHORT - * are defined when XIE_SUPPORTED is defined - */ -#ifndef HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_CHAR -#endif /* HAVE_UNSIGNED_CHAR */ -#ifndef HAVE_UNSIGNED_SHORT -#define HAVE_UNSIGNED_SHORT -#endif /* HAVE_UNSIGNED_SHORT */ -#endif /* XIE_SUPPORTED */ - -#ifdef MSDOS -#define NEED_FAR_POINTERS -#endif - - -/* The next three symbols only affect the system-dependent user interface - * modules (jcmain.c, jdmain.c). You can ignore these if you are supplying - * your own user interface code. - */ - -/* Define this if you want to name both input and output files on the command - * line, rather than using stdout and optionally stdin. You MUST do this if - * your system can't cope with binary I/O to stdin/stdout. See comments at - * head of jcmain.c or jdmain.c. - */ - -#ifdef MSDOS /* two-file style is needed for PCs */ -#ifndef USE_SETMODE /* unless you have setmode() */ -#define TWO_FILE_COMMANDLINE -#endif -#endif -#ifdef THINK_C /* it's needed for Macintosh too */ -#define TWO_FILE_COMMANDLINE -#endif - -/* Define this if your system needs explicit cleanup of temporary files. - * This is crucial under MS-DOS, where the temporary "files" may be areas - * of extended memory; on most other systems it's not as important. - */ - -#ifdef MSDOS -#define NEED_SIGNAL_CATCHER -#endif - -/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). - * This is necessary on systems that distinguish text files from binary files, - * and is harmless on most systems that don't. If you have one of the rare - * systems that complains about the "b" spec, define this symbol. - */ - -/* #define DONT_USE_B_MODE */ - - -/* If you're getting bored, that's the end of the symbols you HAVE to - * worry about. Go fix the makefile and compile. - */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE /* default is to define it as empty */ -#define INLINE -#endif - -/* On a few systems, type boolean and/or macros FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * In that case you need only comment out these definitions. - */ - -typedef int boolean; -#undef FALSE /* in case these macros already exist */ -#undef TRUE -#define FALSE 0 /* values of boolean */ -#define TRUE 1 - -/* This defines the size of the I/O buffers for entropy compression - * and decompression; you could reduce it if memory is tight. - */ - -#define JPEG_BUF_SIZE 4096 /* bytes */ - - - -/* These symbols determine the JPEG functionality supported. */ - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * program file. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -#ifdef XIE_SUPPORTED -/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ - -/* Encoder capability options: */ -#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#undef C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? (NYI) */ -#undef ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -#undef INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ -/* Decoder capability options: */ -#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#undef D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#undef BLOCK_SMOOTHING_SUPPORTED /* Block smoothing during decoding? */ -#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ -/* these defines indicate which JPEG file formats are allowed */ -#define JFIF_SUPPORTED /* JFIF or "raw JPEG" files */ -#undef JTIFF_SUPPORTED /* JPEG-in-TIFF (not yet implemented) */ -/* these defines indicate which image (non-JPEG) file formats are allowed */ -#undef GIF_SUPPORTED /* GIF image file format */ -/* #define RLE_SUPPORTED */ /* RLE image file format (by default, no) */ -#undef PPM_SUPPORTED /* PPM/PGM image file format */ -#undef TARGA_SUPPORTED /* Targa image file format */ -#undef TIFF_SUPPORTED /* TIFF image file format (not yet impl.) */ - -/* more capability options later, no doubt */ -#else -/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ - -/* Encoder capability options: */ -#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#undef C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? (NYI) */ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ -/* Decoder capability options: */ -#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing during decoding? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ -/* these defines indicate which JPEG file formats are allowed */ -#define JFIF_SUPPORTED /* JFIF or "raw JPEG" files */ -#undef JTIFF_SUPPORTED /* JPEG-in-TIFF (not yet implemented) */ -/* these defines indicate which image (non-JPEG) file formats are allowed */ -#define GIF_SUPPORTED /* GIF image file format */ -/* #define RLE_SUPPORTED */ /* RLE image file format (by default, no) */ -#define PPM_SUPPORTED /* PPM/PGM image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ -#undef TIFF_SUPPORTED /* TIFF image file format (not yet impl.) */ - -/* more capability options later, no doubt */ -#endif /* XIE_SUPPORTED */ - - -/* - * Define exactly one of these three symbols to indicate whether you want - * 8-bit, 12-bit, or 16-bit sample (pixel component) values. 8-bit is the - * default and is nearly always the right thing to use. You can use 12-bit if - * you need to support image formats with more than 8 bits of resolution in a - * color value. 16-bit should only be used for the lossless JPEG mode (not - * currently supported). Note that 12- and 16-bit values take up twice as - * much memory as 8-bit! - * Note: if you select 12- or 16-bit precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - */ - -#define EIGHT_BIT_SAMPLES -#undef TWELVE_BIT_SAMPLES -#undef SIXTEEN_BIT_SAMPLES - - - -/* - * The remaining definitions don't need to be hand-edited in most cases. - * You may need to change these if you have a machine with unusual data - * types; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* First define the representation of a single pixel element value. */ - -#ifdef EIGHT_BIT_SAMPLES -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - * If you have only signed chars, and you are more worried about speed than - * memory usage, it might be a win to make JSAMPLE be short. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED - -typedef char JSAMPLE; -#define GETJSAMPLE(value) (value) - -#else /* not CHAR_IS_UNSIGNED */ - -typedef char JSAMPLE; -#define GETJSAMPLE(value) ((value) & 0xFF) - -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -#define BITS_IN_JSAMPLE 8 -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* EIGHT_BIT_SAMPLES */ - - -#ifdef TWELVE_BIT_SAMPLES -/* JSAMPLE should be the smallest type that will hold the values 0..4095. */ -/* On nearly all machines "short" will do nicely. */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) (value) - -#define BITS_IN_JSAMPLE 12 -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* TWELVE_BIT_SAMPLES */ - - -#ifdef SIXTEEN_BIT_SAMPLES -/* JSAMPLE should be the smallest type that will hold the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT - -typedef unsigned short JSAMPLE; -#define GETJSAMPLE(value) (value) - -#else /* not HAVE_UNSIGNED_SHORT */ - -/* If int is 32 bits this'll be horrendously inefficient storage-wise. - * But since we don't actually support 16-bit samples (ie lossless coding) yet, - * I'm not going to worry about making a smarter definition ... - */ -typedef unsigned int JSAMPLE; -#define GETJSAMPLE(value) (value) - -#endif /* HAVE_UNSIGNED_SHORT */ - -#define BITS_IN_JSAMPLE 16 -#define MAXJSAMPLE 65535 -#define CENTERJSAMPLE 32768 - -#endif /* SIXTEEN_BIT_SAMPLES */ - - -/* Here we define the representation of a DCT frequency coefficient. - * This should be a signed 16-bit value; "short" is usually right. - * It's important that this be exactly 16 bits, no more and no less; - * more will cost you a BIG hit of memory, less will give wrong answers. - */ - -typedef short JCOEF; - - -/* The remaining typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold signed 32-bit values; if your machine happens */ -/* to have 64-bit longs, you might want to change this. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -#if defined(LONG64) || defined(WORD64) -typedef int INT32; -#else -typedef long INT32; -#endif -#endif - Index: xc/programs/Xserver/XIE/mixie/jpeg/jcsample.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcsample.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jcsample.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcsample.c:1.2 Fri Dec 14 14:58:36 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcsample.c Sat Feb 28 21:42:00 2004 @@ -1,736 +0,0 @@ -/* $Xorg: jcsample.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcsample.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jcsample.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains downsampling routines. - * These routines are invoked via the downsample and - * downsample_init/term methods. - * - * An excellent reference for image resampling is - * Digital Image Warping, George Wolberg, 1990. - * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. - * - * The downsampling algorithm used here is a simple average of the source - * pixels covered by the output pixel. The hi-falutin sampling literature - * refers to this as a "box filter". In general the characteristics of a box - * filter are not very good, but for the specific cases we normally use (1:1 - * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not - * nearly so bad. If you intend to use other sampling ratios, you'd be well - * advised to improve this code. - * - * A simple input-smoothing capability is provided. This is mainly intended - * for cleaning up color-dithered GIF input files (if you find it inadequate, - * we suggest using an external filtering program such as pnmconvol). When - * enabled, each input pixel P is replaced by a weighted sum of itself and its - * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, - * where SF = (smoothing_factor / 1024). - * Currently, smoothing is only supported for 2h2v sampling factors. - */ - -#include "jinclude.h" - - -/* - * Initialize for downsampling a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -downsample_init (compress_info_ptr cinfo) -#else -downsample_init (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -downsample_init (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} - - -/* - * Downsample pixel values of a single component. - * This version handles arbitrary integral sampling ratios, without smoothing. - * Note that this version is not actually used for customary sampling ratios. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -int_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -int_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -int_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; - long outcol, outcol_h; /* outcol_h == outcol*h_expand */ - JSAMPROW inptr, outptr; - INT32 outvalue; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - if (output_rows != compptr->v_samp_factor || - input_rows != cinfo->max_v_samp_factor || - (output_cols % compptr->h_samp_factor) != 0 || - (input_cols % cinfo->max_h_samp_factor) != 0 || - input_cols*compptr->h_samp_factor != output_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus downsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; - v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; - numpix = h_expand * v_expand; - numpix2 = numpix/2; - - inrow = 0; - for (outrow = 0; outrow < output_rows; outrow++) { - outptr = output_data[outrow]; - for (outcol = 0, outcol_h = 0; outcol < output_cols; - outcol++, outcol_h += h_expand) { - outvalue = 0; - for (v = 0; v < v_expand; v++) { - inptr = input_data[inrow+v] + outcol_h; - for (h = 0; h < h_expand; h++) { - outvalue += (INT32) GETJSAMPLE(*inptr++); - } - } - *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); - } - inrow += v_expand; - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the common case of 2:1 horizontal and 1:1 vertical, - * without smoothing. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -h2v1_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -h2v1_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -h2v1_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - int outrow; - long outcol; - register JSAMPROW inptr, outptr; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - if (output_rows != compptr->v_samp_factor || - input_rows != cinfo->max_v_samp_factor || - (output_cols % compptr->h_samp_factor) != 0 || - (input_cols % cinfo->max_h_samp_factor) != 0 || - input_cols*compptr->h_samp_factor != output_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus downsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - for (outrow = 0; outrow < output_rows; outrow++) { - outptr = output_data[outrow]; - inptr = input_data[outrow]; - for (outcol = 0; outcol < output_cols; outcol++) { - *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) - + 1) >> 1); - inptr += 2; - } - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the standard case of 2:1 horizontal and 2:1 vertical, - * without smoothing. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -h2v2_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -h2v2_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -h2v2_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - int inrow, outrow; - long outcol; - register JSAMPROW inptr0, inptr1, outptr; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - if (output_rows != compptr->v_samp_factor || - input_rows != cinfo->max_v_samp_factor || - (output_cols % compptr->h_samp_factor) != 0 || - (input_cols % cinfo->max_h_samp_factor) != 0 || - input_cols*compptr->h_samp_factor != output_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus downsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - inrow = 0; - for (outrow = 0; outrow < output_rows; outrow++) { - outptr = output_data[outrow]; - inptr0 = input_data[inrow]; - inptr1 = input_data[inrow+1]; - for (outcol = 0; outcol < output_cols; outcol++) { - *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) - + 2) >> 2); - inptr0 += 2; inptr1 += 2; - } - inrow += 2; - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the special case of a full-size component, - * without smoothing. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fullsize_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -fullsize_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -fullsize_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - if (input_cols != output_cols || input_rows != output_rows) - ERREXIT(cinfo->emethods, "Pipeline controller messed up"); -#endif -#endif /* XIE_SUPPORTED */ - - jcopy_sample_rows(input_data, 0, output_data, 0, output_rows, output_cols); -} - - -#ifdef INPUT_SMOOTHING_SUPPORTED - -/* - * Downsample pixel values of a single component. - * This version handles the standard case of 2:1 horizontal and 2:1 vertical, - * with smoothing. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -h2v2_smooth_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -h2v2_smooth_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -h2v2_smooth_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - int inrow, outrow; - long colctr; - register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; - INT32 membersum, neighsum, memberscale, neighscale; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - if (output_rows != compptr->v_samp_factor || - input_rows != cinfo->max_v_samp_factor || - (output_cols % compptr->h_samp_factor) != 0 || - (input_cols % cinfo->max_h_samp_factor) != 0 || - input_cols*compptr->h_samp_factor != output_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus downsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - /* We don't bother to form the individual "smoothed" input pixel values; - * we can directly compute the output which is the average of the four - * smoothed values. Each of the four member pixels contributes a fraction - * (1-8*SF) to its own smoothed image and a fraction SF to each of the three - * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final - * output. The four corner-adjacent neighbor pixels contribute a fraction - * SF to just one smoothed pixel, or SF/4 to the final output; while the - * eight edge-adjacent neighbors contribute SF to each of two smoothed - * pixels, or SF/2 overall. In order to use integer arithmetic, these - * factors are scaled by 2^16 = 65536. - * Also recall that SF = smoothing_factor / 1024. - */ - - memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ - neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ - - inrow = 0; - for (outrow = 0; outrow < output_rows; outrow++) { - outptr = output_data[outrow]; - inptr0 = input_data[inrow]; - inptr1 = input_data[inrow+1]; - if (inrow == 0) - above_ptr = above[input_rows-1]; - else - above_ptr = input_data[inrow-1]; - if (inrow >= input_rows-2) - below_ptr = below[0]; - else - below_ptr = input_data[inrow+2]; - - /* Special case for first column: pretend column -1 is same as column 0 */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); - neighsum += neighsum; - neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768L) >> 16); - inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; - - for (colctr = output_cols - 2; colctr > 0; colctr--) { - /* sum of pixels directly mapped to this output element */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - /* sum of edge-neighbor pixels */ - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + - GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); - /* The edge-neighbors count twice as much as corner-neighbors */ - neighsum += neighsum; - /* Add in the corner-neighbors */ - neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + - GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); - /* form final output scaled up by 2^16 */ - membersum = membersum * memberscale + neighsum * neighscale; - /* round, descale and output it */ - *outptr++ = (JSAMPLE) ((membersum + 32768L) >> 16); - inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; - } - - /* Special case for last column */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); - neighsum += neighsum; - neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); - membersum = membersum * memberscale + neighsum * neighscale; - *outptr = (JSAMPLE) ((membersum + 32768L) >> 16); - - inrow += 2; - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the special case of a full-size component, - * with smoothing. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fullsize_smooth_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -fullsize_smooth_downsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - compress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -fullsize_smooth_downsample (compress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - int outrow; - long colctr; - register JSAMPROW inptr, above_ptr, below_ptr, outptr; - INT32 membersum, neighsum, memberscale, neighscale; - int colsum, lastcolsum, nextcolsum; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - if (input_cols != output_cols || input_rows != output_rows) - ERREXIT(cinfo->emethods, "Pipeline controller messed up"); -#endif -#endif /* XIE_SUPPORTED */ - - /* Each of the eight neighbor pixels contributes a fraction SF to the - * smoothed pixel, while the main pixel contributes (1-8*SF). In order - * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. - * Also recall that SF = smoothing_factor / 1024. - */ - - memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ - neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ - - for (outrow = 0; outrow < output_rows; outrow++) { - outptr = output_data[outrow]; - inptr = input_data[outrow]; - if (outrow == 0) - above_ptr = above[input_rows-1]; - else - above_ptr = input_data[outrow-1]; - if (outrow >= input_rows-1) - below_ptr = below[0]; - else - below_ptr = input_data[outrow+1]; - - /* Special case for first column */ - colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + - GETJSAMPLE(*inptr); - membersum = GETJSAMPLE(*inptr++); - nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + - GETJSAMPLE(*inptr); - neighsum = colsum + (colsum - membersum) + nextcolsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768L) >> 16); - lastcolsum = colsum; colsum = nextcolsum; - - for (colctr = output_cols - 2; colctr > 0; colctr--) { - membersum = GETJSAMPLE(*inptr++); - above_ptr++; below_ptr++; - nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + - GETJSAMPLE(*inptr); - neighsum = lastcolsum + (colsum - membersum) + nextcolsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768L) >> 16); - lastcolsum = colsum; colsum = nextcolsum; - } - - /* Special case for last column */ - membersum = GETJSAMPLE(*inptr); - neighsum = lastcolsum + (colsum - membersum) + colsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr = (JSAMPLE) ((membersum + 32768L) >> 16); - - } -} - -#endif /* INPUT_SMOOTHING_SUPPORTED */ - - -/* - * Clean up after a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -downsample_term (compress_info_ptr cinfo) -#else -downsample_term (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -downsample_term (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} - - - -/* - * The method selection routine for downsampling. - * Note that we must select a routine for each component. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jseldownsample (compress_info_ptr cinfo) -#else -jseldownsample (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jseldownsample (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - short ci; - jpeg_component_info * compptr; - boolean smoothok = TRUE; - -#ifndef XIE_SUPPORTED - if (cinfo->CCIR601_sampling) - ERREXIT(cinfo->emethods, "CCIR601 downsampling not implemented yet"); -#endif /* XIE_SUPPORTED */ - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - if (compptr->h_samp_factor == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) { -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor) - cinfo->methods->downsample[ci] = fullsize_smooth_downsample; - else -#endif - cinfo->methods->downsample[ci] = fullsize_downsample; - } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) { - smoothok = FALSE; - cinfo->methods->downsample[ci] = h2v1_downsample; - } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) { -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor) - cinfo->methods->downsample[ci] = h2v2_smooth_downsample; - else -#endif - cinfo->methods->downsample[ci] = h2v2_downsample; - } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && - (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { - smoothok = FALSE; - cinfo->methods->downsample[ci] = int_downsample; - } else -#ifdef XIE_SUPPORTED - {} -#else - ERREXIT(cinfo->emethods, "Fractional downsampling not implemented yet"); -#endif /* XIE_SUPPORTED */ - } - -#ifndef XIE_SUPPORTED -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor && !smoothok) - TRACEMS(cinfo->emethods, 0, - "Smoothing not supported with nonstandard sampling ratios"); -#endif -#endif /* XIE_SUPPORTED */ - - cinfo->methods->downsample_init = downsample_init; - cinfo->methods->downsample_term = downsample_term; -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jcxie.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcxie.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jcxie.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcxie.c:1.5 Fri Dec 14 14:58:37 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcxie.c Sat Feb 28 21:42:00 2004 @@ -1,689 +0,0 @@ -/* $Xorg: jcxie.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcxie.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - jcxie.c: Xie JPEG Compression Interface Routines - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * Copyright (C) 1992, Thomas G. Lane. - * This file was derived in part from the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - */ - -#include "jinclude.h" -#include "macro.h" - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines below do it the hard way. (The performance cost - * is not all that great, because these routines aren't very heavily used.) - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ -#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case, define if we can */ -#ifdef USE_FMEM -#define FMEMCOPY(dest,src,size) _fmemcpy((pointer*)(dest), (const pointer*)(src), (size_t)(size)) -#define FMEMZERO(target,size) _fmemset((pointer*)(target), 0, (size_t)(size)) -#endif -#endif - -/* - * This routine gets control after the input file header has been read. - * It must determine what output JPEG file format is to be written, - * and make any other compression parameter changes that are desirable. - */ - -METHODDEF void -#if NeedFunctionPrototypes -c_ui_method_selection (compress_info_ptr cinfo) -#else -c_ui_method_selection (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* If the input is gray scale, generate a monochrome JPEG file. */ - if (cinfo->in_color_space == CS_GRAYSCALE) - j_monochrome_default(cinfo); - /* For now, always select JFIF output format. */ - jselwjfif(cinfo); -} - -METHODDEF void -#if NeedFunctionPrototypes -c_per_scan_method_selection (compress_info_ptr cinfo) -#else -c_per_scan_method_selection (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Central point for per-scan method selection */ -{ - /* Edge expansion */ - jselexpand(cinfo); - /* Downsampling of pixels */ - jseldownsample(cinfo); - /* MCU extraction */ - jselcmcu(cinfo); -} - -LOCAL void -#if NeedFunctionPrototypes -c_initial_method_selection (compress_info_ptr cinfo) -#else -c_initial_method_selection (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Central point for initial method selection */ -{ - /* Input image reading method selection is already done. */ - /* So is output file header formatting (both are done by user interface). */ - - /* Entropy encoding: Huffman coding. */ - cinfo->arith_code = FALSE; /* force Huffman mode */ - jselchuffman(cinfo); - - /* Overall control (that's me!) */ - cinfo->methods->c_per_scan_method_selection = c_per_scan_method_selection; -} - -LOCAL int -#if NeedFunctionPrototypes -initial_setup (compress_info_ptr cinfo) -#else -initial_setup (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Do computations that are needed before initial method selection */ -{ - short ci; - jpeg_component_info *compptr; - - /* Compute maximum sampling factors; check factor validity */ - cinfo->max_h_samp_factor = 1; - cinfo->max_v_samp_factor = 1; - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = &cinfo->comp_info[ci]; - if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || - compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) - /* ERREXIT(cinfo->emethods, "Bogus sampling factors"); */ - return(XIE_ERR); - cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, - compptr->h_samp_factor); - cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, - compptr->v_samp_factor); - } - - /* Compute logical downsampled dimensions of components */ - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = &cinfo->comp_info[ci]; - compptr->true_comp_width = (cinfo->image_width * compptr->h_samp_factor - + cinfo->max_h_samp_factor - 1) - / cinfo->max_h_samp_factor; - compptr->true_comp_height = (cinfo->image_height * compptr->v_samp_factor - + cinfo->max_v_samp_factor - 1) - / cinfo->max_v_samp_factor; - } - return(0); -} - -/* - * Utility routines: common code for pipeline controllers - */ - -LOCAL int -#if NeedFunctionPrototypes -interleaved_scan_setup (compress_info_ptr cinfo) -#else -interleaved_scan_setup (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Compute all derived info for an interleaved (multi-component) scan */ -/* On entry, cinfo->comps_in_scan and cinfo->cur_comp_info[] are set up */ -{ - short ci, mcublks; - jpeg_component_info *compptr; - - if (cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) - /* ERREXIT(cinfo->emethods, "Too many components for interleaved scan"); */ - return(XIE_ERR); - - cinfo->MCUs_per_row = (cinfo->image_width - + cinfo->max_h_samp_factor*DCTSIZE - 1) - / (cinfo->max_h_samp_factor*DCTSIZE); - - cinfo->MCU_rows_in_scan = (cinfo->image_height - + cinfo->max_v_samp_factor*DCTSIZE - 1) - / (cinfo->max_v_samp_factor*DCTSIZE); - - cinfo->blocks_in_MCU = 0; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* for interleaved scan, sampling factors give # of blocks per component */ - compptr->MCU_width = compptr->h_samp_factor; - compptr->MCU_height = compptr->v_samp_factor; - compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; - /* compute physical dimensions of component */ - compptr->downsampled_width = jround_up(compptr->true_comp_width, - (long) (compptr->MCU_width*DCTSIZE)); - compptr->downsampled_height = jround_up(compptr->true_comp_height, - (long) (compptr->MCU_height*DCTSIZE)); - /* Sanity check */ - if (compptr->downsampled_width != - (cinfo->MCUs_per_row * (compptr->MCU_width*DCTSIZE))) - /* ERREXIT(cinfo->emethods, "I'm confused about the image width"); */ - return(XIE_ERR); - /* Prepare array describing MCU composition */ - mcublks = compptr->MCU_blocks; - if (cinfo->blocks_in_MCU + mcublks > MAX_BLOCKS_IN_MCU) - /* ERREXIT(cinfo->emethods, "Sampling factors too large for interleaved scan"); */ - return(XIE_ERR); - while (mcublks-- > 0) { - cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; - } - } - - /* Convert restart specified in rows to actual MCU count. */ - /* Note that count must fit in 16 bits, so we provide limiting. */ - if (cinfo->restart_in_rows > 0) { - long nominal = cinfo->restart_in_rows * cinfo->MCUs_per_row; - cinfo->restart_interval = (UINT16) MIN(nominal, 65535L); - } - - (*cinfo->methods->c_per_scan_method_selection) (cinfo); - return(0); -} - -LOCAL void -#if NeedFunctionPrototypes -noninterleaved_scan_setup (compress_info_ptr cinfo) -#else -noninterleaved_scan_setup (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Compute all derived info for a noninterleaved (single-component) scan */ -/* On entry, cinfo->comps_in_scan = 1 and cinfo->cur_comp_info[0] is set up */ -{ - jpeg_component_info *compptr = cinfo->cur_comp_info[0]; - - /* for noninterleaved scan, always one block per MCU */ - compptr->MCU_width = 1; - compptr->MCU_height = 1; - compptr->MCU_blocks = 1; - /* compute physical dimensions of component */ - compptr->downsampled_width = jround_up(compptr->true_comp_width, - (long) DCTSIZE); - compptr->downsampled_height = jround_up(compptr->true_comp_height, - (long) DCTSIZE); - - cinfo->MCUs_per_row = compptr->downsampled_width / DCTSIZE; - cinfo->MCU_rows_in_scan = compptr->downsampled_height / DCTSIZE; - - /* Prepare array describing MCU composition */ - cinfo->blocks_in_MCU = 1; - cinfo->MCU_membership[0] = 0; - - /* Convert restart specified in rows to actual MCU count. */ - /* Note that count must fit in 16 bits, so we provide limiting. */ - if (cinfo->restart_in_rows > 0) { - long nominal = cinfo->restart_in_rows * cinfo->MCUs_per_row; - cinfo->restart_interval = (UINT16) MIN(nominal, 65535L); - } - - (*cinfo->methods->c_per_scan_method_selection) (cinfo); -} - - -LOCAL int -#if NeedFunctionPrototypes -alloc_sampling_buffer (compress_info_ptr cinfo, JSAMPIMAGE fullsize_data[2], - long fullsize_width) -#else -alloc_sampling_buffer (cinfo, fullsize_data, fullsize_width) - compress_info_ptr cinfo; - JSAMPIMAGE fullsize_data[2]; - long fullsize_width; -#endif /* NeedFunctionPrototypes */ -/* Create a pre-downsampling data buffer having the desired structure */ -/* (see comments at head of file) */ -{ - short ci, vs, i; - - vs = cinfo->max_v_samp_factor; /* row group height */ - - /* Get top-level space for array pointers */ - fullsize_data[0] = (JSAMPIMAGE) (*cinfo->emethods->c_alloc_small) - (cinfo, (cinfo->num_components * SIZEOF(JSAMPARRAY))); - if (fullsize_data[0] == NULL) - return(XIE_ERR); - fullsize_data[1] = (JSAMPIMAGE) (*cinfo->emethods->c_alloc_small) - (cinfo, (cinfo->num_components * SIZEOF(JSAMPARRAY))); - if (fullsize_data[1] == NULL) - return(XIE_ERR); - - for (ci = 0; ci < cinfo->num_components; ci++) { - /* Allocate the real storage */ - fullsize_data[0][ci] = (*cinfo->emethods->c_alloc_small_sarray) - (cinfo, fullsize_width, - (long) (vs * (DCTSIZE+2))); - if (fullsize_data[0][ci] == NULL) - return(XIE_ERR); - /* Create space for the scrambled-order pointers */ - fullsize_data[1][ci] = (JSAMPARRAY) (*cinfo->emethods->c_alloc_small) - (cinfo, (vs * (DCTSIZE+2) * SIZEOF(JSAMPROW))); - if (fullsize_data[1][ci] == NULL) - return(XIE_ERR); - /* Duplicate the first DCTSIZE-2 row groups */ - for (i = 0; i < vs * (DCTSIZE-2); i++) { - fullsize_data[1][ci][i] = fullsize_data[0][ci][i]; - } - /* Copy the last four row groups in swapped order */ - for (i = 0; i < vs * 2; i++) { - fullsize_data[1][ci][vs*DCTSIZE + i] = fullsize_data[0][ci][vs*(DCTSIZE-2) + i]; - fullsize_data[1][ci][vs*(DCTSIZE-2) + i] = fullsize_data[0][ci][vs*DCTSIZE + i]; - } - } - return(0); -} - - -LOCAL void -#if NeedFunctionPrototypes -downsample (compress_info_ptr cinfo, - JSAMPIMAGE fullsize_data, JSAMPIMAGE sampled_data, - long fullsize_width, - short above, short current, short below, short out) -#else -downsample (cinfo, - fullsize_data, sampled_data, - fullsize_width, - above, current, below, out) - compress_info_ptr cinfo; - JSAMPIMAGE fullsize_data; - JSAMPIMAGE sampled_data; - long fullsize_width; - short above; - short current; - short below; - short out; -#endif /* NeedFunctionPrototypes */ -/* Do downsampling of a single row group (of each component). */ -/* above, current, below are indexes of row groups in fullsize_data; */ -/* out is the index of the target row group in sampled_data. */ -/* Special case: above, below can be -1 to indicate top, bottom of image. */ -{ - jpeg_component_info *compptr; - JSAMPARRAY above_ptr, below_ptr; - JSAMPROW dummy[MAX_SAMP_FACTOR]; /* for downsample expansion at top/bottom */ - short ci, vs, i; - - vs = cinfo->max_v_samp_factor; /* row group height */ - - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = & cinfo->comp_info[ci]; - - if (above >= 0) - above_ptr = fullsize_data[ci] + above * vs; - else { - /* Top of image: make a dummy above-context with copies of 1st row */ - /* We assume current=0 in this case */ - for (i = 0; i < vs; i++) - dummy[i] = fullsize_data[ci][0]; - above_ptr = (JSAMPARRAY) dummy; /* possible near->far pointer conv */ - } - - if (below >= 0) - below_ptr = fullsize_data[ci] + below * vs; - else { - /* Bot of image: make a dummy below-context with copies of last row */ - for (i = 0; i < vs; i++) - dummy[i] = fullsize_data[ci][(current+1)*vs-1]; - below_ptr = (JSAMPARRAY) dummy; /* possible near->far pointer conv */ - } - - (*cinfo->methods->downsample[ci]) - (cinfo, (int) ci, - fullsize_width, (int) vs, - compptr->downsampled_width, (int) compptr->v_samp_factor, - above_ptr, - fullsize_data[ci] + current * vs, - below_ptr, - sampled_data[ci] + out * compptr->v_samp_factor); - } -} - -METHODDEF int -#if NeedFunctionPrototypes -jcXIE_init (compress_info_ptr cinfo) -#else -jcXIE_init (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; - short ci; - -/* - * Initialize cinfo with default switch settings. - */ - - /* (Re-)initialize the system-dependent error and memory managers. */ - jcselmemmgr(cinfo, cinfo->emethods); /* memory allocation routines */ - cinfo->methods->c_ui_method_selection = c_ui_method_selection; - - /* Set up default JPEG parameters. */ - /* Note that default -quality level here need not, and does not, - * match the default scaling for an explicit -qtables argument. - */ - - /* default quality level = 75 */ - if (j_c_defaults(cinfo, 75, FALSE) == XIE_ERR) - return(XIE_ERR); - - /* Init pass counts to 0 --- total_passes is adjusted in method selection */ - cinfo->total_passes = 0; - cinfo->completed_passes = 0; - cinfo->data_precision = 8; /* always, even if 12-bit JSAMPLEs */ - - /* Give UI a chance to adjust compression parameters and select */ - /* output file format based on results of input_init. */ - (*cinfo->methods->c_ui_method_selection) (cinfo); - - /* Now select methods for compression steps. */ - if ((status = initial_setup(cinfo)) < 0) - return(status); - c_initial_method_selection(cinfo); - - /* Prepare for single scan containing all components */ - if (cinfo->num_components > MAX_COMPS_IN_SCAN) - /* ERREXIT(cinfo->emethods, "Too many components for interleaved scan"); */ - return(XIE_ERR); - cinfo->comps_in_scan = cinfo->num_components; - for (ci = 0; ci < cinfo->num_components; ci++) { - cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; - } - if (cinfo->comps_in_scan == 1) { - noninterleaved_scan_setup(cinfo); - /* Vk block rows constitute the same number of MCU rows */ - cinfo->mcu_rows_per_loop = cinfo->cur_comp_info[0]->v_samp_factor; - } else { - if ((status = interleaved_scan_setup(cinfo)) < 0) - return(status); - /* in an interleaved scan, one MCU row contains Vk block rows */ - cinfo->mcu_rows_per_loop = 1; - } - cinfo->total_passes++; - - /* Compute dimensions of full-size pixel buffers */ - /* Note these are the same whether interleaved or not. */ - cinfo->rows_in_mem = cinfo->max_v_samp_factor * DCTSIZE; - cinfo->fullsize_width = jround_up(cinfo->image_width, - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - - /* Allocate working memory: */ - /* fullsize_data is sample data before downsampling */ - if (alloc_sampling_buffer(cinfo, cinfo->fullsize_data, - cinfo->fullsize_width) == XIE_ERR) - return(XIE_ERR); - /* sampled_data is sample data after downsampling */ - cinfo->sampled_data = (JSAMPIMAGE) (*cinfo->emethods->c_alloc_small) - (cinfo, (cinfo->num_components * SIZEOF(JSAMPARRAY))); - if (cinfo->sampled_data == NULL) - return(XIE_ERR); - for (ci = 0; ci < cinfo->num_components; ci++) { - cinfo->sampled_data[ci] = (*cinfo->emethods->c_alloc_small_sarray) - (cinfo, cinfo->comp_info[ci].downsampled_width, - (long) (cinfo->comp_info[ci].v_samp_factor * DCTSIZE)); - if (cinfo->sampled_data[ci] == NULL) - return(XIE_ERR); - } - - /* Do per-scan object init */ - - if ((status = ((*cinfo->methods->entropy_encode_init) (cinfo))) < 0) - return(status); - (*cinfo->methods->downsample_init) (cinfo); - (*cinfo->methods->extract_init) (cinfo); - - cinfo->mcu_rows_output = 0; - cinfo->whichss = 0; /* arrange to start with fullsize_data[0] */ - cinfo->cur_pixel_row = 0; - cinfo->first_pixel_row = TRUE; - return(0); -} - -LOCAL void -#if NeedFunctionPrototypes -jcopy_pixel_rows (JSAMPARRAY input_array, - JSAMPIMAGE output_array, int dest_row, - int num_rows, long num_cols) -#else -jcopy_pixel_rows (input_array, - output_array, dest_row, - num_rows, num_cols) - JSAMPARRAY input_array; - JSAMPIMAGE output_array; - int dest_row; - int num_rows; - long num_cols; -#endif /* NeedFunctionPrototypes */ -/* Copy some rows of samples from one place to another. - * num_rows rows are copied from input_array[source_row++] - * to output_array[dest_row++]; these areas should not overlap. - * The source and destination arrays must be at least as wide as num_cols. - */ -{ - register JSAMPROW inptr, outptr; -#ifdef FMEMCOPY - register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#else - register long count; -#endif - register int row; - - for (row = 0; row < num_rows; row++) { - inptr = input_array[row]; - outptr = output_array[row][dest_row]; -#ifdef FMEMCOPY - FMEMCOPY(outptr, inptr, count); -#else - for (count = 0; count < num_cols; count++) - outptr[count] = inptr[count]; /* needn't bother with GETJSAMPLE() here */ -#endif - } -} - -GLOBAL int -#if NeedFunctionPrototypes -jcXIE_get (compress_info_ptr cinfo, - int row_to_process, JSAMPARRAY pixel_row) -#else -jcXIE_get (cinfo, row_to_process, pixel_row) - compress_info_ptr cinfo; - int row_to_process; - JSAMPARRAY pixel_row; -#endif /* NeedFunctionPrototypes */ -{ - int status; - short i; - short whichss; - - whichss = cinfo->whichss; - - if (cinfo->XIErestart == XIE_RNUL) { - - /* Obtain rows_this_time pixel rows and expand to rows_in_mem rows. */ - /* Then we have exactly DCTSIZE row groups for downsampling. */ - - jcopy_pixel_rows (pixel_row, - cinfo->fullsize_data[whichss], cinfo->cur_pixel_row, - cinfo->num_components, cinfo->image_width); - - if ((++(cinfo->cur_pixel_row)) < cinfo->rows_this_time) - return(0); - - (*cinfo->methods->edge_expand) (cinfo, - cinfo->image_width, cinfo->rows_this_time, - cinfo->fullsize_width, cinfo->rows_in_mem, - cinfo->fullsize_data[whichss]); - - } - /* Downsample the data (all components) */ - /* First time through is a special case */ - - if (cinfo->first_pixel_row == FALSE) { - if (cinfo->XIErestart == XIE_RNUL) { - /* Downsample last row group of previous set */ - downsample(cinfo, cinfo->fullsize_data[whichss], cinfo->sampled_data, - cinfo->fullsize_width, (short) DCTSIZE, - (short) (DCTSIZE+1), (short) 0, (short) (DCTSIZE-1)); - } - /* and dump the previous set's downsampled data */ - if ((status = (*cinfo->methods->extract_MCUs) (cinfo, cinfo->sampled_data, - cinfo->mcu_rows_per_loop, - cinfo->methods->entropy_encode)) < 0) { - return(status); - } - cinfo->mcu_rows_output += cinfo->mcu_rows_per_loop; - /* Downsample first row group of this set */ - downsample(cinfo, cinfo->fullsize_data[whichss], cinfo->sampled_data, - cinfo->fullsize_width, - (short) (DCTSIZE+1), (short) 0, (short) 1, (short) 0); - } else { - /* Downsample first row group with dummy above-context */ - downsample(cinfo, cinfo->fullsize_data[whichss], cinfo->sampled_data, - cinfo->fullsize_width, - (short) (-1), (short) 0, (short) 1, (short) 0); - cinfo->first_pixel_row = FALSE; - } - /* Downsample second through next-to-last row groups of this set */ - for (i = 1; i <= DCTSIZE-2; i++) { - downsample(cinfo, cinfo->fullsize_data[whichss], cinfo->sampled_data, - cinfo->fullsize_width, - (short) (i-1), (short) i, (short) (i+1), (short) i); - } - cinfo->whichss ^= 1; /* switch to other fullsize_data buffer */ - cinfo->cur_pixel_row = 0; - return(0); -} - -METHODDEF int -#if NeedFunctionPrototypes -jcXIE_term (compress_info_ptr cinfo) -#else -jcXIE_term (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; - short whichss; - - if (cinfo->XIErestart == XIE_RNUL) { - whichss = cinfo->whichss ^ 1; /* switch back to other buffer */ - - /* Downsample the last row group with dummy below-context */ - /* Note whichss points to last buffer side used */ - downsample(cinfo, cinfo->fullsize_data[whichss], cinfo->sampled_data, - cinfo->fullsize_width, (short) (DCTSIZE-2), (short) (DCTSIZE-1), - (short) (-1), (short) (DCTSIZE-1)); - } - /* Dump the remaining data (may be less than full height if uninterleaved) */ - if ((status = (*cinfo->methods->extract_MCUs) (cinfo, cinfo->sampled_data, - (int) (cinfo->MCU_rows_in_scan - cinfo->mcu_rows_output), - cinfo->methods->entropy_encode)) < 0) { - return(status); - } - (*cinfo->methods->extract_term) (cinfo); - (*cinfo->methods->downsample_term) (cinfo); - (*cinfo->methods->entropy_encode_term) (cinfo); - cinfo->completed_passes++; - (*cinfo->emethods->c_free_all) (cinfo); - return(0); -} - -GLOBAL void -#if NeedFunctionPrototypes -jselrXIE (compress_info_ptr cinfo) -#else -jselrXIE (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - cinfo->methods->input_init = jcXIE_init; - /* cinfo->methods->get_input_row is set by input_init */ - cinfo->methods->input_term = jcXIE_term; -} - Index: xc/programs/Xserver/XIE/mixie/jpeg/jcxief.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jcxief.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jcxief.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jcxief.c:1.2 Fri Dec 14 14:58:37 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jcxief.c Sat Feb 28 21:42:00 2004 @@ -1,491 +0,0 @@ -/* $Xorg: jcxief.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jcxief.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - jcxief.c: Xie JPEG Compression Wrapper Routines - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -#include "jinclude.h" - -#ifdef THINK_C -#include /* command-line reader for Macintosh */ -#endif - -#if NeedFunctionPrototypes -GLOBAL void -jselrXIE (compress_info_ptr); -GLOBAL void -process_rgb_ycc_row (compress_info_ptr, JSAMPARRAY); -GLOBAL int -jcXIE_get (compress_info_ptr, int, JSAMPARRAY); -GLOBAL void -jcXIE_get_buffersize (compress_info_ptr); -GLOBAL int -j_add_quant_table (compress_info_ptr, int, const QUANT_VAL *, int, boolean); -GLOBAL int -add_huff_table (compress_info_ptr, HUFF_TBL **, const UINT8 *, const UINT8 *); -#endif /* NeedFunctionPrototypes */ - -/******************************************************************************/ - -LOCAL int -#if NeedFunctionPrototypes -load_quant_tables (compress_info_ptr cinfo, - UINT8 * q_table, int nq_table, int scale_factor) -#else -load_quant_tables (cinfo, q_table, nq_table, scale_factor) - compress_info_ptr cinfo; - UINT8 * q_table; - int nq_table; - int scale_factor; -#endif /* NeedFunctionPrototypes */ -/* Read a set of quantization tables pointed at by q_table. - * There may be one to NUM_QUANT_TBLS tables, each of 64 values. - * The tables are implicitly numbered 0, 1, etc. - */ -{ - /* ZIG[i] is the zigzag-order position of the i'th element of a DCT block */ - /* read in natural order (left to right, top to bottom). */ - static const short ZIG[DCTSIZE2] = { - 0, 1, 5, 6, 14, 15, 27, 28, - 2, 4, 7, 13, 16, 26, 29, 42, - 3, 8, 12, 17, 25, 30, 41, 43, - 9, 11, 18, 24, 31, 40, 44, 53, - 10, 19, 23, 32, 39, 45, 52, 54, - 20, 22, 33, 38, 46, 51, 55, 60, - 21, 34, 37, 47, 50, 56, 59, 61, - 35, 36, 48, 49, 57, 58, 62, 63 - }; - int numtables; - int tblno, i; - QUANT_TBL table; - - numtables = nq_table / 64; - if (numtables < 1 || numtables > NUM_QUANT_TBLS) - return(XIE_ERR); - - for (tblno = 0; tblno < numtables; tblno++) - { - for (i = 0; i < DCTSIZE2; i++) - table[ZIG[i]] = *q_table++; - j_add_quant_table(cinfo, tblno, table, scale_factor, FALSE); - } - return(0); -} - -LOCAL int -#if NeedFunctionPrototypes -load_ac_tables (compress_info_ptr cinfo, - UINT8 * ac_table, int nac_table) -#else -load_ac_tables (cinfo, ac_table, nac_table) - compress_info_ptr cinfo; - UINT8 * ac_table; - int nac_table; -#endif /* NeedFunctionPrototypes */ -/* Read a set of AC Huffman tables pointed at by ac_table. - * There may be one or two tables. - */ -{ - int i; - int count; - UINT8 bits[17]; - UINT8 val[256]; - - bits[0] = 0; - /* luminance AC coefficients */ - count = 0; - nac_table -= 16; - if (nac_table < 0) /* bad length */ - return(XIE_ERR); - for(i = 1; i < 17; i++) { - bits[i] = *ac_table++; - count += bits[i]; - } - nac_table -= count; - if (nac_table < 0 || 256 < count) /* bad length */ - return(XIE_ERR); - for(i = 0; i < count; i++) { - val[i] = *ac_table++; - } - if(XIE_ERR == add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], bits, val)) - return(XIE_ERR); - - /* chrominance AC coefficients */ - count = 0; - nac_table -= 16; - if (nac_table < 0) /* bad length */ - return(XIE_ERR); - for(i = 1; i < 17; i++) { - bits[i] = *ac_table++; - count += bits[i]; - } - nac_table -= count; - if (nac_table < 0 || 256 < count) /* bad length */ - return(XIE_ERR); - for(i = 0; i < count; i++) { - val[i] = *ac_table++; - } - if(XIE_ERR == add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], bits, val)) - return(XIE_ERR); - - return(0); -} - -LOCAL int -#if NeedFunctionPrototypes -load_dc_tables (compress_info_ptr cinfo, - UINT8 * dc_table, int ndc_table) -#else -load_dc_tables (cinfo, dc_table, ndc_table) - compress_info_ptr cinfo; - UINT8 * dc_table; - int ndc_table; -#endif /* NeedFunctionPrototypes */ -/* Read a set of DC Huffman tables pointed at by dc_table. - * There may be one or two tables. - */ -{ - int i; - int count; - UINT8 bits[17]; - UINT8 val[256]; - - bits[0] = 0; - /* luminance DC coefficients */ - count = 0; - ndc_table -= 16; - if (ndc_table < 0) /* bad length */ - return(XIE_ERR); - for(i = 1; i < 17; i++) { - bits[i] = *dc_table++; - count += bits[i]; - } - ndc_table -= count; - if (ndc_table < 0 || 256 < count) /* bad length */ - return(XIE_ERR); - for(i = 0; i < count; i++) { - val[i] = *dc_table++; - } - if(XIE_ERR == add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], bits, val)) - return(XIE_ERR); - - /* chrominance DC coefficients */ - count = 0; - ndc_table -= 16; - if (ndc_table < 0) /* bad length */ - return(XIE_ERR); - for(i = 1; i < 17; i++) { - bits[i] = *dc_table++; - count += bits[i]; - } - ndc_table -= count; - if (ndc_table < 0 || 256 < count) /* bad length */ - return(XIE_ERR); - for(i = 0; i < count; i++) { - val[i] = *dc_table++; - } - if(XIE_ERR == add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], bits, val)) - return(XIE_ERR); - - return(0); -} - -/******************************************************************************/ - -GLOBAL int -#if NeedFunctionPrototypes -JC_INIT (compress_info_ptr cinfo, - compress_methods_ptr cmethods, external_methods_ptr emethods) -#else -JC_INIT (cinfo, cmethods, emethods) - compress_info_ptr cinfo; - compress_methods_ptr cmethods; - external_methods_ptr emethods; -#endif /* NeedFunctionPrototypes */ -{ - /* Set up links to method structures. */ - cinfo->methods = cmethods; - cinfo->emethods = emethods; - - /* Set restart to NULL */ - cinfo->XIErestart = XIE_RNUL; - - jselrXIE (cinfo); - - return (XIE_NRML); -} - -GLOBAL int -#if NeedFunctionPrototypes -JC_BEGINFRAME (compress_info_ptr cinfo, - long components, long width, long height, - UINT8 * q_table, int nq_table, - UINT8 * ac_table, int nac_table, - UINT8 * dc_table, int ndc_table, - short * h_sample, short * v_sample) -#else -JC_BEGINFRAME (cinfo, components, width, height, - q_table, nq_table, ac_table, nac_table, dc_table, ndc_table, - h_sample, v_sample) - compress_info_ptr cinfo; - long components; - long width; - long height; - UINT8 * q_table; - int nq_table; - UINT8 * ac_table; - int nac_table; - UINT8 * dc_table; - int ndc_table; - short * h_sample, * v_sample; -#endif /* NeedFunctionPrototypes */ -{ - short ci; - short hsample, vsample, total; - int status; - int scale_factor = 100; - - if (cinfo->XIErestart == XIE_RNUL) { - cinfo->input_components = (short)components; - cinfo->image_width = width; - cinfo->image_height = height; - if (components == 1) - cinfo->in_color_space = CS_GRAYSCALE; - else - cinfo->in_color_space = CS_RGB; - - if (1 < components) { - total = 0; - for(ci = 0; ci < components; ci++) { - hsample = h_sample[ci]; - if (hsample <= 0 || MAX_SAMP_FACTOR < hsample) - return(XIE_ERR); /* bad sub-sampling factor */ - vsample = v_sample[ci]; - if (vsample <= 0 || MAX_SAMP_FACTOR < vsample) - return(XIE_ERR); /* bad sub-sampling factor */ - total += (hsample*vsample); - if (MAX_BLOCKS_IN_MCU < total) - return(XIE_ERR); /* bad sub-sampling factor(s) */ - cinfo->xie_h_samp_factor[ci] = hsample; - cinfo->xie_v_samp_factor[ci] = vsample; - } - } - - if (((*cinfo->methods->input_init) (cinfo)) == XIE_ERR) /* jcXIE_init (cinfo); */ - return(XIE_ERR); - } - - if (0 < nq_table) { - if ((load_quant_tables (cinfo, q_table, nq_table, scale_factor)) == XIE_ERR) - return(XIE_ERR); - } - - if (0 < nac_table) { - if ((load_ac_tables (cinfo, ac_table, nac_table)) == XIE_ERR) - return(XIE_ERR); - } - - if (0 < ndc_table) { - if ((load_dc_tables (cinfo, dc_table, ndc_table)) == XIE_ERR) - return(XIE_ERR); - } - - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RWFH)) { - if ((status = ((*cinfo->methods->write_file_header) (cinfo))) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RWFH; /* set restart status */ - return(XIE_OUT); - } - } - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RWSH)) { - if ((status = ((*cinfo->methods->write_scan_header) (cinfo))) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RWSH; /* set restart status */ - return(XIE_OUT); - } - } - - return (XIE_NRML); -} - -GLOBAL int -#if NeedFunctionPrototypes -JC_ENDFRAME (compress_info_ptr cinfo) -#else -JC_ENDFRAME (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; - - /* jcXIE_term (cinfo); */ - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RMCU)) { - if ((status = ((*cinfo->methods->input_term) (cinfo))) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RMCU; /* set restart status */ - return(XIE_OUT); - } - } - - (*cinfo->methods->write_scan_trailer) (cinfo); /* does nothing */ - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RWFT)) { - if (((*cinfo->methods->write_file_trailer) (cinfo)) == XIE_OUT) { - cinfo->XIErestart = XIE_RWFT; /* set restart status */ - return(XIE_OUT); - } - } - return (XIE_NRML); -} - -GLOBAL int -#if NeedFunctionPrototypes -JC_SCANLINE_RGB (compress_info_ptr cinfo, - int * scanline, JSAMPROW ptr0, JSAMPROW ptr1, JSAMPROW ptr2) -#else -JC_SCANLINE_RGB (cinfo, scanline, ptr0, ptr1, ptr2) - compress_info_ptr cinfo; - int * scanline; - JSAMPROW ptr0; - JSAMPROW ptr1; - JSAMPROW ptr2; -#endif /* NeedFunctionPrototypes */ -{ - JSAMPROW pixel_row[3]; - int row, rows_this_time; - int status; - - row = *scanline; - if (cinfo->XIErestart == XIE_RNUL) { - if (cinfo->cur_pixel_row <= 0) { - rows_this_time = (int) MIN((long) cinfo->rows_in_mem, - cinfo->image_height - row); - if (rows_this_time <= 0) - return (XIE_NRML); - cinfo->rows_this_time = rows_this_time; - } - pixel_row[0] = ptr0; - pixel_row[1] = ptr1; - pixel_row[2] = ptr2; - } - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RMCU)) { - if ((status = jcXIE_get (cinfo, row, pixel_row)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RMCU; /* set restart status */ - return(XIE_OUT); - } - } - - return (XIE_NRML); -} - -GLOBAL int -#if NeedFunctionPrototypes -JC_SCANLINE_GRAY (compress_info_ptr cinfo, int * scanline, JSAMPROW ptr0) -#else -JC_SCANLINE_GRAY (cinfo, scanline, ptr0) - compress_info_ptr cinfo; - int * scanline; - JSAMPROW ptr0; -#endif /* NeedFunctionPrototypes */ -{ - JSAMPROW pixel_row[3]; - int row, rows_this_time; - int status; - - row = *scanline; - if (cinfo->XIErestart == XIE_RNUL) { - if (cinfo->cur_pixel_row <= 0) { - rows_this_time = (int) MIN((long) cinfo->rows_in_mem, - cinfo->image_height - row); - if (rows_this_time <= 0) - return (XIE_NRML); - cinfo->rows_this_time = rows_this_time; - } - pixel_row[0] = ptr0; - pixel_row[1] = 0; - pixel_row[2] = 0; - } - if ((cinfo->XIErestart == XIE_RNUL) || (cinfo->XIErestart == XIE_RMCU)) { - if ((status = jcXIE_get (cinfo, row, pixel_row)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RMCU; /* set restart status */ - return(XIE_OUT); - } - } - - return (XIE_NRML); -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jdbuffer.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdbuffer.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jdbuffer.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdbuffer.c:1.5 Fri Dec 14 14:58:37 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdbuffer.c Sat Feb 28 21:42:00 2004 @@ -1,150 +0,0 @@ -/* $Xorg: jdbuffer.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/*** jdbuffer.c - transfer data from input strip to decode buffer */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Ben Fahy, AGE Logic, Oct 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -#include "jpeg.h" -#include "macro.h" - -/************************************************************************/ -int fill_jpeg_decode_buffer(state) -JpegDecodeState *state; -{ -decompress_info_ptr cinfo=state->cinfo; -unsigned char *start_of_rest_of_buffer; -int bytes_to_fill,sbytes_done,sbytes_left; - -/*** It is an error to call fill_jpeg_decode_buffer after - we have found out there is no more strip data -***/ - if (state->no_more_strips) - return(JPEG_BUFFER_BufferError); - -#define START_OF_JPEG_INPUT_BUFFER (cinfo->input_buffer + MIN_UNGET) - -/*** Whenever we fill the JPEG decode buffer, we always start by - copying existing data to start of buffer. This way we know - we have a nice contiguous buffer of JPEG_BUF_SIZE bytes long -***/ - if (cinfo->bytes_in_buffer) { - memcpy(START_OF_JPEG_INPUT_BUFFER, - cinfo->next_input_byte, - cinfo->bytes_in_buffer); - } - cinfo->next_input_byte = START_OF_JPEG_INPUT_BUFFER; - /* tells decoder (s)he can start reading here */ - -/*** Ok, now calculate how much fills the rest of the buffer, and - where to put it (assuming we can get the data from a strip) -***/ - start_of_rest_of_buffer = (unsigned char *) - cinfo->next_input_byte + cinfo->bytes_in_buffer; - - bytes_to_fill = JPEG_BUF_SIZE - cinfo->bytes_in_buffer; - /* how much room is left in the buffer */ - -/*** Is there enough data in the current strip to fill buffer? ***/ - sbytes_done = state->sptr - state->strip; - sbytes_left = state->strip_size - sbytes_done; - - if (sbytes_left >= bytes_to_fill) { - /* yes! */ - memcpy(start_of_rest_of_buffer,state->sptr,bytes_to_fill); - state->sptr += bytes_to_fill; - cinfo->bytes_in_buffer += bytes_to_fill; - - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - cinfo->XIEnext_input_byte = cinfo->next_input_byte; - /* save these in case we have to restart */ - - return(JPEG_BUFFER_BufferFilled); - } - -/*** Well, no. We will copy what we can. If this is the last - strip, we will set NoMoreStrips to signal the next state. - If there are more strips to come, we will return the - signal NeedAnotherStrip, so caller will go get another. -***/ - memcpy(start_of_rest_of_buffer,state->sptr,sbytes_left); - cinfo->bytes_in_buffer += sbytes_left; - - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - cinfo->XIEnext_input_byte = cinfo->next_input_byte; - /* save these in case we have to restart */ - - if (state->final) { - state->no_more_strips = 1; - return(JPEG_BUFFER_LastBuffer); - } - else - return(JPEG_BUFFER_NeedAnotherStrip); -} -/************************************************************************/ Index: xc/programs/Xserver/XIE/mixie/jpeg/jddeflts.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jddeflts.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jddeflts.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jddeflts.c:1.2 Fri Dec 14 14:58:37 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jddeflts.c Sat Feb 28 21:42:00 2004 @@ -1,294 +0,0 @@ -/* $Xorg: jddeflts.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/* Module jddeflts.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - -****************************************************************************/ - -/* - * jddeflts.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains optional default-setting code for the JPEG decompressor. - * User interfaces do not have to use this file, but those that don't use it - * must know more about the innards of the JPEG code. - */ - -#include "jinclude.h" - -#ifndef XIE_SUPPORTED -/* Default do-nothing progress monitoring routine. - * This can be overridden by a user interface that wishes to - * provide progress monitoring; just set methods->progress_monitor - * after j_d_defaults is done. The routine will be called periodically - * during the decompression process. - * - * During any one pass, loopcounter increases from 0 up to (not including) - * looplimit; the step size is not necessarily 1. Both the step size and - * the limit may differ between passes. The expected total number of passes - * is in cinfo->total_passes, and the number of passes already completed is - * in cinfo->completed_passes. Thus the fraction of work completed may be - * estimated as - * completed_passes + (loopcounter/looplimit) - * ------------------------------------------ - * total_passes - * ignoring the fact that the passes may not be equal amounts of work. - * - * When decompressing, the total_passes figure is an estimate that may be - * on the high side; completed_passes will jump by more than one if some - * passes are skipped. - */ - -METHODDEF void -progress_monitor (decompress_info_ptr cinfo, long loopcounter, long looplimit) -{ - /* do nothing */ -} -#endif /* XIE_SUPPORTED */ - -/* Default comment-block processing routine. - * This can be overridden by an application that wishes to examine - * COM blocks found in the JPEG file. The default routine does nothing. - * CAUTION: the comment processing routine MUST call JGETC() exactly - * comment_length times to read the comment data, whether it intends - * to do anything with the data or not! - * Keep in mind that (a) there may be more than one COM block in a file; - * (b) there's no guarantee that what's in the block is ASCII data. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -process_comment (decompress_info_ptr cinfo, long comment_length) -#else -process_comment (cinfo, comment_length) - decompress_info_ptr cinfo; - long comment_length; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -process_comment (decompress_info_ptr cinfo, long comment_length) -#endif /* XIE_SUPPORTED */ -{ -#ifdef XIE_SUPPORTED - int i; -#endif /* XIE_SUPPORTED */ - - while (comment_length-- > 0) { -#ifdef XIE_SUPPORTED - if ((i = JGETC(cinfo)) < 0) - return(-1); -#else - (void) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifndef XIE_SUPPORTED -/* - * Reload the input buffer after it's been emptied, and return the next byte. - * See the JGETC macro for calling conditions. Note in particular that - * read_jpeg_data may NOT return EOF. If no more data is available, it must - * exit via ERREXIT, or perhaps synthesize fake data (such as an RST marker). - * In the present implementation, we insert an EOI marker; this might not be - * appropriate for non-JFIF file formats, but it usually allows us to handle - * a truncated JFIF file. - * - * This routine can be overridden by the system-dependent user interface, - * in case the data source is not a stdio stream or some other special - * condition applies. Note, however, that this capability only applies for - * JFIF or similar serial-access JPEG file formats. The input file control - * module for a random-access format such as TIFF/JPEG would most likely - * override the read_jpeg_data method with its own routine. - */ - -METHODDEF int -read_jpeg_data (decompress_info_ptr cinfo) -{ - cinfo->next_input_byte = cinfo->input_buffer + MIN_UNGET; - - cinfo->bytes_in_buffer = (int) JFREAD(cinfo->input_file, - cinfo->next_input_byte, - JPEG_BUF_SIZE); - - if (cinfo->bytes_in_buffer <= 0) { - WARNMS(cinfo->emethods, "Premature EOF in JPEG file"); - cinfo->next_input_byte[0] = (char) 0xFF; - cinfo->next_input_byte[1] = (char) 0xD9; /* EOI marker */ - cinfo->bytes_in_buffer = 2; - } - - return JGETC(cinfo); -} -#endif /* XIE_SUPPORTED */ - - -/* Default parameter setup for decompression. - * - * User interfaces that don't choose to use this routine must do their - * own setup of all these parameters. Alternately, you can call this - * to establish defaults and then alter parameters selectively. This - * is the recommended approach since, if we add any new parameters, - * your code will still work (they'll be set to reasonable defaults). - * - * standard_buffering should be TRUE to cause an input buffer to be allocated - * (the normal case); if FALSE, the user interface must provide a buffer. - * This option is most useful in the case that the buffer must not be freed - * at the end of an image. (For example, when reading a sequence of images - * from a single file, the remaining data in the buffer represents the - * start of the next image and mustn't be discarded.) To handle this, - * allocate the input buffer yourself at startup, WITHOUT using alloc_small - * (probably a direct call to malloc() instead). Then pass FALSE on each - * call to j_d_defaults to ensure the buffer state is not modified. - * - * If the source of the JPEG data is not a stdio stream, override the - * read_jpeg_data method with your own routine after calling j_d_defaults. - * You can still use the standard buffer if it's appropriate. - * - * CAUTION: if you want to decompress multiple images per run, it's necessary - * to call j_d_defaults before *each* call to jpeg_decompress, since subsidiary - * structures like the quantization tables are automatically freed during - * cleanup. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -j_d_defaults (decompress_info_ptr cinfo, boolean standard_buffering) -#else -j_d_defaults (cinfo, standard_buffering) - decompress_info_ptr cinfo; - boolean standard_buffering; -#endif /* NeedFunctionPrototypes */ -#else -j_d_defaults (decompress_info_ptr cinfo, boolean standard_buffering) -#endif /* XIE_SUPPORTED */ -/* NB: the external methods must already be set up. */ -{ - short i; - - /* Initialize pointers as needed to mark stuff unallocated. */ - /* Outer application may fill in default tables for abbreviated files... */ - cinfo->comp_info = NULL; - for (i = 0; i < NUM_QUANT_TBLS; i++) - cinfo->quant_tbl_ptrs[i] = NULL; - for (i = 0; i < NUM_HUFF_TBLS; i++) { - cinfo->dc_huff_tbl_ptrs[i] = NULL; - cinfo->ac_huff_tbl_ptrs[i] = NULL; - } - cinfo->colormap = NULL; - - /* Default to RGB output */ - /* UI can override by changing out_color_space */ - cinfo->out_color_space = CS_RGB; - cinfo->jpeg_color_space = CS_UNKNOWN; - /* Setting any other value in jpeg_color_space overrides heuristics in */ - /* jrdjfif.c. That might be useful when reading non-JFIF JPEG files, */ - /* but ordinarily the UI shouldn't change it. */ - - /* Default to no gamma correction of output */ - cinfo->output_gamma = 1.0; - - /* Default to no color quantization */ - cinfo->quantize_colors = FALSE; - /* but set reasonable default parameters for quantization, */ - /* so that turning on quantize_colors is sufficient to do something useful */ - cinfo->two_pass_quantize = TRUE; - cinfo->use_dithering = TRUE; - cinfo->desired_number_of_colors = 256; - - /* Default to no smoothing */ - cinfo->do_block_smoothing = FALSE; - cinfo->do_pixel_smoothing = FALSE; - -#ifndef XIE_SUPPORTED - /* Allocate memory for input buffer, unless outer application provides it. */ - if (standard_buffering) { - cinfo->input_buffer = (char *) (*cinfo->emethods->alloc_small) - ((size_t) (JPEG_BUF_SIZE + MIN_UNGET)); - cinfo->bytes_in_buffer = 0; /* initialize buffer to empty */ - } - - /* Install standard buffer-reloading method (outer code may override). */ - cinfo->methods->read_jpeg_data = read_jpeg_data; - - /* Install default do-nothing progress monitoring method. */ - cinfo->methods->progress_monitor = progress_monitor; -#endif /* XIE_SUPPORTED */ - - /* Install default comment-block processing method. */ - cinfo->methods->process_comment = process_comment; -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jdhuff.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdhuff.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jdhuff.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdhuff.c:1.5 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdhuff.c Sat Feb 28 21:42:00 2004 @@ -1,698 +0,0 @@ -/* $Xorg: jdhuff.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/* Module jdhuff.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - -****************************************************************************/ - -/* - * jdhuff.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy decoding routines. - * These routines are invoked via the methods entropy_decode - * and entropy_decode_init/term. - */ - -#include "jinclude.h" -#include "macro.h" - - -/* Static variables to avoid passing 'round extra parameters */ - -static decompress_info_ptr dcinfo; - -static INT32 get_buffer; /* current bit-extraction buffer */ -static int bits_left; /* # of unused bits in it */ -#ifdef XIE_SUPPORTED -static UINT16 restarts_to_go; /* MCUs left in this restart interval */ -static short next_restart_num; /* # of next RSTn marker (0..7) */ -#define XIE_EOB 0xffffffff /* Return value when input buffer is empty */ -#else -static boolean printed_eod; /* flag to suppress multiple end-of-data msgs */ -#endif /* XIE_SUPPORTED */ - -LOCAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fix_huff_tbl (HUFF_TBL * htbl) -#else -fix_huff_tbl (htbl) - HUFF_TBL * htbl; -#endif /* NeedFunctionPrototypes */ -#else -fix_huff_tbl (HUFF_TBL * htbl) -#endif /* XIE_SUPPORTED */ -/* Compute derived values for a Huffman table */ -{ - int p, i, l, si; - char huffsize[257]; - UINT16 huffcode[257]; - UINT16 code; - - /* Figure C.1: make table of Huffman code length for each symbol */ - /* Note that this is in code-length order. */ - - p = 0; - for (l = 1; l <= 16; l++) { - for (i = 1; i <= (int) htbl->bits[l]; i++) - huffsize[p++] = (char) l; - } - huffsize[p] = 0; - - /* Figure C.2: generate the codes themselves */ - /* Note that this is in code-length order. */ - - code = 0; - si = huffsize[0]; - p = 0; - while (huffsize[p]) { - while (((int) huffsize[p]) == si) { - huffcode[p++] = code; - code++; - } - code <<= 1; - si++; - } - - /* We don't bother to fill in the encoding tables ehufco[] and ehufsi[], */ - /* since they are not used for decoding. */ - - /* Figure F.15: generate decoding tables */ - - p = 0; - for (l = 1; l <= 16; l++) { - if (htbl->bits[l]) { - htbl->valptr[l] = p; /* huffval[] index of 1st sym of code len l */ - htbl->mincode[l] = huffcode[p]; /* minimum code of length l */ - p += htbl->bits[l]; - htbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */ - } else { - htbl->maxcode[l] = -1; - } - } - htbl->maxcode[17] = 0xFFFFFL; /* ensures huff_DECODE terminates */ -} - - -/* - * Code for extracting the next N bits from the input stream. - * (N never exceeds 15 for JPEG data.) - * This needs to go as fast as possible! - * - * We read source bytes into get_buffer and dole out bits as needed. - * If get_buffer already contains enough bits, they are fetched in-line - * by the macros get_bits() and get_bit(). When there aren't enough bits, - * fill_bit_buffer is called; it will attempt to fill get_buffer to the - * "high water mark", then extract the desired number of bits. The idea, - * of course, is to minimize the function-call overhead cost of entering - * fill_bit_buffer. - * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width - * of get_buffer to be used. (On machines with wider words, an even larger - * buffer could be used.) However, on some machines 32-bit shifts are - * relatively slow and take time proportional to the number of places shifted. - * (This is true with most PC compilers, for instance.) In this case it may - * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the - * average shift distance at the cost of more calls to fill_bit_buffer. - */ - -#ifdef SLOW_SHIFT_32 -#define MIN_GET_BITS 15 /* minimum allowable value */ -#else -#define MIN_GET_BITS 25 /* max value for 32-bit get_buffer */ -#endif - -static const int bmask[16] = /* bmask[n] is mask for n rightmost bits */ - { 0, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, - 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF }; - - -LOCAL int -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fill_bit_buffer (int nbits) -#else -fill_bit_buffer (nbits) - int nbits; -#endif /* NeedFunctionPrototypes */ -#else -fill_bit_buffer (int nbits) -#endif /* XIE_SUPPORTED */ -/* Load up the bit buffer and do get_bits(nbits) */ -{ - /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ - while (bits_left < MIN_GET_BITS) { - register int c = JGETC(dcinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(XIE_EOB); -#endif /* XIE_SUPPORTED */ - - /* If it's 0xFF, check and discard stuffed zero byte */ - if (c == 0xFF) { - int c2 = JGETC(dcinfo); -#ifdef XIE_SUPPORTED - if (c2 < 0) - return(XIE_EOB); -#endif /* XIE_SUPPORTED */ - if (c2 != 0) { - /* Oops, it's actually a marker indicating end of compressed data. */ - /* Better put it back for use later */ - JUNGETC(c2,dcinfo); - JUNGETC(c,dcinfo); - /* There should be enough bits still left in the data segment; */ - /* if so, just break out of the while loop. */ - if (bits_left >= nbits) - break; - /* Uh-oh. Report corrupted data to user and stuff zeroes into - * the data stream, so we can produce some kind of image. - * Note that this will be repeated for each byte demanded for the - * rest of the segment; this is a bit slow but not unreasonably so. - * The main thing is to avoid getting a zillion warnings, hence: - */ -#ifndef XIE_SUPPORTED - if (! printed_eod) { - WARNMS(dcinfo->emethods, "Corrupt JPEG data: premature end of data segment"); - printed_eod = TRUE; - } -#endif /* XIE_SUPPORTED */ - c = 0; /* insert a zero byte into bit buffer */ - } - } - - /* OK, load c into get_buffer */ - get_buffer = (get_buffer << 8) | c; - bits_left += 8; - } - - /* Having filled get_buffer, extract desired bits (this simplifies macros) */ - bits_left -= nbits; - return ((int) (get_buffer >> bits_left)) & bmask[nbits]; -} - - -/* Macros to make things go at some speed! */ -/* NB: parameter to get_bits should be simple variable, not expression */ - -#define get_bits(nbits) \ - (bits_left >= (nbits) ? \ - ((int) (get_buffer >> (bits_left -= (nbits)))) & bmask[nbits] : \ - fill_bit_buffer(nbits)) - -#define get_bit() \ - (bits_left ? \ - ((int) (get_buffer >> (--bits_left))) & 1 : \ - fill_bit_buffer(1)) - - -/* Figure F.16: extract next coded symbol from input stream */ - -INLINE -LOCAL int -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -huff_DECODE (HUFF_TBL * htbl) -#else -huff_DECODE (htbl) - HUFF_TBL * htbl; -#endif /* NeedFunctionPrototypes */ -#else -huff_DECODE (HUFF_TBL * htbl) -#endif /* XIE_SUPPORTED */ -{ - register int l; - register INT32 code; - -#ifdef XIE_SUPPORTED - register int j; - - if ((code = get_bit()) == XIE_EOB) - return(XIE_EOB); - l = 1; - while (code > htbl->maxcode[l]) { - if ((j = get_bit()) == XIE_EOB) - return(XIE_EOB); - code = (code << 1) | j; - l++; - } -#else - code = get_bit(); - l = 1; - while (code > htbl->maxcode[l]) { - code = (code << 1) | get_bit(); - l++; - } -#endif /* XIE_SUPPORTED */ - - /* With garbage input we may reach the sentinel value l = 17. */ - - if (l > 16) { -#ifndef XIE_SUPPORTED - WARNMS(dcinfo->emethods, "Corrupt JPEG data: bad Huffman code"); -#endif /* XIE_SUPPORTED */ - return 0; /* fake a zero as the safest result */ - } - - return htbl->huffval[ htbl->valptr[l] + ((int) (code - htbl->mincode[l])) ]; -} - - -/* Figure F.12: extend sign bit */ - -#define huff_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) - -static const int extend_test[16] = /* entry n is 2**(n-1) */ - { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, - 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; - -static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; - - -/* - * Initialize for a Huffman-compressed scan. - * This is invoked after reading the SOS marker. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -huff_decoder_init (decompress_info_ptr cinfo) -#else -huff_decoder_init (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -huff_decoder_init (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - short ci; - jpeg_component_info * compptr; - - /* Initialize static variables */ - dcinfo = cinfo; -#ifdef XIE_SUPPORTED - bits_left = 0; - cinfo->XIEbits_left = bits_left; - get_buffer = 0; - cinfo->XIEget_buffer = get_buffer; - cinfo->printed_eod = FALSE; -#else - bits_left = 0; - printed_eod = FALSE; -#endif /* XIE_SUPPORTED */ - - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Make sure requested tables are present */ - if (cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no] == NULL || - cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no] == NULL) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Use of undefined Huffman table"); -#endif /* XIE_SUPPORTED */ - /* Compute derived values for Huffman tables */ - /* We may do this more than once for same table, but it's not a big deal */ - fix_huff_tbl(cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no]); - fix_huff_tbl(cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no]); - /* Initialize DC predictions to 0 */ - cinfo->last_dc_val[ci] = 0; - } - - /* Initialize restart stuff */ - cinfo->restarts_to_go = cinfo->restart_interval; - cinfo->next_restart_num = 0; -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Check for a restart marker & resynchronize decoder. - */ - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -process_restart (decompress_info_ptr cinfo) -#else -process_restart (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -process_restart (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - int c, nbytes; - short ci; - - /* Throw away any unused bits remaining in bit buffer */ - nbytes = bits_left / 8; /* count any full bytes loaded into buffer */ - bits_left = 0; -#ifdef XIE_SUPPORTED - cinfo->printed_eod = FALSE; /* next segment can get another warning */ -#else - printed_eod = FALSE; /* next segment can get another warning */ -#endif /* XIE_SUPPORTED */ - - /* Scan for next JPEG marker */ - do { - do { /* skip any non-FF bytes */ - nbytes++; - c = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(XIE_EOB); -#endif /* XIE_SUPPORTED */ - } while (c != 0xFF); - do { /* skip any duplicate FFs */ - /* we don't increment nbytes here since extra FFs are legal */ - c = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(XIE_EOB); -#endif /* XIE_SUPPORTED */ - } while (c == 0xFF); - } while (c == 0); /* repeat if it was a stuffed FF/00 */ - -#ifndef XIE_SUPPORTED - if (nbytes != 1) - WARNMS2(cinfo->emethods, - "Corrupt JPEG data: %d extraneous bytes before marker 0x%02x", - nbytes-1, c); -#endif /* XIE_SUPPORTED */ - - if (c != (RST0 + cinfo->next_restart_num)) { - /* Uh-oh, the restart markers have been messed up too. */ - /* Let the file-format module try to figure out how to resync. */ - (*cinfo->methods->resync_to_restart) (cinfo, c); -#ifdef XIE_SUPPORTED - } -#else - } else - TRACEMS1(cinfo->emethods, 2, "RST%d", cinfo->next_restart_num); -#endif /* XIE_SUPPORTED */ - -#ifndef XIE_SUPPORTED - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = 0; - - /* Update restart state */ - cinfo->restarts_to_go = cinfo->restart_interval; - cinfo->next_restart_num = (cinfo->next_restart_num + 1) & 7; -#else - restarts_to_go = cinfo->restart_interval; - next_restart_num = (next_restart_num + 1) & 7; - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* ZAG[i] is the natural-order position of the i'th element of zigzag order. - * If the incoming data is corrupted, huff_decode_mcu could attempt to - * reference values beyond the end of the array. To avoid a wild store, - * we put some extra zeroes after the real entries. - */ - -static const short ZAG[DCTSIZE2+16] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - 0, 0, 0, 0, 0, 0, 0, 0, /* extra entries in case k>63 below */ - 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* - * Decode and return one MCU's worth of Huffman-compressed coefficients. - * This routine also handles quantization descaling and zigzag reordering - * of coefficient values. - * - * The i'th block of the MCU is stored into the block pointed to by - * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. - * (Wholesale zeroing is usually a little faster than retail...) - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -huff_decode_mcu (decompress_info_ptr cinfo, JBLOCKROW *MCU_data) -#else -huff_decode_mcu (cinfo, MCU_data) - decompress_info_ptr cinfo; - JBLOCKROW *MCU_data; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -huff_decode_mcu (decompress_info_ptr cinfo, JBLOCKROW *MCU_data) -#endif /* XIE_SUPPORTED */ -{ - register int s, k, r; - short blkn, ci; - register JBLOCKROW block; - register QUANT_TBL_PTR quanttbl; - HUFF_TBL *dctbl; - HUFF_TBL *actbl; - jpeg_component_info * compptr; - -#ifdef XIE_SUPPORTED - JCOEF last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each comp */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - last_dc_val[ci] = cinfo->last_dc_val[ci]; - - dcinfo = cinfo; - bits_left = cinfo->XIEbits_left; - get_buffer = cinfo->XIEget_buffer; - restarts_to_go = cinfo->restarts_to_go; - next_restart_num = cinfo->next_restart_num; -#endif /* XIE_SUPPORTED */ - - /* Account for restart interval, process restart marker if needed */ - if (cinfo->restart_interval) { - if (cinfo->restarts_to_go == 0) -#ifdef XIE_SUPPORTED - { - s = process_restart(cinfo); - if (s == XIE_EOB) - return(XIE_EOB); - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - last_dc_val[ci] = 0; - } - restarts_to_go--; -#else - process_restart(cinfo); - cinfo->restarts_to_go--; -#endif /* XIE_SUPPORTED */ - } - - /* Outer loop handles each block in the MCU */ - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - quanttbl = cinfo->quant_tbl_ptrs[compptr->quant_tbl_no]; - actbl = cinfo->ac_huff_tbl_ptrs[compptr->ac_tbl_no]; - dctbl = cinfo->dc_huff_tbl_ptrs[compptr->dc_tbl_no]; - - /* Decode a single block's worth of coefficients */ - - /* Section F.2.2.1: decode the DC coefficient difference */ - s = huff_DECODE(dctbl); -#ifdef XIE_SUPPORTED - if (s == XIE_EOB) { - return(XIE_EOB); - } -#endif /* XIE_SUPPORTED */ - if (s) { - r = get_bits(s); -#ifdef XIE_SUPPORTED - if (r == XIE_EOB) { - return(XIE_EOB); - } -#endif /* XIE_SUPPORTED */ - s = huff_EXTEND(r, s); - } - - /* Convert DC difference to actual value, update last_dc_val */ -#ifdef XIE_SUPPORTED - s += last_dc_val[ci]; - last_dc_val[ci] = (JCOEF) s; -#else - s += cinfo->last_dc_val[ci]; - cinfo->last_dc_val[ci] = (JCOEF) s; -#endif /* XIE_SUPPORTED */ - /* Descale and output the DC coefficient (assumes ZAG[0] = 0) */ - (*block)[0] = (JCOEF) (((JCOEF) s) * quanttbl[0]); - - /* Section F.2.2.2: decode the AC coefficients */ - /* Since zero values are skipped, output area must be zeroed beforehand */ - for (k = 1; k < DCTSIZE2; k++) { - r = huff_DECODE(actbl); -#ifdef XIE_SUPPORTED - if (r == XIE_EOB) { - return(XIE_EOB); - } -#endif /* XIE_SUPPORTED */ - - s = r & 15; - r = r >> 4; - - if (s) { - k += r; - r = get_bits(s); -#ifdef XIE_SUPPORTED - if (r == XIE_EOB) { - return(XIE_EOB); - } -#endif /* XIE_SUPPORTED */ - s = huff_EXTEND(r, s); - /* Descale coefficient and output in natural (dezigzagged) order */ - (*block)[ZAG[k]] = (JCOEF) (((JCOEF) s) * quanttbl[k]); - } else { - if (r != 15) - break; - k += 15; - } - } - } -#ifdef XIE_SUPPORTED - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - cinfo->last_dc_val[ci] = last_dc_val[ci]; - cinfo->XIEbits_left = bits_left; - cinfo->XIEget_buffer = get_buffer; - cinfo->restarts_to_go = restarts_to_go; - cinfo->next_restart_num = next_restart_num; - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Finish up at the end of a Huffman-compressed scan. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -huff_decoder_term (decompress_info_ptr cinfo) -#else -huff_decoder_term (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -huff_decoder_term (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* No work needed */ -} -#endif /* XIE_SUPPORTED */ - -/* - * The method selection routine for Huffman entropy decoding. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jseldhuffman (decompress_info_ptr cinfo) -#else -jseldhuffman (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jseldhuffman (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - if (! cinfo->arith_code) { - cinfo->methods->entropy_decode_init = huff_decoder_init; - cinfo->methods->entropy_decode = huff_decode_mcu; -#ifndef XIE_SUPPORTED - cinfo->methods->entropy_decode_term = huff_decoder_term; -#endif /* XIE_SUPPORTED */ - } -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jdlossy.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdlossy.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jdlossy.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdlossy.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdlossy.c Sat Feb 28 21:42:00 2004 @@ -1,243 +0,0 @@ -/* $Xorg: jdlossy.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jdlossy.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - jdlossy.c - decode JPEG images, Lossy method - - this contain code for: - - 1) JPEG Lossless, grayscale - 2) JPEG Lossless, color - - Ben Fahy, AGE Logic, Oct 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -#include "jpeg.h" - -/**********************************************************************/ -decode_jpeg_lossy_gray(state) -JpegDecodeState *state; -{ - return( decode_jpeg_lossy_color(state) ); -} -/**********************************************************************/ -decode_jpeg_lossy_color(state) -JpegDecodeState *state; -{ -int status; - -/* our output buffer is guaranteed to be clean on entry. */ -/* (every time we write data below, we return to flush it) */ - state->nl_found=0; - state->nl_flushed=0; - - while(1) { /* loop forever (we're a state machine) */ - - switch( state->goal) { - case JPEG_DECODE_GOAL_Startup: - state->goal = JPEG_DECODE_GOAL_ReadDataForInit; - - case JPEG_DECODE_GOAL_ReadDataForInit: - /* we start up by reading data into our buffer and calling INIT */ - status = fill_jpeg_decode_buffer(state); - switch(status) { - case JPEG_BUFFER_LastBuffer: - break; - - case JPEG_BUFFER_BufferFilled: - /* all is coolness */ - break; - - case JPEG_BUFFER_NeedAnotherStrip: - state->needs_input_strip = 1; - return(state->nl_found); - break; - - case JPEG_BUFFER_BufferError: - default: - state->error_code = JPEG_DECODE_ERROR_CouldNotStart; - return(-1); - } - - /* if here, we should have a nice full input buffer */ - - case JPEG_DECODE_GOAL_TryToInit: - status = JD_INIT(state->cinfo, - state->dc_methods, - state->e_methods, - state->up_sample); - if (status == XIE_ERR) { - state->error_code = JPEG_DECODE_ERROR_CouldNotInit; - return(-1); - } - if (status == XIE_NRML) { - state->goal = JPEG_DECODE_GOAL_InitDone; - break; - } - if (status == XIE_INP) { - state->goal = JPEG_DECODE_GOAL_ReadDataForInit; - break; - } - /* hey! we aren't supposed to be here */ - state->error_code = JPEG_DECODE_ERROR_BadInitRetCode; - return(-1); - break; - - case JPEG_DECODE_GOAL_InitDone: - - /* now we know enough to allocate our output buffer */ - state->cinfo->output_workspace = - alloc_sampimage(state->cinfo, - (int) state->cinfo->comps_in_scan, - (long) state->cinfo->rows_in_mem, - state->cinfo->image_width - ); - if (state->cinfo->output_workspace == NULL) { - state->error_code = JPEG_DECODE_ERROR_BadOutputAlloc; - return(-1); - } - state->goal = JPEG_DECODE_GOAL_ProcessData; - - case JPEG_DECODE_GOAL_ProcessData: - status = JD_PROCESS(state->cinfo); - - if (status == XIE_INP) { - state->goal = JPEG_DECODE_GOAL_ReadDataForProcess; - break; - } - if (status == XIE_OUT) { - state->goal = JPEG_DECODE_GOAL_WriteDataForProcess; - break; - } - if (status == XIE_EOI) { - state->goal = JPEG_DECODE_GOAL_EndOfInput; - break; - } - if (status == XIE_NRML) - break; - - if (status == XIE_ERR) { - state->error_code = JPEG_DECODE_ERROR_DecodeError; - return(-1); - } - else { - /* unexpected return status */ - state->error_code = JPEG_DECODE_ERROR_DecoderIsFreakingOut; - return(-1); - } - break; - - case JPEG_DECODE_GOAL_ReadDataForProcess: - status = fill_jpeg_decode_buffer(state); - switch(status) { - case JPEG_BUFFER_LastBuffer: - break; - - case JPEG_BUFFER_BufferFilled: - /* all is coolness */ - break; - - case JPEG_BUFFER_NeedAnotherStrip: - state->needs_input_strip = 1; - return(state->nl_found); - break; - - case JPEG_BUFFER_BufferError: - default: - state->error_code = JPEG_DECODE_ERROR_NoMoreProcessData; - return(-1); - } - state->goal = JPEG_DECODE_GOAL_ProcessData; - break; - - case JPEG_DECODE_GOAL_EndOfInput: - state->goal = JPEG_DECODE_GOAL_Done; - state->nl_found = (state->cinfo->image_height - - state->cinfo->pixel_rows_output); - /* see jdXIE_get() if this seems *too* self-serving */ - - /* leave for good */ - return(state->nl_found); - break; - - case JPEG_DECODE_GOAL_WriteDataForProcess: - state->goal = JPEG_DECODE_GOAL_ProcessData; - state->cinfo->pixel_rows_output += state->cinfo->rows_in_mem; - state->nl_found = state->cinfo->rows_in_mem; - /* leave to flush data */ - return(state->nl_found); - break; - - default: - state->error_code = JPEG_DECODE_ERROR_BadGoal; - return(-1); - } - } -} -/**********************************************************************/ Index: xc/programs/Xserver/XIE/mixie/jpeg/jdmcu.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdmcu.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jdmcu.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdmcu.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdmcu.c Sat Feb 28 21:42:00 2004 @@ -1,432 +0,0 @@ -/* $Xorg: jdmcu.c,v 1.4 2001/02/09 02:04:28 xorgcvs Exp $ */ -/* Module jdmcu.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jdmcu.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains MCU disassembly and IDCT control routines. - * These routines are invoked via the disassemble_MCU, reverse_DCT, and - * disassemble_init/term methods. - */ - -#include "jinclude.h" - - -/* - * Fetch one MCU row from entropy_decode, build coefficient array. - * This version is used for noninterleaved (single-component) scans. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -disassemble_noninterleaved_MCU (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data) -#else -disassemble_noninterleaved_MCU (cinfo, image_data) - decompress_info_ptr cinfo; - JBLOCKIMAGE image_data; -#endif /* NeedFunctionPrototypes */ -{ - long mcuindex; - long start; - - /* this is pretty easy since there is one component and one block per MCU */ - - if (cinfo->XIErestart == XIE_RMCU) { - start = cinfo->XIEmcuindex; - cinfo->XIErestart = XIE_RNUL; - } else { - start = 0; - /* Pre-zero the target area to speed up entropy decoder */ - /* (we assume wholesale zeroing is faster than retail) */ - jzero_far((pointer) image_data[0][0], - (size_t) (cinfo->MCUs_per_row * SIZEOF(JBLOCK))); - } - for (mcuindex = start; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Point to the proper spot in the image array for this MCU */ - cinfo->MCU_data[0] = image_data[0][0] + mcuindex; - /* Fetch the coefficient data */ - /* Save the current input buffer position (for restart) */ - cinfo->XIEnext_input_byte = cinfo->next_input_byte; - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - if (((*cinfo->methods->entropy_decode) (cinfo, cinfo->MCU_data)) < 0) { - cinfo->XIErestart = XIE_RMCU; - cinfo->XIEmcuindex = mcuindex; - cinfo->next_input_byte = cinfo->XIEnext_input_byte; - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - return(-1); - } - } - return(0); -} -#else -METHODDEF void -disassemble_noninterleaved_MCU (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data) -{ - JBLOCKROW MCU_data[1]; - long mcuindex; - - /* this is pretty easy since there is one component and one block per MCU */ - - /* Pre-zero the target area to speed up entropy decoder */ - /* (we assume wholesale zeroing is faster than retail) */ - jzero_far((pointer) image_data[0][0], - (size_t) (cinfo->MCUs_per_row * SIZEOF(JBLOCK))); - - for (mcuindex = 0; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Point to the proper spot in the image array for this MCU */ - MCU_data[0] = image_data[0][0] + mcuindex; - /* Fetch the coefficient data */ - (*cinfo->methods->entropy_decode) (cinfo, MCU_data); - } -} -#endif /* XIE_SUPPORTED */ - - -/* - * Fetch one MCU row from entropy_decode, build coefficient array. - * This version is used for interleaved (multi-component) scans. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -disassemble_interleaved_MCU (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data) -#else -disassemble_interleaved_MCU (cinfo, image_data) - decompress_info_ptr cinfo; - JBLOCKIMAGE image_data; -#endif /* NeedFunctionPrototypes */ -{ - long mcuindex; - long start; - short blkn, ci, xpos, ypos; - jpeg_component_info * compptr; - JBLOCKROW image_ptr; - - /* Pre-zero the target area to speed up entropy decoder */ - /* (we assume wholesale zeroing is faster than retail) */ - if (cinfo->XIErestart == XIE_RMCU) { - start = cinfo->XIEmcuindex; - cinfo->XIErestart = XIE_RNUL; - } else { - start = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - jzero_far((pointer) image_data[ci][ypos], - (size_t) (cinfo->MCUs_per_row * compptr->MCU_width * SIZEOF(JBLOCK))); - } - } - } - - for (mcuindex = start; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Point to the proper spots in the image array for this MCU */ - blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - image_ptr = image_data[ci][ypos] + (mcuindex * compptr->MCU_width); - for (xpos = 0; xpos < compptr->MCU_width; xpos++) { - cinfo->MCU_data[blkn] = image_ptr; - image_ptr++; - blkn++; - } - } - } - /* Fetch the coefficient data */ - /* Save the current input buffer position (for restart) */ - cinfo->XIEnext_input_byte = cinfo->next_input_byte; - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - if (((*cinfo->methods->entropy_decode) (cinfo, cinfo->MCU_data)) < 0) { - cinfo->XIErestart = XIE_RMCU; - cinfo->XIEmcuindex = mcuindex; - cinfo->next_input_byte = cinfo->XIEnext_input_byte; - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - return(-1); - } - } - return(0); -} -#else -METHODDEF void -disassemble_interleaved_MCU (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data) -{ - JBLOCKROW MCU_data[MAX_BLOCKS_IN_MCU]; - long mcuindex; - short blkn, ci, xpos, ypos; - jpeg_component_info * compptr; - JBLOCKROW image_ptr; - - /* Pre-zero the target area to speed up entropy decoder */ - /* (we assume wholesale zeroing is faster than retail) */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - jzero_far((pointer) image_data[ci][ypos], - (size_t) (cinfo->MCUs_per_row * compptr->MCU_width * SIZEOF(JBLOCK))); - } - } - - for (mcuindex = 0; mcuindex < cinfo->MCUs_per_row; mcuindex++) { - /* Point to the proper spots in the image array for this MCU */ - blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - for (ypos = 0; ypos < compptr->MCU_height; ypos++) { - image_ptr = image_data[ci][ypos] + (mcuindex * compptr->MCU_width); - for (xpos = 0; xpos < compptr->MCU_width; xpos++) { - MCU_data[blkn] = image_ptr; - image_ptr++; - blkn++; - } - } - } - /* Fetch the coefficient data */ - (*cinfo->methods->entropy_decode) (cinfo, MCU_data); - } -} -#endif /* XIE_SUPPORTED */ - -/* - * Perform inverse DCT on each block in an MCU row's worth of data; - * output the results into a sample array starting at row start_row. - * NB: start_row can only be nonzero when dealing with a single-component - * scan; otherwise we'd have to pass different offsets for different - * components, since the heights of interleaved MCU rows can vary. - * But the pipeline controller logic is such that this is not necessary. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -reverse_DCT (decompress_info_ptr cinfo, - JBLOCKIMAGE coeff_data, JSAMPIMAGE output_data, int start_row) -#else -reverse_DCT (cinfo, coeff_data, output_data, start_row) - decompress_info_ptr cinfo; - JBLOCKIMAGE coeff_data; - JSAMPIMAGE output_data; - int start_row; -#endif /* NeedFunctionPrototypes */ -#else -reverse_DCT (decompress_info_ptr cinfo, - JBLOCKIMAGE coeff_data, JSAMPIMAGE output_data, int start_row) -#endif /* XIE_SUPPORTED */ -{ - DCTBLOCK block; - JBLOCKROW browptr; - JSAMPARRAY srowptr; - long blocksperrow, bi; - short numrows, ri; - short ci; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - /* calculate size of an MCU row in this component */ - blocksperrow = cinfo->cur_comp_info[ci]->downsampled_width / DCTSIZE; - numrows = cinfo->cur_comp_info[ci]->MCU_height; - /* iterate through all blocks in MCU row */ - for (ri = 0; ri < numrows; ri++) { - browptr = coeff_data[ci][ri]; - srowptr = output_data[ci] + (ri * DCTSIZE + start_row); - for (bi = 0; bi < blocksperrow; bi++) { - /* copy the data into a local DCTBLOCK. This allows for change of - * representation (if DCTELEM != JCOEF). On 80x86 machines it also - * brings the data back from FAR storage to NEAR storage. - */ - { register JCOEFPTR elemptr = browptr[bi]; - register DCTELEM *localblkptr = block; - register int elem = DCTSIZE2; - - while (--elem >= 0) - *localblkptr++ = (DCTELEM) *elemptr++; - } - - j_rev_dct(block); /* perform inverse DCT */ - - /* Output the data into the sample array. - * Note change from signed to unsigned representation: - * DCT calculation works with values +-CENTERJSAMPLE, - * but sample arrays always hold 0..MAXJSAMPLE. - * We have to do range-limiting because of quantization errors in the - * DCT/IDCT phase. We use the sample_range_limit[] table to do this - * quickly; the CENTERJSAMPLE offset is folded into table indexing. - */ - { register JSAMPROW elemptr; - register DCTELEM *localblkptr = block; - register JSAMPLE *range_limit = cinfo->sample_range_limit + - CENTERJSAMPLE; -#if DCTSIZE != 8 - register int elemc; -#endif - register int elemr; - - for (elemr = 0; elemr < DCTSIZE; elemr++) { - elemptr = srowptr[elemr] + (bi * DCTSIZE); -#if DCTSIZE == 8 /* unroll the inner loop */ - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; - *elemptr++ = range_limit[*localblkptr++]; -#else - for (elemc = DCTSIZE; elemc > 0; elemc--) { - *elemptr++ = range_limit[*localblkptr++]; - } -#endif - } - } - } - } - } -} - - -/* - * Initialize for processing a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -disassemble_init (decompress_info_ptr cinfo) -#else -disassemble_init (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -disassemble_init (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} - - -/* - * Clean up after a scan. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -disassemble_term (decompress_info_ptr cinfo) -#else -disassemble_term (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -disassemble_term (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} -#endif /* XIE_SUPPORTED */ - - -/* - * The method selection routine for MCU disassembly. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jseldmcu (decompress_info_ptr cinfo) -#else -jseldmcu (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jseldmcu (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - if (cinfo->comps_in_scan == 1) - cinfo->methods->disassemble_MCU = disassemble_noninterleaved_MCU; - else - cinfo->methods->disassemble_MCU = disassemble_interleaved_MCU; - cinfo->methods->reverse_DCT = reverse_DCT; - cinfo->methods->disassemble_init = disassemble_init; -#ifndef XIE_SUPPORTED - cinfo->methods->disassemble_term = disassemble_term; -#endif /* XIE_SUPPORTED */ -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jdsample.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdsample.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jdsample.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdsample.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdsample.c Sat Feb 28 21:42:00 2004 @@ -1,509 +0,0 @@ -/* $Xorg: jdsample.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jdsample.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jdsample.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains upsampling routines. - * These routines are invoked via the upsample and - * upsample_init/term methods. - * - * An excellent reference for image resampling is - * Digital Image Warping, George Wolberg, 1990. - * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. - */ - -#include "jinclude.h" - - -/* - * Initialize for upsampling a scan. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -upsample_init (decompress_info_ptr cinfo) -#else -upsample_init (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -upsample_init (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} - - -/* - * Upsample pixel values of a single component. - * This version handles any integral sampling ratios. - * - * This is not used for typical JPEG files, so it need not be fast. - * Nor, for that matter, is it particularly accurate: the algorithm is - * simple replication of the input pixel onto the corresponding output - * pixels. The hi-falutin sampling literature refers to this as a - * "box filter". A box filter tends to introduce visible artifacts, - * so if you are actually going to use 3:1 or 4:1 sampling ratios - * you would be well advised to improve this code. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -int_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -int_upsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - decompress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -int_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - register short h_expand, h; - short v_expand, v; - int inrow, outrow; - register long incol; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - if (input_rows != compptr->v_samp_factor || - output_rows != cinfo->max_v_samp_factor || - (input_cols % compptr->h_samp_factor) != 0 || - (output_cols % cinfo->max_h_samp_factor) != 0 || - output_cols*compptr->h_samp_factor != input_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus upsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; - v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; - - outrow = 0; - for (inrow = 0; inrow < input_rows; inrow++) { - for (v = 0; v < v_expand; v++) { - inptr = input_data[inrow]; - outptr = output_data[outrow++]; - for (incol = 0; incol < input_cols; incol++) { - invalue = GETJSAMPLE(*inptr++); - for (h = 0; h < h_expand; h++) { - *outptr++ = invalue; - } - } - } - } -} - - -/* - * Upsample pixel values of a single component. - * This version handles the common case of 2:1 horizontal and 1:1 vertical. - * - * The upsampling algorithm is linear interpolation between pixel centers, - * also known as a "triangle filter". This is a good compromise between - * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 - * of the way between input pixel centers. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -h2v1_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -h2v1_upsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - decompress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -h2v1_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - register JSAMPROW inptr, outptr; - register int invalue; - int inrow; - register long colctr; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - if (input_rows != compptr->v_samp_factor || - output_rows != cinfo->max_v_samp_factor || - (input_cols % compptr->h_samp_factor) != 0 || - (output_cols % cinfo->max_h_samp_factor) != 0 || - output_cols*compptr->h_samp_factor != input_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus upsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - for (inrow = 0; inrow < input_rows; inrow++) { - inptr = input_data[inrow]; - outptr = output_data[inrow]; - /* Special case for first column */ - invalue = GETJSAMPLE(*inptr++); - *outptr++ = (JSAMPLE) invalue; - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); - - for (colctr = input_cols - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ - invalue = GETJSAMPLE(*inptr++) * 3; - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 2) >> 2); - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); - } - - /* Special case for last column */ - invalue = GETJSAMPLE(*inptr); - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 2) >> 2); - *outptr++ = (JSAMPLE) invalue; - } -} - - -/* - * Upsample pixel values of a single component. - * This version handles the common case of 2:1 horizontal and 2:1 vertical. - * - * The upsampling algorithm is linear interpolation between pixel centers, - * also known as a "triangle filter". This is a good compromise between - * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 - * of the way between input pixel centers. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -h2v2_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -h2v2_upsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - decompress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -h2v2_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ - register JSAMPROW inptr0, inptr1, outptr; -#ifdef EIGHT_BIT_SAMPLES - register int thiscolsum, lastcolsum, nextcolsum; -#else - register INT32 thiscolsum, lastcolsum, nextcolsum; -#endif - int inrow, outrow, v; - register long colctr; - -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - jpeg_component_info * compptr = cinfo->cur_comp_info[which_component]; - if (input_rows != compptr->v_samp_factor || - output_rows != cinfo->max_v_samp_factor || - (input_cols % compptr->h_samp_factor) != 0 || - (output_cols % cinfo->max_h_samp_factor) != 0 || - output_cols*compptr->h_samp_factor != input_cols*cinfo->max_h_samp_factor) - ERREXIT(cinfo->emethods, "Bogus upsample parameters"); -#endif -#endif /* XIE_SUPPORTED */ - - outrow = 0; - for (inrow = 0; inrow < input_rows; inrow++) { - for (v = 0; v < 2; v++) { - /* inptr0 points to nearest input row, inptr1 points to next nearest */ - inptr0 = input_data[inrow]; - if (v == 0) { /* next nearest is row above */ - if (inrow == 0) - inptr1 = above[input_rows-1]; - else - inptr1 = input_data[inrow-1]; - } else { /* next nearest is row below */ - if (inrow == input_rows-1) - inptr1 = below[0]; - else - inptr1 = input_data[inrow+1]; - } - outptr = output_data[outrow++]; - - /* Special case for first column */ - thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 8) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - - for (colctr = input_cols - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ - /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 8) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - } - - /* Special case for last column */ - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); - } - } -} - - -/* - * Upsample pixel values of a single component. - * This version handles the special case of a full-size component. - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -fullsize_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#else -fullsize_upsample (cinfo, which_component, - input_cols, input_rows, - output_cols, output_rows, - above, input_data, below, - output_data) - decompress_info_ptr cinfo; - int which_component; - long input_cols; - int input_rows; - long output_cols; - int output_rows; - JSAMPARRAY above; - JSAMPARRAY input_data; - JSAMPARRAY below; - JSAMPARRAY output_data; -#endif /* NeedFunctionPrototypes */ -#else -fullsize_upsample (decompress_info_ptr cinfo, int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below, - JSAMPARRAY output_data) -#endif /* XIE_SUPPORTED */ -{ -#ifndef XIE_SUPPORTED -#ifdef DEBUG /* for debugging pipeline controller */ - if (input_cols != output_cols || input_rows != output_rows) - ERREXIT(cinfo->emethods, "Pipeline controller messed up"); -#endif -#endif /* XIE_SUPPORTED */ - - jcopy_sample_rows(input_data, 0, output_data, 0, output_rows, output_cols); -} - - - -/* - * Clean up after a scan. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -upsample_term (decompress_info_ptr cinfo) -#else -upsample_term (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -upsample_term (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work for now */ -} -#endif /* XIE_SUPPORTED */ - - -/* - * The method selection routine for upsampling. - * Note that we must select a routine for each component. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselupsample (decompress_info_ptr cinfo) -#else -jselupsample (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselupsample (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - short ci; - jpeg_component_info * compptr; - -#ifndef XIE_SUPPORTED - if (cinfo->CCIR601_sampling) - ERREXIT(cinfo->emethods, "CCIR601 upsampling not implemented yet"); -#endif /* XIE_SUPPORTED */ - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - if (compptr->h_samp_factor == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) - cinfo->methods->upsample[ci] = fullsize_upsample; - else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) - cinfo->methods->upsample[ci] = h2v1_upsample; - else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) - cinfo->methods->upsample[ci] = h2v2_upsample; - else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && - (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) - cinfo->methods->upsample[ci] = int_upsample; - else -#ifdef XIE_SUPPORTED - {} -#else - ERREXIT(cinfo->emethods, "Fractional upsampling not implemented yet"); -#endif /* XIE_SUPPORTED */ - } - - cinfo->methods->upsample_init = upsample_init; -#ifndef XIE_SUPPORTED - cinfo->methods->upsample_term = upsample_term; -#endif /* XIE_SUPPORTED */ -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jdxie.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdxie.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jdxie.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdxie.c:1.5 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdxie.c Sat Feb 28 21:42:00 2004 @@ -1,901 +0,0 @@ -/* $Xorg: jdxie.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jdxie.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * Copyright (C) 1992, Thomas G. Lane. - * This file was derived in part from the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - */ - -#include "jinclude.h" -#include "macro.h" - -METHODDEF void -#if NeedFunctionPrototypes -d_ui_method_selection (decompress_info_ptr cinfo) -#else -d_ui_method_selection (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* if grayscale or CMYK input, force similar output; */ - /* else leave the output colorspace as set by options. */ - if (cinfo->jpeg_color_space == CS_GRAYSCALE) - cinfo->out_color_space = CS_GRAYSCALE; - else if (cinfo->jpeg_color_space == CS_CMYK) - cinfo->out_color_space = CS_CMYK; -} - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines below do it the hard way. (The performance cost - * is not all that great, because these routines aren't very heavily used.) - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ -#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case, define if we can */ -#ifdef USE_FMEM -#define FMEMCOPY(dest,src,size) _fmemcpy((pointer*)(dest), (const pointer*)(src), (size_t)(size)) -#define FMEMZERO(target,size) _fmemset((pointer*)(target), 0, (size_t)(size)) -#endif -#endif - -METHODDEF void -#if NeedFunctionPrototypes -d_per_scan_method_selection (decompress_info_ptr cinfo) -#else -d_per_scan_method_selection (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Central point for per-scan method selection */ -{ - /* MCU disassembly */ - jseldmcu(cinfo); - if (cinfo->XIE_upsample) - /* Upsampling of pixels */ - jselupsample(cinfo); -} - - -LOCAL void -#if NeedFunctionPrototypes -d_initial_method_selection (decompress_info_ptr cinfo) -#else -d_initial_method_selection (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Central point for initial method selection (after reading file header) */ -{ - /* JPEG file scanning method selection is already done. */ - /* So is output file format selection (both are done by user interface). */ - - /* Entropy decoding: Huffman coding. */ - jseldhuffman(cinfo); - cinfo->do_block_smoothing = FALSE; - - /* Overall control (that's me!) */ - cinfo->methods->d_per_scan_method_selection = d_per_scan_method_selection; -} - - -LOCAL int -#if NeedFunctionPrototypes -initial_setup (decompress_info_ptr cinfo) -#else -initial_setup (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Do computations that are needed before initial method selection */ -{ - short ci; - jpeg_component_info *compptr; - - /* Compute maximum sampling factors; check factor validity */ - cinfo->max_h_samp_factor = 1; - cinfo->max_v_samp_factor = 1; - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = &cinfo->comp_info[ci]; - if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || - compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) - /* ERREXIT(cinfo->emethods, "Bogus sampling factors"); */ - return(XIE_ERR); - cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, - compptr->h_samp_factor); - cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, - compptr->v_samp_factor); - } - - /* Compute logical downsampled dimensions of components */ - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = &cinfo->comp_info[ci]; - compptr->true_comp_width = (cinfo->image_width * compptr->h_samp_factor - + cinfo->max_h_samp_factor - 1) - / cinfo->max_h_samp_factor; - compptr->true_comp_height = (cinfo->image_height * compptr->v_samp_factor - + cinfo->max_v_samp_factor - 1) - / cinfo->max_v_samp_factor; - } - return(0); -} - - -/* - * About the data structures: - * - * The processing chunk size for upsampling is referred to in this file as - * a "row group": a row group is defined as Vk (v_samp_factor) sample rows of - * any component while downsampled, or Vmax (max_v_samp_factor) unsubsampled - * rows. In an interleaved scan each MCU row contains exactly DCTSIZE row - * groups of each component in the scan. In a noninterleaved scan an MCU row - * is one row of blocks, which might not be an integral number of row groups; - * therefore, we read in Vk MCU rows to obtain the same amount of data as we'd - * have in an interleaved scan. - * To provide context for the upsampling step, we have to retain the last - * two row groups of the previous MCU row while reading in the next MCU row - * (or set of Vk MCU rows). To do this without copying data about, we create - * a rather strange data structure. Exactly DCTSIZE+2 row groups of samples - * are allocated, but we create two different sets of pointers to this array. - * The second set swaps the last two pairs of row groups. By working - * alternately with the two sets of pointers, we can access the data in the - * desired order. - * - * Cross-block smoothing also needs context above and below the "current" row. - * Since this is an optional feature, I've implemented it in a way that is - * much simpler but requires more than the minimum amount of memory. We - * simply allocate three extra MCU rows worth of coefficient blocks and use - * them to "read ahead" one MCU row in the file. For a typical 1000-pixel-wide - * image with 2x2,1x1,1x1 sampling, each MCU row is about 50Kb; an 80x86 - * machine may be unable to apply cross-block smoothing to wider images. - */ - - -/* - * Utility routines: common code for pipeline controller - */ - -LOCAL int -#if NeedFunctionPrototypes -interleaved_scan_setup (decompress_info_ptr cinfo) -#else -interleaved_scan_setup (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Compute all derived info for an interleaved (multi-component) scan */ -/* On entry, cinfo->comps_in_scan and cinfo->cur_comp_info[] are set up */ -{ - short ci, mcublks; - jpeg_component_info *compptr; - - if (cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) - /* ERREXIT(cinfo->emethods, "Too many components for interleaved scan"); */ - return(XIE_ERR); - - cinfo->MCUs_per_row = (cinfo->image_width - + cinfo->max_h_samp_factor*DCTSIZE - 1) - / (cinfo->max_h_samp_factor*DCTSIZE); - - cinfo->MCU_rows_in_scan = (cinfo->image_height - + cinfo->max_v_samp_factor*DCTSIZE - 1) - / (cinfo->max_v_samp_factor*DCTSIZE); - - cinfo->blocks_in_MCU = 0; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* for interleaved scan, sampling factors give # of blocks per component */ - compptr->MCU_width = compptr->h_samp_factor; - compptr->MCU_height = compptr->v_samp_factor; - compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; - /* compute physical dimensions of component */ - compptr->downsampled_width = jround_up(compptr->true_comp_width, - (long) (compptr->MCU_width*DCTSIZE)); - compptr->downsampled_height = jround_up(compptr->true_comp_height, - (long) (compptr->MCU_height*DCTSIZE)); - /* Sanity check */ - if (compptr->downsampled_width != - (cinfo->MCUs_per_row * (compptr->MCU_width*DCTSIZE))) - /* ERREXIT(cinfo->emethods, "I'm confused about the image width"); */ - return(XIE_ERR); - /* Prepare array describing MCU composition */ - mcublks = compptr->MCU_blocks; - if (cinfo->blocks_in_MCU + mcublks > MAX_BLOCKS_IN_MCU) - /* ERREXIT(cinfo->emethods, "Sampling factors too large for interleaved scan"); */ - return(XIE_ERR); - while (mcublks-- > 0) { - cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; - } - } - - (*cinfo->methods->d_per_scan_method_selection) (cinfo); - return(0); -} - - -LOCAL void -#if NeedFunctionPrototypes -noninterleaved_scan_setup (decompress_info_ptr cinfo) -#else -noninterleaved_scan_setup (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Compute all derived info for a noninterleaved (single-component) scan */ -/* On entry, cinfo->comps_in_scan = 1 and cinfo->cur_comp_info[0] is set up */ -{ - jpeg_component_info *compptr = cinfo->cur_comp_info[0]; - - /* for noninterleaved scan, always one block per MCU */ - compptr->MCU_width = 1; - compptr->MCU_height = 1; - compptr->MCU_blocks = 1; - /* compute physical dimensions of component */ - compptr->downsampled_width = jround_up(compptr->true_comp_width, - (long) DCTSIZE); - compptr->downsampled_height = jround_up(compptr->true_comp_height, - (long) DCTSIZE); - - cinfo->MCUs_per_row = compptr->downsampled_width / DCTSIZE; - cinfo->MCU_rows_in_scan = compptr->downsampled_height / DCTSIZE; - - /* Prepare array describing MCU composition */ - cinfo->blocks_in_MCU = 1; - cinfo->MCU_membership[0] = 0; - - (*cinfo->methods->d_per_scan_method_selection) (cinfo); -} - -GLOBAL JSAMPIMAGE -#if NeedFunctionPrototypes -alloc_sampimage (decompress_info_ptr cinfo, - int num_comps, long num_rows, long num_cols) -#else -alloc_sampimage (cinfo, num_comps, num_rows, num_cols) - decompress_info_ptr cinfo; - int num_comps; - long num_rows; - long num_cols; -#endif /* NeedFunctionPrototypes */ -/* Allocate an in-memory sample image (all components same size) */ -{ - JSAMPIMAGE image; - int ci; - - image = (JSAMPIMAGE) (*cinfo->emethods->d_alloc_small) - (cinfo, (num_comps * SIZEOF(JSAMPARRAY))); - if (image == (JSAMPIMAGE) NULL) - return((JSAMPIMAGE) NULL); - for (ci = 0; ci < num_comps; ci++) { - image[ci] = (*cinfo->emethods->d_alloc_small_sarray) - (cinfo, num_cols, num_rows); - if (image[ci] == NULL) - return((JSAMPIMAGE) NULL); - } - return image; -} - -LOCAL JBLOCKIMAGE -#if NeedFunctionPrototypes -alloc_MCU_row (decompress_info_ptr cinfo) -#else -alloc_MCU_row (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Allocate one MCU row's worth of coefficient blocks */ -{ - JBLOCKIMAGE image; - int ci; - - image = (JBLOCKIMAGE) (*cinfo->emethods->d_alloc_small) - (cinfo, (cinfo->comps_in_scan * SIZEOF(JBLOCKARRAY))); - if (image == (JBLOCKIMAGE) NULL) - return((JBLOCKIMAGE) NULL); - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - image[ci] = (*cinfo->emethods->d_alloc_small_barray) - (cinfo, cinfo->cur_comp_info[ci]->downsampled_width / DCTSIZE, - (long) cinfo->cur_comp_info[ci]->MCU_height); - if (image[ci] == NULL) - return((JBLOCKIMAGE) NULL); - } - return image; -} - -LOCAL int -#if NeedFunctionPrototypes -alloc_sampling_buffer (decompress_info_ptr cinfo, JSAMPIMAGE sampled_data[2]) -#else -alloc_sampling_buffer (cinfo, sampled_data) - decompress_info_ptr cinfo; - JSAMPIMAGE sampled_data[2]; -#endif /* NeedFunctionPrototypes */ -/* Create a downsampled-data buffer having the desired structure */ -/* (see comments at head of file) */ -{ - short ci, vs, i; - - /* Get top-level space for array pointers */ - sampled_data[0] = (JSAMPIMAGE) (*cinfo->emethods->d_alloc_small) - (cinfo, (cinfo->comps_in_scan * SIZEOF(JSAMPARRAY))); - if (cinfo->sampled_data[0] == (JSAMPIMAGE) NULL) - return(XIE_ERR); - sampled_data[1] = (JSAMPIMAGE) (*cinfo->emethods->d_alloc_small) - (cinfo, (cinfo->comps_in_scan * SIZEOF(JSAMPARRAY))); - if (cinfo->sampled_data[1] == (JSAMPIMAGE) NULL) - return(XIE_ERR); - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - vs = cinfo->cur_comp_info[ci]->v_samp_factor; /* row group height */ - /* Allocate the real storage */ - sampled_data[0][ci] = (*cinfo->emethods->d_alloc_small_sarray) - (cinfo, cinfo->cur_comp_info[ci]->downsampled_width, - (long) (vs * (DCTSIZE+2))); - if (cinfo->sampled_data[0][ci] == NULL) - return(XIE_ERR); - /* Create space for the scrambled-order pointers */ - sampled_data[1][ci] = (JSAMPARRAY) (*cinfo->emethods->d_alloc_small) - (cinfo, (vs * (DCTSIZE+2) * SIZEOF(JSAMPROW))); - if (cinfo->sampled_data[1][ci] == (JSAMPARRAY) NULL) - return(XIE_ERR); - /* Duplicate the first DCTSIZE-2 row groups */ - for (i = 0; i < vs * (DCTSIZE-2); i++) { - sampled_data[1][ci][i] = sampled_data[0][ci][i]; - } - /* Copy the last four row groups in swapped order */ - for (i = 0; i < vs * 2; i++) { - sampled_data[1][ci][vs*DCTSIZE + i] = sampled_data[0][ci][vs*(DCTSIZE-2) + i]; - sampled_data[1][ci][vs*(DCTSIZE-2) + i] = sampled_data[0][ci][vs*DCTSIZE + i]; - } - } - return(0); -} - -/* - * Several decompression processes need to range-limit values to the range - * 0..MAXJSAMPLE; the input value may fall somewhat outside this range - * due to noise introduced by quantization, roundoff error, etc. These - * processes are inner loops and need to be as fast as possible. On most - * machines, particularly CPUs with pipelines or instruction prefetch, - * a (range-check-less) C table lookup - * x = sample_range_limit[x]; - * is faster than explicit tests - * if (x < 0) x = 0; - * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; - * These processes all use a common table prepared by the routine below. - * - * The table will work correctly for x within MAXJSAMPLE+1 of the legal - * range. This is a much wider range than is needed for most cases, - * but the wide range is handy for color quantization. - * Note that the table is allocated in near data space on PCs; it's small - * enough and used often enough to justify this. - */ - -LOCAL int -#if NeedFunctionPrototypes -prepare_range_limit_table (decompress_info_ptr cinfo) -#else -prepare_range_limit_table (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Allocate and fill in the sample_range_limit table */ -{ - JSAMPLE * table; - int i; - - table = (JSAMPLE *) (*cinfo->emethods->d_alloc_small) - (cinfo, (3 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE))); - if (table == (JSAMPLE *) NULL) - return(XIE_ERR); - cinfo->sample_range_limit = table + (MAXJSAMPLE+1); - for (i = 0; i <= MAXJSAMPLE; i++) { - table[i] = 0; /* sample_range_limit[x] = 0 for x<0 */ - table[i+(MAXJSAMPLE+1)] = (JSAMPLE) i; /* sample_range_limit[x] = x */ - table[i+(MAXJSAMPLE+1)*2] = MAXJSAMPLE; /* x beyond MAXJSAMPLE */ - } - return(0); -} - -LOCAL void -#if NeedFunctionPrototypes -duplicate_row (JSAMPARRAY image_data, - long num_cols, int source_row, int num_rows) -#else -duplicate_row (image_data, num_cols, source_row, num_rows) - JSAMPARRAY image_data; - long num_cols; - int source_row; - int num_rows; -#endif /* NeedFunctionPrototypes */ -/* Duplicate the source_row at source_row+1 .. source_row+num_rows */ -/* This happens only at the bottom of the image, */ -/* so it needn't be super-efficient */ -{ - register int row; - - for (row = 1; row <= num_rows; row++) { - jcopy_sample_rows(image_data, source_row, image_data, source_row + row, - 1, num_cols); - } -} - -LOCAL void -#if NeedFunctionPrototypes -expand (decompress_info_ptr cinfo, - JSAMPIMAGE sampled_data, JSAMPIMAGE fullsize_data, - long fullsize_width, - short above, short current, short below, short out) -#else -expand (cinfo, - sampled_data, fullsize_data, - fullsize_width, - above, current, below, out) - decompress_info_ptr cinfo; - JSAMPIMAGE sampled_data; - JSAMPIMAGE fullsize_data; - long fullsize_width; - short above; - short current; - short below; - short out; -#endif /* NeedFunctionPrototypes */ -/* Do upsampling expansion of a single row group (of each component). */ -/* above, current, below are indexes of row groups in sampled_data; */ -/* out is the index of the target row group in fullsize_data. */ -/* Special case: above, below can be -1 to indicate top, bottom of image. */ -{ - jpeg_component_info *compptr; - JSAMPARRAY above_ptr, below_ptr; - JSAMPROW dummy[MAX_SAMP_FACTOR]; /* for downsample expansion at top/bottom */ - short ci, vs, i; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - vs = compptr->v_samp_factor; /* row group height */ - - if (above >= 0) - above_ptr = sampled_data[ci] + above * vs; - else { - /* Top of image: make a dummy above-context with copies of 1st row */ - /* We assume current=0 in this case */ - for (i = 0; i < vs; i++) - dummy[i] = sampled_data[ci][0]; - above_ptr = (JSAMPARRAY) dummy; /* possible near->far pointer conv */ - } - - if (below >= 0) - below_ptr = sampled_data[ci] + below * vs; - else { - /* Bot of image: make a dummy below-context with copies of last row */ - for (i = 0; i < vs; i++) - dummy[i] = sampled_data[ci][(current+1)*vs-1]; - below_ptr = (JSAMPARRAY) dummy; /* possible near->far pointer conv */ - } - - (*cinfo->methods->upsample[ci]) - (cinfo, (int) ci, - compptr->downsampled_width, (int) vs, - fullsize_width, (int) cinfo->max_v_samp_factor, - above_ptr, - sampled_data[ci] + current * vs, - below_ptr, - fullsize_data[ci] + out * cinfo->max_v_samp_factor); - } -} - -LOCAL void -#if NeedFunctionPrototypes -jdcopy_pixel_rows (decompress_info_ptr cinfo, - JSAMPIMAGE input_array, JSAMPIMAGE output_array) -#else -jdcopy_pixel_rows (cinfo,input_array, output_array) - decompress_info_ptr cinfo; - JSAMPIMAGE input_array; - JSAMPIMAGE output_array; -#endif /* NeedFunctionPrototypes */ -/* Copy some rows of samples from one place to another. - * num_rows rows are copied from input_array[source_row++] - * to output_array[dest_row++]; these areas should not overlap. - * The source and destination arrays must be at least as wide as num_cols. - */ -{ - register JSAMPROW inptr, outptr; -#ifdef FMEMCOPY - register size_t count; -#else - register long count; -#endif - register int ci, row; - int num_components; - int num_rows; - long num_cols; - - num_components = cinfo->num_components; - if (cinfo->XIE_upsample) { - num_rows = cinfo->rows_in_mem; - num_cols = cinfo->image_width; -#ifdef FMEMCOPY - count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#endif - } - - for (ci = 0; ci < num_components; ci++) { - if (!cinfo->XIE_upsample) { - num_rows = cinfo->comp_info[ci].h_samp_factor*DCTSIZE; - num_cols = cinfo->comp_info[ci].true_comp_width; -#ifdef FMEMCOPY - count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#endif - } - for (row = 0; row < num_rows; row++) { - inptr = input_array[ci][row]; - outptr = output_array[ci][row]; -#ifdef FMEMCOPY - FMEMCOPY(outptr, inptr, count); -#else - for (count = 0; count < num_cols; count++) - outptr[count] = inptr[count]; /* needn't bother with GETJSAMPLE() here */ -#endif - } - } -} - -GLOBAL int -#if NeedFunctionPrototypes -jdXIE_init (decompress_info_ptr cinfo) -#else -jdXIE_init (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int status; - - if (cinfo->XIErestart == XIE_RNUL) { - /* Install, but don't yet enable signal catcher. */ - - /* Set up compression parameters */ - /* Initialize cinfo with default switch settings */ - /* (Re-)initialize the system-dependent error and memory managers. */ - jdselmemmgr(cinfo, cinfo->emethods); /* memory allocation routines */ - cinfo->methods->d_ui_method_selection = d_ui_method_selection; - - /* Set up default JPEG parameters. */ - j_d_defaults(cinfo, FALSE); - - /* Set up to read a baseline-JPEG file. */ - jselrjfif(cinfo); - - /* Init pass counts to 0 --- total_passes is adjusted in method selection */ - cinfo->total_passes = 0; - cinfo->completed_passes = 0; - - cinfo->XIErestart = XIE_RNUL; - cinfo->XIEmcuindex = 0; - } /* if (cinfo->XIErestart != XIE_RNUL) */ - - /* Read the JPEG file header markers; everything up through the first SOS - * marker is read now. NOTE: the user interface must have initialized the - * read_file_header method pointer (eg, by calling jselrjfif or jselrtiff). - * The other file reading methods (read_scan_header etc.) were probably - * set at the same time, but could be set up by read_file_header itself. - */ - if (cinfo->XIErestart != XIE_RRSH) { - - /* need more data */ - if ((status = ((*cinfo->methods->read_file_header)(cinfo))) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RRFH; - cinfo->next_input_byte = cinfo->XIEnext_input_byte; - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - return(XIE_INP); - } else { - cinfo->XIErestart = XIE_RNUL; - } - } - /* need more data */ - if ((status = ((*cinfo->methods->read_scan_header)(cinfo))) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->XIErestart = XIE_RRSH; - cinfo->next_input_byte = cinfo->XIEnext_input_byte; - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - return(XIE_INP); - } - cinfo->XIErestart = XIE_RNUL; - - /* Give UI a chance to adjust decompression parameters and select */ - /* output file format based on info from file header. */ - (*cinfo->methods->d_ui_method_selection) (cinfo); - - /* Now select methods for decompression steps. */ - if (initial_setup(cinfo) == XIE_ERR) - return(XIE_ERR); - d_initial_method_selection(cinfo); - - /* Compute dimensions of full-size pixel buffers */ - /* Note these are the same whether interleaved or not. */ - cinfo->rows_in_mem = cinfo->max_v_samp_factor * DCTSIZE; - cinfo->fullsize_width = jround_up(cinfo->image_width, - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - - /* Prepare for single scan containing all components */ - if (cinfo->comps_in_scan == 1) { - noninterleaved_scan_setup(cinfo); - /* Need to read Vk MCU rows to obtain Vk block rows */ - cinfo->mcu_rows_per_loop = cinfo->cur_comp_info[0]->v_samp_factor; - } else { - if (interleaved_scan_setup(cinfo) == XIE_ERR) - return(XIE_ERR); - /* in an interleaved scan, one MCU row provides Vk block rows */ - cinfo->mcu_rows_per_loop = 1; - } - cinfo->total_passes++; - - /* Allocate working memory: */ - /* coeff_data holds a single MCU row of coefficient blocks */ - cinfo->coeff_data = alloc_MCU_row(cinfo); - if (cinfo->coeff_data == (JBLOCKIMAGE) NULL) - return(XIE_ERR); - /* sampled_data is sample data before upsampling */ - if (alloc_sampling_buffer(cinfo, cinfo->sampled_data) == XIE_ERR) - return(XIE_ERR); - if (cinfo->XIE_upsample) { - /* fullsize_data is sample data after upsampling */ - cinfo->fullsize_data = alloc_sampimage(cinfo, (int) cinfo->num_components, - (long) cinfo->rows_in_mem, cinfo->fullsize_width); - if (cinfo->fullsize_data == (JSAMPIMAGE) NULL) - return(XIE_ERR); - } - if (prepare_range_limit_table(cinfo) == XIE_ERR) - return(XIE_ERR); - - /* Initialize to read scan data */ - - if (((*cinfo->methods->entropy_decode_init) (cinfo)) == XIE_ERR) - return(XIE_ERR); - if (cinfo->XIE_upsample) - (*cinfo->methods->upsample_init) (cinfo); - (*cinfo->methods->disassemble_init) (cinfo); - - cinfo->pixel_rows_output = 0; - if (cinfo->XIE_upsample) { - cinfo->whichss = 1; /* arrange to start with sampled_data[0] */ - } else { - cinfo->whichss = 0; /* arrange to start with sampled_data[0] */ - } - cinfo->cur_mcu_row = 0; - cinfo->first_mcu_row = TRUE; - return(XIE_NRML); -} /* jdXIE_init */ - - -GLOBAL int -#if NeedFunctionPrototypes -jdXIE_get (decompress_info_ptr cinfo) -#else -jdXIE_get (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int whichss; - int ri; - int start; - short i; - - if (cinfo->cur_mcu_row < cinfo->MCU_rows_in_scan) { - if (cinfo->XIErestart == XIE_RNUL) { - start = 0; - if (cinfo->XIE_upsample) { - cinfo->whichss ^= 1; /* switch to other downsampled-data buffer */ - } - } else { - start = cinfo->ri; - } - - whichss = cinfo->whichss; /* localize variable */ - - /* Obtain v_samp_factor block rows of each component in the scan. */ - /* This is a single MCU row if interleaved, multiple MCU rows if not. */ - /* In the noninterleaved case there might be fewer than v_samp_factor */ - /* block rows remaining; if so, pad with copies of the last pixel row */ - /* so that upsampling doesn't have to treat it as a special case. */ - - for (ri = start; ri < cinfo->mcu_rows_per_loop; ri++) { - if ((cinfo->cur_mcu_row + ri) < cinfo->MCU_rows_in_scan) { - /* OK to actually read an MCU row. */ - if (((*cinfo->methods->disassemble_MCU) (cinfo, - cinfo->coeff_data)) < 0) { - cinfo->ri = ri; /* save loop position */ - return(XIE_INP); /* need more data */ - } - (*cinfo->methods->reverse_DCT) (cinfo, cinfo->coeff_data, - cinfo->sampled_data[whichss], - ri * DCTSIZE); - } else { - /* Need to pad out with copies of the last downsampled row. */ - /* This can only happen if there is just one component. */ - duplicate_row(cinfo->sampled_data[whichss][0], - cinfo->cur_comp_info[0]->downsampled_width, - ri * DCTSIZE - 1, DCTSIZE); - } - } - - if (cinfo->XIE_upsample) { - /* Upsample the data */ - /* First time through is a special case */ - - if (cinfo->first_mcu_row) { - /* Expand first row group with dummy above-context */ - expand(cinfo, cinfo->sampled_data[whichss], - cinfo->fullsize_data, cinfo->fullsize_width, - (short) (-1), (short) 0, (short) 1, - (short) 0); - } else { - /* Expand last row group of previous set */ - expand(cinfo, cinfo->sampled_data[whichss], - cinfo->fullsize_data, cinfo->fullsize_width, - (short) DCTSIZE, (short) (DCTSIZE+1), (short) 0, - (short) (DCTSIZE-1)); - /* and dump the previous set's expanded data */ - jdcopy_pixel_rows (cinfo, cinfo->fullsize_data, cinfo->output_workspace); - /* Expand first row group of this set */ - expand(cinfo, cinfo->sampled_data[whichss], - cinfo->fullsize_data, cinfo->fullsize_width, - (short) (DCTSIZE+1), (short) 0, (short) 1, - (short) 0); - } - - /* Expand second through next-to-last row groups of this set */ - for (i = 1; i <= DCTSIZE-2; i++) { - expand(cinfo, cinfo->sampled_data[whichss], - cinfo->fullsize_data, cinfo->fullsize_width, - (short) (i-1), (short) i, (short) (i+1), - (short) i); - } - - /* Return for all but last row group */ - cinfo->cur_mcu_row += cinfo->mcu_rows_per_loop; - if (cinfo->first_mcu_row) { - cinfo->first_mcu_row = FALSE; - return(XIE_NRML); /* No errors, no output */ - } else { - return(XIE_OUT); /* No errors, output */ - } - - } else { - - /* Do not upsample the data: copy it directly into the output workspace */ - jdcopy_pixel_rows (cinfo, - cinfo->sampled_data[whichss], cinfo->output_workspace); - cinfo->cur_mcu_row += cinfo->mcu_rows_per_loop; - if (cinfo->cur_mcu_row < cinfo->MCU_rows_in_scan) { - return(XIE_OUT); /* No errors, output */ - } else { - return(XIE_EOI); /* No errors, output, end of input */ - } - } - } - - if (cinfo->XIE_upsample) { - /* Expand the last row group with dummy below-context */ - /* Note whichss points to last buffer side used */ - expand(cinfo, cinfo->sampled_data[cinfo->whichss], - cinfo->fullsize_data, cinfo->fullsize_width, - (short) (DCTSIZE-2), (short) (DCTSIZE-1), (short) (-1), - (short) (DCTSIZE-1)); - /* and dump the remaining data (may be less than full height) */ - jdcopy_pixel_rows (cinfo, cinfo->fullsize_data, cinfo->output_workspace); - } - return(XIE_EOI); /* No errors, output, end of input */ -} /* jdXIE_get */ - -#ifndef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -jdXIE_term (decompress_info_ptr cinfo) -#else -jdXIE_term (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* Clean up after the scan */ - (*cinfo->methods->disassemble_term) (cinfo); - if (cinfo->XIE_upsample) - (*cinfo->methods->upsample_term) (cinfo); - (*cinfo->methods->entropy_decode_term) (cinfo); - (*cinfo->methods->read_scan_trailer) (cinfo); - cinfo->completed_passes++; - - /* Finish output file, release working storage, etc */ - (*cinfo->methods->output_term) (cinfo); - (*cinfo->methods->read_file_trailer) (cinfo); - - (*cinfo->emethods->d_free_all) (cinfo); - - return(XIE_NRML); -} /* jdXIE_term */ - - -GLOBAL void -#if NeedFunctionPrototypes -jseldXIE (decompress_info_ptr cinfo) -#else -jseldXIE (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* NULL function */ -} /* jseldXIE */ -#endif /* XIE_SUPPORTED */ Index: xc/programs/Xserver/XIE/mixie/jpeg/jdxief.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jdxief.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jdxief.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jdxief.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jdxief.c Sat Feb 28 21:42:00 2004 @@ -1,161 +0,0 @@ -/* $Xorg: jdxief.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jdxief.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -#include "jinclude.h" - -#if NeedFunctionPrototypes -GLOBAL int jdXIE_init(decompress_info_ptr); -GLOBAL int jdXIE_get(decompress_info_ptr); -#ifndef XIE_SUPPORTED -GLOBAL int jdXIE_term(decompress_info_ptr); -GLOBAL void jseldXIE(decompress_info_ptr); -#endif /* XIE_SUPPORTED */ -#endif /* NeedFunctionPrototypes */ - -/**********************************************************************/ - -GLOBAL int -#if NeedFunctionPrototypes -JD_INIT(decompress_info_ptr cinfo, - decompress_methods_ptr dcmethods, external_methods_ptr emethods, - boolean upsample) -#else -JD_INIT(cinfo, dcmethods, emethods, upsample) - decompress_info_ptr cinfo; - decompress_methods_ptr dcmethods; - external_methods_ptr emethods; - boolean upsample; -#endif /* NeedFunctionPrototypes */ -{ - /* Set up links to method structures. */ - cinfo->methods = dcmethods; - cinfo->emethods = emethods; - - /* Set upsample flag */ - cinfo->XIE_upsample = upsample; - - /* Set restart to NULL */ - cinfo->XIErestart = XIE_RNUL; - - return(jdXIE_init(cinfo)); -} - -/**********************************************************************/ - -#ifndef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -JD_BEGINFRAME(decompress_info_ptr cinfo) -#else -JD_BEGINFRAME(cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - (*cinfo->methods->output_init) (cinfo); - - return(XIE_NRML); -} -#endif /* XIE_SUPPORTED */ - -/**********************************************************************/ - -GLOBAL int -#if NeedFunctionPrototypes -JD_PROCESS(decompress_info_ptr cinfo) -#else -JD_PROCESS(cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - return(jdXIE_get(cinfo)); -} - -/**********************************************************************/ - -#ifndef XIE_SUPPORTED -GLOBAL int -#if NeedFunctionPrototypes -JD_ENDFRAME(decompress_info_ptr cinfo) -#else -JD_ENDFRAME(cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - - jdXIE_term(cinfo); - - return(XIE_NRML); -} -#endif /* XIE_SUPPORTED */ - -/**********************************************************************/ Index: xc/programs/Xserver/XIE/mixie/jpeg/jelossy.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jelossy.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jelossy.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jelossy.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jelossy.c Sat Feb 28 21:42:00 2004 @@ -1,253 +0,0 @@ -/* $Xorg: jelossy.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jelossy.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - - jelossy.c - encode JPEG images, Lossy method - - this contain code for: - - 1) JPEG Lossless, grayscale - 2) JPEG Lossless, color - - Ben Fahy, AGE Logic, Oct 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - - -****************************************************************************/ - -#include "jpeg.h" - -/**********************************************************************/ -encode_jpeg_lossy_gray(state) -JpegEncodeState *state; -{ - return( encode_jpeg_lossy_color(state) ); -} -/**********************************************************************/ -encode_jpeg_lossy_color(state) -JpegEncodeState *state; -{ -int status; /* some compilers may complain, but close examination - ** shows the useage of this variable 'status' to be correct. - */ - -/* our output buffer is guaranteed to be clean on entry. */ -/* (every time we write data below, we return to flush it) */ - - state->flush_output = 0; - state->nl_coded = 0; - - while(1) { /* loop forever (we're a state machine) */ - - switch( state->goal) { - case JPEG_ENCODE_GOAL_Startup: - state->goal = JPEG_ENCODE_GOAL_TryToBeginFrame; - -/*** Write out the beginning frame information ***/ - case JPEG_ENCODE_GOAL_TryToBeginFrame: - - state->cinfo->bytes_in_buffer = 0; - /* initialize buffer to empty */ - - status = JC_BEGINFRAME(state->cinfo, - state->n_bands, - state->width, - state->height, - state->Qtable, - state->lenQtable, - state->ACtable, - state->lenACtable, - state->DCtable, - state->lenDCtable, - state->h_sample, - state->v_sample); - - if (status == XIE_ERR) { - state->error_code = JPEG_ENCODE_ERROR_CouldNotBeginFrame; - return(-1); - } - if (status == XIE_NRML) { - state->goal = JPEG_ENCODE_GOAL_BeginFrameDone; - break; - } - if (status == XIE_OUT) { - state->goal = JPEG_ENCODE_GOAL_WriteHdrData; - break; - } - /* hey! we aren't supposed to be here */ - state->error_code = JPEG_ENCODE_ERROR_BadBeginFrameRetCode; - return(-1); - break; - - case JPEG_ENCODE_GOAL_WriteHdrData: - return(-1); - break; - - case JPEG_ENCODE_GOAL_BeginFrameDone: - state->goal = JPEG_ENCODE_GOAL_ProcessData; - state->needs_input_strip = 1; - state->flush_output = state->cinfo->bytes_in_buffer; - return(0); - break; - - case JPEG_ENCODE_GOAL_ProcessData: - if (state->n_bands == 3) - state->goal = JPEG_ENCODE_GOAL_EncodeRGB; - else - state->goal = JPEG_ENCODE_GOAL_EncodeGray; - break; - - case JPEG_ENCODE_GOAL_EncodeGray: - if (state->nl_tocode <= 0) { - state->flush_output = state->cinfo->bytes_in_buffer; - return(state->nl_coded); - } - status = JC_SCANLINE_GRAY(state->cinfo, - &state->i_line, /* global line # */ - state->i_lines[0][state->nl_coded]); /* gray data line */ - - /* keep track of how many lines in strip we've given encoder */ - state->nl_coded++; - state->i_line++; - state->nl_tocode--; - state->goal = JPEG_ENCODE_GOAL_CheckStatus; - break; - - case JPEG_ENCODE_GOAL_EncodeRGB: - if (state->nl_tocode <= 0) { - state->flush_output = state->cinfo->bytes_in_buffer; - return(state->nl_coded); - } - status = JC_SCANLINE_RGB(state->cinfo, - &state->i_line, /* global line # */ - state->i_lines[0][state->nl_coded], /* red data line */ - state->i_lines[1][state->nl_coded], /* green data line */ - state->i_lines[2][state->nl_coded]); /* blue data line */ - - /* keep track of how many lines in strip we've given encoder */ - state->nl_coded++; - state->i_line++; - state->nl_tocode--; - - case JPEG_ENCODE_GOAL_CheckStatus: - if (status == XIE_OUT) { - state->flush_output = state->cinfo->bytes_in_buffer; - return(state->nl_coded); - break; - } - if (status == XIE_NRML) { - state->goal = JPEG_ENCODE_GOAL_ProcessData; - if (state->flush_output = state->cinfo->bytes_in_buffer) - return(state->nl_coded); - - break; - } - - if (status == XIE_ERR) { - state->error_code = JPEG_ENCODE_ERROR_EncodeError; - return(-1); - } - else { - /* unexpected return status */ - state->error_code = JPEG_ENCODE_ERROR_EncoderIsFreakingOut; - return(-1); - } - break; - - case JPEG_ENCODE_GOAL_EndFrame: - status = JC_ENDFRAME(state->cinfo); - - if (state->flush_output = state->cinfo->bytes_in_buffer) { - if (status == XIE_NRML) - state->goal = JPEG_ENCODE_GOAL_Done; - - return(state->nl_coded); - } - else if (status == XIE_NRML) { - state->goal = JPEG_ENCODE_GOAL_Done; - state->flush_output = state->cinfo->bytes_in_buffer; - return(state->nl_coded); - } - else if (status == XIE_ERR) { - state->error_code = JPEG_ENCODE_ERROR_EndFrameError; - return(-1); - } - else { - /* unexpected return status */ - state->error_code = JPEG_ENCODE_ERROR_EndFrameFreakOut; - return(-1); - } - break; - - default: - state->error_code = JPEG_ENCODE_ERROR_BadGoal; - return(-1); - } - } -} -/**********************************************************************/ Index: xc/programs/Xserver/XIE/mixie/jpeg/jfwddct.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jfwddct.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jfwddct.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jfwddct.c:1.2 Fri Dec 14 14:58:38 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jfwddct.c Sat Feb 28 21:42:00 2004 @@ -1,380 +0,0 @@ -/* $Xorg: jfwddct.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jfwddct.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jfwddct.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the basic DCT (Discrete Cosine Transform) - * transformation subroutine. - * - * This implementation is based on an algorithm described in - * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT - * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, - * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. - * The primary algorithm described there uses 11 multiplies and 29 adds. - * We use their alternate method with 12 multiplies and 32 adds. - * The advantage of this method is that no data path contains more than one - * multiplication; this allows a very simple and accurate implementation in - * scaled fixed-point arithmetic, with a minimal number of shifts. - */ - -#include "jinclude.h" - -/* - * This routine is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * The poop on this scaling stuff is as follows: - * - * Each 1-D DCT step produces outputs which are a factor of sqrt(N) - * larger than the true DCT outputs. The final outputs are therefore - * a factor of N larger than desired; since N=8 this can be cured by - * a simple right shift at the end of the algorithm. The advantage of - * this arrangement is that we save two multiplications per 1-D DCT, - * because the y0 and y4 outputs need not be divided by sqrt(N). - * - * We have to do addition and subtraction of the integer inputs, which - * is no problem, and multiplication by fractional constants, which is - * a problem to do in integer arithmetic. We multiply all the constants - * by CONST_SCALE and convert them to integer constants (thus retaining - * CONST_BITS bits of precision in the constants). After doing a - * multiplication we have to divide the product by CONST_SCALE, with proper - * rounding, to produce the correct output. This division can be done - * cheaply as a right shift of CONST_BITS bits. We postpone shifting - * as long as possible so that partial sums can be added together with - * full fractional precision. - * - * The outputs of the first pass are scaled up by PASS1_BITS bits so that - * they are represented to better-than-integral precision. These outputs - * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word - * with the recommended scaling. (To scale up 12-bit sample data, an - * intermediate INT32 array would be needed.) - * - * To avoid overflow of the 32-bit intermediate results in pass 2, we must - * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 25. Error analysis - * shows that the values given below are the most effective. - */ - -#ifdef EIGHT_BIT_SAMPLES -#define CONST_BITS 13 -#define PASS1_BITS 2 -#else -#define CONST_BITS 13 -#define PASS1_BITS 0 /* lose a little precision to avoid overflow */ -#endif - -#define ONE ((INT32) 1) - -#define CONST_SCALE (ONE << CONST_BITS) - -/* Convert a positive real constant to an integer scaled by CONST_SCALE. */ - -#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 13 -#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ -#else -#define FIX_0_298631336 FIX(0.298631336) -#define FIX_0_390180644 FIX(0.390180644) -#define FIX_0_541196100 FIX(0.541196100) -#define FIX_0_765366865 FIX(0.765366865) -#define FIX_0_899976223 FIX(0.899976223) -#define FIX_1_175875602 FIX(1.175875602) -#define FIX_1_501321110 FIX(1.501321110) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_1_961570560 FIX(1.961570560) -#define FIX_2_053119869 FIX(2.053119869) -#define FIX_2_562915447 FIX(2.562915447) -#define FIX_3_072711026 FIX(3.072711026) -#endif - - -/* Descale and correctly round an INT32 value that's scaled by N bits. - * We assume RIGHT_SHIFT rounds towards minus infinity, so adding - * the fudge factor is correct for either sign of X. - */ - -#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * For 8-bit samples with the recommended scaling, all the variable - * and constant values involved are no more than 16 bits wide, so a - * 16x16->32 bit multiply can be used instead of a full 32x32 multiply; - * this provides a useful speedup on many machines. - * There is no way to specify a 16x16->32 multiply in portable C, but - * some C compilers will do the right thing if you provide the correct - * combination of casts. - * NB: for 12-bit samples, a full 32-bit multiplication will be needed. - */ - -#ifdef EIGHT_BIT_SAMPLES -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const))) -#endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const))) -#endif -#endif - -#ifndef MULTIPLY /* default definition */ -#define MULTIPLY(var,const) ((var) * (const)) -#endif - - -/* - * Perform the forward DCT on one block of samples. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -j_fwd_dct (DCTBLOCK data) -#else -j_fwd_dct (data) - DCTBLOCK data; -#endif /* NeedFunctionPrototypes */ -#else -j_fwd_dct (DCTBLOCK data) -#endif /* XIE_SUPPORTED */ -{ - INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - INT32 tmp10, tmp11, tmp12, tmp13; - INT32 z1, z2, z3, z4, z5; - register DCTELEM *dataptr; - int rowctr; - SHIFT_TEMPS - - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - - dataptr = data; - for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { - tmp0 = dataptr[0] + dataptr[7]; - tmp7 = dataptr[0] - dataptr[7]; - tmp1 = dataptr[1] + dataptr[6]; - tmp6 = dataptr[1] - dataptr[6]; - tmp2 = dataptr[2] + dataptr[5]; - tmp5 = dataptr[2] - dataptr[5]; - tmp3 = dataptr[3] + dataptr[4]; - tmp4 = dataptr[3] - dataptr[4]; - - /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". - */ - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); - dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), - CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), - CONST_BITS-PASS1_BITS); - - /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents cos(K*pi/16). - * i0..i3 in the paper are tmp4..tmp7 here. - */ - - z1 = tmp4 + tmp7; - z2 = tmp5 + tmp6; - z3 = tmp4 + tmp6; - z4 = tmp5 + tmp7; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - - dataptr = data; - for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { - tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; - tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; - tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; - tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; - tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; - tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; - tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; - tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; - - /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". - */ - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS+3); - dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS+3); - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), - CONST_BITS+PASS1_BITS+3); - - /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents cos(K*pi/16). - * i0..i3 in the paper are tmp4..tmp7 here. - */ - - z1 = tmp4 + tmp7; - z2 = tmp5 + tmp6; - z3 = tmp4 + tmp6; - z4 = tmp5 + tmp7; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, - CONST_BITS+PASS1_BITS+3); - - dataptr++; /* advance pointer to next column */ - } -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h diff -u xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h:1.8 xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h:1.8 Fri Dec 14 14:58:39 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h Sat Feb 28 21:42:00 2004 @@ -1,201 +0,0 @@ -/* $Xorg: jinclude.h,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jinclude.h */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/jinclude.h,v 1.8 2001/12/14 19:58:39 dawes Exp $ */ - -/* - * jinclude.h - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This is the central file that's #include'd by all the JPEG .c files. - * Its purpose is to provide a single place to fix any problems with - * including the wrong system include files. - * You can edit these declarations if you use a system with nonstandard - * system include files. - */ - -#ifndef NO_XIE - -#define _XIEC_MEMORY /* for XieMalloc and XieFree, used in jmemsys.c */ -#define XIE_SUPPORTED -#ifndef XFree86LOADER -#include -#else -#include "xf86_ansic.h" -#endif -#include "misc.h" /* for pointer ;*/ - -#define INCLUDES_ARE_ANSI - - -#undef SIZEOF /* in case you included X11/xmd.h */ -#define SIZEOF(object) ((size_t) sizeof(object)) -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) - -#else - -/* - * Normally the __STDC__ macro can be taken as indicating that the system - * include files conform to the ANSI C standard. However, if you are running - * GCC on a machine with non-ANSI system include files, that is not the case. - * In that case change the following, or add -DNONANSI_INCLUDES to your CFLAGS. - */ - -#ifdef __STDC__ -#ifndef NONANSI_INCLUDES -#define INCLUDES_ARE_ANSI /* this is what's tested before including */ -#endif -#endif - -/* - * is included to get the FILE typedef and NULL macro. - * Note that the core portable-JPEG files do not actually do any I/O - * using the stdio library; only the user interface, error handler, - * and file reading/writing modules invoke any stdio functions. - * (Well, we did cheat a bit in jmemmgr.c, but only if MEM_STATS is defined.) - */ - -#include - -/* - * We need the size_t typedef, which defines the parameter type of malloc(). - * In an ANSI-conforming implementation this is provided by , - * but on non-ANSI systems it's more likely to be in . - * On some not-quite-ANSI systems you may find it in . - */ - -#ifndef INCLUDES_ARE_ANSI /* shouldn't need this if ANSI C */ -#include -#endif -#ifdef __SASC /* Amiga SAS C provides it in stddef.h. */ -#include -#endif - -/* - * In ANSI C, and indeed any rational implementation, size_t is also the - * type returned by sizeof(). However, it seems there are some irrational - * implementations out there, in which sizeof() returns an int even though - * size_t is defined as long or unsigned long. To ensure consistent results - * we always use this SIZEOF() macro in place of using sizeof() directly. - */ - -#undef SIZEOF /* in case you included X11/xmd.h */ -#define SIZEOF(object) ((size_t) sizeof(object)) - -/* - * fread() and fwrite() are always invoked through these macros. - * On some systems you may need to twiddle the argument casts. - * CAUTION: argument order is different from underlying functions! - */ - -#define JFREAD(file,buf,sizeofbuf) \ - ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) - -/* - * We need the memcpy() and strcmp() functions, plus memory zeroing. - * ANSI and System V implementations declare these in . - * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). - * Some systems may declare memset and memcpy in . - * - * NOTE: we assume the size parameters to these functions are of type size_t. - * Change the casts in these macros if not! - */ - -#ifdef INCLUDES_ARE_ANSI -#include -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) -#else /* not ANSI */ -#ifdef BSD -#include -#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) -#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) -#else /* not BSD, assume Sys V or compatible */ -#include -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) -#endif /* BSD */ -#endif /* ANSI */ - -#endif /* XIE */ - -/* Now include the portable JPEG definition files. */ - -#include "jconfig.h" - -#include "jpegdata.h" Index: xc/programs/Xserver/XIE/mixie/jpeg/jmemmgr.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jmemmgr.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jmemmgr.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jmemmgr.c:1.2 Fri Dec 14 14:58:39 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jmemmgr.c Sat Feb 28 21:42:00 2004 @@ -1,1688 +0,0 @@ -/* $Xorg: jmemmgr.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jmemmgr.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jmemmgr.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides the standard system-independent memory management - * routines. This code is usable across a wide variety of machines; most - * of the system dependencies have been isolated in a separate file. - * The major functions provided here are: - * * bookkeeping to allow all allocated memory to be freed upon exit; - * * policy decisions about how to divide available memory among the - * various large arrays; - * * control logic for swapping virtual arrays between main memory and - * backing storage. - * The separate system-dependent file provides the actual backing-storage - * access code, and it contains the policy decision about how much total - * main memory to use. - * This file is system-dependent in the sense that some of its functions - * are unnecessary in some systems. For example, if there is enough virtual - * memory so that backing storage will never be used, much of the big-array - * control logic could be removed. (Of course, if you have that much memory - * then you shouldn't care about a little bit of unused code...) - * - * These routines are invoked via the methods alloc_small, free_small, - * alloc_medium, free_medium, alloc_small_sarray, free_small_sarray, - * alloc_small_barray, free_small_barray, request_big_sarray, - * request_big_barray, alloc_big_arrays, access_big_sarray, access_big_barray, - * free_big_sarray, free_big_barray, and free_all. - */ - -#define AM_MEMORY_MANAGER /* we define big_Xarray_control structs */ - -#include "jinclude.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef XIE_SUPPORTED -#ifndef NO_GETENV -#ifdef INCLUDES_ARE_ANSI -#include /* to declare getenv() */ -#else -extern char * getenv PP((const char * name)); -#endif -#endif -#endif /* XIE_SUPPORTED */ - - -/* - * On many systems it is not necessary to distinguish alloc_small from - * alloc_medium; the main case where they must be distinguished is when - * FAR pointers are distinct from regular pointers. However, you might - * want to keep them separate if you have different system-dependent logic - * for small and large memory requests (i.e., jget_small and jget_large - * do different things). - */ - -#ifdef NEED_FAR_POINTERS -#define NEED_ALLOC_MEDIUM /* flags alloc_medium really exists */ -#endif - - -#ifndef XIE_SUPPORTED -/* - * Many machines require storage alignment: longs must start on 4-byte - * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() - * always returns pointers that are multiples of the worst-case alignment - * requirement, and we had better do so too. This means the headers that - * we tack onto allocated structures had better have length a multiple of - * the alignment requirement. - * There isn't any really portable way to determine the worst-case alignment - * requirement. In this code we assume that the alignment requirement is - * multiples of sizeof(align_type). Here we define align_type as double; - * with this definition, the code will run on all machines known to me. - * If your machine has lesser alignment needs, you can save a few bytes - * by making align_type smaller. - */ - -typedef double align_type; - - -/* - * Some important notes: - * The allocation routines provided here must never return NULL. - * They should exit to error_exit if unsuccessful. - * - * It's not a good idea to try to merge the sarray and barray routines, - * even though they are textually almost the same, because samples are - * usually stored as bytes while coefficients are shorts. Thus, in machines - * where byte pointers have a different representation from word pointers, - * the resulting machine code could not be the same. - */ - - -static external_methods_ptr methods; /* saved for access to error_exit */ - - -#ifdef MEM_STATS /* optional extra stuff for statistics */ - -/* These macros are the assumed overhead per block for malloc(). - * They don't have to be accurate, but the printed statistics will be - * off a little bit if they are not. - */ -#define MALLOC_OVERHEAD (SIZEOF(pointer )) /* overhead for jget_small() */ -#define MALLOC_FAR_OVERHEAD (SIZEOF(pointer)) /* for jget_large() */ - -static long total_num_small = 0; /* total # of small objects alloced */ -static long total_bytes_small = 0; /* total bytes requested */ -static long cur_num_small = 0; /* # currently alloced */ -static long max_num_small = 0; /* max simultaneously alloced */ - -#ifdef NEED_ALLOC_MEDIUM -static long total_num_medium = 0; /* total # of medium objects alloced */ -static long total_bytes_medium = 0; /* total bytes requested */ -static long cur_num_medium = 0; /* # currently alloced */ -static long max_num_medium = 0; /* max simultaneously alloced */ -#endif - -static long total_num_sarray = 0; /* total # of sarray objects alloced */ -static long total_bytes_sarray = 0; /* total bytes requested */ -static long cur_num_sarray = 0; /* # currently alloced */ -static long max_num_sarray = 0; /* max simultaneously alloced */ - -static long total_num_barray = 0; /* total # of barray objects alloced */ -static long total_bytes_barray = 0; /* total bytes requested */ -static long cur_num_barray = 0; /* # currently alloced */ -static long max_num_barray = 0; /* max simultaneously alloced */ - -LOCAL void -print_mem_stats (void) -{ - /* since this is only a debugging stub, we can cheat a little on the - * trace message mechanism... helpful 'cuz trace_message can't handle longs. - */ - fprintf(stderr, "total_num_small = %ld\n", total_num_small); - fprintf(stderr, "total_bytes_small = %ld\n", total_bytes_small); - if (cur_num_small) - fprintf(stderr, "cur_num_small = %ld\n", cur_num_small); - fprintf(stderr, "max_num_small = %ld\n", max_num_small); - -#ifdef NEED_ALLOC_MEDIUM - fprintf(stderr, "total_num_medium = %ld\n", total_num_medium); - fprintf(stderr, "total_bytes_medium = %ld\n", total_bytes_medium); - if (cur_num_medium) - fprintf(stderr, "cur_num_medium = %ld\n", cur_num_medium); - fprintf(stderr, "max_num_medium = %ld\n", max_num_medium); -#endif - - fprintf(stderr, "total_num_sarray = %ld\n", total_num_sarray); - fprintf(stderr, "total_bytes_sarray = %ld\n", total_bytes_sarray); - if (cur_num_sarray) - fprintf(stderr, "cur_num_sarray = %ld\n", cur_num_sarray); - fprintf(stderr, "max_num_sarray = %ld\n", max_num_sarray); - - fprintf(stderr, "total_num_barray = %ld\n", total_num_barray); - fprintf(stderr, "total_bytes_barray = %ld\n", total_bytes_barray); - if (cur_num_barray) - fprintf(stderr, "cur_num_barray = %ld\n", cur_num_barray); - fprintf(stderr, "max_num_barray = %ld\n", max_num_barray); -} - -#endif /* MEM_STATS */ - - -LOCAL void -out_of_memory (int which) -/* Report an out-of-memory error and stop execution */ -/* If we compiled MEM_STATS support, report alloc requests before dying */ -{ -#ifdef MEM_STATS - if (methods->trace_level <= 0) /* don't do it if free_all() will */ - print_mem_stats(); /* print optional memory usage statistics */ -#endif - ERREXIT1(methods, "Insufficient memory (case %d)", which); -} -#endif /* XIE_SUPPORTED */ - - -/* - * Management of "small" objects. - * These are all-in-memory, and are in near-heap space on an 80x86. - */ - - -#ifdef XIE_SUPPORTED -METHODDEF pointer -#if NeedFunctionPrototypes -c_alloc_small (compress_info_ptr cinfo, size_t sizeofobject) -#else -c_alloc_small (cinfo, sizeofobject) - compress_info_ptr cinfo; - size_t sizeofobject; -#endif /* NeedFunctionPrototypes */ -/* Allocate a "small" object */ -{ - small_ptr result; - - sizeofobject += SIZEOF(small_hdr); /* add space for header */ - - result = (small_ptr) jget_small(sizeofobject); - if (result == NULL) - return (pointer ) result; - - result->next = cinfo->small_list; - cinfo->small_list = result; - result++; /* advance past header */ - - return (pointer ) result; -} - -METHODDEF pointer -#if NeedFunctionPrototypes -d_alloc_small (decompress_info_ptr cinfo, size_t sizeofobject) -#else -d_alloc_small (cinfo, sizeofobject) - decompress_info_ptr cinfo; - size_t sizeofobject; -#endif /* NeedFunctionPrototypes */ -/* Allocate a "small" object */ -{ - small_ptr result; - - sizeofobject += SIZEOF(small_hdr); /* add space for header */ - - result = (small_ptr) jget_small(sizeofobject); - if (result == NULL) - return (pointer ) result; - - result->next = cinfo->small_list; - cinfo->small_list = result; - result++; /* advance past header */ - - return (pointer ) result; -} - -#else -typedef union small_struct * small_ptr; - -typedef union small_struct { - small_ptr next; /* next in list of allocated objects */ - align_type dummy; /* ensures alignment of following storage */ - } small_hdr; - -static small_ptr small_list; /* head of list */ - -METHODDEF pointer -alloc_small (size_t sizeofobject) -/* Allocate a "small" object */ -{ - small_ptr result; - - sizeofobject += SIZEOF(small_hdr); /* add space for header */ - -#ifdef MEM_STATS - total_num_small++; - total_bytes_small += sizeofobject + MALLOC_OVERHEAD; - cur_num_small++; - if (cur_num_small > max_num_small) max_num_small = cur_num_small; -#endif - - result = (small_ptr) jget_small(sizeofobject); - if (result == NULL) - out_of_memory(1); - - result->next = small_list; - small_list = result; - result++; /* advance past header */ - - return (pointer ) result; -} -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -c_free_small (compress_info_ptr cinfo, pointer ptr) -#else -c_free_small (cinfo, ptr) - compress_info_ptr cinfo; - pointer ptr; -#endif /* NeedFunctionPrototypes */ -/* Free a "small" object */ -{ - small_ptr hdr; - small_ptr * llink; - - hdr = (small_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &cinfo->small_list; - while (*llink != hdr) { - if (*llink == NULL) - return(XIE_ERR); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - jfree_small((pointer ) hdr); - return(0); -} - -METHODDEF int -#if NeedFunctionPrototypes -d_free_small (decompress_info_ptr cinfo, pointer ptr) -#else -d_free_small (cinfo, ptr) - decompress_info_ptr cinfo; - pointer ptr; -#endif /* NeedFunctionPrototypes */ -/* Free a "small" object */ -{ - small_ptr hdr; - small_ptr * llink; - - hdr = (small_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &cinfo->small_list; - while (*llink != hdr) { - if (*llink == NULL) - return(XIE_ERR); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - jfree_small((pointer ) hdr); - return(0); -} -#else -METHODDEF void -free_small (pointer ptr) -/* Free a "small" object */ -{ - small_ptr hdr; - small_ptr * llink; - - hdr = (small_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &small_list; - while (*llink != hdr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_small request"); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - jfree_small((pointer ) hdr); - -#ifdef MEM_STATS - cur_num_small--; -#endif -} -#endif /* XIE_SUPPORTED */ - - -/* - * Management of "medium-size" objects. - * These are just like small objects except they are in the FAR heap. - */ - -#ifndef XIE_SUPPORTED -#ifdef NEED_ALLOC_MEDIUM - -typedef union medium_struct FAR * medium_ptr; - -typedef union medium_struct { - medium_ptr next; /* next in list of allocated objects */ - align_type dummy; /* ensures alignment of following storage */ - } medium_hdr; - -static medium_ptr medium_list; /* head of list */ - - -METHODDEF pointer -alloc_medium (size_t sizeofobject) -/* Allocate a "medium-size" object */ -{ - medium_ptr result; - - sizeofobject += SIZEOF(medium_hdr); /* add space for header */ - -#ifdef MEM_STATS - total_num_medium++; - total_bytes_medium += sizeofobject + MALLOC_FAR_OVERHEAD; - cur_num_medium++; - if (cur_num_medium > max_num_medium) max_num_medium = cur_num_medium; -#endif - - result = (medium_ptr) jget_large(sizeofobject); - if (result == NULL) - out_of_memory(2); - - result->next = medium_list; - medium_list = result; - result++; /* advance past header */ - - return (pointer) result; -} - - -METHODDEF void -free_medium (pointer ptr) -/* Free a "medium-size" object */ -{ - medium_ptr hdr; - medium_ptr FAR * llink; - - hdr = (medium_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &medium_list; - while (*llink != hdr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_medium request"); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - jfree_large((pointer) hdr); - -#ifdef MEM_STATS - cur_num_medium--; -#endif -} - -#endif /* NEED_ALLOC_MEDIUM */ -#endif /* XIE_SUPPORTED */ - - -/* - * Management of "small" (all-in-memory) 2-D sample arrays. - * The pointers are in near heap, the samples themselves in FAR heap. - * The header structure is adjacent to the row pointers. - * To minimize allocation overhead and to allow I/O of large contiguous - * blocks, we allocate the sample rows in groups of as many rows as possible - * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. - * Note that the big-array control routines, later in this file, know about - * this chunking of rows ... and also how to get the rowsperchunk value! - */ - - -#ifdef XIE_SUPPORTED -METHODDEF JSAMPARRAY -#if NeedFunctionPrototypes -c_alloc_small_sarray (compress_info_ptr cinfo, - long samplesperrow, long numrows) -#else -c_alloc_small_sarray (cinfo, samplesperrow, numrows) - compress_info_ptr cinfo; - long samplesperrow; - long numrows; -#endif /* NeedFunctionPrototypes */ -/* Allocate a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - JSAMPARRAY result; - JSAMPROW workspace; - long rowsperchunk, currow, i; - - /* Calculate max # of rows allowed in one allocation chunk */ - rowsperchunk = MAX_ALLOC_CHUNK / (samplesperrow * SIZEOF(JSAMPLE)); - if (rowsperchunk <= 0) - return (JSAMPARRAY) NULL; - - /* Get space for header and row pointers; this is always "near" on 80x86 */ - hdr = (small_sarray_ptr) c_alloc_small(cinfo, - (size_t) (numrows * SIZEOF(JSAMPROW) + SIZEOF(small_sarray_hdr))); - - result = (JSAMPARRAY) (hdr+1); /* advance past header */ - - /* Insert into list now so free_all does right thing if I fail */ - /* after allocating only some of the rows... */ - hdr->next = cinfo->small_sarray_list; - hdr->numrows = 0; - hdr->rowsperchunk = rowsperchunk; - cinfo->small_sarray_list = hdr; - - /* Get the rows themselves; on 80x86 these are "far" */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JSAMPROW) jget_large((size_t) (rowsperchunk * samplesperrow - * SIZEOF(JSAMPLE))); - if (workspace == NULL) - return (JSAMPARRAY) workspace; - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += samplesperrow; - } - hdr->numrows = currow; - } - - return result; -} - -METHODDEF JSAMPARRAY -#if NeedFunctionPrototypes -d_alloc_small_sarray (decompress_info_ptr cinfo, - long samplesperrow, long numrows) -#else -d_alloc_small_sarray (cinfo, samplesperrow, numrows) - decompress_info_ptr cinfo; - long samplesperrow; - long numrows; -#endif /* NeedFunctionPrototypes */ -/* Allocate a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - JSAMPARRAY result; - JSAMPROW workspace; - long rowsperchunk, currow, i; - - /* Calculate max # of rows allowed in one allocation chunk */ - rowsperchunk = MAX_ALLOC_CHUNK / (samplesperrow * SIZEOF(JSAMPLE)); - if (rowsperchunk <= 0) - return (JSAMPARRAY) NULL; - - /* Get space for header and row pointers; this is always "near" on 80x86 */ - hdr = (small_sarray_ptr) d_alloc_small(cinfo, - (size_t) (numrows * SIZEOF(JSAMPROW) + SIZEOF(small_sarray_hdr))); - - result = (JSAMPARRAY) (hdr+1); /* advance past header */ - - /* Insert into list now so free_all does right thing if I fail */ - /* after allocating only some of the rows... */ - hdr->next = cinfo->small_sarray_list; - hdr->numrows = 0; - hdr->rowsperchunk = rowsperchunk; - cinfo->small_sarray_list = hdr; - - /* Get the rows themselves; on 80x86 these are "far" */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JSAMPROW) jget_large((size_t) (rowsperchunk * samplesperrow - * SIZEOF(JSAMPLE))); - if (workspace == NULL) - return (JSAMPARRAY) workspace; - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += samplesperrow; - } - hdr->numrows = currow; - } - - return result; -} -#else -typedef struct small_sarray_struct * small_sarray_ptr; - -typedef struct small_sarray_struct { - small_sarray_ptr next; /* next in list of allocated sarrays */ - long numrows; /* # of rows in this array */ - long rowsperchunk; /* max # of rows per allocation chunk */ - JSAMPROW dummy; /* ensures alignment of following storage */ - } small_sarray_hdr; - -static small_sarray_ptr small_sarray_list; /* head of list */ - -METHODDEF JSAMPARRAY -alloc_small_sarray (long samplesperrow, long numrows) -/* Allocate a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - JSAMPARRAY result; - JSAMPROW workspace; - long rowsperchunk, currow, i; - -#ifdef MEM_STATS - total_num_sarray++; - cur_num_sarray++; - if (cur_num_sarray > max_num_sarray) max_num_sarray = cur_num_sarray; -#endif - - /* Calculate max # of rows allowed in one allocation chunk */ - rowsperchunk = MAX_ALLOC_CHUNK / (samplesperrow * SIZEOF(JSAMPLE)); - if (rowsperchunk <= 0) - ERREXIT(methods, "Image too wide for this implementation"); - - /* Get space for header and row pointers; this is always "near" on 80x86 */ - hdr = (small_sarray_ptr) alloc_small((size_t) (numrows * SIZEOF(JSAMPROW) - + SIZEOF(small_sarray_hdr))); - - result = (JSAMPARRAY) (hdr+1); /* advance past header */ - - /* Insert into list now so free_all does right thing if I fail */ - /* after allocating only some of the rows... */ - hdr->next = small_sarray_list; - hdr->numrows = 0; - hdr->rowsperchunk = rowsperchunk; - small_sarray_list = hdr; - - /* Get the rows themselves; on 80x86 these are "far" */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); -#ifdef MEM_STATS - total_bytes_sarray += rowsperchunk * samplesperrow * SIZEOF(JSAMPLE) - + MALLOC_FAR_OVERHEAD; -#endif - workspace = (JSAMPROW) jget_large((size_t) (rowsperchunk * samplesperrow - * SIZEOF(JSAMPLE))); - if (workspace == NULL) - out_of_memory(3); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += samplesperrow; - } - hdr->numrows = currow; - } - - return result; -} -#endif /* XIE_SUPPORTED */ - - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -c_free_small_sarray (compress_info_ptr cinfo, JSAMPARRAY ptr) -#else -c_free_small_sarray (cinfo, ptr) - compress_info_ptr cinfo; - JSAMPARRAY ptr; -#endif /* NeedFunctionPrototypes */ -/* Free a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - small_sarray_ptr * llink; - long i; - - hdr = (small_sarray_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &cinfo->small_sarray_list; - while (*llink != hdr) { - if (*llink == NULL) - return(XIE_ERR); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - /* Free the rows themselves; on 80x86 these are "far" */ - /* Note we only free the row-group headers! */ - for (i = 0; i < hdr->numrows; i += hdr->rowsperchunk) { - jfree_large((pointer) ptr[i]); - } - - /* Free header and row pointers */ - return(c_free_small(cinfo, (pointer ) hdr)); -} - -METHODDEF int -#if NeedFunctionPrototypes -d_free_small_sarray (decompress_info_ptr cinfo, JSAMPARRAY ptr) -#else -d_free_small_sarray (cinfo, ptr) - decompress_info_ptr cinfo; - JSAMPARRAY ptr; -#endif /* NeedFunctionPrototypes */ -/* Free a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - small_sarray_ptr * llink; - long i; - - hdr = (small_sarray_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &cinfo->small_sarray_list; - while (*llink != hdr) { - if (*llink == NULL) - return(XIE_ERR); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - /* Free the rows themselves; on 80x86 these are "far" */ - /* Note we only free the row-group headers! */ - for (i = 0; i < hdr->numrows; i += hdr->rowsperchunk) { - jfree_large((pointer) ptr[i]); - } - - /* Free header and row pointers */ - return(d_free_small(cinfo, (pointer ) hdr)); -} - -#else -METHODDEF void -free_small_sarray (JSAMPARRAY ptr) -/* Free a "small" (all-in-memory) 2-D sample array */ -{ - small_sarray_ptr hdr; - small_sarray_ptr * llink; - long i; - - hdr = (small_sarray_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &small_sarray_list; - while (*llink != hdr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_small_sarray request"); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - /* Free the rows themselves; on 80x86 these are "far" */ - /* Note we only free the row-group headers! */ - for (i = 0; i < hdr->numrows; i += hdr->rowsperchunk) { - jfree_large((pointer) ptr[i]); - } - - /* Free header and row pointers */ - free_small((pointer ) hdr); - -#ifdef MEM_STATS - cur_num_sarray--; -#endif -} - -#endif /* XIE_SUPPORTED */ - -/* - * Management of "small" (all-in-memory) 2-D coefficient-block arrays. - * This is essentially the same as the code for sample arrays, above. - */ - - -#ifdef XIE_SUPPORTED -METHODDEF JBLOCKARRAY -#if NeedFunctionPrototypes -d_alloc_small_barray (decompress_info_ptr cinfo, - long blocksperrow, long numrows) -#else -d_alloc_small_barray (cinfo, blocksperrow, numrows) - decompress_info_ptr cinfo; - long blocksperrow; - long numrows; -#endif /* NeedFunctionPrototypes */ -/* Allocate a "small" (all-in-memory) 2-D coefficient-block array */ -{ - small_barray_ptr hdr; - JBLOCKARRAY result; - JBLOCKROW workspace; - long rowsperchunk, currow, i; - - /* Calculate max # of rows allowed in one allocation chunk */ - rowsperchunk = MAX_ALLOC_CHUNK / (blocksperrow * SIZEOF(JBLOCK)); - if (rowsperchunk <= 0) - return (JBLOCKARRAY) NULL; - - /* Get space for header and row pointers; this is always "near" on 80x86 */ - hdr = (small_barray_ptr) d_alloc_small(cinfo, - (size_t) (numrows * SIZEOF(JBLOCKROW) + SIZEOF(small_barray_hdr))); - - result = (JBLOCKARRAY) (hdr+1); /* advance past header */ - - /* Insert into list now so free_all does right thing if I fail */ - /* after allocating only some of the rows... */ - hdr->next = cinfo->small_barray_list; - hdr->numrows = 0; - hdr->rowsperchunk = rowsperchunk; - cinfo->small_barray_list = hdr; - - /* Get the rows themselves; on 80x86 these are "far" */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JBLOCKROW) jget_large((size_t) (rowsperchunk * blocksperrow - * SIZEOF(JBLOCK))); - if (workspace == NULL) - return (JBLOCKARRAY) workspace; - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += blocksperrow; - } - hdr->numrows = currow; - } - - return result; -} - -#else -typedef struct small_barray_struct * small_barray_ptr; - -typedef struct small_barray_struct { - small_barray_ptr next; /* next in list of allocated barrays */ - long numrows; /* # of rows in this array */ - long rowsperchunk; /* max # of rows per allocation chunk */ - JBLOCKROW dummy; /* ensures alignment of following storage */ - } small_barray_hdr; - -static small_barray_ptr small_barray_list; /* head of list */ - -METHODDEF JBLOCKARRAY -alloc_small_barray (long blocksperrow, long numrows) -/* Allocate a "small" (all-in-memory) 2-D coefficient-block array */ -{ - small_barray_ptr hdr; - JBLOCKARRAY result; - JBLOCKROW workspace; - long rowsperchunk, currow, i; - -#ifdef MEM_STATS - total_num_barray++; - cur_num_barray++; - if (cur_num_barray > max_num_barray) max_num_barray = cur_num_barray; -#endif - - /* Calculate max # of rows allowed in one allocation chunk */ - rowsperchunk = MAX_ALLOC_CHUNK / (blocksperrow * SIZEOF(JBLOCK)); - if (rowsperchunk <= 0) - ERREXIT(methods, "Image too wide for this implementation"); - - /* Get space for header and row pointers; this is always "near" on 80x86 */ - hdr = (small_barray_ptr) alloc_small((size_t) (numrows * SIZEOF(JBLOCKROW) - + SIZEOF(small_barray_hdr))); - - result = (JBLOCKARRAY) (hdr+1); /* advance past header */ - - /* Insert into list now so free_all does right thing if I fail */ - /* after allocating only some of the rows... */ - hdr->next = small_barray_list; - hdr->numrows = 0; - hdr->rowsperchunk = rowsperchunk; - small_barray_list = hdr; - - /* Get the rows themselves; on 80x86 these are "far" */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); -#ifdef MEM_STATS - total_bytes_barray += rowsperchunk * blocksperrow * SIZEOF(JBLOCK) - + MALLOC_FAR_OVERHEAD; -#endif - workspace = (JBLOCKROW) jget_large((size_t) (rowsperchunk * blocksperrow - * SIZEOF(JBLOCK))); - if (workspace == NULL) - out_of_memory(4); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += blocksperrow; - } - hdr->numrows = currow; - } - - return result; -} - -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -d_free_small_barray (decompress_info_ptr cinfo, JBLOCKARRAY ptr) -#else -d_free_small_barray (cinfo, ptr) - decompress_info_ptr cinfo; - JBLOCKARRAY ptr; -#endif /* NeedFunctionPrototypes */ -/* Free a "small" (all-in-memory) 2-D coefficient-block array */ -{ - small_barray_ptr hdr; - small_barray_ptr * llink; - long i; - - hdr = (small_barray_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &cinfo->small_barray_list; - while (*llink != hdr) { - if (*llink == NULL) - return(XIE_ERR); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - /* Free the rows themselves; on 80x86 these are "far" */ - /* Note we only free the row-group headers! */ - for (i = 0; i < hdr->numrows; i += hdr->rowsperchunk) { - jfree_large((pointer) ptr[i]); - } - - /* Free header and row pointers */ - return(d_free_small(cinfo, (pointer ) hdr)); -} - -#else -METHODDEF void -free_small_barray (JBLOCKARRAY ptr) -/* Free a "small" (all-in-memory) 2-D coefficient-block array */ -{ - small_barray_ptr hdr; - small_barray_ptr * llink; - long i; - - hdr = (small_barray_ptr) ptr; - hdr--; /* point back to header */ - - /* Remove item from list -- linear search is fast enough */ - llink = &small_barray_list; - while (*llink != hdr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_small_barray request"); - llink = &( (*llink)->next ); - } - *llink = hdr->next; - - /* Free the rows themselves; on 80x86 these are "far" */ - /* Note we only free the row-group headers! */ - for (i = 0; i < hdr->numrows; i += hdr->rowsperchunk) { - jfree_large((pointer) ptr[i]); - } - - /* Free header and row pointers */ - free_small((pointer ) hdr); - -#ifdef MEM_STATS - cur_num_barray--; -#endif -} - -#endif /* XIE_SUPPORTED */ - - -/* - * About "big" array management: - * - * To allow machines with limited memory to handle large images, - * all processing in the JPEG system is done a few pixel or block rows - * at a time. The above "small" array routines are only used to allocate - * strip buffers (as wide as the image, but just a few rows high). - * In some cases multiple passes must be made over the data. In these - * cases the "big" array routines are used. The array is still accessed - * a strip at a time, but the memory manager must save the whole array - * for repeated accesses. The intended implementation is that there is - * a strip buffer in memory (as high as is possible given the desired memory - * limit), plus a backing file that holds the rest of the array. - * - * The request_big_array routines are told the total size of the image (in case - * it is useful to know the total file size that will be needed). They are - * also given the unit height, which is the number of rows that will be - * accessed at once; the in-memory buffer should be made a multiple of - * this height for best efficiency. - * - * The request routines create control blocks (and may open backing files), - * but they don't create the in-memory buffers. This is postponed until - * alloc_big_arrays is called. At that time the total amount of space needed - * is known (approximately, anyway), so free memory can be divided up fairly. - * - * The access_big_array routines are responsible for making a specific strip - * area accessible (after reading or writing the backing file, if necessary). - * Note that the access routines are told whether the caller intends to modify - * the accessed strip; during a read-only pass this saves having to rewrite - * data to disk. - * - * The typical access pattern is one top-to-bottom pass to write the data, - * followed by one or more read-only top-to-bottom passes. However, other - * access patterns may occur while reading. For example, translation of image - * formats that use bottom-to-top scan order will require bottom-to-top read - * passes. The memory manager need not support multiple write passes nor - * funny write orders (meaning that rearranging rows must be handled while - * reading data out of the big array, not while putting it in). - * - * In current usage, the access requests are always for nonoverlapping strips; - * that is, successive access start_row numbers always differ by exactly the - * unitheight. This allows fairly simple buffer dump/reload logic if the - * in-memory buffer is made a multiple of the unitheight. It would be - * possible to keep downsampled rather than fullsize data in the "big" arrays, - * thus reducing temp file size, if we supported overlapping strip access - * (access requests differing by less than the unitheight). At the moment - * I don't believe this is worth the extra complexity. - */ - - - -/* The control blocks for virtual arrays. - * System-dependent info for the associated backing store is hidden inside - * the backing_store_info struct. - */ - -#ifndef XIE_SUPPORTED -struct big_sarray_control { - long rows_in_array; /* total virtual array height */ - long samplesperrow; /* width of array (and of memory buffer) */ - long unitheight; /* # of rows accessed by access_big_sarray() */ - JSAMPARRAY mem_buffer; /* the in-memory buffer */ - long rows_in_mem; /* height of memory buffer */ - long rowsperchunk; /* allocation chunk size in mem_buffer */ - long cur_start_row; /* first logical row # in the buffer */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ - big_sarray_ptr next; /* link to next big sarray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - -static big_sarray_ptr big_sarray_list; /* head of list */ - -struct big_barray_control { - long rows_in_array; /* total virtual array height */ - long blocksperrow; /* width of array (and of memory buffer) */ - long unitheight; /* # of rows accessed by access_big_barray() */ - JBLOCKARRAY mem_buffer; /* the in-memory buffer */ - long rows_in_mem; /* height of memory buffer */ - long rowsperchunk; /* allocation chunk size in mem_buffer */ - long cur_start_row; /* first logical row # in the buffer */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ - big_barray_ptr next; /* link to next big barray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - -static big_barray_ptr big_barray_list; /* head of list */ - - -METHODDEF big_sarray_ptr -request_big_sarray (long samplesperrow, long numrows, long unitheight) -/* Request a "big" (virtual-memory) 2-D sample array */ -{ - big_sarray_ptr result; - - /* get control block */ - result = (big_sarray_ptr) alloc_small(SIZEOF(struct big_sarray_control)); - - result->rows_in_array = numrows; - result->samplesperrow = samplesperrow; - result->unitheight = unitheight; - result->mem_buffer = NULL; /* marks array not yet realized */ - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = big_sarray_list; /* add to list of big arrays */ - big_sarray_list = result; - - return result; -} - - -METHODDEF big_barray_ptr -request_big_barray (long blocksperrow, long numrows, long unitheight) -/* Request a "big" (virtual-memory) 2-D coefficient-block array */ -{ - big_barray_ptr result; - - /* get control block */ - result = (big_barray_ptr) alloc_small(SIZEOF(struct big_barray_control)); - - result->rows_in_array = numrows; - result->blocksperrow = blocksperrow; - result->unitheight = unitheight; - result->mem_buffer = NULL; /* marks array not yet realized */ - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = big_barray_list; /* add to list of big arrays */ - big_barray_list = result; - - return result; -} - - -METHODDEF void -alloc_big_arrays (long extra_small_samples, long extra_small_blocks, - long extra_medium_space) -/* Allocate the in-memory buffers for any unrealized "big" arrays */ -/* 'extra' values are upper bounds for total future small-array requests */ -/* and far-heap requests */ -{ - long total_extra_space = extra_small_samples * SIZEOF(JSAMPLE) - + extra_small_blocks * SIZEOF(JBLOCK) - + extra_medium_space; - long space_per_unitheight, maximum_space, avail_mem; - long unitheights, max_unitheights; - big_sarray_ptr sptr; - big_barray_ptr bptr; - - /* Compute the minimum space needed (unitheight rows in each buffer) - * and the maximum space needed (full image height in each buffer). - * These may be of use to the system-dependent jmem_available routine. - */ - space_per_unitheight = 0; - maximum_space = total_extra_space; - for (sptr = big_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_unitheight += sptr->unitheight * - sptr->samplesperrow * SIZEOF(JSAMPLE); - maximum_space += sptr->rows_in_array * - sptr->samplesperrow * SIZEOF(JSAMPLE); - } - } - for (bptr = big_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_unitheight += bptr->unitheight * - bptr->blocksperrow * SIZEOF(JBLOCK); - maximum_space += bptr->rows_in_array * - bptr->blocksperrow * SIZEOF(JBLOCK); - } - } - - if (space_per_unitheight <= 0) - return; /* no unrealized arrays, no work */ - - /* Determine amount of memory to actually use; this is system-dependent. */ - avail_mem = jmem_available(space_per_unitheight + total_extra_space, - maximum_space); - - /* If the maximum space needed is available, make all the buffers full - * height; otherwise parcel it out with the same number of unitheights - * in each buffer. - */ - if (avail_mem >= maximum_space) - max_unitheights = 1000000000L; - else { - max_unitheights = (avail_mem - total_extra_space) / space_per_unitheight; - /* If there doesn't seem to be enough space, try to get the minimum - * anyway. This allows a "stub" implementation of jmem_available(). - */ - if (max_unitheights <= 0) - max_unitheights = 1; - } - - /* Allocate the in-memory buffers and initialize backing store as needed. */ - - for (sptr = big_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - unitheights = (sptr->rows_in_array + sptr->unitheight - 1L) - / sptr->unitheight; - if (unitheights <= max_unitheights) { - /* This buffer fits in memory */ - sptr->rows_in_mem = sptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - sptr->rows_in_mem = max_unitheights * sptr->unitheight; - jopen_backing_store(& sptr->b_s_info, - (long) (sptr->rows_in_array * - sptr->samplesperrow * SIZEOF(JSAMPLE))); - sptr->b_s_open = TRUE; - } - sptr->mem_buffer = alloc_small_sarray(sptr->samplesperrow, - sptr->rows_in_mem); - /* Reach into the small_sarray header and get the rowsperchunk field. - * Yes, I know, this is horrible coding practice. - */ - sptr->rowsperchunk = - ((small_sarray_ptr) sptr->mem_buffer)[-1].rowsperchunk; - sptr->cur_start_row = 0; - sptr->dirty = FALSE; - } - } - - for (bptr = big_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - unitheights = (bptr->rows_in_array + bptr->unitheight - 1L) - / bptr->unitheight; - if (unitheights <= max_unitheights) { - /* This buffer fits in memory */ - bptr->rows_in_mem = bptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - bptr->rows_in_mem = max_unitheights * bptr->unitheight; - jopen_backing_store(& bptr->b_s_info, - (long) (bptr->rows_in_array * - bptr->blocksperrow * SIZEOF(JBLOCK))); - bptr->b_s_open = TRUE; - } - bptr->mem_buffer = alloc_small_barray(bptr->blocksperrow, - bptr->rows_in_mem); - /* Reach into the small_barray header and get the rowsperchunk field. */ - bptr->rowsperchunk = - ((small_barray_ptr) bptr->mem_buffer)[-1].rowsperchunk; - bptr->cur_start_row = 0; - bptr->dirty = FALSE; - } - } -} - - -LOCAL void -do_sarray_io (big_sarray_ptr ptr, boolean writing) -/* Do backing store read or write of a "big" sample array */ -{ - long bytesperrow, file_offset, byte_count, rows, i; - - bytesperrow = ptr->samplesperrow * SIZEOF(JSAMPLE); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); - /* Transfer no more than fits in file */ - rows = MIN(rows, ptr->rows_in_array - (ptr->cur_start_row + i)); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (& ptr->b_s_info, - (pointer) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (& ptr->b_s_info, - (pointer) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -LOCAL void -do_barray_io (big_barray_ptr ptr, boolean writing) -/* Do backing store read or write of a "big" coefficient-block array */ -{ - long bytesperrow, file_offset, byte_count, rows, i; - - bytesperrow = ptr->blocksperrow * SIZEOF(JBLOCK); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN(ptr->rowsperchunk, ptr->rows_in_mem - i); - /* Transfer no more than fits in file */ - rows = MIN(rows, ptr->rows_in_array - (ptr->cur_start_row + i)); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (& ptr->b_s_info, - (pointer) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (& ptr->b_s_info, - (pointer) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -METHODDEF JSAMPARRAY -access_big_sarray (big_sarray_ptr ptr, long start_row, boolean writable) -/* Access the part of a "big" sample array starting at start_row */ -/* and extending for ptr->unitheight rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - /* debugging check */ - if (start_row < 0 || start_row+ptr->unitheight > ptr->rows_in_array || - ptr->mem_buffer == NULL) - ERREXIT(methods, "Bogus access_big_sarray request"); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - start_row+ptr->unitheight > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(methods, "Virtual array controller messed up"); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_sarray_io(ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target address is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - ptr->cur_start_row = start_row + ptr->unitheight - ptr->rows_in_mem; - if (ptr->cur_start_row < 0) - ptr->cur_start_row = 0; /* don't fall off front end of file */ - } - /* If reading, read in the selected part of the array. - * If we are writing, we need not pre-read the selected portion, - * since the access sequence constraints ensure it would be garbage. - */ - if (! writable) { - do_sarray_io(ptr, FALSE); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -METHODDEF JBLOCKARRAY -access_big_barray (big_barray_ptr ptr, long start_row, boolean writable) -/* Access the part of a "big" coefficient-block array starting at start_row */ -/* and extending for ptr->unitheight rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - /* debugging check */ - if (start_row < 0 || start_row+ptr->unitheight > ptr->rows_in_array || - ptr->mem_buffer == NULL) - ERREXIT(methods, "Bogus access_big_barray request"); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - start_row+ptr->unitheight > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(methods, "Virtual array controller messed up"); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_barray_io(ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target address is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - ptr->cur_start_row = start_row + ptr->unitheight - ptr->rows_in_mem; - if (ptr->cur_start_row < 0) - ptr->cur_start_row = 0; /* don't fall off front end of file */ - } - /* If reading, read in the selected part of the array. - * If we are writing, we need not pre-read the selected portion, - * since the access sequence constraints ensure it would be garbage. - */ - if (! writable) { - do_barray_io(ptr, FALSE); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -METHODDEF void -free_big_sarray (big_sarray_ptr ptr) -/* Free a "big" (virtual-memory) 2-D sample array */ -{ - big_sarray_ptr * llink; - - /* Remove item from list -- linear search is fast enough */ - llink = &big_sarray_list; - while (*llink != ptr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_big_sarray request"); - llink = &( (*llink)->next ); - } - *llink = ptr->next; - - if (ptr->b_s_open) /* there may be no backing store */ - (*ptr->b_s_info.close_backing_store) (& ptr->b_s_info); - - if (ptr->mem_buffer != NULL) /* just in case never realized */ - free_small_sarray(ptr->mem_buffer); - - free_small((pointer ) ptr); /* free the control block too */ -} - - -METHODDEF void -free_big_barray (big_barray_ptr ptr) -/* Free a "big" (virtual-memory) 2-D coefficient-block array */ -{ - big_barray_ptr * llink; - - /* Remove item from list -- linear search is fast enough */ - llink = &big_barray_list; - while (*llink != ptr) { - if (*llink == NULL) - ERREXIT(methods, "Bogus free_big_barray request"); - llink = &( (*llink)->next ); - } - *llink = ptr->next; - - if (ptr->b_s_open) /* there may be no backing store */ - (*ptr->b_s_info.close_backing_store) (& ptr->b_s_info); - - if (ptr->mem_buffer != NULL) /* just in case never realized */ - free_small_barray(ptr->mem_buffer); - - free_small((pointer ) ptr); /* free the control block too */ -} - -#endif /* XIE_SUPPORTED */ - -/* - * Cleanup: free anything that's been allocated since jselmemmgr(). - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -c_free_all (compress_info_ptr cinfo) -#else -c_free_all (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* Free any open small arrays -- these may release small objects */ - /* +1's are because we must pass a pointer to the data, not the header */ - while (cinfo->small_sarray_list != NULL) { - if ((c_free_small_sarray(cinfo, - (JSAMPARRAY) (cinfo->small_sarray_list + 1))) < 0) - return(XIE_ERR); - } - /* Free any remaining small objects */ - while (cinfo->small_list != NULL) { - if ((c_free_small(cinfo, - (pointer ) (cinfo->small_list + 1))) < 0) - return(XIE_ERR); - } - - jmem_term(); /* system-dependent cleanup */ - return(XIE_NRML); - -} - -METHODDEF int -#if NeedFunctionPrototypes -d_free_all (decompress_info_ptr cinfo) -#else -d_free_all (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - /* Free any open small arrays -- these may release small objects */ - /* +1's are because we must pass a pointer to the data, not the header */ - while (cinfo->small_sarray_list != NULL) { - if ((d_free_small_sarray(cinfo, - (JSAMPARRAY) (cinfo->small_sarray_list + 1))) < 0) - return(XIE_ERR); - } - while (cinfo->small_barray_list != NULL) { - if ((d_free_small_barray(cinfo, - (JBLOCKARRAY) (cinfo->small_barray_list + 1))) < 0) - return(XIE_ERR); - } - /* Free any remaining small objects */ - while (cinfo->small_list != NULL) { - if ((d_free_small(cinfo, - (pointer ) (cinfo->small_list + 1))) < 0) - return(XIE_ERR); - } - - jmem_term(); /* system-dependent cleanup */ - return(XIE_NRML); - -} - -#else -METHODDEF void -free_all (void) -{ - /* First free any open "big" arrays -- these may release small arrays */ - while (big_sarray_list != NULL) - free_big_sarray(big_sarray_list); - while (big_barray_list != NULL) - free_big_barray(big_barray_list); - /* Free any open small arrays -- these may release small objects */ - /* +1's are because we must pass a pointer to the data, not the header */ - while (small_sarray_list != NULL) - free_small_sarray((JSAMPARRAY) (small_sarray_list + 1)); - while (small_barray_list != NULL) - free_small_barray((JBLOCKARRAY) (small_barray_list + 1)); - /* Free any remaining small objects */ - while (small_list != NULL) - free_small((pointer ) (small_list + 1)); -#ifdef NEED_ALLOC_MEDIUM - while (medium_list != NULL) - free_medium((pointer) (medium_list + 1)); -#endif - - jmem_term(); /* system-dependent cleanup */ - -#ifdef MEM_STATS - if (methods->trace_level > 0) - print_mem_stats(); /* print optional memory usage statistics */ -#endif -} - -#endif /* XIE_SUPPORTED */ - -/* - * The method selection routine for virtual memory systems. - * The system-dependent setup routine should call this routine - * to install the necessary method pointers in the supplied struct. - */ - -#ifdef XIE_SUPPORTED -GLOBAL void -#if NeedFunctionPrototypes -jcselmemmgr (compress_info_ptr cinfo, external_methods_ptr emethods) -#else -jcselmemmgr (cinfo, emethods) - compress_info_ptr cinfo; - external_methods_ptr emethods; -#endif /* NeedFunctionPrototypes */ -{ - - emethods->c_alloc_small = c_alloc_small; - emethods->c_free_small = c_free_small; - emethods->c_alloc_small_sarray = c_alloc_small_sarray; - emethods->c_free_small_sarray = c_free_small_sarray; - emethods->c_free_all = c_free_all; - - /* Initialize list headers to empty */ - cinfo->small_list = NULL; - cinfo->small_sarray_list = NULL; - cinfo->small_barray_list = NULL; - - emethods->max_memory_to_use = 0; - -} - -GLOBAL void -#if NeedFunctionPrototypes -jdselmemmgr (decompress_info_ptr cinfo, external_methods_ptr emethods) -#else -jdselmemmgr (cinfo, emethods) - decompress_info_ptr cinfo; - external_methods_ptr emethods; -#endif /* NeedFunctionPrototypes */ -{ - - emethods->d_alloc_small = d_alloc_small; - emethods->d_free_small = d_free_small; - emethods->d_alloc_small_sarray = d_alloc_small_sarray; - emethods->d_free_small_sarray = d_free_small_sarray; - emethods->d_alloc_small_barray = d_alloc_small_barray; - emethods->d_free_small_barray = d_free_small_barray; - emethods->d_free_all = d_free_all; - - /* Initialize list headers to empty */ - cinfo->small_list = NULL; - cinfo->small_sarray_list = NULL; - cinfo->small_barray_list = NULL; - - emethods->max_memory_to_use = 0; - -} -#else -GLOBAL void -jselmemmgr (external_methods_ptr emethods) -{ - methods = emethods; /* save struct addr for error exit access */ - - emethods->alloc_small = alloc_small; - emethods->free_small = free_small; -#ifdef NEED_ALLOC_MEDIUM - emethods->alloc_medium = alloc_medium; - emethods->free_medium = free_medium; -#else - emethods->alloc_medium = alloc_small; - emethods->free_medium = free_small; -#endif - emethods->alloc_small_sarray = alloc_small_sarray; - emethods->free_small_sarray = free_small_sarray; - emethods->alloc_small_barray = alloc_small_barray; - emethods->free_small_barray = free_small_barray; - emethods->request_big_sarray = request_big_sarray; - emethods->request_big_barray = request_big_barray; - emethods->alloc_big_arrays = alloc_big_arrays; - emethods->access_big_sarray = access_big_sarray; - emethods->access_big_barray = access_big_barray; - emethods->free_big_sarray = free_big_sarray; - emethods->free_big_barray = free_big_barray; - emethods->free_all = free_all; - - /* Initialize list headers to empty */ - small_list = NULL; -#ifdef NEED_ALLOC_MEDIUM - medium_list = NULL; -#endif - small_sarray_list = NULL; - small_barray_list = NULL; - big_sarray_list = NULL; - big_barray_list = NULL; - - jmem_init(emethods); /* system-dependent initialization */ - - /* Check for an environment variable JPEGMEM; if found, override the - * default max_memory setting from jmem_init. Note that a command line - * -m argument may again override this value. - * If your system doesn't support getenv(), define NO_GETENV to disable - * this feature. - */ -#ifndef NO_GETENV - { char * memenv; - - if ((memenv = getenv("JPEGMEM")) != NULL) { - long lval; - char ch = 'x'; - - if (sscanf(memenv, "%ld%c", &lval, &ch) > 0) { - if (ch == 'm' || ch == 'M') - lval *= 1000L; - emethods->max_memory_to_use = lval * 1000L; - } - } - } -#endif - -} -#endif /* XIE_SUPPORTED */ Index: xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c:3.4 xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c:3.4 Fri Dec 14 14:58:39 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c Sat Feb 28 21:42:00 2004 @@ -1,233 +0,0 @@ -/* $Xorg: jmemsys.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jmemsys.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.c,v 3.4 2001/12/14 19:58:39 dawes Exp $ */ - -/* - * jmemnobs.c (jmemsys.c) - * - * Copyright (C) 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides a really simple implementation of the system- - * dependent portion of the JPEG memory manager. This implementation - * assumes that no backing-store files are needed: all required space - * can be obtained from malloc(). - * This is very portable in the sense that it'll compile on almost anything, - * but you'd better have lots of main memory (or virtual memory) if you want - * to process big images. - * Note that the max_memory_to_use option is ignored by this implementation. - */ - -#include "jinclude.h" -#include "jmemsys.h" - -#ifdef _XIEC_MEMORY -#include -#ifdef malloc -#undef malloc -#endif -#ifdef free -#undef free -#endif -#define malloc(size) XieMalloc(size) -#define free(ptr) XieFree(ptr) -#else -#ifdef INCLUDES_ARE_ANSI -#include /* to declare malloc(), free() */ -#else -extern pointer malloc PP((size_t size)); -extern void free PP(pointer ptr)); -#endif -#endif /* _XIEC_MEMORY */ - - -#ifndef XIE_SUPPORTED -static external_methods_ptr methods; /* saved for access to error_exit */ -#endif /* XIE_SUPPORTED */ - -/* - * Memory allocation and freeing are controlled by the regular library - * routines malloc() and free(). - */ - -GLOBAL pointer -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jget_small (size_t sizeofobject) -#else -jget_small (sizeofobject) - size_t sizeofobject; -#endif /* NeedFunctionPrototypes */ -#else -jget_small (size_t sizeofobject) -#endif /* XIE_SUPPORTED */ -{ - return (pointer) malloc(sizeofobject); -} - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jfree_small (pointer object) -#else -jfree_small (object) - pointer object; -#endif /* NeedFunctionPrototypes */ -#else -jfree_small (pointer object) -#endif /* XIE_SUPPORTED */ -{ - free(object); -} - -/* - * We assume NEED_FAR_POINTERS is not defined and so the separate entry points - * jget_large, jfree_large are not needed. - */ - - -/* - * This routine computes the total memory space available for allocation. - * Here we always say, "we got all you want bud!" - */ - -#ifndef XIE_SUPPORTED -GLOBAL long -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jmem_available (long min_bytes_needed, long max_bytes_needed) -#else -jmem_available (min_bytes_needed, max_bytes_needed) - long min_bytes_needed; - long max_bytes_needed; -#endif /* NeedFunctionPrototypes */ -#else -jmem_available (long min_bytes_needed, long max_bytes_needed) -#endif /* XIE_SUPPORTED */ -{ - return max_bytes_needed; -} - - -/* - * Backing store (temporary file) management. - * This should never be called and we just error out. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jopen_backing_store (backing_store_ptr info, long total_bytes_needed) -#else -jopen_backing_store (info, total_bytes_needed) - backing_store_ptr info; - long total_bytes_needed; -#endif /* NeedFunctionPrototypes */ -#else -jopen_backing_store (backing_store_ptr info, long total_bytes_needed) -#endif /* XIE_SUPPORTED */ -{ - ERREXIT(methods, "Backing store not supported"); -} -#endif /* XIE_SUPPORTED */ - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. Keep in mind that jmem_term may be called more than - * once. - */ - -#ifndef XIE_SUPPORTED -GLOBAL void -jmem_init (external_methods_ptr emethods) -{ - methods = emethods; /* save struct addr for error exit access */ - emethods->max_memory_to_use = 0; -} -#endif /* XIE_SUPPORTED */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jmem_term (void) -#else -jmem_term () -#endif /* NeedFunctionPrototypes */ -#else -jmem_term (void) -#endif /* XIE_SUPPORTED */ -{ - /* no work */ -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.h diff -u xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.h:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.h:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.h:1.2 Fri Dec 14 14:58:39 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jmemsys.h Sat Feb 28 21:42:00 2004 @@ -1,202 +0,0 @@ -/* $Xorg: jmemsys.h,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jmemsys.h */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jmemsys.h - * - * Copyright (C) 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file defines the interface between the system-independent - * and system-dependent portions of the JPEG memory manager. (The system- - * independent portion is jmemmgr.c; there are several different versions - * of the system-dependent portion, and of this file for that matter.) - * - * This is a "generic" skeleton that may need to be modified for particular - * systems. It should be usable as-is on the majority of non-MSDOS machines. - */ - - -/* - * These two functions are used to allocate and release small chunks of - * memory (typically the total amount requested through jget_small is - * no more than 20Kb or so). Behavior should be the same as for the - * standard library functions malloc and free; in particular, jget_small - * returns NULL on failure. On most systems, these ARE malloc and free. - * On an 80x86 machine using small-data memory model, these manage near heap. - */ - -EXTERN pointer jget_small PP((size_t sizeofobject)); -EXTERN void jfree_small PP((pointer object)); - -/* - * These two functions are used to allocate and release large chunks of - * memory (up to the total free space designated by jmem_available). - * The interface is the same as above, except that on an 80x86 machine, - * far pointers are used. On other systems these ARE the same as above. - */ - -#ifdef NEED_FAR_POINTERS /* typically not needed except on 80x86 */ -EXTERN pointer jget_large PP((size_t sizeofobject)); -EXTERN void jfree_large PP((pointer object)); -#else -#define jget_large(sizeofobject) jget_small(sizeofobject) -#define jfree_large(object) jfree_small(object) -#endif - -/* - * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may - * be requested in a single call on jget_large (and jget_small for that - * matter, but that case should never come into play). This macro is needed - * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. - * On machines with flat address spaces, any large constant may be used here. - */ - -#define MAX_ALLOC_CHUNK 1000000000L - -/* - * This routine computes the total space available for allocation by - * jget_large. If more space than this is needed, backing store will be used. - * NOTE: any memory already allocated must not be counted. - * - * There is a minimum space requirement, corresponding to the minimum - * feasible buffer sizes; jmemmgr.c will request that much space even if - * jmem_available returns zero. The maximum space needed, enough to hold - * all working storage in memory, is also passed in case it is useful. - * - * It is OK for jmem_available to underestimate the space available (that'll - * just lead to more backing-store access than is really necessary). - * However, an overestimate will lead to failure. Hence it's wise to subtract - * a slop factor from the true available space, especially if jget_small space - * comes from the same pool. 5% should be enough. - * - * On machines with lots of virtual memory, any large constant may be returned. - * Conversely, zero may be returned to always use the minimum amount of memory. - */ - -EXTERN long jmem_available PP((long min_bytes_needed, long max_bytes_needed)); - - -/* - * This structure holds whatever state is needed to access a single - * backing-store object. The read/write/close method pointers are called - * by jmemmgr.c to manipulate the backing-store object; all other fields - * are private to the system-dependent backing store routines. - */ - -#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ - -typedef struct backing_store_struct * backing_store_ptr; - -typedef struct backing_store_struct { - /* Methods for reading/writing/closing this backing-store object */ - METHOD(void, read_backing_store, (backing_store_ptr info, - pointer buffer_address, - long file_offset, long byte_count)); - METHOD(void, write_backing_store, (backing_store_ptr info, - pointer buffer_address, - long file_offset, long byte_count)); - METHOD(void, close_backing_store, (backing_store_ptr info)); - /* Private fields for system-dependent backing-store management */ - /* For a typical implementation with temp files, we might need: */ -#ifndef XIE_SUPPORTED - FILE * temp_file; /* stdio reference to temp file */ -#endif /* XIE_SUPPORTED */ - char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ - } backing_store_info; - -/* - * Initial opening of a backing-store object. This must fill in the - * read/write/close pointers in the object. The read/write routines - * may take an error exit if the specified maximum file size is exceeded. - * (If jmem_available always returns a large value, this routine can just - * take an error exit.) - */ - -EXTERN void jopen_backing_store PP((backing_store_ptr info, - long total_bytes_needed)); - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. The system methods struct address should be saved - * by jmem_init in case an error exit must be taken. jmem_term may assume - * that all requested memory has been freed and that all opened backing- - * store objects have been closed. - * NB: jmem_term may be called more than once, and must behave reasonably - * if that happens. - */ - -EXTERN void jmem_init PP((external_methods_ptr emethods)); -EXTERN void jmem_term PP((void)); Index: xc/programs/Xserver/XIE/mixie/jpeg/jpegdata.h diff -u xc/programs/Xserver/XIE/mixie/jpeg/jpegdata.h:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jpegdata.h:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jpegdata.h:1.2 Fri Dec 14 14:58:40 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jpegdata.h Sat Feb 28 21:42:00 2004 @@ -1,1287 +0,0 @@ -/* $Xorg: jpegdata.h,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/* Module jpegdata.h */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - -****************************************************************************/ - -/* - * jpegdata.h - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines shared data structures for the various JPEG modules. - */ - -/* - * You might need to change some of the following declarations if you are - * using the JPEG software within a surrounding application program - * or porting it to an unusual system. - */ - - -/* If the source or destination of image data is not to be stdio streams, - * these types may need work. You can replace them with some kind of - * pointer or indicator that is useful to you, or just ignore 'em. - * Note that the user interface and the various jrdxxx/jwrxxx modules - * will also need work for non-stdio input/output. - */ - -#ifndef XIE_SUPPORTED -typedef FILE * JFILEREF; /* source or dest of JPEG-compressed data */ - -typedef FILE * IFILEREF; /* source or dest of non-JPEG image data */ -#endif /* XIE_SUPPORTED */ - - -/* These defines are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions, - * as is shown below for use with C++. Another application would be to make - * all functions global for use with code profilers that require it. - * NOTE: the C++ test does the right thing if you are reading this include - * file in a C++ application to link to JPEG code that's been compiled with a - * regular C compiler. I'm not sure it works if you try to compile the JPEG - * code with C++. - */ - -#define METHODDEF static /* a function called through method pointers */ -#define LOCAL static /* a function used only in its module */ -#define GLOBAL /* a function referenced thru EXTERNs */ -#ifdef __cplusplus -#define EXTERN extern "C" /* a reference to a GLOBAL function */ -#else -#define EXTERN extern /* a reference to a GLOBAL function */ -#endif - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#define FAR -#endif - - - -/* The remaining declarations are not system-dependent, we hope. */ - - -/* - * NOTE: if you have an ancient, strict-K&R C compiler, it may choke on the - * similarly-named fields in Compress_info_struct and Decompress_info_struct. - * If this happens, you can get around it by rearranging the two structs so - * that the similarly-named fields appear first and in the same order in - * each struct. Since such compilers are now pretty rare, we haven't done - * this in the portable code, preferring to maintain a logical ordering. - */ - - - -/* This macro is used to declare a "method", that is, a function pointer. */ -/* We want to supply prototype parameters if the compiler can cope. */ -/* Note that the arglist parameter must be parenthesized! */ - -#ifdef PROTO -#define METHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define METHOD(type,methodname,arglist) type (*methodname) () -#endif - -/* Forward references to lists of method pointers */ -typedef struct External_methods_struct * external_methods_ptr; -typedef struct Compress_methods_struct * compress_methods_ptr; -typedef struct Decompress_methods_struct * decompress_methods_ptr; - - -/* Data structures for images containing either samples or coefficients. */ -/* Note that the topmost (leftmost) index is always color component. */ -/* On 80x86 machines, the image arrays are too big for near pointers, */ -/* but the pointer arrays can fit in near memory. */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* The input and output data of the DCT transform subroutines are of - * the following type, which need not be the same as JCOEF. - * For example, on a machine with fast floating point, it might make sense - * to recode the DCT routines to use floating point; then DCTELEM would be - * 'float' or 'double'. - */ - -typedef JCOEF DCTELEM; -typedef DCTELEM DCTBLOCK[DCTSIZE2]; - - -/* Types for JPEG compression parameters and working tables. */ - - -typedef enum { /* defines known color spaces */ - CS_UNKNOWN, /* error/unspecified */ - CS_GRAYSCALE, /* monochrome (only 1 component) */ - CS_RGB, /* red/green/blue */ - CS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - CS_YIQ, /* Y/I/Q */ - CS_CMYK /* C/M/Y/K */ -} COLOR_SPACE; - - -typedef struct { /* Basic info about one component */ - /* These values are fixed over the whole image */ - /* For compression, they must be supplied by the user interface; */ - /* for decompression, they are read from the SOF marker. */ - short component_id; /* identifier for this component (0..255) */ - short component_index; /* its index in SOF or cinfo->comp_info[] */ - short h_samp_factor; /* horizontal sampling factor (1..4) */ - short v_samp_factor; /* vertical sampling factor (1..4) */ - short quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans */ - /* For compression, they must be supplied by the user interface; */ - /* for decompression, they are read from the SOS marker. */ - short dc_tbl_no; /* DC entropy table selector (0..3) */ - short ac_tbl_no; /* AC entropy table selector (0..3) */ - /* These values are computed during compression or decompression startup */ - long true_comp_width; /* component's image width in samples */ - long true_comp_height; /* component's image height in samples */ - /* the above are the logical dimensions of the downsampled image */ - /* These values are computed before starting a scan of the component */ - short MCU_width; /* number of blocks per MCU, horizontally */ - short MCU_height; /* number of blocks per MCU, vertically */ - short MCU_blocks; /* MCU_width * MCU_height */ - long downsampled_width; /* image width in samples, after expansion */ - long downsampled_height; /* image height in samples, after expansion */ - /* the above are the true_comp_xxx values rounded up to multiples of */ - /* the MCU dimensions; these are the working dimensions of the array */ - /* as it is passed through the DCT or IDCT step. NOTE: these values */ - /* differ depending on whether the component is interleaved or not!! */ -} jpeg_component_info; - - -/* DCT coefficient quantization tables. - * For 8-bit precision, 'INT16' should be good enough for quantization values; - * for more precision, we go for the full 16 bits. 'INT16' provides a useful - * speedup on many machines (multiplication & division of JCOEFs by - * quantization values is a significant chunk of the runtime). - * Note: the values in a QUANT_TBL are always given in zigzag order. - */ -#ifdef EIGHT_BIT_SAMPLES -typedef INT16 QUANT_VAL; /* element of a quantization table */ -#else -typedef UINT16 QUANT_VAL; /* element of a quantization table */ -#endif -typedef QUANT_VAL QUANT_TBL[DCTSIZE2]; /* A quantization table */ -typedef QUANT_VAL * QUANT_TBL_PTR; /* pointer to same */ - - -typedef struct { /* A Huffman coding table */ - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - */ - boolean sent_table; /* TRUE when table has been output */ - /* The remaining fields are computed from the above to allow more efficient - * coding and decoding. These fields should be considered private to the - * Huffman compression & decompression modules. - */ - /* encoding tables: */ - UINT16 ehufco[256]; /* code for each symbol */ - char ehufsi[256]; /* length of code for each symbol */ - /* decoding tables: (element [0] of each array is unused) */ - UINT16 mincode[17]; /* smallest code of length k */ - INT32 maxcode[18]; /* largest code of length k (-1 if none) */ - /* (maxcode[17] is a sentinel to ensure huff_DECODE terminates) */ - short valptr[17]; /* huffval[] index of 1st symbol of length k */ -} HUFF_TBL; - - -#define NUM_QUANT_TBLS 4 /* quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -#define MAX_BLOCKS_IN_MCU 10 /* JPEG limit on # of blocks in an MCU */ - -#ifdef XIE_SUPPORTED -/* Types and Structures from jmemmgr.c */ -/* (used in Compress_info_struct and Decompress_info_struct */ -typedef double align_type; - -typedef union small_struct * small_ptr; - -typedef union small_struct { - small_ptr next; /* next in list of allocated objects */ - align_type dummy; /* ensures alignment of following storage */ - } small_hdr; - -typedef struct small_sarray_struct * small_sarray_ptr; - -typedef struct small_sarray_struct { - small_sarray_ptr next; /* next in list of allocated sarrays */ - long numrows; /* # of rows in this array */ - long rowsperchunk; /* max # of rows per allocation chunk */ - JSAMPROW dummy; /* ensures alignment of following storage */ - } small_sarray_hdr; - -typedef struct small_barray_struct * small_barray_ptr; - -typedef struct small_barray_struct { - small_barray_ptr next; /* next in list of allocated barrays */ - long numrows; /* # of rows in this array */ - long rowsperchunk; /* max # of rows per allocation chunk */ - JBLOCKROW dummy; /* ensures alignment of following storage */ - } small_barray_hdr; - -#endif /* XIE_SUPPORTED */ - - -/* Working data for compression */ - -struct Compress_info_struct { -/* - * All of these fields shall be established by the user interface before - * calling jpeg_compress, or by the input_init or c_ui_method_selection - * methods. - * Most parameters can be set to reasonable defaults by j_c_defaults. - * Note that the UI must supply the storage for the main methods struct, - * though it sets only a few of the methods there. - */ - compress_methods_ptr methods; /* Points to list of methods to use */ - - external_methods_ptr emethods; /* Points to list of methods to use */ - -#ifndef XIE_SUPPORTED - IFILEREF input_file; /* tells input routines where to read image */ - JFILEREF output_file; /* tells output routines where to write JPEG */ -#endif /* XIE_SUPPORTED */ - - long image_width; /* input image width */ - long image_height; /* input image height */ - short input_components; /* # of color components in input image */ - - short data_precision; /* bits of precision in image data */ - - COLOR_SPACE in_color_space; /* colorspace of input file */ - COLOR_SPACE jpeg_color_space; /* colorspace of JPEG file */ - - double input_gamma; /* image gamma of input file */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - /* These three values are not used by the JPEG code, only copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - - short num_components; /* # of color components in JPEG image */ - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - QUANT_TBL_PTR quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - HUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - HUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arithmetic-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arithmetic-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arithmetic-coding tables */ - - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean interleave; /* TRUE=interleaved output, FALSE=not */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - UINT16 restart_interval;/* MCUs per restart interval, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - -/* - * These fields are computed during jpeg_compress startup - */ - short max_h_samp_factor; /* largest h_samp_factor */ - short max_v_samp_factor; /* largest v_samp_factor */ - -/* - * These fields may be useful for progress monitoring - */ - - int total_passes; /* number of passes expected */ - int completed_passes; /* number of passes completed so far */ - -/* - * These fields are valid during any one scan - */ - short comps_in_scan; /* # of JPEG components output this time */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - long MCUs_per_row; /* # of MCUs across the image */ - long MCU_rows_in_scan; /* # of MCU rows in the image */ - - short blocks_in_MCU; /* # of DCT blocks per MCU */ - short MCU_membership[MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - /* these fields are private data for the entropy encoder */ - JCOEF last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each comp */ - JCOEF last_dc_diff[MAX_COMPS_IN_SCAN]; /* last DC diff for each comp */ - UINT16 restarts_to_go; /* MCUs left in this restart interval */ - short next_restart_num; /* # of next RSTn marker (0..7) */ - -#ifdef XIE_SUPPORTED - long jpeg_buf_size; /* put is structure from global define */ - short xie_h_samp_factor[MAX_COMPS_IN_SCAN]; /* for XIE interface */ - short xie_v_samp_factor[MAX_COMPS_IN_SCAN]; /* for XIE interface */ - /* The variables come from jcpipe.c - single_ccontroller */ - int rows_in_mem; /* # of sample rows in full-size buffers */ - long fullsize_width; /* # of samples per row in full-size buffers */ - long cur_pixel_row; /* counts # of pixel rows processed */ - long mcu_rows_output; /* # of MCU rows actually emitted */ - int mcu_rows_per_loop; /* # of MCU rows processed per outer loop */ - /* Work buffer for pre-downsampling data (see comments at head of file) */ - JSAMPIMAGE fullsize_data[2]; - /* Work buffer for downsampled data */ - JSAMPIMAGE sampled_data; - int rows_this_time; - short whichss; - boolean first_pixel_row; - /* from jchuff.c */ - INT32 huff_put_buffer; /* current bit-accumulation buffer */ - int huff_put_bits; /* # of bits now in it */ - char * output_buffer; /* output buffer */ - int bytes_in_buffer; - /* XIE - JPEG buffer */ - int XIEwrloc; - int XIErestart; - int XIEmcurow; - long XIEmcuindex; - int XIEbytes_in_buffer; - /* from jmemmgr.c */ - small_ptr small_list; /* head of list */ - small_sarray_ptr small_sarray_list; /* head of list */ - small_barray_ptr small_barray_list; /* head of list */ -#endif /* XIE_SUPPORTED */ - -}; - -typedef struct Compress_info_struct * compress_info_ptr; - -#ifdef XIE_SUPPORTED - -/* Types for XIE restart. */ - - -typedef enum { /* defines XIE restart locations */ - XIE_RNUL, /* No restart */ - XIE_RRFH, /* Restart at Read File Header */ - XIE_RRSH, /* Restart at Read Scan Header */ - XIE_RMCU, /* Restart at MCU */ - XIE_RWRJ, /* Restart at write jfif */ - XIE_RWFH, /* Restart at Write File Header */ - XIE_RWSH, /* Restart at Write Scan Header */ - XIE_RWFT /* Restart at Write File Trailer */ - } XIE_RESTART; - -/* Types for XIE return. */ - -typedef enum { /* defines XIE restart locations */ - XIE_ERR = -999, /* Error return */ - XIE_NRML = 0, /* Normal return */ - XIE_INP = 1, /* Need input */ - XIE_OUT = 2, /* Output ready */ - XIE_EOI = 3 /* End of input */ -} XIE_RETURN; - -#endif - - -/* Working data for decompression */ - -struct Decompress_info_struct { -/* - * These fields shall be established by the user interface before - * calling jpeg_decompress. - * Most parameters can be set to reasonable defaults by j_d_defaults. - * Note that the UI must supply the storage for the main methods struct, - * though it sets only a few of the methods there. - */ - decompress_methods_ptr methods; /* Points to list of methods to use */ - - external_methods_ptr emethods; /* Points to list of methods to use */ - -#ifndef XIE_SUPPORTED - JFILEREF input_file; /* tells input routines where to read JPEG */ - IFILEREF output_file; /* tells output routines where to write image */ -#endif /* XIE_SUPPORTED */ - - /* these can be set at d_ui_method_selection time: */ - - COLOR_SPACE out_color_space; /* colorspace of output */ - - double output_gamma; /* image gamma wanted in output */ - - boolean quantize_colors; /* T if output is a colormapped format */ - /* the following are ignored if not quantize_colors: */ - boolean two_pass_quantize; /* use two-pass color quantization? */ - boolean use_dithering; /* want color dithering? */ - int desired_number_of_colors; /* max number of colors to use */ - - boolean do_block_smoothing; /* T = apply cross-block smoothing */ - boolean do_pixel_smoothing; /* T = apply post-upsampling smoothing */ - -/* - * These fields are used for efficient buffering of data between read_jpeg_data - * and the entropy decoding object. By using a shared buffer, we avoid copying - * data and eliminate the need for an "unget" operation at the end of a scan. - * The actual source of the data is known only to read_jpeg_data; see the - * JGETC macro, below. - * Note: the user interface is expected to allocate the input_buffer and - * initialize bytes_in_buffer to 0. Also, for JFIF/raw-JPEG input, the UI - * actually supplies the read_jpeg_data method. This is all handled by - * j_d_defaults in a typical implementation. - */ - char * input_buffer; /* start of buffer (private to input code) */ - char * next_input_byte; /* => next byte to read from buffer */ - int bytes_in_buffer; /* # of bytes remaining in buffer */ - -/* - * These fields are set by read_file_header or read_scan_header - */ - long image_width; /* overall image width */ - long image_height; /* overall image height */ - - short data_precision; /* bits of precision in image data */ - - COLOR_SPACE jpeg_color_space; /* colorspace of JPEG file */ - - /* These three values are not used by the JPEG code, merely copied */ - /* from the JFIF APP0 marker (if any). */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - - short num_components; /* # of color components in JPEG image */ - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - QUANT_TBL_PTR quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - HUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - HUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - UINT16 restart_interval;/* MCUs per restart interval, or 0 for no restart */ - -/* - * These fields are computed during jpeg_decompress startup - */ - short max_h_samp_factor; /* largest h_samp_factor */ - short max_v_samp_factor; /* largest v_samp_factor */ - - short color_out_comps; /* # of color components output by color_convert */ - /* (need not match num_components) */ - short final_out_comps; /* # of color components sent to put_pixel_rows */ - /* (1 when quantizing colors, else same as color_out_comps) */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - -/* - * When quantizing colors, the color quantizer leaves a pointer to the output - * colormap in these fields. The colormap is valid from the time put_color_map - * is called (must be before any put_pixel_rows calls) until shutdown (more - * specifically, until free_all is called to release memory). - */ - int actual_number_of_colors; /* actual number of entries */ - JSAMPARRAY colormap; /* NULL if not valid */ - /* map has color_out_comps rows * actual_number_of_colors columns */ - -/* - * These fields may be useful for progress monitoring - */ - int total_passes; /* number of passes expected */ - int completed_passes; /* number of passes completed so far */ - -/* - * These fields are valid during any one scan - */ - short comps_in_scan; /* # of JPEG components input this time */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - long MCUs_per_row; /* # of MCUs across the image */ - long MCU_rows_in_scan; /* # of MCU rows in the image */ - - short blocks_in_MCU; /* # of DCT blocks per MCU */ - short MCU_membership[MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - /* these fields are private data for the entropy encoder */ - JCOEF last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each comp */ - JCOEF last_dc_diff[MAX_COMPS_IN_SCAN]; /* last DC diff for each comp */ - UINT16 restarts_to_go; /* MCUs left in this restart interval */ - short next_restart_num; /* # of next RSTn marker (0..7) */ - -#ifdef XIE_SUPPORTED - boolean XIE_upsample; /* TRUE if upsampling is desired */ - long jpeg_buf_size; /* put is structure from global define */ - int rows_in_mem; /* # of sample rows in full-size buffers */ - /* Work buffer for data being passed to output module. */ - /* This has color_out_comps components if not quantizing, */ - /* but only one component when quantizing. */ - JSAMPIMAGE output_workspace; - long fullsize_width; /* # of samples per row in full-size buffers */ - long pixel_rows_output; /* # of pixel rows actually emitted */ - int mcu_rows_per_loop; /* # of MCU rows processed per outer loop */ - /* Work buffer for dequantized coefficients (IDCT input) */ - JBLOCKIMAGE coeff_data; - /* Work buffer for cross-block smoothing input */ -#ifdef BLOCK_SMOOTHING_SUPPORTED - JBLOCKIMAGE bsmooth[3]; /* this is optional */ - int whichb; -#endif - /* Work buffer for downsampled image data (see comments at head of file) */ - JSAMPIMAGE sampled_data[2]; - /* Work buffer for upsampled data */ - JSAMPIMAGE fullsize_data; - int whichss; - long cur_mcu_row; /* counts # of MCU rows processed */ - int ri; - boolean first_mcu_row; - /* used in jdmcu and jrdjfif */ - int XIErestart; - char * XIEnext_input_byte; /* => next byte to read from buffer */ - int XIEbytes_in_buffer; /* # of bytes remaining in buffer */ - /* used in jdmcu */ - long XIEmcuindex; - JBLOCKROW MCU_data[MAX_BLOCKS_IN_MCU]; - /* used in jdhuff */ - INT32 XIEget_buffer; /* current bit-extraction buffer */ - int XIEbits_left; /* # of unused bits in it */ - boolean printed_eod; /* flag to suppress multiple end-of-data msgs */ - /* from jmemmgr.c */ - small_ptr small_list; /* head of list */ - small_sarray_ptr small_sarray_list; /* head of list */ - small_barray_ptr small_barray_list; /* head of list */ -#endif /* XIE_SUPPORTED */ - -}; - -typedef struct Decompress_info_struct * decompress_info_ptr; - - -/* Macros for reading data from the decompression input buffer */ - -#ifdef XIE_SUPPORTED -#ifdef CHAR_IS_UNSIGNED -#define JGETC(cinfo) ( --(cinfo)->bytes_in_buffer < 0 ? \ - -1 : (int) (*(cinfo)->next_input_byte++) ) -#else -#define JGETC(cinfo) ( --(cinfo)->bytes_in_buffer < 0 ? \ - -1 : (int) (*(cinfo)->next_input_byte++) & 0xFF ) -#endif -#else -#ifdef CHAR_IS_UNSIGNED -#define JGETC(cinfo) ( --(cinfo)->bytes_in_buffer < 0 ? \ - (*(cinfo)->methods->read_jpeg_data) (cinfo) : \ - (int) (*(cinfo)->next_input_byte++) ) -#else -#define JGETC(cinfo) ( --(cinfo)->bytes_in_buffer < 0 ? \ - (*(cinfo)->methods->read_jpeg_data) (cinfo) : \ - (int) (*(cinfo)->next_input_byte++) & 0xFF ) -#endif -#endif /* XIE_SUPPORTED */ - -#define JUNGETC(ch,cinfo) ((cinfo)->bytes_in_buffer++, \ - *(--((cinfo)->next_input_byte)) = (char) (ch)) - -#define MIN_UNGET 4 /* may always do at least 4 JUNGETCs */ - - -/* A virtual image has a control block whose contents are private to the - * memory manager module (and may differ between managers). The rest of the - * code only refers to virtual images by these pointer types, and never - * dereferences the pointer. - */ - -typedef struct big_sarray_control * big_sarray_ptr; -typedef struct big_barray_control * big_barray_ptr; - -/* Although a real ANSI C compiler can deal perfectly well with pointers to - * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI - * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, - * add -DINCOMPLETE_TYPES_BROKEN to CFLAGS in your Makefile. Then we will - * pseudo-define the structs as containing a single "dummy" field. - * The memory managers #define AM_MEMORY_MANAGER before including this file, - * so that they can make their own definitions of the structs. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef AM_MEMORY_MANAGER -struct big_sarray_control { long dummy; }; -struct big_barray_control { long dummy; }; -#endif -#endif - - -/* Method types that need typedefs */ - -#ifdef XIE_SUPPORTED -typedef METHOD(int, MCU_output_method_ptr, (compress_info_ptr cinfo, - JBLOCK *MCU_data)); -#else -typedef METHOD(void, MCU_output_method_ptr, (compress_info_ptr cinfo, - JBLOCK *MCU_data)); -#endif /* XIE_SUPPORTED */ -typedef METHOD(void, MCU_output_caller_ptr, (compress_info_ptr cinfo, - MCU_output_method_ptr output_method)); -typedef METHOD(void, downsample_ptr, (compress_info_ptr cinfo, - int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, - JSAMPARRAY input_data, - JSAMPARRAY below, - JSAMPARRAY output_data)); -typedef METHOD(void, upsample_ptr, (decompress_info_ptr cinfo, - int which_component, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPARRAY above, - JSAMPARRAY input_data, - JSAMPARRAY below, - JSAMPARRAY output_data)); -typedef METHOD(void, quantize_method_ptr, (decompress_info_ptr cinfo, - int num_rows, - JSAMPIMAGE input_data, - JSAMPARRAY output_workspace)); -typedef METHOD(void, quantize_caller_ptr, (decompress_info_ptr cinfo, - quantize_method_ptr quantize_method)); - - -/* These structs contain function pointers for the various JPEG methods. */ - -/* Routines to be provided by the surrounding application, rather than the - * portable JPEG code proper. These are the same for compression and - * decompression. - */ - -struct External_methods_struct { - /* User interface: error exit and trace message routines */ - /* NOTE: the string msgtext parameters will eventually be replaced - * by an enumerated-type code so that non-English error messages - * can be substituted easily. This will not be done until all the - * code is in place, so that we know what messages are needed. - */ - METHOD(void, error_exit, (const char *msgtext)); - METHOD(void, trace_message, (const char *msgtext)); - - /* Working data for error/trace facility */ - /* See macros below for the usage of these variables */ - int trace_level; /* level of detail of tracing messages */ - /* Use level 0 for important warning messages (nonfatal errors) */ - /* Use levels 1, 2, 3 for successively more detailed trace options */ - - /* For recoverable corrupt-data errors, we emit a warning message and - * keep going. A surrounding application can check for bad data by - * seeing if num_warnings is nonzero at the end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - int first_warning_level; /* trace level for first warning */ - int more_warning_level; /* trace level for subsequent warnings */ - - int message_parm[8]; /* store numeric parms for messages here */ - - /* Memory management */ - /* NB: alloc routines never return NULL. They exit to */ - /* error_exit if not successful. */ -#ifdef XIE_SUPPORTED - METHOD(pointer, c_alloc_small, (compress_info_ptr cinfo, - size_t sizeofobject)); - METHOD(int, c_free_small, (compress_info_ptr cinfo, pointer ptr)); - METHOD(pointer, d_alloc_small, (decompress_info_ptr cinfo, - size_t sizeofobject)); - METHOD(int, d_free_small, (decompress_info_ptr cinfo, pointer ptr)); -#else - METHOD(pointer, alloc_small, (size_t sizeofobject)); - METHOD(void, free_small, (pointer ptr)); -#endif /* XIE_SUPPORTED */ - METHOD(pointer, alloc_medium, (size_t sizeofobject)); - METHOD(void, free_medium, (pointer ptr)); -#ifdef XIE_SUPPORTED - METHOD(JSAMPARRAY, c_alloc_small_sarray, (compress_info_ptr cinfo, - long samplesperrow, long numrows)); - METHOD(int, c_free_small_sarray, (compress_info_ptr cinfo, - JSAMPARRAY ptr)); - METHOD(JSAMPARRAY, d_alloc_small_sarray, (decompress_info_ptr cinfo, - long samplesperrow, long numrows)); - METHOD(int, d_free_small_sarray, (decompress_info_ptr cinfo, - JSAMPARRAY ptr)); -#else - METHOD(JSAMPARRAY, alloc_small_sarray, (long samplesperrow, - long numrows)); - METHOD(void, free_small_sarray, (JSAMPARRAY ptr)); -#endif /* XIE_SUPPORTED */ -#ifdef XIE_SUPPORTED - METHOD(JBLOCKARRAY, c_alloc_small_barray, (compress_info_ptr cinfo, - long blocksperrow, long numrows)); - METHOD(int, c_free_small_barray, (compress_info_ptr cinfo, - JBLOCKARRAY ptr)); - METHOD(JBLOCKARRAY, d_alloc_small_barray, (decompress_info_ptr cinfo, - long blocksperrow, long numrows)); - METHOD(int, d_free_small_barray, (decompress_info_ptr cinfo, - JBLOCKARRAY ptr)); -#else - METHOD(JBLOCKARRAY, alloc_small_barray, (long blocksperrow, - long numrows)); - METHOD(void, free_small_barray, (JBLOCKARRAY ptr)); -#endif /* XIE_SUPPORTED */ - METHOD(big_sarray_ptr, request_big_sarray, (long samplesperrow, - long numrows, - long unitheight)); - METHOD(big_barray_ptr, request_big_barray, (long blocksperrow, - long numrows, - long unitheight)); - METHOD(void, alloc_big_arrays, (long extra_small_samples, - long extra_small_blocks, - long extra_medium_space)); - METHOD(JSAMPARRAY, access_big_sarray, (big_sarray_ptr ptr, - long start_row, - boolean writable)); - METHOD(JBLOCKARRAY, access_big_barray, (big_barray_ptr ptr, - long start_row, - boolean writable)); - METHOD(void, free_big_sarray, (big_sarray_ptr ptr)); - METHOD(void, free_big_barray, (big_barray_ptr ptr)); -#ifdef XIE_SUPPORTED - METHOD(int, c_free_all, (compress_info_ptr cinfo)); - METHOD(int, d_free_all, (decompress_info_ptr cinfo)); -#else - METHOD(void, free_all, (void)); -#endif /* XIE_SUPPORTED */ - - long max_memory_to_use; /* maximum amount of memory to use */ -}; - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is generally cinfo->emethods */ - -/* Fatal errors (print message and exit) */ -#ifndef XIE_SUPPORTED -#define ERREXIT(emeth,msg) ((*(emeth)->error_exit) (msg)) -#define ERREXIT1(emeth,msg,p1) ((emeth)->message_parm[0] = (p1), \ - (*(emeth)->error_exit) (msg)) -#define ERREXIT2(emeth,msg,p1,p2) ((emeth)->message_parm[0] = (p1), \ - (emeth)->message_parm[1] = (p2), \ - (*(emeth)->error_exit) (msg)) -#define ERREXIT3(emeth,msg,p1,p2,p3) ((emeth)->message_parm[0] = (p1), \ - (emeth)->message_parm[1] = (p2), \ - (emeth)->message_parm[2] = (p3), \ - (*(emeth)->error_exit) (msg)) -#define ERREXIT4(emeth,msg,p1,p2,p3,p4) ((emeth)->message_parm[0] = (p1), \ - (emeth)->message_parm[1] = (p2), \ - (emeth)->message_parm[2] = (p3), \ - (emeth)->message_parm[3] = (p4), \ - (*(emeth)->error_exit) (msg)) -#endif /* XIE_SUPPORTED */ - -#define MAKESTMT(stuff) do { stuff } while (0) - -#ifndef XIE_SUPPORTED -/* Nonfatal errors (we'll keep going, but the data is probably corrupt) */ -/* Note that warning count is incremented as a side-effect! */ -#define WARNMS(emeth,msg) \ - MAKESTMT( if ((emeth)->trace_level >= ((emeth)->num_warnings++ ? \ - (emeth)->more_warning_level : (emeth)->first_warning_level)){ \ - (*(emeth)->trace_message) (msg); } ) -#define WARNMS1(emeth,msg,p1) \ - MAKESTMT( if ((emeth)->trace_level >= ((emeth)->num_warnings++ ? \ - (emeth)->more_warning_level : (emeth)->first_warning_level)){ \ - (emeth)->message_parm[0] = (p1); \ - (*(emeth)->trace_message) (msg); } ) -#define WARNMS2(emeth,msg,p1,p2) \ - MAKESTMT( if ((emeth)->trace_level >= ((emeth)->num_warnings++ ? \ - (emeth)->more_warning_level : (emeth)->first_warning_level)){ \ - (emeth)->message_parm[0] = (p1); \ - (emeth)->message_parm[1] = (p2); \ - (*(emeth)->trace_message) (msg); } ) - -/* Informational/debugging messages */ -#define TRACEMS(emeth,lvl,msg) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - (*(emeth)->trace_message) (msg); } ) -#define TRACEMS1(emeth,lvl,msg,p1) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - (emeth)->message_parm[0] = (p1); \ - (*(emeth)->trace_message) (msg); } ) -#define TRACEMS2(emeth,lvl,msg,p1,p2) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - (emeth)->message_parm[0] = (p1); \ - (emeth)->message_parm[1] = (p2); \ - (*(emeth)->trace_message) (msg); } ) -#define TRACEMS3(emeth,lvl,msg,p1,p2,p3) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - int * _mp = (emeth)->message_parm; \ - *_mp++ = (p1); *_mp++ = (p2); *_mp = (p3); \ - (*(emeth)->trace_message) (msg); } ) -#define TRACEMS4(emeth,lvl,msg,p1,p2,p3,p4) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - int * _mp = (emeth)->message_parm; \ - *_mp++ = (p1); *_mp++ = (p2); *_mp++ = (p3); *_mp = (p4); \ - (*(emeth)->trace_message) (msg); } ) -#define TRACEMS8(emeth,lvl,msg,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT( if ((emeth)->trace_level >= (lvl)) { \ - int * _mp = (emeth)->message_parm; \ - *_mp++ = (p1); *_mp++ = (p2); *_mp++ = (p3); *_mp++ = (p4); \ - *_mp++ = (p5); *_mp++ = (p6); *_mp++ = (p7); *_mp = (p8); \ - (*(emeth)->trace_message) (msg); } ) -#endif /* XIE_SUPPORTED */ - - -/* Methods used during JPEG compression. */ - -struct Compress_methods_struct { - /* Hook for user interface to get control after input_init */ - METHOD(void, c_ui_method_selection, (compress_info_ptr cinfo)); - /* Hook for user interface to do progress monitoring */ - METHOD(void, progress_monitor, (compress_info_ptr cinfo, - long loopcounter, long looplimit)); - /* Input image reading & conversion to standard form */ -#ifdef XIE_SUPPORTED - METHOD(int, input_init, (compress_info_ptr cinfo)); - METHOD(int, get_input_row, (compress_info_ptr cinfo, - JSAMPARRAY pixel_row)); - METHOD(int, input_term, (compress_info_ptr cinfo)); -#else - METHOD(void, input_init, (compress_info_ptr cinfo)); - METHOD(void, get_input_row, (compress_info_ptr cinfo, - JSAMPARRAY pixel_row)); - METHOD(void, input_term, (compress_info_ptr cinfo)); -#endif /* XIE_SUPPORTED */ - /* Color space and gamma conversion */ - METHOD(void, colorin_init, (compress_info_ptr cinfo)); - METHOD(void, get_sample_rows, (compress_info_ptr cinfo, - int rows_to_read, - JSAMPIMAGE image_data)); - METHOD(void, colorin_term, (compress_info_ptr cinfo)); - /* Expand picture data at edges */ - METHOD(void, edge_expand, (compress_info_ptr cinfo, - long input_cols, int input_rows, - long output_cols, int output_rows, - JSAMPIMAGE image_data)); - /* Downsample pixel values of a single component */ - /* There can be a different downsample method for each component */ - METHOD(void, downsample_init, (compress_info_ptr cinfo)); - downsample_ptr downsample[MAX_COMPS_IN_SCAN]; - METHOD(void, downsample_term, (compress_info_ptr cinfo)); - /* Extract samples in MCU order, process & hand off to output_method */ - /* The input is always exactly N MCU rows worth of data */ - METHOD(void, extract_init, (compress_info_ptr cinfo)); -#ifdef XIE_SUPPORTED - METHOD(int, extract_MCUs, (compress_info_ptr cinfo, - JSAMPIMAGE image_data, - int num_mcu_rows, - MCU_output_method_ptr output_method)); -#else - METHOD(void, extract_MCUs, (compress_info_ptr cinfo, - JSAMPIMAGE image_data, - int num_mcu_rows, - MCU_output_method_ptr output_method)); -#endif /* XIE_SUPPORTED */ - METHOD(void, extract_term, (compress_info_ptr cinfo)); - /* Entropy encoding parameter optimization */ - METHOD(void, entropy_optimize, (compress_info_ptr cinfo, - MCU_output_caller_ptr source_method)); -#ifdef XIE_SUPPORTED - /* Entropy encoding */ - METHOD(int, entropy_encode_init, (compress_info_ptr cinfo)); - METHOD(int, entropy_encode, (compress_info_ptr cinfo, - JBLOCK *MCU_data)); - METHOD(int, entropy_encode_term, (compress_info_ptr cinfo)); - /* JPEG file header construction */ - METHOD(int, write_file_header, (compress_info_ptr cinfo)); - METHOD(int, write_scan_header, (compress_info_ptr cinfo)); - METHOD(void, write_jpeg_data, (compress_info_ptr cinfo, - char *dataptr, - int datacount)); - METHOD(void, write_scan_trailer, (compress_info_ptr cinfo)); - METHOD(int, write_file_trailer, (compress_info_ptr cinfo)); -#else - /* Entropy encoding */ - METHOD(void, entropy_encode_init, (compress_info_ptr cinfo)); - METHOD(void, entropy_encode, (compress_info_ptr cinfo, - JBLOCK *MCU_data)); - METHOD(void, entropy_encode_term, (compress_info_ptr cinfo)); - /* JPEG file header construction */ - METHOD(void, write_file_header, (compress_info_ptr cinfo)); - METHOD(void, write_scan_header, (compress_info_ptr cinfo)); - METHOD(void, write_jpeg_data, (compress_info_ptr cinfo, - char *dataptr, - int datacount)); - METHOD(void, write_scan_trailer, (compress_info_ptr cinfo)); - METHOD(void, write_file_trailer, (compress_info_ptr cinfo)); -#endif /* XIE_SUPPORTED */ - /* Pipeline control */ - METHOD(void, c_pipeline_controller, (compress_info_ptr cinfo)); - METHOD(void, entropy_output, (compress_info_ptr cinfo, - char *dataptr, - int datacount)); - /* Overall control */ - METHOD(void, c_per_scan_method_selection, (compress_info_ptr cinfo)); -}; - -/* Methods used during JPEG decompression. */ - -struct Decompress_methods_struct { - /* Hook for user interface to get control after reading file header */ - METHOD(void, d_ui_method_selection, (decompress_info_ptr cinfo)); - /* Hook for user interface to process comment blocks */ -#ifdef XIE_SUPPORTED - METHOD(int, process_comment, (decompress_info_ptr cinfo, - long comment_length)); -#else - METHOD(void, process_comment, (decompress_info_ptr cinfo, - long comment_length)); -#endif /* XIE_SUPPORTED */ - /* Hook for user interface to do progress monitoring */ - METHOD(void, progress_monitor, (decompress_info_ptr cinfo, - long loopcounter, long looplimit)); - /* JPEG file scanning */ -#ifdef XIE_SUPPORTED - METHOD(int, read_file_header, (decompress_info_ptr cinfo)); - METHOD(int, read_scan_header, (decompress_info_ptr cinfo)); - METHOD(int, read_jpeg_data, (decompress_info_ptr cinfo)); - METHOD(int, resync_to_restart, (decompress_info_ptr cinfo, - int marker)); -#else - METHOD(void, read_file_header, (decompress_info_ptr cinfo)); - METHOD(boolean, read_scan_header, (decompress_info_ptr cinfo)); - METHOD(int, read_jpeg_data, (decompress_info_ptr cinfo)); - METHOD(void, resync_to_restart, (decompress_info_ptr cinfo, - int marker)); -#endif /* XIE_SUPPORTED */ - METHOD(void, read_scan_trailer, (decompress_info_ptr cinfo)); - METHOD(void, read_file_trailer, (decompress_info_ptr cinfo)); - /* Entropy decoding */ -#ifdef XIE_SUPPORTED - METHOD(int, entropy_decode_init, (decompress_info_ptr cinfo)); - METHOD(int, entropy_decode, (decompress_info_ptr cinfo, - JBLOCKROW *MCU_data)); -#else - METHOD(void, entropy_decode_init, (decompress_info_ptr cinfo)); - METHOD(void, entropy_decode, (decompress_info_ptr cinfo, - JBLOCKROW *MCU_data)); -#endif /* XIE_SUPPORTED */ - METHOD(void, entropy_decode_term, (decompress_info_ptr cinfo)); - /* MCU disassembly: fetch MCUs from entropy_decode, build coef array */ - /* The reverse_DCT step is in the same module for symmetry reasons */ - METHOD(void, disassemble_init, (decompress_info_ptr cinfo)); -#ifdef XIE_SUPPORTED - METHOD(int, disassemble_MCU, (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data)); -#else - METHOD(void, disassemble_MCU, (decompress_info_ptr cinfo, - JBLOCKIMAGE image_data)); -#endif /* XIE_SUPPORTED */ - METHOD(void, reverse_DCT, (decompress_info_ptr cinfo, - JBLOCKIMAGE coeff_data, - JSAMPIMAGE output_data, int start_row)); - METHOD(void, disassemble_term, (decompress_info_ptr cinfo)); - /* Cross-block smoothing */ - METHOD(void, smooth_coefficients, (decompress_info_ptr cinfo, - jpeg_component_info *compptr, - JBLOCKROW above, - JBLOCKROW currow, - JBLOCKROW below, - JBLOCKROW output)); - /* Upsample pixel values of a single component */ - /* There can be a different upsample method for each component */ - METHOD(void, upsample_init, (decompress_info_ptr cinfo)); - upsample_ptr upsample[MAX_COMPS_IN_SCAN]; - METHOD(void, upsample_term, (decompress_info_ptr cinfo)); - /* Color space and gamma conversion */ - METHOD(void, colorout_init, (decompress_info_ptr cinfo)); - METHOD(void, color_convert, (decompress_info_ptr cinfo, - int num_rows, long num_cols, - JSAMPIMAGE input_data, - JSAMPIMAGE output_data)); - METHOD(void, colorout_term, (decompress_info_ptr cinfo)); - /* Color quantization */ - METHOD(void, color_quant_init, (decompress_info_ptr cinfo)); - METHOD(void, color_quantize, (decompress_info_ptr cinfo, - int num_rows, - JSAMPIMAGE input_data, - JSAMPARRAY output_data)); - METHOD(void, color_quant_prescan, (decompress_info_ptr cinfo, - int num_rows, - JSAMPIMAGE image_data, - JSAMPARRAY workspace)); - METHOD(void, color_quant_doit, (decompress_info_ptr cinfo, - quantize_caller_ptr source_method)); - METHOD(void, color_quant_term, (decompress_info_ptr cinfo)); - /* Output image writing */ -#ifdef XIE_SUPPORTED - METHOD(int, output_init, (decompress_info_ptr cinfo)); - METHOD(void, put_color_map, (decompress_info_ptr cinfo, - int num_colors, JSAMPARRAY colormap)); - METHOD(void, put_pixel_rows, (decompress_info_ptr cinfo, - int num_rows, - JSAMPIMAGE pixel_data)); - METHOD(int, output_term, (decompress_info_ptr cinfo)); -#else - METHOD(void, output_init, (decompress_info_ptr cinfo)); - METHOD(void, put_color_map, (decompress_info_ptr cinfo, - int num_colors, JSAMPARRAY colormap)); - METHOD(void, put_pixel_rows, (decompress_info_ptr cinfo, - int num_rows, - JSAMPIMAGE pixel_data)); - METHOD(void, output_term, (decompress_info_ptr cinfo)); -#endif /* XIE_SUPPORTED */ - /* Pipeline control */ - METHOD(void, d_pipeline_controller, (decompress_info_ptr cinfo)); - /* Overall control */ - METHOD(void, d_per_scan_method_selection, (decompress_info_ptr cinfo)); -}; - - -/* External declarations for routines that aren't called via method ptrs. */ -/* Note: use "j" as first char of names to minimize namespace pollution. */ -/* The PP macro hides prototype parameters from compilers that can't cope. */ - -#ifdef PROTO -#define PP(arglist) arglist -#else -#define PP(arglist) () -#endif - - -/* main entry for compression */ -EXTERN void jpeg_compress PP((compress_info_ptr cinfo)); - -/* default parameter setup for compression */ -#ifdef XIE_SUPPORTED -EXTERN int j_c_defaults PP((compress_info_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN void j_monochrome_default PP((compress_info_ptr cinfo)); -EXTERN int j_set_quality PP((compress_info_ptr cinfo, int quality, - boolean force_baseline)); -/* advanced compression parameter setup aids */ -EXTERN int j_add_quant_table PP((compress_info_ptr cinfo, int which_tbl, - const QUANT_VAL *basic_table, - int scale_factor, boolean force_baseline)); -#else -EXTERN void j_c_defaults PP((compress_info_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN void j_monochrome_default PP((compress_info_ptr cinfo)); -EXTERN void j_set_quality PP((compress_info_ptr cinfo, int quality, - boolean force_baseline)); -/* advanced compression parameter setup aids */ -EXTERN void j_add_quant_table PP((compress_info_ptr cinfo, int which_tbl, - const QUANT_VAL *basic_table, - int scale_factor, boolean force_baseline)); -#endif /* XIE_SUPPORTED */ -EXTERN int j_quality_scaling PP((int quality)); - -/* main entry for decompression */ -EXTERN void jpeg_decompress PP((decompress_info_ptr cinfo)); - -/* default parameter setup for decompression */ -EXTERN void j_d_defaults PP((decompress_info_ptr cinfo, - boolean standard_buffering)); - -/* forward DCT */ -EXTERN void j_fwd_dct PP((DCTBLOCK data)); -/* inverse DCT */ -EXTERN void j_rev_dct PP((DCTBLOCK data)); - -/* utility routines in jutils.c */ -EXTERN long jround_up PP((long a, long b)); -EXTERN void jcopy_sample_rows PP((JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, long num_cols)); -EXTERN void jcopy_block_row PP((JBLOCKROW input_row, JBLOCKROW output_row, - long num_blocks)); -EXTERN void jzero_far PP((pointer target, size_t bytestozero)); - -/* method selection routines for compression modules */ -EXTERN void jselcpipeline PP((compress_info_ptr cinfo)); /* jcpipe.c */ -EXTERN void jselchuffman PP((compress_info_ptr cinfo)); /* jchuff.c */ -EXTERN void jselcarithmetic PP((compress_info_ptr cinfo)); /* jcarith.c */ -EXTERN void jselexpand PP((compress_info_ptr cinfo)); /* jcexpand.c */ -EXTERN void jseldownsample PP((compress_info_ptr cinfo)); /* jcsample.c */ -EXTERN void jselcmcu PP((compress_info_ptr cinfo)); /* jcmcu.c */ -EXTERN void jselccolor PP((compress_info_ptr cinfo)); /* jccolor.c */ -/* The user interface should call one of these to select input format: */ -EXTERN void jselrgif PP((compress_info_ptr cinfo)); /* jrdgif.c */ -EXTERN void jselrppm PP((compress_info_ptr cinfo)); /* jrdppm.c */ -EXTERN void jselrrle PP((compress_info_ptr cinfo)); /* jrdrle.c */ -EXTERN void jselrtarga PP((compress_info_ptr cinfo)); /* jrdtarga.c */ -/* and one of these to select output header format: */ -EXTERN void jselwjfif PP((compress_info_ptr cinfo)); /* jwrjfif.c */ - -/* method selection routines for decompression modules */ -EXTERN void jseldpipeline PP((decompress_info_ptr cinfo)); /* jdpipe.c */ -EXTERN void jseldhuffman PP((decompress_info_ptr cinfo)); /* jdhuff.c */ -EXTERN void jseldarithmetic PP((decompress_info_ptr cinfo)); /* jdarith.c */ -EXTERN void jseldmcu PP((decompress_info_ptr cinfo)); /* jdmcu.c */ -EXTERN void jselbsmooth PP((decompress_info_ptr cinfo)); /* jbsmooth.c */ -EXTERN void jselupsample PP((decompress_info_ptr cinfo)); /* jdsample.c */ -EXTERN void jseldcolor PP((decompress_info_ptr cinfo)); /* jdcolor.c */ -EXTERN void jsel1quantize PP((decompress_info_ptr cinfo)); /* jquant1.c */ -EXTERN void jsel2quantize PP((decompress_info_ptr cinfo)); /* jquant2.c */ -/* The user interface should call one of these to select input format: */ -EXTERN void jselrjfif PP((decompress_info_ptr cinfo)); /* jrdjfif.c */ -/* and one of these to select output image format: */ -EXTERN void jselwgif PP((decompress_info_ptr cinfo)); /* jwrgif.c */ -EXTERN void jselwppm PP((decompress_info_ptr cinfo)); /* jwrppm.c */ -EXTERN void jselwrle PP((decompress_info_ptr cinfo)); /* jwrrle.c */ -EXTERN void jselwtarga PP((decompress_info_ptr cinfo)); /* jwrtarga.c */ - -/* method selection routines for system-dependent modules */ -EXTERN void jselerror PP((external_methods_ptr emethods)); /* jerror.c */ -#ifdef XIE_SUPPORTED -EXTERN void jcselmemmgr PP((compress_info_ptr cinfo, - external_methods_ptr emethods)); /* jmemmgr.c */ -EXTERN void jdselmemmgr PP((decompress_info_ptr cinfo, - external_methods_ptr emethods)); /* jmemmgr.c */ -#else -EXTERN void jselmemmgr PP((external_methods_ptr emethods)); /* jmemmgr.c */ -#endif /* XIE_SUPPORTED */ - - -/* We assume that right shift corresponds to signed division by 2 with - * rounding towards minus infinity. This is correct for typical "arithmetic - * shift" instructions that shift in copies of the sign bit. But some - * C compilers implement >> with an unsigned shift. For these machines you - * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. - * It is only applied with constant shift counts. SHIFT_TEMPS must be - * included in the variables of any routine using RIGHT_SHIFT. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS INT32 shift_temp; -#define RIGHT_SHIFT(x,shft) \ - ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ - (shift_temp >> (shft))) -#else -#define SHIFT_TEMPS -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - - -/* Miscellaneous useful macros */ - -#undef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#undef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - - -#define RST0 0xD0 /* RST0 marker code */ Index: xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c:1.5 Fri Dec 14 14:58:40 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c Sat Feb 28 21:42:00 2004 @@ -1,1623 +0,0 @@ -/* $Xorg: jrdjfif.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/* Module jrdjfif.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - -****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/jpeg/jrdjfif.c,v 1.5 2001/12/14 19:58:40 dawes Exp $ */ - -/* - * jrdjfif.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains routines to decode standard JPEG file headers/markers. - * This code will handle "raw JPEG" and JFIF-convention JPEG files. - * - * You can also use this module to decode a raw-JPEG or JFIF-standard data - * stream that is embedded within a larger file. To do that, you must - * position the file to the JPEG SOI marker (0xFF/0xD8) that begins the - * data sequence to be decoded. If nothing better is possible, you can scan - * the file until you see the SOI marker, then use JUNGETC to push it back. - * - * This module relies on the JGETC macro and the read_jpeg_data method (which - * is provided by the user interface) to read from the JPEG data stream. - * Therefore, this module is not dependent on any particular assumption about - * the data source; it need not be a stdio stream at all. (This fact does - * NOT carry over to more complex JPEG file formats such as JPEG-in-TIFF; - * those format control modules may well need to assume stdio input.) - * - * These routines are invoked via the methods read_file_header, - * read_scan_header, read_jpeg_data, read_scan_trailer, and read_file_trailer. - */ - -#include "jinclude.h" -#include "macro.h" - -#ifdef JFIF_SUPPORTED - -#ifdef XIE_SUPPORTED -#define M_EOB -1 -#define M_SOF0 0xc0 -#define M_SOF1 0xc1 -#define M_SOF2 0xc2 -#define M_SOF3 0xc3 - -#define M_SOF5 0xc5 -#define M_SOF6 0xc6 -#define M_SOF7 0xc7 - -#define M_JPG 0xc8 -#define M_SOF9 0xc9 -#define M_SOF10 0xca -#define M_SOF11 0xcb - -#define M_SOF13 0xcd -#define M_SOF14 0xce -#define M_SOF15 0xcf - -#define M_DHT 0xc4 - -#define M_DAC 0xcc - -#define M_RST0 0xd0 -#define M_RST1 0xd1 -#define M_RST2 0xd2 -#define M_RST3 0xd3 -#define M_RST4 0xd4 -#define M_RST5 0xd5 -#define M_RST6 0xd6 -#define M_RST7 0xd7 - -#define M_SOI 0xd8 -#define M_EOI 0xd9 -#define M_SOS 0xda -#define M_DQT 0xdb -#define M_DNL 0xdc -#define M_DRI 0xdd -#define M_DHP 0xde -#define M_EXP 0xdf - -#define M_APP0 0xe0 -#define M_APP15 0xef - -#define M_JPG0 0xf0 -#define M_JPG13 0xfd -#define M_COM 0xfe - -#define M_TEM 0x01 - -#define M_ERROR 0x100 -#else -typedef enum { /* JPEG marker codes */ - M_SOF0 = 0xc0, - M_SOF1 = 0xc1, - M_SOF2 = 0xc2, - M_SOF3 = 0xc3, - - M_SOF5 = 0xc5, - M_SOF6 = 0xc6, - M_SOF7 = 0xc7, - - M_JPG = 0xc8, - M_SOF9 = 0xc9, - M_SOF10 = 0xca, - M_SOF11 = 0xcb, - - M_SOF13 = 0xcd, - M_SOF14 = 0xce, - M_SOF15 = 0xcf, - - M_DHT = 0xc4, - - M_DAC = 0xcc, - - M_RST0 = 0xd0, - M_RST1 = 0xd1, - M_RST2 = 0xd2, - M_RST3 = 0xd3, - M_RST4 = 0xd4, - M_RST5 = 0xd5, - M_RST6 = 0xd6, - M_RST7 = 0xd7, - - M_SOI = 0xd8, - M_EOI = 0xd9, - M_SOS = 0xda, - M_DQT = 0xdb, - M_DNL = 0xdc, - M_DRI = 0xdd, - M_DHP = 0xde, - M_EXP = 0xdf, - - M_APP0 = 0xe0, - M_APP15 = 0xef, - - M_JPG0 = 0xf0, - M_JPG13 = 0xfd, - M_COM = 0xfe, - - M_TEM = 0x01, - - M_ERROR = 0x100 -} JPEG_MARKER; -#endif /* XIE_SUPPORTED */ - - -/* - * Reload the input buffer after it's been emptied, and return the next byte. - * This is exported for direct use by the entropy decoder. - * See the JGETC macro for calling conditions. Note in particular that - * read_jpeg_data may NOT return EOF. If no more data is available, it must - * exit via ERREXIT, or perhaps synthesize fake data (such as an RST marker). - * For error recovery purposes, synthesizing an EOI marker is probably best. - * - * For this header control module, read_jpeg_data is supplied by the - * user interface. However, header formats that require random access - * to the input file would need to supply their own code. This code is - * left here to indicate what is required. - */ - -#ifndef XIE_SUPPORTED -#if NOTDEF /* not needed in this module */ - -METHODDEF int -read_jpeg_data (decompress_info_ptr cinfo) -{ - cinfo->next_input_byte = cinfo->input_buffer + MIN_UNGET; - - cinfo->bytes_in_buffer = (int) JFREAD(cinfo->input_file, - cinfo->next_input_byte, - JPEG_BUF_SIZE); - - if (cinfo->bytes_in_buffer <= 0) { - WARNMS(cinfo->emethods, "Premature EOF in JPEG file"); - cinfo->next_input_byte[0] = (char) 0xFF; - cinfo->next_input_byte[1] = (char) M_EOI; - cinfo->bytes_in_buffer = 2; - } - - return JGETC(cinfo); -} - -#endif -#endif /* XIE_SUPPORTED */ - - -/* - * Routines to parse JPEG markers & save away the useful info. - */ - - -LOCAL INT32 -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -get_2bytes (decompress_info_ptr cinfo) -#else -get_2bytes (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -get_2bytes (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Get a 2-byte unsigned integer (e.g., a marker parameter length field) */ -{ - INT32 a; -#ifdef XIE_SUPPORTED - INT32 b; - if ((a = JGETC(cinfo)) < 0) - return(-1); - if ((b = JGETC(cinfo)) < 0) - return(-1); - return (a << 8) + b; -#else - a = JGETC(cinfo); - return (a << 8) + JGETC(cinfo); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -skip_variable (decompress_info_ptr cinfo, int code) -#else -skip_variable (cinfo, code) - decompress_info_ptr cinfo; - int code; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -skip_variable (decompress_info_ptr cinfo, int code) -#endif /* XIE_SUPPORTED */ -/* Skip over an unknown or uninteresting variable-length marker */ -{ - INT32 length; - - length = get_2bytes(cinfo); -#ifdef XIE_SUPPORTED - if (length < 0) - return(-1); -#else - TRACEMS2(cinfo->emethods, 1, - "Skipping marker 0x%02x, length %u", code, (int) length); -#endif /* XIE_SUPPORTED */ - - for (length -= 2; length > 0; length--) -#ifdef XIE_SUPPORTED - if (JGETC(cinfo) < 0) - return(-1); -#else - (void) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_dht (decompress_info_ptr cinfo) -#else -get_dht (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_dht (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a DHT marker */ -{ - INT32 length; - UINT8 bits[17]; - UINT8 huffval[256]; - int i, index, count; - HUFF_TBL **htblptr; -#ifdef XIE_SUPPORTED - int j; -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if ((length = get_2bytes(cinfo)) < 0) - return(-1); - length -= 2; -#else - length = get_2bytes(cinfo)-2; -#endif /* XIE_SUPPORTED */ - - - while (length > 0) { - index = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (index < 0) - return(-1); -#else - TRACEMS1(cinfo->emethods, 1, "Define Huffman Table 0x%02x", index); -#endif /* XIE_SUPPORTED */ - - bits[0] = 0; - count = 0; - for (i = 1; i <= 16; i++) { -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - bits[i] = (UINT8) j; -#else - bits[i] = (UINT8) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - count += bits[i]; - } - -#ifndef XIE_SUPPORTED - TRACEMS8(cinfo->emethods, 2, " %3d %3d %3d %3d %3d %3d %3d %3d", - bits[1], bits[2], bits[3], bits[4], - bits[5], bits[6], bits[7], bits[8]); - TRACEMS8(cinfo->emethods, 2, " %3d %3d %3d %3d %3d %3d %3d %3d", - bits[9], bits[10], bits[11], bits[12], - bits[13], bits[14], bits[15], bits[16]); -#endif /* XIE_SUPPORTED */ - - if (count > 256) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Bogus DHT counts"); -#endif /* XIE_SUPPORTED */ - - for (i = 0; i < count; i++) { -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - huffval[i] = (UINT8) j; -#else - huffval[i] = (UINT8) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - } - - length -= 1 + 16 + count; - - if (index & 0x10) { /* AC table definition */ - index -= 0x10; - htblptr = &cinfo->ac_huff_tbl_ptrs[index]; - } else { /* DC table definition */ - htblptr = &cinfo->dc_huff_tbl_ptrs[index]; - } - - if (index < 0 || index >= NUM_HUFF_TBLS) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Bogus DHT index %d", index); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->d_alloc_small) - (cinfo, SIZEOF(HUFF_TBL)); - if (*htblptr == (HUFF_TBL *) NULL) - return(XIE_ERR); -#else - if (*htblptr == NULL) - *htblptr = (HUFF_TBL *) (*cinfo->emethods->alloc_small) (SIZEOF(HUFF_TBL)); -#endif /* XIE_SUPPORTED */ - - MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); - MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_dac (decompress_info_ptr cinfo) -#else -get_dac (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_dac (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a DAC marker */ -{ - INT32 length; - int index, val; - -#ifdef XIE_SUPPORTED - if ((length = get_2bytes(cinfo)) < 0) - return(-1); - length -= 2; -#else - length = get_2bytes(cinfo)-2; -#endif /* XIE_SUPPORTED */ - - while (length > 0) { - index = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (index < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - val = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (val < 0) - return(-1); -#else - TRACEMS2(cinfo->emethods, 1, - "Define Arithmetic Table 0x%02x: 0x%02x", index, val); -#endif /* XIE_SUPPORTED */ - - if (index < 0 || index >= (2*NUM_ARITH_TBLS)) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Bogus DAC index %d", index); -#endif /* XIE_SUPPORTED */ - - if (index >= NUM_ARITH_TBLS) { /* define AC table */ - cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val; - } else { /* define DC table */ - cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F); - cinfo->arith_dc_U[index] = (UINT8) (val >> 4); - if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index]) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Bogus DAC value 0x%x", val); -#endif /* XIE_SUPPORTED */ - } - - length -= 2; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_dqt (decompress_info_ptr cinfo) -#else -get_dqt (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_dqt (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a DQT marker */ -{ - INT32 length; - int n, i, prec; - UINT16 tmp; - QUANT_TBL_PTR quant_ptr; -#ifdef XIE_SUPPORTED - int j; -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if ((length = get_2bytes(cinfo)) < 0) - return(-1); - length -= 2; -#else - length = get_2bytes(cinfo)-2; -#endif /* XIE_SUPPORTED */ - - while (length > 0) { - n = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (n < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - prec = n >> 4; - n &= 0x0F; - -#ifndef XIE_SUPPORTED - TRACEMS2(cinfo->emethods, 1, - "Define Quantization Table %d precision %d", n, prec); -#endif /* XIE_SUPPORTED */ - - if (n >= NUM_QUANT_TBLS) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Bogus table number %d", n); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if (cinfo->quant_tbl_ptrs[n] == NULL) - cinfo->quant_tbl_ptrs[n] = (QUANT_TBL_PTR) - (*cinfo->emethods->d_alloc_small) (cinfo, SIZEOF(QUANT_TBL)); - if (cinfo->quant_tbl_ptrs[n] == (QUANT_TBL_PTR) NULL) - return(XIE_ERR); -#else - if (cinfo->quant_tbl_ptrs[n] == NULL) - cinfo->quant_tbl_ptrs[n] = (QUANT_TBL_PTR) - (*cinfo->emethods->alloc_small) (SIZEOF(QUANT_TBL)); -#endif /* XIE_SUPPORTED */ - quant_ptr = cinfo->quant_tbl_ptrs[n]; - - for (i = 0; i < DCTSIZE2; i++) { -#ifdef XIE_SUPPORTED - j = JGETC(cinfo); - if (j < 0) - return(-1); - tmp = (UINT16) j; -#else - tmp = JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - if (prec) { -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - tmp = (tmp<<8) + j; -#else - tmp = (tmp<<8) + JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - } - quant_ptr[i] = tmp; - } - -#ifndef XIE_SUPPORTED - for (i = 0; i < DCTSIZE2; i += 8) { - TRACEMS8(cinfo->emethods, 2, " %4u %4u %4u %4u %4u %4u %4u %4u", - quant_ptr[i ], quant_ptr[i+1], quant_ptr[i+2], quant_ptr[i+3], - quant_ptr[i+4], quant_ptr[i+5], quant_ptr[i+6], quant_ptr[i+7]); - } -#endif /* XIE_SUPPORTED */ - - length -= DCTSIZE2+1; - if (prec) length -= DCTSIZE2; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_dri (decompress_info_ptr cinfo) -#else -get_dri (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_dri (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a DRI marker */ -{ -#ifdef XIE_SUPPORTED - INT32 j; -#endif /* XIE_SUPPORTED */ - if (get_2bytes(cinfo) != 4) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Bogus length in DRI"); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if ((j = get_2bytes(cinfo)) < 0) - return(-1); - cinfo->restart_interval = (UINT16) j; - - return(0); -#else - cinfo->restart_interval = (UINT16) get_2bytes(cinfo); - - TRACEMS1(cinfo->emethods, 1, - "Define Restart Interval %u", cinfo->restart_interval); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_app0 (decompress_info_ptr cinfo) -#else -get_app0 (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_app0 (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process an APP0 marker */ -{ -#define JFIF_LEN 14 - INT32 length; - UINT8 b[JFIF_LEN]; - int buffp; -#ifdef XIE_SUPPORTED - int j; -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if ((length = get_2bytes(cinfo)) < 0) - return(-1); - length -= 2; -#else - length = get_2bytes(cinfo)-2; -#endif /* XIE_SUPPORTED */ - - /* See if a JFIF APP0 marker is present */ - - if (length >= JFIF_LEN) { - for (buffp = 0; buffp < JFIF_LEN; buffp++) { -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - b[buffp] = (UINT8) j; -#else - b[buffp] = (UINT8) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - } - length -= JFIF_LEN; - - if (b[0]==0x4A && b[1]==0x46 && b[2]==0x49 && b[3]==0x46 && b[4]==0) { - /* Found JFIF APP0 marker: check version */ - /* Major version must be 1 */ - if (b[5] != 1) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT2(cinfo->emethods, "Unsupported JFIF revision number %d.%02d", - b[5], b[6]); - /* Minor version should be 0..2, but try to process anyway if newer */ - if (b[6] > 2) - TRACEMS2(cinfo->emethods, 1, "Warning: unknown JFIF revision number %d.%02d", - b[5], b[6]); -#endif /* XIE_SUPPORTED */ - /* Save info */ - cinfo->density_unit = b[7]; - cinfo->X_density = (b[8] << 8) + b[9]; - cinfo->Y_density = (b[10] << 8) + b[11]; - /* Assume colorspace is YCbCr, unless UI has overridden me */ - if (cinfo->jpeg_color_space == CS_UNKNOWN) - cinfo->jpeg_color_space = CS_YCbCr; -#ifndef XIE_SUPPORTED - TRACEMS3(cinfo->emethods, 1, "JFIF APP0 marker, density %dx%d %d", - cinfo->X_density, cinfo->Y_density, cinfo->density_unit); - if (b[12] | b[13]) - TRACEMS2(cinfo->emethods, 1, " with %d x %d thumbnail image", - b[12], b[13]); - if (length != ((INT32) b[12] * (INT32) b[13] * (INT32) 3)) - TRACEMS1(cinfo->emethods, 1, - "Warning: thumbnail image size does not match data length %u", - (int) length); -#endif /* XIE_SUPPORTED */ - } else { -#ifndef XIE_SUPPORTED - TRACEMS1(cinfo->emethods, 1, "Unknown APP0 marker (not JFIF), length %u", - (int) length + JFIF_LEN); -#endif /* XIE_SUPPORTED */ - } - } else { -#ifndef XIE_SUPPORTED - TRACEMS1(cinfo->emethods, 1, "Short APP0 marker, length %u", (int) length); -#endif /* XIE_SUPPORTED */ - } - - while (length-- > 0) /* skip any remaining data */ -#ifdef XIE_SUPPORTED - if (JGETC(cinfo) < 0) - return(-1); -#else - (void) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_com (decompress_info_ptr cinfo) -#else -get_com (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_com (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a COM marker */ -/* Actually we just pass this off to an application-supplied routine */ -{ - INT32 length; - -#ifdef XIE_SUPPORTED - if ((length = get_2bytes(cinfo)) < 0) - return(-1); - length -= 2; -#else - length = get_2bytes(cinfo) - 2; - - TRACEMS1(cinfo->emethods, 1, "Comment, length %u", (int) length); -#endif /* XIE_SUPPORTED */ - - (*cinfo->methods->process_comment) (cinfo, (long) length); - -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_sof (decompress_info_ptr cinfo, int code) -#else -get_sof (cinfo, code) - decompress_info_ptr cinfo; - int code; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_sof (decompress_info_ptr cinfo, int code) -#endif /* XIE_SUPPORTED */ -/* Process a SOFn marker */ -{ - INT32 length; - short ci; - int c; - jpeg_component_info * compptr; -#ifdef XIE_SUPPORTED - int j; - INT32 k; -#endif /* XIE_SUPPORTED */ - - length = get_2bytes(cinfo); -#ifdef XIE_SUPPORTED - if (length < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - cinfo->data_precision = j; - if ((k = get_2bytes(cinfo)) < 0) - return(-1); - cinfo->image_height = k; - if ((k = get_2bytes(cinfo)) < 0) - return(-1); - cinfo->image_width = k; - if ((j = JGETC(cinfo)) < 0) - return(-1); - cinfo->num_components = j; -#else - cinfo->data_precision = JGETC(cinfo); - cinfo->image_height = get_2bytes(cinfo); - cinfo->image_width = get_2bytes(cinfo); - cinfo->num_components = JGETC(cinfo); - - TRACEMS4(cinfo->emethods, 1, - "Start Of Frame 0x%02x: width=%u, height=%u, components=%d", - code, (int) cinfo->image_width, (int) cinfo->image_height, - cinfo->num_components); -#endif /* XIE_SUPPORTED */ - - /* We don't support files in which the image height is initially specified */ - /* as 0 and is later redefined by DNL. As long as we have to check that, */ - /* might as well have a general sanity check. */ - if (cinfo->image_height <= 0 || cinfo->image_width <= 0 - || cinfo->num_components <= 0) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Empty JPEG image (DNL not supported)"); -#endif /* XIE_SUPPORTED */ - -#ifdef EIGHT_BIT_SAMPLES - if (cinfo->data_precision != 8) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Unsupported JPEG data precision"); -#endif /* XIE_SUPPORTED */ -#endif -#ifdef TWELVE_BIT_SAMPLES - if (cinfo->data_precision != 12) /* this needs more thought?? */ -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Unsupported JPEG data precision"); -#endif /* XIE_SUPPORTED */ -#endif -#ifdef SIXTEEN_BIT_SAMPLES - if (cinfo->data_precision != 16) /* this needs more thought?? */ -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Unsupported JPEG data precision"); -#endif /* XIE_SUPPORTED */ -#endif - - if (length != (cinfo->num_components * 3 + 8)) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Bogus SOF length"); -#endif /* XIE_SUPPORTED */ - -#ifdef XIE_SUPPORTED - cinfo->comp_info = (jpeg_component_info *) (*cinfo->emethods->d_alloc_small) - (cinfo, (cinfo->num_components * SIZEOF(jpeg_component_info))); - if (cinfo->comp_info == (jpeg_component_info *) NULL) - return(XIE_ERR); -#else - cinfo->comp_info = (jpeg_component_info *) (*cinfo->emethods->alloc_small) - (cinfo->num_components * SIZEOF(jpeg_component_info)); -#endif /* XIE_SUPPORTED */ - - for (ci = 0; ci < cinfo->num_components; ci++) { - compptr = &cinfo->comp_info[ci]; - compptr->component_index = ci; -#ifdef XIE_SUPPORTED - if ((j = JGETC(cinfo)) < 0) - return(-1); - compptr->component_id = j; - if ((c = JGETC(cinfo)) < 0) - return(-1); - compptr->h_samp_factor = (c >> 4) & 15; - compptr->v_samp_factor = (c ) & 15; - if ((j = JGETC(cinfo)) < 0) - return(-1); - compptr->quant_tbl_no = j; -#else - compptr->component_id = JGETC(cinfo); - c = JGETC(cinfo); - compptr->h_samp_factor = (c >> 4) & 15; - compptr->v_samp_factor = (c ) & 15; - compptr->quant_tbl_no = JGETC(cinfo); - - TRACEMS4(cinfo->emethods, 1, " Component %d: %dhx%dv q=%d", - compptr->component_id, compptr->h_samp_factor, - compptr->v_samp_factor, compptr->quant_tbl_no); -#endif /* XIE_SUPPORTED */ - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -get_sos (decompress_info_ptr cinfo) -#else -get_sos (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -get_sos (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Process a SOS marker */ -{ - INT32 length; - int i, ci, n, c, cc; - jpeg_component_info * compptr; - - length = get_2bytes(cinfo); -#ifdef XIE_SUPPORTED - if (length < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - - n = JGETC(cinfo); /* Number of components */ -#ifdef XIE_SUPPORTED - if (n < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - cinfo->comps_in_scan = n; - length -= 3; - - if (length != (n * 2 + 3) || n < 1 || n > MAX_COMPS_IN_SCAN) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Bogus SOS length"); - - TRACEMS1(cinfo->emethods, 1, "Start Of Scan: %d components", n); -#endif /* XIE_SUPPORTED */ - - for (i = 0; i < n; i++) { - cc = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (cc < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - c = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - length -= 2; - - for (ci = 0; ci < cinfo->num_components; ci++) - if (cc == cinfo->comp_info[ci].component_id) - break; - - if (ci >= cinfo->num_components) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT(cinfo->emethods, "Invalid component number in SOS"); -#endif /* XIE_SUPPORTED */ - - compptr = &cinfo->comp_info[ci]; - cinfo->cur_comp_info[i] = compptr; - compptr->dc_tbl_no = (c >> 4) & 15; - compptr->ac_tbl_no = (c ) & 15; - -#ifndef XIE_SUPPORTED - TRACEMS3(cinfo->emethods, 1, " c%d: [dc=%d ac=%d]", cc, - compptr->dc_tbl_no, compptr->ac_tbl_no); -#endif /* XIE_SUPPORTED */ - } - - while (length > 0) { -#ifdef XIE_SUPPORTED - if (JGETC(cinfo) < 0) - return(-1); -#else - (void) JGETC(cinfo); -#endif /* XIE_SUPPORTED */ - length--; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -LOCAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -get_soi (decompress_info_ptr cinfo) -#else -get_soi (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Process an SOI marker */ -{ - int i; - -#else -get_soi (decompress_info_ptr cinfo) -/* Process an SOI marker */ -{ - int i; - - TRACEMS(cinfo->emethods, 1, "Start of Image"); -#endif /* XIE_SUPPORTED */ - - /* Reset all parameters that are defined to be reset by SOI */ - - for (i = 0; i < NUM_ARITH_TBLS; i++) { - cinfo->arith_dc_L[i] = 0; - cinfo->arith_dc_U[i] = 1; - cinfo->arith_ac_K[i] = 5; - } - cinfo->restart_interval = 0; - - cinfo->density_unit = 0; /* set default JFIF APP0 values */ - cinfo->X_density = 1; - cinfo->Y_density = 1; - - cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling */ -} - - -LOCAL int -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -next_marker (decompress_info_ptr cinfo) -#else -next_marker (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -next_marker (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Find the next JPEG marker */ -/* Note that the output might not be a valid marker code, */ -/* but it will never be 0 or FF */ -{ - int c, nbytes; - -#ifdef XIE_SUPPORTED - /* Save the location of the next marker (for restart) */ - cinfo->XIEnext_input_byte = cinfo->next_input_byte; - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; -#endif /* XIE_SUPPORTED */ - nbytes = 0; - do { - do { /* skip any non-FF bytes */ - nbytes++; - c = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - } while (c != 0xFF); - do { /* skip any duplicate FFs */ - /* we don't increment nbytes here since extra FFs are legal */ - c = JGETC(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - } while (c == 0xFF); - } while (c == 0); /* repeat if it was a stuffed FF/00 */ - -#ifndef XIE_SUPPORTED - if (nbytes != 1) - WARNMS2(cinfo->emethods, - "Corrupt JPEG data: %d extraneous bytes before marker 0x%02x", - nbytes-1, c); -#endif /* XIE_SUPPORTED */ - - return c; -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -process_tables (decompress_info_ptr cinfo) -#else -process_tables (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Scan and process JPEG markers that can appear in any order */ -/* Return when an SOI, EOI, SOFn, or SOS is found */ -{ - int status; -#else -LOCAL JPEG_MARKER -process_tables (decompress_info_ptr cinfo) -/* Scan and process JPEG markers that can appear in any order */ -/* Return when an SOI, EOI, SOFn, or SOS is found */ -{ -#endif /* XIE_SUPPORTED */ - int c; - - while (TRUE) { - c = next_marker(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - - switch (c) { - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_JPG: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - case M_SOI: - case M_EOI: - case M_SOS: -#ifdef XIE_SUPPORTED - return (c); -#else - return ((JPEG_MARKER) c); -#endif /* XIE_SUPPORTED */ - - case M_DHT: -#ifdef XIE_SUPPORTED - if ((status = get_dht(cinfo)) < 0) - return(status); -#else - get_dht(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_DAC: -#ifdef XIE_SUPPORTED - if ((status = get_dac(cinfo)) < 0) - return(status); -#else - get_dac(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_DQT: -#ifdef XIE_SUPPORTED - if ((status = get_dqt(cinfo)) < 0) - return(status); -#else - get_dqt(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_DRI: -#ifdef XIE_SUPPORTED - if ((status = get_dri(cinfo)) < 0) - return(status); -#else - get_dri(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_APP0: -#ifdef XIE_SUPPORTED - if ((status = get_app0(cinfo)) < 0) - return(status); -#else - get_app0(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_COM: -#ifdef XIE_SUPPORTED - if ((status = get_com(cinfo)) < 0) - return(status); -#else - get_com(cinfo); -#endif /* XIE_SUPPORTED */ - break; - - case M_RST0: /* these are all parameterless */ - case M_RST1: - case M_RST2: - case M_RST3: - case M_RST4: - case M_RST5: - case M_RST6: - case M_RST7: - case M_TEM: -#ifndef XIE_SUPPORTED - TRACEMS1(cinfo->emethods, 1, "Unexpected marker 0x%02x", c); -#endif /* XIE_SUPPORTED */ - break; - - default: /* must be DNL, DHP, EXP, APPn, JPGn, COM, or RESn */ -#ifdef XIE_SUPPORTED - if (skip_variable(cinfo, c) < 0) - return(-1); -#else - skip_variable(cinfo, c); -#endif /* XIE_SUPPORTED */ - break; - } - } -} - - - -/* - * Initialize and read the file header (everything through the SOF marker). - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -read_file_header (decompress_info_ptr cinfo) -#else -read_file_header (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - int i, j; - int status; -#else -METHODDEF void -read_file_header (decompress_info_ptr cinfo) -{ -#endif /* XIE_SUPPORTED */ - int c; - - /* Demand an SOI marker at the start of the file --- otherwise it's - * probably not a JPEG file at all. If the user interface wants to support - * nonstandard headers in front of the SOI, it must skip over them itself - * before calling jpeg_decompress(). - */ -#ifdef XIE_SUPPORTED - if (cinfo->XIErestart != XIE_RRFH) { /* don't read signature bytes on restart */ - if ((i = JGETC(cinfo)) < 0) - return(-1); - if ((j = JGETC(cinfo)) < 0) - return(-1); - if (i != 0xFF || j != M_SOI) - return(XIE_ERR); - - get_soi(cinfo); /* OK, process SOI */ - } -#else - if (JGETC(cinfo) != 0xFF || JGETC(cinfo) != M_SOI) - ERREXIT(cinfo->emethods, "Not a JPEG file"); - - get_soi(cinfo); /* OK, process SOI */ -#endif /* XIE_SUPPORTED */ - - /* Process markers until SOF */ - c = process_tables(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(c); -#endif /* XIE_SUPPORTED */ - - switch (c) { - case M_SOF0: - case M_SOF1: -#ifdef XIE_SUPPORTED - if ((status = get_sof(cinfo, c)) < 0) - return(status); -#else - get_sof(cinfo, c); -#endif /* XIE_SUPPORTED */ - cinfo->arith_code = FALSE; - break; - - case M_SOF9: -#ifdef XIE_SUPPORTED - if ((status = get_sof(cinfo, c)) < 0) - return(status); -#else - get_sof(cinfo, c); -#endif /* XIE_SUPPORTED */ - cinfo->arith_code = TRUE; - break; - - default: -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Unsupported SOF marker type 0x%02x", c); -#endif /* XIE_SUPPORTED */ - break; - } - - /* Figure out what colorspace we have */ - /* (too bad the JPEG committee didn't provide a real way to specify this) */ - - switch (cinfo->num_components) { - case 1: - cinfo->jpeg_color_space = CS_GRAYSCALE; - break; - - case 3: - /* if we saw a JFIF marker, leave it set to YCbCr; */ - /* also leave it alone if UI has provided a value */ - if (cinfo->jpeg_color_space == CS_UNKNOWN) { - short cid0 = cinfo->comp_info[0].component_id; - short cid1 = cinfo->comp_info[1].component_id; - short cid2 = cinfo->comp_info[2].component_id; - - if (cid0 == 1 && cid1 == 2 && cid2 == 3) - cinfo->jpeg_color_space = CS_YCbCr; /* assume it's JFIF w/out marker */ - else if (cid0 == 1 && cid1 == 4 && cid2 == 5) - cinfo->jpeg_color_space = CS_YIQ; /* prototype's YIQ matrix */ - else { -#ifndef XIE_SUPPORTED - TRACEMS3(cinfo->emethods, 1, - "Unrecognized component IDs %d %d %d, assuming YCbCr", - cid0, cid1, cid2); -#endif /* XIE_SUPPORTED */ - cinfo->jpeg_color_space = CS_YCbCr; - } - } - break; - - case 4: - cinfo->jpeg_color_space = CS_CMYK; - break; - - default: - cinfo->jpeg_color_space = CS_UNKNOWN; - break; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Read the start of a scan (everything through the SOS marker). - * Return TRUE if find SOS, FALSE if find EOI. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -read_scan_header (decompress_info_ptr cinfo) -#else -read_scan_header (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF boolean -read_scan_header (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - int c; - - /* Process markers until SOS or EOI */ - c = process_tables(cinfo); -#ifdef XIE_SUPPORTED - if (c < 0) - return(c); -#endif /* XIE_SUPPORTED */ - - switch (c) { - case M_SOS: -#ifdef XIE_SUPPORTED - return(get_sos(cinfo)); /* 0, OK; -1, read error */ -#else - get_sos(cinfo); - return TRUE; -#endif /* XIE_SUPPORTED */ - - case M_EOI: -#ifndef XIE_SUPPORTED - TRACEMS(cinfo->emethods, 1, "End Of Image"); -#endif /* XIE_SUPPORTED */ - return FALSE; - - default: -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Unexpected marker 0x%02x", c); -#endif /* XIE_SUPPORTED */ - break; - } -#ifdef XIE_SUPPORTED - return(0); -#else - return FALSE; /* keeps lint happy */ -#endif /* XIE_SUPPORTED */ -} - - -/* - * The entropy decoder calls this routine if it finds a marker other than - * the restart marker it was expecting. (This code is *not* used unless - * a nonzero restart interval has been declared.) The passed parameter is - * the marker code actually found (might be anything, except 0 or FF). - * The desired restart marker is that indicated by cinfo->next_restart_num. - * This routine is supposed to apply whatever error recovery strategy seems - * appropriate in order to position the input stream to the next data segment. - * For some file formats (eg, TIFF) extra information such as tile boundary - * pointers may be available to help in this decision. - * - * This implementation is substantially constrained by wanting to treat the - * input as a data stream; this means we can't back up. (For instance, we - * generally can't fseek() if the input is a Unix pipe.) Therefore, we have - * only the following actions to work with: - * 1. Do nothing, let the entropy decoder resume at next byte of file. - * 2. Read forward until we find another marker, discarding intervening - * data. (In theory we could look ahead within the current bufferload, - * without having to discard data if we don't find the desired marker. - * This idea is not implemented here, in part because it makes behavior - * dependent on buffer size and chance buffer-boundary positions.) - * 3. Push back the passed marker (with JUNGETC). This will cause the - * entropy decoder to process an empty data segment, inserting dummy - * zeroes, and then re-read the marker we pushed back. - * #2 is appropriate if we think the desired marker lies ahead, while #3 is - * appropriate if the found marker is a future restart marker (indicating - * that we have missed the desired restart marker, probably because it got - * corrupted). - - * We apply #2 or #3 if the found marker is a restart marker no more than - * two counts behind or ahead of the expected one. We also apply #2 if the - * found marker is not a legal JPEG marker code (it's certainly bogus data). - * If the found marker is a restart marker more than 2 counts away, we do #1 - * (too much risk that the marker is erroneous; with luck we will be able to - * resync at some future point). - * For any valid non-restart JPEG marker, we apply #3. This keeps us from - * overrunning the end of a scan. An implementation limited to single-scan - * files might find it better to apply #2 for markers other than EOI, since - * any other marker would have to be bogus data in that case. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -resync_to_restart (decompress_info_ptr cinfo, int marker) -#else -resync_to_restart (cinfo, marker) - decompress_info_ptr cinfo; - int marker; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -resync_to_restart (decompress_info_ptr cinfo, int marker) -#endif /* XIE_SUPPORTED */ -{ - int desired = cinfo->next_restart_num; - int action = 1; - - /* Always put up a warning. */ -#ifndef XIE_SUPPORTED - WARNMS2(cinfo->emethods, - "Corrupt JPEG data: found 0x%02x marker instead of RST%d", - marker, desired); -#endif /* XIE_SUPPORTED */ - /* Outer loop handles repeated decision after scanning forward. */ - for (;;) { - if (marker < (int) M_SOF0) - action = 2; /* invalid marker */ - else if (marker < (int) M_RST0 || marker > (int) M_RST7) - action = 3; /* valid non-restart marker */ - else { - if (marker == ((int) M_RST0 + ((desired+1) & 7)) || - marker == ((int) M_RST0 + ((desired+2) & 7))) - action = 3; /* one of the next two expected restarts */ - else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || - marker == ((int) M_RST0 + ((desired-2) & 7))) - action = 2; /* a prior restart, so advance */ - else - action = 1; /* desired restart or too far away */ - } -#ifndef XIE_SUPPORTED - TRACEMS2(cinfo->emethods, 4, - "At marker 0x%02x, recovery action %d", marker, action); -#endif /* XIE_SUPPORTED */ - switch (action) { - case 1: - /* Let entropy decoder resume processing. */ -#ifdef XIE_SUPPORTED - return(0); -#else - return; -#endif /* XIE_SUPPORTED */ - case 2: - /* Scan to the next marker, and repeat the decision loop. */ - marker = next_marker(cinfo); -#ifdef XIE_SUPPORTED - if (marker < 0) - return(-1); -#endif /* XIE_SUPPORTED */ - break; - case 3: - /* Put back this marker & return. */ - /* Entropy decoder will be forced to process an empty segment. */ - JUNGETC(marker, cinfo); - JUNGETC(0xFF, cinfo); -#ifdef XIE_SUPPORTED - return(0); -#else - return; -#endif /* XIE_SUPPORTED */ - } - } -} - - -/* - * Finish up after a compressed scan (series of read_jpeg_data calls); - * prepare for another read_scan_header call. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -read_scan_trailer (decompress_info_ptr cinfo) -#else -read_scan_trailer (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -read_scan_trailer (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work needed */ -} -#endif /* XIE_SUPPORTED */ - -/* - * Finish up at the end of the file. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -read_file_trailer (decompress_info_ptr cinfo) -#else -read_file_trailer (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -read_file_trailer (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work needed */ -} -#endif /* XIE_SUPPORTED */ - -/* - * The method selection routine for standard JPEG header reading. - * Note that this must be called by the user interface before calling - * jpeg_decompress. When a non-JFIF file is to be decompressed (TIFF, - * perhaps), the user interface must discover the file type and call - * the appropriate method selection routine. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselrjfif (decompress_info_ptr cinfo) -#else -jselrjfif (cinfo) - decompress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselrjfif (decompress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - cinfo->methods->read_file_header = read_file_header; - cinfo->methods->read_scan_header = read_scan_header; - /* For JFIF/raw-JPEG format, the user interface supplies read_jpeg_data. */ -#ifndef XIE_SUPPORTED -#if NOTDEF - cinfo->methods->read_jpeg_data = read_jpeg_data; -#endif -#endif /* XIE_SUPPORTED */ - cinfo->methods->resync_to_restart = resync_to_restart; -#ifndef XIE_SUPPORTED - cinfo->methods->read_scan_trailer = read_scan_trailer; - cinfo->methods->read_file_trailer = read_file_trailer; -#endif /* XIE_SUPPORTED */ -} - -#endif /* JFIF_SUPPORTED */ Index: xc/programs/Xserver/XIE/mixie/jpeg/jrevdct.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jrevdct.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jrevdct.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jrevdct.c:1.2 Fri Dec 14 14:58:40 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jrevdct.c Sat Feb 28 21:42:00 2004 @@ -1,451 +0,0 @@ -/* $Xorg: jrevdct.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jrevdct.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jrevdct.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the basic inverse-DCT transformation subroutine. - * - * This implementation is based on an algorithm described in - * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT - * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, - * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. - * The primary algorithm described there uses 11 multiplies and 29 adds. - * We use their alternate method with 12 multiplies and 32 adds. - * The advantage of this method is that no data path contains more than one - * multiplication; this allows a very simple and accurate implementation in - * scaled fixed-point arithmetic, with a minimal number of shifts. - */ - -#include "jinclude.h" - -/* - * This routine is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * The poop on this scaling stuff is as follows: - * - * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) - * larger than the true IDCT outputs. The final outputs are therefore - * a factor of N larger than desired; since N=8 this can be cured by - * a simple right shift at the end of the algorithm. The advantage of - * this arrangement is that we save two multiplications per 1-D IDCT, - * because the y0 and y4 inputs need not be divided by sqrt(N). - * - * We have to do addition and subtraction of the integer inputs, which - * is no problem, and multiplication by fractional constants, which is - * a problem to do in integer arithmetic. We multiply all the constants - * by CONST_SCALE and convert them to integer constants (thus retaining - * CONST_BITS bits of precision in the constants). After doing a - * multiplication we have to divide the product by CONST_SCALE, with proper - * rounding, to produce the correct output. This division can be done - * cheaply as a right shift of CONST_BITS bits. We postpone shifting - * as long as possible so that partial sums can be added together with - * full fractional precision. - * - * The outputs of the first pass are scaled up by PASS1_BITS bits so that - * they are represented to better-than-integral precision. These outputs - * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word - * with the recommended scaling. (To scale up 12-bit sample data further, an - * intermediate INT32 array would be needed.) - * - * To avoid overflow of the 32-bit intermediate results in pass 2, we must - * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis - * shows that the values given below are the most effective. - */ - -#ifdef EIGHT_BIT_SAMPLES -#define CONST_BITS 13 -#define PASS1_BITS 2 -#else -#define CONST_BITS 13 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ -#endif - -#define ONE ((INT32) 1) - -#define CONST_SCALE (ONE << CONST_BITS) - -/* Convert a positive real constant to an integer scaled by CONST_SCALE. */ - -#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 13 -#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ -#else -#define FIX_0_298631336 FIX(0.298631336) -#define FIX_0_390180644 FIX(0.390180644) -#define FIX_0_541196100 FIX(0.541196100) -#define FIX_0_765366865 FIX(0.765366865) -#define FIX_0_899976223 FIX(0.899976223) -#define FIX_1_175875602 FIX(1.175875602) -#define FIX_1_501321110 FIX(1.501321110) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_1_961570560 FIX(1.961570560) -#define FIX_2_053119869 FIX(2.053119869) -#define FIX_2_562915447 FIX(2.562915447) -#define FIX_3_072711026 FIX(3.072711026) -#endif - - -/* Descale and correctly round an INT32 value that's scaled by N bits. - * We assume RIGHT_SHIFT rounds towards minus infinity, so adding - * the fudge factor is correct for either sign of X. - */ - -#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * For 8-bit samples with the recommended scaling, all the variable - * and constant values involved are no more than 16 bits wide, so a - * 16x16->32 bit multiply can be used instead of a full 32x32 multiply; - * this provides a useful speedup on many machines. - * There is no way to specify a 16x16->32 multiply in portable C, but - * some C compilers will do the right thing if you provide the correct - * combination of casts. - * NB: for 12-bit samples, a full 32-bit multiplication will be needed. - */ - -#ifdef EIGHT_BIT_SAMPLES -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const))) -#endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const))) -#endif -#endif - -#ifndef MULTIPLY /* default definition */ -#define MULTIPLY(var,const) ((var) * (const)) -#endif - - -/* - * Perform the inverse DCT on one block of coefficients. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -j_rev_dct (DCTBLOCK data) -#else -j_rev_dct (data) - DCTBLOCK data; -#endif /* NeedFunctionPrototypes */ -#else -j_rev_dct (DCTBLOCK data) -#endif /* XIE_SUPPORTED */ -{ - INT32 tmp0, tmp1, tmp2, tmp3; - INT32 tmp10, tmp11, tmp12, tmp13; - INT32 z1, z2, z3, z4, z5; - register DCTELEM *dataptr; - int rowctr; - SHIFT_TEMPS - - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - - dataptr = data; - for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any row in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * row DCT calculations can be simplified this way. - */ - - if ((dataptr[1] | dataptr[2] | dataptr[3] | dataptr[4] | - dataptr[5] | dataptr[6] | dataptr[7]) == 0) { - /* AC terms all zero */ - DCTELEM dcval = (DCTELEM) (dataptr[0] << PASS1_BITS); - - dataptr[0] = dcval; - dataptr[1] = dcval; - dataptr[2] = dcval; - dataptr[3] = dcval; - dataptr[4] = dcval; - dataptr[5] = dcval; - dataptr[6] = dcval; - dataptr[7] = dcval; - - dataptr += DCTSIZE; /* advance pointer to next row */ - continue; - } - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - - z2 = (INT32) dataptr[2]; - z3 = (INT32) dataptr[6]; - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); - tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); - - tmp0 = ((INT32) dataptr[0] + (INT32) dataptr[4]) << CONST_BITS; - tmp1 = ((INT32) dataptr[0] - (INT32) dataptr[4]) << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - /* Odd part per figure 8; the matrix is unitary and hence its - * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. - */ - - tmp0 = (INT32) dataptr[7]; - tmp1 = (INT32) dataptr[5]; - tmp2 = (INT32) dataptr[3]; - tmp3 = (INT32) dataptr[1]; - - z1 = tmp0 + tmp3; - z2 = tmp1 + tmp2; - z3 = tmp0 + tmp2; - z4 = tmp1 + tmp3; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - tmp0 += z1 + z3; - tmp1 += z2 + z4; - tmp2 += z2 + z3; - tmp3 += z1 + z4; - - /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - - dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); - dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); - dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); - dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - - dataptr = data; - for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { - /* Columns of zeroes can be exploited in the same way as we did with rows. - * However, the row calculation has created many nonzero AC terms, so the - * simplification applies less often (typically 5% to 10% of the time). - * On machines with very fast multiplication, it's possible that the - * test takes more time than it's worth. In that case this section - * may be commented out. - */ - -#ifndef NO_ZERO_COLUMN_TEST - if ((dataptr[DCTSIZE*1] | dataptr[DCTSIZE*2] | dataptr[DCTSIZE*3] | - dataptr[DCTSIZE*4] | dataptr[DCTSIZE*5] | dataptr[DCTSIZE*6] | - dataptr[DCTSIZE*7]) == 0) { - /* AC terms all zero */ - DCTELEM dcval = (DCTELEM) DESCALE((INT32) dataptr[0], PASS1_BITS+3); - - dataptr[DCTSIZE*0] = dcval; - dataptr[DCTSIZE*1] = dcval; - dataptr[DCTSIZE*2] = dcval; - dataptr[DCTSIZE*3] = dcval; - dataptr[DCTSIZE*4] = dcval; - dataptr[DCTSIZE*5] = dcval; - dataptr[DCTSIZE*6] = dcval; - dataptr[DCTSIZE*7] = dcval; - - dataptr++; /* advance pointer to next column */ - continue; - } -#endif - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - - z2 = (INT32) dataptr[DCTSIZE*2]; - z3 = (INT32) dataptr[DCTSIZE*6]; - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); - tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); - - tmp0 = ((INT32) dataptr[DCTSIZE*0] + (INT32) dataptr[DCTSIZE*4]) << CONST_BITS; - tmp1 = ((INT32) dataptr[DCTSIZE*0] - (INT32) dataptr[DCTSIZE*4]) << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - /* Odd part per figure 8; the matrix is unitary and hence its - * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. - */ - - tmp0 = (INT32) dataptr[DCTSIZE*7]; - tmp1 = (INT32) dataptr[DCTSIZE*5]; - tmp2 = (INT32) dataptr[DCTSIZE*3]; - tmp3 = (INT32) dataptr[DCTSIZE*1]; - - z1 = tmp0 + tmp3; - z2 = tmp1 + tmp2; - z3 = tmp0 + tmp2; - z4 = tmp1 + tmp3; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - tmp0 += z1 + z3; - tmp1 += z2 + z4; - tmp2 += z2 + z3; - tmp3 += z1 + z4; - - /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - - dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0, - CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0, - CONST_BITS+PASS1_BITS+3); - - dataptr++; /* advance pointer to next column */ - } -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jutils.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jutils.c:1.5 xc/programs/Xserver/XIE/mixie/jpeg/jutils.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jutils.c:1.5 Fri Dec 14 14:58:40 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jutils.c Sat Feb 28 21:42:00 2004 @@ -1,238 +0,0 @@ -/* $Xorg: jutils.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jutils.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jutils.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains miscellaneous utility routines needed for both - * compression and decompression. - * Note we prefix all global names with "j" to minimize conflicts with - * a surrounding application. - */ - -#include "jinclude.h" -#include "macro.h" - - -GLOBAL long -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jround_up (long a, long b) -#else -jround_up (a, b) - long a; - long b; -#endif /* NeedFunctionPrototypes */ -#else -jround_up (long a, long b) -#endif /* XIE_SUPPORTED */ -/* Compute a rounded up to next multiple of b; a >= 0, b > 0 */ -{ - a += b-1; - return a - (a % b); -} - - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines below do it the hard way. (The performance cost - * is not all that great, because these routines aren't very heavily used.) - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ -#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case, define if we can */ -#ifdef USE_FMEM -#define FMEMCOPY(dest,src,size) _fmemcpy((pointer)(dest), (const pointer)(src), (size_t)(size)) -#define FMEMZERO(target,size) _fmemset((pointer)(target), 0, (size_t)(size)) -#endif -#endif - - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jcopy_sample_rows (JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, long num_cols) -#else -jcopy_sample_rows (input_array, source_row, - output_array, dest_row, - num_rows, num_cols) - JSAMPARRAY input_array; - int source_row; - JSAMPARRAY output_array; - int dest_row; - int num_rows; - long num_cols; -#endif /* NeedFunctionPrototypes */ -#else -jcopy_sample_rows (JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, long num_cols) -#endif /* XIE_SUPPORTED */ -/* Copy some rows of samples from one place to another. - * num_rows rows are copied from input_array[source_row++] - * to output_array[dest_row++]; these areas should not overlap. - * The source and destination arrays must be at least as wide as num_cols. - */ -{ - register JSAMPROW inptr, outptr; -#ifdef FMEMCOPY - register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#else - register long count; -#endif - register int row; - - input_array += source_row; - output_array += dest_row; - - for (row = num_rows; row > 0; row--) { - inptr = *input_array++; - outptr = *output_array++; -#ifdef FMEMCOPY - FMEMCOPY(outptr, inptr, count); -#else - for (count = num_cols; count > 0; count--) - *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ -#endif - } -} - - -#ifndef XIE_SUPPORTED -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, long num_blocks) -#else -jcopy_block_row (input_row, output_row, num_blocks) - JBLOCKROW input_row; - JBLOCKROW output_row; - long num_blocks; -#endif /* NeedFunctionPrototypes */ -#else -jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, long num_blocks) -#endif /* XIE_SUPPORTED */ -/* Copy a row of coefficient blocks from one place to another. */ -{ -#ifdef FMEMCOPY - FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); -#else - register JCOEFPTR inptr, outptr; - register long count; - - inptr = (JCOEFPTR) input_row; - outptr = (JCOEFPTR) output_row; - for (count = num_blocks * DCTSIZE2; count > 0; count--) { - *outptr++ = *inptr++; - } -#endif -} -#endif /* XIE_SUPPORTED */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jzero_far (pointer target, size_t bytestozero) -#else -jzero_far (target, bytestozero) - pointer target; - size_t bytestozero; -#endif /* NeedFunctionPrototypes */ -#else -jzero_far (pointer target, size_t bytestozero) -#endif /* XIE_SUPPORTED */ -/* Zero out a chunk of FAR memory. */ -/* This might be sample-array data, block-array data, or alloc_medium data. */ -{ -#ifdef FMEMZERO - FMEMZERO(target, bytestozero); -#else - register char FAR * ptr = (char FAR *) target; - register size_t count; - - for (count = bytestozero; count > 0; count--) { - *ptr++ = 0; - } -#endif -} Index: xc/programs/Xserver/XIE/mixie/jpeg/jwrjfif.c diff -u xc/programs/Xserver/XIE/mixie/jpeg/jwrjfif.c:1.2 xc/programs/Xserver/XIE/mixie/jpeg/jwrjfif.c:removed --- xc/programs/Xserver/XIE/mixie/jpeg/jwrjfif.c:1.2 Fri Dec 14 14:58:40 2001 +++ xc/programs/Xserver/XIE/mixie/jpeg/jwrjfif.c Sat Feb 28 21:42:00 2004 @@ -1,985 +0,0 @@ -/* $Xorg: jwrjfif.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* Module jwrjfif.c */ - -/**************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - Gary Rogers, AGE Logic, Inc., October 1993 - Gary Rogers, AGE Logic, Inc., January 1994 - -****************************************************************************/ - -/* - * jwrjfif.c - * - * Copyright (C) 1991, 1992, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains routines to write standard JPEG file headers/markers. - * The file format created is a raw JPEG data stream with (optionally) an - * APP0 marker per the JFIF spec. This will handle baseline and - * JFIF-convention JPEG files, although there is currently no provision - * for inserting a thumbnail image in the JFIF header. - * - * These routines may need modification for non-Unix environments or - * specialized applications. As they stand, they assume output to - * an ordinary stdio stream. However, the changes to write to something - * else are localized in the macros appearing just below. - * - * These routines are invoked via the methods write_file_header, - * write_scan_header, write_jpeg_data, write_scan_trailer, and - * write_file_trailer. - */ - -#include "jinclude.h" - -#ifdef JFIF_SUPPORTED - - -/* - * To output to something other than a stdio stream, you'd need to redefine - * these macros. - */ - -/* Write a single byte */ -#ifdef XIE_SUPPORTED -#define emit_byte(cinfo,x) \ - MAKESTMT( if (cinfo->bytes_in_buffer >= cinfo->jpeg_buf_size) \ - return(-1); \ - cinfo->output_buffer[cinfo->bytes_in_buffer++] = (char) (x); ) -#else -#define emit_byte(cinfo,x) putc((x), cinfo->output_file) -#endif /* XIE_SUPPORTED */ - -/* End of stdio-specific code. */ - - -typedef enum { /* JPEG marker codes */ - M_SOF0 = 0xc0, - M_SOF1 = 0xc1, - M_SOF2 = 0xc2, - M_SOF3 = 0xc3, - - M_SOF5 = 0xc5, - M_SOF6 = 0xc6, - M_SOF7 = 0xc7, - - M_JPG = 0xc8, - M_SOF9 = 0xc9, - M_SOF10 = 0xca, - M_SOF11 = 0xcb, - - M_SOF13 = 0xcd, - M_SOF14 = 0xce, - M_SOF15 = 0xcf, - - M_DHT = 0xc4, - - M_DAC = 0xcc, - - M_RST0 = 0xd0, - M_RST1 = 0xd1, - M_RST2 = 0xd2, - M_RST3 = 0xd3, - M_RST4 = 0xd4, - M_RST5 = 0xd5, - M_RST6 = 0xd6, - M_RST7 = 0xd7, - - M_SOI = 0xd8, - M_EOI = 0xd9, - M_SOS = 0xda, - M_DQT = 0xdb, - M_DNL = 0xdc, - M_DRI = 0xdd, - M_DHP = 0xde, - M_EXP = 0xdf, - - M_APP0 = 0xe0, - M_APP15 = 0xef, - - M_JPG0 = 0xf0, - M_JPG13 = 0xfd, - M_COM = 0xfe, - - M_TEM = 0x01, - - M_ERROR = 0x100 -} JPEG_MARKER; - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_marker (compress_info_ptr cinfo, JPEG_MARKER mark) -#else -emit_marker (cinfo, mark) - compress_info_ptr cinfo; - JPEG_MARKER mark; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_marker (compress_info_ptr cinfo, JPEG_MARKER mark) -#endif /* XIE_SUPPORTED */ -/* Emit a marker code */ -{ - emit_byte(cinfo, 0xFF); - emit_byte(cinfo, mark); -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_2bytes (compress_info_ptr cinfo, int value) -#else -emit_2bytes (cinfo, value) - compress_info_ptr cinfo; - int value; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_2bytes (compress_info_ptr cinfo, int value) -#endif /* XIE_SUPPORTED */ -/* Emit a 2-byte integer; these are always MSB first in JPEG files */ -{ - emit_byte(cinfo, (value >> 8) & 0xFF); - emit_byte(cinfo, value & 0xFF); -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_dqt (compress_info_ptr cinfo, int index) -#else -emit_dqt (cinfo, index) - compress_info_ptr cinfo; - int index; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_dqt (compress_info_ptr cinfo, int index) -#endif /* XIE_SUPPORTED */ -/* Emit a DQT marker */ -/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ -{ - QUANT_TBL_PTR data = cinfo->quant_tbl_ptrs[index]; - int prec = 0; - int i; - - for (i = 0; i < DCTSIZE2; i++) { - if (data[i] > 255) - prec = 1; - } - -#ifdef XIE_SUPPORTED - if (emit_marker(cinfo, M_DQT) < 0) - return(-1); - - if (emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2) < 0) - return(-1); -#else - emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2); - - emit_marker(cinfo, M_DQT); -#endif /* XIE_SUPPORTED */ - - emit_byte(cinfo, index + (prec<<4)); - - for (i = 0; i < DCTSIZE2; i++) { - if (prec) - emit_byte(cinfo, data[i] >> 8); - emit_byte(cinfo, data[i] & 0xFF); - } - - return prec; -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_dht (compress_info_ptr cinfo, int index, boolean is_ac) -#else -emit_dht (cinfo, index, is_ac) - compress_info_ptr cinfo; - int index; - boolean is_ac; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_dht (compress_info_ptr cinfo, int index, boolean is_ac) -#endif /* XIE_SUPPORTED */ -/* Emit a DHT marker */ -{ - HUFF_TBL * htbl; - int length, i; - - if (is_ac) { - htbl = cinfo->ac_huff_tbl_ptrs[index]; - index += 0x10; /* output index has AC bit set */ - } else { - htbl = cinfo->dc_huff_tbl_ptrs[index]; - } - - if (htbl == NULL) -#ifdef XIE_SUPPORTED - return(XIE_ERR); -#else - ERREXIT1(cinfo->emethods, "Huffman table 0x%02x was not defined", index); -#endif /* XIE_SUPPORTED */ - - if (! htbl->sent_table) { -#ifdef XIE_SUPPORTED - if (emit_marker(cinfo, M_DHT) < 0) - return(-1); -#else - emit_marker(cinfo, M_DHT); -#endif /* XIE_SUPPORTED */ - - length = 0; - for (i = 1; i <= 16; i++) - length += htbl->bits[i]; - -#ifdef XIE_SUPPORTED - if (emit_2bytes(cinfo, length + 2 + 1 + 16) < 0) - return(-1); -#else - emit_2bytes(cinfo, length + 2 + 1 + 16); -#endif /* XIE_SUPPORTED */ - emit_byte(cinfo, index); - - for (i = 1; i <= 16; i++) - emit_byte(cinfo, htbl->bits[i]); - - for (i = 0; i < length; i++) - emit_byte(cinfo, htbl->huffval[i]); - - htbl->sent_table = TRUE; - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_dac (compress_info_ptr cinfo) -#else -emit_dac (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_dac (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Emit a DAC marker */ -/* Since the useful info is so small, we want to emit all the tables in */ -/* one DAC marker. Therefore this routine does its own scan of the table. */ -{ - char dc_in_use[NUM_ARITH_TBLS]; - char ac_in_use[NUM_ARITH_TBLS]; - int length, i; - - for (i = 0; i < NUM_ARITH_TBLS; i++) - dc_in_use[i] = ac_in_use[i] = 0; - - for (i = 0; i < cinfo->num_components; i++) { - dc_in_use[cinfo->comp_info[i].dc_tbl_no] = 1; - ac_in_use[cinfo->comp_info[i].ac_tbl_no] = 1; - } - - length = 0; - for (i = 0; i < NUM_ARITH_TBLS; i++) - length += dc_in_use[i] + ac_in_use[i]; - -#ifdef XIE_SUPPORTED - if (emit_marker(cinfo, M_DAC) < 0) - return(-1); - - if (emit_2bytes(cinfo, length*2 + 2) < 0) - return(-1); -#else - emit_marker(cinfo, M_DAC); - - emit_2bytes(cinfo, length*2 + 2); -#endif /* XIE_SUPPORTED */ - - for (i = 0; i < NUM_ARITH_TBLS; i++) { - if (dc_in_use[i]) { - emit_byte(cinfo, i); - emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); - } - if (ac_in_use[i]) { - emit_byte(cinfo, i + 0x10); - emit_byte(cinfo, cinfo->arith_ac_K[i]); - } - } -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_dri (compress_info_ptr cinfo) -#else -emit_dri (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -/* Emit a DRI marker */ -{ - if (emit_marker(cinfo, M_DRI) < 0) - return(-1); - - if (emit_2bytes(cinfo, 4) < 0) /* fixed length */ - return(-1); - - if (emit_2bytes(cinfo, (int) cinfo->restart_interval) < 0) - return(-1); - - return(0); -} -#else -LOCAL void -emit_dri (compress_info_ptr cinfo) -/* Emit a DRI marker */ -{ - emit_marker(cinfo, M_DRI); - - emit_2bytes(cinfo, 4); /* fixed length */ - - emit_2bytes(cinfo, (int) cinfo->restart_interval); -} -#endif /* XIE_SUPPORTED */ - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_sof (compress_info_ptr cinfo, JPEG_MARKER code) -#else -emit_sof (cinfo, code) - compress_info_ptr cinfo; - JPEG_MARKER code; -#endif /* NeedFunctionPrototypes */ -/* Emit a SOF marker */ -{ - int i; - - if (emit_marker(cinfo, code) < 0) - return(-1); - - if (emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1) < 0) - return(-1); /* length */ - - if (cinfo->image_height > 65535L || cinfo->image_width > 65535L) - return(XIE_ERR); - - emit_byte(cinfo, cinfo->data_precision); - if (emit_2bytes(cinfo, (int) cinfo->image_height) < 0) - return(-1); - if (emit_2bytes(cinfo, (int) cinfo->image_width) < 0) - return(-1); - - emit_byte(cinfo, cinfo->num_components); - - for (i = 0; i < cinfo->num_components; i++) { - emit_byte(cinfo, cinfo->comp_info[i].component_id); - emit_byte(cinfo, (cinfo->comp_info[i].h_samp_factor << 4) - + cinfo->comp_info[i].v_samp_factor); - emit_byte(cinfo, cinfo->comp_info[i].quant_tbl_no); - } - return(0); -} -#else -LOCAL void -emit_sof (compress_info_ptr cinfo, JPEG_MARKER code) -/* Emit a SOF marker */ -{ - int i; - - emit_marker(cinfo, code); - - emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ - - if (cinfo->image_height > 65535L || cinfo->image_width > 65535L) - ERREXIT(cinfo->emethods, "Maximum image dimension for JFIF is 65535 pixels"); - - emit_byte(cinfo, cinfo->data_precision); - emit_2bytes(cinfo, (int) cinfo->image_height); - emit_2bytes(cinfo, (int) cinfo->image_width); - - emit_byte(cinfo, cinfo->num_components); - - for (i = 0; i < cinfo->num_components; i++) { - emit_byte(cinfo, cinfo->comp_info[i].component_id); - emit_byte(cinfo, (cinfo->comp_info[i].h_samp_factor << 4) - + cinfo->comp_info[i].v_samp_factor); - emit_byte(cinfo, cinfo->comp_info[i].quant_tbl_no); - } -} -#endif /* XIE_SUPPORTED */ - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_sos (compress_info_ptr cinfo) -#else -emit_sos (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_sos (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Emit a SOS marker */ -{ - int i; - -#ifdef XIE_SUPPORTED - if (emit_marker(cinfo, M_SOS) < 0) - return(-1); - - if (emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3) < 0) - return(-1); /* length */ -#else - emit_marker(cinfo, M_SOS); - - emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ -#endif /* XIE_SUPPORTED */ - - emit_byte(cinfo, cinfo->comps_in_scan); - - for (i = 0; i < cinfo->comps_in_scan; i++) { - emit_byte(cinfo, cinfo->cur_comp_info[i]->component_id); - emit_byte(cinfo, (cinfo->cur_comp_info[i]->dc_tbl_no << 4) - + cinfo->cur_comp_info[i]->ac_tbl_no); - } - - emit_byte(cinfo, 0); /* Spectral selection start */ - emit_byte(cinfo, DCTSIZE2-1); /* Spectral selection end */ - emit_byte(cinfo, 0); /* Successive approximation */ -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -#ifdef XIE_SUPPORTED -LOCAL int -#if NeedFunctionPrototypes -emit_jfif_app0 (compress_info_ptr cinfo) -#else -emit_jfif_app0 (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -LOCAL void -emit_jfif_app0 (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -/* Emit a JFIF-compliant APP0 marker */ -{ - /* - * Length of APP0 block (2 bytes) - * Block ID (4 bytes - ASCII "JFIF") - * Zero byte (1 byte to terminate the ID string) - * Version Major, Minor (2 bytes - 0x01, 0x01) - * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) - * Xdpu (2 bytes - dots per unit horizontal) - * Ydpu (2 bytes - dots per unit vertical) - * Thumbnail X size (1 byte) - * Thumbnail Y size (1 byte) - */ - -#ifdef XIE_SUPPORTED - if (emit_marker(cinfo, M_APP0) < 0) - return(-1); - - if (emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1) < 0) - return(-1); /* length */ -#else - emit_marker(cinfo, M_APP0); - - emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ -#endif /* XIE_SUPPORTED */ - - emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ - emit_byte(cinfo, 0x46); - emit_byte(cinfo, 0x49); - emit_byte(cinfo, 0x46); - emit_byte(cinfo, 0); - emit_byte(cinfo, 1); /* Major version */ - emit_byte(cinfo, 1); /* Minor version */ - emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ -#ifdef XIE_SUPPORTED - if (emit_2bytes(cinfo, (int) cinfo->X_density) < 0) - return(-1); - if (emit_2bytes(cinfo, (int) cinfo->Y_density) < 0) - return(-1); -#else - emit_2bytes(cinfo, (int) cinfo->X_density); - emit_2bytes(cinfo, (int) cinfo->Y_density); -#endif /* XIE_SUPPORTED */ - emit_byte(cinfo, 0); /* No thumbnail image */ - emit_byte(cinfo, 0); -#ifdef XIE_SUPPORTED - return(0); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Write the file header. - */ - - -#ifdef XIE_SUPPORTED -LOCAL boolean -#if NeedFunctionPrototypes -set_location(compress_info_ptr cinfo, int l) -#else -set_location(cinfo, l) - compress_info_ptr cinfo; - int l; -#endif /* NeedFunctionPrototypes */ -{ - if ((cinfo->XIErestart >= XIE_RWRJ) && (cinfo->XIEwrloc != l)) - return(FALSE); - - cinfo->XIEbytes_in_buffer = cinfo->bytes_in_buffer; - cinfo->XIErestart = XIE_RNUL; - cinfo->XIEwrloc = l; - - return(TRUE); -} - -METHODDEF int -#if NeedFunctionPrototypes -write_file_header (compress_info_ptr cinfo) -#else -write_file_header (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -write_file_header (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - char qt_in_use[NUM_QUANT_TBLS]; - int i, prec; - boolean is_baseline; - -#ifdef XIE_SUPPORTED - int status; - int j; - if (set_location(cinfo, 1)) { - if (emit_marker(cinfo, M_SOI) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); /* first the SOI */ - } - - if (cinfo->write_JFIF_header) { /* next an optional JFIF APP0 */ - if (emit_jfif_app0(cinfo) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - } -#else - emit_marker(cinfo, M_SOI); /* first the SOI */ - - if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ - emit_jfif_app0(cinfo); -#endif /* XIE_SUPPORTED */ - - /* Emit DQT for each quantization table. */ - /* Note that doing it here means we can't adjust the QTs on-the-fly. */ - /* If we did want to do that, we'd have a problem with checking precision */ - /* for the is_baseline determination. */ - - for (i = 0; i < NUM_QUANT_TBLS; i++) - qt_in_use[i] = 0; - - for (i = 0; i < cinfo->num_components; i++) - qt_in_use[cinfo->comp_info[i].quant_tbl_no] = 1; - - prec = 0; -#ifdef XIE_SUPPORTED - if (set_location(cinfo, 2)) { - for (i = 0; i < NUM_QUANT_TBLS; i++) { - if (qt_in_use[i]) - { - if ((j = emit_dqt(cinfo, i)) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - prec += j; - } - } - } -#else - for (i = 0; i < NUM_QUANT_TBLS; i++) { - prec += emit_dqt(cinfo, i); - } -#endif /* XIE_SUPPORTED */ - /* now prec is nonzero iff there are any 16-bit quant tables. */ - - /* Check for a non-baseline specification. */ - /* Note we assume that Huffman table numbers won't be changed later. */ - is_baseline = TRUE; - if (cinfo->arith_code || (cinfo->data_precision != 8)) - is_baseline = FALSE; - for (i = 0; i < cinfo->num_components; i++) { - if (cinfo->comp_info[i].dc_tbl_no > 1 || cinfo->comp_info[i].ac_tbl_no > 1) - is_baseline = FALSE; - } - if (prec && is_baseline) { - is_baseline = FALSE; - /* If it's baseline except for quantizer size, warn the user */ -#ifndef XIE_SUPPORTED - TRACEMS(cinfo->emethods, 0, - "Caution: quantization tables are too coarse for baseline JPEG"); -#endif /* XIE_SUPPORTED */ - } - - -#ifdef XIE_SUPPORTED - if (set_location(cinfo, 3)) { - /* Emit the proper SOF marker */ - if (cinfo->arith_code) { - if ((status = emit_sof(cinfo, M_SOF9)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); /* SOF code for arithmetic coding */ - } - } else if (is_baseline) { - if ((status = emit_sof(cinfo, M_SOF0)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); /* SOF code for baseline implementation */ - } - } else { - if ((status = emit_sof(cinfo, M_SOF1)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); /* SOF code for non-baseline Huffman file */ - } - } - } - return(0); -#else - /* Emit the proper SOF marker */ - if (cinfo->arith_code) - emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ - else if (is_baseline) - emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ - else - emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ -#endif /* XIE_SUPPORTED */ -} - - -/* - * Write the start of a scan (everything through the SOS marker). - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -write_scan_header (compress_info_ptr cinfo) -#else -write_scan_header (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -METHODDEF void -write_scan_header (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - int i; -#ifdef XIE_SUPPORTED - int status; - int l = 0; -#endif /* XIE_SUPPORTED */ - - if (cinfo->arith_code) { - /* Emit arith conditioning info. We will have some duplication - * if the file has multiple scans, but it's so small it's hardly - * worth worrying about. - */ -#ifdef XIE_SUPPORTED - if (set_location(cinfo, l++)) { - if (emit_dac(cinfo) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } -#else - emit_dac(cinfo); -#endif /* XIE_SUPPORTED */ - } else { - /* Emit Huffman tables. Note that emit_dht takes care of - * suppressing duplicate tables. - */ -#ifdef XIE_SUPPORTED - for (i = 0; i < cinfo->comps_in_scan; i++) { - if (set_location(cinfo, l++)) { - if ((status = - emit_dht(cinfo, cinfo->cur_comp_info[i]->dc_tbl_no, FALSE)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - if (set_location(cinfo, l++)) { - if ((status = - emit_dht(cinfo, cinfo->cur_comp_info[i]->ac_tbl_no, TRUE)) < 0) { - if (status == XIE_ERR) - return(XIE_ERR); - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - } -#else - for (i = 0; i < cinfo->comps_in_scan; i++) { - emit_dht(cinfo, cinfo->cur_comp_info[i]->dc_tbl_no, FALSE); - emit_dht(cinfo, cinfo->cur_comp_info[i]->ac_tbl_no, TRUE); - } -#endif /* XIE_SUPPORTED */ - } - - /* Emit DRI if required --- note that DRI value could change for each scan. - * If it doesn't, a tiny amount of space is wasted in multiple-scan files. - * We assume DRI will never be nonzero for one scan and zero for a later one. - */ -#ifdef XIE_SUPPORTED - if (cinfo->restart_interval) { - if (set_location(cinfo, l++)) { - if (emit_dri(cinfo) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - } - - if (set_location(cinfo, l)) { - if (emit_sos(cinfo) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - return(0); -#else - if (cinfo->restart_interval) - emit_dri(cinfo); - - emit_sos(cinfo); -#endif /* XIE_SUPPORTED */ -} - - -/* - * Write some bytes of compressed data within a scan. - */ - -#ifndef XIE_SUPPORTED -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -write_jpeg_data (compress_info_ptr cinfo, char *dataptr, int datacount) -#else -write_jpeg_data (cinfo, dataptr, datacount) - compress_info_ptr cinfo; - char *dataptr; - int datacount; -#endif /* NeedFunctionPrototypes */ -#else -write_jpeg_data (compress_info_ptr cinfo, char *dataptr, int datacount) -#endif /* XIE_SUPPORTED */ -{ -#ifndef XIE_SUPPORTED - size_t i; - /* Write some bytes from a (char *) buffer */ - if ((i = JFWRITE(cinfo->output_file, dataptr, datacount)) - != (size_t) (datacount)) - ERREXIT(cinfo->emethods, "Output file write error"); -#endif /* XIE_SUPPORTED */ -} -#endif /* XIE_SUPPORTED */ - -/* - * Finish up after a compressed scan (series of write_jpeg_data calls). - */ - -METHODDEF void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -write_scan_trailer (compress_info_ptr cinfo) -#else -write_scan_trailer (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -write_scan_trailer (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - /* no work needed in this format */ -} - - -/* - * Finish up at the end of the file. - */ - -#ifdef XIE_SUPPORTED -METHODDEF int -#if NeedFunctionPrototypes -write_file_trailer (compress_info_ptr cinfo) -#else -write_file_trailer (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -{ - if (set_location(cinfo, 1)) { - if (emit_marker(cinfo, M_EOI) < 0) { - cinfo->bytes_in_buffer = cinfo->XIEbytes_in_buffer; - cinfo->XIErestart = XIE_RWRJ; - return(XIE_OUT); - } - } - return(0); -} -#else -METHODDEF void -write_file_trailer (compress_info_ptr cinfo) -{ - int i; - emit_marker(cinfo, M_EOI); - /* Make sure we wrote the output file OK */ - /* Clean up and verify successful output */ - fflush(cinfo->output_file); - if ((i = ferror(cinfo->output_file))) - ERREXIT(cinfo->emethods, "Output file write error"); -} -#endif /* XIE_SUPPORTED */ - - -/* - * The method selection routine for standard JPEG header writing. - * This should be called from c_ui_method_selection if appropriate. - */ - -GLOBAL void -#ifdef XIE_SUPPORTED -#if NeedFunctionPrototypes -jselwjfif (compress_info_ptr cinfo) -#else -jselwjfif (cinfo) - compress_info_ptr cinfo; -#endif /* NeedFunctionPrototypes */ -#else -jselwjfif (compress_info_ptr cinfo) -#endif /* XIE_SUPPORTED */ -{ - cinfo->methods->write_file_header = write_file_header; - cinfo->methods->write_scan_header = write_scan_header; -#ifndef XIE_SUPPORTED - cinfo->methods->write_jpeg_data = write_jpeg_data; -#endif - cinfo->methods->write_scan_trailer = write_scan_trailer; - cinfo->methods->write_file_trailer = write_file_trailer; -} - -#endif /* JFIF_SUPPORTED */ Index: xc/programs/Xserver/XIE/mixie/process/Imakefile diff -u xc/programs/Xserver/XIE/mixie/process/Imakefile:3.6 xc/programs/Xserver/XIE/mixie/process/Imakefile:removed --- xc/programs/Xserver/XIE/mixie/process/Imakefile:3.6 Wed Jan 17 17:13:10 2001 +++ xc/programs/Xserver/XIE/mixie/process/Imakefile Sat Feb 28 21:42:00 2004 @@ -1,43 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:49 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/XIE/mixie/process/Imakefile,v 3.6 2001/01/17 22:13:10 dawes Exp $ - -XCOMM build device dependent machine independent process element objs - -#define IHaveModules -#include - -SRCS1 = bitfun.c mpgeom.c mpgeomaa.c mpgeomnn.c mppoint.c -OBJS1 = bitfun.o mpgeom.o mpgeomaa.o mpgeomnn.o mppoint.o - -#if BuildDIS -DEFINES = -DXIE_DIS -#else -SRCS2 = mparith.c mpbandc.c mpbande.c mpbands.c mpblend.c mpcfromi.c \ - mpcnst.c mpcomp.c mpconv.c mpctoi.c mpdither.c mphist.c \ - mplogic.c mppaste.c mprgb.c mpuncnst.c -OBJS2 = mparith.o mpbandc.o mpbande.o mpbands.o mpblend.o mpcfromi.o \ - mpcnst.o mpcomp.o mpconv.o mpctoi.o mpdither.o mphist.o \ - mplogic.o mppaste.o mprgb.o mpuncnst.o -#endif - - SRCS = $(SRCS1) $(SRCS2) - - OBJS = $(OBJS1) $(OBJS2) - - INCLUDES = -I../include -I../../include -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(XINCLUDESRC)/extensions - LINTLIBS = ../../dixie/export/llib-lexp.ln ../../dixie/import/llib-limp.ln \ - ../../dixie/process/llib-lproc.ln ../../dixie/request/llib-lreq.ln \ - ../control/llib-lctrl.ln ../export/llib-lmexp.ln ../fax/llib-lfax.ln \ - ../import/llib-lmimp.ln ../jpeg/llib-ljpeg.ln ../process/llib-lmproc.ln - -ModuleObjectRule() - -SubdirLibraryRule($(OBJS)) -LintLibraryTarget(mproc,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/XIE/mixie/process/bitfun.c diff -u xc/programs/Xserver/XIE/mixie/process/bitfun.c:1.5 xc/programs/Xserver/XIE/mixie/process/bitfun.c:removed --- xc/programs/Xserver/XIE/mixie/process/bitfun.c:1.5 Fri Dec 14 14:58:42 2001 +++ xc/programs/Xserver/XIE/mixie/process/bitfun.c Sat Feb 28 21:42:00 2004 @@ -1,428 +0,0 @@ -/* $Xorg: bitfun.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/**** module bitfun.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - bitfun.c -- DDXIE utilities for bits and other fun things. - - Larry Hare -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/bitfun.c,v 1.5 2001/12/14 19:58:42 dawes Exp $ */ - -#define _XIEC_MPBITFUN - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include - -#include "xiemd.h" - -/*--------------------------------------------------------------------------- --------------------------------- bitexpand -------------------------------- ----------------------------------------------------------------------------*/ - -/* -** Following routine is used to expand a length of bit pixels to byte -** pixels. Similar routines could be written for other pixels sizes -** but currently we don't really support them (eg 4 bits) or doesnt -** really speed them up (16 bits). -** -** You could also do this with any other bit expansion tricks you -** have up your sleeve. For instance, you could look up 8 bits -** at a time, and have a table of 256 long longs; or use your -** favorite graphics accelerator, or ... bitfun. -*/ - - -CARD32 xie8StippleMasks[16] = { -0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, -0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, -0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, -0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff, -}; - -/* byte reversal table */ -unsigned char _ByteReverseTable[]= { - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff - -}; - -#if (IMAGE_BYTE_ORDER == MSBFirst) -#define g4 (c = (inval>>26) & 0x3c, inval <<= 4, \ - *((CARD32 *) ((int) &xie8StippleMasks[0] + c)) & val) -#define g4r (c = (inval>>26) & 0x3c, inval <<= 4, \ - ~(*((CARD32 *) ((int) &xie8StippleMasks[0] + c))) & val) -#define g4b (c = (inval>>26) & 0x3c, inval <<= 4, \ - c = *((CARD32 *) ((int) &xie8StippleMasks[0] + c)), \ - (loval & ~c) | (hival & c)) -#else -#define g4 (c = inval & 0xf, inval >>= 4, xie8StippleMasks[c] & val) -#define g4r (c = inval & 0xf, inval >>= 4, ~xie8StippleMasks[c] & val) -#define g4b (c = inval & 0xf, inval >>= 4, c = xie8StippleMasks[c], \ - (loval & ~c) | (hival & c)) -#endif - -#define p4 *outp++ - -pointer bitexpand(inp,outp,bw,olow,ohigh) - CARD32 *inp; /* these are actualy bits... */ - CARD32 *outp; /* its actually bytes but ... */ - int bw; /* number of bits to extract */ - unsigned char olow; /* zero bit maps to this */ - unsigned char ohigh; /* one bit maps to this */ -{ - pointer dst = (pointer)outp; - int nw; - CARD32 inval, c; - if (olow == 0) { - CARD32 val = ohigh; - val = (val << 8) | val; val = (val << 16) | val; - for ( nw = bw >> 5; nw > 0; nw--) { - inval = *inp++; - p4 = g4; p4 = g4; p4 = g4; p4 = g4; - p4 = g4; p4 = g4; p4 = g4; p4 = g4; - } - if ((bw &= 31) > 0) - for (inval = *inp; bw > 0; bw -= 4) - p4 = g4; - } else if (ohigh == 0) { - CARD32 val = olow; - val = (val << 8) | val; val = (val << 16) | val; - for ( nw = bw >> 5; nw > 0; nw--) { - inval = *inp++; - p4 = g4r; p4 = g4r; p4 = g4r; p4 = g4r; - p4 = g4r; p4 = g4r; p4 = g4r; p4 = g4r; - } - if ((bw &= 31) > 0) - for (inval = *inp; bw > 0; bw -= 4) - p4 = g4r; - } else { - CARD32 loval = olow, hival = ohigh; - loval = (loval << 8) | loval; loval = (loval << 16) | loval; - hival = (hival << 8) | hival; hival = (hival << 16) | hival; - for ( nw = bw >> 5; nw > 0; nw--) { - inval = *inp++; - p4 = g4b; p4 = g4b; p4 = g4b; p4 = g4b; - p4 = g4b; p4 = g4b; p4 = g4b; p4 = g4b; - } - if ((bw &= 31) > 0) - for (inval = *inp; bw > 0; bw -= 4) - p4 = g4b; - } - /******** - if (bw > 0) - for (M=LOGLEFT, inval = *inp++; bw; bw--, LOGRIGHT(M)) - *outp++ = (inval & M) ? ohigh : olow ; - *********/ - return(dst); -} - -/* byte to bit converter - * everything less than "threshold" becomes a zero - */ -void -bitshrink(src,dst,width,threshold) - unsigned char *src, *dst, threshold; - int width; -{ - BytePixel *i = src; - LogInt *o = (LogInt*)dst, M, v; - int bw; - - for(bw = width; bw >= LOGSIZE; *o++ = v, bw -= LOGSIZE) - for(v = 0, M = LOGLEFT; M; LOGRIGHT(M)) if(*i++ >= threshold) v |= M; - if(bw > 0) { - for(v = 0, M = LOGLEFT; bw--; LOGRIGHT(M)) if(*i++ >= threshold) v |= M; - *o++ = v; - } -} - -/*------------------------------------------------------------------------ ------------------- Bit manipulation in ROI section ----------------------- -------------------------------------------------------------------------*/ - -/* -** The following routines are used to turn a set of bits in a ROI extent -** of a scanline to 0's, to 1's, or to invert them. 'ix' is the starting -** bit number, and 'run' is the number of bits. The routines can be -** applied to eg BytePixel arrays by scaling the coordinates appropriately. -*/ - -void -action_clear(d, run, ix) /* turn off bits in region */ - LogInt *d; - int run, ix; -{ - int sbit = ix & LOGMASK; - - ix >>= LOGSHIFT; d += ix; - if ((sbit + run) >= LOGSIZE) { - if (sbit) { - *d &= ~(BitRight(LOGONES,sbit)); - run -= (LOGSIZE - sbit); d++; - } - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--) { - *d++ = 0; - } - if (run &= LOGMASK) { - *d &= BitRight(LOGONES,run); - } - } else { - *d &= ~(BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run))); - } -} - -void -action_set(d, run, ix) /* turn on bits in region */ - LogInt *d; - int run, ix; -{ - int sbit = ix & LOGMASK; - - ix >>= LOGSHIFT; d += ix; - if ((sbit + run) >= LOGSIZE) { - if (sbit) { - *d |= BitRight(LOGONES,sbit); - run -= (LOGSIZE - sbit); d++; - } - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--) { - *d++ = LOGONES; - } - if (run &= LOGMASK) { - *d |= ~BitRight(LOGONES,run); - } - } else { - *d |= (BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run))); - } -} - -void -action_invert(d, run, ix) /* invert bits in region */ - LogInt *d; - int run, ix; -{ - int sbit = ix & LOGMASK; - - ix >>= LOGSHIFT; d += ix; - if ((sbit + run) >= LOGSIZE) { - if (sbit) { - *d ^= BitRight(LOGONES,sbit); - run -= (LOGSIZE - sbit); d++; - } - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--) { - *d++ ^= LOGONES; - } - if (run &= LOGMASK) { - *d ^= ~BitRight(LOGONES,run); - } - } else { - *d ^= (BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run))); - } -} - -/*------------------------------------------------------------------------ ------------------------- Pixel Copy in ROI section ----------------------- -------------------------------------------------------------------------*/ -/* -** NOTE: Nominally used to copy src1 to destination in the passive -** regions of a ROI. To implement this efficiently we have a variety -** of issues and choices: -** a) Simply call memcpy for the correct number of bytes. -** b) Simply call passcopy_bit below for the correct # of bits. -** d) For small number, do a while loop, else call memcpy or passocpy_bit. -** NOTE: do not call if s == d, or if s overlaps d. -*/ - -/* (*(pvt->passive)) (dvoid, svoid, -run, ix); */ - -void passcopy_byte(d,s,dx,x) - BytePixel *d, *s; - CARD32 dx, x; -{ - d += x; - s += x; - if (dx < 15) while (dx-- > 0) *d++ = *s++; - else memcpy (d, s, dx); -} - -void passcopy_pair(d,s,dx,x) - PairPixel *d, *s; - CARD32 dx, x; -{ - d += x; - s += x; - if (dx < 12) while (dx-- > 0) *d++ = *s++; - else memcpy (d, s, dx << 1); -} - -void passcopy_quad(d,s,dx,x) - QuadPixel *d, *s; - CARD32 dx, x; -{ - d += x; - s += x; - if (dx < 8) while (dx-- > 0) *d++ = *s++; - else memcpy (d, s, dx << 2); -} - -void passcopy_real(d,s,dx,x) - RealPixel *d, *s; - CARD32 dx, x; -{ - d += x; - s += x; - if (dx < 8) while (dx-- > 0) *d++ = *s++; - else memcpy (d, s, dx << 2); -} - -void -passcopy_bit(d,s,dx,x) - LogInt *d, *s; - CARD32 dx, x; -{ - CARD32 sbit = x & LOGMASK; - LogInt M; - - x >>= LOGSHIFT; s += x; d += x; - - if ((sbit + dx) >= LOGSIZE) { - if (sbit) { - M = BitRight(LOGONES,sbit); - *d = (*d & ~M) | (*s & M); - dx -= (LOGSIZE - sbit); d++; s++; - } - for (sbit = dx >> LOGSHIFT; sbit > 0; sbit--) { - *d++ = *s++; - } - if (dx &= LOGMASK) { - M = ~BitRight(LOGONES,dx); - *d = (*d & ~M) | (*s & M); - } - } else { - M = (BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+dx))); - *d = (*d & ~M) | (*s & M); - } -} - -void (*passive_copy[5])() = { - passcopy_real, passcopy_bit, passcopy_byte, passcopy_pair, passcopy_quad -}; - -/**** module bitfun.c ****/ Index: xc/programs/Xserver/XIE/mixie/process/mparith.c diff -u xc/programs/Xserver/XIE/mixie/process/mparith.c:3.5 xc/programs/Xserver/XIE/mixie/process/mparith.c:removed --- xc/programs/Xserver/XIE/mixie/process/mparith.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mparith.c Sat Feb 28 21:42:00 2004 @@ -1,1185 +0,0 @@ -/* $Xorg: mparith.c,v 1.6 2001/02/09 02:04:29 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mparith.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mparith.c -- DDXIE arithmetic and math element - - Larry Hare -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mparith.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - - -#define _XIEC_MPARITH -#define _XIEC_PARITH - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - /* - ** Most machines will work fine using the double precision versions - ** of the math functions. If they give you problems, or if you - ** want a bit more speed, then pick one of the following sets of - ** defines. Enjoy. While you are thinking about this you might - ** want to consider changing the cube root function in mprgb.c - ** with fpow(x,1./3.) or powf(x,1./3.). Another similar area is - ** in mpgeomaa.c for the gaussian technique. - */ - -#if defined(USE_EXPF) - /* - ** The very newest ANSI-C libraries promote this style of floating - ** functions. Even if you have these available, you may need to - ** use special compiler options, and prototypes from math.h - */ -# define exp expf -# define log logf -# define pow powf -# define sqrt sqrtf -#endif - -#if defined(USE_FEXP) - /* - ** This is the more antique way to get floating math functions. But - ** you may have to use compiler options or otherwise stand on your - ** head to do this safely. Otherwise the argument may get promoted. - */ -# define exp fexp -# define log flog -# define pow fpow -# define sqrt fsqrt -#endif - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeArith(); -int miAnalyzeMath(); - -/* - * routines used internal to this module - */ -static int CreateArith(); -static int InitializeArith(); -static int ResetArith(); -static int DestroyArith(); - -static int ActivateArithMROI(); -static int ActivateArithDROI(); -static int SetupArith(); -static void ClearArith(); /* and Math */ - -static int CreateMath(); -static int InitializeMath(); -static int SetupMath(); - -/* - * DDXIE Arithmetic and Math entry points - */ -static ddElemVecRec ArithVec = { - CreateArith, - InitializeArith, - (xieIntProc) NULL, - (xieIntProc) NULL, - ResetArith, - DestroyArith - }; - -static ddElemVecRec MathVec = { - CreateMath, - InitializeMath, - ActivateArithMROI, /* yes, arith */ - (xieIntProc) NULL, - ResetArith, /* yes, arith */ - DestroyArith /* yes, arith */ - }; - -/* -* Local Declarations. -*/ - -typedef struct _mparithdef { - void (*action) (); /* to do arithmetic */ - void (*passive) (); /* to copy src1 in passive areas */ - CARD32 *lutptr; /* in case we do a lookup */ - CARD32 nlev; /* integer clipping */ - CARD32 nclip; /* integer clipping */ - CARD32 iconstant; - RealPixel fconstant; -} mpArithPvtRec, *mpArithPvtPtr; /* also used for Math */ - -/* -** NOTE: What happens if element is run over and over with same -** parameters. If we are using a LUT, should we try to keep it? -** If KEEP_LUTS is enabled, then we build any required luts in -** the Create routine and free them in Destroy. Otherwise we do -** so in Initialize and Reset. This is more important on -** operations like divide on non-fpu machines. -*/ - -#define KEEP_LUTS - - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = ArithVec; - return TRUE; -} - -int miAnalyzeMath(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = MathVec; - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* always force syncing between inputs (is nop if only one input) */ - if (!MakePETex(flo,ped, - xieValMaxBands * sizeof(mpArithPvtRec), - SYNC, /* InSync: */ - NO_SYNC /* bandSync: */)) - return FALSE; - -#if defined(KEEP_LUTS) - if (!SetupArith(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - return TRUE; - -} - -static int CreateMath(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* always force syncing between inputs (is nop if only one input) */ - if (!MakePETex(flo,ped, - xieValMaxBands * sizeof(mpArithPvtRec), - SYNC, /* InSync: */ - NO_SYNC /* bandSync: */)) - return FALSE; - -#if defined(KEEP_LUTS) - if (!SetupMath(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - return TRUE; - -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ - -static int InitializeArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloArithmetic *raw = (xieFloArithmetic *) ped->elemRaw; - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - CARD8 msk = raw->bandMask; - -#if !defined(KEEP_LUTS) - if (!SetupArith(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - ped->ddVec.activate = raw->src2 ? ActivateArithDROI : ActivateArithMROI; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - rcp[ped->inCnt-1].band[0].replicate = msk; - - InitReceptor(flo, ped, &rcp[SRCt1], NO_DATAMAP, 1, msk, ~msk); - - if (raw->src2) - InitReceptor(flo, ped, &rcp[SRCt2], NO_DATAMAP, 1, msk, NO_BANDS); - - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY); - InitEmitter(flo, ped, NO_DATAMAP, SRCt1); - - return !ferrCode(flo); -} - -static int InitializeMath(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloMath *raw = (xieFloMath *) ped->elemRaw; - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - CARD8 msk = raw->bandMask; - -#if !defined(KEEP_LUTS) - if (!SetupMath(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - if (raw->domainPhototag) - rcp[ped->inCnt-1].band[0].replicate = msk; - InitReceptor(flo, ped, &rcp[SRCt1], NO_DATAMAP, 1, msk, ~msk); - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY); - InitEmitter(flo, ped, NO_DATAMAP, SRCt1); - - return !ferrCode(flo); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - -static int ActivateArithMROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpArithPvtPtr pvt = (mpArithPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, dband++) { - pointer svoid, dvoid; - - if (!(pet->scheduled & 1< 0) { - (*(pvt->action)) (dvoid, svoid, run, ix, pvt); - ix += run; - } else { - if (dvoid != svoid) - (*(pvt->passive)) (dvoid, svoid, -run, ix); - ix -= run; - } - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - FreeData(flo, pet, sband, sband->current); - } - return TRUE; -} - -static int ActivateArithDROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpArithPvtPtr pvt = (mpArithPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, tband++, dband++) { - pointer svoid, tvoid, dvoid; - CARD32 w; - - if (!(pet->scheduled & 1<format->width; - if (w > tband->format->width) w = tband->format->width; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(tvoid = GetCurrentSrc(flo,pet,tband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) continue; - - while (!ferrCode(flo) && svoid && tvoid && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - INT32 run, ix = 0; - - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - /* needs to clip to second source, yuck */ - if ((ix + run) > w) { - if (ix < w) - (*(pvt->action)) (dvoid,svoid,tvoid, w-ix, ix, pvt); - if (dvoid != svoid) { - run = sband->format->width - w; - if (run > 0) - (*(pvt->passive)) (dvoid, svoid, run, w); - } - break; - } - (*(pvt->action)) (dvoid, svoid, tvoid, run, ix, pvt); - ix += run; - } else { - if (dvoid != svoid) - (*(pvt->passive)) (dvoid, svoid, -run, ix); - ix -= run; - } - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - tvoid = GetNextSrc(flo,pet,tband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - if(!svoid && sband->final) { - DisableSrc(flo,pet,tband,FLUSH); - } else if(!tvoid && tband->final) { - BypassSrc(flo,pet,sband); - } else { - /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sband,sband->current); - FreeData(flo,pet,tband,tband->current); - } - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - -#if !defined(KEEP_LUTS) - ClearArith(flo,ped); -#endif - - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - -#if defined(KEEP_LUTS) - ClearArith(flo,ped); -#endif - - /* get rid of the peTex structure and private structures */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -/* xieTypArithmeticOp -** -** #define xieValAdd 1 -** #define xieValSub 2 -** #define xieValSubRev 3 -** #define xieValMul 4 -** #define xieValDiv 5 -** #define xieValDivRev 6 -** #define xieValMin 7 -** #define xieValMax 8 -** #define xieValGamma 9 -** -** xieTypMathOp -** -** #define xieValExp 1 -** #define xieValLn 2 -** #define xieValLog2 3 -** #define xieValLog10 4 -** #define xieValSquare 5 -** #define xieValSqrt 6 -*/ - -#define NADA 0 - -#define AADD D = S1 + S2; if (D >= nlev) D = nlev - 1; -#define ASUB D = (S1 > S2) ? S1 - S2 : 0; -#define ASUBREV D = (S2 > S1) ? S2 - S1 : 0; -#define AMIN D = S1 < S2 ? S1 : S2; -#define AMAX D = S1 > S2 ? S1 : S2; - - -#define FADD D = S1 + S2; -#define FSUB D = S1 - S2; -#define FSUBREV D = S2 - S1; -#define FMUL D = S1 * S2; -#define FDIV D = S1 / S2; -#define FDIVREV D = S1 ? S2 / S1 : S2; -#define FMIN D = S1 < S2 ? S1 : S2; -#define FMAX D = S1 > S2 ? S1 : S2; - /* beware float vs double */ - /* consider using fpow() if available */ -#define FGAM D = pow(S1,S2); -#define IFGAM D = (nlev - 1) * pow(S1/(nlev-1),S2); - -#define BADD D = S1 | S2; -#define BSUB D = S1 & ~S2; -#define BSUBREV D = S2 & ~S1; -#define BMUL D = S1 & S2; -#define BDIV D = S1; -#define BDIVREV D = S2; -#define BMIN D = S1 & S2; /* same as BMUL */ -#define BMAX D = S1 | S2; /* same as BADD */ -#define BGAM D = S1; - - -/*------------------------------------------------------------------------ ---------------------- ROI operations work on subranges ------------------ -------------------------------------------------------------------------*/ - -/* MROI: (*(pvt->action)) (dvoid, src1, run, ix, pvt); */ -/* DROI: (*(pvt->action)) (dvoid, src1, src2, run, ix, pvt); */ - -#define MakeLutI(name1, expr) \ -static void name1(pvt) \ - mpArithPvtPtr pvt; \ -{ \ - CARD32 *lut = pvt->lutptr; \ - CARD32 nlev = pvt->nlev; \ - CARD32 nclip = pvt->nclip; \ - CARD32 i; \ - CARD32 D, S1, S2 = pvt->iconstant; \ - for ( i = 0; i < nlev ; i++) { \ - S1 = i; \ - expr; \ - lut[i] = D; \ - } \ - for ( ; i < nclip ; i++) { \ - lut[i] = 0; \ - } \ -} - -#define MakeLutF2(name1, expr) \ -static void name1(pvt) \ - mpArithPvtPtr pvt; \ -{ \ - CARD32 *lut = pvt->lutptr; \ - CARD32 nlev = pvt->nlev; \ - CARD32 nclip = pvt->nclip; \ - RealPixel Half = (RealPixel) .5; \ - RealPixel dlev = (RealPixel) nlev - Half; \ - RealPixel D, S1, S2 = pvt->fconstant; \ - CARD32 i; \ - for ( i = 0; i < nlev ; i++) { \ - S1 = i; \ - expr; \ - D += .5; \ - if (D < 0.) D = 0; \ - else if (D > dlev) D = dlev; \ - lut[i] = D; \ - } \ - for ( ; i < nclip ; i++) { \ - lut[i] = 0; \ - } \ -} - -#define MakeLutF1(name1, expr) \ -static void name1(pvt) \ - mpArithPvtPtr pvt; \ -{ \ - CARD32 *lut = pvt->lutptr; \ - CARD32 nlev = pvt->nlev; \ - CARD32 nclip = pvt->nclip; \ - RealPixel Half = (RealPixel) .5; \ - RealPixel dlev = (RealPixel) nlev - Half; \ - RealPixel D, S1; \ - CARD32 i; \ - for ( i = 0; i < nlev ; i++) { \ - S1 = i; \ - expr; \ - D += .5; \ - if (D < 0.) D = 0; \ - else if (D > dlev) D = dlev; \ - lut[i] = D; \ - } \ - for ( ; i < nclip ; i++) { \ - lut[i] = 0; \ - } \ -} - -#define MakeLook(name1, itype) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - itype *dst = ((itype *) dst1) + x; \ - itype *src = ((itype *) src1) + x; \ - CARD32 *lut = pvt->lutptr; \ - CARD32 nmask = pvt->nclip - 1; \ - for ( ; nx > 0 ; nx--) { \ - *dst++ = lut[*src++ & nmask]; \ - } \ -} - -MakeLutI(pr_a, AADD ) -MakeLutI(pr_s, ASUB ) -MakeLutI(pr_sr, ASUBREV ) -MakeLutI(pr_mn, AMIN ) -MakeLutI(pr_mx, AMAX ) - -MakeLutF2(pr_m, FMUL ) -MakeLutF2(pr_d, FDIV ) -MakeLutF2(pr_dr, FDIVREV ) -MakeLutF2(pr_gm, IFGAM ) - -static void (*prep_mono[xieValGamma])() = { -pr_a, pr_s, pr_sr, pr_m, pr_d, pr_dr, pr_mn, pr_mx, pr_gm -}; - -MakeLook(lr_B, BytePixel) -MakeLook(lr_P, PairPixel) -MakeLook(lr_Q, QuadPixel) - -static void (*action_lut[5])() = { - NADA, - NADA, - lr_B, - lr_P, - lr_Q -}; - - - -/* -** NOTE: -** The MakePixI and MakePixF? macros may be used to synthesize monadic -** action routines which can be used in place of look up table based -** routines. They were actually tested at one point in time. The -** invocations still remain below, and the routines can be plugged -** into the action_monoROI[itype][operator] table below. As noted -** elsewhere, these routines might be more appropriate for bigger -** pixels to avoid lookup table explosion; or for machines without -** a data cache, or a very small data cache. IN summary, which -** of these routines should be used depends on: -** a) existence of data cache? -** b) size, organization, and fill method of data cache? -** c) speed of floating operations -*/ - -#define MakePixI(name1, itype, expr) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - itype *dst = (itype *) dst1; \ - itype *src = (itype *) src1; \ - CARD32 nlev = pvt->nlev; \ - CARD32 D, S1, S2 = (itype) pvt->iconstant; \ - for ( ; nx > 0 ; nx--, x++) { \ - S1 = src[x]; \ - expr \ - dst[x] = D; \ - } \ -} - -#define MakePixF2(name1, itype, expr) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - itype *dst = (itype *) dst1; \ - itype *src = (itype *) src1; \ - RealPixel Half = (RealPixel) .5; \ - RealPixel dlev = (RealPixel) pvt->nlev - Half; \ - RealPixel D, S1, S2 = (itype) pvt->fconstant; \ - for ( ; nx > 0 ; nx--, x++) { \ - S1 = (RealPixel) src[x]; \ - expr \ - D += Half; \ - if (D < 0.) D = 0; \ - else if (D > dlev) D = dlev; \ - dst[x] = (itype) D; \ - } \ -} - -#define MakePixF1(name1, itype, expr) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - itype *dst = (itype *) dst1; \ - itype *src = (itype *) src1; \ - RealPixel Half = (RealPixel) .5; \ - RealPixel dlev = (RealPixel) pvt->nlev - Half; \ - RealPixel D, S1; \ - for ( ; nx > 0 ; nx--, x++) { \ - S1 = (RealPixel) src[x]; \ - expr \ - D += Half; \ - if (D < 0.) D = 0; \ - else if (D > dlev) D = dlev; \ - dst[x] = (itype) D; \ - } \ -} - -#define DakePix(name2, itype, expr) \ -static void name2(dst1,src1,src2,nx,x,pvt) \ - pointer dst1, src1, src2; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - itype *dst = ((itype *) dst1) + x; \ - itype *src = ((itype *) src1) + x; \ - itype *trc = ((itype *) src2) + x; \ - CARD32 nlev = pvt->nlev; \ - CARD32 D, S1, S2; \ - for ( ; nx > 0 ; nx--) { \ - S1 = *src++; \ - S2 = *trc++; \ - expr \ - *dst++ = D; \ - } \ -} - -#define MakeFlt2(name1, expr) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - RealPixel *dst = ((RealPixel *) dst1) + x; \ - RealPixel *src = ((RealPixel *) src1) + x; \ - RealPixel D, S1, S2 = pvt->fconstant; \ - for ( ; nx > 0 ; nx--) { \ - S1 = *src++; \ - expr \ - *dst++ = D; \ - } \ -} - -#define MakeFlt1(name1, expr) \ -static void name1(dst1,src1,nx,x,pvt) \ - pointer dst1, src1; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - RealPixel *dst = ((RealPixel *) dst1) + x; \ - RealPixel *src = ((RealPixel *) src1) + x; \ - RealPixel D, S1; \ - for ( ; nx > 0 ; nx--) { \ - S1 = *src++; \ - expr \ - *dst++ = D; \ - } \ -} - -#define DakeFlt(name2, expr) \ -static void name2(dst1,src1,src2,nx,x,pvt) \ - pointer dst1, src1, src2; \ - CARD32 nx, x; \ - mpArithPvtPtr pvt; \ -{ \ - RealPixel *dst = ((RealPixel *) dst1) + x; \ - RealPixel *src = ((RealPixel *) src1) + x; \ - RealPixel *trc = ((RealPixel *) src2) + x; \ - RealPixel D, S1, S2; \ - for ( ; nx > 0 ; nx--) { \ - S1 = *src++; \ - S2 = *trc++; \ - expr \ - *dst++ = D; \ - } \ -} - -/* Bits no longer required by protocol */ -#define mr_b_a NADA -#define mr_b_s NADA -#define mr_b_sr NADA -#define mr_b_m NADA -#define mr_b_d NADA -#define mr_b_dr NADA -#define mr_b_mn NADA -#define mr_b_mx NADA -#define mr_b_gm NADA - -#define dr_b_a NADA -#define dr_b_s NADA -#define dr_b_sr NADA -#define dr_b_mn NADA -#define dr_b_mx NADA - -/* MakePixI (mr_B_a, BytePixel, AADD ) */ -/* MakePixI (mr_B_s, BytePixel, ASUB ) */ -/* MakePixI (mr_B_sr, BytePixel, ASUBREV ) */ -/* MakePixI (mr_B_mn, BytePixel, AMIN ) */ -/* MakePixI (mr_B_mx, BytePixel, AMAX ) */ - -/* MakePixF2 (mr_B_m, BytePixel, FMUL ) */ -/* MakePixF2 (mr_B_d, BytePixel, FDIV ) */ -/* MakePixF2 (mr_B_dr, BytePixel, FDIVREV ) */ -/* MakePixF2 (mr_B_gm, BytePixel, IFGAM ) */ - - DakePix (dr_B_a, BytePixel, AADD ) - DakePix (dr_B_s, BytePixel, ASUB ) - DakePix (dr_B_sr, BytePixel, ASUBREV ) - DakePix (dr_B_mn, BytePixel, AMIN ) - DakePix (dr_B_mx, BytePixel, AMAX ) - -/* MakePixI (mr_P_a, PairPixel, AADD ) */ -/* MakePixI (mr_P_s, PairPixel, ASUB ) */ -/* MakePixI (mr_P_sr, PairPixel, ASUBREV ) */ -/* MakePixI (mr_P_mn, PairPixel, AMIN ) */ -/* MakePixI (mr_P_mx, PairPixel, AMAX ) */ - -/* MakePixF2 (mr_P_m, PairPixel, FMUL ) */ -/* MakePixF2 (mr_P_d, PairPixel, FDIV ) */ -/* MakePixF2 (mr_P_dr, PairPixel, FDIVREV ) */ -/* MakePixF2 (mr_P_gm, PairPixel, IFGAM ) */ - - DakePix (dr_P_a, PairPixel, AADD ) - DakePix (dr_P_s, PairPixel, ASUB ) - DakePix (dr_P_sr, PairPixel, ASUBREV ) - DakePix (dr_P_mn, PairPixel, AMIN ) - DakePix (dr_P_mx, PairPixel, AMAX ) - -/* MakePixI (mr_Q_a, QuadPixel, AADD ) */ -/* MakePixI (mr_Q_s, QuadPixel, ASUB ) */ -/* MakePixI (mr_Q_sr, QuadPixel, ASUBREV ) */ -/* MakePixI (mr_Q_mn, QuadPixel, AMIN ) */ -/* MakePixI (mr_Q_mx, QuadPixel, AMAX ) */ - -/* MakePixF2 (mr_Q_m, QuadPixel, FMUL ) */ -/* MakePixF2 (mr_Q_d, QuadPixel, FDIV ) */ -/* MakePixF2 (mr_Q_dr, QuadPixel, FDIVREV ) */ -/* MakePixF2 (mr_Q_gm, QuadPixel, IFGAM ) */ - - DakePix (dr_Q_a, QuadPixel, AADD ) - DakePix (dr_Q_s, QuadPixel, ASUB ) - DakePix (dr_Q_sr, QuadPixel, ASUBREV ) - DakePix (dr_Q_mn, QuadPixel, AMIN ) - DakePix (dr_Q_mx, QuadPixel, AMAX ) - -MakeFlt2 (mr_R_a, FADD ) -MakeFlt2 (mr_R_s, FSUB ) -MakeFlt2 (mr_R_sr, FSUBREV ) -MakeFlt2 (mr_R_m, FMUL ) -MakeFlt2 (mr_R_d, FDIV ) -MakeFlt2 (mr_R_dr, FDIVREV ) -MakeFlt2 (mr_R_mn, FMIN ) -MakeFlt2 (mr_R_mx, FMAX ) -MakeFlt2 (mr_R_gm, FGAM ) - -DakeFlt (dr_R_a, FADD ) -DakeFlt (dr_R_s, FSUB ) -DakeFlt (dr_R_sr, FSUBREV ) -DakeFlt (dr_R_mn, FMIN ) -DakeFlt (dr_R_mx, FMAX ) - -/* -ADD, SUB, SUBREV, MUL, DIV, DIVREV, MIN, MAX, GAMMA -*/ - -static void (*action_monoROI[5][xieValGamma])() = { -mr_R_a, mr_R_s, mr_R_sr, mr_R_m, mr_R_d, mr_R_dr, mr_R_mn, mr_R_mx, mr_R_gm, -mr_b_a, mr_b_s, mr_b_sr, mr_b_m, mr_b_d, mr_b_dr, mr_b_mn, mr_b_mx, mr_b_gm, -NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA, -NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA, -NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA, NADA -}; - -static void (*action_dyadROI[5][xieValGamma])() = { -dr_R_a, dr_R_s, dr_R_sr, NADA, NADA, NADA, dr_R_mn, dr_R_mx, NADA, -dr_b_a, dr_b_s, dr_b_sr, NADA, NADA, NADA, dr_b_mn, dr_b_mx, NADA, -dr_B_a, dr_B_s, dr_B_sr, NADA, NADA, NADA, dr_B_mn, dr_B_mx, NADA, -dr_P_a, dr_P_s, dr_P_sr, NADA, NADA, NADA, dr_P_mn, dr_P_mx, NADA, -dr_Q_a, dr_Q_s, dr_Q_sr, NADA, NADA, NADA, dr_Q_mn, dr_Q_mx, NADA -}; - - -extern void (*passive_copy[5])(); - -/*------------------------------------------------------------------------ --------------------------- . . . Math Sandbox . . . ---------------------- -------------------------------------------------------------------------*/ - -/* -** Math NOTES: -** #define xieValExp 1 -** #define xieValLn 2 -** #define xieValLog2 3 -** #define xieValLog10 4 -** #define xieValSquare 5 -** #define xieValSqrt 6 -** -** log(==0) is -infinity with divide by zero exception. sigh. -** log( <0) is quiet NaN with invalid operation exception, sigh. -** sqrt(<0) might be error, 0., or -sqrt(-x) ??? -** -** for log2(), it may be quicker to count bits for integer arguments :-) -** -** also, not all machines have a log2 and log10 in their math library -** so we multiply log() by the magic values M_LOG2E and M_LOG10E. -** -** one can argue that taking logs and exponents and such of small -** integers is a somewhat frenetic exercise. while it might make -** sense to use square or squareroot as an image contrast enhancer, -** it doesn't make sense when applied to small integers either. -** -** just for the heck of it, here are some values for small inputs: -** i log2 logN log10 exp sqrt square -** 0 -Inf -Inf -Inf 1 0 0 -** 1 0 0 0 2.718 1 1 -** 2 1 0.6931 0.301 7.389 1.414 4 -** 3 1.585 1.099 0.4771 20.09 1.732 9 -** 4 2 1.386 0.6021 54.6 2 16 -** 5 2.322 1.609 0.699 148.4 2.236 25 -** -** also note that LN_MAXFLOAT (or LN_MAXDOUBLE) and MAXFLOAT are -** typically defined in values.h, but including it conflicts with -** misc.h on many machines. values.h isn't a very modern .h file -** as standards go these days. help..... -*/ - -#ifndef M_LOG2E -#define M_LOG2E 1.4426950408889634074 -#endif - -#ifndef M_LOG10E -#define M_LOG10E 0.43429448190325182765 -#endif - -#ifndef LN_MAXFLOAT -#define LN_MAXFLOAT 88.7228394 -#endif - -#ifndef MAXFLOAT -#define MAXFLOAT ((float)3.40282346638528860e+38) -#endif - -#define BANY D = S1; -#define FEXP D = (S1 <= (LN_MAXFLOAT-2.) ? exp(S1) : MAXFLOAT); -#define FLGN D = (S1 > 0. ? log(S1) : 0. ); -#define FLG2 D = (S1 > 0. ? log(S1) * M_LOG2E : 0. ); -#define FLG10 D = (S1 > 0. ? log(S1) * M_LOG10E : 0. ); -#define FSQR D = S1 * S1; -#define FSQRT D = (S1 >= 0. ? sqrt(S1) : 0. ); - -MakeLutF1(mpr_exp, FEXP ) -MakeLutF1(mpr_lgN, FLGN ) -MakeLutF1(mpr_lg2, FLG2 ) -MakeLutF1(mpr_lg10, FLG10) -MakeLutF1(mpr_sqr, FSQR ) -MakeLutF1(mpr_sqrt, FSQRT) - - -/* Bits no longer required by protocol */ -#define m_b_exp NADA -#define m_b_lgN NADA -#define m_b_lg2 NADA -#define m_b_lg10 NADA -#define m_b_sqr NADA -#define m_b_sqrt NADA - -MakePixF1 (m_P_sqr, PairPixel, FSQR) /* ??? or use LUT */ -MakePixF1 (m_Q_sqr, QuadPixel, FSQR) - -MakeFlt1 (m_R_exp, FEXP ) -MakeFlt1 (m_R_lgN, FLGN ) -MakeFlt1 (m_R_lg2, FLG2 ) -MakeFlt1 (m_R_lg10, FLG10 ) -MakeFlt1 (m_R_sqr, FSQR ) -MakeFlt1 (m_R_sqrt, FSQRT ) - -static void (*action_mathROI[5][xieValSqrt])() = { -/* EXP, LOG, LOG2, LOG10, SQUARE, SQRT */ -m_R_exp, m_R_lgN, m_R_lg2, m_R_lg10, m_R_sqr, m_R_sqrt, /* floats */ -m_b_exp, m_b_lgN, m_b_lg2, m_b_lg10, m_b_sqr, m_b_sqrt, /* bits */ -NADA, NADA, NADA, NADA, NADA, NADA, /* bytes */ -NADA, NADA, NADA, NADA, m_P_sqr, NADA, /* pairs */ -NADA, NADA, NADA, NADA, m_Q_sqr, NADA /* quads */ -/* EXP, LOG, LOG2, LOG10, SQUARE, SQRT */ -}; - -static void (*prep_math[xieValSqrt])() = { -mpr_exp, mpr_lgN, mpr_lg2, mpr_lg10, mpr_sqr, mpr_sqrt -}; - -/*------------------------------------------------------------------------ --------------------------- initialize element . . . ---------------------- -------------------------------------------------------------------------*/ - -static int SetupArith(flo,ped,modify) - floDefPtr flo; - peDefPtr ped; - int modify; -{ - xieFloArithmetic *raw = (xieFloArithmetic *) ped->elemRaw; - peTexPtr pet = ped->peTex; - pArithDefPtr epvt = (pArithDefPtr) ped->elemPvt; - mpArithPvtPtr pvt = (mpArithPvtPtr) pet->private; - receptorPtr rcp = pet->receptor; - CARD32 nbands = rcp[SRCt1].inFlo->bands; - bandPtr sband = &(rcp[SRCt1].band[0]); - bandPtr tband = &(rcp[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD32 band; - - for (band=0; bandformat->class); - void (*act)() = 0; - - if ((raw->bandMask & (1<src2) /* only used for mul, div, divrev, gamma */ - pvt->fconstant = (RealPixel) epvt->constant[band]; - - switch(raw->operator) { - case xieValDiv: if (pvt->fconstant == 0.0) /* epsilon ?? */ - pvt->fconstant = 1.0; - break; - } - - if (IsConstrained(sband->format->class)) { - pvt->nlev = sband->format->levels; - if (!raw->src2) { - CARD32 deep; - SetDepthFromLevels(pvt->nlev,deep); pvt->nclip = 1 << deep; - /* only used for add, sub, subrev, min, max */ - pvt->iconstant = ConstrainConst(epvt->constant[band],pvt->nlev); - } - } - - /* Try to find a dyadic operator */ - if (!act && raw->src2) - act = action_dyadROI[iclass][raw->operator-1]; - - /* - ** NOTE: - ** For larger pixels a look up table begins to be less - ** attractive since the malloc is larger, it takes longer - ** to compute, and the cache hit rate may go down. So - ** we may want to add more actual monodaic arithmetic - ** elements to the table (see MakePixel, it worked once - ** upon a time) and choose between an arithmetic and lookup - ** version based on number of levels. - */ - - /* Try to find a monadic operator */ - if (!act && !raw->src2) - act = action_monoROI[iclass][raw->operator-1]; - - /* Or maybe a monadic look up table op */ - if (!act && !raw->src2) { - act = action_lut[iclass]; - if (act) { - /* Allocate Lut and Fill it in */ - if (!(pvt->lutptr = (CARD32 *) - XieMalloc(pvt->nclip * sizeof(CARD32)))) - AllocError(flo,ped,return(FALSE)); - (*prep_mono[raw->operator-1]) (pvt); - } - } - - if (!act) - ImplementationError(flo,ped,return(FALSE)); - pvt->action = act; - pvt->passive = passive_copy[iclass]; - } - return TRUE; -} - -static int SetupMath(flo,ped,modify) - floDefPtr flo; - peDefPtr ped; - int modify; -{ - xieFloMath *raw = (xieFloMath *) ped->elemRaw; - peTexPtr pet = ped->peTex; - mpArithPvtPtr pvt = (mpArithPvtPtr) pet->private; - receptorPtr rcp = pet->receptor; - CARD32 nbands = rcp[SRCt1].inFlo->bands; - bandPtr sband = &(rcp[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD32 band; - - for (band=0; bandformat->class); - void (*act)() = 0; - - if ((raw->bandMask & (1<format->class)) { - CARD32 deep; - pvt->nlev = sband->format->levels; - SetDepthFromLevels(pvt->nlev,deep); pvt->nclip = 1 << deep; - } - - /* - ** NOTE: - ** For larger sized pixels, a lookup table my be counter - ** productive. In addition to the malloc space (eg 64k - ** words), and the low cache hit rate, the time to fill the - ** lookup table can become significant. Even for medium - ** sized pixels, some sort of hashed cache might be a - ** better solution. But I seriously doubt anyone will - ** use these operations on integer pixels very much ... - */ - - /* Try to find a monadic operator */ - if (!act) - act = action_mathROI[iclass][raw->operator-1]; - - /* Or maybe a monadic look up table operator */ - if (!act) { - act = action_lut[iclass]; - if (act) { - /* Allocate Lut and Fill it in */ - if (!(pvt->lutptr = (CARD32 *) - XieMalloc(pvt->nclip * sizeof(CARD32)))) - AllocError(flo,ped,return(FALSE)); - (*prep_math[raw->operator-1]) (pvt); - } - } - if (!act) - ImplementationError(flo,ped,return(FALSE)); - - pvt->action = act; - pvt->passive = passive_copy[iclass]; - } - return TRUE; -} - -static void ClearArith(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpArithPvtPtr pvt = (mpArithPvtPtr) (ped->peTex->private); - int band; - - /* free any dynamic private data */ - if (pvt) - for (band = 0 ; band < xieValMaxBands ; band++, pvt++) - if (pvt->lutptr) - pvt->lutptr = (CARD32 *) XieFree(pvt->lutptr); - -} - -/* end module mparith.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpbandc.c diff -u xc/programs/Xserver/XIE/mixie/process/mpbandc.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpbandc.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpbandc.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpbandc.c Sat Feb 28 21:42:00 2004 @@ -1,234 +0,0 @@ -/* $Xorg: mpbandc.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/**** module mpbandc.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpbandc.c -- DDXIE BandCombine element - - Robert NC Shelley -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpbandc.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - -#define _XIEC_MPBANDC -#define _XIEC_PBANDC - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeBandCom(); - -/* routines used internal to this module - */ -static int CreateBandCom(); -static int InitializeBandCom(); -static int ActivateBandCom(); -static int ResetBandCom(); -static int DestroyBandCom(); - -/* DDXIE BandCombine entry points - */ -static ddElemVecRec BandComVec = { - CreateBandCom, - InitializeBandCom, - ActivateBandCom, - (xieIntProc)NULL, - ResetBandCom, - DestroyBandCom - }; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeBandCom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = BandComVec; - - return(TRUE); -} /* end miAnalyzeBandCom */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateBandCom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC); -} /* end CreateBandCom */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeBandCom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - return - InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE); -} /* end InitializeBandCom */ - - -/*------------------------------------------------------------------------ ------------------------- crank some single input data -------------------- -------------------------------------------------------------------------*/ -static int ActivateBandCom(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - receptorPtr rcp = pet->receptor; - bandPtr sbnd, dbnd = pet->emitter; - CARD32 b; - - /* pass input from the 3 receptors to the corresponding output band - */ - for(b = 0; b < xieValMaxBands; ++rcp, ++dbnd, ++b) { - sbnd = rcp->band; - if(!GetCurrentSrc(flo,pet,sbnd)) continue; - - do { - /* pass a clone of the current src strip downstream - */ - if(!PassStrip(flo,pet,dbnd,sbnd->strip)) - return(FALSE); - } while(GetSrc(flo,pet,sbnd,sbnd->maxLocal,FLUSH)); - - FreeData(flo,pet,sbnd,sbnd->maxLocal); - } - return(TRUE); -} /* end ActivateBandCom */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetBandCom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetBandCom */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyBandCom(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyBandCom */ - -/* end module mpbandc.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpbande.c diff -u xc/programs/Xserver/XIE/mixie/process/mpbande.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpbande.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpbande.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpbande.c Sat Feb 28 21:42:00 2004 @@ -1,552 +0,0 @@ -/* $Xorg: mpbande.c,v 1.4 2001/02/09 02:04:29 xorgcvs Exp $ */ -/**** module mpbande.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpbande.c -- DDXIE BandExtract element - - Robert NC Shelley -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpbande.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - -#define _XIEC_MPBANDE -#define _XIEC_PBANDE - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeBandExt(); - -/* routines used internal to this module - */ -static int CreateBandExt(); -static int InitializeBandExt(); -static int ActivateBandExt(); -static int ResetBandExt(); -static int DestroyBandExt(); - -/* DDXIE BandExtract entry points - */ -static ddElemVecRec BandExtVec = { - CreateBandExt, - InitializeBandExt, - ActivateBandExt, - (xieIntProc)NULL, - ResetBandExt, - DestroyBandExt - }; - -/* Local Declarations. - */ -typedef float bndExtFlt; -typedef int bndExtInt; -#define BE_FBITS 6 -#define BE_IBITS 32-BE_FBITS -#define BE_LIMIT (1<ddVec = BandExtVec; - - return(TRUE); -} /* end miAnalyzeBandExt */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateBandExt(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, sizeof(mpBandExtRec), NO_SYNC, SYNC); -} /* end CreateBandExt */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeBandExt(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - formatPtr ift = &ped->inFloLst[SRCtag].format[0]; - formatPtr oft = &ped->outFlo.format[0]; - pBandExtDefPtr dix = (pBandExtDefPtr)ped->elemPvt; - mpBandExtPtr ddx = (mpBandExtPtr) pet->private; - bandMsk msk = 0; - - if(IsntConstrained(ift->class)) { - /* - * the choice here is easy -- have to do floating calculation of each pixel - */ - ddx->extract = extRR; - ddx->coef[0] = dix->coef[0]; - ddx->coef[1] = dix->coef[1]; - ddx->coef[2] = dix->coef[2]; - ddx->fbias = dix->bias; - msk = ALL_BANDS; - } else { - int size, b, i, ic = ift->class, shift[xieValMaxBands]; - Bool match = TRUE; - bndExtFlt val, lo = dix->bias, hi = dix->bias; - - /* first we'll examine the numbers we have to work with... - */ - for(b = 0; b < xieValMaxBands; ++b) { - if((val = dix->coef[b]) < 0.0) - lo += val * (ift[b].levels-1); - else - hi += val * (ift[b].levels-1); - if(ift[b].levels <= 2 || (bndExtFlt)(i = val) != val || !i || i & i-1) - shift[b] = ift[b].levels < 2 || val == 0.0 ? -1 : 0; - else - SetDepthFromLevels((int)val,shift[b]); /* coef is a power of 2 */ - match &= ic == ift[b].class; - } - if(val = hi >= BE_LIMIT ? hi : lo <= -BE_LIMIT ? lo : 0.0) - ValueError(flo,ped,(int)val, return(FALSE)); - - /* if all bands share a common data class, see if we have an extractor, - * else we'll have to accumulate input, then convert to the output class - */ - if(match && (ddx->extract = action_extract[oft->class-1][ic-1])) - msk = ALL_BANDS; - else if(ddx->accumulator = - (bndExtInt*) XieMalloc(oft->width*sizeof(bndExtInt))) - ddx->output = action_output[oft->class-1]; - else - AllocError(flo,ped, return(FALSE)); - - /* init the control parameters for the action routines - */ - ddx->clip = lo < 0.0 || hi >= oft->levels; - ddx->shift = ddx->extract && shift[0] > 0 && shift[1] > 0 && shift[2] > 0; - ddx->ibias = dix->bias * (ddx->shift ? 1 : (1<shift && !ddx->clip && ddx->extract == extBB) { - ddx->extract = extB4; /* we can use the turbo multi-byte shifter */ - ddx->ibias |= ddx->ibias << 8; - ddx->ibias |= ddx->ibias << 16; - } - for(b = 0; b < xieValMaxBands; ++b) { - if(!ddx->shift && ddx->extract || shift[b] == 0) { - /* - * build luts and assign accumulator functions - */ - size = 1<bits[b] = size-1; - if(!(ddx->lut[b] = (bndExtInt*) XieMalloc(size * sizeof(bndExtInt)))) - AllocError(flo,ped, return(FALSE)); - - for(i = 0; i < ift[b].levels; ++i) - ddx->lut[b][i] = dix->coef[b] * (i<lut[b][i++] = 0; - } else if(shift[b] > 0) { - /* - * coef is an exact power of 2, so just use a left shift count - */ - ddx->bits[b] = shift[b] + ((ddx->shift ? 0 : BE_FBITS) - - (dix->coef[b] == 1.0 ? 1 : 0)); - } - if(!ddx->extract && shift[b] >= 0) { - /* - * assign accumulator function and add this band to the active mask - */ - ddx->accumulate[b] = action_accumulate[ift[b].class-1]; - msk |= 1<receptor[SRCtag],NO_DATAMAP,1,msk,NO_BANDS) - && InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeBandExt */ - - -/*------------------------------------------------------------------------ ------------------------- crank some single input data -------------------- -------------------------------------------------------------------------*/ -static int ActivateBandExt(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpBandExtPtr ddx = (mpBandExtPtr) pet->private; - bandPtr ib = &pet->receptor[SRCtag].band[0]; - bandPtr ob = &pet->emitter[0]; - bndExtInt *acc = ddx->accumulator; - formatPtr oft = ob->format; - CARD32 b, i, width = oft->width; - CARD32 maxLev = oft->levels-1; - bandMsk ok, ready = pet->scheduled; - pointer o, i0 = NULL, i1 = NULL, i2 = NULL; - - ok = NO_BANDS; - if(ready & 1 && (i0 = GetCurrentSrc(flo,pet,&ib[0]))) ok |= 1; - if(ready & 2 && (i1 = GetCurrentSrc(flo,pet,&ib[1]))) ok |= 2; - if(ready & 4 && (i2 = GetCurrentSrc(flo,pet,&ib[2]))) ok |= 4; - if((o = GetCurrentDst(flo,pet,ob)) && ok == ready) - do { - /* if we have a "full service" extractor, go for the whole enchalada - */ - if( ddx->extract) - (*ddx->extract)(o, i0, i1, i2, width, maxLev, ddx); - else { - /* initialize accumulator with the bias value - */ - if(ddx->ibias) - for(i = 0; i < width; acc[i++] = ddx->ibias); - else - bzero((char *)acc, width * sizeof(bndExtInt)); - - /* accumulate data from each active band, then convert to output class - */ - if( ddx->accumulate[0]) - (*ddx->accumulate[0])(acc, i0, width, ddx->bits[0], ddx->lut[0]); - if( ddx->accumulate[1]) - (*ddx->accumulate[1])(acc, i1, width, ddx->bits[1], ddx->lut[1]); - if( ddx->accumulate[2]) - (*ddx->accumulate[2])(acc, i2, width, ddx->bits[2], ddx->lut[2]); - (*ddx->output)(o, acc, width, maxLev, ddx->clip); - } - ok = NO_BANDS; - if(ready & 1 && (i0 = GetNextSrc(flo,pet,&ib[0],FLUSH))) ok |= 1; - if(ready & 2 && (i1 = GetNextSrc(flo,pet,&ib[1],FLUSH))) ok |= 2; - if(ready & 4 && (i2 = GetNextSrc(flo,pet,&ib[2],FLUSH))) ok |= 4; - } while((o = GetNextDst(flo,pet,ob,FLUSH)) && ok == ready); - - /* free the input data we used - */ - for(b = 0; b < xieValMaxBands; ++b) - if(ready & 1<peTex->private; - CARD32 b = xieValMaxBands; - - if(ddx->accumulator) - ddx->accumulator = (bndExtInt*)XieFree(ddx->accumulator); - - while(b--) { - if(ddx->lut[b]) - ddx->lut[b] = (bndExtInt*) XieFree(ddx->lut[b]); - ddx->accumulate[b] = (xieVoidProc)NULL; - } - ddx->extract = (xieVoidProc)NULL; - ddx->output = (xieVoidProc)NULL; - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetBandExt */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyBandExt(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyBandExt */ - -/*------------------------------------------------------------------------ ---------- extract functions -- used when input data classes match -------- -------------------------------------------------------------------------*/ -static void extB4(O, I0, I1, I2, width, dummy, ddx) - pointer O, I0, I1, I2; CARD32 width, dummy; mpBandExtPtr ddx; -{ - QuadPixel *o = (QuadPixel*)O; - QuadPixel *i0 = (QuadPixel*)I0, *i1 = (QuadPixel*)I1, *i2 = (QuadPixel*)I2; - bndExtInt b0 = ddx->bits[0], b1 = ddx->bits[1], b2 = ddx->bits[2]; - bndExtInt d = ddx->ibias; - int i, w = width+3>>2; - - for(i = 0; i < w; ++i) - *o++ = (i0[i]<coef[0], c1 = ddx->coef[1], c2 = ddx->coef[2], - d = ddx->fbias; - int i; - for(i = 0; i < width; ++i) - o[i] = i0[i] * c0 + i1[i] * c1 + i2[i] * c2 + d; -} - -#define BAND_EXTRACT(name,otype,itype) \ -static void name(O, I0, I1, I2, width, maxLev, ddx) \ - pointer O, I0, I1, I2; CARD32 width, maxLev; mpBandExtPtr ddx; \ -{ \ - otype *o = (otype*)O; \ - itype *i0 = (itype*)I0, *i1 = (itype*)I1, *i2 = (itype*)I2; \ - bndExtInt b0 = ddx->bits[0], b1 = ddx->bits[1], b2 = ddx->bits[2]; \ - bndExtInt d = ddx->ibias; \ - int i; \ - if(ddx->shift) { \ - if(ddx->clip) \ - for(i = 0; i < width; ++i) { \ - int tmp = (i0[i]< maxLev) *o++ = maxLev; \ - else *o++ = tmp; \ - } \ - else \ - for(i = 0; i < width; ++i) \ - *o++ = (i0[i]<lut[0], *L1 = ddx->lut[1], *L2 = ddx->lut[2]; \ - if(ddx->clip) { \ - bndExtInt limit = (maxLev+1)<= limit) *o++ = maxLev; \ - else *o++ = tmp>>BE_FBITS; \ - } \ - } else \ - for(i = 0; i < width; ++i) \ - *o++ = L0[i0[i] & b0]+L1[i1[i] & b1]+L2[i2[i] & b2]+d>>BE_FBITS;\ - } \ -} -BAND_EXTRACT(extBB,BytePixel,BytePixel) -BAND_EXTRACT(extBP,BytePixel,PairPixel) -BAND_EXTRACT(extPB,PairPixel,BytePixel) -BAND_EXTRACT(extPP,PairPixel,PairPixel) -BAND_EXTRACT(extQB,QuadPixel,BytePixel) -BAND_EXTRACT(extQP,QuadPixel,PairPixel) - -/*------------------------------------------------------------------------ ----- accumulator functions (accumulate products from individual bands) --- -------------------------------------------------------------------------*/ -static void acc_b(acc, SRC, width, dummy, lut) - bndExtInt *acc; pointer SRC; CARD32 width; bndExtInt dummy, *lut; -{ - LogInt *i = (LogInt *)SRC, ival, M; - bndExtInt *o = (bndExtInt*)acc, c = lut[1]; - int bw = width; - int nw = bw >> LOGSHIFT; - while(nw--) - for(ival = *i++,M = LOGLEFT; M; ++o, LOGRIGHT(M)) if(ival & M) *o += c; - if(bw &= LOGMASK) - for(ival = *i, M = LOGLEFT; bw--; ++o, LOGRIGHT(M)) if(ival & M) *o += c; -} - -#define BAND_ACCUMULATE(name,itype) \ -static void name(acc, SRC, width, bits, lut) \ - bndExtInt *acc; pointer SRC; CARD32 width; bndExtInt bits, *lut; \ -{ \ - itype *src = (itype*)SRC; \ - int i = 0; \ - if(lut) while(i < width) acc[i++] += lut[*src++ & bits]; \ - else while(i < width) acc[i++] += *src++ << bits; \ -} -BAND_ACCUMULATE(acc_B,BytePixel) -BAND_ACCUMULATE(acc_P,PairPixel) - -/*------------------------------------------------------------------------ ----- output functions (convert accumulated data to output data class) ---- -------------------------------------------------------------------------*/ -static void out_b(DST, acc, width, dummy1, dummy2) - pointer DST; bndExtInt *acc; CARD32 width, dummy1; Bool dummy2; -{ - bndExtInt *i = acc; - LogInt *o = (LogInt*)DST, M, v; - int bw; - for(bw = width; bw >= LOGSIZE; *o++ = v, bw -= LOGSIZE) - for(v = 0, M = LOGLEFT; M; LOGRIGHT(M)) if(*i++ > 0) v |= M; - if(bw > 0) { - for(v = 0, M = LOGLEFT; bw--; LOGRIGHT(M)) if(*i++ > 0) v |= M; - *o++ = v; - } -} - -#define BAND_OUTPUT(name,otype) \ -static void name(DST, acc, width, maxLev, clip) \ - pointer DST; bndExtInt *acc; CARD32 width, maxLev; Bool clip; \ -{ \ - otype *dst = (otype*)DST; \ - bndExtInt limit = (maxLev+1)<= limit) *dst++ = maxLev; \ - else *dst++ = tmp >> BE_FBITS; \ - else \ - while(i < width) *dst++ = acc[i++] >> BE_FBITS; \ -} -BAND_OUTPUT(out_B,BytePixel) -BAND_OUTPUT(out_P,PairPixel) -BAND_OUTPUT(out_Q,QuadPixel) - -/* end module mpbande.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpbands.c diff -u xc/programs/Xserver/XIE/mixie/process/mpbands.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpbands.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpbands.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpbands.c Sat Feb 28 21:42:00 2004 @@ -1,240 +0,0 @@ -/* $Xorg: mpbands.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/**** module mpbands.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpbands.c -- DDXIE BandSelect element - - Robert NC Shelley -- AGE Logic, Inc. September, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpbands.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - -#define _XIEC_MPBANDS -#define _XIEC_PBANDS - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeBandSel(); - -/* routines used internal to this module - */ -static int CreateBandSel(); -static int InitializeBandSel(); -static int ActivateBandSel(); -static int ResetBandSel(); -static int DestroyBandSel(); - -/* DDXIE BandSelect entry points - */ -static ddElemVecRec BandSelVec = { - CreateBandSel, - InitializeBandSel, - ActivateBandSel, - (xieIntProc)NULL, - ResetBandSel, - DestroyBandSel - }; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeBandSel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = BandSelVec; - - return(TRUE); -} /* end miAnalyzeBandSel */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateBandSel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - return MakePETex(flo, ped, NO_PRIVATE, NO_SYNC, NO_SYNC); -} /* end CreateBandSel */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeBandSel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloBandSelect *raw = (xieFloBandSelect *)ped->elemRaw; - - if(raw->bandNumber) - return(InitReceptor(flo,ped,&ped->peTex->receptor[SRCtag],NO_DATAMAP,1, - (bandMsk)(1<bandNumber),NO_BANDS) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); - else - return(InitReceptor(flo,ped,&ped->peTex->receptor[SRCtag],NO_DATAMAP,1, - NO_BANDS,(bandMsk)1)); -} /* end InitializeBandSel */ - - -/*------------------------------------------------------------------------ ---------------------------- pass some input data ------------------------- -------------------------------------------------------------------------*/ -static int ActivateBandSel(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloBandSelect *raw = (xieFloBandSelect*)ped->elemRaw; - bandPtr sbnd = &pet->receptor->band[raw->bandNumber]; - bandPtr dbnd = pet->emitter; - - /* pass the chosen receptor band to our output band - */ - if(GetCurrentSrc(flo,pet,sbnd)) { - do { - /* pass a clone of the current src strip downstream - */ - if(!PassStrip(flo,pet,dbnd,sbnd->strip)) - return(FALSE); - } while(GetSrc(flo,pet,sbnd,sbnd->maxLocal,FLUSH)); - - FreeData(flo,pet,sbnd,sbnd->maxLocal); - } - return(TRUE); -} /* end ActivateBandSel */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetBandSel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloBandSelect *raw = (xieFloBandSelect *)ped->elemRaw; - - if(raw->bandNumber) { - ResetReceptors(ped); - ResetEmitter(ped); - } - return(TRUE); -} /* end ResetBandSel */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyBandSel(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyBandSel */ - -/* end module mpbands.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpblend.c diff -u xc/programs/Xserver/XIE/mixie/process/mpblend.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpblend.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpblend.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpblend.c Sat Feb 28 21:42:00 2004 @@ -1,908 +0,0 @@ -/* $Xorg: mpblend.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpblend.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpblend.c -- DDXIE Blend element - - Dean Verheiden -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpblend.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - -#define _XIEC_MPBLEND -#define _XIEC_PBLEND - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - - -typedef float BlendFloat; -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeBlend(); - -/* - * routines used internal to this module - */ -static int CreateBlend(); -static int ResetBlend(); -static int DestroyBlend(); - -static int InitializeMonoBlend(); -static int InitializeDualBlend(); -static int InitializeMonoAlphaBlend(); -static int InitializeDualAlphaBlend(); - -static int MonoBlend(); -static int DualBlend(); -static int MonoAlphaBlend(); -static int DualAlphaBlend(); - - -/* - * DDXIE Blend entry points - */ -static ddElemVecRec BlendVec = { - CreateBlend, - (xieIntProc)NULL, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetBlend, - DestroyBlend - }; - -/* - * Local Declarations. - */ - -typedef struct _mpblenddef { - void (*action) (); -} mpBlendPvtRec, *mpBlendPvtPtr; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - pBlendDefPtr pvt = (pBlendDefPtr)ped->elemPvt; - CARD16 aindex = pvt->aindex; - - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = BlendVec; - if (aindex) { - if (raw->src2) { - ped->ddVec.initialize = InitializeDualAlphaBlend; - ped->ddVec.activate = DualAlphaBlend; - } else { - ped->ddVec.initialize = InitializeMonoAlphaBlend; - ped->ddVec.activate = MonoAlphaBlend; - } - } else { - if (raw->src2) { - ped->ddVec.initialize = InitializeDualBlend; - ped->ddVec.activate = DualBlend; - } else { - ped->ddVec.initialize = InitializeMonoBlend; - ped->ddVec.activate = MonoBlend; - } - } - - return(TRUE); -} /* end miAnalyzeBlend */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpBlendPvtRec); - - /* always force syncing between inputs (is nop if only one input) */ - return MakePETex(flo, ped, auxsize, SYNC , NO_SYNC); -} /* end CreateBlend */ - - -static void MonoR(), MonoQ(), MonoP(), MonoB(); -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeMonoBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - CARD8 msk = raw->bandMask; - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - mpBlendPvtPtr pvt = (mpBlendPvtPtr) pet->private; - int band, nbands; - bandPtr iband; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - if (!(InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,msk,~msk) && - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY) && - InitEmitter(flo,ped,NO_DATAMAP,SRCt1))) - return (FALSE); - - /* Figure out the appropriate action vector */ - nbands = pet->receptor[SRCtag].inFlo->bands; - iband = &(pet->receptor[SRCtag].band[0]); - for(band = 0; band < nbands; band++, pvt++, iband++) { - switch (iband->format->class) { - case UNCONSTRAINED: pvt->action = MonoR; break; - case QUAD_PIXEL: pvt->action = MonoQ; break; - case PAIR_PIXEL: pvt->action = MonoP; break; - case BYTE_PIXEL: pvt->action = MonoB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, return(FALSE)); - break; - } - } - - return( TRUE ); -} /* end InitializeMonoBlend */ - -static void DualR(), DualQ(), DualP(), DualB(); -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeDualBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - peTexPtr pet = ped->peTex; - CARD8 msk = raw->bandMask; - receptorPtr rcp = pet->receptor; - mpBlendPvtPtr pvt = (mpBlendPvtPtr) pet->private; - int band, nbands; - bandPtr iband; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - if (!(InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,msk,~msk) && - InitReceptor(flo,ped,&rcp[SRCt2],NO_DATAMAP,1,msk,NO_BANDS) && - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY) && - InitEmitter(flo,ped,0,SRCt1))) - return (FALSE); - - /* Figure out the appropriate action vector */ - nbands = pet->receptor[SRCtag].inFlo->bands; - iband = &(pet->receptor[SRCtag].band[0]); - for(band = 0; band < nbands; band++, pvt++, iband++) { - switch (iband->format->class) { - case UNCONSTRAINED: pvt->action = DualR; break; - case QUAD_PIXEL: pvt->action = DualQ; break; - case PAIR_PIXEL: pvt->action = DualP; break; - case BYTE_PIXEL: pvt->action = DualB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, return(FALSE)); - break; - } - } - - return( TRUE ); -} /* end InitializeDualBlend */ - -static void MonoAlphaRQ(), MonoAlphaQQ(), MonoAlphaPQ(), MonoAlphaBQ(); -static void MonoAlphaRP(), MonoAlphaQP(), MonoAlphaPP(), MonoAlphaBP(); -static void MonoAlphaRB(), MonoAlphaQB(), MonoAlphaPB(), MonoAlphaBB(); -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeMonoAlphaBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - CARD8 msk = raw->bandMask; - receptorPtr rcp = pet->receptor; - CARD16 aindex = ((pBlendDefPtr)ped->elemPvt)->aindex; - bandPtr ab = &pet->receptor[aindex].band[0]; - CARD8 nbands = pet->receptor[SRCtag].inFlo->bands; - CARD8 abands = pet->receptor[aindex].inFlo->bands; - mpBlendPvtPtr pvt = (mpBlendPvtPtr) pet->private; - int band; - bandPtr iband; - - /* Replicate the alpha plane to all active bands */ - if (nbands == 3 && abands == 1) - ab->replicate = msk; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - if (!(InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,msk,~msk) && - InitReceptor(flo,ped,&rcp[aindex],NO_DATAMAP,1,1,NO_BANDS) && - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY) && - InitEmitter(flo,ped,0,SRCt1))) - return (FALSE); - - /* Figure out the appropriate action vector based on src and alpha plane */ - iband = &(pet->receptor[SRCtag].band[0]); - for(band = 0; band < nbands; band++, pvt++, iband++) { - switch (iband->format->class) { - case UNCONSTRAINED: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = MonoAlphaRQ; break; - case PAIR_PIXEL: pvt->action = MonoAlphaRP; break; - case BYTE_PIXEL: pvt->action = MonoAlphaRB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case QUAD_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = MonoAlphaQQ; break; - case PAIR_PIXEL: pvt->action = MonoAlphaQP; break; - case BYTE_PIXEL: pvt->action = MonoAlphaQB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case PAIR_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = MonoAlphaPQ; break; - case PAIR_PIXEL: pvt->action = MonoAlphaPP; break; - case BYTE_PIXEL: pvt->action = MonoAlphaPB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case BYTE_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = MonoAlphaBQ; break; - case PAIR_PIXEL: pvt->action = MonoAlphaBP; break; - case BYTE_PIXEL: pvt->action = MonoAlphaBB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, return(FALSE)); - break; - } - } - - return( TRUE ); -} /* end InitializeMonoAlphaBlend */ - -static void DualAlphaRQ(), DualAlphaQQ(), DualAlphaPQ(), DualAlphaBQ(); -static void DualAlphaRP(), DualAlphaQP(), DualAlphaPP(), DualAlphaBP(); -static void DualAlphaRB(), DualAlphaQB(), DualAlphaPB(), DualAlphaBB(); -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeDualAlphaBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - xieFloBlend *raw = (xieFloBlend *)ped->elemRaw; - CARD8 msk = raw->bandMask; - receptorPtr rcp = pet->receptor; - CARD16 aindex = ((pBlendDefPtr)ped->elemPvt)->aindex; - bandPtr ab = &pet->receptor[aindex].band[0]; - mpBlendPvtPtr pvt = (mpBlendPvtPtr) pet->private; - CARD8 nbands = pet->receptor[SRCtag].inFlo->bands; - CARD8 abands = pet->receptor[aindex].inFlo->bands; - int band; - bandPtr iband; - - /* Replicate the alpha plane to all active bands */ - if (nbands == 3 && abands == 1) - ab->replicate = msk; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - if (!(InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,msk,~msk) && - InitReceptor(flo,ped,&rcp[SRCt2],NO_DATAMAP,1,msk,NO_BANDS) && - InitReceptor(flo,ped,&rcp[aindex],NO_DATAMAP,1,1,NO_BANDS) && - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY) && - InitEmitter(flo,ped,0,SRCt1))) - return (FALSE); - - /* Figure out the appropriate action vector based on src and alpha plane */ - iband = &(pet->receptor[SRCtag].band[0]); - for(band = 0; band < nbands; band++, pvt++, iband++) { - switch (iband->format->class) { - case UNCONSTRAINED: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = DualAlphaRQ; break; - case PAIR_PIXEL: pvt->action = DualAlphaRP; break; - case BYTE_PIXEL: pvt->action = DualAlphaRB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case QUAD_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = DualAlphaQQ; break; - case PAIR_PIXEL: pvt->action = DualAlphaQP; break; - case BYTE_PIXEL: pvt->action = DualAlphaQB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case PAIR_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = DualAlphaPQ; break; - case PAIR_PIXEL: pvt->action = DualAlphaPP; break; - case BYTE_PIXEL: pvt->action = DualAlphaPB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case BYTE_PIXEL: - switch (ab->format->class) { - case QUAD_PIXEL: pvt->action = DualAlphaBQ; break; - case PAIR_PIXEL: pvt->action = DualAlphaBP; break; - case BYTE_PIXEL: pvt->action = DualAlphaBB; break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, - return(FALSE)); - break; - } - break; - case BIT_PIXEL: - default: ImplementationError(flo, ped, return(FALSE)); - break; - } - } - - return( TRUE ); -} /* end InitializeDualAlphaBlend */ - -/*------------------------------------------------------------------------ ------------------------- crank some single input data -------------------- -------------------------------------------------------------------------*/ -static int MonoBlend(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - pBlendDefPtr pvt = (pBlendDefPtr) ped->elemPvt; - BlendFloat aconst1 = pvt->alphaConst; - BlendFloat aconst2 = (BlendFloat)1.0 - aconst1; - double *sconst = pvt->constant; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp[SRCt1].inFlo->bands; - bandPtr sb1 = &rcp[SRCt1].band[0]; - bandPtr bnd = &pet->emitter[0]; - mpBlendPvtPtr mpvt = (mpBlendPvtPtr) pet->private; - pointer sr1, dst; - CARD32 b; - - for(b = 0; b < bands; b++, sb1++, bnd++, sconst++, mpvt++) { - BlendFloat offset = *sconst * aconst1; - - if (!(pet->scheduled & 1<pitch); - - while (run = GetRun(flo,pet,bnd)) { - if (run > 0) { - (*(mpvt->action)) (currentx,run,sr1,dst,aconst2,offset); - currentx += run; - } else - currentx -= run; - } - - /* get pointers to the next src and dst scanlines */ - sr1 = GetNextSrc(flo,pet,sb1,TRUE); - dst = GetNextDst(flo,pet,bnd,TRUE); - } - /* make sure the scheduler knows how much src we used */ - FreeData(flo,pet,sb1,sb1->current); - } - return(TRUE); -} /* end MonoBlend */ - -/*------------------------------------------------------------------------ --- Case with two inputs: src1, src2, no alpha plane --------------------- -------------------------------------------------------------------------*/ -static int DualBlend(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - BlendFloat aconst1 = ((pBlendDefPtr)ped->elemPvt)->alphaConst; - BlendFloat aconst2 = 1.0 - aconst1; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp[SRCt1].inFlo->bands; - bandPtr sb1 = &rcp[SRCt1].band[0]; - bandPtr sb2 = &rcp[SRCt2].band[0]; - bandPtr bnd = &pet->emitter[0]; - mpBlendPvtPtr mpvt = (mpBlendPvtPtr) pet->private; - pointer sr1, sr2, dst; - CARD32 b, w; - - for(b = 0; b < bands; b++,sb1++,sb2++,bnd++,mpvt++) { - - if (!(pet->scheduled & 1<format->width > sb2->format->width) - w = sb2->format->width; - else - w = sb1->format->width; - - /* get pointers to the initial src-1, src-2, and dst scanlines */ - sr1 = GetCurrentSrc(flo,pet,sb1); - sr2 = GetCurrentSrc(flo,pet,sb2); - dst = GetCurrentDst(flo,pet,bnd); - - /* continue while all is well and we have pointers */ - while(!ferrCode(flo) && sr1 && sr2 && dst && - SyncDomain(flo,ped,bnd,FLUSH)) { - INT32 run, currentx = 0; - - if (sr1 != dst) memcpy (dst, sr1, bnd->pitch); - - while ((run = GetRun(flo,pet,bnd)) && currentx < w) { - if (run > 0) { - if (currentx + run > w) /* Yuck, have to clip */ - run = w - currentx; - (*(mpvt->action)) (currentx,run,sr1,sr2,dst,aconst1,aconst2); - currentx += run; - } else - currentx -= run; - } - - /* get pointers to the next src-1, src-2, and dst scanlines */ - sr1 = GetNextSrc(flo,pet,sb1,TRUE); - sr2 = GetNextSrc(flo,pet,sb2,TRUE); - dst = GetNextDst(flo,pet,bnd,TRUE); - } - - /* If src2 < sr1, pass remaining lines through untouched */ - if(!sr1 && sb1->final) /* when sr1 runs out, we're done */ - DisableSrc(flo,pet,sb2,FLUSH); - else if(!sr2 && sb2->final) /* when sr2 runs out, pass-thru sr1 */ - BypassSrc(flo,pet,sb1); - else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sb1,sb1->current); - FreeData(flo,pet,sb2,sb2->current); - } - } - return(TRUE); -} /* end DualBlend */ - -/*------------------------------------------------------------------------ --- Case with two inputs: src1, alpha plane, no src2 --------------------- -------------------------------------------------------------------------*/ -static int MonoAlphaBlend(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - pBlendDefPtr pvt = (pBlendDefPtr) ped->elemPvt; - BlendFloat invaconst = 1/pvt->alphaConst; - CARD16 aindex = pvt->aindex; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp[SRCt1].inFlo->bands; - bandPtr sb1 = &rcp[SRCt1].band[0]; - bandPtr aband = &rcp[aindex].band[0]; - bandPtr bnd = &pet->emitter[0]; - double *sconst = pvt->constant; - mpBlendPvtPtr mpvt = (mpBlendPvtPtr) pet->private; - pointer sr1, alpha, dst; - CARD32 b, w; - - for(b = 0; b < bands; b++,sb1++,bnd++,sconst++, mpvt++, aband++) { - BlendFloat scalefactor = *sconst * invaconst; - - if (!(pet->scheduled & 1<format->width > aband->format->width) - w = aband->format->width; - else - w = sb1->format->width; - - /* get pointers to the initial src-1, alpha, and dst scanlines */ - sr1 = GetCurrentSrc(flo,pet,sb1); - alpha = GetCurrentSrc(flo,pet,aband); - dst = GetCurrentDst(flo,pet,bnd); - - /* continue while all is well and we have pointers */ - while(!ferrCode(flo) && sr1 && alpha && dst && - SyncDomain(flo,ped,bnd,FLUSH)) { - INT32 run, currentx = 0; - - if (sr1 != dst) memcpy (dst, sr1, bnd->pitch); - - while ((run = GetRun(flo,pet,bnd)) && currentx < w ) { - if (run > 0) { - if (currentx + run > w ) /* Yuck, have to clip */ - run = w - currentx; - (*(mpvt->action))(currentx,run,sr1,alpha,dst,invaconst,scalefactor); - currentx += run; - } else - currentx -= run; - } - - /* get pointers to the next src-1 and dst scanlines */ - sr1 = GetNextSrc(flo,pet,sb1,FLUSH); - alpha = GetNextSrc(flo,pet,aband,FLUSH); - dst = GetNextDst(flo,pet,bnd,FLUSH); - } - - /* If alpha < sr1, pass remaining lines through untouched */ - if(!sr1 && sb1->final) { /* when sr1 runs out, we're done */ - } else if(!alpha && aband->final) { /* when alpha runs out, pass-thru sr1*/ - pet->inSync = FALSE; /* No need to sync anymore */ - BypassSrc(flo,pet,sb1); - } else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sb1,sb1->current); - FreeData(flo,pet,aband,aband->current); - } - } - - return(TRUE); -} /* end MonoAlphaBlend */ - -/*------------------------------------------------------------------------ --- Case with three inputs: src1, src2, and alpha plane ------------------- -------------------------------------------------------------------------*/ -static int DualAlphaBlend(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - pBlendDefPtr pvt = (pBlendDefPtr)ped->elemPvt; - BlendFloat invaconst = 1.0/pvt->alphaConst; - CARD16 aindex = pvt->aindex; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp[SRCt1].inFlo->bands; - bandPtr sb1 = &rcp[SRCt1].band[0]; - bandPtr sb2 = &rcp[SRCt2].band[0]; - bandPtr aband = &rcp[aindex].band[0]; - bandPtr bnd = &pet->emitter[0]; - mpBlendPvtPtr mpvt = (mpBlendPvtPtr) pet->private; - pointer sr1, sr2, alpha, dst; - CARD32 b, w; - - for(b = 0; b < bands; b++,sb1++,sb2++,bnd++,mpvt++,aband++) { - - if (!(pet->scheduled & 1<format->width > sb2->format->width || - sb1->format->width > aband->format->width) - w = (aband->format->width < sb2->format->width) ? - aband->format->width : sb2->format->width; - else - w = sb1->format->width; - - /* get pointers to the initial src-1, src-2, and dst scanlines */ - sr1 = GetCurrentSrc(flo,pet,sb1); - sr2 = GetCurrentSrc(flo,pet,sb2); - alpha = GetCurrentSrc(flo,pet,aband); - dst = GetCurrentDst(flo,pet,bnd); - - /* continue while all is well and we have pointers */ - while(!ferrCode(flo) && sr1 && sr2 && alpha && dst && - SyncDomain(flo,ped,bnd,FLUSH)) { - INT32 run, currentx = 0; - - if (sr1 != dst) memcpy (dst, sr1, bnd->pitch); - - while ((run = GetRun(flo,pet,bnd)) && currentx < w ) { - if (run > 0) { - if (currentx + run > w) /* Yuck, have to clip */ - run = w - currentx; - (*(mpvt->action)) (currentx,run,sr1,sr2,alpha,dst,invaconst); - currentx += run; - } else - currentx -= run; - } - - /* get pointers to the next src-1, src-2, and dst scanlines */ - sr1 = GetNextSrc(flo,pet,sb1,FLUSH); - sr2 = GetNextSrc(flo,pet,sb2,FLUSH); - alpha = GetNextSrc(flo,pet,aband,FLUSH); - dst = GetNextDst(flo,pet,bnd,FLUSH); - } - - /* If alpha < sr1, pass remaining lines through untouched */ - if(!sr1 && sb1->final) { /* when sr1 runs out, we're done */ - DisableSrc(flo,pet,sb2,FLUSH); - } else if( !sr2 && sb2->final || /* when other inputs out, pass sr1 */ - !alpha && aband->final ) { - pet->inSync = FALSE; /* No need to sync anymore */ - if (sr2) { /* flush any remain sr2 */ - DisableSrc(flo,pet,sb2,FLUSH); - } - BypassSrc(flo,pet,sb1); - } else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sb1,sb1->current); - FreeData(flo,pet,sb2,sb2->current); - FreeData(flo,pet,aband,aband->current); - } - } - - return(TRUE); -} /* end DualAlphaBlend */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetBlend */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyBlend(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyBlend */ - -/*------------------------------------------------------------------------ -------------------------MonoBlend action routines ---------------------- -------------------------------------------------------------------------*/ - -#define DOMono(fname,stype) \ -static void fname(count,width,is,id,aconst2,offset) \ -INT32 count, width; \ -pointer is, id; \ -BlendFloat aconst2, offset; \ -{ \ -stype *sr1 = ((stype *)is) + count; \ -stype *dst = ((stype *)id) + count; \ -int i; \ - for(i = 0; i < width; ++i) \ - *dst++ = *sr1++ * aconst2 + offset; \ -} - -DOMono(MonoR,RealPixel) -DOMono(MonoQ,QuadPixel) -DOMono(MonoP,PairPixel) -DOMono(MonoB,BytePixel) - -/*------------------------------------------------------------------------ -------------------------DualBlend action routines ---------------------- -------------------------------------------------------------------------*/ -#define DODual(fname,stype) \ -static void fname(count,width,is1,is2,id,aconst1,aconst2) \ -INT32 count,width; \ -pointer is1, is2, id; \ -BlendFloat aconst1, aconst2; \ -{ \ -stype *sr1 = ((stype *)is1) + count; \ -stype *sr2 = ((stype *)is2) + count; \ -stype *dst = ((stype *)id) + count; \ -int i; \ - for(i = 0; i < width; ++i) \ - *dst++ = *sr1++ * aconst2 + *sr2++ * aconst1; \ -} - -DODual(DualR,RealPixel) -DODual(DualQ,QuadPixel) -DODual(DualP,PairPixel) -DODual(DualB,BytePixel) - -/*------------------------------------------------------------------------ --------------------- MonoAlphaBlend action routines -------------------- -------------------------------------------------------------------------*/ -#define DOMonoAlpha(fname,stype,atype) \ -static void fname(count,width,is1,ia,id,iac,sf) \ -INT32 count, width; \ -pointer is1, ia, id; \ -BlendFloat iac, sf; \ -{ \ -stype *sr1 = ((stype *)is1) + count; \ -stype *dst = ((stype *)id) + count; \ -atype *alpha = ((atype *)ia) + count; \ -int i; \ - for(i = 0; i < width; ++i) { \ - register BlendFloat ralpha = *alpha++; \ - *dst++ = *sr1++ * ((BlendFloat)1.0 - ralpha * iac) + \ - ralpha * sf; \ - } \ -} - -DOMonoAlpha(MonoAlphaRQ,RealPixel,QuadPixel) -DOMonoAlpha(MonoAlphaRP,RealPixel,PairPixel) -DOMonoAlpha(MonoAlphaRB,RealPixel,BytePixel) -DOMonoAlpha(MonoAlphaQQ,QuadPixel,QuadPixel) -DOMonoAlpha(MonoAlphaQP,QuadPixel,PairPixel) -DOMonoAlpha(MonoAlphaQB,QuadPixel,BytePixel) -DOMonoAlpha(MonoAlphaPQ,PairPixel,QuadPixel) -DOMonoAlpha(MonoAlphaPP,PairPixel,PairPixel) -DOMonoAlpha(MonoAlphaPB,PairPixel,BytePixel) -DOMonoAlpha(MonoAlphaBQ,BytePixel,QuadPixel) -DOMonoAlpha(MonoAlphaBP,BytePixel,PairPixel) -DOMonoAlpha(MonoAlphaBB,BytePixel,BytePixel) - -/*------------------------------------------------------------------------ --------------------- DualAlphaBlend action routines -------------------- -------------------------------------------------------------------------*/ -#define DODualAlpha(fname,stype,atype) \ -static void fname(count,width,is1,is2,ia,id,iac) \ -CARD32 count,width; \ -pointer is1, is2, ia, id; \ -BlendFloat iac; \ -{ \ -stype *sr1 = ((stype *)is1) + count; \ -stype *sr2 = ((stype *)is2) + count; \ -atype *alpha = ((atype *)ia) + count; \ -stype *dst = ((stype *)id) + count; \ -int i; \ - for(i = 0; i < width; ++i) { \ - register BlendFloat ascale = *alpha++ * iac; \ - *dst++ = *sr1++ * ((BlendFloat)1.0 - ascale) + \ - *sr2++ * ascale; \ - } \ -} - -DODualAlpha(DualAlphaRQ,RealPixel,QuadPixel) -DODualAlpha(DualAlphaRP,RealPixel,PairPixel) -DODualAlpha(DualAlphaRB,RealPixel,BytePixel) -DODualAlpha(DualAlphaQQ,QuadPixel,QuadPixel) -DODualAlpha(DualAlphaQP,QuadPixel,PairPixel) -DODualAlpha(DualAlphaQB,QuadPixel,BytePixel) -DODualAlpha(DualAlphaPQ,PairPixel,QuadPixel) -DODualAlpha(DualAlphaPP,PairPixel,PairPixel) -DODualAlpha(DualAlphaPB,PairPixel,BytePixel) -DODualAlpha(DualAlphaBQ,BytePixel,QuadPixel) -DODualAlpha(DualAlphaBP,BytePixel,PairPixel) -DODualAlpha(DualAlphaBB,BytePixel,BytePixel) -/* end module mpblend.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpcfromi.c diff -u xc/programs/Xserver/XIE/mixie/process/mpcfromi.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpcfromi.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpcfromi.c:3.5 Fri Dec 14 14:58:43 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpcfromi.c Sat Feb 28 21:42:00 2004 @@ -1,479 +0,0 @@ -/* $Xorg: mpcfromi.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/**** module mpcfromi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpcfromi.c -- DDXIE ConvertFromIndex element - - Robert NC Shelley -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpcfromi.c,v 3.5 2001/12/14 19:58:43 dawes Exp $ */ - -#define _XIEC_MPCFROMI -#define _XIEC_PCFROMI - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -extern int QueryColors(); /* in ...server/dix/colormap.c */ - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeCvtFromInd(); - -/* routines used internal to this module - */ -static int CreateCfromI(); -static int InitCfromI(); -static int DoSingleCfromI(); -static int DoTripleCfromI(); -static int ResetCfromI(); -static int DestroyCfromI(); - - -/* DDXIE ConvertFromIndex entry points - */ -static ddElemVecRec mpCfromIVec = { - CreateCfromI, - InitCfromI, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetCfromI, - DestroyCfromI - }; - - -/* Local Declarations. - */ -typedef struct _mpcfromi { - pCfromIDefPtr dix; - xieIntProc action; - bandPtr iband; - bandPtr oband; - Pixel *pixLst; - xrgb *rgbLst; - CARD32 width; - pointer ibuf; - pointer obuf[xieValMaxBands]; -} mpCfromIRec, *mpCfromIPtr; - -/* action routines - */ -#define CfromI_1bb CfromI_1BB -#define CfromI_1bB CfromI_1BB -#define CfromI_1bP CfromI_1BP -#define CfromI_1Bb CfromI_1BB -#define CfromI_1Pb CfromI_1PB -#define CfromI_1Qb CfromI_1QB -#define CfromI_3bb CfromI_3BB -#define CfromI_3bB CfromI_3BB -#define CfromI_3bP CfromI_3BP -#define CfromI_3Bb CfromI_3BB -#define CfromI_3Pb CfromI_3PB -#define CfromI_3Qb CfromI_3QB -static int CfromI_1BB(), CfromI_1BP(), CfromI_3BB(), CfromI_3BP(); -static int CfromI_1PB(), CfromI_1PP(), CfromI_3PB(), CfromI_3PP(); -static int CfromI_1QB(), CfromI_1QP(), CfromI_3QB(), CfromI_3QP(); - -static int (*action_CfromI[2][3][4])() = { - CfromI_1bb, CfromI_1Bb, CfromI_1Pb, CfromI_1Qb, /* single, o=1, i=1..4 */ - CfromI_1bB, CfromI_1BB, CfromI_1PB, CfromI_1QB, /* single, o=2, i=1..4 */ - CfromI_1bP, CfromI_1BP, CfromI_1PP, CfromI_1QP, /* single, o=3, i=1..4 */ - CfromI_3bb, CfromI_3Bb, CfromI_3Pb, CfromI_3Qb, /* triple, o=1, i=1..4 */ - CfromI_3bB, CfromI_3BB, CfromI_3PB, CfromI_3QB, /* triple, o=2, i=1..4 */ - CfromI_3bP, CfromI_3BP, CfromI_3PP, CfromI_3QP, /* triple, o=3, i=1..4 */ -}; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeCvtFromInd(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* stash the entry point vector with the appropriate activate routine - */ - ped->ddVec = mpCfromIVec; - - return(TRUE); -} /* end miAnalyzeCvtFromInd */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateCfromI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - return(MakePETex(flo, ped, sizeof(mpCfromIRec), NO_SYNC, NO_SYNC)); -} /* end CreateCfromI */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitCfromI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloConvertFromIndex *raw = (xieFloConvertFromIndex *)ped->elemRaw; - peTexPtr pet = ped->peTex; - formatPtr ift = &ped->inFloLst[SRCtag].format[0]; - formatPtr oft = &ped->outFlo.format[0]; - pCfromIDefPtr dix = (pCfromIDefPtr) ped->elemPvt; - mpCfromIPtr ddx = (mpCfromIPtr)pet->private; - CARD32 i, pseudo = !dix->pixMsk[0]; - CARD32 cells, odx = ped->outFlo.bands == 1 ? 0 : 1; - CARD8 oc = oft->class, ic = ift->class; - Pixel *p; - xrgb *rgb; - - /* set up action parameters - */ - ddx->dix = dix; - ddx->width = oft->width; - ddx->iband = &pet->receptor[SRCtag].band[0]; - ddx->oband = &pet->emitter[0]; - ddx->action = action_CfromI[odx][oc-1][ift->class-1]; - if(!ddx->action) ImplementationError(flo,ped, return(FALSE)); - ped->ddVec.activate = !odx ? DoSingleCfromI : DoTripleCfromI; - - if(ic == BIT_PIXEL && !(ddx->ibuf = (BytePixel*)XieMalloc(ddx->width+7))) - AllocError(flo,ped, return(FALSE)); - - if(oc == BIT_PIXEL) - if( odx && (!(ddx->obuf[0] = (BytePixel*)XieMalloc(ddx->width+7)) || - !(ddx->obuf[1] = (BytePixel*)XieMalloc(ddx->width+7)) || - !(ddx->obuf[2] = (BytePixel*)XieMalloc(ddx->width+7))) || - !odx && !(ddx->obuf[0] = (BytePixel*)XieMalloc(ddx->width+7))) - AllocError(flo,ped, return(FALSE)); - - /* snapshot the current contents of the colormap - */ - SetDepthFromLevels(dix->cells,i); cells = 1<pixLst = (Pixel*) XieMalloc(cells * sizeof(Pixel))) || - !(ddx->rgbLst = (xrgb *) XieMalloc(cells * sizeof(xrgb)))) - AllocError(flo,ped, return(FALSE)); - for(p = ddx->pixLst, i = 0; i < cells; ++i) - *p++ = pseudo ? i : (i << dix->pixPos[0] & dix->pixMsk[0] | - i << dix->pixPos[1] & dix->pixMsk[1] | - i << dix->pixPos[2] & dix->pixMsk[2]); - if(QueryColors(dix->cmap,cells,ddx->pixLst,ddx->rgbLst)) - ColormapError(flo,ped,raw->colormap, return(FALSE)); /* XXX hmmm? */ - - /* adjust the RGB values according to the client's precision requirements - */ - for(rgb = ddx->rgbLst, i = 0; i < cells; ++rgb, ++i) { - rgb->red >>= dix->precShift; - rgb->green >>= dix->precShift; - rgb->blue >>= dix->precShift; - } - - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitCfromI */ - - -/*------------------------------------------------------------------------ -------------------------- crank some input data -------------------------- -------------------------------------------------------------------------*/ -static int DoSingleCfromI(flo,ped,pet) /* one band out */ - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpCfromIPtr ddx = (mpCfromIPtr) pet->private; - bandPtr iband = ddx->iband; - bandPtr oband = ddx->oband; - CARD32 width = iband->format->width; - pointer src, dst; - - if((src = GetCurrentSrc(flo,pet,iband)) && - (dst = GetCurrentDst(flo,pet,oband))) - do { - if(ddx->ibuf) src = bitexpand(src,ddx->ibuf,width,(char)1,(char)0); - - (*ddx->action)(ddx, src, ddx->obuf[0] ? ddx->obuf[0] : dst); - - if(ddx->obuf[0]) bitshrink(ddx->obuf[0],dst,width,(char)1); - - src = GetNextSrc(flo,pet,iband,FLUSH); - dst = GetNextDst(flo,pet,oband,FLUSH); - } while(src && dst); - - FreeData(flo,pet,iband,iband->current); - - return(TRUE); -} /* end DoSingleCfromI */ - -static int DoTripleCfromI(flo,ped,pet) /* three bands out */ - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpCfromIPtr ddx = (mpCfromIPtr) pet->private; - bandPtr iband = ddx->iband; - bandPtr oband = ddx->oband; - CARD32 width = iband->format->width; - pointer src, dstR, dstG, dstB; - - src = GetCurrentSrc(flo,pet,iband); - dstR = GetCurrentDst(flo,pet,oband); oband++; - dstG = GetCurrentDst(flo,pet,oband); oband++; - dstB = GetCurrentDst(flo,pet,oband); oband -=2; - - while(src && dstR && dstG && dstB) { - - if(ddx->ibuf) src = bitexpand(src,ddx->ibuf,width,(char)1,(char)0); - - (*ddx->action)(ddx, src, - ddx->obuf[0] ? ddx->obuf[0] : dstR, - ddx->obuf[1] ? ddx->obuf[1] : dstG, - ddx->obuf[2] ? ddx->obuf[2] : dstB); - - if(ddx->obuf[0]) bitshrink(ddx->obuf[0],dstR,width,(char)1); - if(ddx->obuf[1]) bitshrink(ddx->obuf[1],dstG,width,(char)1); - if(ddx->obuf[2]) bitshrink(ddx->obuf[2],dstB,width,(char)1); - - src = GetNextSrc(flo,pet,iband,FLUSH); - dstR = GetNextDst(flo,pet,oband,FLUSH); oband++; - dstG = GetNextDst(flo,pet,oband,FLUSH); oband++; - dstB = GetNextDst(flo,pet,oband,FLUSH); oband -=2; - } - FreeData(flo,pet,iband,iband->current); - - return(TRUE); -} /* end DoTripleCfromI */ - - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetCfromI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpCfromIPtr ddx = (mpCfromIPtr) ped->peTex->private; - - if(ddx->pixLst ) ddx->pixLst = (Pixel*) XieFree(ddx->pixLst ); - if(ddx->rgbLst ) ddx->rgbLst = (xrgb *) XieFree(ddx->rgbLst ); - if(ddx->ibuf ) ddx->ibuf = (pointer ) XieFree(ddx->ibuf ); - if(ddx->obuf[0]) ddx->obuf[0] = (pointer ) XieFree(ddx->obuf[0]); - if(ddx->obuf[1]) ddx->obuf[1] = (pointer ) XieFree(ddx->obuf[1]); - if(ddx->obuf[2]) ddx->obuf[2] = (pointer ) XieFree(ddx->obuf[2]); - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetCfromI */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyCfromI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyCfromI */ - -/* Single band output action routines: - */ - -#define DO_SINGLE_CFROMI(fn_do,itype,otype) \ -static int fn_do(ddx,SRC,DST) \ - mpCfromIPtr ddx; pointer SRC; pointer DST; \ -{ \ - itype *s = (itype *)SRC; \ - otype *d = (otype *)DST; \ - xrgb *x = ddx->rgbLst; \ - int w = ddx->width; \ - switch(ddx->dix->class) { \ - case StaticGray: \ - case GrayScale: \ - case StaticColor: \ - case PseudoColor: \ - while(w--) *d++ = x[*s++].red; \ - break; \ - case TrueColor: \ - case DirectColor: \ - { int rm = ddx->dix->pixMsk[0], rs = ddx->dix->pixPos[0]; \ - while(w--) *d++ = x[(*s++ & rm) >> rs].red; \ - } \ - } \ -} -/* bit versions - nyi */ -/* CfromI_1bb,BitPixel, BitPixel */ -/* CfromI_1bB,BitPixel, BytePixel */ -/* CfromI_1bP,BitPixel, PairPixel */ -/* CfromI_1Bb,BytePixel,BitPixel */ -DO_SINGLE_CFROMI(CfromI_1BB,BytePixel,BytePixel) -DO_SINGLE_CFROMI(CfromI_1BP,BytePixel,PairPixel) -/* CfromI_1Pb,PairPixel,BitPixel */ -DO_SINGLE_CFROMI(CfromI_1PB,PairPixel,BytePixel) -DO_SINGLE_CFROMI(CfromI_1PP,PairPixel,PairPixel) -/* CfromI_1Qb,QuadPixel,BitPixel */ -DO_SINGLE_CFROMI(CfromI_1QB,QuadPixel,BytePixel) -DO_SINGLE_CFROMI(CfromI_1QP,QuadPixel,PairPixel) - - -/* Triple band output action routines: - */ - -#define DO_TRIPLE_CFROMI(fn_do,itype,otype) \ -static int fn_do(ddx,SRC,DSTR,DSTG,DSTB) \ - mpCfromIPtr ddx; pointer SRC, DSTR, DSTG, DSTB; \ -{ \ - itype *s = (itype *)SRC; \ - otype *r = (otype *)DSTR; \ - otype *g = (otype *)DSTG; \ - otype *b = (otype *)DSTB; \ - xrgb *x = ddx->rgbLst; \ - int w = ddx->width; \ - switch(ddx->dix->class) { \ - case StaticGray: \ - case GrayScale: \ - while(w--) *r++ = *g++ = *b++ = x[*s++].red; \ - break; \ - case StaticColor: \ - case PseudoColor: \ - while(w--) { \ - xrgb *p = x + *s++; \ - *r++ = p->red; *g++ = p->green; *b++ = p->blue; \ - } \ - break; \ - case TrueColor: \ - case DirectColor: \ - { int rm = ddx->dix->pixMsk[0], rs = ddx->dix->pixPos[0]; \ - int gm = ddx->dix->pixMsk[1], gs = ddx->dix->pixPos[1]; \ - int bm = ddx->dix->pixMsk[2], bs = ddx->dix->pixPos[2]; \ - while(w--) { \ - Pixel p = *s++; \ - *r++ = x[(p & rm) >> rs].red; \ - *g++ = x[(p & gm) >> gs].green; \ - *b++ = x[(p & bm) >> bs].blue; \ - } \ - } \ - } \ -} -/* bit versions - nyi */ -/* CfromI_3bb,BitPixel, BitPixel */ -/* CfromI_3bB,BitPixel, BytePixel */ -/* CfromI_3bP,BitPixel, PairPixel */ -/* CfromI_3Bb,BytePixel,BitPixel */ -DO_TRIPLE_CFROMI(CfromI_3BB,BytePixel,BytePixel) -DO_TRIPLE_CFROMI(CfromI_3BP,BytePixel,PairPixel) -/* CfromI_3Pb,PairPixel,BitPixel */ -DO_TRIPLE_CFROMI(CfromI_3PB,PairPixel,BytePixel) -DO_TRIPLE_CFROMI(CfromI_3PP,PairPixel,PairPixel) - /* CfromI_3Qb,QuadPixel,BitPixel */ -DO_TRIPLE_CFROMI(CfromI_3QB,QuadPixel,BytePixel) -DO_TRIPLE_CFROMI(CfromI_3QP,QuadPixel,PairPixel) - -/* end module mpcfromi.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpcnst.c diff -u xc/programs/Xserver/XIE/mixie/process/mpcnst.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpcnst.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpcnst.c:3.5 Fri Dec 14 14:58:44 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpcnst.c Sat Feb 28 21:42:00 2004 @@ -1,1037 +0,0 @@ -/* $Xorg: mpcnst.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpcnst.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpcnst.c -- DDXIE constrain element - - Dean Verheiden && Larry Hare -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpcnst.c,v 3.5 2001/12/14 19:58:44 dawes Exp $ */ - - -#define _XIEC_MPCNST -#define _XIEC_PCNST - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeConstrain(); - -/* - * routines used internal to this module - */ -static int CreateConstrain(); -static int InitializeConstrain(); -static int ActivateConstrain(); -static int ResetConstrain(); -static int DestroyConstrain(); - -/* - * DDXIE ImportClientPhoto entry points - */ -static ddElemVecRec ConstrainVec = { - CreateConstrain, - InitializeConstrain, - ActivateConstrain, - (xieBoolProc)NULL, - ResetConstrain, - DestroyConstrain - }; - - -/*------------------------------------------------------------------------ ------------------------- Local declares and defines -------------------- -------------------------------------------------------------------------*/ - -typedef struct _mpconstraindef { - void (*action) (); - pointer lut; - double pad[7]; -} mpCnstPvtRec, *mpCnstPvtPtr; - - -static void (*hc_nop())(); -static void (*HCp_Rb())(), (*HCp_bb())(), (*HCp_Bb())(), - (*HCp_Pb())(), (*HCp_Qb())(); -static void (*HCp_RB())(), (*HCp_bB())(), (*HCp_BB())(), - (*HCp_PB())(), (*HCp_QB())(); -static void (*HCp_RP())(), (*HCp_bP())(), (*HCp_BP())(), - (*HCp_PP())(), (*HCp_QP())(); -static void (*HCp_RQ())(), (*HCp_bQ())(), (*HCp_BQ())(), - (*HCp_PQ())(), (*HCp_QQ())(); - -static void (*(*prep_hc[5][5])())() = { - hc_nop, hc_nop, hc_nop, hc_nop, hc_nop, /* [out=0][inp=0...4] */ - HCp_Rb, HCp_bb, HCp_Bb, HCp_Pb, HCp_Qb, /* [out=1][inp=0...4] */ - HCp_RB, HCp_bB, HCp_BB, HCp_PB, HCp_QB, /* [out=2][inp=0...4] */ - HCp_RP, HCp_bP, HCp_BP, HCp_PP, HCp_QP, /* [out=3][inp=0...4] */ - HCp_RQ, HCp_bQ, HCp_BQ, HCp_PQ, HCp_QQ, /* [out=4][inp=0...4] */ -}; - -static void (*cs_nop())(); -static void (*CSp_Rb())(), (*CSp_bb())(), (*CSp_Bb())(), - (*CSp_Pb())(), (*CSp_Qb())(); -static void (*CSp_RB())(), (*CSp_bB())(), (*CSp_BB())(), - (*CSp_PB())(), (*CSp_QB())(); -static void (*CSp_RP())(), (*CSp_bP())(), (*CSp_BP())(), - (*CSp_PP())(), (*CSp_QP())(); -static void (*CSp_RQ())(), (*CSp_bQ())(), (*CSp_BQ())(), - (*CSp_PQ())(), (*CSp_QQ())(); - -static void (*(*prep_cs[5][5])())() = { - cs_nop, cs_nop, cs_nop, cs_nop, cs_nop, /* [0][0...4] */ - CSp_Rb, CSp_bb, CSp_Bb, CSp_Pb, CSp_Qb, /* [1][0...4] */ - CSp_RB, CSp_bB, CSp_BB, CSp_PB, CSp_QB, /* [2][0...4] */ - CSp_RP, CSp_bP, CSp_BP, CSp_PP, CSp_QP, /* [3][0...4] */ - CSp_RQ, CSp_bQ, CSp_BQ, CSp_PQ, CSp_QQ, /* [4][0...4] */ -}; - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeConstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - - ped->ddVec = ConstrainVec; - - /* based on the technique, fill in the appropriate entry point vector */ - - switch(((xieFloConstrain *)ped->elemRaw)->constrain) { - case xieValConstrainClipScale: - case xieValConstrainHardClip: - break; - default: - ImplementationError(flo,ped, return(FALSE)); - } - - return TRUE; -} - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateConstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpCnstPvtRec); - - return MakePETex(flo,ped,auxsize,NO_SYNC,NO_SYNC); -} - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ - -static int InitializeConstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - pCnstDefPtr techpvt = (pCnstDefPtr)ped->techPvt; - mpCnstPvtPtr pvt = (mpCnstPvtPtr) pet->private; - bandPtr oband; - bandPtr iband; - int band, nbands, status; - - status = InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); - - nbands = pet->receptor[SRCtag].inFlo->bands; - iband = &(pet->receptor[SRCtag].band[0]); - oband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - - int oo = IndexClass(oband->format->class); - int ii = IndexClass(iband->format->class); - - switch(((xieFloConstrain *)ped->elemRaw)->constrain) { - - case xieValConstrainClipScale: - pvt->action = - ((*(prep_cs[oo][ii])) (iband, oband, pvt, techpvt, band)); - break; - case xieValConstrainHardClip: - pvt->action = - ((*(prep_hc[oo][ii])) (iband, oband, pvt, techpvt, band)); - break; - } - } - return status; -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateConstrain(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpCnstPvtPtr pvt = (mpCnstPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - register int bw = iband->format->width; - pointer ivoid, ovoid; - - if (!(ivoid = GetCurrentSrc(flo,pet,iband))) - continue; - - if (!pvt->action) { - do { /* pass a clone of the current src strip downstream */ - if(!PassStrip(flo,pet,oband,iband->strip)) - return(FALSE); - ivoid = GetSrc(flo,pet,iband,iband->maxLocal,TRUE); - } while (!ferrCode(flo) && ivoid) ; - FreeData(flo, pet, iband, iband->current); - continue; - } - - if (!(ovoid = GetCurrentDst(flo,pet,oband))) - continue; - - do { - (*(pvt->action)) (ivoid, ovoid, pvt, bw); - ivoid = GetNextSrc(flo,pet,iband,TRUE); - ovoid = GetNextDst(flo,pet,oband,TRUE); - } while (!ferrCode(flo) && ivoid && ovoid) ; - - FreeData(flo, pet, iband, iband->current); - } - return TRUE; -} - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetConstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpCnstPvtPtr pvt = (mpCnstPvtPtr) ped->peTex->private; - int band; - - /* free any dynamic private data */ - for (band = 0 ; band < xieValMaxBands ; band++, pvt++) - if (pvt->lut) - pvt->lut = (pointer) XieFree(pvt->lut); - - ResetReceptors(ped); - ResetEmitter(ped); - - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyConstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- This guy must be nuts ------------------------- -------------------------------------------------------------------------*/ - -/*----------------------------- HardClip --------------------------------*/ - -/* -** DO_HCb - consume bits, produce bits. -** DO_HCc - consume bits, produce otype. -** DO_HCcx - consume bits, produce otype (using bitexpand). -** DO_HCp - consume itype, produce bits.. -** DO_HCfp - consume floats, produce bits. -** DO_HClt - consume itype, produce otype (itype < otype). -** DO_HCeq - consume itype, produce otype (itype == otype). -** DO_HCgt - consume itype, produce otype (itype > otype) -** DO_HCf - consume floats, produce otype. -*/ - -static void constrain_nop(INP,OUTP,pvt,bw) - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; -{ - return; -} -static void (*hc_nop(iband,oband,pvt,techpvt,band))() - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; -{ - return constrain_nop; -} -static void (*cs_nop(iband,oband,pvt,techpvt,band))() - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; -{ - return constrain_nop; -} - -static void clearbitline(INP,OUTP,pvt,bw) - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; -{ - action_clear(OUTP, bw, 0); -} - -static void setbitline(INP,OUTP,pvt,bw) - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; -{ - action_set(OUTP, bw, 0); -} - -static void copybitline(INP,OUTP,pvt,bw) - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; -{ - passcopy_bit(OUTP, INP, bw, 0); -} - -static void invertbitline(INP,OUTP,pvt,bw) - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; -{ - passcopy_bit (OUTP, INP, bw, 0); - action_invert(OUTP, bw, 0); -} - -#define LEVELSM1(T) *((T *) &(pvt->pad[0])) - -#define DO_HCb(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (iband->format->levels == 1) \ - return clearbitline; \ - if (oband->format->levels == 1) \ - return clearbitline; \ - return copybitline; \ -} - -#define DO_HCc(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - LogInt inval, M, *inp = (LogInt *) INP; \ - otype *outp = (otype *) OUTP; \ - for ( ; bw >= LOGSIZE ; bw -= LOGSIZE) \ - for (M=LOGLEFT, inval = *inp++; M; LOGRIGHT(M)) \ - *outp++ = (inval & M) ? (otype) 1 : (otype) 0; \ - if (bw > 0) \ - for (M=LOGLEFT, inval = *inp++; bw; bw--, LOGRIGHT(M)) \ - *outp++ = (inval & M) ? (otype) 1 : (otype) 0; \ -} \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - bzero((char *)OUTP, bw * sizeof(otype)); \ - /* action_clear(OUTP, (bw * sizeof(otype)) << 3, 0); */ \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (iband->format->levels == 1) \ - return fn_do_b; \ - return fn_do_a; \ -} - -#define DO_HCcx(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - bitexpand(INP, OUTP, bw, 0, 1); \ -} \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - bzero((char *)OUTP, bw * sizeof(otype)); \ - /* action_clear(OUTP, (bw * sizeof(otype)) << 3, 0); */ \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (iband->format->levels == 1) \ - return fn_do_b; \ - return fn_do; \ -} - -#define DO_HCp(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - LogInt outval, M, *outp = (LogInt *) OUTP; \ - for ( ; bw >= LOGSIZE ; *outp++ = outval, bw -= LOGSIZE) \ - for (M=LOGLEFT, outval = 0; M; LOGRIGHT(M)) \ - if (*inp++) \ - outval |= M; \ - if (bw > 0) { \ - for (M=LOGLEFT, outval = 0; bw; bw--, LOGRIGHT(M)) \ - if (*inp++) \ - outval |= M; \ - *outp = outval; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (oband->format->levels == 1) \ - return clearbitline; \ - return fn_do_a; \ -} - -#define DO_HCfp(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - LogInt outval, M, *outp = (LogInt *) OUTP; \ - for ( ; bw >= LOGSIZE ; *outp++ = outval, bw -= LOGSIZE) \ - for (M=LOGLEFT, outval = 0; M; LOGRIGHT(M)) \ - if (*inp++ >= (itype) 1.0) \ - outval |= M; \ - if (bw > 0) { \ - for (M=LOGLEFT, outval = 0; bw; bw--, LOGRIGHT(M)) \ - if (*inp++ >= (itype) 1.0) \ - outval |= M; \ - *outp = outval; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (oband->format->levels == 1) \ - return clearbitline; \ - return fn_do_a; \ -} - -#define DO_HClt(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - otype *outp = (otype *) OUTP; \ - while (bw-- > 0 ) { \ - *outp++ = (otype) *inp++; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - return fn_do_b; \ -} - -#define DO_HCeq(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - otype *outp = (otype *) OUTP; \ - itype inval, lm1 = LEVELSM1(itype); \ - while (bw-- > 0 ) { \ - if ((inval = *inp++) > lm1) inval = lm1; \ - *outp++ = (otype) inval; \ - } \ -} \ -/* fn_do_b was memcpy, now done at higher level with PassStrip */ \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - itype ilm1 = (itype)( (iband->format->levels) \ - ? iband->format->levels - 1 : ~0); \ - itype olm1 = (itype)( (oband->format->levels) \ - ? oband->format->levels - 1 : ~0); \ - if (ilm1 < olm1) { \ - /*special hint to PassStrip */ \ - return (void (*) ()) 0; \ - } \ - LEVELSM1(itype) = (itype) olm1; \ - return fn_do_a; \ -} - -#define DO_HCgt(fn_prep,fn_do_a, fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - otype *outp = (otype *) OUTP; \ - itype inval, lm1 = LEVELSM1(itype); \ - while (bw-- > 0 ) { \ - if ((inval = *inp++) > lm1) inval = lm1; \ - *outp++ = (otype) inval; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - otype olm1 = (otype)( (oband->format->levels) \ - ? oband->format->levels - 1 : ~0); \ - LEVELSM1(itype) = (itype) olm1; \ - return fn_do_a; \ -} - - -#define DO_HCf(fn_prep,fn_do_a,fn_do_b,itype,otype) \ -static void \ -fn_do_a(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - otype *outp = (otype *) OUTP; \ - itype inval, olm1 = *((itype *) &(pvt->pad[0])); \ - while (bw-- > 0 ) { \ - if ((inval = *inp++) > olm1) inval = olm1; \ - else if (inval < 0) inval = (itype) 0; \ - *outp++ = (otype) inval; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - otype olm1 = (otype)( (oband->format->levels) \ - ? oband->format->levels - 1 : ~0); \ - *((itype *) &(pvt->pad[0])) = olm1; \ - return fn_do_a; \ -} - -DO_HCb (HCp_bb, HCa_bb, HCb_bb, BitPixel, BitPixel) -DO_HCp (HCp_Bb, HCa_Bb, HCb_Bb, BytePixel, BitPixel) -DO_HCp (HCp_Pb, HCa_Pb, HCb_Pb, PairPixel, BitPixel) -DO_HCp (HCp_Qb, HCa_Qb, HCb_Qb, QuadPixel, BitPixel) -DO_HCfp (HCp_Rb, HCa_Rb, HCb_Rb, RealPixel, BitPixel) - -DO_HCcx (HCp_bB, HCa_bB, HCb_bB, BitPixel, BytePixel) -DO_HCeq (HCp_BB, HCa_BB, HCb_BB, BytePixel, BytePixel) -DO_HCgt (HCp_PB, HCa_PB, HCb_PB, PairPixel, BytePixel) -DO_HCgt (HCp_QB, HCa_QB, HCb_QB, QuadPixel, BytePixel) -DO_HCf (HCp_RB, HCa_RB, HCb_RB, RealPixel, BytePixel) - -DO_HCc (HCp_bP, HCa_bP, HCb_bP, BitPixel, PairPixel) -DO_HClt (HCp_BP, HCa_BP, HCb_BP, BytePixel, PairPixel) -DO_HCeq (HCp_PP, HCa_PP, HCb_PP, PairPixel, PairPixel) -DO_HCgt (HCp_QP, HCa_QP, HCb_QP, QuadPixel, PairPixel) -DO_HCf (HCp_RP, HCa_RP, HCb_RP, RealPixel, PairPixel) - -DO_HCc (HCp_bQ, HCa_bQ, HCb_bQ, BitPixel, QuadPixel) -DO_HClt (HCp_BQ, HCa_BQ, HCb_BQ, BytePixel, QuadPixel) -DO_HClt (HCp_PQ, HCa_PQ, HCb_PQ, PairPixel, QuadPixel) -DO_HCeq (HCp_QQ, HCa_QQ, HCb_QQ, QuadPixel, QuadPixel) -DO_HCf (HCp_RQ, HCa_RQ, HCb_RQ, RealPixel, QuadPixel) - -#undef LEVELSM1 - -/*----------------------------- ClipScale --------------------------------*/ - -typedef float ConstrainFloat; -#define HALF ((ConstrainFloat) 0.5) - -#define LBOUND(T) *((T *) &(pvt->pad[0])) -#define UBOUND(T) *((T *) &(pvt->pad[1])) -#define OLOW(T) *((T *) &(pvt->pad[2])) -#define OHIGH(T) *((T *) &(pvt->pad[3])) -#define FLT_SF *((ConstrainFloat *) &(pvt->pad[4])) -#define FLT_OFF *((ConstrainFloat *) &(pvt->pad[5])) -#define INT_SF *((INT32 *) &(pvt->pad[4])) -#define INT_OFF *((INT32 *) &(pvt->pad[5])) - -static void -cs_scale_equation(pvt,techpvt,band) - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; -{ - QuadPixel olow = techpvt->output_low[band]; - ConstrainFloat ilow = techpvt->input_low[band]; - ConstrainFloat sf = (techpvt->output_high[band] - olow) / - (techpvt->input_high[band] - ilow); - FLT_SF = sf; - FLT_OFF = (ConstrainFloat) olow - sf * ilow; -} - -static void -cs_fix_bits(pvt,techpvt,band) - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; -{ - ConstrainFloat ilow = techpvt->input_low[band]; - ConstrainFloat ihigh = techpvt->input_high[band]; - QuadPixel olow = techpvt->output_low[band]; - QuadPixel ohigh = techpvt->output_high[band]; - /* Prep guarantees ilow != ihigh, but what if ilow > ihigh */ - if (ilow == 0.0 && ihigh == 1.0) { - OLOW(QuadPixel) = olow; - OHIGH(QuadPixel) = ohigh; - return; - } else if (ilow == 1.0 && ihigh == 0.0) { - OLOW(QuadPixel) = ohigh; - OHIGH(QuadPixel) = olow; - return; - } - cs_scale_equation(pvt,techpvt,band); - if (ilow < ihigh) { - if (0.0 <= ilow) OLOW(QuadPixel) = olow; - else if (0.0 >= ihigh) OLOW(QuadPixel) = ohigh; - else OLOW(QuadPixel) = FLT_SF * 0. + FLT_OFF + HALF; - if (1.0 <= ilow) OHIGH(QuadPixel) = olow; - else if (1.0 >= ihigh) OHIGH(QuadPixel) = ohigh; - else OHIGH(QuadPixel) = FLT_SF * 1. + FLT_OFF + HALF; - } else { - if (0.0 >= ilow) OLOW(QuadPixel) = olow; - else if (0.0 <= ihigh) OLOW(QuadPixel) = ohigh; - else OLOW(QuadPixel) = FLT_SF * 0. + FLT_OFF + HALF; - if (1.0 >= ilow) OHIGH(QuadPixel) = olow; - else if (1.0 <= ihigh) OHIGH(QuadPixel) = ohigh; - else OHIGH(QuadPixel) = FLT_SF * 1. + FLT_OFF + HALF; - } -} - -#define DO_CSb(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - if (iband->format->levels == 1 || oband->format->levels == 1) \ - return clearbitline; \ - cs_fix_bits(pvt,techpvt,band); \ - return (OLOW(QuadPixel) == OHIGH(QuadPixel)) \ - ? ((OLOW(QuadPixel) == 0) ? clearbitline: setbitline) \ - : ((OLOW(QuadPixel) == 0) ? copybitline: invertbitline); \ -} - - -#define DO_CSc(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - LogInt inval, M, *inp = (LogInt *) INP; \ - otype *outp = (otype *) OUTP; \ - otype olow = OLOW(otype), ohigh = OHIGH(otype); \ - for ( ; bw >= LOGSIZE ; bw -= LOGSIZE) \ - for (M=LOGLEFT, inval = *inp++; M; LOGRIGHT(M)) \ - *outp++ = (inval & M) ? ohigh : olow ; \ - if (bw > 0) \ - for (M=LOGLEFT, inval = *inp++; bw; bw--, LOGRIGHT(M)) \ - *outp++ = (inval & M) ? ohigh : olow ; \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - cs_fix_bits(pvt,techpvt,band); \ - OLOW(otype) = OLOW(QuadPixel); \ - OHIGH(otype) = OHIGH(QuadPixel); \ - return fn_do; \ -} - -#define DO_CScx(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - otype olow = OLOW(otype), ohigh = OHIGH(otype); \ - bitexpand(INP, OUTP, bw, olow, ohigh); \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - cs_fix_bits(pvt,techpvt,band); \ - OLOW(otype) = OLOW(QuadPixel); \ - OHIGH(otype) = OHIGH(QuadPixel); \ - return fn_do; \ -} - -#define DO_CSp(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - LogInt outval, M, *outp = (LogInt *) OUTP; \ - itype imedian = UBOUND(itype); \ - for ( ; bw >= LOGSIZE ; *outp++ = outval, bw -= LOGSIZE) \ - for (M=LOGLEFT, outval = 0; M; LOGRIGHT(M)) \ - if (*inp++ > imedian) \ - outval |= M; \ - if (bw > 0) { \ - for (M=LOGLEFT, outval = 0; bw; bw--, LOGRIGHT(M)) \ - if (*inp++ > imedian) \ - outval |= M; \ - *outp = outval; \ - } \ -} \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - LogInt outval, M, *outp = (LogInt *) OUTP; \ - itype imedian = UBOUND(itype); \ - for ( ; bw >= LOGSIZE ; *outp++ = outval, bw -= LOGSIZE) \ - for (M=LOGLEFT, outval = 0; M; LOGRIGHT(M)) \ - if (*inp++ <= imedian) \ - outval |= M; \ - if (bw > 0) { \ - for (M=LOGLEFT, outval = 0; bw; bw--, LOGRIGHT(M)) \ - if (*inp++ <= imedian) \ - outval |= M; \ - *outp = outval; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - otype olow = techpvt->output_low[band]; \ - otype ohigh = techpvt->output_high[band]; \ - if (olow == ohigh) \ - return (olow == 0) ? clearbitline : setbitline; \ - UBOUND(itype) = HALF * \ - (techpvt->input_low[band] + techpvt->input_high[band]); \ - return (techpvt->input_low[band] < techpvt->input_high[band]) \ - ? fn_do : fn_do_b; \ -} - -#define DO_CS(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - itype inv, lbound = LBOUND(itype), ubound = UBOUND(itype); \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - ConstrainFloat sf = FLT_SF, offset = FLT_OFF; \ - while (bw-- > 0) { \ - inv = *inp++; \ - out = olow; \ - if (inv >= ubound) \ - out = ohigh; \ - else if (inv > lbound) \ - out = (otype)(sf * inv + offset); \ - *outp++ = out; \ - } \ -} \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - itype inv, lbound = LBOUND(itype), ubound = UBOUND(itype); \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - ConstrainFloat sf = FLT_SF, offset = FLT_OFF; \ - while (bw-- > 0) { \ - inv = *inp++; \ - out = ohigh; \ - if (inv >= lbound) \ - out = olow; \ - else if (inv > ubound) \ - out = (otype)(sf * inv + offset); \ - *outp++ = out; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - OLOW(otype) = techpvt->output_low[band]; \ - OHIGH(otype) = techpvt->output_high[band]; \ - LBOUND(itype) = (itype) (techpvt->input_low[band] + HALF); \ - UBOUND(itype) = (itype) (techpvt->input_high[band] + HALF); \ - cs_scale_equation(pvt,techpvt,band); \ - FLT_OFF += HALF; \ - return (FLT_SF >= 0.0) ? fn_do : fn_do_b; \ -} - -#if defined(USE_FLOATS) -#define DO_CSi(fn_prep,fn_do,fn_do_b,itype,otype,shift) \ - DO_CS(fn_prep,fn_do,fn_do_b,itype,otype) -#else -/* XXX need LUT based approach for small sizes */ -#define DO_CSi_part1(fna,itype,otype,shift) \ -static void \ -fna(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - INT32 lbound = (INT32) LBOUND(itype); \ - INT32 ubound = (INT32) UBOUND(itype); \ - INT32 int_sf = INT_SF, int_off = INT_OFF; \ - CARD32 inv; \ - while (bw > 0) { \ - inv = *inp++; \ - out = ohigh; \ - bw--; \ - if (inv < ubound) { \ - out = (otype)((int_sf * inv + int_off)>>shift); \ - if (inv <= lbound) \ - out = olow; \ - } \ - *outp++ = out; \ - } \ -} -#define DO_CSi_part2(fnb,itype,otype,shift) \ -static void \ -fnb(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - INT32 lbound = (INT32) LBOUND(itype); \ - INT32 ubound = (INT32) UBOUND(itype); \ - INT32 int_sf = INT_SF, int_off = INT_OFF; \ - CARD32 inv; \ - while (bw > 0) { \ - inv = *inp++; \ - out = olow; \ - bw--; \ - if (inv < lbound) { \ - out = (otype)((int_sf * inv + int_off)>>shift); \ - if (inv <= ubound) \ - out = ohigh; \ - } \ - *outp++ = out; \ - } \ -} -/* some compilers gag on long macros. somehow this helps */ -#define DO_CSi(fn_prep,fn_do,fn_do_b,itype,otype,shift) \ -DO_CSi_part1(fn_do,itype,otype,shift) \ -DO_CSi_part2(fn_do_b,itype,otype,shift) \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - CARD32 olow, ohigh; INT32 int_sf, int_off; \ - olow = techpvt->output_low[band]; \ - ohigh = techpvt->output_high[band]; \ - LBOUND(itype) = (itype) (techpvt->input_low[band] + HALF); \ - UBOUND(itype) = (itype) (techpvt->input_high[band] + HALF); \ - OLOW(otype) = olow = techpvt->output_low[band]; \ - OHIGH(otype) = ohigh = techpvt->output_high[band]; \ - olow <<= shift; \ - ohigh <<= shift; \ - INT_SF = int_sf = (ohigh - olow) / \ - (techpvt->input_high[band] - techpvt->input_low[band]); \ - INT_OFF = int_off = (1<<(shift-1)) + olow - \ - int_sf * (INT32) techpvt->input_low[band]; \ - INT_SF = int_sf; \ - INT_OFF = int_off; \ - return (int_sf >= 0) ? fn_do : fn_do_b; \ -} -#endif - -#define DO_CSf(fn_prep,fn_do,fn_do_b,itype,otype) \ -static void \ -fn_do(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - itype inv, lbound = LBOUND(itype), ubound = UBOUND(itype); \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - ConstrainFloat sf = FLT_SF, offset = FLT_OFF; \ - while (bw-- > 0) { \ - inv = *inp++; \ - out = olow; \ - if (inv >= ubound) \ - out = ohigh; \ - else if (inv > lbound) \ - out = (otype)(sf * inv + offset); \ - *outp++ = out; \ - } \ -} \ -static void \ -fn_do_b(INP,OUTP,pvt,bw) \ - pointer INP; pointer OUTP; mpCnstPvtPtr pvt; int bw; \ -{ \ - itype *inp = (itype *) INP; otype *outp = (otype *) OUTP; \ - itype inv, lbound = LBOUND(itype), ubound = UBOUND(itype); \ - otype out, olow = OLOW(otype), ohigh = OHIGH(otype); \ - ConstrainFloat sf = FLT_SF, offset = FLT_OFF; \ - while (bw-- > 0) { \ - inv = *inp++; \ - out = ohigh; \ - if (inv >= lbound) \ - out = olow; \ - else if (inv > ubound) \ - out = (otype)(sf * inv + offset); \ - *outp++ = out; \ - } \ -} \ -static void \ -(*fn_prep (iband,oband,pvt,techpvt,band))() \ - bandPtr iband, oband; \ - mpCnstPvtPtr pvt; pCnstDefPtr techpvt; int band; \ -{ \ - OLOW(otype) = techpvt->output_low[band]; \ - OHIGH(otype) = techpvt->output_high[band]; \ - LBOUND(itype) = (itype) techpvt->input_low[band]; \ - UBOUND(itype) = (itype) techpvt->input_high[band]; \ - cs_scale_equation(pvt,techpvt,band); \ - return (FLT_SF >= 0.0) ? fn_do : fn_do_b; \ -} - -DO_CSb (CSp_bb, CSa_bb, CSb_bb, BitPixel, BitPixel) -DO_CSp (CSp_Bb, CSa_Bb, CSb_Bb, BytePixel, BitPixel) -DO_CSp (CSp_Pb, CSa_Pb, CSb_Pb, PairPixel, BitPixel) -DO_CSp (CSp_Qb, CSa_Qb, CSb_Qb, QuadPixel, BitPixel) -DO_CSp (CSp_Rb, CSa_Rb, CSb_Rb, RealPixel, BitPixel) - -DO_CScx (CSp_bB, CSa_bB, CSb_bB, BitPixel, BytePixel) -DO_CSi (CSp_BB, CSa_BB, CSb_BB, BytePixel, BytePixel, 22) -DO_CSi (CSp_PB, CSa_PB, CSb_PB, PairPixel, BytePixel, 22) -DO_CSi (CSp_QB, CSa_QB, CSb_QB, QuadPixel, BytePixel, 22) -DO_CSf (CSp_RB, CSa_RB, CSb_RB, RealPixel, BytePixel) - -DO_CSc (CSp_bP, CSa_bP, CSb_bP, BitPixel, PairPixel) -DO_CSi (CSp_BP, CSa_BP, CSb_BP, BytePixel, PairPixel, 14) -DO_CSi (CSp_PP, CSa_PP, CSb_PP, PairPixel, PairPixel, 14) -DO_CSi (CSp_QP, CSa_QP, CSb_QP, QuadPixel, PairPixel, 14) -DO_CSf (CSp_RP, CSa_RP, CSb_RP, RealPixel, PairPixel) - -DO_CSc (CSp_bQ, CSa_bQ, CSb_bQ, BitPixel, QuadPixel) -DO_CSi (CSp_BQ, CSa_BQ, CSb_BQ, BytePixel, QuadPixel, 6) -DO_CSi (CSp_PQ, CSa_PQ, CSb_PQ, PairPixel, QuadPixel, 6) -DO_CSi (CSp_QQ, CSa_QQ, CSb_QQ, QuadPixel, QuadPixel, 6) -DO_CSf (CSp_RQ, CSa_RQ, CSb_RQ, RealPixel, QuadPixel) - -#undef LBOUND -#undef HBOUND -#undef OLOW -#undef OHIGH -#undef FLT_SF -#undef FLT_OFF -#undef INT_SF -#undef INT_OFF - -/* end module mpcnst.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpcomp.c diff -u xc/programs/Xserver/XIE/mixie/process/mpcomp.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpcomp.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpcomp.c:3.5 Fri Dec 14 14:58:44 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpcomp.c Sat Feb 28 21:42:00 2004 @@ -1,1226 +0,0 @@ -/* $Xorg: mpcomp.c,v 1.6 2001/02/09 02:04:30 xorgcvs Exp $ */ -/**** module mpcomp.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpcomp.c -- DDXIE compare element - - Larry Hare -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpcomp.c,v 3.5 2001/12/14 19:58:44 dawes Exp $ */ - - -#define _XIEC_MPCOMP -#define _XIEC_PCOMP - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeCompare(); - -/* -** Turn on NON_ROI to get non ROI based versions. They don't really go -** faster and cost about 20Kbytes of object code space. -*/ - -/* - * routines used internal to this module - */ -static int CreateCompare(); -static int InitializeCompare(); -static int ResetCompare(); -static int DestroyCompare(); - -#if defined(NON_ROI) -static int ActivateCompareM(); -static int ActivateCompareD(); -#endif -static int ActivateCompareMROI(); -static int ActivateCompareDROI(); -static int ActivateCompareTripleM(); -static int ActivateCompareTripleD(); - -/* - * DDXIE Compare entry points - */ -static ddElemVecRec CompareVec = { - CreateCompare, - InitializeCompare, - ActivateCompareMROI, - (xieBoolProc)NULL, - ResetCompare, - DestroyCompare - }; - -/* -* Local Declarations. -*/ - -typedef struct _mpcomparedef { - CARD32 iconst; /* first, in case of .asm code */ - RealPixel fconst; /* second, in case of .asm code */ - void (*action) (); - CARD32 width; - BOOL final; -#if defined(NON_ROI) - void (*action2) (); - CARD32 endrun; - CARD32 endix; -#endif -} mpComparePvtRec, *mpComparePvtPtr; - -/* -** NOTE: Might change constants to use dyads with prefilled constant strip -** to conserve code space at some small execution time expense. -** NOTE: The ROI variants use three loops, the first to get in sync with -** 32 bits, and the last to finish up partial words. A more space -** efficient version would have one loop which would check for M -** wrapping in which case the old word would be written. -** It also requires loads of intermediate destination words which -** will be completely overwritten. -** NOTE: Might do NE/GT/GE as a second pass inversion of EQ/LE/LT to -** save even more space at cost of another time penalty. This -** inversion would have to be applied to active ROI entries only. -** NOTE: On some machine architectures, it may be possible to write -** assembly or asm() code which does a compare and then extracts -** some 1 bit from a condition code register. This would reduce -** the multiplication of code by 6 (or 3). Heck you could even -** generate assembly code yourself automagically ... -** NOTE: Triple Compare assumes all src1 bands same height/width. -** NOTE: Triple Compare assumes all src2 bands same height/width. -** NOTE: Triple Compare with band_mask of 0 sets output to 1 (for -** equal) or 0 (for not equal) or 0 (outside ROI). This sortof -** makes sense since all the selected bands were equal :-) -*/ - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeCompare(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = CompareVec; - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateCompare(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* always force syncing between inputs (is nop if only one input) */ - return MakePETex(flo,ped, - xieValMaxBands * sizeof(mpComparePvtRec), - SYNC, /* InSync: Make sure ROI exists first */ - NO_SYNC /* bandSync: see InitializeCompare */ - ); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - -#if defined(NON_ROI) -static int ActivateCompareM(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, dband++) { - CARD32 npix = pvt->width; - LogInt *svoid, *dvoid; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) continue; - - do { - /* NOTE: could pass in replicated constant strip here */ - (*(pvt->action)) (dvoid, svoid, pvt, npix); - svoid = GetNextSrc(flo,pet,sband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } while (!ferrCode(flo) && svoid && dvoid) ; - - FreeData(flo, pet, sband, sband->current); - } - return TRUE; -} -#endif /* NON_ROI */ - -#if defined(NON_ROI) -static int ActivateCompareD(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, tband++, dband++) { - LogInt *svoid, *tvoid, *dvoid; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(tvoid = GetCurrentSrc(flo,pet,tband)) || - !(dvoid = GetCurrentDst(flo,pet,dband)) ) { - if (sband->final && tband->final) { - /* Generate constant fill of 0 for remainder of image */ - while ((dband->current < dband->format->height) && - (dvoid = GetCurrentDst(flo,pet,dband))) { - action_clear(dvoid,dband->format->pitch,0); - if (PutData(flo,pet,dband,dband->current+1)) - break; - } - } - continue; - } - - do { - (*(pvt->action)) (dvoid, svoid, tvoid, pvt->endix); - if (pvt->action2) - (*(pvt->action2)) (dvoid, pvt->endrun, pvt->endix); - svoid = GetNextSrc(flo,pet,sband,FLUSH); - tvoid = GetNextSrc(flo,pet,tband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } while (!ferrCode(flo) && svoid && tvoid && dvoid) ; - - if(!svoid && sband->final) { /* when sr1 runs out, kill sr2 too */ - DisableSrc(flo,pet,tband,FLUSH); - pvt->final = TRUE; /* generate constant fill on future activates */ - } else if(!tvoid && tband->final) {/* when sr2 runs out, clear rest */ - DisableSrc(flo,pet,sband,FLUSH); - pvt->final = TRUE; /* generate constant fill on future activates */ - } else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sband,sband->current); - FreeData(flo,pet,tband,tband->current); - } - } - return TRUE; -} -#endif /* NON_ROI */ - -static int ActivateCompareMROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, dband++) { - pointer svoid, dvoid; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) continue; - - while (!ferrCode(flo) && svoid && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - INT32 run, ix = 0; - - /* bzero better for messy control planes */ - /* bzero((char *)dvoid, dband->pitch); */ - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - /* NOTE: could pass in replicated constant strip here */ - (*(pvt->action)) (dvoid, svoid, pvt, run, ix); - ix += run; - } else { - /* action_clear better for non ROI or simple ROIs */ - action_clear(dvoid, -run, ix); - ix -= run; - } - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - FreeData(flo, pet, sband, sband->current); - } - return TRUE; -} - -static int ActivateCompareDROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, tband++, dband++) { - pointer svoid, tvoid, dvoid; - CARD32 w = pvt->width; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(tvoid = GetCurrentSrc(flo,pet,tband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) { - if (sband->final && tband->final) { - /* Generate constant fill of 0 for remainder of image */ - while ((dband->current < dband->format->height) && - (dvoid = GetCurrentDst(flo,pet,dband))) { - action_clear(dvoid,dband->format->pitch,0); - if (PutData(flo,pet,dband,dband->current+1)) - break; - } - } - continue; - } - - while (!ferrCode(flo) && svoid && tvoid && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - INT32 run, ix = 0; - - /* bzero better for messy control planes */ - /* bzero((char *)dvoid, dband->pitch); */ - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - /* needs to clip to second source, yuck */ - if ((ix + run) > w) { - if (ix < w) { - (*(pvt->action)) (dvoid, svoid, tvoid, w - ix, ix); - ix = w; - } - action_clear(dvoid, dband->format->width - ix, ix); - break; - } - (*(pvt->action)) (dvoid, svoid, tvoid, run, ix); - ix += run; - } else { - /* action_clear better for non ROI or simple ROIs */ - action_clear(dvoid, -run, ix); - ix -= run; - } - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - tvoid = GetNextSrc(flo,pet,tband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - if(!svoid && sband->final) { - /* when sr1 runs out, kill sr2 too. should be done */ - DisableSrc(flo,pet,tband,FLUSH); - pvt->final = TRUE; - } else if(!tvoid && tband->final) { - /* when sr2 runs out, kill off sr1 also, and clear remaining dest */ - DisableSrc(flo,pet,sband,FLUSH); - pvt->final = TRUE; - } else { - /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sband,sband->current); - FreeData(flo,pet,tband,tband->current); - } - } - return TRUE; -} - -static int ActivateCompareTripleM(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD8 msk = ((xieFloCompare *) ped->elemRaw)->bandMask; - BOOL equal = ((xieFloCompare *) ped->elemRaw)->operator == xieValEQ; - register pointer s0 = (pointer ) 1; - register pointer s1 = (pointer ) 1; - register pointer s2 = (pointer ) 1; - register pointer dvoid; - - if ((msk & 1) && !(s0 = GetCurrentSrc(flo,pet,sband))) - goto done; sband++; - if ((msk & 2) && !(s1 = GetCurrentSrc(flo,pet,sband))) - goto done; sband++; - if ((msk & 4) && !(s2 = GetCurrentSrc(flo,pet,sband))) - goto done; sband -= 2; - if(!(dvoid = GetCurrentDst(flo,pet,dband))) - goto done; - - /* - ** An alternative algorithm might use while(GetRun) loop to - ** set or clear the destination bits in the line; and then - ** use SIMPLER action routines which scanned the entire line - ** and only operate on 1 pixels; optionally followed by - ** a while(GetRun) to invert the active bits for NE. - */ - pvt += 2; - while (!ferrCode(flo) && s0 && s1 && s2 && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - register INT32 run, ix = 0; - - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - action_set(dvoid, run, ix); - pvt -= 2; if (msk & 1) - (*pvt->action) (dvoid, s0, pvt, run, ix); - pvt++; if (msk & 2) - (*pvt->action) (dvoid, s1, pvt, run, ix); - pvt++; if (msk & 4) - (*pvt->action) (dvoid, s2, pvt, run, ix); - if (!equal) - action_invert(dvoid, run, ix); - ix += run; - } else { - action_clear(dvoid, -run, ix); - ix -= run; - } - } - - if (msk & 1) s0 = GetNextSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 2) s1 = GetNextSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 4) s2 = GetNextSrc(flo,pet,sband,FLUSH); sband -= 2; - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - if (msk & 1) FreeData(flo,pet,sband,sband->current); sband++; - if (msk & 2) FreeData(flo,pet,sband,sband->current); sband++; - if (msk & 4) FreeData(flo,pet,sband,sband->current); sband -= 2; -done: - return TRUE; -} - -static int ActivateCompareTripleD(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD8 msk = ((xieFloCompare *) ped->elemRaw)->bandMask; - BOOL equal = ((xieFloCompare *) ped->elemRaw)->operator == xieValEQ; - CARD32 w = pvt->width; - register pointer s0 = (pointer ) 1; - register pointer s1 = (pointer ) 1; - register pointer s2 = (pointer ) 1; - register pointer t0 = (pointer ) 1; - register pointer t1 = (pointer ) 1; - register pointer t2 = (pointer ) 1; - register pointer dvoid; - - if (pvt->final) { /* generate constant fill */ - /* Generate constant fill of 0 for remainder of image */ - while ((dband->current < dband->format->height) && - (dvoid = GetCurrentDst(flo,pet,dband))) { - action_clear(dvoid,dband->format->pitch,0); - if (PutData(flo,pet,dband,dband->current+1)) - break; - } - return TRUE; - } - - if (msk & 1) s0 = GetCurrentSrc(flo,pet,sband); sband++; - if (msk & 2) s1 = GetCurrentSrc(flo,pet,sband); sband++; - if (msk & 4) s2 = GetCurrentSrc(flo,pet,sband); sband -= 2; - if (msk & 1) t0 = GetCurrentSrc(flo,pet,tband); tband++; - if (msk & 2) t1 = GetCurrentSrc(flo,pet,tband); tband++; - if (msk & 4) t2 = GetCurrentSrc(flo,pet,tband); tband -= 2; - - dvoid = GetCurrentDst(flo,pet,dband); - - while (!ferrCode(flo) && s0 && s1 && s2 && t0 && t1 && t2 && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - register INT32 run, ix = 0, extra; - - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - extra = 0; - if ((ix+run) > w) { /* tband < sband */ - if (ix >= w) { /* already off the end of src2 */ - action_clear(dvoid, dband->format->width - ix, ix); - break; - } - extra = ix + run - w; - action_clear(dvoid, extra, w); - run = w - ix; - } - action_set(dvoid, run, ix); - if (msk & 1) (*((pvt+0)->action)) (dvoid, s0, t0, run, ix); - if (msk & 2) (*((pvt+1)->action)) (dvoid, s1, t1, run, ix); - if (msk & 4) (*((pvt+2)->action)) (dvoid, s2, t2, run, ix); - if (!equal) action_invert(dvoid, run, ix); - ix += run + extra; - } else { - action_clear(dvoid, -run, ix); - ix -= run; - } - } - - if (msk & 1) s0 = GetNextSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 2) s1 = GetNextSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 4) s2 = GetNextSrc(flo,pet,sband,FLUSH); sband -= 2; - if (msk & 1) t0 = GetNextSrc(flo,pet,tband,FLUSH); tband++; - if (msk & 2) t1 = GetNextSrc(flo,pet,tband,FLUSH); tband++; - if (msk & 4) t2 = GetNextSrc(flo,pet,tband,FLUSH); tband -= 2; - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - if (msk & 1) FreeData(flo,pet,sband,sband->current); sband++; - if (msk & 2) FreeData(flo,pet,sband,sband->current); sband++; - if (msk & 4) FreeData(flo,pet,sband,sband->current); sband -= 2; - if (msk & 1) FreeData(flo,pet,tband,tband->current); tband++; - if (msk & 2) FreeData(flo,pet,tband,tband->current); tband++; - if (msk & 4) FreeData(flo,pet,tband,tband->current); tband -= 2; - - /* if dband is final, then we are done. make sure src2 disabled */ - if (dband->current >= dband->format->height) { - if (msk & 1) DisableSrc(flo,pet,tband,FLUSH); tband++; - if (msk & 2) DisableSrc(flo,pet,tband,FLUSH); tband++; - if (msk & 4) DisableSrc(flo,pet,tband,FLUSH); tband -= 2; - return TRUE; - } - - /* if src2 finished early, then disable src1 and generate 0 fill */ - if (dband->current >= tband->format->height) { - /* only need to check one band since in theory all the same */ - if (msk & 1) DisableSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 2) DisableSrc(flo,pet,sband,FLUSH); sband++; - if (msk & 4) DisableSrc(flo,pet,sband,FLUSH); sband -= 2; - pvt->final = TRUE; - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetCompare(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyCompare(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -#if defined(NON_ROI) -/* M: (*(pvt->action)) (dvoid, svoid, pvt, bw); */ -/* D: (*(pvt->action)) (dvoid, svoid, tvoid, bw); */ - -#define MakeBit(name1, name2, op) \ -static void name1(dst,src1,pvt,nx) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - CARD32 nx; \ -{ \ - LogInt *src = (LogInt *) src1; \ - LogInt S1, S2 = (pvt->iconst ? LOGONES : LOGZERO); \ - for (nx = (nx + LOGMASK) >> LOGSHIFT; nx > 0; nx--) { \ - S1 = *src++; \ - *dst++ = op; \ - } \ -} \ -static void name2(dst,src1,src2,nx) \ - LogInt *dst; \ - pointer src1, src2; \ - CARD32 nx; \ -{ \ - LogInt S1, *src = (LogInt *) src1; \ - LogInt S2, *trc = (LogInt *) src2; \ - for (nx = (nx + LOGMASK) >> LOGSHIFT; nx > 0; nx--) { \ - S1 = *src++; \ - S2 = *trc++; \ - *dst++ = op; \ - } \ -} - -#define MakePix(name1, name2, itype, cnst_name, op) \ -static void name1(dst,src1,pvt,nx) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - CARD32 nx; \ -{ \ - itype *src = (itype *) src1; \ - itype con = (itype) pvt->cnst_name; \ - LogInt M, value; \ - for ( ; nx >= LOGSIZE; nx -= LOGSIZE, *dst++ = value) \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ op con) \ - value |= M; \ - if (nx > 0) { \ - for (value = 0, M=LOGLEFT; nx; nx--, LOGRIGHT(M)) \ - if (*src++ op con) \ - value |= M; \ - *dst = value; \ - } \ -} \ -static void name2(dst,src1,src2,nx) \ - LogInt *dst; \ - pointer src1, src2; \ - CARD32 nx; \ -{ \ - itype *src = (itype *) src1; \ - itype *trc = (itype *) src2; \ - LogInt M, value; \ - for ( ; nx >= LOGSIZE; nx -= LOGSIZE, *dst++ = value) \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ op *trc++) \ - value |= M; \ - if (nx > 0) { \ - for (value = 0, M=LOGLEFT; nx; nx--, LOGRIGHT(M)) \ - if (*src++ op *trc++) \ - value |= M; \ - *dst = value; \ - } \ -} - -MakeBit (m_bit_lt, d_bit_lt, (S2 & ~S1) ) -MakeBit (m_bit_le, d_bit_le, (S2 | ~S1) ) -MakeBit (m_bit_eq, d_bit_eq, (S1 ^ ~S2) ) -MakeBit (m_bit_ne, d_bit_ne, (S1 ^ S2) ) -MakeBit (m_bit_gt, d_bit_gt, (S1 & ~S2) ) -MakeBit (m_bit_ge, d_bit_ge, (S1 | ~S2) ) - -MakePix (m_byte_lt, d_byte_lt, BytePixel, iconst, < ) -MakePix (m_byte_le, d_byte_le, BytePixel, iconst, <= ) -MakePix (m_byte_eq, d_byte_eq, BytePixel, iconst, == ) -MakePix (m_byte_ne, d_byte_ne, BytePixel, iconst, != ) -MakePix (m_byte_gt, d_byte_gt, BytePixel, iconst, > ) -MakePix (m_byte_ge, d_byte_ge, BytePixel, iconst, >= ) - -MakePix (m_pair_lt, d_pair_lt, PairPixel, iconst, < ) -MakePix (m_pair_le, d_pair_le, PairPixel, iconst, <= ) -MakePix (m_pair_eq, d_pair_eq, PairPixel, iconst, == ) -MakePix (m_pair_ne, d_pair_ne, PairPixel, iconst, != ) -MakePix (m_pair_gt, d_pair_gt, PairPixel, iconst, > ) -MakePix (m_pair_ge, d_pair_ge, PairPixel, iconst, >= ) - -MakePix (m_quad_lt, d_quad_lt, QuadPixel, iconst, < ) -MakePix (m_quad_le, d_quad_le, QuadPixel, iconst, <= ) -MakePix (m_quad_eq, d_quad_eq, QuadPixel, iconst, == ) -MakePix (m_quad_ne, d_quad_ne, QuadPixel, iconst, != ) -MakePix (m_quad_ge, d_quad_ge, QuadPixel, iconst, >= ) -MakePix (m_quad_gt, d_quad_gt, QuadPixel, iconst, > ) - -MakePix (m_real_lt, d_real_lt, RealPixel, fconst, < ) -MakePix (m_real_le, d_real_le, RealPixel, fconst, <= ) -MakePix (m_real_eq, d_real_eq, RealPixel, fconst, == ) -MakePix (m_real_ne, d_real_ne, RealPixel, fconst, != ) -MakePix (m_real_gt, d_real_gt, RealPixel, fconst, > ) -MakePix (m_real_ge, d_real_ge, RealPixel, fconst, >= ) - -static void (*action_mono[5][6])() = { - m_real_lt, m_real_le, m_real_eq, m_real_ne, m_real_gt, m_real_ge, - m_bit_lt, m_bit_le, m_bit_eq, m_bit_ne, m_bit_gt, m_bit_ge, - m_byte_lt, m_byte_le, m_byte_eq, m_byte_ne, m_byte_gt, m_byte_ge, - m_pair_lt, m_pair_le, m_pair_eq, m_pair_ne, m_pair_gt, m_pair_ge, - m_quad_lt, m_quad_le, m_quad_eq, m_quad_ne, m_quad_gt, m_quad_ge -}; -static void (*action_dyad[5][6])() = { - d_real_lt, d_real_le, d_real_eq, d_real_ne, d_real_gt, d_real_ge, - d_bit_lt, d_bit_le, d_bit_eq, d_bit_ne, d_bit_gt, d_bit_ge, - d_byte_lt, d_byte_le, d_byte_eq, d_byte_ne, d_byte_gt, d_byte_ge, - d_pair_lt, d_pair_le, d_pair_eq, d_pair_ne, d_pair_gt, d_pair_ge, - d_quad_lt, d_quad_le, d_quad_eq, d_quad_ne, d_quad_gt, d_quad_ge -}; -#endif - -/*------------------------------------------------------------------------ ---------------------- ROI operations work on subranges ------------------ -------------------------------------------------------------------------*/ - -/* MROI: (*(pvt->action)) (dvoid, src1, pvt, run, ix); */ -/* DROI: (*(pvt->action)) (dvoid, src1, src2, run, ix); */ - -/* Currently ROI code pre-zeroes the line and then we OR into it. -** If we want to use this for the nonROI code as well, it might be -** more efficient to instead use a passive routine (when run < 0) to -** clear out the idle bits. -*/ - -#define RakeBit(name1, name2, op) \ -static void name1(dst,src1,pvt,dx,x) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - INT32 dx, x; \ -{ \ - CARD32 M, D, px = LOGINDX(x); \ - LogInt S1, *src = ((LogInt *) src1) + px; \ - LogInt S2 = (pvt->iconst ? LOGONES : LOGZERO); \ - dst += px; \ - px = x & LOGMASK; \ - if ((px + dx) >= LOGSIZE) { \ - if (px) { \ - S1 = *src++; \ - D = *dst; \ - M = BitRight(LOGONES,px); \ - dx -= (LOGSIZE - px); \ - *dst++ = D | (M & op); \ - } \ - for (px = dx >> LOGSHIFT; px > 0; px--) { \ - S1 = *src++; \ - *dst++ = op; \ - } \ - if (dx &= LOGMASK) { \ - S1 = *src; \ - D = *dst; \ - M = ~BitRight(LOGONES,dx); \ - *dst = D | (M & op); \ - } \ - } else { \ - S1 = *src; \ - D = *dst; \ - M = BitRight(LOGONES,px) & ~(BitRight(LOGONES,px+dx)); \ - *dst = D | (M & op); \ - } \ -} \ -static void name2(dst,src1,src2,dx,x) \ - LogInt *dst; \ - pointer src1, src2; \ - INT32 dx, x; \ -{ \ - CARD32 M, D, px = LOGINDX(x); \ - LogInt S1, *src = ((LogInt *) src1) + px; \ - LogInt S2, *trc = ((LogInt *) src2) + px; \ - dst += px; \ - px = x & LOGMASK; \ - if ((px + dx) >= LOGSIZE) { \ - if (px) { \ - S1 = *src++; S2 = *trc++; \ - D = *dst; \ - M = BitRight(LOGONES,px); \ - dx -= (LOGSIZE - px); \ - *dst++ = D | (M & op); \ - } \ - for (px = dx >> LOGSHIFT; px > 0; px--) { \ - S1 = *src++; S2 = *trc++; \ - *dst++ = op; \ - } \ - if (dx &= LOGMASK) { \ - S1 = *src; S2 = *trc; \ - D = *dst; \ - M = ~BitRight(LOGONES,dx); \ - *dst = D | (M & op); \ - } \ - } else { \ - S1 = *src; S2 = *trc; \ - D = *dst; \ - M = BitRight(LOGONES,px) & ~(BitRight(LOGONES,px+dx)); \ - *dst = D | (M & op); \ - } \ -} - -#define RakePix(name1, name2, itype, cnst_name, op) \ -static void name1(dst,src1,pvt,dx,x) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - INT32 dx, x; \ -{ \ - itype *src = ((itype *) src1) + x; \ - itype con = (itype) pvt->cnst_name; \ - LogInt M, value; \ - dst += LOGINDX(x); \ - if (x & LOGMASK) { \ - for (value = *dst, M=LOGBIT(x); dx && M; dx--, LOGRIGHT(M)) \ - if (*src++ op con) \ - value |= M; \ - else \ - value &= ~M; \ - *dst++ = value; \ - } \ - for ( ; dx >= LOGSIZE; dx -= LOGSIZE, *dst++ = value) \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ op con) \ - value |= M; \ - if (dx > 0) { \ - for (value = 0, M=LOGLEFT; dx; dx--, LOGRIGHT(M)) \ - if (*src++ op con) \ - value |= M; \ - *dst = value; \ - } \ -} \ -static void name2(dst,src1,src2,dx,x) \ - LogInt *dst; \ - pointer src1, src2; \ - INT32 dx, x; \ -{ \ - itype *src = ((itype *) src1) + x; \ - itype *trc = ((itype *) src2) + x; \ - LogInt M, value; \ - dst += LOGINDX(x); \ - if (x & LOGMASK) { \ - for (value = *dst, M=LOGBIT(x); dx && M; dx--, LOGRIGHT(M)) \ - if (*src++ op *trc++) \ - value |= M; \ - else \ - value &= ~M; \ - *dst++ = value; \ - } \ - for ( ; dx >= LOGSIZE; dx -= LOGSIZE, *dst++ = value) \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ op *trc++) \ - value |= M; \ - if (dx > 0) { \ - for (value = 0, M=LOGLEFT; dx; dx--, LOGRIGHT(M)) \ - if (*src++ op *trc++) \ - value |= M; \ - *dst = value; \ - } \ -} - -/* -** Consider the following paradigm. It adds a taken branch to -** each loop, but reduces the amount of total code. This mechanism -** also relies on the preclearing of the full destination while -** the above mechanism could be adapted to apply boundary masks, -** to work more efficiently with nonROI data. -** -** for (value = 0, M = x & LOGMASK ; dx ; dx--) { -** if (*src++ op *trc++) value |= M; -** if (LOGRIGHT(M)) { *dst++ |= value; value = 0; } -** } -*/ - -RakeBit (rm_bit_lt, rd_bit_lt, (S2 & ~S1) ) -RakeBit (rm_bit_le, rd_bit_le, (S2 | ~S1) ) -RakeBit (rm_bit_eq, rd_bit_eq, (S1 ^ ~S2) ) -RakeBit (rm_bit_ne, rd_bit_ne, (S1 ^ S2) ) -RakeBit (rm_bit_gt, rd_bit_gt, (S1 & ~S2) ) -RakeBit (rm_bit_ge, rd_bit_ge, (S1 | ~S2) ) - -RakePix (rm_byte_lt, rd_byte_lt, BytePixel, iconst, < ) -RakePix (rm_byte_le, rd_byte_le, BytePixel, iconst, <= ) -RakePix (rm_byte_eq, rd_byte_eq, BytePixel, iconst, == ) -RakePix (rm_byte_ne, rd_byte_ne, BytePixel, iconst, != ) -RakePix (rm_byte_gt, rd_byte_gt, BytePixel, iconst, > ) -RakePix (rm_byte_ge, rd_byte_ge, BytePixel, iconst, >= ) - -RakePix (rm_pair_lt, rd_pair_lt, PairPixel, iconst, < ) -RakePix (rm_pair_le, rd_pair_le, PairPixel, iconst, <= ) -RakePix (rm_pair_eq, rd_pair_eq, PairPixel, iconst, == ) -RakePix (rm_pair_ne, rd_pair_ne, PairPixel, iconst, != ) -RakePix (rm_pair_gt, rd_pair_gt, PairPixel, iconst, > ) -RakePix (rm_pair_ge, rd_pair_ge, PairPixel, iconst, >= ) - -RakePix (rm_quad_lt, rd_quad_lt, QuadPixel, iconst, < ) -RakePix (rm_quad_le, rd_quad_le, QuadPixel, iconst, <= ) -RakePix (rm_quad_eq, rd_quad_eq, QuadPixel, iconst, == ) -RakePix (rm_quad_ne, rd_quad_ne, QuadPixel, iconst, != ) -RakePix (rm_quad_ge, rd_quad_ge, QuadPixel, iconst, >= ) -RakePix (rm_quad_gt, rd_quad_gt, QuadPixel, iconst, > ) - -RakePix (rm_real_lt, rd_real_lt, RealPixel, fconst, < ) -RakePix (rm_real_le, rd_real_le, RealPixel, fconst, <= ) -RakePix (rm_real_eq, rd_real_eq, RealPixel, fconst, == ) -RakePix (rm_real_ne, rd_real_ne, RealPixel, fconst, != ) -RakePix (rm_real_gt, rd_real_gt, RealPixel, fconst, > ) -RakePix (rm_real_ge, rd_real_ge, RealPixel, fconst, >= ) - -static void (*action_monoROI[5][6])() = { - rm_real_lt, rm_real_le, rm_real_eq, rm_real_ne, rm_real_gt, rm_real_ge, - rm_bit_lt, rm_bit_le, rm_bit_eq, rm_bit_ne, rm_bit_gt, rm_bit_ge, - rm_byte_lt, rm_byte_le, rm_byte_eq, rm_byte_ne, rm_byte_gt, rm_byte_ge, - rm_pair_lt, rm_pair_le, rm_pair_eq, rm_pair_ne, rm_pair_gt, rm_pair_ge, - rm_quad_lt, rm_quad_le, rm_quad_eq, rm_quad_ne, rm_quad_gt, rm_quad_ge -}; -static void (*action_dyadROI[5][6])() = { - rd_real_lt, rd_real_le, rd_real_eq, rd_real_ne, rd_real_gt, rd_real_ge, - rd_bit_lt, rd_bit_le, rd_bit_eq, rd_bit_ne, rd_bit_gt, rd_bit_ge, - rd_byte_lt, rd_byte_le, rd_byte_eq, rd_byte_ne, rd_byte_gt, rd_byte_ge, - rd_pair_lt, rd_pair_le, rd_pair_eq, rd_pair_ne, rd_pair_gt, rd_pair_ge, - rd_quad_lt, rd_quad_le, rd_quad_eq, rd_quad_ne, rd_quad_gt, rd_quad_ge -}; - -/*------------------------------------------------------------------------ ----------------- Triple Band Operations (with/without ROI) -------------- -------------------------------------------------------------------------*/ - -/* mono: (*(pvt->action)) (dvoid, src1, pvt, run, ix); */ -/* dyad: (*(pvt->action)) (dvoid, src1, src2, run, ix); */ - -#define tb_name1_body() \ - CARD32 M, D, px = LOGINDX(x); \ - LogInt S1, *src = ((LogInt *) src1) + px; \ - LogInt S2 = (pvt->iconst ? LOGONES : LOGZERO); \ - dst += px; \ - px = x & LOGMASK; \ - if ((px + dx) >= LOGSIZE) { \ - if (px) { \ - S1 = *src++; \ - D = *dst; \ - M = BitRight(LOGONES,px); \ - dx -= (LOGSIZE - px); \ - *dst++ = D & ~(M & (S1 ^ S2)); \ - } \ - for (px = dx >> LOGSHIFT; px > 0; px--) { \ - S1 = *src++; \ - D = *dst; \ - /* turn off (&~) unequal (^) bits */ \ - *dst++ = D & ~(S1 ^ S2); \ - } \ - if (dx &= LOGMASK) { \ - S1 = *src; \ - D = *dst; \ - M = ~BitRight(LOGONES,dx); \ - *dst = D & ~(M & (S1 ^ S2)); \ - } \ - } else { \ - S1 = *src; \ - D = *dst; \ - M = BitRight(LOGONES,px) & ~(BitRight(LOGONES,px+dx)); \ - *dst = D & ~(M & (S1 ^ S2)); \ - } -/* end of tb_name1_body */ - -#define tb_name2_body() \ - CARD32 M, D, px = LOGINDX(x); \ - LogInt S1, *src = ((LogInt *) src1) + px; \ - LogInt S2, *trc = ((LogInt *) src2) + px; \ - dst += px; \ - px = x & LOGMASK; \ - if ((px + dx) >= LOGSIZE) { \ - if (px) { \ - S1 = *src++; S2 = *trc++; \ - D = *dst; \ - M = BitRight(LOGONES,px); \ - dx -= (LOGSIZE - px); \ - *dst++ = D & ~(M & (S1 ^ S2)); \ - } \ - for (px = dx >> LOGSHIFT; px > 0; px--) { \ - S1 = *src++; S2 = *trc++; \ - D = *dst; \ - *dst++ = D & ~(S1 ^ S2); \ - } \ - if (dx &= LOGMASK) { \ - S1 = *src; S2 = *trc; \ - D = *dst; \ - M = ~BitRight(LOGONES,dx); \ - *dst = D & ~(M & (S1 ^ S2)); \ - } \ - } else { \ - S1 = *src; S2 = *trc; \ - D = *dst; \ - M = BitRight(LOGONES,px) & ~(BitRight(LOGONES,px+dx)); \ - *dst = D & ~(M & (S1 ^ S2)); \ - } -/* end of tb_name2_body */ - -#define TakeBit(name1, name2) \ -static void name1(dst,src1,pvt,dx,x) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - INT32 dx, x; \ -{ \ -tb_name1_body() \ -} \ -static void name2(dst,src1,src2,dx,x) \ - LogInt *dst; \ - pointer src1, src2; \ - INT32 dx, x; \ -{ \ -tb_name2_body() \ -} - -#define TakePix(name1, name2, itype, cnst_name) \ -static void name1(dst,src1,pvt,dx,x) \ - LogInt *dst; \ - pointer src1; \ - mpComparePvtPtr pvt; \ - INT32 dx, x; \ -{ \ - itype *src = ((itype *) src1) + x; \ - itype con = (itype) pvt->cnst_name; \ - LogInt M, value; \ - dst += LOGINDX(x); \ - if (x & LOGMASK) { \ - for (value = 0, M=LOGBIT(x); dx && M; dx--, LOGRIGHT(M)) \ - if (*src++ != con) \ - value |= M; \ - *dst++ &= ~value; \ - } \ - for ( ; dx >= LOGSIZE; dx -= LOGSIZE, dst++) { \ - /* if (!*dst) { src += LOGSIZE; } else */ \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ != con) \ - value |= M; \ - *dst &= ~value; \ - } \ - if (dx > 0) { \ - for (value = 0, M=LOGLEFT; dx; dx--, LOGRIGHT(M)) \ - if (*src++ != con) \ - value |= M; \ - *dst &= ~value; \ - } \ -} \ -static void name2(dst,src1,src2,dx,x) \ - LogInt *dst; \ - pointer src1, src2; \ - INT32 dx, x; \ -{ \ - itype *src = ((itype *) src1) + x; \ - itype *trc = ((itype *) src2) + x; \ - LogInt M, value; \ - dst += LOGINDX(x); \ - if (x & LOGMASK) { \ - for (value = 0, M=LOGBIT(x); dx && M; dx--, LOGRIGHT(M)) \ - if (*src++ != *trc++) \ - value |= M; \ - *dst++ &= ~value; \ - } \ - for ( ; dx >= LOGSIZE; dx -= LOGSIZE, dst++) { \ - /* if (!*dst) { src += LOGSIZE; trc += LOGSIZE; } else */ \ - for (value = 0, M=LOGLEFT; M ; LOGRIGHT(M)) \ - if (*src++ != *trc++) \ - value |= M; \ - *dst &= ~value; \ - } \ - if (dx > 0) { \ - for (value = 0, M=LOGLEFT; dx; dx--, LOGRIGHT(M)) \ - if (*src++ != *trc++) \ - value |= M; \ - *dst++ &= ~value; \ - } \ -} - -TakeBit (tm_bit, td_bit) -TakePix (tm_byte, td_byte, BytePixel, iconst) -TakePix (tm_pair, td_pair, PairPixel, iconst) -TakePix (tm_quad, td_quad, QuadPixel, iconst) -TakePix (tm_real, td_real, RealPixel, fconst) - -static void (*action_mtrip[5])() = - { tm_real, tm_bit, tm_byte, tm_pair, tm_quad }; - -static void (*action_dtrip[5])() = - { td_real, td_bit, td_byte, td_pair, td_quad }; - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ - -static int InitializeCompare(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - xieFloCompare *raw = (xieFloCompare *) ped->elemRaw; - pCompareDefPtr epvt = (pCompareDefPtr) ped->elemPvt; - mpComparePvtPtr pvt = (mpComparePvtPtr) pet->private; - receptorPtr rcp = pet->receptor; - CARD32 nbands = rcp[SRCt1].inFlo->bands; - bandPtr sband = &(rcp[SRCt1].band[0]); - bandPtr tband = &(rcp[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD8 msk = raw->bandMask; - BOOL hasROI = raw->domainPhototag != 0; - BOOL doingtriple = raw->combine && (nbands == 3); - CARD32 band; - - if (doingtriple) { - if (raw->src2) - ped->ddVec.activate = ActivateCompareTripleD; - else - ped->ddVec.activate = ActivateCompareTripleM; -#if defined(NON_ROI) - } else if (!hasROI) { - if (raw->src2) - ped->ddVec.activate = ActivateCompareD; - else - ped->ddVec.activate = ActivateCompareM; -#endif - } else { - if (raw->src2) - ped->ddVec.activate = ActivateCompareDROI; - else - ped->ddVec.activate = ActivateCompareMROI; - } - for (band=0; bandformat->class); - pvt->width = sband->format->width; - pvt->final = FALSE; - if (raw->src2 && (pvt->width > tband->format->width)) - pvt->width = tband->format->width; - if (doingtriple) { - if (raw->src2) - pvt->action = action_dtrip[iclass]; - else - pvt->action = action_mtrip[iclass]; -#if defined(NON_ROI) - } else if (!hasROI) { - if (raw->src2) { - pvt->action = action_dyad[iclass][raw->operator-1]; - pvt->action2 = (void (*)()) NULL; - pvt->endix = dband->format->width; /* pixels to do */ - if (dband->format->width > tband->format->width) { - pvt->action2 = action_clear; - pvt->endix = tband->format->width; /* pixels to do */ - pvt->endrun = dband->format->width - - tband->format->width; /* pixels to pad */ - } - } else - pvt->action = action_mono[iclass][raw->operator-1]; -#endif - } else { /* ROI */ - if (raw->src2) - pvt->action = action_dyadROI[iclass][raw->operator-1]; - else - pvt->action = action_monoROI[iclass][raw->operator-1]; - } - if (!raw->src2) { - double dub = epvt->constant[band]; - pvt->fconst = dub; - pvt->iconst = ConstrainConst(dub, sband->format->levels); - } - } - - /* If processing domain, allow replication */ - if (hasROI && !doingtriple) - rcp[ped->inCnt-1].band[0].replicate = msk; - - InitReceptor(flo, ped, &rcp[SRCt1], NO_DATAMAP, 1, msk, NO_BANDS); - - if (raw->src2) - InitReceptor(flo, ped, &rcp[SRCt2], NO_DATAMAP, 1, msk, NO_BANDS); - -#if defined(NON_ROI) - if (hasROI || doingtriple) -#endif - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY); - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE); - - pet->bandSync = doingtriple ? SYNC : NO_SYNC; - - return !ferrCode(flo); -} - - -/* end module mpcomp.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpconv.c diff -u xc/programs/Xserver/XIE/mixie/process/mpconv.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpconv.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpconv.c:3.5 Fri Dec 14 14:58:44 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpconv.c Sat Feb 28 21:42:00 2004 @@ -1,481 +0,0 @@ -/* $Xorg: mpconv.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpconv.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpconv.c -- DDXIE convolve element - - Dean Verheiden && Robert NC Shelley -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpconv.c,v 3.5 2001/12/14 19:58:44 dawes Exp $ */ - - -#define _XIEC_MPCONV -#define _XIEC_PCONV - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeConvolve(); - -/* - * routines used internal to this module - */ -static int CreateConvolveConstant(); -static int InitializeConvolveConstant(); -static int ActivateConvolveConstant(); -static int ResetConvolveConstant(); -static int DestroyConvolve(); - -/* - * DDXIE Convolve entry points - */ -static ddElemVecRec ConvolveConstantVec = { - CreateConvolveConstant, - InitializeConvolveConstant, - ActivateConvolveConstant, - (xieIntProc)NULL, - ResetConvolveConstant, - DestroyConvolve - }; - -typedef struct _mpconvconst { - pointer carray; /* stores constant convolution lines */ - ConvFloat *sums; /* stores constant * kernel vals */ - void (*action)(); /* band specific action function */ - ConvFloat minClip; /* constrained data min clip value */ - ConvFloat maxClip; /* constrained data max clip value */ -} mpConvConstRec, *mpConvConstPtr; - -static void RealConvolveConstant(); -static void QuadConvolveConstant(); -static void PairConvolveConstant(); -static void ByteConvolveConstant(); -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeConvolve(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* based on the technique, fill in the appropriate entry point vector - */ - switch(ped->techVec->number) { - case xieValConvolveConstant: - ped->ddVec = ConvolveConstantVec; - break; - - case xieValConvolveReplicate: - default: - return (FALSE); /* Not implemented in the SI */ - } - return(TRUE); -} /* end miAnalyzeConvolve */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateConvolveConstant(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* Allocate space for an array of pointers to constant convolution lines */ - return(MakePETex(flo, - ped, - sizeof(mpConvConstRec) * ped->inFloLst[SRCtag].bands, - SYNC, - NO_SYNC)); -} /* end CreateConvolve */ - - -#define GenConst(itype) \ - CARD32 iwidth = bnd->format->width; \ - itype *cline; \ - register itype cconst = (itype)*tconst; \ - register CARD32 i; \ - if (!(cline = (itype *)XieMalloc(sizeof(itype) * iwidth))) \ - AllocError(flo,ped,return(FALSE)); \ - cpvt->carray = (pointer)cline; \ - for (i = 0; i < iwidth; i++) *cline++ = cconst; \ - for (i = 0; i < ks2; i++) bnd->dataMap[i] = (CARD8 *)cpvt->carray; - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeConvolveConstant(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloConvolve *raw = (xieFloConvolve *)ped->elemRaw; - CARD8 msk = raw->bandMask; - INT32 ksize = raw->kernelSize; - ConvFloat *tconst = (ConvFloat *)ped->techPvt; - ConvFloat *kernel = (ConvFloat *)ped->elemPvt; - peTexPtr pet = ped->peTex; - mpConvConstPtr cpvt = (mpConvConstPtr)pet->private; - receptorPtr rcp = pet->receptor; - INT32 b, ks2 = ksize>>1; - bandPtr bnd; - - /* If processing domain, allow replication */ - if (raw->domainPhototag) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - if(!(InitReceptor(flo, ped, &rcp[SRCtag], ksize, ks2+1, msk, ~msk) && - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY) && - InitEmitter(flo,ped,SRCtag,NO_INPLACE))) - return(FALSE); - - /* Create constants for each band */ - for(b = 0; b < ped->inFloLst[SRCtag].bands; b++, cpvt++, tconst++) { - int i, j; - ConvFloat *sums; - - if ((msk & (1<sums = sums = - (ConvFloat *)XieMalloc(sizeof(ConvFloat) * ksize))) - AllocError(flo,ped,return(FALSE)); - - for (i = 0; i < ksize; i++) { - sums[i] = 0; - if (i == ks2) continue; /* Don't need a middle */ - for (j = 0; j < ksize; j++) - sums[i] += kernel[j * ksize + i] * *tconst; - } - /* Accumulate totals for multiple columns */ - for (i = ks2 - 2; i > -1; i--) - sums[i] += sums[i+1]; - for (i = ks2 + 2; i < ksize; i++) - sums[i] += sums[i-1]; - - bnd = &pet->receptor[SRCtag].band[b]; - switch (bnd->format->class) { - case UNCONSTRAINED: - { - GenConst(RealPixel); - cpvt->action = RealConvolveConstant; - cpvt->minClip = 0; /* Unsued for RealPixels */ - cpvt->maxClip = 0; /* Unused for RealPixels */ - } - break; - case QUAD_PIXEL: - { - GenConst(QuadPixel); - cpvt->action = QuadConvolveConstant; - cpvt->minClip = 0; - cpvt->maxClip = (ConvFloat)bnd->format->levels - 1; - } - break; - case PAIR_PIXEL: - { - GenConst(PairPixel); - cpvt->action = PairConvolveConstant; - cpvt->minClip = 0; - cpvt->maxClip = (ConvFloat)bnd->format->levels - 1; - } - break; - case BYTE_PIXEL: - { - GenConst(BytePixel); - cpvt->action = ByteConvolveConstant; - cpvt->minClip = 0; - cpvt->maxClip = (ConvFloat)bnd->format->levels - 1; - } - break; - case BIT_PIXEL: /* SILLY_BITONAL, not supported */ - default: - return(FALSE); - } - } - return(TRUE); -} /* end InitializeConvolveConstant */ - -#define ConvConstAction_Body(dtype) \ - /* Handle the left edge */ \ - endx = (k2 <= currX + run) ? k2 : currX + run; \ - for(i = currX; i < endx; i++, currX++, run--){ \ - ConvFloat count = 0.0; \ - for(j = 0 ; j < ks; j++) \ - for(k = -i; k <= k2; k++) \ - count += br[j][i+k] * kernel[j * ks + k + k2]; \ - if (*tconst) \ - count += cpvt->sums[i]; /* Sum of left side pad */ \ - ClipIt; \ - *dst++ = (dtype) count; \ - } \ - if (run <= 0) return; \ - /* Handle the middle */ \ - endx = (w <= currX + run) ? w : currX + run; \ - for(i = (k2 < currX) ? currX : k2; i < endx; i++,currX++,run--) { \ - ConvFloat count = 0.0; \ - for(j = 0 ; j < ks; j++) \ - for(k = -k2; k <= k2; k++) \ - count += br[j][i+k] * kernel[j * ks + k + k2]; \ - ClipIt; \ - *dst++ = (dtype) count; \ - } \ - if (run <= 0) return; \ - /* Handle the right edge */ \ - endx = (width <= currX + run) ? width : currX + run; \ - for(i = currX; i < endx; i++,currX++,run--) { \ - ConvFloat count = 0.0; \ - for(j = 0 ; j < ks; j++) \ - for(k = -k2; k < width - i; k++) \ - count += br[j][i+k] * kernel[j * ks + k + k2]; \ - if (*tconst) \ - count += cpvt->sums[ks - (width - i)]; \ - ClipIt; \ - *dst++ = (dtype) count; \ - } \ - -#define ConvConstAction(name,dtype) \ -static void name(cpvt,kernel,tconst,run,currX,br,dst,ks,width) \ -mpConvConstPtr cpvt; \ -ConvFloat *kernel, *tconst; \ -INT32 run, currX, ks; \ -dtype *dst, **br; \ -CARD32 width; \ -{ \ - ConvFloat minClip = cpvt->minClip; \ - ConvFloat maxClip = cpvt->maxClip; \ - INT32 k2 = ks/2; \ - INT32 w = width - k2; \ - INT32 endx; \ - int i,j,k; \ - /* Adjust destination to current location */ \ - dst += currX; \ - /* Outside of region, pass these pixels */ \ - if (run < 0) { \ - memcpy(dst, &br[k2][currX], -run * sizeof(dtype)); \ - return; \ - } \ - ConvConstAction_Body(dtype); \ -} - - -/* Macro for clipping of constrained data */ -#define ClipIt \ -if (count < minClip) \ - count = minClip; \ -else if (count > maxClip) \ - count = maxClip; - -ConvConstAction(ByteConvolveConstant,BytePixel) -ConvConstAction(PairConvolveConstant,PairPixel) -ConvConstAction(QuadConvolveConstant,QuadPixel) -#undef ClipIt -#define ClipIt -ConvConstAction(RealConvolveConstant,RealPixel) - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateConvolveConstant(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloConvolve *raw = (xieFloConvolve *)ped->elemRaw; - mpConvConstPtr cpvt = (mpConvConstPtr)pet->private; - bandPtr iband = &pet->receptor[SRCtag].band[0]; - bandPtr oband = &pet->emitter[0]; - ConvFloat *tconst = (ConvFloat *)ped->techPvt; - ConvFloat *kernel = (ConvFloat *)ped->elemPvt; - INT32 ks = raw->kernelSize; - INT32 k2 = ks/2; - CARD8 bmask = raw->bandMask; - int b; - - for(b = 0; b < ped->inFloLst[SRCtag].bands; b++, cpvt++, tconst++, iband++, - oband++) - if(bmask & 1<scheduled & 1<format->height - 1 - k2; - CARD32 width = oband->format->width; - CARD32 sline = iband->current; - CARD32 dline = oband->current; - CARD32 len = ks; - CARD32 map = 0; - pointer *br = (pointer *)iband->dataMap; - pointer dst; - Bool ok; - - while(!ferrCode(flo)) { - INT32 run, currX = 0; - - /* do special handling at top and bottom of image */ - if(dline <= k2) { - len = iband->threshold; - map = ks - len; - sline = 0; - if(dline < k2) - SetBandThreshold(iband, len + 1); - } - if(dline > end) { - len = iband->threshold - 1; - br[len] = (pointer)cpvt->carray; - SetBandThreshold(iband, len); - } - - ok = MapData(flo,pet,iband,map,sline++,len,TRUE); - dst = GetDst(flo,pet,oband,dline++,TRUE); - - if(!ok || !dst || !SyncDomain(flo,ped,oband,FLUSH)) break; - - while (run = GetRun(flo,pet,oband)) { - (*cpvt->action)(cpvt,kernel,tconst,run,currX,br,dst,ks,width); - currX += (run > 0) ? run : -run; - } - } - FreeData(flo, pet, iband, len ? iband->current : iband->maxGlobal); - } - return(TRUE); -} /* end ActivateConvolveConstant */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetConvolveConstant(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpConvConstPtr cpvt = (mpConvConstPtr)ped->peTex->private; - int b; - - for(b = 0; b < ped->inFloLst[SRCtag].bands; b++, cpvt++) { - if (cpvt->carray) cpvt->carray = (pointer) XieFree(cpvt->carray); - if (cpvt->sums) cpvt->sums = (ConvFloat *) XieFree(cpvt->sums); - cpvt->action = (void (*)())NULL; - cpvt->minClip = 0; - cpvt->maxClip = 0; - } - - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetConvolveConstant */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyConvolve(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyConvolve */ - -/* end module mpconv.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpctoi.c diff -u xc/programs/Xserver/XIE/mixie/process/mpctoi.c:3.6 xc/programs/Xserver/XIE/mixie/process/mpctoi.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpctoi.c:3.6 Fri Dec 14 14:58:44 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpctoi.c Sat Feb 28 21:42:00 2004 @@ -1,1065 +0,0 @@ -/* $Xorg: mpctoi.c,v 1.4 2001/02/09 02:04:30 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpctoi.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpctoi.c -- DDXIE ConvertToIndex element - - Robert NC Shelley -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpctoi.c,v 3.6 2001/12/14 19:58:44 dawes Exp $ */ - -#define _XIEC_MPCTOI -#define _XIEC_PCTOI - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - - -extern int AllocColor(); /* in . . . server/dix/colormap.c */ - - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeCvtToInd(); - -/* routines used internal to this module - */ -static int CreateCtoIAll(); -static int InitializeCtoIAll(); -static int DoGrayCtoIAll(); -static int DoRGB1CtoIAll(); -static int DoRGB3CtoIAll(); -static int DoRGB3CtoIAll(); -static int ResetCtoIAll(); -static int DestroyCtoI(); - -static int allocDirect(); -static int allocGray1(); -static int allocGray3(); -static int allocRGB1(); -static int allocRGB3(); -static pointer cvt(); - - -/* DDXIE ConvertToIndex entry points - */ -static ddElemVecRec mpCtoIAllVec = { - CreateCtoIAll, - InitializeCtoIAll, - (xieIntProc)NULL, - (xieIntProc)NULL, - ResetCtoIAll, - DestroyCtoI - }; - - -/* Local Declarations. - */ -#define HASH_POINT 14 /* use hash table if sum of depth exceeds this */ - -#define HR 19 /* prime hash multipliers (sum also prime) */ -#define HG 23 -#define HB 17 - -#define NADA (xieVoidProc)NULL - -typedef struct _ctihash { - CARD32 rgbVal; - Pixel pixdex; -} ctiHashRec, *ctiHashPtr; - - -typedef struct _mpctiall { - xieVoidProc action; /* scanline action routine */ - xieVoidProc action2; /* pass 2 scanline action routine */ - ColormapPtr cmap; /* colormap-id */ - int cmapFull; /* == Success until allocs fail */ - int clindex; /* index of client doing allocs */ - int (*alloc)(); /* color allocation routine */ - Pixel *pixLst; /* list of alloc'd pixels */ - CARD32 pixCnt; /* count of alloc'd pixels (total)*/ - CARD32 allocMatch; /* count of alloc'd/matched pixels*/ - CARD32 shareMatch; /* count of shared/matched pixels */ - CARD32 width; /* image width */ - CARD32 fill; /* value to use if alloc fails */ - BOOL hashing; /* true if using hash table */ - CARD8 trim[xieValMaxBands]; /* # LS bits to trim from pixels */ - CARD32 mask[xieValMaxBands]; /* mask for keeping useful bits */ - CARD32 shft[xieValMaxBands]; /* crazy-pixel shift counts */ - float coef[xieValMaxBands]; /* scale pixel up to 16 bits */ - CARD32 tmpLen[xieValMaxBands]; /* length of tmpLsts... */ - pointer tmpLst[xieValMaxBands]; /* lists where we remember stuff */ - Bool tmpSet; /* initialize tmpLsts to 0 or ~0 */ - pointer auxbuf[xieValMaxBands]; /* format-class conversion buffers*/ - CARD8 iclass[xieValMaxBands]; /* input format classes */ - CARD8 cclass; /* conversion format class */ -} ctiAllRec, *ctiAllPtr; - - -/***************************************************************************** - * - * Convert to Index alloc-All action routines: - * CtoIall_bmctio - * |||||`-- output format class (b=bit, B=byte, P=pair, Q=quad) - * ||||`--- input format class (b=bit, B=byte, P=pair, Q=quad) - * |||`---- L:lookup, H:hash, U:usage map - * ||`----- class colormap: d=dynamic, s=static - * |`------ 1 or 3 map colormap (blank if it supports both) - * `------- 1 or 3 band image - */ -static void CtoIall_1_dLBB(), CtoIall_1_dLBP(), CtoIall_1_dLBQ(); -static void CtoIall_1_dLPB(), CtoIall_1_dLPP(), CtoIall_1_dLPQ(); -static void CtoIall_31dLBB(), CtoIall_31dLBP(); -static void CtoIall_31dLPB(), CtoIall_31dLPP(); -static void CtoIall_31dHBB(), CtoIall_31dHBP(); -static void CtoIall_31dHPB(), CtoIall_31dHPP(); - -static void CtoIall_33dUB_(), CtoIall_33dUP_(); - -static void CtoIall_33dLBB(), CtoIall_33dLBP(), CtoIall_33dLBQ(); -static void CtoIall_33dLPB(), CtoIall_33dLPP(), CtoIall_33dLPQ(); - -/* input bits are promoted to bytes, so they share the same action routines - */ -#define CtoIall_1_dLbB CtoIall_1_dLBB -#define CtoIall_1_dLbP CtoIall_1_dLBP -#define CtoIall_1_dLbQ CtoIall_1_dLBQ -#define CtoIall_31dLbB CtoIall_31dLBB -#define CtoIall_31dLbP CtoIall_31dLBP -#define CtoIall_31dHbB CtoIall_31dHBB -#define CtoIall_31dHbP CtoIall_31dHBP -#define CtoIall_33dUb_ CtoIall_33dUB_ -#define CtoIall_33dLbB CtoIall_33dLBB -#define CtoIall_33dLbP CtoIall_33dLBP -#define CtoIall_33dLbQ CtoIall_33dLBQ - - -/* single band image, single or triple dynamic colormap, linear lookup tables - */ -static void (*gray_action[4][3])() = { - NADA, NADA, NADA, /* out=b, in=b..P */ - CtoIall_1_dLbB, CtoIall_1_dLBB, CtoIall_1_dLPB, /* out=B, in=b..P */ - CtoIall_1_dLbP, CtoIall_1_dLBP, CtoIall_1_dLPP, /* out=P, in=b..P */ - CtoIall_1_dLbQ, CtoIall_1_dLBQ, CtoIall_1_dLPQ, /* out=Q, in=b..P */ -}; - -/* triple band image, single dynamic colormap, linear or hash tables - */ -static void (*rgb1_action[2][4][3])() = { - NADA, NADA, NADA, /* lut, out=b, in=b..P */ - CtoIall_31dLbB, CtoIall_31dLBB, CtoIall_31dLPB, /* lut, out=B, in=b..P */ - CtoIall_31dLbP, CtoIall_31dLBP, CtoIall_31dLPP, /* lut, out=P, in=b..P */ - NADA, NADA, NADA, /* lut, out=Q, in=b..P */ - NADA, NADA, NADA, /* hash, out=b, in=b..P */ - CtoIall_31dHbB, CtoIall_31dHBB, CtoIall_31dHPB, /* hash, out=B, in=b..P */ - CtoIall_31dHbP, CtoIall_31dHBP, CtoIall_31dHPP, /* hash, out=P, in=b..P */ - NADA, NADA, NADA, /* hash, out=Q, in=b..P */ -}; - -/* triple band image, triple dynamic colormap, map usage (Boolean histogram) - */ -static void (*rgb3_action_usage[3])() = { - CtoIall_33dUb_, CtoIall_33dUB_, CtoIall_33dUP_, /* usage map out, in=b..P */ -}; - -/* triple band image, triple dynamic colormap, linear lookup tables - */ -static void (*rgb3_action_remap[4][3])() = { - NADA, NADA, NADA, /* out=b, in=b..P */ - CtoIall_33dLbB, CtoIall_33dLBB, CtoIall_33dLPB, /* out=B, in=b..P */ - CtoIall_33dLbP, CtoIall_33dLBP, CtoIall_33dLPP, /* out=P, in=b..P */ - CtoIall_33dLbQ, CtoIall_33dLBQ, CtoIall_33dLPQ, /* out=Q, in=b..P */ -}; - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeCvtToInd(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - - /* stash the appropriate entry point vector in the peDef - */ - switch(ped->techVec->number) { - case xieValColorAllocAll: ped->ddVec = mpCtoIAllVec; break; - case xieValColorAllocMatch: - case xieValColorAllocRequantize: - default: TechniqueError(flo, ped, xieValColorAlloc, - raw->colorAlloc, raw->lenParams, return(FALSE)); - } - return(TRUE); -} /* end miAnalyzeCvtToInd */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateCtoIAll(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - pCtoIDefPtr dix = (pCtoIDefPtr) ped->elemPvt; - Bool band_sync = !dix->graySrc || dix->class != DirectColor; - - return(MakePETex(flo, ped, sizeof(ctiAllRec), NO_SYNC, band_sync)); -} /* end CreateCtoIAll */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeCtoIAll(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - xieTecColorAllocAll *tec = (xieTecColorAllocAll *) &raw[1]; - pTecCtoIDefPtr pvt = (pTecCtoIDefPtr) ped->techPvt; - peTexPtr pet = ped->peTex; - formatPtr ift = &ped->inFloLst[SRCtag].format[0]; - formatPtr oft = &ped->outFlo.format[0]; - pCtoIDefPtr dix = (pCtoIDefPtr) ped->elemPvt; - ctiAllPtr ddx = (ctiAllPtr) pet->private; - CARD8 depth, bands = dix->graySrc ? 1 : 3; - CARD32 ic = BYTE_PIXEL, oc = oft->class; - CARD32 b, size; - - /* init generic color allocation params - */ - ddx->cmap = dix->cmap; - ddx->clindex = dix->list->client->index; - ddx->fill = pvt->fill; - ddx->width = oft->width; - ddx->cmapFull = 0; - ddx->pixCnt = 0; - ddx->allocMatch = 0; - ddx->shareMatch = 0; - if(!(ddx->pixLst = (Pixel*) XieCalloc((dix->cells + 1) * sizeof(Pixel)))) - AllocError(flo,ped, return(FALSE)); - - /* examine input data format-classes - */ - for(b = 0; b < bands; ++b) { - ddx->iclass[b] = ift[b].class; - ic = max(ddx->iclass[b],ic); - } - ddx->cclass = ic; - size = (ic == BYTE_PIXEL ? sz_BytePixel : sz_PairPixel) >> 3; - - /* init format-class and pixel to RGB cell conversion parameters - */ - for(b = 0; b < bands; ++b) { - if(ift[b].class != ic && - !(ddx->auxbuf[b] = (pointer) XieMalloc((ift->width+7)*size))) - AllocError(flo,ped, return(FALSE)); - - ddx->trim[b] = ift[b].depth > dix->stride ? ift[b].depth - dix->stride : 0; - ddx->mask[b] = (1 << ift[b].depth - ddx->trim[b]) - 1; - ddx->coef[b] = 65535.0 / ((ift[b].levels >> ddx->trim[b]) - 1); - } - /* init stuff specific to the image class and visual class - */ - if(dix->graySrc) { - /* - * grayscale image, visual class doesn't matter - */ - ddx->tmpSet = TRUE; - ddx->tmpLen[0] = (ddx->mask[0] + 1) * sizeof(Pixel); - ddx->action = gray_action[oc-1][ic-1]; - ddx->alloc = (pvt->defTech ? dix->class <= PseudoColor - ? allocGray1 : allocGray3 : AllocColor); - if(ddx->alloc == allocGray3) - ddx->pixLst[dix->cells] = ~0; - ped->ddVec.activate = DoGrayCtoIAll; - - } else if(dix->class <= PseudoColor) { - /* - * RGB image, visual class has a single channel colormap - */ - for(depth = 0, b = 0; b < xieValMaxBands; ++b) { - SetDepthFromLevels(ddx->mask[b]+1,size); - ddx->shft[b] = depth; - depth += size; - } - /* if we have too many levels, we'll have to use a hash table - */ - if(ddx->hashing = depth > HASH_POINT) { - ddx->tmpLen[0] = (HR+HG+HB) * (dix->cells + 1) * sizeof(ctiHashRec); - ddx->tmpSet = FALSE; - } else { - ddx->tmpLen[0] = (1<tmpSet = TRUE; - } - bands = 1; /* only 1 colormap band */ - ddx->action = rgb1_action[ddx->hashing ? 1 : 0][oc-1][ic-1]; - ddx->alloc = pvt->defTech ? allocRGB1 : AllocColor; - ped->ddVec.activate = DoRGB1CtoIAll; - - } else { - /* - * RGB image, visual class has a three channel colormap - */ - for(b = 0; b < bands; ++b) { - SetDepthFromLevels(ddx->mask[b]+1,depth); - ddx->tmpLen[b] = (1<tmpSet = FALSE; - ddx->action = rgb3_action_usage[ic-1]; - ddx->action2 = rgb3_action_remap[oc-1][ic-1]; - ddx->alloc = pvt->defTech ? allocRGB3 : AllocColor; - ped->ddVec.activate = DoRGB3CtoIAll; - } - if(!ddx->action) ImplementationError(flo,ped, return(FALSE)); - - /* alloc/init whatever temporary storage we need - */ - for(b = 0; b < bands; ++b) { - if(!(ddx->tmpLst[b] = (pointer ) XieMalloc(ddx->tmpLen[b]))) - AllocError(flo,ped, return(FALSE)); - memset((char*)ddx->tmpLst[b],(char)(ddx->tmpSet ? ~0 : 0),ddx->tmpLen[b]); - } - return(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE)); -} /* end InitializeCtoIAll */ - - -/*------------------------------------------------------------------------ -------------------------- crank some input data -------------------------- -------------------------------------------------------------------------*/ -static int DoGrayCtoIAll(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - ctiAllPtr ddx = (ctiAllPtr) pet->private; - bandPtr iband = &pet->receptor[SRCtag].band[0]; - bandPtr oband = &pet->emitter[0]; - pointer ivoid, ovoid; - - if(Resumed(flo,pet) && - (flo->runClient->clientGone || - ddx->cmap != (ColormapPtr) LookupIDByType(raw->colormap, RT_COLORMAP))) - ColormapError(flo,ped,raw->colormap, return(FALSE)); - - if((ivoid = GetCurrentSrc(flo,pet,iband)) && - (ovoid = GetCurrentDst(flo,pet,oband))) - do { - if(ddx->auxbuf[0]) ivoid = cvt(ivoid, ddx, (CARD8)0); - - (*ddx->action)(ddx, ovoid, ivoid); - - ivoid = GetNextSrc(flo,pet,iband,FLUSH); - ovoid = GetNextDst(flo,pet,oband,FLUSH); - } while(ivoid && ovoid); - - FreeData(flo,pet,iband,iband->current); - - return(TRUE); -} /* end DoGrayCtoIAll */ - - -/*------------------------------------------------------------------------ -------------------------- crank some input data -------------------------- -------------------------------------------------------------------------*/ -static int DoRGB1CtoIAll(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - ctiAllPtr ddx = (ctiAllPtr) pet->private; - bandPtr iband = &pet->receptor[SRCtag].band[0]; - bandPtr oband = &pet->emitter[0]; - pointer ovoid, ivoid0, ivoid1, ivoid2; - - if(Resumed(flo,pet) && - (flo->runClient->clientGone || - ddx->cmap != (ColormapPtr) LookupIDByType(raw->colormap, RT_COLORMAP))) - ColormapError(flo,ped,raw->colormap, return(FALSE)); - - ovoid = GetCurrentDst(flo,pet,oband); - ivoid0 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid1 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid2 = GetCurrentSrc(flo,pet,iband); iband -= 2; - - while(ovoid && ivoid0 && ivoid1 && ivoid2) { - - if(ddx->auxbuf[0]) ivoid0 = cvt(ivoid0, ddx, (CARD8)0); - if(ddx->auxbuf[1]) ivoid1 = cvt(ivoid1, ddx, (CARD8)1); - if(ddx->auxbuf[2]) ivoid2 = cvt(ivoid2, ddx, (CARD8)2); - - (*ddx->action)(ddx, ovoid, ivoid0, ivoid1, ivoid2); - - ovoid = GetNextDst(flo,pet,oband,FLUSH); - ivoid0 = GetNextSrc(flo,pet,iband,FLUSH); iband++; - ivoid1 = GetNextSrc(flo,pet,iband,FLUSH); iband++; - ivoid2 = GetNextSrc(flo,pet,iband,FLUSH); iband -= 2; - } - FreeData(flo,pet,iband,iband->current); iband++; - FreeData(flo,pet,iband,iband->current); iband++; - FreeData(flo,pet,iband,iband->current); - - return(TRUE); -} /* end DoRGB1CtoIAll */ - - -/*------------------------------------------------------------------------ -------------------------- crank some input data -------------------------- -------------------------------------------------------------------------*/ -static int DoRGB3CtoIAll(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - bandPtr iband = &pet->receptor[SRCtag].band[0]; - ctiAllPtr ddx = (ctiAllPtr) pet->private; - - if(ddx->action) { - BOOL final = TRUE; - pointer ivoid; - int b; - - /* PASS 1: generate per-band usage maps of the colors needed - */ - for(b = 0; b < xieValMaxBands; b++, iband++) { - for(ivoid = GetCurrentSrc(flo,pet,iband); ivoid; - ivoid = GetNextSrc(flo,pet,iband,KEEP)) { - - if(ddx->auxbuf[b]) ivoid = cvt(ivoid, ddx, (CARD8)b); - - (*ddx->action)(ddx, ivoid, b); - } - /* if we're done with the band, go back to the first scanline, otherwise - * increase the threshold to keep the scheduler out of our hair - */ - if(iband->final) - iband->current = 0; - else { - final = FALSE; - SetBandThreshold(iband, iband->current + 1); - } - } - /* now that we know what we need, it's time to allocate colors. - * we'll continue with PASS 2 when we return from the scheduler - */ - if(final) { - ddx->action = (xieVoidProc)NULL; - return(allocDirect(flo,ped,pet,ddx)); - } - } else { - bandPtr oband = &pet->emitter[0]; - pointer ovoid, ivoid0, ivoid1, ivoid2; - - /* PASS 2: map src pixesl to allocated colors - */ - ivoid0 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid1 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid2 = GetCurrentSrc(flo,pet,iband); iband -= 2; - ovoid = GetCurrentDst(flo,pet,oband); - - while(ovoid && ivoid0 && ivoid1 && ivoid2) { - - if(ddx->auxbuf[0]) ivoid0 = cvt(ivoid0, ddx, (CARD8)0); - if(ddx->auxbuf[1]) ivoid1 = cvt(ivoid1, ddx, (CARD8)1); - if(ddx->auxbuf[2]) ivoid2 = cvt(ivoid2, ddx, (CARD8)2); - - (*ddx->action2)(ddx, ovoid, ivoid0, ivoid1, ivoid2); - - ivoid0 = GetNextSrc(flo,pet,iband,FLUSH); iband++; - ivoid1 = GetNextSrc(flo,pet,iband,FLUSH); iband++; - ivoid2 = GetNextSrc(flo,pet,iband,FLUSH); iband -= 2; - ovoid = GetNextDst(flo,pet,oband,FLUSH); - } - FreeData(flo,pet,iband,iband->current); iband++; - FreeData(flo,pet,iband,iband->current); iband++; - FreeData(flo,pet,iband,iband->current); - } - return(TRUE); -} /* end DoRGB3CtoIAll */ - - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetCtoIAll(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - pCtoIDefPtr dix = (pCtoIDefPtr) ped->elemPvt; - ctiAllPtr ddx = (ctiAllPtr) ped->peTex->private; - colorListPtr lst = dix->list; - CARD32 b, i, j; - /* - * if we've got pixels, they might need to be transfered into the ColorList - */ - if((lst->cellPtr = ddx->pixLst) && (lst->cellCnt = ddx->pixCnt)) { - - if(dix->class <= PseudoColor) { - for(i = j = 0; i < ddx->pixCnt; ++j) - if(lst->cellPtr[j]) - lst->cellPtr[i++] = (Pixel)j; - - } else if(dix->graySrc && ddx->alloc == AllocColor) { - Pixel p, *ppix = (Pixel*) ddx->tmpLst[0]; - - for(i = 0; i < ddx->pixCnt; ++ppix) - if((INT32)(p = *ppix) >= 0) - lst->cellPtr[i++] = p; - - } /* else pixels are already in place */ - } - if(raw->notify && !ferrCode(flo) && !flo->flags.aborted && - (ddx->cmapFull || ddx->allocMatch || ddx->shareMatch)) - SendColorAllocEvent(flo, ped, lst->mapID, raw->colorAlloc, - ddx->pixCnt - ddx->allocMatch + (ddx->cmapFull - ? 0 : ddx->shareMatch + ddx->allocMatch << 16)); - - for(b = 0; b < xieValMaxBands; ++b) { - if(ddx->tmpLst[b]) ddx->tmpLst[b] = (pointer ) XieFree(ddx->tmpLst[b]); - if(ddx->auxbuf[b]) ddx->auxbuf[b] = (pointer ) XieFree(ddx->auxbuf[b]); - } - ddx->pixLst = NULL; - ddx->pixCnt = 0; - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetCtoIAll */ - - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyCtoI(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyCtoI */ - - -/*------------------------------------------------------------------------ -------------- allocate DirectColors based on usage map ------------------- -------------------------------------------------------------------------*/ -static int allocDirect(flo,ped,pet,ddx) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; - ctiAllPtr ddx; -{ - xieFloConvertToIndex *raw = (xieFloConvertToIndex *)ped->elemRaw; - pCtoIDefPtr dix = (pCtoIDefPtr) ped->elemPvt; - formatPtr fmt = &ped->inFloLst[SRCtag].format[0]; - unsigned short value[xieValMaxBands]; - int b, next[xieValMaxBands]; - Bool final, done[xieValMaxBands]; - Pixel *pix, *used[xieValMaxBands]; - - if(Resumed(flo,pet) && - (flo->runClient->clientGone || - ddx->cmap != (ColormapPtr)LookupIDByType(raw->colormap,RT_COLORMAP))) - ColormapError(flo,ped,raw->colormap, return(FALSE)); - - /* find the first color needed in each usage map - */ - for(b = 0; b < xieValMaxBands; ++b) { - done[b] = FALSE; - next[b] = 0; - used[b] = (Pixel*)ddx->tmpLst[b]; - while(!(used[b][next[b]])) ++next[b]; - } - do { - /* plant the current round of RGB values - */ - for(b = 0; b < xieValMaxBands; ++b) - if(!done[b]) - value[b] = next[b] * ddx->coef[b]; - - /* alloc a triplet of color cells - */ - pix = &ddx->pixLst[ddx->pixCnt]; - - if( ddx->cmapFull || - (ddx->cmapFull = (*ddx->alloc)(ddx->cmap,&value[0],&value[1],&value[2], - pix,ddx->clindex,ddx))) - *pix = ddx->fill; - else - ddx->cmapFull = ++ddx->pixCnt > dix->cells; - - /* save the result and find the next color needed in each usage map - */ - for(final = TRUE, b = 0; b < xieValMaxBands; ++b) - if(!done[b]) { - used[b][next[b]] = *pix & dix->mask[b]; - while(!(done[b] = ++next[b] >= fmt[b].levels >> ddx->trim[b]) && - !(used[b][next[b]])); - final &= done[b]; - } - } while(!final); - - return(TRUE); -} - -/*------------------------------------------------------------------------ -------------- allocate closest match for Default Technique --------------- -------------------------------------------------------------------------*/ -static int allocGray1(cmap, red, grn, blu, pix, client, ddx) - ColormapPtr cmap; - CARD16 *red, *grn, *blu; - Pixel *pix; - int client; - ctiAllPtr ddx; -{ - int status; - - if(status = AllocColor(cmap, red, grn, blu, pix, client)) { - xColorItem rgb; - - rgb.pixel = 0; - rgb.red = rgb.green = rgb.blue = *red; - FakeAllocColor(cmap, &rgb); - - if(!ddx->pixLst[(*pix = rgb.pixel)]++) { - xrgb match; - - QueryColors(cmap,1,&rgb.pixel,&match); - FakeFreeColor(cmap, rgb.pixel); - *red = match.red; - *grn = match.green; - *blu = match.blue; - if(status = AllocColor(cmap, red, grn, blu, pix, client)) - ddx->pixLst[rgb.pixel] = 0; - else - ddx->allocMatch++; - } else { - FakeFreeColor(cmap, rgb.pixel); - ++ddx->shareMatch; - --ddx->pixCnt; - status = 0; - } - } else { - ++ddx->pixLst[*pix]; - } - return(status); -} - -static int allocGray3(cmap, red, grn, blu, pix, client, ddx) - ColormapPtr cmap; - CARD16 *red, *grn, *blu; - Pixel *pix; - int client; - ctiAllPtr ddx; -{ - int status; - - if(ddx->pixLst[ddx->pixCnt]) return(BadAlloc); - - if(status = AllocColor(cmap, red, grn, blu, pix, client)) { - xColorItem rgb; - xrgb match; - - rgb.pixel = 0; - rgb.red = rgb.green = rgb.blue = *red; - FakeAllocColor(cmap, &rgb); - - QueryColors(cmap,1,&rgb.pixel,&match); - FakeFreeColor(cmap, rgb.pixel); - *pix = rgb.pixel; - *red = match.red; - *grn = match.green; - *blu = match.blue; - if(!(status = AllocColor(cmap, red, grn, blu, pix, client))) - ddx->allocMatch++; - } - ddx->pixLst[ddx->pixCnt] = *pix; - return(status); -} - -static int allocRGB1(cmap, red, grn, blu, pix, client, ddx) - ColormapPtr cmap; - CARD16 *red, *grn, *blu; - Pixel *pix; - int client; - ctiAllPtr ddx; -{ - int status; - - if(status = AllocColor(cmap, red, grn, blu, pix, client)) { - xColorItem rgb; - - rgb.pixel = 0; - rgb.red = *red; - rgb.green = *grn; - rgb.blue = *blu; - FakeAllocColor(cmap, &rgb); - - if(!ddx->pixLst[(*pix = rgb.pixel)]++) { - xrgb match; - - QueryColors(cmap,1,&rgb.pixel,&match); - FakeFreeColor(cmap, rgb.pixel); - *red = match.red; - *grn = match.green; - *blu = match.blue; - if(status = AllocColor(cmap, red, grn, blu, pix, client)) - ddx->pixLst[rgb.pixel] = 0; - else - ddx->allocMatch++; - } else { - if(!ddx->hashing || - *ddx->tmpLen > ddx->shareMatch * sizeof(ctiHashRec) << 1) { - ++ddx->shareMatch; - --ddx->pixCnt; - status = 0; - } - FakeFreeColor(cmap, rgb.pixel); - } - } else { - ++ddx->pixLst[*pix]; - } - return(status); -} - -static int allocRGB3(cmap, red, grn, blu, pix, client, ddx) - ColormapPtr cmap; - CARD16 *red, *grn, *blu; - Pixel *pix; - int client; - ctiAllPtr ddx; -{ - int status; - - if(status = AllocColor(cmap, red, grn, blu, pix, client)) { - xColorItem rgb; - xrgb match; - - rgb.pixel = 0; - rgb.red = *red; - rgb.green = *grn; - rgb.blue = *blu; - FakeAllocColor(cmap, &rgb); - - QueryColors(cmap,1,&rgb.pixel,&match); - FakeFreeColor(cmap, rgb.pixel); - *pix = rgb.pixel; - *red = match.red; - *grn = match.green; - *blu = match.blue; - if(!(status = AllocColor(cmap, red, grn, blu, pix, client))) - ddx->allocMatch++; - } - return(status); -} - -/*------------------------------------------------------------------------ -------------- convert bits to bytes or pairs, or bytes to pairs ---------- -------------------------------------------------------------------------*/ -static pointer cvt(src, ddx, band) - pointer src; - ctiAllPtr ddx; - CARD8 band; -{ - if(ddx->iclass[band] == BIT_PIXEL) { - if(ddx->cclass == BYTE_PIXEL) { - bitexpand(src,ddx->auxbuf[band],ddx->width,(BytePixel)0,(BytePixel)1); - - } else /* BIT_PIXEL --> PAIR_PIXEL */ { - LogInt *i = (LogInt *) src, ival, M; - PairPixel *o = (PairPixel *) ddx->auxbuf[band]; - int bw = ddx->width, nw = bw >> LOGSHIFT; - - while(nw--) - for(ival = *i++, M = LOGLEFT; M; LOGRIGHT(M)) - *o++ = (ival & M) ? (PairPixel) 1 : (PairPixel) 0; - if(bw &= LOGMASK) - for(ival = *i, M = LOGLEFT; bw--; LOGRIGHT(M)) - *o++ = (ival & M) ? (PairPixel) 1 : (PairPixel) 0; - } - } else /* BYTE_PIXEL --> PAIR_PIXEL */ { - CARD32 i, width = ddx->width; - BytePixel *ip = (BytePixel*)src; - PairPixel *op = (PairPixel*)ddx->auxbuf[band]; - - for(i = 0; i < width; *op++ = *ip++, ++i); - } - return(ddx->auxbuf[band]); -} - -/*------------------------------------------------------------------------ --- action routines: single band image, single or triple dynamic colormap - -------------------------------------------------------------------------*/ -#define DO_GRAY_CtoI_ALL(fn_do,itype,otype) \ -static void fn_do(ddx, DST, SRC) \ - ctiAllPtr ddx; pointer DST,SRC; \ -{ \ - itype *src = (itype *)SRC; \ - otype *dst = (otype *)DST; \ - Pixel px, *pp, *lst = (Pixel *)ddx->tmpLst[0]; \ - CARD32 w, val, mask = ddx->mask[0], trim = ddx->trim[0]; \ - CARD16 r, g, b; \ - for(w = ddx->width; w--; *dst++ = px) { \ - if((INT32)(px = *(pp = &lst[(val = *src++ >> trim & mask)])) < 0) { \ - if(!ddx->cmapFull) { \ - r = g = b = (unsigned short)((float)val * ddx->coef[0]); \ - if(!(ddx->cmapFull = (*ddx->alloc)(ddx->cmap,&r,&g,&b,pp, \ - ddx->clindex,ddx))) { \ - ++ddx->pixCnt; \ - px = *pp; \ - continue; \ - } \ - } \ - px = ddx->fill; \ - } \ - } \ -} -DO_GRAY_CtoI_ALL(CtoIall_1_dLBB, BytePixel, BytePixel) -DO_GRAY_CtoI_ALL(CtoIall_1_dLBP, BytePixel, PairPixel) -DO_GRAY_CtoI_ALL(CtoIall_1_dLBQ, BytePixel, QuadPixel) -DO_GRAY_CtoI_ALL(CtoIall_1_dLPB, PairPixel, BytePixel) -DO_GRAY_CtoI_ALL(CtoIall_1_dLPP, PairPixel, PairPixel) -DO_GRAY_CtoI_ALL(CtoIall_1_dLPQ, PairPixel, QuadPixel) - - -/*------------------------------------------------------------------------ ---- triple band, single dynamic colormap, sum of depths <= HASH_POINT ---- -------------------------------------------------------------------------*/ -#define DO_RGB31L_CtoI_ALL(fn_do,itype,otype) \ -static void fn_do(ddx, DST, SRCR, SRCG, SRCB) \ - ctiAllPtr ddx; pointer DST,SRCR,SRCG,SRCB; \ -{ \ - itype *srcR = (itype*)SRCR, *srcG = (itype*)SRCG, *srcB = (itype*)SRCB; \ - otype *dst = (otype*)DST; \ - CARD32 Rmask = ddx->mask[0], Rtrim = ddx->trim[0]; \ - CARD32 Gmask = ddx->mask[1], Gtrim = ddx->trim[1]; \ - CARD32 Bmask = ddx->mask[2], Btrim = ddx->trim[2]; \ - CARD32 Gshft = ddx->shft[1], Bshft = ddx->shft[2]; \ - Pixel px, *pp, *lst = (Pixel*)ddx->tmpLst[0]; \ - CARD32 rv, gv, bv, w; \ - CARD16 r, g, b; \ - for(w = ddx->width; w--; *dst++ = px) { \ - rv = *srcR++ >> Rtrim & Rmask; \ - gv = *srcG++ >> Gtrim & Gmask; \ - bv = *srcB++ >> Btrim & Bmask; \ - if((INT32)(px = *(pp = &lst[rv | gv<cmapFull) { \ - r = (unsigned short)((float)rv * ddx->coef[0]); \ - g = (unsigned short)((float)gv * ddx->coef[1]); \ - b = (unsigned short)((float)bv * ddx->coef[2]); \ - if(!(ddx->cmapFull = (*ddx->alloc)(ddx->cmap,&r,&g,&b,pp, \ - ddx->clindex,ddx))) { \ - ++ddx->pixCnt; \ - px = *pp; \ - continue; \ - } \ - } \ - px = ddx->fill; \ - } \ - } \ -} -DO_RGB31L_CtoI_ALL(CtoIall_31dLBB,BytePixel,BytePixel) -DO_RGB31L_CtoI_ALL(CtoIall_31dLBP,BytePixel,PairPixel) -DO_RGB31L_CtoI_ALL(CtoIall_31dLPB,PairPixel,BytePixel) -DO_RGB31L_CtoI_ALL(CtoIall_31dLPP,PairPixel,PairPixel) - - -/*------------------------------------------------------------------------ ---- triple band, single dynamic colormap, sum of depths > HASH_POINT ----- -------------------------------------------------------------------------*/ -#define DO_RGB31H_CtoI_ALL(fn_do,itype,otype) \ -static void fn_do(ddx, DST, SRCR, SRCG, SRCB) \ - ctiAllPtr ddx; pointer DST,SRCR,SRCG,SRCB; \ -{ \ - itype *srcR = (itype*)SRCR, *srcG = (itype*)SRCG, *srcB = (itype*)SRCB; \ - otype *dst = (otype*)DST; \ - CARD32 Rmask = ddx->mask[0], Rtrim = ddx->trim[0]; \ - CARD32 Gmask = ddx->mask[1], Gtrim = ddx->trim[1]; \ - CARD32 Bmask = ddx->mask[2], Btrim = ddx->trim[2]; \ - CARD32 width = ddx->width; \ - ctiHashPtr hash, list = (ctiHashPtr)ddx->tmpLst[0]; \ - CARD16 r, g, b; \ - union{ CARD32 rgbGlob; CARD8 rgbVals[4]; } rgb; \ - rgb.rgbVals[3] = 1; \ - while(width--) { \ - hash = &list[HR * (rgb.rgbVals[0] = *srcR++ >> Rtrim & Rmask) + \ - HG * (rgb.rgbVals[1] = *srcG++ >> Gtrim & Gmask) + \ - HB * (rgb.rgbVals[2] = *srcB++ >> Btrim & Bmask)]; \ - while(hash->rgbVal && hash->rgbVal != rgb.rgbGlob) ++hash; \ - if(hash->rgbVal) { *dst++ = hash->pixdex; continue; } \ - if(!ddx->cmapFull) { \ - r = (unsigned short)((float)rgb.rgbVals[0] * ddx->coef[0]); \ - g = (unsigned short)((float)rgb.rgbVals[1] * ddx->coef[1]); \ - b = (unsigned short)((float)rgb.rgbVals[2] * ddx->coef[2]); \ - if(!(ddx->cmapFull = (*ddx->alloc)(ddx->cmap,&r,&g,&b,&hash->pixdex, \ - ddx->clindex,ddx))) { \ - ++ddx->pixCnt; \ - *dst++ = hash->pixdex; \ - hash->rgbVal = rgb.rgbGlob; \ - continue; \ - } \ - } \ - *dst++ = ddx->fill; \ - } \ -} -DO_RGB31H_CtoI_ALL(CtoIall_31dHBB,BytePixel,BytePixel) -DO_RGB31H_CtoI_ALL(CtoIall_31dHBP,BytePixel,PairPixel) -DO_RGB31H_CtoI_ALL(CtoIall_31dHPB,PairPixel,BytePixel) -DO_RGB31H_CtoI_ALL(CtoIall_31dHPP,PairPixel,PairPixel) - - -/*------------------------------------------------------------------------ -------------- action routines for triple band, triple colormap ----------- -------------- U? routines generate usage maps of src pixels ----------- -------------- L? routines re-map src pixels thru lookup tables ----------- -------------------------------------------------------------------------*/ -#define DO_RGB33U_CtoI_ALL(fn_do,itype) \ -static void fn_do(ddx, SRC, band) \ - ctiAllPtr ddx; pointer SRC; CARD8 band; \ -{ \ - itype *src = (itype *)SRC; \ - CARD32 mask = ddx->mask[band]; \ - CARD32 trim = ddx->trim[band]; \ - Pixel *used = (Pixel*)ddx->tmpLst[band]; \ - CARD32 w = ddx->width; \ - while(w--) used[*src++ >> trim & mask] = TRUE; \ -} -DO_RGB33U_CtoI_ALL(CtoIall_33dUB_, BytePixel) -DO_RGB33U_CtoI_ALL(CtoIall_33dUP_, PairPixel) - - -#define DO_RGB33L_CtoI_ALL(fn_do,itype,otype) \ -static void fn_do(ddx, DST, SRCR, SRCG, SRCB) \ - ctiAllPtr ddx; pointer DST,SRCR,SRCG,SRCB; \ -{ \ - itype *srcR = (itype *)SRCR; \ - itype *srcG = (itype *)SRCG; \ - itype *srcB = (itype *)SRCB; \ - otype *dst = (otype *)DST; \ - CARD32 Rmask = ddx->mask[0], Rtrim = ddx->trim[0]; \ - CARD32 Gmask = ddx->mask[1], Gtrim = ddx->trim[1]; \ - CARD32 Bmask = ddx->mask[2], Btrim = ddx->trim[2]; \ - Pixel *Rlut = (Pixel*)ddx->tmpLst[0]; \ - Pixel *Glut = (Pixel*)ddx->tmpLst[1]; \ - Pixel *Blut = (Pixel*)ddx->tmpLst[2]; \ - CARD32 w = ddx->width; \ - while(w--) *dst++ = (Rlut[*srcR++ >> Rtrim & Rmask] | \ - Glut[*srcG++ >> Gtrim & Gmask] | \ - Blut[*srcB++ >> Btrim & Bmask]); \ -} -DO_RGB33L_CtoI_ALL(CtoIall_33dLBB, BytePixel, BytePixel) -DO_RGB33L_CtoI_ALL(CtoIall_33dLBP, BytePixel, PairPixel) -DO_RGB33L_CtoI_ALL(CtoIall_33dLBQ, BytePixel, QuadPixel) -DO_RGB33L_CtoI_ALL(CtoIall_33dLPB, PairPixel, BytePixel) -DO_RGB33L_CtoI_ALL(CtoIall_33dLPP, PairPixel, PairPixel) -DO_RGB33L_CtoI_ALL(CtoIall_33dLPQ, PairPixel, QuadPixel) - -/* end module mpctoi.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpdither.c diff -u xc/programs/Xserver/XIE/mixie/process/mpdither.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpdither.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpdither.c:3.5 Fri Dec 14 14:58:45 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpdither.c Sat Feb 28 21:42:00 2004 @@ -1,918 +0,0 @@ -/* $Xorg: mpdither.c,v 1.4 2001/02/09 02:04:31 xorgcvs Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpdither.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpdither.c -- DDXIE dither element - - Larry Hare -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpdither.c,v 3.5 2001/12/14 19:58:45 dawes Exp $ */ - - -#define _XIEC_MPDITHER -#define _XIEC_PDITHER - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeDither(); - -/* - * routines used internal to this module - */ -static int CreateDitherErrorDiffusion(), CreateDitherOrdered(); -static int InitializeDitherErrorDiffusion(), InitializeDitherOrdered(); -static int ActivateDitherErrorDiffusion(), ActivateDitherOrdered(); -static int ResetDitherErrorDiffusion(), ResetDitherOrdered(); -static int DestroyDither(); - - -typedef float DitherFloat; /* see xiemd.h */ - - /* Diffusion Dither Locals */ -typedef struct _mpditherEDdef { - void (*action) (); - DitherFloat *previous; - DitherFloat *current; - DitherFloat range; - DitherFloat range1over; - DitherFloat round; - INT32 width; -#if defined(SF_DITHER) - CARD32 shift; - INT32 irange; - INT32 iround; -#endif -} mpDitherEDDefRec, *mpDitherEDDefPtr; - -static void EdDitherQb(), EdDitherPb(), EdDitherBb(), EdDitherbb(); -static void EdDitherQB(), EdDitherPB(), EdDitherBB(); -static void EdDitherQP(), EdDitherPP(); -static void EdDitherQQ(); - - /* Ordered Dither Locals */ -typedef struct _mpditherOrddef { - void (*action) (); - CARD32 *matrix; - CARD32 ncol; - CARD32 nrow; - CARD32 shift; - CARD32 mult; - CARD32 width; -} mpDitherOrdDefRec, *mpDitherOrdDefPtr; - -static Bool SetupOrderMatrix(); - -static void OrdDitherQb(), OrdDitherPb(), OrdDitherBb(); -static void OrdDitherQB(), OrdDitherPB(), OrdDitherBB(); -static void OrdDitherQP(), OrdDitherPP(); -static void OrdDitherQQ(); - - - -/* - * DDXIE Dither entry points - */ -/* static Testing Hack. See mpcnst.c */ -ddElemVecRec DitherErrorDiffusion = { - CreateDitherErrorDiffusion, - InitializeDitherErrorDiffusion, - ActivateDitherErrorDiffusion, - (xieIntProc)NULL, - ResetDitherErrorDiffusion, - DestroyDither -}; - -static ddElemVecRec DitherOrdered = { - CreateDitherOrdered, - InitializeDitherOrdered, - ActivateDitherOrdered, - (xieIntProc)NULL, - ResetDitherOrdered, - DestroyDither -}; - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeDither(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - - switch(ped->techVec->number) { - case xieValDitherErrorDiffusion: - ped->ddVec = DitherErrorDiffusion; - break; - case xieValDitherOrdered: - ped->ddVec = DitherOrdered; - break; - } - - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateDitherErrorDiffusion(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpDitherEDDefRec); - - return MakePETex(flo,ped,auxsize,NO_SYNC,NO_SYNC); -} - -static int CreateDitherOrdered(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpDitherOrdDefRec); - - return MakePETex(flo,ped,auxsize,NO_SYNC,NO_SYNC); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeDitherErrorDiffusion(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - mpDitherEDDefPtr pvt = (mpDitherEDDefPtr) (pet->private); - bandMsk bmask = ((xieFloDither *) (ped->elemRaw))->bandMask; - bandPtr oband; - bandPtr iband; - int band, nbands; - void (*action) () = (void (*)()) 0; - - oband = &(pet->emitter[0]); - iband = &(pet->receptor[SRCtag].band[0]); - nbands = pet->receptor[SRCtag].inFlo->bands; - for (band = 0; band < nbands; band++, pvt++, iband++, oband++) { - - if ((bmask & (1<format->class) { - case QUAD_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = EdDitherQQ; break; - default: break; - } - break; - case PAIR_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = EdDitherQP; break; - case PAIR_PIXEL: action = EdDitherPP; break; - default: break; - } - break; - case BYTE_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = EdDitherQB; break; - case PAIR_PIXEL: action = EdDitherPB; break; - case BYTE_PIXEL: action = EdDitherBB; break; - default: break; - } - break; - case BIT_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = EdDitherQb; break; - case PAIR_PIXEL: action = EdDitherPb; break; - case BYTE_PIXEL: action = EdDitherBb; break; - case BIT_PIXEL: action = EdDitherbb; break; - default: break; - } - break; - default: - break; - } - if (!action) - ImplementationError(flo, ped, return(FALSE)); - - pvt->action = action; - pvt->width = iband->format->width; - pvt->range = (iband->format->levels-1.0)/(oband->format->levels-1.0); - pvt->round = pvt->range/((DitherFloat)2.0); - pvt->range1over = ((DitherFloat) 1.0) / pvt->range; - - if(pvt->range == 1.0) { - bmask &= ~(1<shift = (iband->format->class == PAIR_PIXEL ? 11 : 19); - pvt->irange = pvt->range * (1<shift); - pvt->iround = pvt->round * (1<shift); -#endif - - if (ped->techVec->number == xieValDitherErrorDiffusion) { - /* Use XieCalloc to force DitherFloat's to 0.0 */ - int auxsize = (pvt->width + 2) * sizeof(DitherFloat); - if((!(pvt->previous = (DitherFloat *) XieCalloc(auxsize))) || - (!(pvt->current = (DitherFloat *) XieCalloc(auxsize)))) - AllocError(flo, ped, return(FALSE)); - } - } - return - InitReceptor(flo,ped,&pet->receptor[SRCtag],NO_DATAMAP,1,bmask,~bmask) - && InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); - -} - -static int InitializeDitherOrdered(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - mpDitherOrdDefPtr pvt = (mpDitherOrdDefPtr) pet->private; - xieFloDither *elem = (xieFloDither *) (ped->elemRaw); - CARD8 thresh = ((xieTecDitherOrdered *) (&elem[1]))->thresholdOrder; - bandMsk bmask = elem->bandMask; - bandPtr oband; - bandPtr iband; - int band, nbands; - void (*action) () = (void(*)()) 0; - - oband = &(pet->emitter[0]); - iband = &(pet->receptor[SRCtag].band[0]); - nbands = pet->receptor[SRCtag].inFlo->bands; - for (band = 0; band < nbands; band++, pvt++, iband++, oband++) { - - if ((bmask & (1<format->class) { - case QUAD_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = OrdDitherQQ; break; - default: break; - } - break; - case PAIR_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = OrdDitherQP; break; - case PAIR_PIXEL: action = OrdDitherPP; break; - default: break; - } - break; - case BYTE_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = OrdDitherQB; break; - case PAIR_PIXEL: action = OrdDitherPB; break; - case BYTE_PIXEL: action = OrdDitherBB; break; - default: break; - } - break; - case BIT_PIXEL: - switch (iband->format->class) { - case QUAD_PIXEL: action = OrdDitherQb; break; - case PAIR_PIXEL: action = OrdDitherPb; break; - case BYTE_PIXEL: action = OrdDitherBb; break; - default: break; - } - break; - default: - break; - } - if (!action) - ImplementationError(flo, ped, return(FALSE)); - - pvt->action = action; - pvt->width = iband->format->width; - - switch (iband->format->class) { - case QUAD_PIXEL: pvt->shift=6; break; - case PAIR_PIXEL: pvt->shift=14; break; - case BYTE_PIXEL: pvt->shift=22; break; - } - pvt->mult = ((1<shift) * (oband->format->levels-1.0)) / - (iband->format->levels-1.0); - - if(pvt->mult == (1<shift)) { - bmask &= ~(1<matrix) - AllocError(flo, ped, return(FALSE)); - } - return - InitReceptor(flo,ped,&pet->receptor[SRCtag],NO_DATAMAP,1,bmask,~bmask) - && InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE); - -} - - -static CARD8 ddmtrx1[] = { 1, 0, 1, 0, - 0, 1, 0, 1, - 1, 0, 1, 0, - 0, 1, 0, 1 - }; - -static CARD8 ddmtrx2[] = { 1, 2, 1, 2, - 3, 0, 3, 0, - 1, 2, 1, 2, - 3, 0, 3, 0 - }; - -static CARD8 ddmtrx3[] = { 1, 6, 0, 7, - 5, 3, 4, 2, - 0, 7, 1, 6, - 4, 2, 5, 3 - }; - -static CARD8 ddmtrx4[] = { 1, 15, 2, 12, - 9, 5, 10, 6, - 3, 13, 0, 14, - 11, 7, 8, 4 - }; - -static CARD8 ddmtrx5[] = { 1, 28, 6, 26, 0, 29, 7, 27, - 17, 9, 22, 14, 16, 8, 23, 15, - 5, 25, 3, 30, 4, 24, 2, 31, - 21, 13, 19, 11, 20, 12, 18, 10, - }; - -static CARD8 ddmtrx6[] = { 1, 59, 15, 55, 2, 56, 12, 52, - 33, 17, 47, 31, 34, 18, 44, 28, - 9, 49, 5, 63, 10, 50, 6, 60, - 41, 25, 37, 21, 42, 26, 38, 22, - 3, 57, 13, 53, 0, 58, 14, 54, - 35, 19, 45, 29, 32, 16, 46, 30, - 11, 51, 7, 61, 8, 48, 4, 62, - 43, 27, 39, 23, 40, 24, 36, 20 - }; - -static CARD8 ddmtrx7[] = { - 1, 116, 28, 108, 6, 114, 26, 106, 0, 117, 29, 109, 7, 115, 27, 107, - 65, 33, 92, 60, 70, 38, 90, 58, 64, 32, 93, 61, 71, 39, 91, 59, - 17, 97, 9, 124, 22, 102, 14, 122, 16, 96, 8, 125, 23, 103, 15, 123, - 81, 49, 73, 41, 86, 54, 78, 46, 80, 48, 72, 40, 87, 55, 79, 47, - 5, 113, 25, 105, 3, 118, 30, 110, 4, 112, 24, 104, 2, 119, 31, 111, - 69, 37, 89, 57, 67, 35, 94, 62, 68, 36, 88, 56, 66, 34, 95, 63, - 21, 101, 13, 121, 19, 99, 11, 126, 20, 100, 12, 120, 18, 98, 10, 127, - 85, 53, 77, 45, 83, 51, 75, 43, 84, 52, 76, 44, 82, 50, 74, 42, -}; - -static CARD8 ddmtrx8[] = { - 1, 235, 49, 219, 15, 231, 55, 215, 2, 232, 56, 216, 12, 228, 52, 212, -129, 65, 187, 123, 143, 79, 183, 119, 130, 66, 184, 120, 140, 76, 180, 116, - 33, 193, 17, 251, 47, 207, 31, 247, 34, 194, 18, 248, 44, 204, 28, 244, -161, 97, 145, 81, 175, 111, 159, 95, 162, 98, 146, 82, 172, 108, 156, 92, - 9, 225, 49, 209, 5, 239, 63, 223, 10, 226, 50, 210, 6, 236, 60, 220, -137, 73, 177, 113, 133, 69, 191, 127, 138, 74, 178, 114, 134, 70, 188, 124, - 41, 201, 25, 241, 37, 197, 21, 255, 42, 202, 26, 242, 38, 198, 22, 252, -169, 105, 153, 89, 165, 101, 149, 85, 170, 106, 154, 90, 166, 102, 150, 86, - 3, 233, 57, 217, 13, 229, 53, 213, 0, 234, 58, 218, 14, 230, 54, 214, -131, 67, 185, 121, 141, 77, 181, 117, 128, 64, 186, 122, 142, 78, 182, 118, - 35, 195, 19, 249, 45, 205, 29, 245, 32, 192, 16, 250, 46, 206, 30, 246, -163, 99, 147, 83, 173, 109, 157, 93, 160, 96, 144, 80, 174, 110, 158, 94, - 11, 227, 51, 211, 7, 237, 61, 221, 8, 224, 48, 208, 4, 238, 62, 222, -139, 75, 179, 115, 135, 71, 189, 127, 136, 72, 176, 112, 132, 68, 190, 126, - 43, 203, 27, 243, 39, 199, 23, 253, 40, 200, 24, 240, 36, 196, 20, 254, -171, 107, 155, 91, 167, 103, 151, 87, 168, 104, 152, 88, 164, 100, 148, 84 -}; - - - -static Bool -SetupOrderMatrix(pvt, threshold) - mpDitherOrdDefPtr pvt; - CARD32 threshold; -{ - CARD32 shift = 1 << pvt->shift; - CARD32 *mtrx; - CARD8 *srcmtrx; - CARD32 nr, nc, nt; - INT32 m; - - switch(threshold) { - case 1: srcmtrx = ddmtrx1; nr = 4; nc = 4; nt = 2; break; - case 2: srcmtrx = ddmtrx2; nr = 4; nc = 4; nt = 4; break; - case 3: srcmtrx = ddmtrx3; nr = 4; nc = 4; nt = 8; break; - case 4: srcmtrx = ddmtrx4; nr = 4; nc = 4; nt = 16; break; - case 5: srcmtrx = ddmtrx5; nr = 4; nc = 8; nt = 32; break; - case 6: srcmtrx = ddmtrx6; nr = 8; nc = 8; nt = 64; break; - case 7: srcmtrx = ddmtrx7; nr = 8; nc =16; nt = 128; break; - default: - case 8: srcmtrx = ddmtrx8; nr =16; nc =16; nt = 256; break; - } - - if (!(mtrx = (CARD32 *)XieMalloc(nr * nc * sizeof(CARD32)))) - return FALSE; - - for (m = nr * nc -1; m >= 0 ; m--) - mtrx[m] = ((CARD32)srcmtrx[m] * shift + (shift>>1)) / nt; - - /* - ** This would be a good place to spin the matrix to avoid - ** aligning the dither pattern on triple band images. - */ - - pvt->ncol = nc; - pvt->nrow = nr; - pvt->matrix = mtrx; - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - - -static int ActivateDitherErrorDiffusion(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpDitherEDDefPtr pvt = (mpDitherEDDefPtr) pet->private; - bandPtr oband = &(pet->emitter[0]); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - register pointer inp, outp; - - if (!(inp = GetCurrentSrc(flo,pet,iband)) || - !(outp = GetCurrentDst(flo,pet,oband))) continue; - - do { - (*(pvt->action)) (inp, outp, pvt); - - { /* Swap error buffers */ - DitherFloat *curr = pvt->current; - curr = pvt->current; - pvt->current = pvt->previous; - pvt->previous = curr; - } - inp = GetNextSrc(flo,pet,iband,FLUSH); - outp = GetNextDst(flo,pet,oband,FLUSH); - - } while (inp && outp) ; - - FreeData(flo, pet, iband, iband->current); - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - -static int ActivateDitherOrdered(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpDitherOrdDefPtr pvt = (mpDitherOrdDefPtr) pet->private; - bandPtr oband = &(pet->emitter[0]); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - register pointer inp, outp; - - if (!(inp = GetCurrentSrc(flo,pet,iband)) || - !(outp = GetCurrentDst(flo,pet,oband))) continue; - - do { - (*(pvt->action)) (inp, outp, pvt, oband->current); - - inp = GetNextSrc(flo,pet,iband,FLUSH); - outp = GetNextDst(flo,pet,oband,FLUSH); - - } while (inp && outp) ; - - FreeData(flo, pet, iband, iband->current); - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetDitherErrorDiffusion(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpDitherEDDefPtr pvt = (mpDitherEDDefPtr) ped->peTex->private; - int band; - - /* free any dynamic private data */ - for (band = 0 ; band < xieValMaxBands ; band++, pvt++) { - pvt->width = 0; - pvt->action = 0; - if (pvt->previous) - pvt->previous = (DitherFloat *) XieFree(pvt->previous); - if (pvt->current) - pvt->current = (DitherFloat *) XieFree(pvt->current); - } - - ResetReceptors(ped); - ResetEmitter(ped); - return TRUE; -} - -static int ResetDitherOrdered(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpDitherOrdDefPtr pvt = (mpDitherOrdDefPtr) ped->peTex->private; - int band; - - /* free any dynamic private data */ - for (band = 0 ; band < xieValMaxBands ; band++, pvt++) { - pvt->width = 0; - pvt->action = 0; - if (pvt->matrix) - pvt->matrix = (CARD32 *) XieFree(pvt->matrix); - } - - ResetReceptors(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyDither(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ -------------------------------- Macro Mania ------------------------------ -------------------------------------------------------------------------*/ - -/* -** The only legal bit to bit dither is 2 levels to 1 level. -*/ - -static void EdDitherbb(inp,outp,pvt) - pointer inp; pointer outp; mpDitherEDDefPtr pvt; -{ - bzero((char *)outp, (pvt->width+7)>>3); -} - -/* -** Quads, Pairs, and Bytes can be dithered to bits. Since this code is -** so slow anyway, don't get too excited about optimizing the bit output. -*/ - -#define MakeEdBit(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt) \ - pointer INP; pointer OUTP; mpDitherEDDefPtr pvt; \ -{ \ - register itype *inp = (itype *) INP; \ - register LogInt *outp = (LogInt *) OUTP; \ - register unsigned int actual; \ - register DitherFloat range = pvt->range; \ - register DitherFloat round = pvt->round; \ - register DitherFloat *prev = pvt->previous; \ - register DitherFloat *curr = pvt->current; \ - register DitherFloat range1over = pvt->range1over; \ - register DitherFloat current = *curr, desire; \ - register int ix, bw = pvt->width; \ - bzero((char *)outp, (bw+7)>>3); \ - for (ix = 0; ix < bw; ix++) { \ - desire = inp[ix] + ((DitherFloat) .4375 * current) + \ - ((DitherFloat) .0625 * *(prev+0)) + \ - ((DitherFloat) .3125 * *(prev+1)) + \ - ((DitherFloat) .1875 * *(prev+2)) ; \ - prev++; \ - actual = (desire+round)*range1over; \ - if (actual) { \ - LOG_setbit(outp,ix); \ - *++curr = current = desire - actual*range; \ - } else \ - *++curr = current = desire; \ - } \ -} - -#if defined(SF_DITHER) -#define MakeEdBitI(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt) \ - pointer INP; pointer OUTP; mpDitherEDDefPtr pvt; \ -{ \ - register itype *inp = (itype *) INP; \ - register LogInt *outp = (LogInt *) OUTP; \ - register unsigned int actual; \ - register CARD32 shift = pvt->shift; \ - register INT32 range = pvt->irange; \ - register INT32 round = pvt->iround; \ - register INT32 *prev = (INT32 *) pvt->previous; \ - register INT32 *curr = (INT32 *) pvt->current; \ - register INT32 current = *curr, desire; \ - register int ix, bw = pvt->width; \ - bzero((char *)outp, (bw+7)>>3); \ - for (ix = 0; ix < bw; ix++) { \ - desire = (((CARD32) inp[ix]) << shift) + \ - ((( current * 7) + \ - (*(prev+0) ) + \ - (*(prev+1) * 5) + \ - (*(prev+2) * 3) ) >> 4) ; \ - prev++; \ - actual = (desire+round)/range; \ - if (actual) { \ - LOG_setbit(outp,ix); \ - *++curr = current = desire - actual*range; \ - } else \ - *++curr = current = desire; \ - } \ -} -#endif - -/* -** All the other multitudes of combinations. -*/ - -#define MakeEdPix(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt) \ - pointer INP; pointer OUTP; mpDitherEDDefPtr pvt; \ -{ \ - register itype *inp = (itype *) INP; \ - register otype *outp = (otype *) OUTP, actual; \ - register DitherFloat range = pvt->range; \ - register DitherFloat round = pvt->round; \ - register DitherFloat *prev = pvt->previous; \ - register DitherFloat *curr = pvt->current; \ - register DitherFloat current = *curr, desire; \ - register DitherFloat range1over = pvt->range1over; \ - register int ix, bw = pvt->width; \ - for (ix = 0; ix < bw; ix++) { \ - desire = inp[ix] + ((DitherFloat) .4375 * current) + \ - ((DitherFloat) .0625 * *(prev+0)) + \ - ((DitherFloat) .3125 * *(prev+1)) + \ - ((DitherFloat) .1875 * *(prev+2)) ; \ - prev++; \ - *outp++ = actual = (desire+round)*range1over; \ - *++curr = current = (desire - actual*range); \ - } \ -} - -#if defined(SF_DITHER) - /* NOTE: has <<, /, then * which means many cycles. - ** A better design would use a *, >>, *. The last * might - ** be a <<, and the first * on mips would pipeline with the - ** *(prev+N) calculations. This should double or triple the - ** speed for many of these architectures. - */ -#define MakeEdPixI(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt) \ - pointer INP; pointer OUTP; mpDitherEDDefPtr pvt; \ -{ \ - register itype *inp = (itype *) INP; \ - register otype *outp = (otype *) OUTP; \ - register CARD32 actual; \ - register CARD32 shift = pvt->shift; \ - /* ?? replace divide by range with multiply and >> ?? */ \ - register INT32 range = pvt->irange; \ - register INT32 round = pvt->iround; \ - register INT32 *prev = (INT32 *) pvt->previous; \ - register INT32 *curr = (INT32 *) pvt->current; \ - register INT32 current = *curr, desire; \ - register int ix, bw = pvt->width; \ - for (ix = 0; ix < bw; ix++) { \ - desire = (((CARD32)inp[ix]) << shift) + \ - (((current * 7) + \ - (*(prev+0) ) + \ - (*(prev+1) * 5) + \ - (*(prev+2) * 3) ) >> 4) ; \ - prev++; \ - *outp++ = actual = (desire+round)/range; \ - *++curr = current = desire - actual * range; \ - } \ -} -#endif - -#if defined(SF_DITHER) - -MakeEdBit (EdDitherQb,QuadPixel,BitPixel) -MakeEdBitI (EdDitherPb,PairPixel,BitPixel) -MakeEdBitI (EdDitherBb,BytePixel,BitPixel) -MakeEdPix (EdDitherQB,QuadPixel,BytePixel) -MakeEdPixI (EdDitherPB,PairPixel,BytePixel) -MakeEdPixI (EdDitherBB,BytePixel,BytePixel) -MakeEdPix (EdDitherQP,QuadPixel,PairPixel) -MakeEdPixI (EdDitherPP,PairPixel,PairPixel) -MakeEdPix (EdDitherQQ,QuadPixel,QuadPixel) - -#else -MakeEdBit (EdDitherQb,QuadPixel,BitPixel) -MakeEdBit (EdDitherPb,PairPixel,BitPixel) -MakeEdBit (EdDitherBb,BytePixel,BitPixel) - -MakeEdPix (EdDitherQB,QuadPixel,BytePixel) -MakeEdPix (EdDitherPB,PairPixel,BytePixel) -MakeEdPix (EdDitherBB,BytePixel,BytePixel) - -MakeEdPix (EdDitherQP,QuadPixel,PairPixel) -MakeEdPix (EdDitherPP,PairPixel,PairPixel) - -MakeEdPix (EdDitherQQ,QuadPixel,QuadPixel) - -#endif - -/*------------------------------------------------------------------------ -------------------------------- Macro Mania ------------------------------ -------------------------------------------------------------------------*/ - - -#define MakeOrdBit(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt,ycur) \ - pointer INP; pointer OUTP; mpDitherOrdDefPtr pvt; int ycur; \ -{ \ - register itype *inp = (itype *) INP; \ - register LogInt *outp = (LogInt *) OUTP; \ - register CARD32 mult = pvt->mult; \ - register CARD32 shift = pvt->shift; \ - register CARD32 ncol = pvt->ncol; \ - register CARD32 *mtrx; \ - register CARD32 jcol, nw; \ - register LogInt outval, M; \ - register int bw = pvt->width; \ - CARD32 nrow = pvt->nrow; \ - mtrx = pvt->matrix + ((ycur & (nrow-1)) * ncol); \ - jcol = ((ncol > nrow) && (ycur & nrow)) ? nrow : 0; \ - for (ncol--, nw = (bw >> LOGSHIFT); nw > 0; nw--) { \ - for (M=LOGLEFT, outval = 0; M ; LOGRIGHT(M)) { \ - register CARD32 value1, value2; \ - value1 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - value2 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - if (value1) outval |= M; \ - value1 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - LOGRIGHT(M); if (value2) outval |= M; \ - value2 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - LOGRIGHT(M); if (value1) outval |= M; \ - jcol &= ncol; \ - LOGRIGHT(M); if (value2) outval |= M; \ - } \ - *outp++ = outval; \ - } \ - if ((nw = (bw & LOGMASK))) { \ - for (M=LOGLEFT, outval = 0; nw ; nw--, LOGRIGHT(M)) { \ - if ((mtrx[jcol++] + *inp++ * mult) >> shift) \ - outval |= M; \ - jcol &= ncol; \ - } \ - *outp = outval; \ - } \ -} - -#define MakeOrdPix(fn_name,itype,otype) \ -static void fn_name(INP,OUTP,pvt,ycur) \ - pointer INP; pointer OUTP; mpDitherOrdDefPtr pvt; int ycur; \ -{ \ - register itype *inp = (itype *) INP; \ - register otype *outp = (otype *) OUTP; \ - register CARD32 mult = pvt->mult; \ - register CARD32 shift = pvt->shift; \ - register CARD32 ncol = pvt->ncol; \ - register CARD32 *mtrx; \ - register CARD32 jcol; \ - register int bw = pvt->width; \ - CARD32 nrow = pvt->nrow; \ - mtrx = pvt->matrix + ((ycur & (nrow-1)) * ncol); \ - jcol = ((ncol > nrow) && (ycur & nrow)) ? nrow : 0; \ - for (ncol--, bw-- ; bw > 0; bw -= 4) { \ - /* unroll four times is all we can do safely */ \ - register CARD32 value1, value2; \ - value1 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - value2 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - *outp++ = value1; \ - value1 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - *outp++ = value2; \ - value2 = (*inp++ * mult + mtrx[jcol++]) >> shift; \ - *outp++ = value1; \ - jcol &= ncol; \ - *outp++ = value2; \ - } \ - for ( ; bw >= 0; bw--) \ - *outp++ = (*inp++ * mult + mtrx[jcol++]) >> shift; \ -} - -MakeOrdBit (OrdDitherQb,QuadPixel,BitPixel) -MakeOrdBit (OrdDitherPb,PairPixel,BitPixel) -MakeOrdBit (OrdDitherBb,BytePixel,BitPixel) - -MakeOrdPix (OrdDitherQB,QuadPixel,BytePixel) -MakeOrdPix (OrdDitherPB,PairPixel,BytePixel) -MakeOrdPix (OrdDitherBB,BytePixel,BytePixel) - -MakeOrdPix (OrdDitherQP,QuadPixel,PairPixel) -MakeOrdPix (OrdDitherPP,PairPixel,PairPixel) - -MakeOrdPix (OrdDitherQQ,QuadPixel,QuadPixel) - -/* end module mpdither.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpgeom.c diff -u xc/programs/Xserver/XIE/mixie/process/mpgeom.c:1.5 xc/programs/Xserver/XIE/mixie/process/mpgeom.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpgeom.c:1.5 Fri Dec 14 14:58:45 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpgeom.c Sat Feb 28 21:42:01 2004 @@ -1,147 +0,0 @@ -/* $Xorg: mpgeom.c,v 1.4 2001/02/09 02:04:31 xorgcvs Exp $ */ -/**** module mpgeom.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpgeom.c -- DDXIE geometry element - - Ben Fahy -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpgeom.c,v 1.5 2001/12/14 19:58:45 dawes Exp $ */ - - -#define _XIEC_MPGEOM -#define _XIEC_PGEOM - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeGeometry(); - -/* - * routines which we reference from other DDXIE modules - */ -extern int miAnalyzeGeomAA(); -#if XIE_FULL -extern int miAnalyzeGeomBi(); -#endif -extern int miAnalyzeGeomNN(); - -static xieIntProc miAnalyzeGeomVecs[] = { - miAnalyzeGeomAA, -#if XIE_FULL - miAnalyzeGeomBi, -#endif - miAnalyzeGeomNN, - (xieIntProc) NULL -}; -#define n_vecs (sizeof(miAnalyzeGeomVecs)/sizeof(xieIntProc) - 1) - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeGeometry(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int i; - - for (i=0; i -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeGeomAA(); - -/* - * routines used internal to this module, technique dependent - */ - -/* antialias by lowpass using boxcar filter*/ -static int CreateGeomAA(); -static int InitializeGeomAA(); -static int ActivateGeomAA(); -static int ResetGeomAA(); -static int DestroyGeomAA(); - - -/* - * DDXIE Geometry entry points - */ -static ddElemVecRec AntiAliasVec = { - CreateGeomAA, - InitializeGeomAA, - ActivateGeomAA, - (xieIntProc)NULL, - ResetGeomAA, - DestroyGeomAA - }; - -static void AASL_R(), AASL_b(), AASL_B(), AASL_P(), AASL_Q(); /* AA scale */ -static void AAGL_R(), AAGL_b(), AAGL_B(), AAGL_P(), AAGL_Q(); /* AA general */ -static void XXFL_R(), XXFL_b(), XXFL_B(), XXFL_P(), XXFL_Q(); /* fill */ -static void (*aa_scl_lines[5])() = { AASL_R, AASL_b, AASL_B, AASL_P, AASL_Q }; -static void (*aa_gen_lines[5])() = { AAGL_R, AAGL_b, AAGL_B, AAGL_P, AAGL_Q }; -static void (*fill_lines[5])() = { XXFL_R, XXFL_b, XXFL_B, XXFL_P, XXFL_Q }; - -#if XIE_FULL -static void GAGL_R(), GAGL_B(), GAGL_P(), GAGL_Q(); /* GA general */ -static void (*ga_scl_lines[5])() = { GAGL_R, AASL_b, GAGL_B, GAGL_P, GAGL_Q }; -static void (*ga_gen_lines[5])() = { GAGL_R, AAGL_b, GAGL_B, GAGL_P, GAGL_Q }; -#endif - -typedef struct _bounding_rect { - double xmin,xmax,ymin,ymax; -} brect; - -#define FLG_A_NOT_ZERO 0x01 -#define FLG_B_NOT_ZERO 0x02 -#define FLG_C_NOT_ZERO 0x04 -#define FLG_D_NOT_ZERO 0x08 -#define FLG_BACKWARDS 0x10 -#define FLG_SKIP_BAND 0x20 - -typedef struct _mpaabanddef { - CARD32 flags; /* see FLG_xxx above */ - int yOut; /* what output line we are on */ - - int first_ilow, /* rounded first_mlow */ - first_ihigh; /* rounded first_mhigh */ - - double first_mlow, /* lowest input line mapped by first output */ - first_mhigh; /* highest input line mapped by first output */ - - brect left_br; /* bounding rectangle, left side */ - - int *ixmin; /* useful data precalculated for scaling */ - int *ixmax; - - int level_clip; /* in case we need to clip our pixel */ - int int_constant; /* precalculated for Constrained data fill */ - RealPixel flt_constant; /* precalculated for UnConstrained data fill */ - - int in_width; /* source image size */ - int in_height; - - int lo_src_avail; /* lines we think are available */ - int hi_src_avail; - - void (*linefunc) (); /* action routines based on pixel size */ - void (*fillfunc) (); - } -mpAABandRec, *mpAABandPtr; - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - switch(ped->techVec->number) { - case xieValGeomAntialias: - case xieValGeomGaussian: /* safe, but slow and sometimes ugly */ - ped->ddVec = AntiAliasVec; - break; - default: - return(FALSE); - } - return(TRUE); -} /* end miAnalyzeGeomAA */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = sizeof(mpAABandRec) * xieValMaxBands; - - return(MakePETex(flo, ped, auxsize, NO_SYNC, NO_SYNC)); - -} /* end CreateGeomAA */ -/*------------------------------------------------------------------------ ----------------------------- free private data . . . --------------------- -------------------------------------------------------------------------*/ -static int FreeBandData(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpAABandPtr pvtband = (mpAABandPtr) (ped->peTex->private); - int band, nbands = ped->inFloLst[SRCtag].bands; - - for (band = 0 ; band < nbands ; band++, pvtband++) { - if (pvtband->flags & FLG_SKIP_BAND) - continue; - if (pvtband->ixmin != NULL) - pvtband->ixmin = (int *) XieFree(pvtband->ixmin); - - } -} -/*------------------------------------------------------------------------ --------------------------------------------------------------------------- ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - xieFloGeometry *raw = (xieFloGeometry *)ped->elemRaw; - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; - mpAABandPtr pvtband = (mpAABandPtr) (pet->private); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - int nbands = ped->inFloLst[SRCtag].bands; -#if XIE_FULL - BOOL gaussian = (ped->techVec->number == xieValGeomGaussian); -#endif - int band; - /* - * access coordinates for y_in = c * x_out + d * y_out + ty - */ - double a = pedpvt->coeffs[0]; - double b = pedpvt->coeffs[1]; - double c = pedpvt->coeffs[2]; - double d = pedpvt->coeffs[3]; - double tx = pedpvt->coeffs[4]; - double ty = pedpvt->coeffs[5]; - int width = raw->width; - int threshold; - double xmin,xmax,ymin,ymax,tot_ymin,tot_ymax; - CARD32 dataclass; - CARD32 band_flags; - -/* - * Initialize parameters for tracking input lines, etc. - */ - band_flags = 0; - - if (a != 0.0) band_flags |= FLG_A_NOT_ZERO; - if (b != 0.0) band_flags |= FLG_B_NOT_ZERO; - if (c != 0.0) band_flags |= FLG_C_NOT_ZERO; - if (d != 0.0) band_flags |= FLG_D_NOT_ZERO; - if (d < 0.0) band_flags |= FLG_BACKWARDS; - - for (band = 0 ; band < nbands; band++, iband++, oband++, pvtband++) { - - if (pedpvt->do_band[band]) { - - pvtband->flags = band_flags; - pvtband->yOut = 0; /* what output line we are on */ - - dataclass =oband->format->class; - if (IsConstrained(dataclass)) - pvtband->int_constant = ConstrainConst(pedpvt->constant[band], - iband->format->levels); - else - pvtband->flt_constant = (RealPixel) pedpvt->constant[band]; - - pvtband->fillfunc = fill_lines[IndexClass(dataclass)]; -#if XIE_FULL - pvtband->linefunc = gaussian - ? ga_gen_lines[IndexClass(dataclass)] - : aa_gen_lines[IndexClass(dataclass)]; -#else - pvtband->linefunc = aa_gen_lines[IndexClass(dataclass)]; -#endif - - pvtband->level_clip = oband->format->levels; - pvtband->in_width = iband->format->width; - pvtband->in_height = iband->format->height; - - /* - * THE BASIC IDEA - - * - * We consider each output pixel as describing an *area* of width 1 - * and height 1. Pixel (xo,yo) thus refers to the locus of points: - * - * LocusOut(xo,yo) = { (x,y) | xo <= x < xo+1, yo <= y < yo + 1 } - * - * When we map this area back to the input image, each corner maps - * according to: - * - * x_in = a * x_out + b * y_out + tx, - * y_in = c * x_out + b * y_out + ty. - * - * Now let P(xo,yo) be described as the point at relative position - * (p,q) from (xo,yo) in LocusOut(xo,yo). In other words, - * - * P(xo,yo) = (xo+p, yo+q) - * - * Let M(p,q;xo,yo) be the mapping in input space of P(xo,yo). Then - * the x coordinate of M(p,q;xo+1,yo) is: - * - * XCoord[ M(p,q:xo+1,yo) ] = a * (x_o+1+p) + b*yo + tx - * = a * (x_o+p) + b*yo + tx + a*p - * so - * - * XCoord[ M(p,q:xo+1,yo) ] = XCoord[ M(p,q;xo,yo) ] + a*p - * - * similarly, - * - * YCoord[ M(p,q:xo,yo+1) ] = YCoord[ M(p,q;xo,yo) ] + c*q - * - * also, - * - * XCoord[ M(p+1,q:xo,yo) ] = XCoord[ M(p,q;xo,yo) ] + a*p - * YCoord[ M(p+1,q:xo,yo) ] = XCoord[ M(p,q;xo,yo) ] + c*p - * XCoord[ M(p,q+1:xo,yo) ] = YCoord[ M(p,q;xo,yo) ] + b*q - * YCoord[ M(p,q+1:xo,yo) ] = YCoord[ M(p,q;xo,yo) ] + d*q - * - * We will use these results to derive a computationally simple - * antialiasing algorithm. - * - * Suppose we are scaling an image down by a factor of four in - * the X direction: - * - * | | | |**| | | | | | | | | | | | | | | | - * | | | |**| | | | |**|**|**|**|**|**|**|**|**|**| | - * | | | |**| | | | | | | | | | | | | | | | - * - * | | | ******** | ******** | ***** - * - * If we nearest neighbor sample the input image where the - * output pixels map to input locations, the horizontal line - * at the right will show up in the output image, but the vertical - * line at left will be completely missed. - * - * The idea of this algorithm is to take the average of all pixels - * which are included in the *region* mapped by the output *area*, - * as opposed to looking at discrete pixels only. So we consider - * a pixel as representing an output locus - * - * LocusOut(xo,yo) = { (x,y) | xo <= x < xo+1, yo <= y < yo + 1 } - * - * and the input locus will have corner points: - * - * ( XCoord[ M(0,0:xo,yo) ],YCoord[ M(0,0:xo,yo) ] ) - * ( XCoord[ M(1,0:xo,yo) ],YCoord[ M(1,0:xo,yo) ] ) - * ( XCoord[ M(0,1:xo,yo) ],YCoord[ M(0,1:xo,yo) ] ) - * ( XCoord[ M(1,1:xo,yo) ],YCoord[ M(1,1:xo,yo) ] ) - * - * If xi(xo) = XCoord[ M(0,0;xo,yo) ] - * and yi(yo) = YCoord[ M(0,0;xo,yo) ], - * - * Then we can rewrite these using the relations above as: - * - * ( xi(xo), yi(yo) ), - * ( xi(xo)+a, yi(yo)+c ), - * ( xi(xo)+b, yi(yo)+d), - * ( xi(xo)+a+b, yi(yo)+c+d ). - * - * We have very little guarantee on what shape this collection - * of points will assume, without agreeing to look for special - * cases of (a,b,c,d). However, we do know that whatever the - * locus looks like, there is a "bounding rectangle": - * - * BRect: { (xmin,ymin; xmax,ymax) } - * - * such that xmin is the greatest lower bound of all x in the input locus, - * such that ymin is the greatest lower bound of all y in the input locus, - * such that xmax is the least upper bound of all x in the input locus, & - * such that ymax is the least upper bound of all y in the input locus. - * - * Furthermore, this bounding rectangle has the very nice property - * of "shift invariance," ie, - * - * If { (xmin,ymin; xmax,ymax) } is the bounding rectangle for (xo,yo), - * - * Then { (xmin+a*m+b*n,ymin+c*m+d*n; xmax+a*m+b*n,ymax+c*m+d*n) } - * is the bounding rect for (xo+m,yo+n). - * - * Proof. Let Yo be the ymax coordinate of the bounding rectangle for - * (xo,yo). Let ILo be the input locus of (xo,yo). Let Yo' be the ymax - * coordinate of (xo+m,yo+n), and ILo' be the input locus of (xo+m,yo+n). - * We claim Yo' = Yo + c*m+d*n. - * - * By definition, Yo >= y for all y in ILo, and Yo' >= y for all y in ILo'. - * Suppose Yo' < Yo + c*m+d*n. Then Yo~ = (Yo' - c*m - d*n) is less than - * Yo. If Yo~ >= y for all y in ILo, then this contradicts Yo being a - * least upper bound. Therefore there must be some offset (r,s) such - * that Yrs = YCoord[ M(r,s;xo,yo) ] is > Yo~. But by the translation - * rules above, YCoord[ M(r,s; xo+m,yo+n) ] = Yrs + c*m + d*n. Call - * this point Yrs'. Then: - * - * Yrs' = Yrs + c*m + d*n > Yo~ + c*m + d*n = Yo' - * - * which violates the assumption that Yo' is the least upper bound for - * ILo'. Thus, Yo' >= Yo + c*m + d*n. It is easy to show that Yo' - * greater than Yo + c*m + d*n also leads to a contradiction. Therefore - * we have Yo' identically equal to Yo + c*m + d*n, and the other - * coordinates (xmin,xmax,ymin) follow by similar reasoning. - * - * ---------------------------------------------------------------------- - * - * WHY THIS IS USEFUL: - * - * We compute the bounding rectangle for the first pixel on the first - * output line. Then it is easy to compute the bounding rectangle for - * all other points in the output image. In particular, we can compute - * ymin,ymax values for any line in the output image. We don't bother - * decoding any output line until all of the required input image lines - * are available. - * - * Once we have the data, we call a line function that does the real - * work. The line function simply marches through the bounding rect - * of each pixel in the output line, adds up the input image numbers, - * and divides by the number of discrete pixels in the bounding rect. - * The next bounding rect in the line is easily calculated by the - * shift-invariance relation. Clipping of the bounding rect is used - * to avoid integrating nonsense values. An output pixel is filled - * with the constant value only if the *entire* bounding rectangle - * is off-image. - * - */ - -/*** Calculate bounding rectangle of first pixel, ylimits of first line ***/ - - xmin = xmax = tx; - ymin = ymax = tot_ymin = tot_ymax = ty; - -#if XIE_FULL - if (gaussian) { - pTecGeomGaussianDefPtr tkpvt = (pTecGeomGaussianDefPtr)ped->techPvt; - - if (tkpvt->radius < 1) tkpvt->radius = 2; - - /* conservatively pick a bounding box for datamgr calculations */ - xmin -= ((double) tkpvt->radius + 1.00001); - xmax += ((double) tkpvt->radius + 1.99999); - ymin -= ((double) tkpvt->radius + 1.00001); - ymax += ((double) tkpvt->radius + 1.99999); - tot_ymin = ymin + (c < 0.0 ? (width * c) : 0.0); - tot_ymax = ymax + (c > 0.0 ? (width * c) : 0.0); - } else -#endif - { - if (a < 0) xmin += a; - else xmax += a; - if (b < 0) xmin += b; - else xmax += b; - - if (c < 0) { ymin += c; tot_ymin += (width * c); } - else { ymax += c; tot_ymax += (width * c); } - if (d < 0) { ymin += d; tot_ymin += d; } - else { ymax += d; tot_ymax += d; } - } - - pvtband->left_br.xmin = xmin; - pvtband->left_br.ymin = ymin; - pvtband->left_br.xmax = xmax; - pvtband->left_br.ymax = ymax; - - pvtband->first_mlow = tot_ymin; - pvtband->first_mhigh = tot_ymax; - - pvtband->first_ilow = pvtband->first_mlow; - pvtband->first_ihigh = pvtband->first_mhigh; - -/*** Check for some special cases ***/ - if ((band_flags & (FLG_C_NOT_ZERO | FLG_B_NOT_ZERO)) == 0) { - int i, maxpixl = pvtband->in_width - 1; - -#if XIE_FULL - pvtband->linefunc = gaussian - ? ga_scl_lines[IndexClass(dataclass)] - : aa_scl_lines[IndexClass(dataclass)]; -#else - pvtband->linefunc = aa_scl_lines[IndexClass(dataclass)]; -#endif - - if (!(pvtband->ixmin = (int *) XieMalloc(width * 2*sizeof(int)))) { - FreeBandData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - pvtband->ixmax = pvtband->ixmin + width; - /* Valid X coord domain will remain same for entire image */ - for ( i=0; i maxpixl) ixmax = maxpixl; - if (ixmax > ixmin) ixmax--; - - pvtband->ixmin[i] = ixmin; - pvtband->ixmax[i] = ixmax; - } - } - - /* set threshold so we get all needed src lines */ - /* if we need line 256, must ask for 257! */ - threshold = pvtband->first_ihigh + 1; - - /* make sure we get something */ - if (threshold < 1) - threshold = 1; - - /* but don't ask for stuff we can't ever get! */ - if (threshold > iband->format->height) - threshold = iband->format->height; - - if(!InitBand(flo, ped, iband, iband->format->height, - threshold, NO_INPLACE)) - return(FALSE); - } else { - pvtband->flags = FLG_SKIP_BAND; - BypassSrc(flo,pet,iband); - } - } - return(raw->bandMask ? InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE) : TRUE); -} /* end InitializeGeomAA */ -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - pGeomDefPtr pedpvt = (pGeomDefPtr) ped->elemPvt; - mpAABandPtr pvtband = (mpAABandPtr) pet->private; - bandPtr oband = &(pet->emitter[0]); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - int width = oband->format->width; /* consider use of pvtband */ - double d = pedpvt->coeffs[3]; - register pointer outp; - - for(band = 0; band < nbands; band++, iband++, oband++, pvtband++) { - - if (pvtband->flags & FLG_SKIP_BAND) - continue; - - if ((pet->scheduled & (1 << band)) == 0) - continue; - - if (pvtband->flags & FLG_BACKWARDS) { - - /* we're going backwards, which is actually *simpler*, - * because we don't get ANY data until we have ALL data. - * Thus, first time through, just map everything we have. - */ - if (!pvtband->yOut) { - if (!MapData(flo,pet,iband,0,0,iband->maxGlobal,KEEP)) - ImplementationError(flo,ped, return(FALSE)); - pvtband->lo_src_avail = 0; - pvtband->hi_src_avail = iband->maxGlobal-1; - } - - outp = GetCurrentDst(flo,pet,oband); - while (outp) { - - if ((pvtband->first_ihigh < 0) || - (pvtband->first_ilow > pvtband->in_height)) - - (*pvtband->fillfunc)(outp,width,pvtband); - else - (*pvtband->linefunc)(outp,iband->dataMap,width,ped,pvtband); - - /* now compute highest input line for next oline */ - pvtband->first_mlow += d; - pvtband->first_mhigh += d; - pvtband->first_ilow = (int) pvtband->first_mlow ; - pvtband->first_ihigh = (int) pvtband->first_mhigh; - pvtband->yOut++; - outp = GetNextDst(flo,pet,oband,TRUE); - } - if (oband->final) - DisableSrc(flo,pet,iband,FLUSH); - - } else { - - while (!ferrCode(flo)) { - int map_lo; /* lowest line mapped by output line */ - int map_hi; /* highest line mapped by output line */ - int last_src_line = pvtband->in_height - 1; - int threshold; - - /* access current output line */ - outp = GetDst(flo,pet,oband,pvtband->yOut,FLUSH); - if (!outp) { - if (oband->final) - DisableSrc(flo, pet, iband, FLUSH); - else if (iband->current != 0) - FreeData(flo, pet, iband, iband->current); - goto breakout; - } - - map_lo = pvtband->first_ilow; - if (map_lo < 0) - map_lo = 0; - - map_hi = pvtband->first_ihigh; - if (map_hi > last_src_line) - map_hi = last_src_line; - - if (map_hi < 0 || map_lo > last_src_line) - (*pvtband->fillfunc)(outp,width,pvtband); - else { - if(!MapData(flo,pet,iband,map_lo,map_lo,(map_hi-map_lo+1),KEEP)) - break; - pvtband->lo_src_avail = 0; - pvtband->hi_src_avail = iband->maxGlobal-1; - - if (map_lo != iband->current) - ImplementationError(flo,ped, return(FALSE)); - - /*** Compute output pixels for this line ***/ - (*pvtband->linefunc)(outp,iband->dataMap,width,ped,pvtband); - } - - /* increment to next line. */ - - pvtband->first_mlow += d; - pvtband->first_mhigh += d; - - /* have to be careful about -0.5 rounding to 0, not -1 */ - if (pvtband->first_ilow < 0) { - pvtband->first_ilow = (pvtband->first_mlow < 0) - ? -1 - : (int)pvtband->first_mlow; - pvtband->first_ihigh = (pvtband->first_mhigh < 0) - ? -1 - : (int)pvtband->first_mhigh; - } else { - /* if ilow was positive before, needn't check for negative */ - pvtband->first_ilow = (int)pvtband->first_mlow; - pvtband->first_ihigh = (int)pvtband->first_mhigh; - } - - ++pvtband->yOut; - if (pvtband->first_ilow > last_src_line) { - /* rest of output image is off the input image */ - /* we will exit after filling output strip */ - while(outp=GetDst(flo,pet,oband,pvtband->yOut,FLUSH)) { - (*pvtband->fillfunc)(outp,width,pvtband); - pvtband->yOut++; - } - if (oband->final) /* out of destination lines */ - DisableSrc(flo, pet, iband, FLUSH); - else - goto breakout; - /* Be nice and let downstream element eat our data */ - /* notice we don't free input data, because then the */ - /* silly scheduler would turn us off */ - } - - map_hi = pvtband->first_ihigh; - if (map_hi > last_src_line) - map_hi = last_src_line; - - threshold = map_hi - iband->current + 1; - - /* make sure we get something */ - if (threshold <= 1) - threshold = 1; - - /* but don't ask for stuff we can't ever get! */ - if (threshold > pvtband->in_height) - threshold = pvtband->in_height; - - SetBandThreshold(iband, threshold); - if (map_hi >= (int) iband->maxGlobal) { - /* we need to let someone else generate more data */ - break; - } - } - /* want to make sure we GetSrc at least once before Freeing */ - if (iband->current) - FreeData(flo, pet, iband, iband->current); - } /* end of backwards/forwards */ -breakout: ; - } /* end of band loop */ - return(TRUE); -} /* end ActivateGeometry */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - FreeBandData(flo,ped); - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetGeomAA */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyGeomAA(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyGeomAA */ - -/**********************************************************************/ -/* fill routines */ -static void XXFL_b (OUTP,width,pvtband) - register pointer OUTP; - register int width; - mpAABandPtr pvtband; -{ - register LogInt constant = (LogInt) pvtband->int_constant; - register LogInt *outp = (LogInt *) OUTP; - register int i; - - if (constant) constant = ~0; - /* - ** NOTE: Following code assume filling entire line. Which is - ** currently true. In the future we may need to abide by - ** bit boundaries. Conversely code for bytes and pairs below - ** could be sped up by doing something similar. perhaps we need - ** an action_constant(outp,run,ix,constant) routine similar to - ** action_set(). - */ - width = (width + 31) >> 5; - for (i=0; i < width; ++i) *outp++ = constant; -} - -#define DO_FL(funcname, iotype, CONST) \ -static void funcname (OUTP,width,pvtband) \ - register pointer OUTP; \ - register int width; \ - mpAABandPtr pvtband; \ -{ \ - register iotype constant = (iotype) pvtband->CONST; \ - register iotype *outp = (iotype *) OUTP; \ - \ - for ( ; width > 0; width--) *outp++ = constant; \ -} - -DO_FL (XXFL_R, RealPixel, flt_constant) -DO_FL (XXFL_B, BytePixel, int_constant) -DO_FL (XXFL_P, PairPixel, int_constant) -DO_FL (XXFL_Q, QuadPixel, int_constant) - -/**********************************************************************/ -/* (x,y) separable routines (eg, scale, mirror_x, mirror_y) */ -/**********************************************************************/ -/* - * NOTE - see caveat for GL_b for why the user shouldn't really be - * asking for antialias in the first place... - */ -static void AASL_b (OUTP,srcimg,width,ped,pvtband) - register pointer OUTP, *srcimg; - register int width; - peDefPtr ped; - mpAABandPtr pvtband; -{ - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; - double d = pedpvt->coeffs[3]; - - /* These variables describe the limits of the bounding rectangle */ - - /* since x and y separable, x limits are precalculated once */ - register int *ixminptr=pvtband->ixmin; - register int *ixmaxptr=pvtband->ixmax; - register int ixmin,ixmax; - - /* since x and y separable, y limits will be set once this line */ - register int iymin,iymax; - - /* some variables which describe available input data (for clipping) */ - register int minline = pvtband->lo_src_avail; - register int maxline = pvtband->hi_src_avail; - - - /* cast of constant, output and input pointers to correct type */ - register LogInt *outp = (LogInt *) OUTP; - register LogInt *ptrIn; - register LogInt constant; - register LogInt value,outval,M; - register int nfound; - - constant = pvtband->int_constant ? ~(LogInt) 0 : 0; - - /* round bounding rectangle limits to ints */ - iymin=pvtband->left_br.ymin; - iymax=pvtband->left_br.ymax; - - /* clip to available src data */ - if (iymin < minline) iymin = 0; - if (iymax > maxline) iymax = maxline; - if (iymax > iymin) iymax--; - - /* M is a number that encodes the "active" bit */ - M=LOGLEFT; - - /* val accumulates the output bits */ -#define kludge_based -#ifdef kludge_based - outval = 0; -#else - outval = constant; -#endif - - /* loop through all the output pixels on this line */ - while ( width-- > 0 ) { - register int ix,iy; - - /* make use of precalculated X limits */ - ixmin = *ixminptr++; - ixmax = *ixmaxptr++; - - nfound = 0; - value = 0; - for (iy=iymin; iy<=iymax; ++iy) { - ptrIn = (LogInt *) srcimg[iy]; - - for (ix=ixmin; ix<=ixmax; ++ix) { - ++nfound; -#ifdef kludge_based - if (LOG_tstbit(ptrIn,ix)) { - ++value; -#else - if (!LOG_tstbit(ptrIn,ix)) { - /* set this pixel black */ - outval &= ~M; - goto next; -#endif - } - } - } /* end of iy loop */ - -/* See GL_b() for an explanation of the kludge below */ - -#ifdef kludge_based -#define kludge 8/7 - /* note: 4/3 relies on C evaluating left to right */ - - if (!nfound) - outval |= (constant&M); /* set to background */ - else if (value*kludge >= nfound) - outval |= M; -#else - - if (!nfound) - outval &= (constant&M); /* set to background */ - else - outval |= M; /* set bit on */ -next: - -#endif - /* shift our active bit over one */ - LOGRIGHT(M); - - /* if we hit the end of a word, output what we have */ - if (!M) { - *outp++ = outval; /* record output data */ - M=LOGLEFT; /* reset active bit */ - outval = 0; /* reset accumulator */ - } - - } /* end of line loop */ - - /* if we didn't write all the pixels out, do so now */ - if (M != LOGLEFT) *outp = outval; - - /* before leaving, update bounding rect for next line */ - pvtband->left_br.ymin += d; - pvtband->left_br.ymax += d; -} - -/* NOTE: too bad paper is white is 255, otherwise you can often avoid the -** divide by "if (value) value /= nfound;" -*/ -#define aalinsep_func(funcname, iotype, valtype, CONST) \ - \ - /* round bounding rectangle limits to ints */ \ - iymin = pvtband->left_br.ymin; \ - iymax = pvtband->left_br.ymax; \ - \ - /* clip to available src data */ \ - if (iymin < minline) iymin = 0; \ - if (iymax > maxline) iymax = maxline; \ - if (iymax > iymin) iymax--; \ - \ - /* loop through all the output pixels on this line */ \ - for ( i=0; iixmin[i]; */ \ - /* ixmax = pvtband->ixmax[i]; */ \ - ixmin = *ixminptr++; \ - ixmax = *ixmaxptr++; \ - \ - for (iy=iymin; iy<=iymax; ++iy) { \ - ptrIn = ixmin + (iotype *) srcimg[iy]; \ - for (ix=ixmin; ix<=ixmax; ++ix) { \ - value += *ptrIn++; \ - ++nfound; \ - } \ - } /* end of iy loop */ \ - \ - if (nfound) \ - value /= nfound; \ - else \ - value = constant; \ - \ - *outp++ = value; \ - \ - } /* end of for loop */ \ - \ - /* before leaving, update bounding rect for next line */ \ - pvtband->left_br.ymin += d; \ - pvtband->left_br.ymax += d; \ - -#define DO_AASL(funcname, iotype, valtype, CONST) \ -static void \ -funcname (OUTP,srcimg,width,ped,pvtband) \ - register pointer OUTP; \ - register pointer *srcimg; \ - register int width; \ - peDefPtr ped; \ - mpAABandPtr pvtband; \ -{ \ - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; \ - \ - /* Mapping coefficients */ \ - double d = pedpvt->coeffs[3]; \ - \ - /* These variables describe the limits of the bounding rectangle */ \ - register int *ixminptr = pvtband->ixmin; \ - register int *ixmaxptr = pvtband->ixmax; \ - register int ixmin,iymin,ixmax,iymax; \ - \ - /* variables which describe available input data (for clipping) */ \ - register int minline = pvtband->lo_src_avail; \ - register int maxline = pvtband->hi_src_avail; \ - \ - /* cast of constant, output and input pointers to correct type */ \ - register iotype constant = (iotype) pvtband->CONST; \ - register iotype *outp = (iotype *) OUTP; \ - register iotype *ptrIn; \ - \ - register valtype value; \ - register int i,nfound; \ - \ - aalinsep_func(funcname, iotype, valtype, CONST) \ -} - -DO_AASL (AASL_R, RealPixel, RealPixel, flt_constant) -DO_AASL (AASL_B, BytePixel, QuadPixel, int_constant) -DO_AASL (AASL_P, PairPixel, QuadPixel, int_constant) -DO_AASL (AASL_Q, QuadPixel, QuadPixel, int_constant) - - -/**********************************************************************/ -/* general routines (should be able to handle any valid map) */ - -/* CAVEAT - antialias doesn't really make much sense for bit-bit, - * because you can't represent any intermediate values. This means - * you can choose between line dropouts (bad) or making your image - * overly bold (also bad). The algorithm here assumes that if you - * were worried about being too bold, you would use the default - * sampling technique (eg, nearest neighbor). So it attempts to - * eliminate line dropouts at the expense of decreasing fine - * image detail. - */ - -static void -AAGL_b (OUTP,srcimg,width,ped,pvtband) - register pointer OUTP, *srcimg; - register int width; - peDefPtr ped; - mpAABandPtr pvtband; -{ - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; - - /* Mapping coefficients */ - double a = pedpvt->coeffs[0]; - double b = pedpvt->coeffs[1]; - double c = pedpvt->coeffs[2]; - double d = pedpvt->coeffs[3]; - - /* These variables describe the limits of the bounding rectangle */ - double xmin = pvtband->left_br.xmin; - double ymin = pvtband->left_br.ymin; - double xmax = pvtband->left_br.xmax; - double ymax = pvtband->left_br.ymax; - register int ixmin,iymin,ixmax,iymax; - - /* loop variables for roaming through the bounding rectangle */ - register int ix,iy; - - /* some variables which describe available input data (for clipping) */ - register int maxpixl = pvtband->in_width - 1; - register int minline = pvtband->lo_src_avail; - register int maxline = pvtband->hi_src_avail; - CARD32 flags = pvtband->flags; - - /* cast of constant, output and input pointers to correct type */ - register LogInt *outp = (LogInt *) OUTP; - register LogInt *ptrIn; - register LogInt constant; - register LogInt value,outval,M; - register int nfound; - - constant = pvtband->int_constant ? ~(LogInt) 0 : 0; - - /* round bounding rectangle limits to ints */ - ixmin = xmin; - iymin = ymin; - ixmax = xmax; - iymax = ymax; - - /* clip to available src data */ - if (ixmin < 0) ixmin = 0; - if (iymin < minline) iymin = 0; - if (ixmax > maxpixl) ixmax = maxpixl; - if (iymax > maxline) iymax = maxline; - - /* M is a number that encodes the "active" bit */ - M=LOGLEFT; - - /* val accumulates the output bits */ -#define kludge_based_not -#ifdef kludge_based - outval = 0; -#else - outval = constant; -#endif - - /* loop through all the output pixels on this line */ - while ( width > 0 ) { - - xmin += a; - xmax += a; - nfound = 0; - value = 0; - for (iy=iymin; iy<=iymax; ++iy) { - ptrIn = (LogInt *) srcimg[iy]; - - for (ix=ixmin; ix<=ixmax; ++ix) { - ++nfound; -#ifdef kludge_based - if (LOG_tstbit(ptrIn,ix)) { - ++value; - } -#else - if (!LOG_tstbit(ptrIn,ix)) { - /* set this pixel black */ - outval &= ~M; - goto next; - } -#endif - } - } /* end of iy loop */ - -/* on the kludge below: antialias is weird when you are going from - 1 bit to 1 bit. A straight generalization of the n-bit algorithm - would have us find the average value in the bounding rect, and - then round to 0 or 1. This corresponds to kludge = 2. However, - it may be desirable to choose black if a much smaller number of - pixels in the bounding rect are off. For example, we may want to - have black output if less than 3 out of every four pixels in the - input bounding rect are on. (value <= 3/4 nfound) which would - correspond to value *4/3 < nfound. - - The problem with choosing anything other than 2 is that we are - treating black and white asymmetrically: the algorithm will - perform well for black lines on a white background, and poorly - for white pixels on a black background. Granted, one could use - Point or Constrain to flip, but.... ugh. - - Note that if the bounding rectangle is completely off the input - image, then we should set 'val' to the background value (constant). -*/ - -#ifdef kludge_based -#define kludge 8/7 - /* note: 4/3 relies on C evaluating left to right */ - - if (!nfound) - outval |= (constant&M); /* set to background */ - else if (value*kludge >= nfound) - outval |= M; -#else - - if (!nfound) - outval &= (constant&M); /* set to background */ - else - outval |= M; /* set bit on */ -next: - -#endif - /* shift our active bit over one */ - LOGRIGHT(M); - - /* if we hit the end of a word, output what we have */ - if (!M) { - *outp++ = outval; /* record output data */ - M=LOGLEFT; /* reset active bit */ - outval = 0; /* reset accumulator */ - } - - /* prepare geometry stuff for next loop */ - width--; - ixmin = xmin; - ixmax = xmax; - if (flags & FLG_C_NOT_ZERO) { - ymin += c; - ymax += c; - iymin = ymin; - iymax = ymax; - if (iymin < minline) iymin = minline; - if (iymax >= maxline) iymax = maxline; - if (iymax > iymin) iymax--; - } - if (ixmin < 0) ixmin = 0; - if (ixmax >= maxpixl) ixmax = maxpixl; - if (ixmax > ixmin) ixmax--; - } /* end of line loop */ - - /* if we didn't write all the pixels out, do so now */ - if (M != LOGLEFT) *outp = outval; - - /* before leaving, update bounding rect for next line */ - if (flags & FLG_B_NOT_ZERO) { - pvtband->left_br.xmin += b; - pvtband->left_br.xmax += b; - } - if (flags & FLG_D_NOT_ZERO) { - pvtband->left_br.ymin += d; - pvtband->left_br.ymax += d; - } -} - -/* NOTE: too bad paper is white is 255, otherwise you can often avoid the -** divide by "if (value) value /= nfound;" -*/ -#define inscrutable_compiler(funcname, iotype, valtype, CONST) \ - /* round bounding rectangle limits to ints */ \ - ixmin = xmin; \ - iymin = ymin; \ - ixmax = xmax; \ - iymax = ymax; \ - \ - /* clip to available src data */ \ - if (ixmin < 0) ixmin = 0; \ - if (iymin < minline) iymin = 0; \ - if (ixmax > maxpixl) ixmax = maxpixl; \ - if (iymax > maxline) iymax = maxline; \ - \ - /* loop through all the output pixels on this line */ \ - while ( width > 0 ) { \ - \ - xmin += a; \ - xmax += a; \ - nfound = 0; \ - value = 0; \ - for (iy=iymin; iy<=iymax; ++iy) { \ - ptrIn = (iotype *) srcimg[iy]; \ - for (ix=ixmin; ix<=ixmax; ++ix) { \ - value += ptrIn[ix]; \ - ++nfound; \ - } \ - } /* end of iy loop */ \ - \ - if (nfound) \ - value /= nfound; \ - else \ - value = constant; \ - \ - /* prepare for next loop */ \ - width--; \ - ixmin = xmin; \ - ixmax = xmax; \ - if (flags & FLG_C_NOT_ZERO) { \ - ymin += c; \ - ymax += c; \ - iymin = ymin; \ - iymax = ymax; \ - if (iymin < minline) iymin = minline; \ - if (iymax >= maxline) iymax = maxline; \ - if (iymax > iymin) iymax--; \ - } \ - if (ixmin < 0) ixmin = 0; \ - if (ixmax >= maxpixl) ixmax = maxpixl; \ - if (ixmax > ixmin) ixmax--; \ - *outp++ = value; \ - }/* end of line loop */ \ - \ - /* before leaving, update bounding rect for next line */ \ - if (flags & FLG_B_NOT_ZERO) { \ - pvtband->left_br.xmin += b; \ - pvtband->left_br.xmax += b; \ - } \ - if (flags & FLG_D_NOT_ZERO) { \ - pvtband->left_br.ymin += d; \ - pvtband->left_br.ymax += d; \ - } - -#define DO_AAGL(funcname, iotype, valtype, CONST) \ -static void \ -funcname (OUTP,srcimg,width,ped,pvtband) \ - register pointer OUTP; \ - register pointer *srcimg; \ - register int width; \ - peDefPtr ped; \ - mpAABandPtr pvtband; \ -{ \ - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; \ - \ - /* Mapping coefficients */ \ - double a = pedpvt->coeffs[0]; \ - double b = pedpvt->coeffs[1]; \ - double c = pedpvt->coeffs[2]; \ - double d = pedpvt->coeffs[3]; \ - CARD32 flags = pvtband->flags; \ - \ - /* These variables describe the limits of the bounding rectangle */ \ - double xmin = pvtband->left_br.xmin; \ - double ymin = pvtband->left_br.ymin; \ - double xmax = pvtband->left_br.xmax; \ - double ymax = pvtband->left_br.ymax; \ - register int ixmin,iymin,ixmax,iymax; \ - \ - /* loop variables for roaming through the bounding rectangle */ \ - register int ix,iy; \ - \ - /* variables which describe available input data (for clipping) */ \ - register int maxpixl = pvtband->in_width - 1; \ - register int minline = pvtband->lo_src_avail; \ - register int maxline = pvtband->hi_src_avail; \ - \ - /* cast of constant, output and input pointers to correct type */ \ - register iotype constant = (iotype) pvtband->CONST; \ - register iotype *outp = (iotype *) OUTP; \ - register iotype *ptrIn; \ - \ - register valtype value; \ - register int nfound; \ - \ - inscrutable_compiler(funcname, iotype, valtype, CONST) \ -} - -DO_AAGL (AAGL_R, RealPixel, RealPixel, flt_constant) -DO_AAGL (AAGL_B, BytePixel, QuadPixel, int_constant) -DO_AAGL (AAGL_P, PairPixel, QuadPixel, int_constant) -DO_AAGL (AAGL_Q, QuadPixel, QuadPixel, int_constant) - -#if XIE_FULL -/************************************************************************/ -/* Gaussian Routines */ -/************************************************************************/ -/* NOTES: -** this is so slow, we don't try to do a special scale routine. -** should use #include ? -** should consider using float (e.g. fexp()) but tends to be machine specific. -** should generate pow(2,K) as (1 << floor(k)) + table[fraction(K)]. -** (pow(2,K) is half the speed of exp() which defeats the purpose). -** issue of whether to pick points within a radius? or to use a constant -** ...size box of size 2 * radius ? - - (((uv2 = ((ix-xcen)*(ix-xcen)+(iy-ycen)*(iy-ycen))) <= rad2 ) \ - ? ((double)(P)) * (simple \ - ? pow(2.0, sigma * uv2) \ - : exp(sigma * uv2)) \ - : 0.0 ) -*/ - -#if !defined(exp) && !defined(pow) -extern double exp(), pow(); -#endif - - -#define gauss_loop(funcname, iotype, valtype, CONST) \ - \ - /* loop through all the output pixels on this line */ \ - while ( width-- > 0 ) { \ - \ - iymin = ycen - (radius-1); \ - iymax = iymin + (radius+radius-1); \ - if (iymin < minline) iymin = minline; \ - if (iymax >= maxline) iymax = maxline; \ - \ - ixmin = xcen - (radius - 1); \ - ixmax = ixmin + (radius + radius - 1); \ - if (ixmin < 0) ixmin = 0; \ - if (ixmax >= maxpixl) ixmax = maxpixl; \ - \ - nfound = 0; \ - value = 0.; \ - for (iy = iymin; iy <= iymax; ++iy) { \ - ptrIn = (iotype *) srcimg[iy]; \ - for (ix = ixmin; ix <= ixmax; ++ix) { \ - uv2 = ((ix-xcen)*(ix-xcen)+(iy-ycen)*(iy-ycen)); \ - value += ((double)(ptrIn[ix])) * (simple \ - ? pow(2.0, sigma * uv2) \ - : exp(sigma * uv2)); \ - ++nfound; \ - } \ - } /* end of iy loop */ \ - \ - if (nfound) { \ - value *= tkpvt->normalize; /* xxx clip */ \ - *outp++ = value < levels ? value : levels; \ - } else \ - *outp++ = constant; \ - \ - xcen += a; \ - ycen += c; \ - }/* end of line loop */ \ - \ - /* before leaving, update bounding rect for next line */ \ - if (flags & FLG_B_NOT_ZERO) { \ - pvtband->left_br.xmin += b; \ - pvtband->left_br.xmax += b; \ - } \ - if (flags & FLG_D_NOT_ZERO) { \ - pvtband->left_br.ymin += d; \ - pvtband->left_br.ymax += d; \ - } - -#define DO_GAGL(funcname, iotype, valtype, CONST) \ -static void \ -funcname (OUTP,srcimg,width,ped,pvtband) \ - register pointer OUTP; \ - register pointer *srcimg; \ - register int width; \ - peDefPtr ped; \ - mpAABandPtr pvtband; \ -{ \ - pGeomDefPtr pedpvt = (pGeomDefPtr)ped->elemPvt; \ - \ - /* Mapping coefficients */ \ - double a = pedpvt->coeffs[0]; \ - double b = pedpvt->coeffs[1]; \ - double c = pedpvt->coeffs[2]; \ - double d = pedpvt->coeffs[3]; \ - CARD32 flags = pvtband->flags; \ - \ - register double xcen = pvtband->yOut * b + pedpvt->coeffs[4]; \ - register double ycen = pvtband->yOut * d + pedpvt->coeffs[5]; \ - register int ixmin,iymin,ixmax,iymax; \ - \ - /* loop variables for roaming through the bounding rectangle */ \ - register int ix,iy; \ - \ - /* variables which describe available input data (for clipping) */ \ - register int maxpixl = pvtband->in_width - 1; \ - register int minline = pvtband->lo_src_avail; \ - register int maxline = pvtband->hi_src_avail; \ - \ - /* cast of constant, output and input pointers to correct type */ \ - register iotype constant = (iotype) pvtband->CONST; \ - register iotype *outp = (iotype *) OUTP; \ - register iotype *ptrIn; \ - \ - register double value, levels = pvtband->level_clip - 1; \ - register int nfound; \ - pTecGeomGaussianDefPtr tkpvt = (pTecGeomGaussianDefPtr)ped->techPvt;\ - int simple = tkpvt->simple; \ - int radius = tkpvt->radius; \ - double sigma = (simple ? -1.0 : -0.5) / \ - (tkpvt->sigma * tkpvt->sigma); \ - register double uv2; \ - \ - gauss_loop(funcname, iotype, valtype, CONST) \ -} - -DO_GAGL (GAGL_R, RealPixel, RealPixel, flt_constant) -DO_GAGL (GAGL_B, BytePixel, QuadPixel, int_constant) -DO_GAGL (GAGL_P, PairPixel, QuadPixel, int_constant) -DO_GAGL (GAGL_Q, QuadPixel, QuadPixel, int_constant) -#endif - -/**********************************************************************/ -/* end module mpgeomaa.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c diff -u xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c:3.4 xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c:3.4 Wed Jan 17 17:13:12 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c Sat Feb 28 21:42:01 2004 @@ -1,1121 +0,0 @@ -/* $Xorg: mpgeomnn.c,v 1.3 2000/08/17 19:47:53 cpqbld Exp $ */ -/* AGE Logic - Oct 15 1995 - Larry Hare */ -/**** module mpgeomnn.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -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 -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpgeomnn.c -- DDXIE geometry element for handling nearest - neighbor technique - - Ben Fahy && Larry Hare -- AGE Logic, Inc. June, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpgeomnn.c,v 3.4 2001/01/17 22:13:12 dawes Exp $ */ - - -#define _XIEC_MPGEOM -#define _XIEC_PGEOM - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -/* #include */ -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeGeomNN(); - -/* - * routines used internal to this module, technique dependent - */ - -static int CreateGeomNN(); -static int InitializeGeomNN(); -static int ActivateGeomNN(); -static int ResetGeomNN(); -static int DestroyGeomNN(); - -/* - * DDXIE Geometry entry points - */ -static ddElemVecRec NearestNeighborVec = { - CreateGeomNN, - InitializeGeomNN, - ActivateGeomNN, - (xieIntProc)NULL, - ResetGeomNN, - DestroyGeomNN - }; - -/* - * private - */ -#define PIX0 ((double)(0.0000)) - -typedef struct _mpgeombanddef { - - double first_mlow, /* lowest input line mapped by first output */ - first_mhigh; /* highest input line mapped by first output */ - int first_ilow, /* rounded first_mlow */ - first_ihigh; /* rounded first_mhigh */ - - double *s_locs; /* useful data precalculated for scaling */ - int *x_locs; /* useful data precalculated for scaling */ - int x_start; - int x_end; - int int_constant; /* precalculated for Constrained data fill */ - RealPixel flt_constant; /* precalculated for UnConstrained data fill */ - - int yOut; /* what output line we are on */ - int out_width; /* output image size */ - int out_height; /* ... not used */ - int in_width; /* input image size */ - int in_height; - - int lo_src_available; /* which input lines we've come across */ - int hi_src_available; - - void (*linefunc) (); - void (*fillfunc) (); -} mpGeometryBandRec, *mpGeometryBandPtr; - -typedef struct _mpgeometrydef { - int upside_down; - mpGeometryBandPtr bandInfo[xieValMaxBands]; -} mpGeometryDefRec, *mpGeometryDefPtr; - -static void FL_R(), FL_b(), FL_B(), FL_P(), FL_Q(); -static void (*fill_lines[5])() = {FL_R, FL_b, FL_B, FL_P, FL_Q,}; - -static void SL_R(), SL_b(), SL_B(), SL_P(), SL_Q(); -static void GL_R(), GL_b(), GL_B(), GL_P(), GL_Q(); -static void (*scale_lines[5])() = {SL_R, SL_b, SL_B, SL_P, SL_Q,}; -static void (*ggen_lines[5])() = {GL_R, GL_b, GL_B, GL_P, GL_Q,}; - -#if XIE_FULL -static void BiSL_R(), BiSL_b(), BiSL_B(), BiSL_P(), BiSL_Q(); -static void BiGL_R(), BiGL_b(), BiGL_B(), BiGL_P(), BiGL_Q(); -static void (*biscale_lines[5])() = {BiSL_R, BiSL_b, BiSL_B, BiSL_P, BiSL_Q,}; -static void (*bigen_lines[5])() = {BiGL_R, BiGL_b, BiGL_B, BiGL_P, BiGL_Q,}; -#endif - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -#if XIE_FULL -int miAnalyzeGeomBi(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - switch(ped->techVec->number) { - case xieValGeomBilinearInterp: - ped->ddVec = NearestNeighborVec; /* Yes */ - break; - default: - return(FALSE); - } - return(TRUE); -} /* end miAnalyzeGeomBi */ -#endif - -int miAnalyzeGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - switch(ped->techVec->number) { - case xieValGeomNearestNeighbor: - ped->ddVec = NearestNeighborVec; - break; - default: - return(FALSE); - } - return(TRUE); -} /* end miAnalyzeGeomNN */ - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* allocate space for private data */ - return(MakePETex(flo, ped, sizeof(mpGeometryDefRec), NO_SYNC, NO_SYNC)); -} /* end CreateGeomNN */ - -/*------------------------------------------------------------------------ ----------------------------- free private data . . . --------------------- -------------------------------------------------------------------------*/ -static int FreeBandData(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpGeometryDefPtr pvt = (mpGeometryDefPtr) (ped->peTex->private); - int band, nbands = ped->inFloLst[SRCtag].bands; - -/* - * Look for private data to free - */ - for (band = 0 ; band < nbands ; band++) { - mpGeometryBandPtr pvtband = pvt->bandInfo[band]; - if (pvtband) { - if (pvtband->x_locs) - XieFree(pvtband->x_locs); - if (pvtband->s_locs) - XieFree(pvtband->s_locs); - pvt->bandInfo[band] = (mpGeometryBandPtr) XieFree(pvtband); - } - } -} - -/*------------------------------------------------------------------------ --------------------------------------------------------------------------- ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - mpGeometryDefPtr pvt = (mpGeometryDefPtr) (pet->private); - xieFloGeometry *raw = (xieFloGeometry *) (ped->elemRaw); - pGeomDefPtr pedpvt = (pGeomDefPtr) (ped->elemPvt); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - int band, nbands = ped->inFloLst[SRCtag].bands; - mpGeometryBandPtr pvtband; -#if XIE_FULL - BOOL bilinear = (ped->techVec->number == - xieValGeomBilinearInterp); -#endif - /* - * x_in = a * x_out + b * y_out + tx - * y_in = c * x_out + d * y_out + ty - */ - double a = pedpvt->coeffs[0]; - double b = pedpvt->coeffs[1]; - double c = pedpvt->coeffs[2]; - double d = pedpvt->coeffs[3]; - double tx = pedpvt->coeffs[4]; - double ty = pedpvt->coeffs[5]; - int threshold; - -/* - * Initialize parameters for tracking input lines, etc. - */ - pvt->upside_down = (d < 0.0); - - for (band = 0 ; band < nbands ; band++, iband++, oband++) { - if (pedpvt->do_band[band]) { - CARD32 dataclass = pet->emitter[band].format->class; - - pvt->bandInfo[band] = pvtband = - (mpGeometryBandPtr) XieCalloc(sizeof(mpGeometryBandRec)); - if (!pvtband) { - FreeBandData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } - if (IsConstrained(dataclass)) - pvtband->int_constant = ConstrainConst(pedpvt->constant[band], - pet->emitter[band].format->levels); - else - pvtband->flt_constant = (RealPixel) pedpvt->constant[band]; - - pvtband->fillfunc = - fill_lines[IndexClass(dataclass)]; -#if XIE_FULL - pvtband->linefunc = bilinear - ? bigen_lines[IndexClass(dataclass)] - : ggen_lines[IndexClass(dataclass)]; -#else - pvtband->linefunc = ggen_lines[IndexClass(dataclass)]; -#endif - pvtband->out_width = oband->format->width; - pvtband->in_width = iband->format->width; - pvtband->in_height = iband->format->height; - - if (c == 0 && b == 0 ) { - int in_width = pvtband->in_width; - int width = pvtband->out_width; - int x, in_x_coord; - double in_x; - - /* For Scaling, can precalculate a lot */ - - if (a == 1 && d == 1) { - /* just Cropping, no real resampling to be done */ - } -#if XIE_FULL - pvtband->linefunc = bilinear - ? biscale_lines[IndexClass(dataclass)] - : scale_lines[IndexClass(dataclass)]; -#else - pvtband->linefunc = scale_lines[IndexClass(dataclass)]; -#endif - if (!(pvtband->x_locs = (int *) XieMalloc(width * sizeof(int)))) { - FreeBandData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } -#if XIE_FULL - if (bilinear && !(pvtband->s_locs = (double *) - XieMalloc(width * sizeof(double)))) { - FreeBandData(flo,ped); - AllocError(flo, ped, return(FALSE)); - } -#endif - /* coordinate of line is x_in = a * x_out + tx */ - /* however, we will map pixel centers to centers, */ - /* so we plug in output pixel location x_out+0.5 */ - /* for output_pixel x_out. Happily, finding the */ - /* nearest pixel centered on the computed input */ - /* location is then found simply by truncating */ - - /* initialize to nonsense values */ - pvtband->x_start = width; - pvtband->x_end = -1; - - in_x = a*PIX0 + tx; /* location of center */ - - for (x=0; x= 0 && in_x_coord < in_width) { - /* this pixel is useful */ - pvtband->x_end = x; - if (pvtband->x_start >= width) - pvtband->x_start = x; - pvtband->x_locs[x] = in_x_coord; -#if XIE_FULL - if (bilinear) - pvtband->s_locs[x] = in_x - in_x_coord; -#endif - } else - pvtband->x_locs[x] = -1; /* ignore this */ - in_x += a; /* next center location */ - } - } - - /* - * we need to compute the initial input line - * number ranges for the entire output image and the first output line. - * Just for fun, we will also compute the range for the last output line. - * How these limits are computed, of course, may depend on techniqu; - */ - - /* - * For nearest neighbor, we consider lines to have both width and height. - * Thus, if an image is of area w x h, we picture the image as being: - * - * x=0 w-1 w - * y=0 ________________________________ - * | | | | | ... | | | - * y=1 --------------------------------- - * - * - * y=h-1 ________________________________ - * | | | | | ... | | | - * y=h --------------------------------- - * - * The first pixel on the first output line is therefore (.5,.5) and - * the last pixel on the last output line is (w-.5,w-.5), etc. We - * compute the input line ranges by seeing where the four corners map, - * and selecting the coordinates of the pixel whose *center* maps most - * closely. - * - */ - - /* - * first line of output image - */ - { - double left_map,right_map; - left_map = c * PIX0 + d * PIX0 + ty; - right_map = c * ((pvtband->out_width-1) + PIX0) + d * PIX0 + ty; - pvtband->first_mlow = (left_map <= right_map)? left_map : right_map; - pvtband->first_mhigh = (left_map >= right_map)? left_map : right_map; - } - - /* - * coordinates with center closest are just truncated doubles - */ - pvtband->first_ilow = pvtband->first_mlow; - pvtband->first_ihigh = pvtband->first_mhigh; - - - /* set threshold so we get all needed src lines */ - /* ...if we need line 256, must ask for 257! */ - threshold = pvtband->first_ihigh + 1; -#if XIE_FULL - if (bilinear) threshold++; -#endif - /* make sure we get something */ - if (threshold < 1) - threshold = 1; - - /* but don't ask for stuff we can't ever get! */ - if (threshold > pvtband->in_height) - threshold = pvtband->in_height; - - if(!InitBand(flo,ped,iband,pvtband->in_height,threshold,NO_INPLACE)) - return(FALSE); - } else { - /* we're suppose to pass this band thru unscathed */ - BypassSrc(flo,pet,iband); - } - } - return(raw->bandMask ? InitEmitter(flo,ped,NO_DATAMAP,NO_INPLACE) : TRUE); -} /* end InitializeGeomNN */ -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - pGeomDefPtr pedpvt = (pGeomDefPtr) (ped->elemPvt); - mpGeometryDefPtr pvt = (mpGeometryDefPtr) (ped->peTex->private); - bandPtr oband = &(pet->emitter[0]); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - register pointer outp; -#if XIE_FULL - BOOL bilinear = (ped->techVec->number == xieValGeomBilinearInterp); -#endif - - for(band = 0; band < nbands; band++, iband++, oband++) { - - mpGeometryBandPtr pvtband = pvt->bandInfo[band]; - int width; - - if (!pvtband || ((pet->scheduled & (1 << band)) == 0) ) - continue; - - width = pvtband->out_width; - if (pvt->upside_down) { - - /* we're going backwards, which is actually *simpler*, - * because we don't get ANY data until we have ALL data. - * Thus, first time through, just map everything we have. - */ - if (!pvtband->yOut) { - if (!MapData(flo,pet,iband,0,0,iband->maxGlobal,KEEP)) { - ImplementationError(flo,ped, return(FALSE)); - } - pvtband->lo_src_available = 0; - pvtband->hi_src_available = iband->maxGlobal-1; - } - - outp = GetCurrentDst(flo,pet,oband); - while (outp) { - int lo_in,hi_in; - - /* get range of src lines for this output line */ - lo_in = pvtband->first_ilow; - hi_in = pvtband->first_ihigh; - - /* rest of output image is off input image */ - if ( (hi_in < 0) || (lo_in > pvtband->hi_src_available) ) - (*pvtband->fillfunc)(outp,width,pvtband); - else - /* Compute output pixels for this line */ -#if XIE_FULL - (*pvtband->linefunc)(outp,iband->dataMap,width, - bilinear ? lo_in : hi_in, pedpvt, pvtband); -#else - (*pvtband->linefunc)(outp,iband->dataMap,width, - hi_in, pedpvt, pvtband); -#endif - pvtband->first_mlow += pedpvt->coeffs[3]; - pvtband->first_mhigh += pedpvt->coeffs[3]; - pvtband->first_ilow = (int) pvtband->first_mlow ; - pvtband->first_ihigh = (int) pvtband->first_mhigh; - pvtband->yOut++; - outp = GetNextDst(flo,pet,oband,TRUE); - } - if (oband->final) - DisableSrc(flo,pet,iband,FLUSH); - - } else { - /* - ** nice normal image progression. This means that I know when - ** I am done with an input line for the current output line, I - ** can purge it, because it won't be needed for subsequent - ** output lines. - */ - - while (!ferrCode(flo)) { - int map_lo; /* lowest line mapped by output line */ - int map_hi; /* highest line mapped by output line */ - int last_src_line = pvtband->in_height - 1; - int threshold; - - /* access current output line */ - if (!(outp = GetDst(flo,pet,oband,pvtband->yOut,FLUSH))) { - if (oband->final) - DisableSrc(flo, pet, iband, FLUSH); - else if (iband->current != 0) - FreeData(flo, pet, iband, iband->current); - goto breakout; - } - - map_lo = pvtband->first_ilow; - if (map_lo < 0) - map_lo = 0; - - map_hi = pvtband->first_ihigh; -#if XIE_FULL - if (bilinear) map_hi++; -#endif - if (map_hi > last_src_line) - map_hi = last_src_line; - - if (map_hi < 0 || map_lo > last_src_line) - (*pvtband->fillfunc)(outp,width,pvtband); - else { - - threshold = map_hi - map_lo + 1; - if(!MapData(flo,pet,iband,map_lo,map_lo,threshold,KEEP)) - break; - - if (map_lo != iband->current) - ImplementationError(flo,ped, return(FALSE)); - - pvtband->lo_src_available = 0; - pvtband->hi_src_available = iband->maxGlobal-1; - - (*pvtband->linefunc)(outp,iband->dataMap, - width,map_lo,pedpvt,pvtband); - - } - - pvtband->first_mlow += pedpvt->coeffs[3]; - pvtband->first_mhigh += pedpvt->coeffs[3]; - - /* have to be careful about -0.5 rounding to 0, not -1 */ - if (pvtband->first_ilow < 0) { - - pvtband->first_ilow = (pvtband->first_mlow < 0) - ? -1 - : (int)pvtband->first_mlow; - - pvtband->first_ihigh = (pvtband->first_mhigh < 0) - ? -1 - : (int)pvtband->first_mhigh; - } else { - /* if ilow was positive before, needn't check for negative */ - pvtband->first_ilow = (int)pvtband->first_mlow; - pvtband->first_ihigh = (int)pvtband->first_mhigh; - } - - ++pvtband->yOut; - - if (pvtband->first_ilow > last_src_line) { - /* rest of output image is off the input image */ - /* we will exit after filling output strip */ - while(outp=GetDst(flo,pet,oband,pvtband->yOut,FLUSH)) { - (*pvtband->fillfunc)(outp,width,pvtband); - pvtband->yOut++; - } - if (oband->final) - DisableSrc(flo, pet, iband, FLUSH); - else - goto breakout; - } - - map_hi = pvtband->first_ihigh; -#if XIE_FULL - if (bilinear) map_hi++; -#endif - if (map_hi > last_src_line) - map_hi = last_src_line; - - threshold = map_hi - iband->current + 1; - - /* make sure we get something */ - if (threshold <= 1) - threshold = 1; - - /* but don't ask for stuff we can't ever get! */ - if (threshold > pvtband->in_height) - threshold = pvtband->in_height; - - SetBandThreshold(iband, threshold); - if (map_hi >= (int) iband->maxGlobal) { - /* we need to let someone else generate more data */ - break; - } - } /* end of while no flo err */ - /* want to make sure we GetSrc at least once before Freeing */ - if (iband->current) - FreeData(flo, pet, iband, iband->current); -breakout: - ; - } /* end of else on normal order */ - } /* end of band loop */ - return(TRUE); -} /* end ActivateGeometry */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - FreeBandData(flo,ped); - ResetReceptors(ped); - ResetEmitter(ped); - - return(TRUE); -} /* end ResetGeomNN */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyGeomNN(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.flush = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyGeomNN */ - -/********************************************************************** -**************************** Fill Routines ************************** -**********************************************************************/ - -static void FL_b (OUTP,width,pvtband) - pointer OUTP; - int width; - mpGeometryBandPtr pvtband; -{ - if (pvtband->int_constant) - action_set(OUTP, width, 0); - else - action_clear(OUTP, width, 0); -} - -#define DO_FL(funcname, iotype, CONST) \ -static void funcname (OUTP,width,pvtband) \ -pointer OUTP; \ -register int width; \ -mpGeometryBandPtr pvtband; \ -{ \ -register iotype constant = (iotype) pvtband->CONST; \ -register iotype *outp = (iotype *) OUTP; \ - \ - for ( ; width > 0; width--) *outp++ = constant; \ -} - -DO_FL (FL_R, RealPixel, flt_constant) -DO_FL (FL_B, BytePixel, int_constant) -DO_FL (FL_P, PairPixel, int_constant) -DO_FL (FL_Q, QuadPixel, int_constant) - -/********************************************************************** -********************** Neareast Neighbor - Separable **************** -**********************************************************************/ - -/* (x,y) separable routines (eg, scale, mirror_x, mirror_y) */ - -static void SL_b (OUTP,srcimg,width,sline,pedpvt,pvtband) - pointer OUTP, *srcimg; - register int width; - int sline; - pGeomDefPtr pedpvt; - mpGeometryBandPtr pvtband; -{ - register int xbeg = pvtband->x_start; - register int xend = pvtband->x_end; - register int *x_locs = pvtband->x_locs; - register LogInt *src = (LogInt *) (srcimg[sline]); - register LogInt *outp = (LogInt *) OUTP; - register LogInt outval, M, fill; - register int i= 0, w; - - fill = (pvtband->int_constant ? ~(LogInt)0 : 0); - - for (w = xbeg >> LOGSHIFT; w > 0; w--, i+=LOGSIZE) *outp++ = fill; - - if (xbeg & LOGMASK) { - outval = BitLeft(fill,LOGSIZE-i); - for (i = xbeg, M=LOGBIT(i) ; M && i <= xend ; LOGRIGHT(M), i++) - if (LOG_tstbit(src,x_locs[i])) - outval |= M; - if (i > xend) { - if (fill) outval |= ~BitLeft(fill,LOGSIZE-i); - i = (i+LOGMASK) & ~LOGMASK; - } - *outp++ = outval; - } - - if ( i <= xend) { - w = (xend - i + 1) >> LOGSHIFT; - for ( ; w > 0; w--, *outp++ = outval) - for (outval = 0, M=LOGLEFT ; M ; LOGRIGHT(M), i++) - if (LOG_tstbit(src,x_locs[i])) - outval |= M; - - for (outval = 0, M=LOGLEFT; i <= xend; LOGRIGHT(M), i++) - if (LOG_tstbit(src,x_locs[i])) - outval |= M; - - if (i & LOGMASK) { - if (fill) outval |= ~BitLeft(fill,LOGSIZE-i); - i = (i+LOGMASK) & ~LOGMASK; - *outp++ = outval; - } - } - for ( ; i < width; i += LOGSIZE) *outp++ = fill; -} - -#define DO_SL(funcname, iotype, CONST) \ -static void funcname (OUTP,srcimg,width,sline,pedpvt,pvtband) \ -register pointer OUTP; \ -register pointer *srcimg; \ -register int width,sline; \ -pGeomDefPtr pedpvt; \ -mpGeometryBandPtr pvtband; \ -{ \ -register int xbeg = pvtband->x_start; \ -register int xend = pvtband->x_end; \ -register int *x_locs = pvtband->x_locs; \ -register iotype constant = (iotype) pvtband->CONST; \ -register iotype *src = (iotype *) (srcimg[sline]); \ -register iotype *outp = (iotype *) OUTP; \ -register int i; \ - for (i=0; i < xbeg; ++i) *outp++ = constant; \ - for ( ; i <= xend; ++i) *outp++ = src[x_locs[i]]; \ - for ( ; i < width; ++i) *outp++ = constant; \ -} - -DO_SL (SL_R, RealPixel, flt_constant) -DO_SL (SL_B, BytePixel, int_constant) -DO_SL (SL_P, PairPixel, int_constant) -DO_SL (SL_Q, QuadPixel, int_constant) - -/********************************************************************** -************************* Bilinear - Seperable ********************** -**********************************************************************/ -#if XIE_FULL - -/* note - could use BiGL_b since this is a silly anyway */ - -static void BiSL_b (OUTP,srcimg,width,sline,pedpvt,pvtband) -pointer OUTP; -pointer *srcimg; -register int width; -int sline; -pGeomDefPtr pedpvt; -mpGeometryBandPtr pvtband; -{ -register double s, t, st, result; -register int isrcpix; -register int *x_locs = pvtband->x_locs; -register double *s_locs = pvtband->s_locs; -register LogInt constant, val, M, *ptrIn, *ptrJn; -register LogInt *outp = (LogInt *) OUTP; -register int srcwidth = pvtband->in_width - 1; - - if ( (sline >= pvtband->hi_src_available) || - (sline < pvtband->lo_src_available) ) { - FL_b(outp, width, pvtband); - return; - } - - t = pvtband->first_mlow; t -= ((int)t); - M=LOGLEFT; val = 0; - constant = pvtband->int_constant; - ptrIn = (LogInt *) srcimg[sline]; - ptrJn = (LogInt *) srcimg[sline+1]; - while ( width > 0 ) { - isrcpix = *x_locs++; - s = *s_locs++; - if ( (isrcpix >= 0) && (isrcpix < srcwidth) ) { - st = s * t; - result = 0.; - if (LOG_tstbit(ptrIn,isrcpix)) result = - ((double)1. - s - t + st); - if (LOG_tstbit(ptrIn,isrcpix+1)) result += (s - st); - if (LOG_tstbit(ptrJn,isrcpix)) result += (t - st); - if (LOG_tstbit(ptrJn,isrcpix+1)) result += st; - if (result > 0.5) val |= M; - } else if (constant) val |= M; - width--; - LOGRIGHT(M); if (!M) { *outp++ = val; M=LOGLEFT; val = 0; } - } - if (M != LOGLEFT) *outp = val; -} - -#define BI_SL(funcname, iotype, CONST, ROUND) \ -static void funcname (OUTP,srcimg,width,sline,pedpvt,pvtband) \ -pointer OUTP; \ -pointer *srcimg; \ -register int width; \ -int sline; \ -pGeomDefPtr pedpvt; \ -mpGeometryBandPtr pvtband; \ -{ \ -register int *x_locs = pvtband->x_locs; \ -register double *s_locs = pvtband->s_locs; \ -register iotype constant = (iotype) pvtband->CONST; \ -register iotype *outp = (iotype *) OUTP; \ -register iotype *src = (iotype *) (srcimg[sline]); \ -register iotype *trc; \ -register int i, j, in_width = pvtband->in_width - 1; \ -register double s, t, st; \ -register iotype val; \ - \ - t = pvtband->first_mlow; t -= ((int)t); \ - if (sline >= pvtband->hi_src_available) \ - trc = src; /* or fill line with constant */ \ - else \ - trc = (iotype *) (srcimg[sline+1]); \ - for (i = 0; i < width; i++) { \ - j = x_locs[i]; \ - s = s_locs[i]; \ - val = constant; \ - if (j >= 0 && j < in_width) { \ - st = s * t; \ - val = src[j] * ((float)1. - s - t + st) + \ - src[j+1] * (s - st) + \ - trc[j] * (t - st) + \ - trc[j+1] * (st) + ROUND; \ - } \ - *outp++ = val; \ - } \ -} - -BI_SL (BiSL_R, RealPixel, flt_constant, (float)0.0) -BI_SL (BiSL_B, BytePixel, int_constant, (float)0.5) -BI_SL (BiSL_P, PairPixel, int_constant, (float)0.5) -BI_SL (BiSL_Q, QuadPixel, int_constant, (float)0.5) -#endif - -/********************************************************************** -********************** Neareast Neighbor - General ****************** -**********************************************************************/ - -/* NOTE: for GL routines, would be better to keep running srcpix, -** and srcline variables outside of scan line routine. -*/ - -static void GL_b (OUTP,srcimg,width,sline,pedpvt,pvtband) -pointer OUTP; -pointer *srcimg; -register int width; -int sline; -pGeomDefPtr pedpvt; -mpGeometryBandPtr pvtband; -{ -register double a = pedpvt->coeffs[0]; -register double c = pedpvt->coeffs[2]; -register double srcpix = a * PIX0 + - pedpvt->coeffs[1] * (pvtband->yOut + PIX0) + - pedpvt->coeffs[4]; -register double srcline = c * PIX0 + - pedpvt->coeffs[3] * (pvtband->yOut + PIX0) + - pedpvt->coeffs[5]; -register int isrcline,isrcpix; -register LogInt constant, val, M, *ptrIn; -register LogInt *outp = (LogInt *) OUTP; -register int srcwidth = pvtband->in_width; -register int minline = pvtband->lo_src_available; -register int maxline = pvtband->hi_src_available; - - - constant = pvtband->int_constant ? ~(LogInt) 0 : 0; - /* could pull out inner if (constant) */ - M=LOGLEFT; val = constant; - while ( width > 0 ) { - /* in our coordinate system, truncate does a round */ - isrcline = srcline; - isrcpix = srcpix; - /* prepare for next loop */ - width--; - srcline += c; - srcpix += a; - /* if (isrcline,isrcpix) not in src image, fill w/val*/ - if ( (isrcline >= minline) && (isrcline <= maxline) ) { - ptrIn = (LogInt *) srcimg[isrcline]; - if ( (isrcpix >= 0) && (isrcpix < srcwidth) && ptrIn ) - if (LOG_chgbit(ptrIn,isrcpix,constant)) - val ^= M; - } - LOGRIGHT(M); if (!M) { *outp++ = val; M=LOGLEFT; val = constant; } - } - if (M != LOGLEFT) *outp = val; -} - - -#define DO_GL(funcname, iotype, CONST) \ -static void funcname (OUTP,srcimg,width,sline,pedpvt,pvtband) \ -pointer OUTP; \ -pointer *srcimg; \ -register int width; \ -int sline; \ -pGeomDefPtr pedpvt; \ -mpGeometryBandPtr pvtband; \ -{ \ -register double a = pedpvt->coeffs[0]; \ -register double c = pedpvt->coeffs[2]; \ -register double srcpix = a * PIX0 + \ - pedpvt->coeffs[1] * (pvtband->yOut + PIX0) + \ - pedpvt->coeffs[4]; \ -register double srcline = c * PIX0 + \ - pedpvt->coeffs[3] * (pvtband->yOut + PIX0) + \ - pedpvt->coeffs[5]; \ -register int isrcline,isrcpix; \ -register iotype constant = (iotype) pvtband->CONST; \ -register iotype *outp = (iotype *) OUTP; \ -register iotype *ptrIn; \ -register iotype val; \ -/* some variables which describe available input data (for clipping) */ \ -register int srcwidth = pvtband->in_width; \ -register int minline = pvtband->lo_src_available; \ -register int maxline = pvtband->hi_src_available; \ - \ - while ( width > 0 ) { \ - isrcline = srcline; \ - isrcpix = srcpix; \ - width--; \ - srcline += c; \ - srcpix += a; \ - val = constant; \ - if ( (isrcline >= minline) && (isrcline <= maxline) ) { \ - ptrIn = (iotype *) srcimg[isrcline]; \ - if ( (isrcpix >= 0) && \ - (isrcpix < srcwidth) && \ - ptrIn ) \ - val = ptrIn[isrcpix]; \ - } \ - *outp++ = val; \ - } \ -} - -DO_GL (GL_R, RealPixel, flt_constant) -DO_GL (GL_B, BytePixel, int_constant) -DO_GL (GL_P, PairPixel, int_constant) -DO_GL (GL_Q, QuadPixel, int_constant) - -/********************************************************************** -************************* Bilinear - General ************************ -**********************************************************************/ -#if XIE_FULL - -static void BiGL_b (OUTP,srcimg,width,sline,pedpvt,pvtband) -pointer OUTP; -pointer *srcimg; -register int width; -int sline; -pGeomDefPtr pedpvt; -mpGeometryBandPtr pvtband; -{ -register float s, t, st, result; -register double a = pedpvt->coeffs[0]; -register double c = pedpvt->coeffs[2]; -register double srcpix = a * PIX0 + - pedpvt->coeffs[1] * (pvtband->yOut + PIX0) + - pedpvt->coeffs[4]; -register double srcline = c * PIX0 + - pedpvt->coeffs[3] * (pvtband->yOut + PIX0) + - pedpvt->coeffs[5]; -register int isrcline,isrcpix; -register LogInt constant, val, M, *ptrIn, *ptrJn; -register LogInt *outp = (LogInt *) OUTP; -register int srcwidth = pvtband->in_width - 1; -register int minline = pvtband->lo_src_available; -register int maxline = pvtband->hi_src_available; - - constant = pvtband->int_constant; - M=LOGLEFT; val = 0; - while ( width > 0 ) { - isrcline = srcline; - isrcpix = srcpix; - if ( (isrcline >= minline) && (isrcline < maxline) ) { - s = srcpix - isrcpix; - t = srcline - isrcline; - ptrIn = (LogInt *) srcimg[isrcline]; - ptrJn = (LogInt *) srcimg[isrcline+1]; - if ( (isrcpix >= 0) && (isrcpix < srcwidth) ) { - st = s * t; - result = 0.; - if (LOG_tstbit(ptrIn,isrcpix)) result = - ((float)1. - s - t + st); - if (LOG_tstbit(ptrIn,isrcpix+1)) result += (s - st); - if (LOG_tstbit(ptrJn,isrcpix)) result += (t - st); - if (LOG_tstbit(ptrJn,isrcpix+1)) result += st; - if (result > (float) 0.5) val |= M; - } else if (constant) val |= M; - } else if (constant) val |= M; - LOGRIGHT(M); if (!M) { *outp++ = val; M=LOGLEFT; val = 0; } - width--; - srcline += c; - srcpix += a; - } - if (M != LOGLEFT) *outp = val; -} - -#define BI_GL(funcname, iotype, CONST, ROUND) \ -static void funcname (OUTP,srcimg,width,sline,pedpvt,pvtband) \ -pointer OUTP; \ -pointer *srcimg; \ -register int width; \ -int sline; \ -pGeomDefPtr pedpvt; \ -mpGeometryBandPtr pvtband; \ -{ \ -register float s, t, st; \ -register double a = pedpvt->coeffs[0]; \ -register double c = pedpvt->coeffs[2]; \ -register double srcpix = a * PIX0 + \ - pedpvt->coeffs[1] * (pvtband->yOut + PIX0) + \ - pedpvt->coeffs[4]; \ -register double srcline = c * PIX0 + \ - pedpvt->coeffs[3] * (pvtband->yOut + PIX0) + \ - pedpvt->coeffs[5]; \ -register int isrcline,isrcpix; \ -register iotype constant = (iotype) pvtband->CONST; \ -register iotype *outp = (iotype *) OUTP; \ -register iotype *ptrIn, *ptrJn; \ -register iotype val; \ -/* some variables which describe available input data (for clipping) */ \ -register int srcwidth = pvtband->in_width - 1; \ -register int minline = pvtband->lo_src_available; \ -register int maxline = pvtband->hi_src_available; \ - \ - /* in our coordinate system, truncate does a round */ \ - while ( width > 0 ) { \ - isrcline = srcline; \ - isrcpix = srcpix; /* no fpu?, move down in 'if' */ \ - val = constant; \ - if ( (isrcline >= minline) && (isrcline < maxline) ) { \ - s = srcpix - isrcpix; \ - ptrIn = (iotype *) srcimg[isrcline]; \ - t = srcline - isrcline; \ - ptrJn = (iotype *) srcimg[isrcline+1]; \ - st = s * t; \ - if ( (isrcpix >= 0) && (isrcpix < srcwidth) ) \ - val = \ - ptrIn[isrcpix] * ((float)1. - s - t + st) + \ - ptrIn[isrcpix+1] * (s - st) + \ - ptrJn[isrcpix] * (t - st) + \ - ptrJn[isrcpix+1] * (st) + ROUND; \ - } \ - /* prepare for next loop */ \ - width--; \ - srcline += c; \ - srcpix += a; \ - *outp++ = val; \ - } \ -} - -BI_GL (BiGL_R, RealPixel, flt_constant, (float)0.0) -BI_GL (BiGL_B, BytePixel, int_constant, (float)0.5) -BI_GL (BiGL_P, PairPixel, int_constant, (float)0.5) -BI_GL (BiGL_Q, QuadPixel, int_constant, (float)0.5) -#endif -/**********************************************************************/ - -/* end module mpgeomnn.c */ Index: xc/programs/Xserver/XIE/mixie/process/mphist.c diff -u xc/programs/Xserver/XIE/mixie/process/mphist.c:3.5 xc/programs/Xserver/XIE/mixie/process/mphist.c:removed --- xc/programs/Xserver/XIE/mixie/process/mphist.c:3.5 Fri Dec 14 14:58:45 2001 +++ xc/programs/Xserver/XIE/mixie/process/mphist.c Sat Feb 28 21:42:01 2004 @@ -1,567 +0,0 @@ -/* $Xorg: mphist.c,v 1.4 2001/02/09 02:04:31 xorgcvs Exp $ */ -/**** module mphist.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mphist.c -- DDXIE match histogram element - - Larry Hare -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mphist.c,v 3.5 2001/12/14 19:58:45 dawes Exp $ */ - -#define _XIEC_MPHIST -#define _XIEC_PHIST - -/* - * Include files - */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* routines referenced by other DDXIE modules - */ -int miAnalyzeMatchHist(); - -/* routines used internal to this module - */ -static int CreateMatchHist(); -static int InitializeMatchHist(); -static int ActivateMatchHist(); -static int ResetMatchHist(); -static int DestroyMatchHist(); - -/* DDXIE Match Histogram entry points - */ -static ddElemVecRec MatchHistVec = { - CreateMatchHist, - InitializeMatchHist, - ActivateMatchHist, - (xieIntProc)NULL, - ResetMatchHist, - DestroyMatchHist - }; - -/* declarations for private structures and actions procs ... */ - -typedef RealPixel MatchFloat; - -static void match_hist(), flat_pdf(), gauss_pdf(), hyper_pdf(); - -typedef struct { - CARD32 histphase; - CARD32 histsize; - CARD32 *histdata; - void (*histproc) (); - void (*lutproc) (); -} miMatchHistRec, *miMatchHistPtr; - -static void doHistQ(), doHistP(), doHistB(); -static void doLutQ(), doLutP(), doLutB(); - - -/*------------------------------------------------------------------------ -------------------- see if we can handle this element -------------------- -------------------------------------------------------------------------*/ -int miAnalyzeMatchHist(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = MatchHistVec; - - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateMatchHist(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* attach an execution context to the photo element definition */ - - /* always force syncing between inputs (is nop if only one input) */ - return MakePETex(flo, ped, sizeof(miMatchHistRec), SYNC, NO_SYNC); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeMatchHist(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - receptorPtr rcp = pet->receptor; - bandPtr iband; - CARD32 nclip; - xieFloMatchHistogram *raw = (xieFloMatchHistogram *)ped->elemRaw; - miMatchHistPtr pvt = (miMatchHistPtr)(pet->private); - - iband = &(pet->receptor[SRCtag].band[0]); - - SetDepthFromLevels(iband->format->levels,nclip); nclip = 1 << nclip; - - switch (iband->format->class) { - case QUAD_PIXEL: pvt->histproc = doHistQ; - pvt->lutproc = doLutQ; - break; - case PAIR_PIXEL: pvt->histproc = doHistP; - pvt->lutproc = doLutP; - break; - case BYTE_PIXEL: pvt->histproc = doHistB; - pvt->lutproc = doLutB; - break; - default: ImplementationError(flo, ped, return(FALSE)); - } - - pvt->histphase = 1; - pvt->histsize = nclip; - if (!(pvt->histdata = (CARD32 *) XieCalloc(nclip * sizeof(CARD32)))) - AllocError(flo,ped,return(FALSE)); - - return InitReceptor(flo,ped,&rcp[SRCt1],NO_DATAMAP,1,1,NO_BANDS) && - InitProcDomain(flo, ped, raw->domainPhototag, - raw->domainOffsetX, raw->domainOffsetY) && - InitEmitter(flo,ped,NO_DATAMAP,SRCt1); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -static int ActivateMatchHist(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - xieFloMatchHistogram *raw = (xieFloMatchHistogram *)ped->elemRaw; - miMatchHistPtr pvt = (miMatchHistPtr)(pet->private); - receptorPtr rcp = pet->receptor; - bandPtr sbnd = &rcp->band[0]; - bandPtr dbnd = &pet->emitter[0]; - - - if (pvt->histphase == 1) { - pointer src; - - src = GetCurrentSrc(flo,pet,sbnd); - while(!ferrCode(flo) && src && SyncDomain(flo,ped,sbnd,KEEP)) { - INT32 x = 0, dx; - while (dx = GetRun(flo,pet,sbnd)) { - if (dx > 0) { - (*(pvt->histproc)) (src,pvt->histdata,pvt->histsize,x,dx); - x += dx; /* nhist += dx; */ - } else - x -= dx; - } - src = GetNextSrc(flo,pet,sbnd,KEEP); - } - - /* Is it time to switch to phase2 */ - if (src || !sbnd->final) { - /* - Since we are keeping data for the second pass, we need to - keep incrementing the threshold so that we won't get activated - until new data is available. - */ - SetBandThreshold(sbnd, sbnd->current + 1); - return (TRUE); - } - pvt->histphase = 2; - } - - /* finished with accumulation, figure out desired LUT */ - if (pvt->histphase == 2) { - - CARD32 nlev = sbnd->format->levels; - CARD32 nclip = pvt->histsize; - MatchFloat *pdfdata, pdftemp[256]; - - - /* - ** NOTE: Could try to maintain for longer periods of time, - ** OR could try to put on stack for small sizes. - */ - if (nclip <= 256) - pdfdata = &pdftemp[0]; - else if (!(pdfdata = (MatchFloat *) - XieMalloc(nclip*sizeof(MatchFloat)))) - AllocError(flo,ped,return(FALSE)); - - /* generate LUT based on match curve type */ - switch (raw->shape) { - case xieValHistogramFlat: - flat_pdf(NULL, pdfdata, nlev); - break; - case xieValHistogramGaussian: - gauss_pdf((pTecHistogramGaussianDefPtr)ped->techPvt, - pdfdata, nlev); - break; - case xieValHistogramHyperbolic: - hyper_pdf((pTecHistogramHyperbolicDefPtr)ped->techPvt, - pdfdata, nlev); - break; - default: - if (nclip > 256) (void) XieFree(pdfdata); - ImplementationError(flo, ped, return(FALSE)); - } - - /* match the histogram and the new shape */ - match_hist(pvt->histdata, pdfdata, nlev); - - if (nclip > 256) (void) XieFree(pdfdata); - - - if (nclip > nlev) { - /* zero tail entries, then mask instead of compare input pixels */ - bzero(pvt->histdata + nlev, (nclip - nlev) * sizeof(CARD32)); - } - - /* Reset src to start from scratch. - ** The domain automatically resyncs in the SyncDomain call. - */ - (void) GetSrc(flo,pet,sbnd,0,KEEP); - pvt->histphase = 3; - } - /* now processing to create actual outputs */ - if (pvt->histphase == 3) { - pointer src, dst; - - src = GetCurrentSrc(flo,pet,sbnd); - dst = GetCurrentDst(flo,pet,dbnd); - while(!ferrCode(flo) && src && dst && SyncDomain(flo,ped,dbnd,FLUSH)) { - INT32 x = 0, dx; - if (src != dst) memcpy (dst, src, dbnd->pitch); - while (dx = GetRun(flo,pet,dbnd)) { - if (dx > 0) { - (*(pvt->lutproc)) (dst,pvt->histdata,pvt->histsize,x,dx); - x += dx; /* nhist += dx; */ - } else - x -= dx; - } - src = GetNextSrc(flo,pet,sbnd,FLUSH); - dst = GetNextDst(flo,pet,dbnd,FLUSH); - } - FreeData(flo,pet,sbnd,sbnd->current); - - /* when dbnd->final goes true, we are done */ - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetMatchHist(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - miMatchHistPtr pvt = (miMatchHistPtr)(ped->peTex->private); - if (pvt && pvt->histdata) - pvt->histdata = (CARD32 *) XieFree(pvt->histdata); - - ResetReceptors(ped); - ResetEmitter(ped); - - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyMatchHist(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc) NULL; - ped->ddVec.initialize = (xieIntProc) NULL; - ped->ddVec.activate = (xieIntProc) NULL; - ped->ddVec.reset = (xieIntProc) NULL; - ped->ddVec.destroy = (xieIntProc) NULL; - - return TRUE; -} - - -/*------------------------------------------------------------------------ ------------------------- action procs to do histogram -------------------- -------------------------------------------------------------------------*/ - -/* -** NOTE: Consider revamping Export Client Histogram to not use -** 'pvt' structure so that more sharing of code (and thus potential -** future optimizations) is possible. -*/ - -static void -doHistQ(svoid,hist,clip,x,dx) - pointer svoid; - CARD32 *hist, clip, x, dx; -{ - QuadPixel *src = (QuadPixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; -} - -static void -doHistP(svoid,hist,clip,x,dx) - pointer svoid; - CARD32 *hist, clip, x, dx; -{ - PairPixel *src = (PairPixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; -} - -static void -doHistB(svoid,hist,clip,x,dx) - pointer svoid; - CARD32 *hist, clip, x, dx; -{ - BytePixel *src = (BytePixel *) svoid; - - for ( src += x, clip -= 1; dx > 0 ; dx--) - hist[*src++ & clip]++; -} - - - -/*------------------------------------------------------------------------ ------------------------- action procs to process lut -------------------- -------------------------------------------------------------------------*/ - -static void -doLutQ(dvoid,lut,clip,x,dx) - pointer dvoid; - CARD32 *lut, clip, x, dx; -{ - QuadPixel *dst = (QuadPixel *) dvoid; - - for ( dst += x, clip -= 1; dx > 0 ; dx--, dst++) - *dst = lut[*dst & clip]; -} - -static void -doLutP(dvoid,lut,clip,x,dx) - pointer dvoid; - CARD32 *lut, clip, x, dx; -{ - PairPixel *dst = (PairPixel *) dvoid; - - for ( dst += x, clip -= 1; dx > 0 ; dx--, dst++) - *dst = lut[*dst & clip]; -} - -static void -doLutB(dvoid,lut,clip,x,dx) - pointer dvoid; - CARD32 *lut, clip, x, dx; -{ - BytePixel *dst = (BytePixel *) dvoid; - - for ( dst += x, clip -= 1; dx > 0 ; dx--, dst++) - *dst = lut[*dst & clip]; -} - - -/*------------------------------------------------------------------------ --------------------------- process matching curves ----------------------- -------------------------------------------------------------------------*/ - - -static void -match_hist(hptr, pdf, nlev) - CARD32 *hptr; - MatchFloat *pdf; - CARD32 nlev; -{ - double sum, sf; - MatchFloat match, closest, delta; - CARD32 ilev, jlev, plev, hsum; - - /* sum up the probability curve distribution */ - for (sum=0., ilev = 0; ilev < nlev; ilev++) - sum += pdf[ilev]; - - /* normalize and accumulate the pdf */ - sf = 1.0 / (sum ? sum : 1.0); - for (sum=0., ilev = 0; ilev < nlev; ilev++) { - sum += pdf[ilev]; - pdf[ilev] = sum * sf; - } - - /* count up the histogram entries */ - for (hsum=0, ilev = 0; ilev < nlev ; ilev++) { - hsum += hptr[ilev]; - } - - /* match the histogram and the new shape */ - sf = 1.0 / (double) (hsum ? hsum : 1.0); - for (ilev=0, plev=0, hsum=0; ilev < nlev ; ilev++) { - hsum += hptr[ilev]; - match = (MatchFloat) hsum * sf; /* normalize, accumulate */ - - /* search forwards to find closest match */ - for (jlev = plev, closest = 99.0 ; jlev < nlev ; jlev++) { - - delta = match - pdf[jlev]; - if (delta < 0.) delta = -delta; - - if (delta == 0.) {jlev++; break; } - else if (delta < closest) closest = delta; - else if (delta > closest) break; - } - hptr[ilev] = plev = jlev - 1; - } -} - -static void -flat_pdf(raw, pdf, nlev) - pTecHistogramGaussianDefPtr raw; - MatchFloat *pdf; - CARD32 nlev; -{ - CARD32 ilev; - double sf = 1.0 / (double) nlev; - - for (ilev = 0; ilev < nlev; ilev++) - *pdf++ = sf; -} - -static void -gauss_pdf(raw, pdf, nlev) - pTecHistogramGaussianDefPtr raw; - MatchFloat *pdf; - CARD32 nlev; -{ - CARD32 ilev; - double mean, sigma, a, b, xx; - - mean = raw->mean; - sigma = raw->sigma; - - a = 1.0 / sqrt ( 2.0 * M_PI ); /* .39894228 ..... */ - b = 2.0 * sigma * sigma; - - for (ilev = 0; ilev < nlev; ilev++) { - xx = (double) ilev - mean; - pdf[ilev] = a * exp( - (xx * xx) / b); - } -} - -static void -hyper_pdf(raw, pdf, nlev) - pTecHistogramHyperbolicDefPtr raw; - MatchFloat *pdf; - CARD32 nlev; -{ - CARD32 ilev; - BOOL sf; - double cnst, lg; - - - sf = raw->shapeFactor; - cnst = raw->constant; - lg = log(1.0 + 1.0 / cnst); - - for (ilev = 0; ilev < nlev; ilev++) - pdf[ilev] = 1.0 / (((double)(sf ? nlev-1-ilev : ilev) + cnst) * lg); -} - -/* end module mphist.c */ Index: xc/programs/Xserver/XIE/mixie/process/mplogic.c diff -u xc/programs/Xserver/XIE/mixie/process/mplogic.c:3.5 xc/programs/Xserver/XIE/mixie/process/mplogic.c:removed --- xc/programs/Xserver/XIE/mixie/process/mplogic.c:3.5 Fri Dec 14 14:58:45 2001 +++ xc/programs/Xserver/XIE/mixie/process/mplogic.c Sat Feb 28 21:42:01 2004 @@ -1,814 +0,0 @@ -/* $Xorg: mplogic.c,v 1.6 2001/02/09 02:04:31 xorgcvs Exp $ */ -/**** module mplogic.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mplogic.c -- DDXIE logic element - - Larry Hare -- AGE Logic, Inc. July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mplogic.c,v 3.5 2001/12/14 19:58:45 dawes Exp $ */ - - -#define _XIEC_MPLOGIC -#define _XIEC_PLOGIC - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeLogic(); - -/* - * routines used internal to this module - */ -static int CreateLogic(); -static int InitializeLogic(); -static int ResetLogic(); -static int DestroyLogic(); - -static int ActivateLogicM(); -static int ActivateLogicD(); -static int ActivateLogicMROI(); -static int ActivateLogicDROI(); - -/* - * DDXIE Logic entry points - */ -static ddElemVecRec LogicVec = { - CreateLogic, - InitializeLogic, - ActivateLogicM, - (xieIntProc)NULL, - ResetLogic, - DestroyLogic - }; - -/* - * Local Declarations. - */ - -typedef struct _mplogicdef { - void (*action) (); - void (*action2) (); - CARD32 cnst; - CARD32 endrun; - CARD32 endix; -} mpLogicPvtRec, *mpLogicPvtPtr; - -#define SHIFT_FROM_LEVELS(shift,levels) \ -{ CARD32 _lev = levels; \ - shift = _lev <= 256 ? (_lev <= 2 ? 0 : 3 ) : (_lev <=65536 ? 4 : 5); \ -} - -static CARD32 rep_cnst(); - -/* -** NOTE: might change over to use mergerops (see mfb/mergerop.h) -** NOTE: might change constant operations to use dyads with prefilled -** constant strip; this would slow them down, but would -** conserve code space. -*/ - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeLogic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = LogicVec; - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateLogic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* always force syncing between inputs (is nop if only one input) */ - return MakePETex(flo,ped, - xieValMaxBands * sizeof(mpLogicPvtRec), - SYNC, /* InSync: Make sure ROI exists first */ - NO_SYNC /* bandSync: see CreateLogic */ - ); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - -static int ActivateLogicM(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpLogicPvtPtr pvt = (mpLogicPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, dband++) { - int pitch = sband->format->pitch; /* bits */ - LogInt *svoid, *dvoid; - - if (!(svoid = (LogInt*)GetCurrentSrc(flo,pet,sband)) || - !(dvoid = (LogInt*)GetCurrentDst(flo,pet,dband))) continue; - - do { - (*(pvt->action)) (dvoid, svoid, pvt->cnst, pitch); - svoid = (LogInt*)GetNextSrc(flo,pet,sband,FLUSH); - dvoid = (LogInt*)GetNextDst(flo,pet,dband,FLUSH); - } while (!ferrCode(flo) && svoid && dvoid) ; - - FreeData(flo, pet, sband, sband->current); - } - return TRUE; -} - -static int ActivateLogicD(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpLogicPvtPtr pvt = (mpLogicPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, tband++, dband++) { - LogInt *svoid, *tvoid, *dvoid; - - if (!(svoid = (LogInt*)GetCurrentSrc(flo,pet,sband)) || - !(tvoid = (LogInt*)GetCurrentSrc(flo,pet,tband)) || - !(dvoid = (LogInt*)GetCurrentDst(flo,pet,dband)) ) continue; - - do { - /* This is the code that might rather utilize INPLACE */ - (*(pvt->action)) (dvoid, svoid, tvoid, pvt->endix); - if (pvt->action2) - (*(pvt->action2)) (dvoid, svoid, pvt->endrun, pvt->endix); - svoid = (LogInt*)GetNextSrc(flo,pet,sband,FLUSH); - tvoid = (LogInt*)GetNextSrc(flo,pet,tband,FLUSH); - dvoid = (LogInt*)GetNextDst(flo,pet,dband,FLUSH); - } while (!ferrCode(flo) && svoid && tvoid && dvoid) ; - - if(!svoid && sband->final) /* when sr1 runs out, kill sr2 too */ - DisableSrc(flo,pet,tband,FLUSH); - else if(!tvoid && tband->final) /* when sr2 runs out, pass-thru sr1 */ - BypassSrc(flo,pet,sband); - else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sband,sband->current); - FreeData(flo,pet,tband,tband->current); - } - } - return TRUE; -} - -static int ActivateLogicMROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpLogicPvtPtr pvt = (mpLogicPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, dband++) { - pointer svoid, dvoid; - CARD32 shift; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) continue; - - SHIFT_FROM_LEVELS(shift, dband->format->levels) - - while (!ferrCode(flo) && svoid && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - INT32 run, ix = 0; - - if (svoid != dvoid) memcpy(dvoid, svoid, dband->pitch); - - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - (*(pvt->action)) (dvoid, pvt->cnst, - run << shift, ix << shift); - ix += run; - } else - ix -= run; - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - FreeData(flo, pet, sband, sband->current); - } - return TRUE; -} - -static int ActivateLogicDROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpLogicPvtPtr pvt = (mpLogicPvtPtr) pet->private; - int band, nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr tband = &(pet->receptor[SRCt2].band[0]); - bandPtr dband = &(pet->emitter[0]); - - for(band = 0; band < nbands; band++, pvt++, sband++, tband++, dband++) { - pointer svoid, tvoid, dvoid; - CARD32 shift, w; - - w = sband->format->width; - if (w > tband->format->width) w = tband->format->width; - - if (!(svoid = GetCurrentSrc(flo,pet,sband)) || - !(tvoid = GetCurrentSrc(flo,pet,tband)) || - !(dvoid = GetCurrentDst(flo,pet,dband))) continue; - - SHIFT_FROM_LEVELS(shift, dband->format->levels) - - while (!ferrCode(flo) && svoid && tvoid && dvoid && - SyncDomain(flo,ped,dband,FLUSH)) { - INT32 run, ix = 0; - - if (svoid != dvoid) memcpy(dvoid, svoid, dband->pitch); - - while (run = GetRun(flo,pet,dband)) { - if (run > 0) { - /* needs to clip to second source, yuck */ - if ((ix + run) > w) { - if (ix < w) (*(pvt->action)) (dvoid, tvoid, - (w-ix) << shift, ix << shift); - break; - } - (*(pvt->action)) (dvoid, tvoid, run << shift, ix << shift); - ix += run; - } else - ix -= run; - } - svoid = GetNextSrc(flo,pet,sband,FLUSH); - tvoid = GetNextSrc(flo,pet,tband,FLUSH); - dvoid = GetNextDst(flo,pet,dband,FLUSH); - } - - if(!svoid && sband->final) /* when sr1 runs out, kill sr2 too */ - DisableSrc(flo,pet,tband,FLUSH); - else if(!tvoid && tband->final) /* when sr2 runs out, pass-thru sr1 */ - BypassSrc(flo,pet,sband); - else { /* both inputs still active, keep the scheduler up to date */ - FreeData(flo,pet,sband,sband->current); - FreeData(flo,pet,tband,tband->current); - } - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetLogic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyLogic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -/* NOTE: would be nice to use mfb/mergerop.h. beware though. the roles -** of dst, and source are somewhat reversed. This will be almost -** necessary if we choose to support mismatched levels, and should make -** it simpler to make fine tuned assembly or C code. -*/ - -/* M: (*(pvt->action)) (dvoid, svoid, pvt->cnst, bw); */ -/* D: (*(pvt->action)) (dvoid, svoid, tvoid, bw); */ - -#define MakeM1(name, op) \ -static void name(d,src1,con,bits) \ - LogInt *d, *src1, con; \ - CARD32 bits; \ -{ \ - CARD32 w = (bits + LOGSIZE - 1) / LOGSIZE; \ - while (w >= 4) { *d++ = op; *d++ = op; \ - *d++ = op; *d++ = op; w -= 4; } \ - switch (w) { \ - case 3: *d++ = op; \ - case 2: *d++ = op; \ - case 1: *d = op; \ - default: break; \ - } \ -} - -#define MakeM2(name, rev, op) \ -static void name(d,src1,con,bits) \ - LogInt *d, *src1, con; \ - CARD32 bits; \ -{ \ - CARD32 w = (bits + LOGSIZE - 1) / LOGSIZE; \ - LogInt A, B, C, D; \ - while (w >= 4) { \ - A = *src1++; B = *src1++; C = *src1++; D = *src1++; \ - *d++ = (rev A) op; *d++ = (rev B) op; \ - *d++ = (rev C) op; *d++ = (rev D) op; w -= 4; \ - } \ - switch (w) { \ - case 3: A = *src1++; *d++ = (rev A) op; \ - case 2: A = *src1++; *d++ = (rev A) op; \ - case 1: A = *src1; *d = (rev A) op; \ - default: break; \ - } \ -} - -#define MakeD1(dname, mname) \ -static void dname(d,src1,src2,bits) \ - LogInt *d, *src1, *src2; \ - CARD32 bits; \ -{ \ - mname (d, src2, 0, bits); \ -} - -#define MakeD2(name, rev, op) \ -static void name(d,src1,src2,bits) \ - LogInt *d, *src1, *src2; \ - CARD32 bits; \ -{ \ - CARD32 w = (bits + LOGSIZE - 1) / LOGSIZE; \ - LogInt A, B, C, D, E, F, G, H; \ - while (w >= 4) { \ - A = src1[0]; B = src1[1]; C = src1[2]; D = src1[3]; src1 += 4; \ - E = src2[0]; F = src2[1]; G = src2[2]; H = src2[3]; src2 += 4; \ - d[0] = (rev A) op E; d[1] = (rev B) op F; \ - d[2] = (rev C) op G; d[3] = (rev D) op H; w -= 4; d += 4; \ - } \ - switch (w) { \ - case 3: A = *src1++; E = *src2++; *d++ = (rev A) op E; \ - case 2: A = *src1++; E = *src2++; *d++ = (rev A) op E; \ - case 1: A = *src1; E = *src2++; *d = (rev A) op E; \ - default: break; \ - } \ -} - -#define NaDa - -MakeM1 (mono_clear, (LogInt) 0) -MakeM2 (mono_and, NaDa, & con) -MakeM2 (mono_andrev, ~, & con) -MakeM1 (mono_copy, con) -MakeM2 (mono_andinv, NaDa, & ~con) -MakeM2 (mono_noop, NaDa, NaDa) -MakeM2 (mono_xor, NaDa, ^ con) -MakeM2 (mono_or, NaDa, | con) -MakeM2 (mono_nor, ~, & ~con) -MakeM2 (mono_equiv, NaDa, ^ ~con) -MakeM2 (mono_invert, ~, NaDa) -MakeM2 (mono_orrev, ~, | con) -MakeM1 (mono_copyinv, ~con) -MakeM2 (mono_orinv, NaDa, | ~con) -MakeM2 (mono_nand, ~, | ~con) -MakeM1 (mono_set, ~(LogInt) 0) - -#define dyad_clear mono_clear -MakeD2 (dyad_and, NaDa, & ) -MakeD2 (dyad_andrev, ~, & ) -MakeD1 (dyad_copy, mono_noop) -MakeD2 (dyad_andinv, NaDa, & ~) -#define dyad_noop mono_noop -MakeD2 (dyad_xor, NaDa, ^ ) -MakeD2 (dyad_or, NaDa, | ) -MakeD2 (dyad_nor, ~, & ~) -MakeD2 (dyad_equiv, NaDa, ^ ~) -#define dyad_invert mono_invert -MakeD2 (dyad_orrev, ~, | ) -MakeD1 (dyad_copyinv, mono_invert) -MakeD2 (dyad_orinv, NaDa, | ~) -MakeD2 (dyad_nand, ~, | ~) -#define dyad_set mono_set - -static void (*action_mono[16])() = { - mono_clear, mono_and, mono_andrev, mono_copy, - mono_andinv, mono_noop, mono_xor, mono_or, - mono_nor, mono_equiv, mono_invert, mono_orrev, - mono_copyinv, mono_orinv, mono_nand, mono_set -}; -static void (*action_dyad[16])() = { - dyad_clear, dyad_and, dyad_andrev, dyad_copy, - dyad_andinv, dyad_noop, dyad_xor, dyad_or, - dyad_nor, dyad_equiv, dyad_invert, dyad_orrev, - dyad_copyinv, dyad_orinv, dyad_nand, dyad_set -}; - -/*------------------------------------------------------------------------ ---------------------- ROI operations work on subranges ------------------ -------------------------------------------------------------------------*/ - -/* MROI: (*(pvt->action)) (dvoid, pvt->cnst, run, ix); */ -/* DROI: (*(pvt->action)) (dvoid, src2, run, ix); */ - -#define MakeROIM1(name, op) \ -static void name(d,con,run,ix) \ - LogInt *d, con; \ - CARD32 run, ix; \ -{ \ - LogInt D, M; \ - CARD32 sbit = ix & LOGMASK; \ - d += (ix >>= LOGSHIFT); \ - if (sbit + run >= LOGSIZE) { \ - if (sbit) { \ - M = BitRight(LOGONES,sbit); run -= (LOGSIZE - sbit); \ - D = *d; *d = (D & ~M) | (op & M); d++; \ - } \ - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--, d++ ) { \ - *d = op; \ - } \ - if (run &= LOGMASK) { \ - M = ~BitRight(LOGONES,run); \ - D = *d; *d = (D & ~M) | (op & M); \ - } \ - } else { \ - M = BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run)); \ - D = *d; *d = (D & ~M) | (op & M); \ - } \ -} - -#define MakeROIM2(name, rev, op) \ -static void name(d,con,run,ix) \ - LogInt *d, con; \ - CARD32 run, ix; \ -{ \ - LogInt D, M; \ - CARD32 sbit = ix & LOGMASK; \ - d += (ix >>= LOGSHIFT); \ - if (sbit + run >= LOGSIZE) { \ - if (sbit) { \ - M = BitRight(LOGONES,sbit); run -= (LOGSIZE - sbit); \ - D = *d; *d = (D & ~M) | (((rev D) op) & M); d++; \ - } \ - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--, d++ ) { \ - *d = (rev *d) op; \ - } \ - if (run &= LOGMASK) { \ - M = ~BitRight(LOGONES,run); \ - D = *d; *d = (D & ~M) | (((rev D) op) & M); \ - } \ - } else { \ - M = BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run)); \ - D = *d; *d = (D & ~M) | (((rev D) op) & M); d++; \ - } \ -} - -#define MakeROIM3(name) \ -static void name(d,con,run,ix) \ - LogInt *d, con; \ - CARD32 run, ix; \ -{ \ - return; /* NoOp */ \ -} - -#define MakeROID1(name, op) \ -static void name(d,src2,run,ix) \ - LogInt *d, *src2; \ - CARD32 run, ix; \ -{ \ - LogInt D, M; \ - CARD32 sbit = ix & LOGMASK; \ - ix >>= LOGSHIFT; d += ix; src2 += ix; \ - if (sbit + run >= LOGSIZE) { \ - if (sbit) { \ - M = BitRight(LOGONES,sbit); run -= (LOGSIZE - sbit); \ - D = *d; *d = (D & ~M) | ((op *src2++) & M); d++; \ - } \ - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--, d++, src2++ ) { \ - *d = op *src2; \ - } \ - if (run &= LOGMASK) { \ - M = ~BitRight(LOGONES,run); \ - D = *d; *d = (D & ~M) | ((op *src2) & M); \ - } \ - } else { \ - M = BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run)); \ - D = *d; *d = (D & ~M) | ((op *src2) & M); \ - } \ -} - -#define MakeROID2(name, rev, op) \ -static void name(d,src2,run,ix) \ - LogInt *d, *src2; \ - CARD32 run, ix; \ -{ \ - LogInt D, M; \ - CARD32 sbit = ix & LOGMASK; \ - ix >>= LOGSHIFT; d += ix; src2 += ix; \ - if (sbit + run >= LOGSIZE) { \ - if (sbit) { \ - M = BitRight(LOGONES,sbit); run -= (LOGSIZE - sbit); \ - D = *d; *d = (D & ~M) | (((rev D) op *src2++) & M); d++; \ - } \ - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--, d++, src2++ ) { \ - *d = (rev *d) op *src2; \ - } \ - if (run &= LOGMASK) { \ - M = ~BitRight(LOGONES,run); \ - D = *d; *d = (D & ~M) | (((rev D) op *src2) & M); \ - } \ - } else { \ - M = BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run)); \ - D = *d; *d = (D & ~M) | (((rev D) op *src2) & M); \ - } \ -} - -MakeROIM1 (mroi_clear, (LogInt) 0) -MakeROIM2 (mroi_and, NaDa, & con) -MakeROIM2 (mroi_andrev, ~, & con) -MakeROIM1 (mroi_copy, con) -MakeROIM2 (mroi_andinv, NaDa, & ~con) -MakeROIM3 (mroi_noop ) -MakeROIM2 (mroi_xor, NaDa, ^ con) -MakeROIM2 (mroi_or, NaDa, | con) -MakeROIM2 (mroi_nor, ~, & ~con) -MakeROIM2 (mroi_equiv, NaDa, ^ ~con) -MakeROIM2 (mroi_invert, ~, NaDa) -MakeROIM2 (mroi_orrev, ~, | con) -MakeROIM1 (mroi_copyinv, ~con) -MakeROIM2 (mroi_orinv, NaDa, | ~con) -MakeROIM2 (mroi_nand, ~, | ~con) -MakeROIM1 (mroi_set, ~(LogInt) 0) - -#define droi_clear mroi_clear -MakeROID2 (droi_and, NaDa, & ) -MakeROID2 (droi_andrev, ~, & ) -MakeROID1 (droi_copy, NaDa) -MakeROID2 (droi_andinv, NaDa, & ~) -#define droi_noop mroi_noop -MakeROID2 (droi_xor, NaDa, ^ ) -MakeROID2 (droi_or, NaDa, | ) -MakeROID2 (droi_nor, ~, & ~) -MakeROID2 (droi_equiv, NaDa, ^ ~) -#define droi_invert mroi_invert -MakeROID2 (droi_orrev, ~, | ) -MakeROID1 (droi_copyinv, ~) -MakeROID2 (droi_orinv, NaDa, | ~) -MakeROID2 (droi_nand, ~, | ~) -#define droi_set mroi_set - -static void (*action_monoROI[16])() = { - mroi_clear, mroi_and, mroi_andrev, mroi_copy, - mroi_andinv, mroi_noop, mroi_xor, mroi_or, - mroi_nor, mroi_equiv, mroi_invert, mroi_orrev, - mroi_copyinv, mroi_orinv, mroi_nand, mroi_set -}; -static void (*action_dyadROI[16])() = { - droi_clear, droi_and, droi_andrev, droi_copy, - droi_andinv, droi_noop, droi_xor, droi_or, - droi_nor, droi_equiv, droi_invert, droi_orrev, - droi_copyinv, droi_orinv, droi_nand, droi_set -}; - -/*------------------------------------------------------------------------ ----------------------------- some other goodies ------------------------- -------------------------------------------------------------------------*/ - -static void action_tail(d, src, run, ix) - LogInt *d, *src; - CARD32 run, ix; -{ - LogInt D, M; - CARD32 sbit = ix & LOGMASK; - ix >>= LOGSHIFT; d += ix; src += ix; - if (sbit + run >= LOGSIZE) { - if (sbit) { - M = BitRight(LOGONES,sbit); run -= (LOGSIZE - sbit); - D = *d; *d = (D & ~M) | (*src++ & M); d++; - } - for (sbit = run >> LOGSHIFT; sbit > 0; sbit--) { - *d++ = *src++; - } - if (run &= LOGMASK) { /* may be unnecessary due to padding */ - M = ~BitRight(LOGONES,run); - D = *d; *d = (D & ~M) | (*src & M); - } - } else { - M = BitRight(LOGONES,sbit) & ~(BitRight(LOGONES,sbit+run)); - D = *d; *d = (D & ~M) | (*src & M); - } -} - -static CARD32 -rep_cnst(levels, dconst) - CARD32 levels; - double dconst; -{ - - CARD32 con = ConstrainConst(dconst,levels); - - if (levels <= 0x100) { - if ( levels > 2) { - con &= 0xff; con |= con << 8; return con | (con << 16); - } - if (levels == 2) { - return con & 1 ? ~0 : 0; - } - return 0; - } else if (levels < 0x10000) { - con &= 0xffff; return con | (con << 16); - } - return con & 0xffffff; -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ - -static int InitializeLogic(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - xieFloLogical *raw = (xieFloLogical *) ped->elemRaw; - pLogicDefPtr epvt = (pLogicDefPtr) ped->elemPvt; - mpLogicPvtPtr pvt = (mpLogicPvtPtr) pet->private; - receptorPtr rcp = pet->receptor; - CARD32 nbands = pet->receptor[SRCt1].inFlo->bands; - bandPtr dband = &(pet->emitter[0]); - CARD8 msk = raw->bandMask; - BOOL hasROI = raw->domainPhototag != 0; - CARD32 band; - void (*act)(); - - if (hasROI) { - if (raw->src2) { - ped->ddVec.activate = ActivateLogicDROI; - act = action_dyadROI[raw->operator]; - } else { - ped->ddVec.activate = ActivateLogicMROI; - act = action_monoROI[raw->operator]; - } - } else { /* no ROI */ - if (raw->src2) { - ped->ddVec.activate = ActivateLogicD; - act = action_dyad[raw->operator]; - } else { - ped->ddVec.activate = ActivateLogicM; - act = action_mono[raw->operator]; - } - } - - for (band=0; bandaction = act; - if (!raw->src2) { - pvt->cnst = rep_cnst(dband->format->levels, epvt->constant[band]); - } else if (!hasROI) { - /* gack, an alternative is to use INPLACE for SRCt1 */ - bandPtr tband = &(pet->receptor[SRCt2].band[band]); - if (dband->format->pitch <= tband->format->pitch) { - pvt->action2 = (void (*)()) NULL; - pvt->endix = dband->format->pitch; /* bits */ - } else { - pvt->action2 = action_tail; - pvt->endix = tband->format->pitch; - pvt->endrun = dband->format->pitch - pvt->endix; - } - } - } - - /* If processing domain, allow replication */ - if (hasROI) - pet->receptor[ped->inCnt-1].band[0].replicate = msk; - - InitReceptor(flo, ped, &rcp[SRCt1], NO_DATAMAP, 1, msk, ~msk); - if (msk && raw->src2) - InitReceptor(flo, ped, &rcp[SRCt2], NO_DATAMAP, 1, msk, NO_BANDS); - if (hasROI) - InitProcDomain(flo, ped, raw->domainPhototag, raw->domainOffsetX, - raw->domainOffsetY); - if (msk) - InitEmitter(flo, ped, NO_DATAMAP, hasROI ? SRCt1 : NO_INPLACE); - - return !ferrCode(flo); -} - - -/* end module mplogic.c */ Index: xc/programs/Xserver/XIE/mixie/process/mppaste.c diff -u xc/programs/Xserver/XIE/mixie/process/mppaste.c:3.5 xc/programs/Xserver/XIE/mixie/process/mppaste.c:removed --- xc/programs/Xserver/XIE/mixie/process/mppaste.c:3.5 Fri Dec 14 14:58:45 2001 +++ xc/programs/Xserver/XIE/mixie/process/mppaste.c Sat Feb 28 21:42:01 2004 @@ -1,557 +0,0 @@ -/* $Xorg: mppaste.c,v 1.4 2001/02/09 02:04:31 xorgcvs Exp $ */ -/**** module mppaste.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mppaste.c -- DDXIE paste up element - - Dean Verheiden, Larry Hare && Robert NC Shelley -- AGE Logic, Inc. - July, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mppaste.c,v 3.5 2001/12/14 19:58:45 dawes Exp $ */ - -#define _XIEC_MPPASTE -#define _XIEC_PPASTE - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzePasteUp(); - -/* - * routines used internal to this module - */ -static int CreatePasteUp(); -static int InitializePasteUp(); -static int ActivatePasteUp(); -static int ResetPasteUp(); -static int DestroyPasteUp(); - -/* Fill functions */ -static void FillReal(); -static void FillQuad(); -static void FillPair(); -static void FillByte(); -static void FillBit(); - -/* Action functions */ -static void PasteReal(); -static void PasteQuad(); -static void PastePair(); -static void PasteByte(); -static void PasteBit(); - -/* - * DDXIE Paste Up entry points - */ -static ddElemVecRec PasteUpVec = { - CreatePasteUp, - InitializePasteUp, - ActivatePasteUp, - (xieIntProc)NULL, - ResetPasteUp, - DestroyPasteUp - }; - -/* - * Local Declarations. - */ - -typedef struct _pasterect { - Bool active; /* indicates this src is not finished yet */ - INT32 sxoff; /* src x offset */ - INT32 dxoff; /* dst x offset */ - INT32 dyoff; /* dst y offset */ - CARD32 width; /* clipped width of src on output window */ - CARD32 height; /* clipped height of src on output window */ - CARD32 receptorIndex; -} PasteRectRec, *PasteRectPtr; - -typedef struct _mppasteupdef { - void (*fill)(); - void (*action)(); - INT32 nextline; - CARD32 iconstant; - CARD32 numRects; /* Number of interesting src for this band */ - PasteRectPtr rects; -} mpPasteUpPvtRec, *mpPasteUpPvtPtr; - - -/*------------------------------------------------------------------------ ------------------------------ Analyze ------------------------------------ -------------------------------------------------------------------------*/ -int miAnalyzePasteUp(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* for now just stash our entry point vector in the peDef */ - ped->ddVec = PasteUpVec; - - return(TRUE); -} /* end miAnalyzePasteUp */ - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreatePasteUp(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpPasteUpPvtRec); - - /* Force syncing between sources, but not bands */ - return (MakePETex(flo, ped, auxsize, SYNC, NO_SYNC) ); -} /* end CreatePasteUp */ - - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializePasteUp(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloPasteUp *raw = (xieFloPasteUp *)ped->elemRaw; - peTexPtr pet = ped->peTex; - CARD32 nbands = pet->receptor[SRCt1].inFlo->bands; - PasteUpFloat *fconst = ((pPasteUpDefPtr)ped->elemPvt)->constant; - mpPasteUpPvtPtr pvt; - xieTypTile *tp; - bandPtr iband, oband; - CARD32 b, t; - - if (!(InitReceptors(flo, ped, NO_DATAMAP, 1) && - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE))) - return (FALSE); - - /* Figure out the appropriate action vector */ - /* Use first source for the band types since they all must be the same */ - iband = &(pet->receptor[SRCt1].band[0]); - pvt = (mpPasteUpPvtPtr)pet->private; - for(b = 0; b < nbands; b++, pvt++, iband++, fconst++) { - - /* Zero out "interesting" rectangle counters */ - pvt->numRects = 0; - pvt->nextline = pet->emitter[b].format->height - 1; - - /* Clip fill for constrained data */ - if (IsConstrained(iband->format->class)) - pvt->iconstant = ConstrainConst(*fconst,iband->format->levels); - - switch (iband->format->class) { - case UNCONSTRAINED: - pvt->fill = FillReal; - pvt->action = PasteReal; - break; - case QUAD_PIXEL: - pvt->fill = FillQuad; - pvt->action = PasteQuad; - break; - case PAIR_PIXEL: - pvt->fill = FillPair; - pvt->action = PastePair; - break; - case BYTE_PIXEL: - pvt->fill = FillByte; - pvt->action = PasteByte; - break; - case BIT_PIXEL: - pvt->fill = FillBit; - pvt->action = PasteBit; - break; - default: - ImplementationError(flo, ped, return(FALSE)); - break; - } - } - - /* Disable completely clipped srcs, determine minimum y of non clipped src */ - tp = (xieTypTile *)&(raw[1]); - for (t = 0; t < raw->numTiles; t++, tp++) { - iband = &(pet->receptor[t].band[0]); - oband = &pet->emitter[0]; - pvt = (mpPasteUpPvtPtr)pet->private; - for(b = 0; b < nbands; b++, iband++, oband++, pvt++) { - INT32 dst_width = oband->format->width; - INT32 dst_height = oband->format->height; - if ((tp->dstY + (INT32)iband->format->height) <= 0 || - (tp->dstX + (INT32)iband->format->width) <= 0 || - (tp->dstX >= dst_width) || - (tp->dstY >= dst_height)) - DisableSrc(flo,pet,iband,FLUSH); - else { - pvt->numRects++; - if (tp->dstY < pvt->nextline) - pvt->nextline = (tp->dstY > 0) ? tp->dstY : 0; - } - } - } - - /* Allocate space for srcs that are not completely clipped */ - pvt = (mpPasteUpPvtPtr)pet->private; - for (b = 0; b < nbands; b++, pvt++) - if (pvt->numRects) { - pvt->rects = - (PasteRectPtr)XieMalloc(pvt->numRects * sizeof(PasteRectRec)); - pvt->numRects = 0; /* Will be used as list is built */ - } else - pvt->rects = (PasteRectPtr)NULL; - - /* - Build list for each band containing srcs that are displayed, adjust - thresholds for srcs without minimum y - */ - tp = (xieTypTile *)&(raw[1]); - for (t = 0; t < raw->numTiles; t++, tp++) { - CARD8 amask = 1, active = pet->receptor[t].active; - iband = &(pet->receptor[t].band[0]); - oband = &pet->emitter[0]; - pvt = (mpPasteUpPvtPtr)pet->private; - for(b = 0; b < nbands; b++, iband++, oband++, amask <<= 1, pvt++) { - if (active & amask) { - INT32 dst_width = oband->format->width; - INT32 dst_height = oband->format->height; - PasteRectPtr pr = &(pvt->rects[pvt->numRects++]); /* Yuck */ - - pr->active = TRUE; - pr->receptorIndex = t; - if (tp->dstX >= 0) { /* clip left */ - pr->sxoff = 0; - pr->dxoff = tp->dstX; - pr->width = iband->format->width; - } else { - pr->sxoff = -tp->dstX; - pr->dxoff = 0; - pr->width = iband->format->width - pr->sxoff; - } - if (pr->dxoff + pr->width > dst_width) /* clip right */ - pr->width = dst_width - pr->dxoff; - - if (tp->dstY >= 0) { /* clip top */ - pr->dyoff = tp->dstY; - pr->height = iband->format->height; - } else { - pr->dyoff = 0; - pr->height = iband->format->height - (-tp->dstY); - } - if (pr->dyoff + pr->height > dst_height)/* clip bottom */ - pr->height = dst_height - pr->dyoff; - - /* Adjust thresholds if necessary */ - if (tp->dstY != pvt->nextline) { - if (tp->dstY > pvt->nextline) - IgnoreBand(iband); - else - SetBandThreshold(iband,-tp->dstY+1); - } - } - } - } - - return( TRUE ); -} /* end InitializePasteUp */ - -/*------------------------------------------------------------------------ ------------------------- crank some single input data -------------------- -------------------------------------------------------------------------*/ -static int ActivatePasteUp(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - pPasteUpDefPtr pvt = (pPasteUpDefPtr) ped->elemPvt; - PasteUpFloat *fconst = pvt->constant; - receptorPtr rcp = pet->receptor; - CARD32 bands = rcp[SRCt1].inFlo->bands; - bandPtr dbnd = &pet->emitter[0]; - mpPasteUpPvtPtr mpvt = (mpPasteUpPvtPtr) pet->private; - pointer src, dst; - PasteRectPtr tp; - CARD32 t, b; - - for(b = 0; b < bands; b++, dbnd++, mpvt++, fconst++) { - INT32 dst_width = dbnd->format->width; - - /* Get pointer for dst scanline, Fill with constant */ - if (!(dst = GetCurrentDst(flo,pet,dbnd))) - break; - - (*(mpvt->fill)) (dst,*fconst,mpvt->iconstant,dst_width); - - /* Skip any constant lines */ - if (dbnd->current < mpvt->nextline) { - while (dbnd->current < mpvt->nextline) { - if (dst = GetNextDst(flo,pet,dbnd,KEEP)) { - (*(mpvt->fill)) (dst,*fconst,mpvt->iconstant,dst_width); - } else { - PutData(flo,pet,dbnd,dbnd->current); - return TRUE; - } - } - } - - mpvt->nextline = dbnd->format->height; - tp = mpvt->rects; - for (t = 0; t < mpvt->numRects; t++, tp++){ - bandPtr sbnd = &rcp[tp->receptorIndex].band[b]; - INT32 tdy = tp->dyoff; - INT32 tdend = tdy + tp->height; - - if (!tp->active) continue; - - /* see if this src has a line for the destination */ - if ((INT32)dbnd->current >= tdy && (INT32)dbnd->current < tdend) { - - if (sbnd->threshold > 1) { - src = GetSrc(flo,pet,sbnd,sbnd->threshold - 1,KEEP); - SetBandThreshold(sbnd,1); - } else - src = GetCurrentSrc(flo,pet,sbnd); - if (!src) /* all tiles for this line should be ready */ - ImplementationError(flo, ped, return(FALSE)); - - (*(mpvt->action)) (src, tp->sxoff, dst, tp->dxoff, tp->width); - - FreeData(flo,pet,sbnd,sbnd->current+1); - if ((dbnd->current + 1) < tdend) - mpvt->nextline = dbnd->current + 1; - else - tp->active = FALSE; - } else if (tdy == (dbnd->current + 1)) { - /* Tile missed on this line but will be needed for next line */ - AttendBand(sbnd); - mpvt->nextline = dbnd->current + 1; - } else if (tdy < mpvt->nextline) { - mpvt->nextline = tdy; - } - } - - if (mpvt->nextline < dbnd->format->height) { - /* ... still more tiles to copy */ - (void) GetNextDst(flo,pet,dbnd,FLUSH); - if (mpvt->nextline != dbnd->current) { - /* ... find the Next bunch of tiles */ - tp = mpvt->rects; - for (t = 0; t < mpvt->numRects; t++, tp++) - if (tp->active && tp->dyoff == mpvt->nextline) { - AttendBand(&rcp[tp->receptorIndex].band[b]); - } - } - } else { - /* ... fill in remaining destination with constant */ - while((dst = GetNextDst(flo,pet,dbnd,KEEP))) - (*(mpvt->fill)) (dst,*fconst,mpvt->iconstant,dst_width); - PutData(flo,pet,dbnd,dbnd->current); - } - - } - return(TRUE); -} /* end ActivatePasteUp */ - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetPasteUp(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - mpPasteUpPvtPtr pvt = (mpPasteUpPvtPtr)pet->private; - CARD32 nbands = pet->receptor[SRCt1].inFlo->bands; - CARD32 b; - - /* Free any lists that were malloced */ - for (b = 0; b < nbands; b++, pvt++) - if (pvt->rects) - pvt->rects = (PasteRectPtr)XieFree(pvt->rects); - - ResetReceptors(ped); - ResetEmitter(ped); - - - return(TRUE); -} /* end ResetPasteUp */ - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyPasteUp(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.flush = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return(TRUE); -} /* end DestroyPasteUp */ - -/*------------------------------------------------------------------------ ---------------------------PasteUp fill routines ------------------------ -------------------------------------------------------------------------*/ -static void FillReal(dst,ffill,ifill,width) - RealPixel *dst; - PasteUpFloat ffill; - CARD32 ifill,width; -{ - while (width-- > 0) *dst++ = ffill; -} - -#define PasteFill(fname,stype) \ -static void fname(din,ffill,ifill,width) \ -pointer din; \ -PasteUpFloat ffill; \ -CARD32 ifill,width; \ -{ \ -stype *dst = (stype *)din, fill = (stype)ifill; \ - while (width-- > 0) *dst++ = fill; \ -} - -PasteFill(FillQuad,QuadPixel) -PasteFill(FillPair,PairPixel) -PasteFill(FillByte,BytePixel) - - -static void FillBit(dst,ffill,ifill,width) - BitPixel *dst; - PasteUpFloat ffill; - CARD32 ifill,width; -{ - memset((char *)dst, (ifill ? ~0 : 0), (width+7)>>3); -} - -/*------------------------------------------------------------------------ ---------------------------PasteUp action routines ---------------------- -------------------------------------------------------------------------*/ - -#define PasteAction(fname,stype) \ -static void fname(sin,s_off,din,d_off,width) \ -CARD32 width, s_off, d_off; \ -pointer sin, din; \ -{ \ -stype *src = (stype *)sin, *dst = (stype *)din; \ - src += s_off; \ - dst += d_off; \ - while (width-- > 0) *dst++ = *src++; \ -} - -PasteAction(PasteReal,RealPixel) -PasteAction(PasteQuad,QuadPixel) -PasteAction(PastePair,PairPixel) -PasteAction(PasteByte,BytePixel) - -static void PasteBit(sin,s_off,din,d_off,width) - CARD32 width, s_off, d_off; - pointer sin, din; -{ - LogInt * src = (LogInt *) sin; - LogInt * dst = (LogInt *) din; - for ( ; width-- > 0 ; s_off++, d_off++ ) { - if (LOG_tstbit(src,s_off)) - LOG_setbit(dst,d_off); - else - LOG_clrbit(dst,d_off); - } -} - -/* end module mppaste.c */ Index: xc/programs/Xserver/XIE/mixie/process/mppoint.c diff -u xc/programs/Xserver/XIE/mixie/process/mppoint.c:3.5 xc/programs/Xserver/XIE/mixie/process/mppoint.c:removed --- xc/programs/Xserver/XIE/mixie/process/mppoint.c:3.5 Fri Dec 14 14:58:46 2001 +++ xc/programs/Xserver/XIE/mixie/process/mppoint.c Sat Feb 28 21:42:01 2004 @@ -1,1037 +0,0 @@ -/* $Xorg: mppoint.c,v 1.4 2001/02/09 02:04:31 xorgcvs Exp $ */ -/**** module mppoint.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mppoint.c -- DDXIE point element - - Larry Hare -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mppoint.c,v 3.5 2001/12/14 19:58:46 dawes Exp $ */ - - -#define _XIEC_MPPOINT -#define _XIEC_PPOINT - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzePoint(); - -/* - * routines used internal to this module - */ -static int CreatePoint(); -static int InitializePoint(); -static int ActivatePoint(); -static int ResetPoint(); -static int DestroyPoint(); - -#if XIE_FULL -static int ActivatePointExplode(); -static int ActivatePointExplodeMsk(); -static int ActivatePointCombine(); -static int ActivatePointROI(); - -#define LUT_EXPLODE -#endif - -/* - * DDXIE Point entry points - */ -static ddElemVecRec PointVec = { - CreatePoint, - InitializePoint, - ActivatePoint, - (xieIntProc) NULL, - ResetPoint, - DestroyPoint - }; - -/* -* Local Declarations. -*/ -typedef struct _mppointdef { - void (*action) (); -#if XIE_FULL - /* below here for crazy pixels only */ - pointer (*convert) (); - pointer buffer; - CARD32 constant; - CARD8 shiftok; - CARD8 shiftamt; - CARD32 mask; /* for all 3 bands */ - CARD32 width; /* for all 3 bands */ - void (*merge) (); /* for all 3 bands */ - void (*store) (); /* for all 3 bands */ -#endif -} mpPointPvtRec, *mpPointPvtPtr; - -static void P11_bb0(), P11_bb1(); -static void P11_bb(), P11_Bb(), P11_Pb(), P11_Qb(); -static void P11_bB(), P11_BB(), P11_PB(), P11_QB(); -static void P11_bP(), P11_BP(), P11_PP(), P11_QP(); -static void P11_bQ(), P11_BQ(), P11_PQ(), P11_QQ(); - -static void (*action_pnt11[4][4])() = { - P11_bb, P11_Bb, P11_Pb, P11_Qb, /* [out=1][inp=1...4] */ - P11_bB, P11_BB, P11_PB, P11_QB, /* [out=2][inp=1...4] */ - P11_bP, P11_BP, P11_PP, P11_QP, /* [out=3][inp=1...4] */ - P11_bQ, P11_BQ, P11_PQ, P11_QQ, /* [out=4][inp=1...4] */ -}; - -#if XIE_FULL -static void Proi11_bb0(); -static void Proi11_bb(), Proi11_BB(), Proi11_PP(), Proi11_QQ(); - -static void (*action_pntroi11[4])() = { - Proi11_bb, Proi11_BB, Proi11_PP, Proi11_QQ /* [out==inp=1...4] */ -}; - -static void crazy_horse(); - -static void CPM_B3BB(), CPS_B3BB(), CPA_B3BB(); - -static void CPMRG_B(), CPMRG_P(), CPMRG_Q(); - -static void (*action_merge[3])() = { /* [intclass - 2] */ - CPMRG_B, CPMRG_P, CPMRG_Q /* [byte,pair,quad] */ -}; - -static pointer CPCNV_bB(), CPCNV_BB(); -static pointer CPCNV_bP(), CPCNV_BP(), CPCNV_PP(); -static pointer CPCNV_bQ(), CPCNV_BQ(), CPCNV_PQ(); - -static pointer (*action_convert[3][3])() = { /* [intclass-2][ii-1] */ - CPCNV_bB, CPCNV_BB, 0, /* [out=Byte] [inp=bits,byte,pair] */ - CPCNV_bP, CPCNV_BP, CPCNV_PP, /* [out=Pair] [inp=bits,byte,pair] */ - CPCNV_bQ, CPCNV_BQ, CPCNV_PQ /* [out=Quad] [inp=bits,byte,pair] */ -}; -#endif - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzePoint(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = PointVec; - return TRUE; -} - - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreatePoint(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - return MakePETex(flo,ped, - xieValMaxBands * sizeof(mpPointPvtRec), - SYNC, /* InSync: Make sure Lut exists first */ - NO_SYNC /* bandSync: see InitializePoint */ - ); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializePoint(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - xieFloPoint *raw = (xieFloPoint *)ped->elemRaw; - peTexPtr pet = ped->peTex; - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - receptorPtr rcp = pet->receptor; - CARD32 nbands = pet->receptor[SRCtag].inFlo->bands; - CARD32 lbands = pet->receptor[LUTtag].inFlo->bands; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - CARD8 msk = raw->bandMask; - BOOL bandsync = FALSE; - CARD8 passmsk, lutmask; - CARD32 band; - -#if XIE_FULL - if (nbands == 3 && lbands == 1) { - int oo = oband->format->class; - int ii = iband->format->class; - int intclass; - CARD32 c0, c1, c2, ctotal; - CARD32 iimin = ii, iimax = ii; - - pvt->width = iband->format->width; - - c1 = (iband+1)->format->class; - if (c1 > iimax) iimax = c1; else if (c1 < iimin) iimin = c1; - c2 = (iband+2)->format->class; - if (c2 > iimax) iimax = c2; else if (c2 < iimin) iimin = c2; - - /* Create CRAZY pixels by multiply/accumulate */ - if (pet->receptor[LUTtag].band[0].format->width == xieValLSFirst) { - (pvt+0)->constant = c0 = 1; - (pvt+1)->constant = c1 = (iband+0)->format->levels; - (pvt+2)->constant = c2 = (iband+0)->format->levels * - (iband+1)->format->levels; - ctotal = c2 * (iband+2)->format->levels; - } else { /* swizzle band-order MSFirst */ - (pvt+2)->constant = c2 = 1; - (pvt+1)->constant = c1 = (iband+2)->format->levels; - (pvt+0)->constant = c0 = (iband+2)->format->levels * - (iband+1)->format->levels; - ctotal = c0 * (iband+0)->format->levels; - } - - if ((c0 & (c0-1)) == 0) { - (pvt+0)->shiftamt = ffs(c0) - 1; - (pvt+0)->shiftok = 1; - } else (pvt+0)->shiftok = 0; - if ((c1 & (c1-1)) == 0) { - (pvt+1)->shiftamt = ffs(c1) - 1; - (pvt+1)->shiftok = 1; - } else (pvt+1)->shiftok = 0; - if ((c2 & (c2-1)) == 0) { - (pvt+2)->shiftamt = ffs(c2) - 1; - (pvt+2)->shiftok = 1; - } else (pvt+2)->shiftok = 0; - - if (ctotal <= 2) /* Could happen if levels were 1/1/2. pretty silly */ - ctotal = 4; - - SetDepthFromLevels(ctotal,c2); - pvt->mask = (1< BYTE -> BYTE */ - pvt->action = ((pvt+0)->shiftok && - (pvt+1)->shiftok && - (pvt+2)->shiftok) ? CPS_B3BB : CPM_B3BB; - } else { - /* Do it the hard way */ - pvt->action = crazy_horse; - if (intclass == BYTE_PIXEL && oo == BYTE_PIXEL) { - pvt->merge = CPA_B3BB; - pvt->store = 0; - } else { - pvt->merge = action_merge[intclass-2]; - pvt->store = (oband->format->levels == 1) - ? P11_bb0 - : action_pnt11[oo-1][intclass-1]; - } - for(band = 0; band < nbands; band++, pvt++, iband++) { - ii = iband->format->class; - pvt->width = iband->format->width; - /* might allocate extra space and use lut instead of multiply */ - pvt->convert = action_convert[intclass-2][ii-1]; - if (!(pvt->buffer = (pointer) - XieMalloc(pvt->width << (intclass - BYTE_PIXEL)))) - AllocError(flo,ped,return(FALSE)); - } - } - - /* protocol requires msk == ALL_BANDS */ - msk = ALL_BANDS; passmsk = NO_BANDS, lutmask = 1; bandsync = TRUE; - ped->ddVec.activate = ActivatePointCombine; - - } else if (nbands == 1 && lbands == 3) { - - for(band = 0; band < lbands; band++, pvt++, oband++) { - int oo = oband->format->class; - int ii = iband->format->class; - - if (oband->format->levels == 1) - pvt->action = P11_bb0; - else if ((iband->format->levels == 1) && (oo == BIT_PIXEL)) - pvt->action = P11_bb1; - else - pvt->action = action_pnt11[oo-1][ii-1]; - } -#if defined(LUT_EXPLODE) - if ((msk & 7) == 7) { - /* Only works when all 3 bands selected */ - msk = 1; passmsk = NO_BANDS; lutmask = ALL_BANDS; bandsync = TRUE; - ped->ddVec.activate = ActivatePointExplode; - } else -#endif - { - /* must actually activate these bands instead of using passmsk */ - ped->ddVec.activate = ActivatePointExplodeMsk; - lutmask = msk; msk = 1; passmsk = NO_BANDS; bandsync = FALSE; - rcp[SRCtag].band[0].replicate = ~msk; - } - - } else if (nbands == lbands) { - /* Standard Case. Map each band thru its own LUT */ - - if (raw->domainPhototag) { - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - int oo = oband->format->class; - - pvt->action = (oband->format->levels == 1) - ? Proi11_bb0 - : action_pntroi11[oo-1]; - } - passmsk = ~msk; lutmask = msk; - rcp[ped->inCnt-1].band[0].replicate = msk; - ped->ddVec.activate = ActivatePointROI; - } else { -#endif - for(band = 0; band < nbands; band++, pvt++, iband++, oband++) { - int oo = oband->format->class; - int ii = iband->format->class; - - if (oband->format->levels == 1) - pvt->action = P11_bb0; - else if ((iband->format->levels == 1) && (oo == BIT_PIXEL)) - pvt->action = P11_bb1; - else - pvt->action = action_pnt11[oo-1][ii-1]; - } - passmsk = ~msk; lutmask = msk; - ped->ddVec.activate = ActivatePoint; -#if XIE_FULL - } - } else - ImplementationError(flo,ped, return(FALSE)); -#endif - pet->bandSync = bandsync; - return(InitReceptor(flo,ped,&rcp[SRCtag],NO_DATAMAP,1,msk,passmsk) && - InitReceptor(flo,ped,&rcp[LUTtag],NO_DATAMAP,1,lutmask,NO_BANDS) && - (!raw->domainPhototag || - InitProcDomain(flo, ped, raw->domainPhototag, - raw->domainOffsetX, raw->domainOffsetY)) && - InitEmitter(flo, ped, NO_DATAMAP, - (raw->domainPhototag ? SRCtag : NO_INPLACE))); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ -/*------------------ (1 Band, 3 LUTS) --> (3 Bands) -------------------*/ - -#if XIE_FULL -#if defined(LUT_EXPLODE) -/* -** NOTE: -** This code was used in the SI alpha drop and works fine. However -** using our new band replication feature, we can replicate the -** image band and use the 3x3 mapping code. On the three machines -** I compared the execution times on, the results were within a few -** percent; but this code was faster. If you want to save a bit -** of code space, turn off the define LUT_EXPLODE. -*/ - -static int ActivatePointExplode(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr lband = &(pet->receptor[LUTtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - pointer lvoid0, lvoid1, lvoid2; - pointer ovoid0, ovoid1, ovoid2; - pointer ivoid; - int bw = iband->format->width; - - /* asking for 1 should fetch entire lut strip */ - lvoid0 = GetSrcBytes(flo,pet,lband,0,1,FALSE); lband++; - lvoid1 = GetSrcBytes(flo,pet,lband,0,1,FALSE); lband++; - lvoid2 = GetSrcBytes(flo,pet,lband,0,1,FALSE); - - if (!lvoid0 || !lvoid1 || !lvoid2) - ImplementationError(flo,ped, return(FALSE)); - - ivoid = GetCurrentSrc(flo,pet,iband); - ovoid0 = GetCurrentDst(flo,pet,oband); oband++; - ovoid1 = GetCurrentDst(flo,pet,oband); oband++; - ovoid2 = GetCurrentDst(flo,pet,oband); oband -= 2; - while (!ferrCode(flo) && ivoid && ovoid0 && ovoid1 && ovoid2) { - - (*((pvt+0)->action)) (ivoid, ovoid0, lvoid0, bw); - (*((pvt+1)->action)) (ivoid, ovoid1, lvoid1, bw); - (*((pvt+2)->action)) (ivoid, ovoid2, lvoid2, bw); - - ivoid = GetNextSrc(flo,pet,iband,TRUE); - ovoid0 = GetNextDst(flo,pet,oband,TRUE); oband++; - ovoid1 = GetNextDst(flo,pet,oband,TRUE); oband++; - ovoid2 = GetNextDst(flo,pet,oband,TRUE); oband -= 2; - } - FreeData(flo, pet, iband, iband->current); - if (iband->final) { - FreeData(flo, pet, lband ,lband->current); lband--; - FreeData(flo, pet, lband ,lband->current); lband--; - FreeData(flo, pet, lband ,lband->current); - } - return TRUE; -} -#endif - -static int ActivatePointExplodeMsk(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - xieFloPoint *raw = (xieFloPoint *)ped->elemRaw; - int band, nbands = pet->receptor[LUTtag].inFlo->bands; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr lband = &(pet->receptor[LUTtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - CARD8 msk = raw->bandMask; - pointer lvoid; - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++, lband++) { - register int bw = iband->format->width; - pointer ivoid, ovoid; - - if ((msk & (1<strip)) - return(FALSE); - } while(GetSrc(flo,pet,iband,iband->maxLocal,FLUSH)); - FreeData(flo,pet,iband,iband->maxLocal); - } - continue; - } - - /* Or process similar to ordinary Point code. */ - if (!(lvoid = GetSrcBytes(flo,pet,lband,0,1,FALSE)) || - !(ivoid = GetCurrentSrc(flo,pet,iband)) || - !(ovoid = GetCurrentDst(flo,pet,oband))) continue; - - do { - (*(pvt->action)) (ivoid, ovoid, lvoid, bw); - ivoid = GetNextSrc(flo,pet,iband,TRUE); - ovoid = GetNextDst(flo,pet,oband,TRUE); - } while (!ferrCode(flo) && ivoid && ovoid) ; - - FreeData(flo, pet, iband, iband->current); - if (iband->final) - FreeData(flo, pet, lband, lband->current); - } - return TRUE; -} - -/*------------------ (3 Band, 1 LUTS) --> (1 Bands) -------------------*/ - -static int ActivatePointCombine(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr lband = &(pet->receptor[LUTtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - pointer ivoid0, ivoid1, ivoid2, lvoid, ovoid; - - /* asking for 1 should fetch entire lut strip */ - if (!(lvoid = GetSrcBytes(flo,pet,lband,0,1,FALSE))) - return FALSE; - - ovoid = GetCurrentDst(flo,pet,oband); - ivoid0 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid1 = GetCurrentSrc(flo,pet,iband); iband++; - ivoid2 = GetCurrentSrc(flo,pet,iband); iband -= 2; - - while (!ferrCode(flo) && ovoid && ivoid0 && ivoid1 && ivoid2) { - - (*(pvt->action)) (ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt); - - ovoid = GetNextDst(flo,pet,oband,TRUE); - ivoid0 = GetNextSrc(flo,pet,iband,TRUE); iband++; - ivoid1 = GetNextSrc(flo,pet,iband,TRUE); iband++; - ivoid2 = GetNextSrc(flo,pet,iband,TRUE); iband -= 2; - } - - FreeData(flo, pet, iband, iband->current); iband++; - FreeData(flo, pet, iband, iband->current); iband++; - FreeData(flo, pet, iband, iband->current); - - if (iband->final) - FreeData(flo, pet, lband, lband->current); - - return TRUE; -} - -/*------------------ (3 Band, 3 LUTS, ROI) --> (3 Bands) -------------------*/ -/*------------------ (1 Band, 1 LUTS, ROI) --> (1 Bands) -------------------*/ - -static int ActivatePointROI(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - int band, nbands = pet->receptor[LUTtag].inFlo->bands; /* ??? */ - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr lband = &(pet->receptor[LUTtag].band[0]); - bandPtr rband = &(pet->receptor[ped->inCnt-1].band[0]); - bandPtr oband = &(pet->emitter[0]); - pointer lvoid; - - for(band=0; band < nbands; band++,pvt++,iband++,oband++,lband++,rband++) { - pointer ivoid, ovoid; - - /* 1 should fetch entire lut strip */ - if (!(lvoid = GetSrcBytes(flo,pet,lband,0,1,FALSE)) || - !(ivoid = GetCurrentSrc(flo,pet,iband)) || - !(ovoid = GetCurrentDst(flo,pet,oband))) continue; - - while (!ferrCode(flo) && ivoid && ovoid && - SyncDomain(flo,ped,oband,FLUSH)) { - INT32 run, currentx = 0; - - if(ivoid != ovoid) memcpy(ovoid, ivoid, oband->pitch); - - while (run = GetRun(flo,pet,oband)) { - if (run > 0) { - (*(pvt->action)) (ovoid, lvoid, run, currentx); - currentx += run; - } else - currentx -= run; - } - - ivoid = GetNextSrc(flo,pet,iband,TRUE); - ovoid = GetNextDst(flo,pet,oband,TRUE); - } - - FreeData(flo, pet, iband, iband->current); - if (iband->final) - FreeData(flo, pet, lband, lband->current); - } - return TRUE; -} -#endif - -/*------------------ (3 Band, 3 LUTS) --> (3 Bands) -------------------*/ -/*------------------ (1 Band, 1 LUTS) --> (1 Bands) -------------------*/ - -static int ActivatePoint(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpPointPvtPtr pvt = (mpPointPvtPtr) pet->private; - int band, nbands = pet->receptor[LUTtag].inFlo->bands; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr lband = &(pet->receptor[LUTtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - pointer lvoid; - - for(band = 0; band < nbands; band++, pvt++, iband++, oband++, lband++) { - register int bw = iband->format->width; - pointer ivoid, ovoid; - - /* 1 should fetch entire lut strip */ - if (!(lvoid = GetSrcBytes(flo,pet,lband,0,1,FALSE)) || - !(ivoid = GetCurrentSrc(flo,pet,iband)) || - !(ovoid = GetCurrentDst(flo,pet,oband))) continue; - - do { - (*(pvt->action)) (ivoid, ovoid, lvoid, bw); - ivoid = GetNextSrc(flo,pet,iband,TRUE); - ovoid = GetNextDst(flo,pet,oband,TRUE); - } while (!ferrCode(flo) && ivoid && ovoid) ; - - FreeData(flo, pet, iband, iband->current); - if (iband->final) - FreeData(flo, pet, lband, lband->current); - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetPoint(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -#if XIE_FULL - mpPointPvtPtr pvt = (mpPointPvtPtr) (ped->peTex->private); - int band; - - /* free any dynamic private data */ - if (pvt) - for (band = 0 ; band < xieValMaxBands ; band++, pvt++) - if (pvt->buffer) - pvt->buffer = (pointer) XieFree(pvt->buffer); -#endif - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyPoint(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* get rid of the peTex structure */ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -/* -** bitonal ---> LUT ---> bitonal (only 4 possibilities) -*/ - -static void -P11_bb(INP,OUTP,LUTP,bw) - pointer INP; pointer OUTP; pointer LUTP; int bw; -{ - unsigned char *lutp = (unsigned char *) LUTP; - - if (*lutp++ == 0) { - if (*lutp == 0) - action_clear (OUTP, bw, 0); - else - passcopy_bit (OUTP, INP, bw, 0); - } else if (*lutp == 0) { - passcopy_bit (OUTP, INP, bw, 0); - action_invert (OUTP, bw, 0); - } else - action_set (OUTP, bw, 0); -} - -/* -** bitonal ---> LUT ---> bitonal (input is single level) -*/ - -static void -P11_bb1(INP,OUTP,LUTP,bw) - pointer INP; pointer OUTP; pointer LUTP; int bw; -{ - CARD8 *lutp = (CARD8 *) LUTP; - - if (*lutp) action_set(OUTP, bw, 0); - else action_clear(OUTP, bw, 0); -} - -/* -** anything ---> LUT ---> bitonal (output is single level) -*/ - -static void -P11_bb0(INP,OUTP,LUTP,bw) - pointer INP; pointer OUTP; pointer LUTP; int bw; -{ - action_clear(OUTP, bw, 0); -} - -/* -** DO_P11b - single band, single lut, bit to bit -** DO_P11c - single band, single lut, consume bits -** DO_P11x - single band, single lut, consume bits (to bytes only) -** DO_P11p - single band, single lut, produce bits -** DO_P11 - single band, single lut, non-bit versions -*/ - -#define DO_P11b(fd_do,itype,otype) /* see P11_bb, P11_bb1, P11_bb0 above */ - -#define DO_P11c(fn_do,itype,otype) \ -static void \ -fn_do(INP,OUTP,LUTP,bw) \ - pointer INP; pointer OUTP; pointer LUTP; int bw; \ -{ \ - LogInt *inp = (LogInt *) INP; \ - otype *outp = (otype *) OUTP; \ - otype *lutp = (otype *) LUTP; \ - otype loval = lutp[0], hival = lutp[1]; \ - LogInt M, inval; \ - for ( ; bw >= LOGSIZE ; bw -= LOGSIZE) \ - for (M=LOGLEFT, inval = *inp++; M; LOGRIGHT(M)) \ - *outp++ = (inval & M) ? hival : loval; \ - if (bw > 0) \ - for (M=LOGLEFT, inval = *inp++; bw; bw--, LOGRIGHT(M)) \ - *outp++ = (inval & M) ? hival : loval; \ -} -#define DO_P11p(fn_do,itype,otype) \ -static void \ -fn_do(INP,OUTP,LUTP,bw) \ - pointer INP; pointer OUTP; pointer LUTP; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - LogInt *outp = (LogInt *) OUTP, M, outval; \ - unsigned char *lutp = (unsigned char *) LUTP; \ - for ( ; bw >= LOGSIZE ; *outp++ = outval, bw -= LOGSIZE) \ - for (M=LOGLEFT, outval = 0; M; LOGRIGHT(M)) \ - if (lutp[*inp++]) \ - outval |= M; \ - if (bw > 0) { \ - for (M=LOGLEFT, outval = 0; bw; bw--, LOGRIGHT(M)) \ - if (lutp[*inp++]) \ - outval |= M; \ - *outp++ = outval; \ - } \ -} - -#define DO_P11x(fn_do,itype,otype) \ -static void \ -fn_do(INP,OUTP,LUTP,bw) \ - pointer INP; pointer OUTP; pointer LUTP; int bw; \ -{ \ - otype *lutp = (otype *) LUTP; \ - bitexpand(INP,OUTP,bw, lutp[0], lutp[1]); \ -} - -#define DO_P11(fn_do,itype,otype) \ -static void \ -fn_do(INP,OUTP,LUTP,bw) \ - pointer INP; pointer OUTP; pointer LUTP; int bw; \ -{ \ - itype *inp = (itype *) INP; \ - otype *outp = (otype *) OUTP; \ - otype *lutp = (otype *) LUTP; \ - while (bw-- > 0) *outp++ = lutp[*inp++]; \ -} - -/* -** DO_P11b - bit to bit -** DO_P11c - consume bits -** DO_P11x - consume bits (faster bit eXpander for bytes only) -** DO_P11p - produce bits -** DO_P11 - non-bit versions -*/ - -DO_P11b (P11_bb, BitPixel, BitPixel) -DO_P11p (P11_Bb, BytePixel, BitPixel) -DO_P11p (P11_Pb, PairPixel, BitPixel) -DO_P11p (P11_Qb, QuadPixel, BitPixel) - -DO_P11x (P11_bB, BitPixel, BytePixel) -DO_P11 (P11_BB, BytePixel, BytePixel) -DO_P11 (P11_PB, PairPixel, BytePixel) -DO_P11 (P11_QB, QuadPixel, BytePixel) - -DO_P11c (P11_bP, BitPixel, PairPixel) -DO_P11 (P11_BP, BytePixel, PairPixel) -DO_P11 (P11_PP, PairPixel, PairPixel) -DO_P11 (P11_QP, QuadPixel, PairPixel) - -DO_P11c (P11_bQ, BitPixel, QuadPixel) -DO_P11 (P11_BQ, BytePixel, QuadPixel) -DO_P11 (P11_PQ, PairPixel, QuadPixel) -DO_P11 (P11_QQ, QuadPixel, QuadPixel) - -/*------------------------------------------------------------------------ ---------------------- ROI operations work on subranges ------------------ -------------------------------------------------------------------------*/ -#if XIE_FULL -/* -** The Proi11_XX routines only map within a single type. By making new -** routines here, instead of using the P11_XX routines above, it -** may be easier to optimize the more important P11_XX routines by -** virtue of starting on nicely aligned boundaries. -*/ - -static void -Proi11_bb0(INP,LUTP,run,ix) - pointer INP; pointer LUTP; int run; int ix; -{ - action_clear (INP, run, ix); -} - -static void -Proi11_bb(INP,LUTP,run,ix) - pointer INP; pointer LUTP; int run; int ix; -{ - CARD8 *lutp = (CARD8 *) LUTP; - - if (*lutp++ == 0) { - if (*lutp == 0) action_clear (INP, run, ix); - } else if (*lutp == 0) action_invert (INP, run, ix); - else action_set (INP, run, ix); -} - -#define ROI_P11(fn_do,iotype) \ -static void \ -fn_do(INP,LUTP,run,ix) \ - pointer INP; pointer LUTP; INT32 run; INT32 ix; \ -{ \ - iotype *inp = ((iotype *) INP) + ix; \ - iotype *lutp = (iotype *) LUTP; \ - while (run-- > 0) { *inp = lutp[*inp]; inp++; } \ -} - -ROI_P11 (Proi11_BB, BytePixel) -ROI_P11 (Proi11_PP, PairPixel) -ROI_P11 (Proi11_QQ, QuadPixel) -#endif - -/*------------------------------------------------------------------------ ---------------------- Crazy Pixels Action Routines --------------------- -------------------------------------------------------------------------*/ -#if XIE_FULL -/* -** The Activate routine will nominally call this routine to do all -** the necessary moderation per scanline. However in the typical -** case of going from a triple byte to a single byte image, one of the -** CPM_B3BB or CPS_B3BB routines will get called instead. -*/ - -static void -crazy_horse(ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt) - pointer ivoid0, ivoid1, ivoid2, lvoid, ovoid; - mpPointPvtPtr pvt; -{ - ivoid0 = (*(pvt->convert)) (ivoid0, pvt); pvt++; - ivoid1 = (*(pvt->convert)) (ivoid1, pvt); pvt++; - ivoid2 = (*(pvt->convert)) (ivoid2, pvt); pvt -= 2; - if (pvt->store) { - (*(pvt->merge)) (ivoid0, ivoid1, ivoid2, lvoid, pvt->buffer, pvt); - (*(pvt->store)) (pvt->buffer, ovoid, lvoid, pvt->width); - } else - (*(pvt->merge)) (ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt); -} - -/* -** Some cpu's are not to good at multiplies, so we need two versions. -*/ - -#define MakeCrazyPix(name, itype, otype, OP, field) \ -static void \ -name(ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt) \ - pointer ivoid0, ivoid1, ivoid2, lvoid, ovoid; \ - mpPointPvtPtr pvt; \ -{ \ - itype *i0 = (itype *) ivoid0; \ - itype *i1 = (itype *) ivoid1; \ - itype *i2 = (itype *) ivoid2; \ - otype *l = (otype *) lvoid; \ - otype *o = (otype *) ovoid; \ - CARD32 c0 = (pvt+0)->field; \ - CARD32 c1 = (pvt+1)->field; \ - CARD32 c2 = (pvt+2)->field; \ - CARD32 msk = pvt->mask; \ - CARD32 bw = pvt->width; \ - CARD32 j; \ - for (j = 0; j < bw; j++) \ - *o++ = l[((i0[j] OP c0) + (i1[j] OP c1) + (i2[j] OP c2)) & msk];\ -} - -#define MakeCrazyMergeLut(name, itype, otype) \ -static void \ -name(ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt) \ - pointer ivoid0, ivoid1, ivoid2, lvoid, ovoid; \ - mpPointPvtPtr pvt; \ -{ \ - itype *i0 = (itype *) ivoid0; \ - itype *i1 = (itype *) ivoid1; \ - itype *i2 = (itype *) ivoid2; \ - otype *l = (otype *) lvoid; \ - otype *o = (otype *) ovoid; \ - CARD32 msk = pvt->mask; \ - CARD32 bw = pvt->width; \ - CARD32 j; \ - for (j = 0; j < bw; j++) \ - *o++ = l[(i0[j] + i1[j] + i2[j]) & msk]; \ -} - -#define MakeCrazyMerge(name, iotype) \ -static void \ -name(ivoid0, ivoid1, ivoid2, lvoid, ovoid, pvt) \ - pointer ivoid0, ivoid1, ivoid2, lvoid, ovoid; \ - mpPointPvtPtr pvt; \ -{ \ - iotype *i0 = (iotype *) ivoid0; \ - iotype *i1 = (iotype *) ivoid1; \ - iotype *i2 = (iotype *) ivoid2; \ - iotype *op = (iotype *) ovoid; \ - CARD32 msk = pvt->mask; \ - CARD32 bw = pvt->width; \ - CARD32 j; \ - for (j = 0; j < bw; j++) \ - op[j] = (i0[j] + i1[j] + i2[j]) & msk; \ -} - -#define MakeCrazyConvert(name, itype, otype) \ -static pointer \ -name(ivoid,pvt) \ - pointer ivoid; \ - mpPointPvtPtr pvt; \ -{ \ - itype *i = (itype *) ivoid; \ - otype *o = (otype *) pvt->buffer; \ - CARD32 c = pvt->constant; \ - CARD32 bw = pvt->width; \ - if ( (sizeof(itype) == sizeof(otype)) && (c == 1)) \ - return ivoid; \ - if (pvt->shiftok) \ - for (c = pvt->shiftamt ; bw > 0; bw--) *o++ = *i++ << c; \ - else \ - for ( ; bw > 0; bw--) *o++ = *i++ * c; \ - return pvt->buffer; \ -} - -static pointer -CPCNV_bB(ivoid,pvt) - pointer ivoid; - mpPointPvtPtr pvt; -{ - bitexpand(ivoid, pvt->buffer, pvt->width, 0, pvt->constant); - return pvt->buffer; -} - -#define MakeCrazyConvertBit(name, otype) \ -static pointer \ -name(ivoid,pvt) \ - pointer ivoid; \ - mpPointPvtPtr pvt; \ -{ \ - LogInt *i = (LogInt *) ivoid, ival, M; \ - otype *o = (otype *) pvt->buffer; \ - CARD32 c = pvt->constant; \ - int bw = pvt->width; \ - int nw = bw >> LOGSHIFT; \ - for ( ; nw > 0; nw--) \ - for (ival = *i++, M=LOGLEFT; M ; LOGRIGHT(M)) \ - *o++ = (ival & M) ? c : 0; \ - if ((bw &= LOGMASK)) \ - for (ival = *i, M=LOGLEFT; bw > 0 ; bw--, LOGRIGHT(M)) \ - *o++ = (ival & M) ? c : 0; \ - return pvt->buffer; \ -} - - -MakeCrazyPix (CPM_B3BB, BytePixel, BytePixel, *, constant) -MakeCrazyPix (CPS_B3BB, BytePixel, BytePixel, <<, shiftamt) -MakeCrazyMergeLut (CPA_B3BB, BytePixel, BytePixel ) -MakeCrazyMerge (CPMRG_B, BytePixel) -MakeCrazyMerge (CPMRG_P, PairPixel) -MakeCrazyMerge (CPMRG_Q, QuadPixel) - - -MakeCrazyConvert (CPCNV_BB, BytePixel, BytePixel) -MakeCrazyConvert (CPCNV_BP, BytePixel, PairPixel) -MakeCrazyConvert (CPCNV_BQ, BytePixel, QuadPixel) -MakeCrazyConvert (CPCNV_PP, PairPixel, PairPixel) -MakeCrazyConvert (CPCNV_PQ, PairPixel, QuadPixel) -MakeCrazyConvertBit (CPCNV_bP, PairPixel) -MakeCrazyConvertBit (CPCNV_bQ, QuadPixel) -#endif - -/* end module mppoint.c */ Index: xc/programs/Xserver/XIE/mixie/process/mprgb.c diff -u xc/programs/Xserver/XIE/mixie/process/mprgb.c:3.5 xc/programs/Xserver/XIE/mixie/process/mprgb.c:removed --- xc/programs/Xserver/XIE/mixie/process/mprgb.c:3.5 Fri Dec 14 14:58:46 2001 +++ xc/programs/Xserver/XIE/mixie/process/mprgb.c Sat Feb 28 21:42:01 2004 @@ -1,1345 +0,0 @@ -/* $Xorg: mprgb.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ -/**** module mprgb.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mprgb.c -- DDXIE Convert To/From RGB elements - - Larry Hare -- AGE Logic, Inc. August, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mprgb.c,v 3.5 2001/12/14 19:58:46 dawes Exp $ */ - - -#define _XIEC_MPRGB -#define _XIEC_PCFRGB -#define _XIEC_PCTRGB - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include -#include - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeToRGB(); -int miAnalyzeFromRGB(); - -/* - * routines used internal to this module - */ - -static int CreateToRGB(); -static int InitializeToRGB(); -static int SetupToRGB(); - -static int CreateFromRGB(); -static int InitializeFromRGB(); -static int SetupFromRGB(); - -static int ResetRGB(); -static int DestroyRGB(); -static void ClearRGB(); -static void CheckRGB(); - -static int ActivateRGB(); - -/* - * DDXIE Convert To/From RGB element entry points. - */ -static ddElemVecRec ToRGBVec = { - CreateToRGB, - InitializeToRGB, - ActivateRGB, - (xieIntProc) NULL, - ResetRGB, - DestroyRGB - }; - -static ddElemVecRec FromRGBVec = { - CreateFromRGB, - InitializeFromRGB, - ActivateRGB, - (xieIntProc) NULL, - ResetRGB, - DestroyRGB - }; - -/* -** Local Declarations. -** NOTE: use #define EARLY_SETUP to do setup at create time -** NOTE: uses RGBFloat's for matrix multiply. -*/ - -#define EARLY_SETUP -typedef RealPixel RGBFloat; - -typedef struct _mprgbdef { - void (*action) (); /* every one needs these */ - void (*post) (); /* clipping, or CIELab, for floats */ - CARD32 iclip[3]; /* clip values for integers */ - pointer (*cvt_in[3])(); /* !0 if need to expand input */ - pointer (*cvt_out[3])(); /* !0 if need to compress output */ - pointer aux_buf[3]; /* used for cvt_in/cvt_out */ - RGBFloat matrix[12]; - INT32 imatrix[12]; -} mpRGBPvtRec, *mpRGBPvtPtr; - -/* -** NOTES on BASIC ALGORITHM: -** 1) All transforms center on a matrix. Either a passed in XYZMAT -** or one synthesized from Luma values. -** 2) White Point adjustments, if specified are applied to this matrix. -** 3) Bias (YCbCr) or Implicit Biasing and Scaling (YCC) are applied. -** (Float to Float stops here, matmul is done as floats) -** 4) If inputs are integers, a scale is applied to reduce input -** input numbers to range 0.0 to 1.0. -** (Int to Float stops here, matmul is done as floats) -** 5) If outputs are integers, a scale is applied to expand values -** back to output range. For tripleband with all 256 levels -** for inputs and outputs, this cancels step 4. But allows -** for mapping say an (8,8,4) image to say (16,4,4). This -** final matrix is turned into a scaled fraction integer matrix. -** (Int to Int stops here, matmul is done as scaled fractions) -*/ - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeToRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = ToRGBVec; - return TRUE; -} - -int miAnalyzeFromRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = FromRGBVec; - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int -CreateToRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - if (!MakePETex(flo,ped,sizeof(mpRGBPvtRec), NO_SYNC, SYNC)) - return FALSE; - -#if defined(EARLY_SETUP) - if (!SetupToRGB(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - return TRUE; -} - -static int -CreateFromRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - /* always force syncing between inputs (is nop if only one input) */ - if (!MakePETex(flo,ped,sizeof(mpRGBPvtRec), NO_SYNC, SYNC)) - return FALSE; - -#if defined(EARLY_SETUP) - if (!SetupFromRGB(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ - -static int -InitializeToRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -#if !defined(EARLY_SETUP) - if (!SetupToRGB(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - InitReceptors(flo, ped, NO_DATAMAP, 1); - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE); - - return !ferrCode(flo); -} - -static int -InitializeFromRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ -#if !defined(EARLY_SETUP) - if (!SetupFromRGB(flo, ped, 0 /* modify ?? */)) - return FALSE; -#endif - - InitReceptors(flo, ped, NO_DATAMAP, 1); - InitEmitter(flo, ped, NO_DATAMAP, NO_INPLACE); - - return !ferrCode(flo); -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - -static int -ActivateRGB(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpRGBPvtPtr pvt = (mpRGBPvtPtr) pet->private; - bandPtr sband = &(pet->receptor[SRCt1].band[0]); - bandPtr dband = &(pet->emitter[0]); - CARD32 npix = sband->format->width; - pointer svoid[3], dvoid[3], stvoid[3], dtvoid[3]; - CARD32 b; - BOOL stop; - - for (b = 0; b < 3; b++, sband++, dband++) { - if (!(svoid[b] = GetCurrentSrc(flo,pet,sband))) - return TRUE; - if (!(dvoid[b] = GetCurrentDst(flo,pet,dband))) - return TRUE; - stvoid[b] = pvt->cvt_in[b] - ? (*pvt->cvt_in[b]) (pvt->aux_buf[b], svoid[b], pvt, npix) - : svoid[b] ; - dtvoid[b] = pvt->cvt_out[b] ? pvt->aux_buf[b] : dvoid[b]; - } sband -= 3; dband -= 3; - - do { - - (*(pvt->action)) (dtvoid, stvoid, pvt, npix); - - if (pvt->post) (*(pvt->post)) (dtvoid, npix); - - for (b = 0, stop = FALSE; b < 3; b++, sband++, dband++) { - if (pvt->cvt_out[b]) - (*pvt->cvt_out[b]) (dvoid[b], dtvoid[b], pvt, npix); - stop |= !(svoid[b] = GetNextSrc(flo,pet,sband,FLUSH)); - stop |= !(dvoid[b] = GetNextDst(flo,pet,dband,FLUSH)); - if (!stop) { - dtvoid[b] = pvt->cvt_out[b] ? dtvoid[b] : dvoid[b]; - stvoid[b] = pvt->cvt_in[b] - ? (*pvt->cvt_in[b]) (stvoid[b], svoid[b], pvt, npix) - : svoid[b] ; - } - } sband -= 3; dband -= 3; - - } while (!ferrCode(flo) && !stop) ; - - for (b = 0; b < 3; b++, sband++) { - FreeData(flo, pet, sband, sband->current); - } sband -= 3; - - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int -ResetRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - -#if !defined(EARLY_SETUP) - ClearRGB(flo, ped); -#endif - - ResetReceptors(ped); - ResetProcDomain(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int -DestroyRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - -#if defined(EARLY_SETUP) - ClearRGB(flo, ped); -#endif - - /* get rid of the peTex structure and private structures */ - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- Action Utility Routines ----------------------- -------------------------------------------------------------------------*/ - -/* - * Used for CIELab conversions. - * - * NOTE: Investigate use of stock cbrt() function in libc. - * NOTE: Borrowed from lib/X/XcmsMath.h - * NOTE: Copyright 1990 The Open Group - * - * NOTE: Investigate use of stock cbrt() function in libc. - * NOTE: Used better choice of seed values with emphasis on - * range of 0 to 1, and other smallish numbers. - */ - -#if !defined(XCMS_CUBEROOT) -#define XCMS_CUBEROOT _cmsCubeRoot - -/* Newton's Method: x_n+1 = x_n - ( f(x_n) / f'(x_n) ) */ -/* for cube roots, x^3 - a = 0, x_new = x - 1/3 (x - a/x^2) */ -#ifndef DBL_EPSILON -#define DBL_EPSILON 1e-6 -#endif - -double -_cmsCubeRoot(a) - double a; -{ - register double abs_a, cur_guess, delta; - if (a == 0.) - return 0.; - - /* convert to positive to speed loop tests */ - abs_a = a < 0. ? -a : a; - - /* arbitrary first guess */ - cur_guess = abs_a < 1. ? 0.5 + .500 * abs_a : - abs_a < 1000. ? 1.0 + .125 * abs_a : - 10.0 + .0125 * abs_a ; - do { - delta = (cur_guess - abs_a/(cur_guess*cur_guess))/3.; - cur_guess -= delta; - if (delta < 0.) delta = -delta; - } while (delta >= cur_guess*DBL_EPSILON); - - return a > 0. ? cur_guess : -cur_guess; -} -#endif - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -/* (*(pvt->cvt_out)) (dvoid, svoid, pvt, npix); */ -/* (*(pvt->cvt_in)) (dvoid, svoid, pvt, npix); */ -/* (*(pvt->action)) (dvoid, svoid, pvt, npix); */ -/* (*(pvt->post)) (dvoid, npix); */ - -static pointer -cvt_bit_to_pair(dvoid,svoid,pvt,npix) - pointer dvoid, svoid; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - LogInt *bitp = (LogInt *) svoid, ival, M; - PairPixel *pairp = (PairPixel *) dvoid; - int nw = npix >> LOGSHIFT; - for ( ; nw > 0; nw--) - for (ival = *bitp++, M=LOGLEFT; M ; LOGRIGHT(M)) - *pairp++ = (ival & M) ? (PairPixel) 1 : (PairPixel) 0; - if ((npix &= LOGMASK)) - for (ival = *bitp, M=LOGLEFT; npix > 0 ; npix--, LOGRIGHT(M)) - *pairp++ = (ival & M) ? (PairPixel) 1 : (PairPixel) 0; - return dvoid; -} - -static pointer -cvt_byte_to_pair(dvoid,svoid,pvt,npix) - pointer dvoid, svoid; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - BytePixel *bytep = (BytePixel *) svoid; - PairPixel *pairp = (PairPixel *) dvoid; - for ( ; npix > 0; npix--) - *pairp++ = *bytep++; - return dvoid; -} - -static pointer -cvt_pair_to_byte(dvoid,svoid,pvt,npix) - pointer dvoid, svoid; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - PairPixel *pairp = (PairPixel *) svoid; - BytePixel *bytep = (BytePixel *) dvoid; - for ( ; npix > 0; npix--) - *bytep++ = *pairp++; /* already hard-clipped!! */ - return dvoid; -} - -static pointer -cvt_pair_to_bit(dvoid,svoid,pvt,npix) - pointer dvoid, svoid; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - PairPixel *pairp = (PairPixel *) svoid; - LogInt *bitp = (LogInt *) dvoid, bitval, M; - for ( ; npix >= LOGSIZE; *bitp++ = bitval, npix -= LOGSIZE) - for (M=LOGLEFT, bitval = 0; M; LOGRIGHT(M)) - if (*pairp++) - bitval |= M; - if (npix > 0) { - for (M=LOGLEFT, bitval = 0; npix > 0; npix--, LOGRIGHT(M)) - if (*pairp++) - bitval |= M; - *bitp = bitval; - } - return dvoid; -} - -static void -act_mmRR(dvoid, svoid, pvt, npix) - RealPixel *svoid[3], *dvoid[3]; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - RGBFloat *mtrx = &(pvt->matrix[0]); - RGBFloat r, g, b; - CARD32 i; - - /* - ** dvector = matrix * svector - */ - for (i = 0; i < npix; i++) { - r = svoid[0][i]; - g = svoid[1][i]; - b = svoid[2][i]; - dvoid[0][i] = mtrx[0] * r + mtrx[1] * g + mtrx[2] * b; - dvoid[1][i] = mtrx[3] * r + mtrx[4] * g + mtrx[5] * b; - dvoid[2][i] = mtrx[6] * r + mtrx[7] * g + mtrx[8] * b; - } -} - -#define MakeIntFltMatMul(name, itype) \ -static void \ -name(dvoid, svoid, pvt, npix) \ - itype *svoid[3]; \ - RealPixel *dvoid[3]; \ - mpRGBPvtPtr pvt; \ - CARD32 npix; \ -{ \ - RealPixel *mtrx = &(pvt->matrix[0]); \ - RealPixel r, g, b, rr, gg, bb; \ - CARD32 i; \ - \ - for (i = 0; i < npix; i++) { \ - r = (RealPixel) svoid[0][i]; \ - g = (RealPixel) svoid[1][i]; \ - b = (RealPixel) svoid[2][i]; \ - rr = mtrx[0] * r + mtrx[1] * g + mtrx[2] * b; \ - gg = mtrx[3] * r + mtrx[4] * g + mtrx[5] * b; \ - bb = mtrx[6] * r + mtrx[7] * g + mtrx[8] * b; \ - dvoid[0][i] = rr; \ - dvoid[1][i] = gg; \ - dvoid[2][i] = bb; \ - } \ -} - -MakeIntFltMatMul(act_mmBR, BytePixel) -MakeIntFltMatMul(act_mmPR, PairPixel) - -#define MakeIntIntMatMul(name, iotype, shift) \ -static void \ -name(dvoid, svoid, pvt, npix) \ - iotype *svoid[3], *dvoid[3]; \ - mpRGBPvtPtr pvt; \ - CARD32 npix; \ -{ \ - INT32 *mtrx = &(pvt->imatrix[0]); \ - INT32 r, g, b, rr, gg, bb; \ - CARD32 iclip0 = pvt->iclip[0]; \ - CARD32 iclip1 = pvt->iclip[1]; \ - CARD32 iclip2 = pvt->iclip[2]; \ - INT32 bias0 = mtrx[9] + (1 << (shift-1)); \ - INT32 bias1 = mtrx[10] + (1 << (shift-1)); \ - INT32 bias2 = mtrx[11] + (1 << (shift-1)); \ - CARD32 i; \ - \ - for (i = 0; i < npix; i++) { \ - r = svoid[0][i]; \ - g = svoid[1][i]; \ - b = svoid[2][i]; \ - rr = mtrx[0] * r + mtrx[1] * g + mtrx[2] * b + bias0; \ - gg = mtrx[3] * r + mtrx[4] * g + mtrx[5] * b + bias1; \ - bb = mtrx[6] * r + mtrx[7] * g + mtrx[8] * b + bias2; \ - if (rr < 0) rr = 0; \ - if (gg < 0) gg = 0; \ - if (bb < 0) bb = 0; \ - if ((rr >>= shift) > iclip0) rr = iclip0; \ - if ((gg >>= shift) > iclip1) gg = iclip1; \ - if ((bb >>= shift) > iclip2) bb = iclip2; \ - dvoid[0][i] = rr; \ - dvoid[1][i] = gg; \ - dvoid[2][i] = bb; \ - } \ -} - -#define SF_BYTESHIFT 20 -#define SF_PAIRSHIFT 12 -MakeIntIntMatMul(act_mmBB, BytePixel, SF_BYTESHIFT) -MakeIntIntMatMul(act_mmPP, PairPixel, SF_PAIRSHIFT) - - -static void -act_postClipR(dvoid, npix) - RealPixel *dvoid[3]; -{ - RGBFloat *fp, f, zero = (RGBFloat) 0.0, one = (RGBFloat) 1.0; - CARD32 ipix, band; - - for (band = 0; band < 3; band++) { - fp = dvoid[band]; - for (ipix = npix; ipix > 0; ipix--, fp++) { - f = *fp; - if ( f < zero) *fp = zero; - if ( f > one) *fp = one; - } - } -} - -static void -act_postCIELab(dvoid, npix) - RealPixel *dvoid[3]; -{ - RGBFloat *xp, *yp, *zp, x3, y3, z3; - CARD32 ipix; - - xp = dvoid[0]; - yp = dvoid[1]; - zp = dvoid[2]; - for (ipix = npix; ipix > 0; ipix--) { - - /* XXX, if numbers are small, do some more work */ - x3 = XCMS_CUBEROOT((double)*xp); - y3 = XCMS_CUBEROOT((double)*yp); - z3 = XCMS_CUBEROOT((double)*zp); - - *xp++ = 116.0 * y3 - 16.0; /* L* */ - *yp++ = 500.0 * (x3 - y3); /* a* */ - *zp++ = 200.0 * (y3 - z3); /* b* */ - } -} - -static void -act_preCIELab(dvoid, svoid, pvt, npix) - RealPixel *svoid[3], *dvoid[3]; - mpRGBPvtPtr pvt; - CARD32 npix; -{ - RGBFloat *Lp, *ap, *bp, *xp, *yp, *zp, L, a, b; - CARD32 ipix; - - /* must be careful not to smash the source */ - Lp = svoid[0]; ap = svoid[1]; bp = svoid[2]; - xp = dvoid[0]; yp = dvoid[1]; zp = dvoid[2]; - - for (ipix = npix; ipix > 0; ipix--) { - - /* XXX, if numbers are small, do some more work */ - L = (*Lp++ + 16.0) * (1.0 / 116.0); - a = L + (*ap++ * 0.002); - b = L - (*bp++ * 0.005); - - *yp++ = (L * L * L); /* Y = ... */ - *xp++ = (a * a * a); /* X = ... */ - *zp++ = (b * b * b); /* Z = ... */ - } - act_mmRR(dvoid, dvoid, pvt, npix); -} - -/*------------------------------------------------------------------------ --------------------- utility routines for initialization ---------------- -------------------------------------------------------------------------*/ - -/* Scale entire matrix by single scale factor */ - -static void -scale_mtrx(mtx,imtx,iscl) - RGBFloat *mtx; - INT32 *imtx; - CARD32 iscl; -{ - RGBFloat fscl = iscl; - int i; - - for (i = 0; i < 12; i++) - *imtx++ = *mtx++ * fscl; -} - -/* Scale each row of matrix by respective factors */ - -void -scale_rows(mtrx,scale1,scale2,scale3) - RGBFloat *mtrx; - double scale1, scale2, scale3; -{ - int b; - for (b = 0; b < 3; b++) *mtrx++ *= scale1; - for (b = 0; b < 3; b++) *mtrx++ *= scale2; - for (b = 0; b < 3; b++) *mtrx++ *= scale3; -} - -/* Scale each column of matrix by respective factors */ - -void -scale_columns(mtrx,scale1,scale2,scale3) - RGBFloat *mtrx; - double scale1, scale2, scale3; -{ - int b; - for (b = 0; b < 3; b++) { - *mtrx++ *= scale1; - *mtrx++ *= scale2; - *mtrx++ *= scale3; - } -} - -/* -** Our matrix routines for integers use a BIAS like so: -** YCC = MATRIX * RGB - BIAS -** But when we are going back to RGB we would have liked to do: -** RGB = MATRIX * (YCC - BIAS) -** So we multiply do transitive property of matrix arithmetic -** to get a new BIAS' (BIAS' = -MATRIX * BIAS) such that: -** RGB = MATRIX * YCC - MATRIX * BIAS = MATRIX * YCC - BIAS' -*/ -static void -flip_bias(mtx) - RGBFloat *mtx; -{ - RGBFloat mtx9, mtx10, mtx11; - mtx9 = -(mtx[0] * mtx[9] + mtx[1] * mtx[10] + mtx[2] * mtx[11]); - mtx10 = -(mtx[3] * mtx[9] + mtx[4] * mtx[10] + mtx[5] * mtx[11]); - mtx11 = -(mtx[6] * mtx[9] + mtx[7] * mtx[10] + mtx[8] * mtx[11]); - - mtx[9] = mtx9; - mtx[10] = mtx10; - mtx[11] = mtx11; -} - - - -/* Seed matrix for CIEXYZ and CIELab */ - -static void -copymatrix(pvt,input) - mpRGBPvtPtr pvt; - double *input; -{ - RGBFloat *mtrx = pvt->matrix; - int i; - - for (i = 0; i < 9; i++) - *mtrx++ = *input++; - - for (; i < 12; i++) - *mtrx++ = 0.0; /* bias */ -} - -static void -copywhiteLABFromRGB(pvt,tec,vec) - mpRGBPvtPtr pvt; - xieTypWhiteAdjustTechnique tec; - double *vec; -{ - RGBFloat *mtrx = pvt->matrix; - double a, b, c; - - switch (tec) { - case xieValWhiteAdjustCIELabShift: a = vec[0]; - b = vec[1]; - c = vec[2]; - break; - - case xieValWhiteAdjustDefault: - case xieValWhiteAdjustNone: /* calculate from pvt->matrix */ - a = mtrx[0] + mtrx[1] + mtrx[2]; - b = mtrx[3] + mtrx[4] + mtrx[5]; - c = mtrx[6] + mtrx[7] + mtrx[8]; - break; - - default: return; - } - - if (a < .0001) return; - if (b < .0001) return; - if (c < .0001) return; - scale_rows (mtrx, 1.0 / a, 1.0 / b, 1.0 / c); - return; -} - -static void -copywhiteLABToRGB(pvt,tec,vec) - mpRGBPvtPtr pvt; - xieTypWhiteAdjustTechnique tec; - double *vec; -{ - RGBFloat *mtrx = pvt->matrix; - double a, b, c; - switch (tec) { - case xieValWhiteAdjustCIELabShift: a = vec[0]; - b = vec[1]; - c = vec[2]; - break; - - case xieValWhiteAdjustDefault: - case xieValWhiteAdjustNone: - { /* White Point comes from XYZ Matrix. Must invert it first */ - RGBFloat *m = mtrx - 1; /* number matrix from 1 to 9 */ - double determinant = m[1] * (m[5]*m[9] - m[6]*m[8]) - - m[2] * (m[4]*m[9] - m[6]*m[7]) + - m[3] * (m[4]*m[8] - m[5]*m[7]); - a = (m[5]*m[9]-m[6]*m[8]); /* inv[00] */ - a += -(m[2]*m[9]-m[3]*m[8]); /* inv[01] */ - a += (m[2]*m[6]-m[3]*m[5]); /* inv[02] */ - b = -(m[4]*m[9]-m[6]*m[7]); /* inv[10] */ - b += (m[1]*m[9]-m[3]*m[7]); /* inv[11] */ - b += -(m[1]*m[6]-m[3]*m[4]); /* inv[12] */ - c = (m[4]*m[8]-m[5]*m[7]); /* inv[20] */ - c += -(m[1]*m[8]-m[2]*m[7]); /* inv[21] */ - c += (m[1]*m[5]-m[2]*m[4]); /* inv[22] */ - - a /= (determinant ? determinant : 1.0); - b /= (determinant ? determinant : 1.0); - c /= (determinant ? determinant : 1.0); - } - break; - - default: return; - } - scale_columns (pvt->matrix, a, b, c); - return; -} - -static void -copywhiteXYZFromRGB(pvt,tec,vec) - mpRGBPvtPtr pvt; - xieTypWhiteAdjustTechnique tec; - double *vec; -{ - switch (tec) { - case xieValWhiteAdjustCIELabShift: break; - case xieValWhiteAdjustDefault: return; - case xieValWhiteAdjustNone: return; - default: return; - } - if (vec[0] < .0001) return; - if (vec[1] < .0001) return; - if (vec[2] < .0001) return; - - scale_rows (pvt->matrix, 1.0 / vec[0], 1.0 / vec[1], 1.0 / vec[2]); -} - -static void -copywhiteXYZToRGB(pvt,tec,vec) - mpRGBPvtPtr pvt; - xieTypWhiteAdjustTechnique tec; - double *vec; -{ - switch (tec) { - case xieValWhiteAdjustCIELabShift: break; - case xieValWhiteAdjustDefault: return; - case xieValWhiteAdjustNone: return; - default: return; - } - scale_columns (pvt->matrix, vec[0], vec[1], vec[2]); -} - -static void -copygamut(pvt,tec) - mpRGBPvtPtr pvt; - xieTypGamutTechnique tec; -{ - if (tec == xieValGamutClipRGB) - pvt->post = act_postClipR; -} - -static void -copybiasYCbCr(pvt,bias0,bias1,bias2) - mpRGBPvtPtr pvt; - double bias0, bias1, bias2; -{ - pvt->matrix[9] = bias0; - pvt->matrix[10] = bias1; - pvt->matrix[11] = bias2; -} - -static void -copylumaYCbCrfromRGB(pvt,LumaRed,LumaGreen,LumaBlue) - mpRGBPvtPtr pvt; - double LumaRed,LumaGreen,LumaBlue; -{ - RGBFloat *mtrx = pvt->matrix; - - if (LumaRed < .01) LumaRed = .01; - if (LumaGreen < .01) LumaGreen = .01; - if (LumaBlue < .01) LumaBlue = .01; - if (LumaRed > .99) LumaRed = .99; - if (LumaGreen > .99) LumaGreen = .99; - if (LumaBlue > .99) LumaBlue = .99; - - /* - ** FROM TIFF 6.0 - ** - ** Y = (LumaRed*R + LumaGreen * G + LumaBlue * B) - ** Cb = (B - Y) / (2 - 2*LumaBlue) - ** Cr = (R - Y) / (2 - 2*LumaRed) - ** - ** Cb = .5 * (B - (Lr*R + Lg*G + Lb*B)) / (1 - Lb) - ** Cb = .5B/(1-Lb) - .5(Lr*R + Lg*G + Lb*B)) / (1-Lb) - ** Cb = .5B/(1-Lb) - .5 Lr*R/(1-Lb) -.5 Lg*G/(1-Lb) -.5 Lb*B/(1-Lb) - ** Cb = .5B(1-Lb)/(1-Lb) -.5 Lr*R/(1-Lb) -.5 Lg*G/(1-Lb) - ** Cb = .5B -.5 Lr*R/(1-Lb) -.5 Lg*G/(1-Lb) - */ - mtrx[0] = LumaRed; - mtrx[1] = LumaGreen; - mtrx[2] = LumaBlue; - mtrx[3] = -0.5 * LumaRed / (1.0 - LumaBlue); - mtrx[4] = -0.5 * LumaGreen / (1.0 - LumaBlue); - mtrx[5] = 0.5; - mtrx[6] = 0.5; - mtrx[7] = -0.5 * LumaGreen / (1.0 - LumaRed); - mtrx[8] = -0.5 * LumaBlue / (1.0 - LumaRed); - - mtrx[9] = mtrx[10] = mtrx[11] = 0.0; /* bias */ -} - -static void -copylumaYCbCrtoRGB(pvt,LumaRed,LumaGreen,LumaBlue) - mpRGBPvtPtr pvt; - double LumaRed,LumaGreen,LumaBlue; -{ - RGBFloat *mtrx = pvt->matrix; - - /* should/could check that LumaRed + LumaGreen + LumaBlue approx == 1.0 */ - - if (LumaGreen < .01) LumaGreen = .01; - if (LumaGreen > .99) LumaGreen = .99; - - /* - ** FROM TIFF 6.0 - ** - ** R = Cr * (2 - 2 * LumaRed) + Y - ** G = (Y - LumaBlue * B - LumaRed * R) / LumaGreen - ** B = Cb * (2 - 2 * LumaBlue) + Y - ** - ** G = (Y - Lb*(Cb*(2-2*Lb) + Y) - Lr*(Cr*(2-2*Lr) + Y) ) / Lg - ** G = (Y - Lb*Cb*(2-2*Lb) - Lb*Y - Lr*Cr*(2-2*Lr) - Lr*Y ) / Lg - ** G = ((1 - Lb - Lr)*Y - 2*Lb*(1-Lb)*Cb - 2*Lr*(1-Lr)*Cr ) / Lg - ** - ** R = 1 * Y + 0 * Cb + (2 - 2 * LumaRed) * Cr - ** G = 1 * Y + ... - ** B = 1 * Y + (2 - 2 * LumaBlue) * Cb + 0 * Cr - ** - ** note: mtrx[3] == 1.0 when LR+LG+LB==1.0 - */ - mtrx[0] = 1.0; - mtrx[1] = 0.0; - mtrx[2] = 2.0 - 2.0 * LumaRed; - - mtrx[3] = (1.0 - LumaRed - LumaBlue) / LumaGreen; - mtrx[4] = -2.0 * LumaBlue * (1.0 - LumaBlue) / LumaGreen; - mtrx[5] = -2.0 * LumaRed * (1.0 - LumaRed ) / LumaGreen; - - mtrx[6] = 1.0; - mtrx[7] = 2.0 - 2.0 * LumaBlue; - mtrx[8] = 0.0; - - mtrx[9] = mtrx[10] = mtrx[11] = 0.0; /* bias */ - -} - -static void -copylumaYCCfromRGB(pvt,LumaRed,LumaGreen,LumaBlue,Scale,oband) - mpRGBPvtPtr pvt; - double LumaRed,LumaGreen,LumaBlue,Scale; - bandPtr oband; -{ - RGBFloat *mtrx = pvt->matrix; - - if (LumaGreen < .01) LumaGreen = .01; - - /* - ** See "A Planning Guide For Developers" from KODAK PhotoCD Products. - ** Typical CCIR601.1 values of (.299, .587, .114) are used for - ** (LumaRed,LumaGreen,LumaBlue). - ** - ** Y = ( LumaRed*R + LumaGreen * G + LumaBlue * B) - ** C1 = ( -LumaRed*R - LumaGreen * G + (1-LumaBlue) * B) - ** C2 = ((1-LumaRed)*R - LumaGreen * G + -LumaBlue * B) - ** - ** From the same paper we are treated with the following equations - ** for packing 8bit pixels: - ** - ** PACK: UMPACK - ** Y' = 255/1.402 * Y Y = 1.3584 * Y' - ** C1' = 111.40 * C1 + 156 C1 = 2.2179 * (C1' - 156) - ** C2' = 135.64 * C2 + 137 C2 = 1.8215 * (C2' - 137) - ** - ** Extrapolating a bit we can see that this is: - ** - ** Y' = 255/1.402 * Y - ** C1' = 255/2.289 * C1 + (.612 * 255) <2.289 = 1.402 * 1.6327 > - ** C2' = 255/1.879 * C2 + (.537 * 255) <1.879 = 1.402 * 1.3409 > - ** - ** Y = 1.3584 * Y' - ** C1 = 1.3584 * 1.6327 * (C1' - (.612*255)) - ** C2 = 1.3584 * 1.3409 * (C2' - (.537*255)) - ** - ** So we are left with a choice between the magic 1.402 and 1.3584 - ** values. Hey, better idea. Its now an XIE protocol parameter - ** called "scale". - ** - ** In future versions, its possible we will want to accept the 1.3584 - ** number as a technique parameter in addition to the Luma. - */ - mtrx[0] = LumaRed; - mtrx[1] = LumaGreen; - mtrx[2] = LumaBlue; - mtrx[3] = -LumaRed; - mtrx[4] = -LumaGreen; - mtrx[5] = 1.0 - LumaBlue; - mtrx[6] = 1.0 - LumaRed; - mtrx[7] = -LumaGreen; - mtrx[8] = -LumaBlue; - - if (IsConstrained(oband->format->class)) { - - /* Scale each row of matrix by compression factors */ - scale_rows (mtrx, 1.0 / (Scale ), - 1.0 / (Scale * 1.6327), - 1.0 / (Scale * 1.3409)); - - /* Bias expressed as fraction of pixel range */ - mtrx[9] = 0.0; - mtrx[10] = 0.612 * (RGBFloat) ((oband+1)->format->levels-1); - mtrx[11] = 0.5373 * (RGBFloat) ((oband+2)->format->levels-1); - } -} - -static void -copylumaYCCtoRGB(pvt,LumaRed,LumaGreen,LumaBlue,Scale,iband) - mpRGBPvtPtr pvt; - double LumaRed,LumaGreen,LumaBlue,Scale; - bandPtr iband; -{ - RGBFloat *mtrx = pvt->matrix; - - if (LumaGreen < .01) LumaGreen = .01; - - /* - ** See "A Planning Guide For Developers" from KODAK PhotoCD Products. - ** Typical values of (.299, .587, .114) are used for (LR,LG,LB). - ** - ** R = 1 * Y + 0 * C1 + 1 * C2 - ** G = 1 * Y - .194 * C1 - .509 * C2 - ** B = 1 * Y + 1 * C1 + 0 * C2 - ** - ** By inverting the matrix symbolically we can deduce that the - ** constants .194 and .509 are not arbitrary: - ** - ** R = 1 * Y + 0 * C1 + 1 * C2 - ** G = 1 * Y - LB/LG * C1 - LR/LG * C2 - ** B = 1 * Y + 1 * C1 + 0 * C2 - ** - ** Note: mtrx[3] == 1.0 when LR+LG+LB==1.0 - */ - mtrx[0] = 1.0; - mtrx[1] = 0.0; - mtrx[2] = 1.0; - - mtrx[3] = (1.0 - LumaRed - LumaBlue) / LumaGreen; - mtrx[4] = - LumaBlue/LumaGreen; - mtrx[5] = - LumaRed/LumaGreen; - - mtrx[6] = 1.0; - mtrx[7] = 1.0; - mtrx[8] = 0.0; - - if (IsConstrained(iband->format->class)) { - - /* Scale each column of matrix by compression factors */ - scale_columns (mtrx, Scale, (Scale * 1.6327), (Scale * 1.3409)); - - /* Bias expressed as fraction of pixel range */ - mtrx[9] = 0.0; - mtrx[10] = 0.612 * (RGBFloat) ((iband+1)->format->levels-1); - mtrx[11] = 0.5373 * (RGBFloat) ((iband+2)->format->levels-1); - } - -} - -/*------------------------------------------------------------------------ --------------------------- initialize element . . . ---------------------- -------------------------------------------------------------------------*/ - -static int -SetupToRGB(flo,ped,modify) - floDefPtr flo; - peDefPtr ped; - int modify; -{ - peTexPtr pet = ped->peTex; - mpRGBPvtPtr pvt = (mpRGBPvtPtr) pet->private; - pTecCIEToRGBDefPtr pCIE = (pTecCIEToRGBDefPtr) ped->techPvt; - pTecYCCToRGBDefPtr pYCC = (pTecYCCToRGBDefPtr) ped->techPvt; - pTecYCbCrToRGBDefPtr pYCb = (pTecYCbCrToRGBDefPtr) ped->techPvt; - - pvt->action = act_mmRR; - pvt->post = 0; - - switch(ped->techVec->number) { - case xieValCIELabToRGB: - /* if whiteAdjusted, or calculate from inverted matrix */ - copymatrix(pvt, pCIE->matrix); - copywhiteLABToRGB (pvt, pCIE->whiteAdjusted, pCIE->whitePoint); - copygamut (pvt, pCIE->gamutCompress); - pvt->action = act_preCIELab; /* calls act_mmRR */ - break; - case xieValCIEXYZToRGB: - copymatrix(pvt, pCIE->matrix); - copywhiteXYZToRGB (pvt, pCIE->whiteAdjusted, pCIE->whitePoint); - copygamut (pvt, pCIE->gamutCompress); - break; - case xieValYCbCrToRGB: - copylumaYCbCrtoRGB(pvt, pYCb->red, pYCb->green, pYCb->blue); - copybiasYCbCr(pvt, pYCb->bias0, pYCb->bias1, pYCb->bias2); - copygamut(pvt, pYCb->gamutCompress); - break; - case xieValYCCToRGB: - copylumaYCCtoRGB(pvt, pYCC->red, pYCC->green, pYCC->blue, - pYCC->scale, &(pet->receptor[SRCtag].band[0])); - copygamut (pvt, pYCC->gamutCompress); - break; - } - - CheckRGB(flo,ped,FALSE); - - return TRUE; -} - -static int -SetupFromRGB(flo,ped,modify) - floDefPtr flo; - peDefPtr ped; - int modify; -{ - peTexPtr pet = ped->peTex; - mpRGBPvtPtr pvt = (mpRGBPvtPtr) pet->private; - pTecRGBToCIEDefPtr pCIE = (pTecRGBToCIEDefPtr) ped->techPvt; - pTecRGBToYCCDefPtr pYCC = (pTecRGBToYCCDefPtr) ped->techPvt; - pTecRGBToYCbCrDefPtr pYCb = (pTecRGBToYCbCrDefPtr) ped->techPvt; - - pvt->action = act_mmRR; - pvt->post = (void (*)()) 0; - - switch(ped->techVec->number) { - case xieValRGBToCIELab: - copymatrix(pvt, pCIE->matrix); - copywhiteLABFromRGB(pvt, pCIE->whiteAdjusted, - pCIE->whitePoint); - pvt->post = act_postCIELab; - break; - case xieValRGBToCIEXYZ: - copymatrix(pvt, pCIE->matrix); - copywhiteXYZFromRGB(pvt, pCIE->whiteAdjusted, - pCIE->whitePoint); - break; - case xieValRGBToYCbCr: - copylumaYCbCrfromRGB(pvt, pYCb->red, pYCb->green, pYCb->blue); - copybiasYCbCr(pvt, pYCb->bias0, pYCb->bias1, pYCb->bias2); - break; - case xieValRGBToYCC: - copylumaYCCfromRGB(pvt, pYCC->red, pYCC->green, pYCC->blue, - pYCC->scale, &(pet->emitter[0])); - break; - } - - CheckRGB(flo,ped,TRUE); - - return TRUE; -} - -static void -CheckRGB(flo,ped,fromrgb) - floDefPtr flo; - peDefPtr ped; - Bool fromrgb; -{ - peTexPtr pet = ped->peTex; - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - bandPtr oband = &(pet->emitter[0]); - CARD32 nbands = pet->receptor[SRCtag].inFlo->bands; - mpRGBPvtPtr pvt = (mpRGBPvtPtr) pet->private; - - CARD32 c, cmin, cmax, l, lmin, lmax; - CARD32 band; - - pvt->cvt_in[0] = pvt->cvt_in[1] = pvt->cvt_in[2] = (pointer (*)()) 0; - pvt->cvt_out[0] = pvt->cvt_out[1] = pvt->cvt_out[2] = (pointer (*)()) 0; - pvt->aux_buf[0] = pvt->aux_buf[1] = pvt->aux_buf[2] = (pointer) 0; - - if (IsntConstrained(iband->format->class)) { - /* Already set up to activate floating routine */ - return; - } - - cmin = PAIR_PIXEL; cmax = BIT_PIXEL; - lmin = (1<<24); lmax = 1; - - for (band = 0; band < nbands; band++, iband++, oband++) { - - c = iband->format->class; - if (c < cmin) cmin = c; - if (c > cmax) cmax = c; - - l = iband->format->levels; - if (l < lmin) lmin = l; - if (l > lmax) lmax = l; - - if (IsntConstrained(oband->format->class)) - continue; - - c = oband->format->class; - if (c < cmin) cmin = c; - if (c > cmax) cmax = c; - - l = oband->format->levels; - if (l < lmin) lmin = l; - if (l > lmax) lmax = l; - - } iband -= 3; oband -= 3; - - - /* Scale each column of matrix to scale from input levels to 0 ... 1 */ - scale_columns (pvt->matrix, - (double) (1.0 / ((iband+0)->format->levels - 1)), - (double) (1.0 / ((iband+1)->format->levels - 1)), - (double) (1.0 / ((iband+2)->format->levels - 1))); - - if (IsntConstrained(oband->format->class)) { - - /* Only RGBtoCIEXYZ and RGBtoCIELab will Unconstrain the data */ - - if (lmin > (1<<1) && lmax <= (1<<8)) { /* ALL Bytes */ - pvt->action = act_mmBR; - return; - } - - pvt->action = act_mmPR; - if (lmin > (1<<8)) /* ALL Pairs */ - return; - - for (band = 0; band < nbands; band++, iband++) { /* SOME Pairs */ - int levels = iband->format->levels; - if (levels <= (1<<8)) { - pvt->cvt_in[band] = levels < (1<<1) - ? cvt_bit_to_pair - : cvt_byte_to_pair; - pvt->aux_buf[band] = (pointer) - XieMalloc( iband->format->width * sizeof(PairPixel)); - if (!pvt->aux_buf[band]) - AllocError(flo,ped,return); - } - } iband -= 3; - return; - } - - /* If we got to here, we will implicitly HardClip the outputs */ - pvt->post = (void (*)()) 0; - - pvt->iclip[0] = (oband+0)->format->levels - 1; - pvt->iclip[1] = (oband+1)->format->levels - 1; - pvt->iclip[2] = (oband+2)->format->levels - 1; - - /* Scale each row of matrix to map output from 0...1 to 0...nlev-1 */ - scale_rows (pvt->matrix, (double) ((oband+0)->format->levels - 1), - (double) ((oband+1)->format->levels - 1), - (double) ((oband+2)->format->levels - 1)); - - /* Adjust bias for integer YCbCr and YCC */ - if (!fromrgb) switch (ped->techVec->number) { - case xieValRGBToYCC: /* fall thru */ - case xieValRGBToYCbCr: flip_bias(pvt->matrix); - break; - default: break; - } - - if (lmin > (1<<1) && lmax <= (1<<8)) { /* ALL Bytes */ - pvt->action = act_mmBB; - scale_mtrx(pvt->matrix,pvt->imatrix,(1<action = act_mmPP; - scale_mtrx(pvt->matrix,pvt->imatrix,(1< (1<<8)) /* ALL Pairs */ - return; - - for (band = 0; band < nbands; band++, iband++, oband++) { - int levels; - levels = iband->format->levels; - pvt->cvt_in[band] = levels <= (1<<1) ? cvt_bit_to_pair : - levels <= (1<<8) ? cvt_byte_to_pair : - (pointer (*)()) 0; - levels = oband->format->levels; - pvt->cvt_out[band] = levels <= (1<<1) ? cvt_pair_to_bit : - levels <= (1<<8) ? cvt_pair_to_byte : - (pointer (*)()) 0; - if ( pvt->cvt_in[band] || pvt->cvt_out[band]) { - pvt->aux_buf[band] = (pointer) - XieMalloc( iband->format->width * sizeof(PairPixel)); - if (!pvt->aux_buf[band]) - AllocError(flo,ped,return); - } - } iband -= 3; oband -= 3; - return; -} - -static void -ClearRGB(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - mpRGBPvtPtr pvt = (mpRGBPvtPtr) ped->peTex->private; - - if (!pvt) - return; - - pvt->cvt_in[0] = pvt->cvt_in[1] = pvt->cvt_in[2] = (pointer (*)()) 0; - pvt->cvt_out[0] = pvt->cvt_out[1] = pvt->cvt_out[2] = (pointer (*)()) 0; - - if (pvt->aux_buf[0]) pvt->aux_buf[0] = (pointer) XieFree(pvt->aux_buf[0]); - if (pvt->aux_buf[1]) pvt->aux_buf[1] = (pointer) XieFree(pvt->aux_buf[1]); - if (pvt->aux_buf[2]) pvt->aux_buf[2] = (pointer) XieFree(pvt->aux_buf[2]); -} - -/* end module mprgb.c */ Index: xc/programs/Xserver/XIE/mixie/process/mpuncnst.c diff -u xc/programs/Xserver/XIE/mixie/process/mpuncnst.c:3.5 xc/programs/Xserver/XIE/mixie/process/mpuncnst.c:removed --- xc/programs/Xserver/XIE/mixie/process/mpuncnst.c:3.5 Fri Dec 14 14:58:46 2001 +++ xc/programs/Xserver/XIE/mixie/process/mpuncnst.c Sat Feb 28 21:42:01 2004 @@ -1,314 +0,0 @@ -/* $Xorg: mpuncnst.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ -/**** module mpuncnst.c ****/ -/****************************************************************************** - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -***************************************************************************** - - mpuncnst.c -- DDXIE Unconstrain element - - Dean Verheiden && Larry Hare -- AGE Logic, Inc. May, 1993 - -*****************************************************************************/ -/* $XFree86: xc/programs/Xserver/XIE/mixie/process/mpuncnst.c,v 3.5 2001/12/14 19:58:46 dawes Exp $ */ - - -#define _XIEC_MPUNCNST -#define _XIEC_PUNCNST - -/* - * Include files - */ - -/* - * Core X Includes - */ -#include -#include -/* - * XIE Includes - */ -#include -#include -/* - * more X server includes. - */ -#include -#include -/* - * Server XIE Includes - */ -#include -#include -#include -#include -#include -#include - - -/* - * routines referenced by other DDXIE modules - */ -int miAnalyzeUnconstrain(); - -/* - * routines used internal to this module - */ -static int CreateUnconstrain(); -static int InitializeUnconstrain(); -static int ActivateUnconstrain(); -static int ResetUnconstrain(); -static int DestroyUnconstrain(); - -/* - * DDXIE Unconstrain entry points - */ -static ddElemVecRec UnconstrainVec = { - CreateUnconstrain, - InitializeUnconstrain, - ActivateUnconstrain, - (xieIntProc)NULL, - ResetUnconstrain, - DestroyUnconstrain -}; - -/* - * Local Declarations. - */ - -typedef struct _mpuncnstndef { - void (*action) (); -} mpUncnstPvtRec, *mpUncnstPvtPtr; - -static void CastQuad(), CastPair(), CastByte(), CastBit(), CastNothing(); - -/*------------------------------------------------------------------------ ------------------------- fill in the vector --------------------------- -------------------------------------------------------------------------*/ -int miAnalyzeUnconstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ped->ddVec = UnconstrainVec; - return TRUE; -} - -/*------------------------------------------------------------------------ ----------------------------- create peTex . . . -------------------------- -------------------------------------------------------------------------*/ -static int CreateUnconstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - int auxsize = xieValMaxBands * sizeof(mpUncnstPvtRec); - - return MakePETex(flo,ped,auxsize,NO_SYNC,NO_SYNC); -} - -/*------------------------------------------------------------------------ ----------------------------- initialize peTex . . . ---------------------- -------------------------------------------------------------------------*/ -static int InitializeUnconstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - peTexPtr pet = ped->peTex; - mpUncnstPvtPtr pvt = (mpUncnstPvtPtr) pet->private; - bandPtr iband; - int band, nbands, status; - - /* ped->flags.modified = FALSE; */ - - status = InitReceptors(flo,ped,NO_DATAMAP,1) && - InitEmitter(flo,ped,NO_DATAMAP,-1); - - nbands = pet->receptor[SRCtag].inFlo->bands; - iband = &(pet->receptor[SRCtag].band[0]); - - for(band = 0; band < nbands; band++, pvt++, iband++) { - switch (iband->format->class) { - case QUAD_PIXEL: pvt->action = CastQuad; break; - case PAIR_PIXEL: pvt->action = CastPair; break; - case BYTE_PIXEL: pvt->action = CastByte; break; - case BIT_PIXEL: pvt->action = (iband->format->levels == 1) - ? CastNothing : CastBit; - break; - default: ImplementationError(flo, ped, return(FALSE)); - break; - } - } - return status; -} - -/*------------------------------------------------------------------------ ------------------------------ crank some data ---------------------------- -------------------------------------------------------------------------*/ - - -static int ActivateUnconstrain(flo,ped,pet) - floDefPtr flo; - peDefPtr ped; - peTexPtr pet; -{ - mpUncnstPvtPtr pvt = (mpUncnstPvtPtr) pet->private; - bandPtr oband = &(pet->emitter[0]); - bandPtr iband = &(pet->receptor[SRCtag].band[0]); - int band, nbands = pet->receptor[SRCtag].inFlo->bands; - - for(band = 0; band < nbands; band++, iband++, oband++, pvt++) { - register int bw = iband->format->width; - register RealPixel *outp; - register pointer voidp; - - if (!(voidp = GetCurrentSrc(flo,pet,iband)) || - !(outp = (RealPixel*)GetCurrentDst(flo,pet,oband))) continue; - - do { - - (*(pvt->action)) (voidp, outp, bw); - - voidp = GetNextSrc(flo,pet,iband,TRUE); - outp = (RealPixel*)GetNextDst(flo,pet,oband,TRUE); - - } while (!ferrCode(flo) && voidp && outp) ; - - FreeData(flo, pet, iband, iband->current); - } - return TRUE; -} - -/*------------------------------------------------------------------------ ------------------------- get rid of run-time stuff ----------------------- -------------------------------------------------------------------------*/ -static int ResetUnconstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - ResetReceptors(ped); - ResetEmitter(ped); - return TRUE; -} - -/*------------------------------------------------------------------------ --------------------------- get rid of this element ----------------------- -------------------------------------------------------------------------*/ -static int DestroyUnconstrain(flo,ped) - floDefPtr flo; - peDefPtr ped; -{ - if(ped->peTex) - ped->peTex = (peTexPtr) XieFree(ped->peTex); - - /* zap this element's entry point vector */ - ped->ddVec.create = (xieIntProc)NULL; - ped->ddVec.initialize = (xieIntProc)NULL; - ped->ddVec.activate = (xieIntProc)NULL; - ped->ddVec.reset = (xieIntProc)NULL; - ped->ddVec.destroy = (xieIntProc)NULL; - - return TRUE; -} - -/*------------------------------------------------------------------------ ---------------------- Lotsa Little Action Routines --------------------- -------------------------------------------------------------------------*/ - -#define MakeCast(fn_name,itype) \ -static void fn_name(voidp,outp,bw) \ - pointer voidp; RealPixel *outp; int bw; \ -{ \ - register itype *inp = (itype *) voidp; \ - register int ix; \ - for (ix = 0; ix < bw; ix++) \ - *outp++ = (RealPixel) *inp++; \ -} - -MakeCast (CastQuad,QuadPixel) -MakeCast (CastPair,PairPixel) -MakeCast (CastByte,BytePixel) - -static void CastBit(voidp,outp,bw) - pointer voidp; RealPixel *outp; int bw; -{ - register LogInt *inp = (LogInt *) voidp; - register RealPixel One = (RealPixel) 1.0; - register RealPixel Zero = (RealPixel) 0.0; - register LogInt M, inval; - for ( ; bw >= LOGSIZE ; bw -= 32) - for (M=LOGLEFT, inval = *inp++; M; LOGRIGHT(M)) - *outp++ = (inval & M) ? One : Zero; - if (bw) - for (M=LOGLEFT, inval = *inp++; bw; bw--, LOGRIGHT(M)) - *outp++ = (inval & M) ? One : Zero; -} - -static void CastNothing(voidp,outp,bw) - pointer voidp; RealPixel *outp; int bw; -{ - register RealPixel Zero = (RealPixel) 0.0; - register int ix; - for (ix = 0; ix < bw; ix++) - outp[ix] = Zero; -} - -/* end module mpuncnst.c */ Index: xc/programs/Xserver/XTrap/xtrapdi.c diff -u xc/programs/Xserver/XTrap/xtrapdi.c:1.5 xc/programs/Xserver/XTrap/xtrapdi.c:1.7 --- xc/programs/Xserver/XTrap/xtrapdi.c:1.5 Wed Sep 18 13:11:47 2002 +++ xc/programs/Xserver/XTrap/xtrapdi.c Tue Oct 28 17:52:10 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/XTrap/xtrapdi.c,v 1.5 2002/09/18 17:11:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/XTrap/xtrapdi.c,v 1.7 2003/10/28 22:52:10 tsi Exp $ */ /***************************************************************************** Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA X11R6 Changes Copyright (c) 1994 by Robert Chesler of Absol-Puter, Hudson, NH. @@ -152,7 +152,9 @@ static Bool key_ignore = False; /* The global "keymaster" */ static Bool ignore_grabs = False; static CARD8 next_key = XEKeyIsClear; /* Echo, Clear, or Other */ +#ifdef VECTORED_EVENTS static INT16 current_screen = -1L; /* Current screen for events */ +#endif static INT16 vectored_requests[256L] = {0L}; /* cnt of vectoring clients */ static INT16 vectored_events[KeyPress+MotionNotify] = {0L}; typedef struct _client_list @@ -208,8 +210,9 @@ next_key = XEKeyIsClear; } - +#ifdef VECTORED_EVENTS current_screen = -1L; /* Invalidate current screen */ +#endif #ifdef VERBOSE ErrorF("%s: Client '%d' Disconnected\n", XTrapExtName, @@ -376,7 +379,7 @@ (XETrapType = CreateNewResourceType(XETrapDestroyEnv)) == 0L) { ErrorF("%s: Setup can't create new resource type (%d,%d,%d)\n", - XTrapExtName, a,XETrapClass,XETrapType); + XTrapExtName, (int)a,(int)XETrapClass,(int)XETrapType); return; } /* initialize the GetAvailable info reply here */ @@ -512,7 +515,9 @@ } } +#ifdef VECTORED_EVENTS current_screen = -1L; /* Invalidate current screen */ +#endif #ifdef VERBOSE if (status == Success) Index: xc/programs/Xserver/Xext/EVI.c diff -u xc/programs/Xserver/Xext/EVI.c:3.9 xc/programs/Xserver/Xext/EVI.c:3.11 --- xc/programs/Xserver/Xext/EVI.c:3.9 Sat Oct 27 23:32:50 2001 +++ xc/programs/Xserver/Xext/EVI.c Tue Oct 28 18:08:43 2003 @@ -21,7 +21,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/EVI.c,v 3.9 2001/10/28 03:32:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/EVI.c,v 3.11 2003/10/28 23:08:43 tsi Exp $ */ #include "X.h" #include "Xproto.h" @@ -31,8 +31,13 @@ #define _XEVI_SERVER_ #include "XEVIstr.h" #include "EVIstruct.h" +#include "modinit.h" + +#if 0 static unsigned char XEVIReqCode = 0; +#endif static EviPrivPtr eviPriv; + static int ProcEVIQueryVersion(ClientPtr client) { @@ -74,6 +79,7 @@ visual1++; \ } \ } + static int ProcEVIGetVisualInfo(ClientPtr client) { @@ -109,6 +115,7 @@ eviPriv->freeVisualInfo(eviInfo, conflict); return (client->noClientException); } + static int ProcEVIDispatch(ClientPtr client) { @@ -122,15 +129,16 @@ return BadRequest; } } + static int -SProcEVIQueryVersion(client) -ClientPtr client; +SProcEVIQueryVersion(ClientPtr client) { REQUEST(xEVIQueryVersionReq); int n; swaps(&stuff->length, n); return ProcEVIQueryVersion(client); } + static int SProcEVIGetVisualInfo(ClientPtr client) { @@ -139,6 +147,7 @@ swaps(&stuff->length, n); return ProcEVIGetVisualInfo(client); } + static int SProcEVIDispatch(ClientPtr client) { @@ -153,12 +162,14 @@ return BadRequest; } } + /*ARGSUSED*/ static void EVIResetProc(ExtensionEntry *extEntry) { eviDDXReset(); } + /**************** * XEVIExtensionInit * @@ -167,15 +178,21 @@ * ****************/ void -EVIExtensionInit(void) +EVIExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; + if ((extEntry = AddExtension(EVINAME, 0, 0, ProcEVIDispatch, SProcEVIDispatch, - EVIResetProc, StandardMinorOpcode))) - { + EVIResetProc, StandardMinorOpcode))) { XEVIReqCode = (unsigned char)extEntry->base; +#else + if (AddExtension(EVINAME, 0, 0, + ProcEVIDispatch, SProcEVIDispatch, + EVIResetProc, StandardMinorOpcode)) { +#endif eviPriv = eviDDXInit(); } } Index: xc/programs/Xserver/Xext/EVIstruct.h diff -u xc/programs/Xserver/Xext/EVIstruct.h:3.4 xc/programs/Xserver/Xext/EVIstruct.h:3.6 --- xc/programs/Xserver/Xext/EVIstruct.h:3.4 Wed Jan 17 17:13:14 2001 +++ xc/programs/Xserver/Xext/EVIstruct.h Mon Nov 17 17:20:26 2003 @@ -21,33 +21,36 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xext/EVIstruct.h,v 3.6 2003/11/17 22:20:26 dawes Exp $ */ + #ifndef EVI_STRUCT_H #define EVI_STRUCT_H + /* ****************************************************************************** ** Per-ddx data ****************************************************************************** */ + typedef int (*GetVisualInfoProc)( -#if NeedNestedPrototypes VisualID32*, int, xExtendedVisualInfo**, int*, VisualID32**, int* -#endif ); + typedef void (*FreeVisualInfoProc)( -#if NeedNestedPrototypes xExtendedVisualInfo*, VisualID32* -#endif ); typedef struct _EviPrivRec { GetVisualInfoProc getVisualInfo; FreeVisualInfoProc freeVisualInfo; } EviPrivRec, *EviPrivPtr; -extern EviPrivPtr eviDDXInit(); -extern void eviDDXReset(); + +extern EviPrivPtr eviDDXInit(void); +extern void eviDDXReset(void); + #endif /* EVI_STRUCT_H */ Index: xc/programs/Xserver/Xext/Imakefile diff -u xc/programs/Xserver/Xext/Imakefile:3.42 xc/programs/Xserver/Xext/Imakefile:3.44 --- xc/programs/Xserver/Xext/Imakefile:3.42 Wed Mar 6 16:12:32 2002 +++ xc/programs/Xserver/Xext/Imakefile Tue Jul 15 21:38:28 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.42 2002/03/06 21:12:32 mvojkovi Exp $ +XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.44 2003/07/16 01:38:28 dawes Exp $ #include @@ -157,6 +157,8 @@ LinkConfDirectory(xserver,.,xserver,.) +LinkSourceFile(modinit.h,extmod) + #if BuildXCSecurity && InstallSecurityConfig InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR)) #endif @@ -170,3 +172,4 @@ InstallDriverSDKNonExecFile(dgaproc.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR)) Index: xc/programs/Xserver/Xext/appgroup.c diff -u xc/programs/Xserver/Xext/appgroup.c:1.9 xc/programs/Xserver/Xext/appgroup.c:1.11 --- xc/programs/Xserver/Xext/appgroup.c:1.9 Mon Dec 17 15:52:25 2001 +++ xc/programs/Xserver/Xext/appgroup.c Tue Oct 28 18:08:43 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/appgroup.c,v 1.9 2001/12/17 20:52:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/appgroup.c,v 1.11 2003/10/28 23:08:43 tsi Exp $ */ /* Copyright 1996, 1998, 2001 The Open Group @@ -39,6 +39,7 @@ #include "servermd.h" #define _XAG_SERVER_ #include "Xagstr.h" +#include "Xagsrv.h" #define _SECURITY_SERVER #include "security.h" #include "Xfuncproto.h" @@ -49,6 +50,9 @@ #include +#include "modinit.h" +#include "appgroup.h" + typedef struct _AppGroupRec { struct _AppGroupRec* next; XID appgroupId; @@ -65,11 +69,14 @@ char* ConnectionInfo; } AppGroupRec, *AppGroupPtr; -static int ProcXagDispatch (), SProcXagDispatch (); -static void XagResetProc (); +static int ProcXagDispatch(ClientPtr client); +static int SProcXagDispatch(ClientPtr client); +static void XagResetProc(ExtensionEntry* extEntry); +#if 0 static unsigned char XagReqCode = 0; static int XagErrorBase; +#endif static int XagCallbackRefCount = 0; static RESTYPE RT_APPGROUP; @@ -80,9 +87,9 @@ extern int connBlockScreenStart; static -int XagAppGroupFree (what, id) - pointer what; - XID id; /* unused */ +int XagAppGroupFree( + pointer what, + XID id) /* unused */ { int i; AppGroupPtr pAppGrp = (AppGroupPtr) what; @@ -113,10 +120,10 @@ } /* static */ -void XagClientStateChange (pcbl, nulldata, calldata) - CallbackListPtr* pcbl; - pointer nulldata; - pointer calldata; +void XagClientStateChange( + CallbackListPtr* pcbl, + pointer nulldata, + pointer calldata) { SecurityAuthorizationPtr pAuth; NewClientInfoRec* pci = (NewClientInfoRec*) calldata; @@ -217,8 +224,9 @@ } void -XagExtensionInit () +XagExtensionInit(INITARGS) { +#if 0 ExtensionEntry* extEntry; if ((extEntry = AddExtension (XAGNAME, @@ -230,14 +238,23 @@ StandardMinorOpcode))) { XagReqCode = (unsigned char)extEntry->base; XagErrorBase = extEntry->errorBase; +#else + if (AddExtension (XAGNAME, + 0, + XagNumberErrors, + ProcXagDispatch, + SProcXagDispatch, + XagResetProc, + StandardMinorOpcode)) { +#endif RT_APPGROUP = CreateNewResourceType (XagAppGroupFree); } } /*ARGSUSED*/ static -void XagResetProc (extEntry) - ExtensionEntry* extEntry; +void XagResetProc( + ExtensionEntry* extEntry) { DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL); XagCallbackRefCount = 0; @@ -245,8 +262,8 @@ } static -int ProcXagQueryVersion (client) - register ClientPtr client; +int ProcXagQueryVersion( + register ClientPtr client) { /* REQUEST (xXagQueryVersionReq); */ xXagQueryVersionReply rep; @@ -269,11 +286,11 @@ } static -void ProcessAttr (pAppGrp, client, attrib_mask, attribs) - AppGroupPtr pAppGrp; - ClientPtr client; - unsigned int attrib_mask; - CARD32* attribs; +void ProcessAttr( + AppGroupPtr pAppGrp, + ClientPtr client, + unsigned int attrib_mask, + CARD32* attribs) { int i; @@ -307,8 +324,8 @@ } static -void CreateConnectionInfo (pAppGrp) - AppGroupPtr pAppGrp; +void CreateConnectionInfo( + AppGroupPtr pAppGrp) { xWindowRoot* rootp; xWindowRoot* roots[MAXSCREENS]; @@ -368,11 +385,11 @@ } static -AppGroupPtr CreateAppGroup (client, appgroupId, attrib_mask, attribs) - ClientPtr client; - XID appgroupId; - unsigned int attrib_mask; - CARD32* attribs; +AppGroupPtr CreateAppGroup( + ClientPtr client, + XID appgroupId, + unsigned int attrib_mask, + CARD32* attribs) { AppGroupPtr pAppGrp; @@ -396,10 +413,10 @@ } static -int AttrValidate (client, attrib_mask, pAppGrp) - ClientPtr client; - int attrib_mask; - AppGroupPtr pAppGrp; +int AttrValidate( + ClientPtr client, + int attrib_mask, + AppGroupPtr pAppGrp) { WindowPtr pWin; int idepth, ivids, found; @@ -439,8 +456,8 @@ } /* static */ -int ProcXagCreate (client) - register ClientPtr client; +int ProcXagCreate ( + register ClientPtr client) { REQUEST (xXagCreateReq); AppGroupPtr pAppGrp; @@ -471,8 +488,8 @@ } /* static */ -int ProcXagDestroy (client) - register ClientPtr client; +int ProcXagDestroy( + register ClientPtr client) { AppGroupPtr pAppGrp; REQUEST (xXagDestroyReq); @@ -488,8 +505,8 @@ } static -int ProcXagGetAttr (client) - register ClientPtr client; +int ProcXagGetAttr( + register ClientPtr client) { AppGroupPtr pAppGrp; REQUEST (xXagGetAttrReq); @@ -524,8 +541,8 @@ } static -int ProcXagQuery (client) - register ClientPtr client; +int ProcXagQuery( + register ClientPtr client) { ClientPtr pClient; AppGroupPtr pAppGrp; @@ -556,8 +573,8 @@ } static -int ProcXagCreateAssoc (client) - register ClientPtr client; +int ProcXagCreateAssoc( + register ClientPtr client) { REQUEST (xXagCreateAssocReq); @@ -579,8 +596,8 @@ } static -int ProcXagDestroyAssoc (client) - register ClientPtr client; +int ProcXagDestroyAssoc( + register ClientPtr client) { /* REQUEST (xXagDestroyAssocReq); */ @@ -590,8 +607,8 @@ } static -int ProcXagDispatch (client) - register ClientPtr client; +int ProcXagDispatch ( + register ClientPtr client) { REQUEST (xReq); switch (stuff->data) @@ -616,8 +633,8 @@ } static -int SProcXagQueryVersion (client) - register ClientPtr client; +int SProcXagQueryVersion( + register ClientPtr client) { register int n; REQUEST(xXagQueryVersionReq); @@ -626,8 +643,8 @@ } static -int SProcXagCreate (client) - ClientPtr client; +int SProcXagCreate( + ClientPtr client) { register int n; REQUEST (xXagCreateReq); @@ -640,8 +657,8 @@ } static -int SProcXagDestroy (client) - ClientPtr client; +int SProcXagDestroy( + ClientPtr client) { register int n; REQUEST (xXagDestroyReq); @@ -652,8 +669,8 @@ } static -int SProcXagGetAttr (client) - ClientPtr client; +int SProcXagGetAttr( + ClientPtr client) { register int n; REQUEST (xXagGetAttrReq); @@ -664,8 +681,8 @@ } static -int SProcXagQuery (client) - ClientPtr client; +int SProcXagQuery( + ClientPtr client) { register int n; REQUEST (xXagQueryReq); @@ -676,8 +693,8 @@ } static -int SProcXagCreateAssoc (client) - ClientPtr client; +int SProcXagCreateAssoc( + ClientPtr client) { register int n; REQUEST (xXagCreateAssocReq); @@ -690,8 +707,8 @@ } static -int SProcXagDestroyAssoc (client) - ClientPtr client; +int SProcXagDestroyAssoc( + ClientPtr client) { register int n; REQUEST (xXagDestroyAssocReq); @@ -702,8 +719,8 @@ } static -int SProcXagDispatch (client) - register ClientPtr client; +int SProcXagDispatch( + register ClientPtr client) { REQUEST(xReq); switch (stuff->data) @@ -727,20 +744,20 @@ } } -Colormap XagDefaultColormap (client) - ClientPtr client; +Colormap XagDefaultColormap( + ClientPtr client) { return (client->appgroup ? client->appgroup->default_colormap : None); } -VisualID XagRootVisual (client) - ClientPtr client; +VisualID XagRootVisual( + ClientPtr client) { return (client->appgroup ? client->appgroup->root_visual : 0); } -ClientPtr XagLeader (client) - ClientPtr client; +ClientPtr XagLeader( + ClientPtr client) { return (client->appgroup ? client->appgroup->leader : NULL); } @@ -750,9 +767,9 @@ * We don't want to send it to the leader when the window is on a different * screen, e.g. a print screen. */ -Bool XagIsControlledRoot (client, pParent) - ClientPtr client; - WindowPtr pParent; +Bool XagIsControlledRoot( + ClientPtr client, + WindowPtr pParent) { if (client->appgroup) { if (client->appgroup->single_screen && @@ -766,11 +783,11 @@ return FALSE; } -void XagConnectionInfo (client, conn_prefix, conn_info, num_screen) - ClientPtr client; - xConnSetupPrefix** conn_prefix; - char** conn_info; - int* num_screen; +void XagConnectionInfo( + ClientPtr client, + xConnSetupPrefix** conn_prefix, + char** conn_info, + int* num_screen) { if (client->appgroup && client->appgroup->ConnectionInfo) { *conn_prefix = &client->appgroup->connSetupPrefix; @@ -779,15 +796,15 @@ } } -XID XagId (client) - ClientPtr client; +XID XagId( + ClientPtr client) { return (client->appgroup ? client->appgroup->appgroupId : 0); } -void XagGetDeltaInfo (client, buf) - ClientPtr client; - CARD32* buf; +void XagGetDeltaInfo( + ClientPtr client, + CARD32* buf) { *buf++ = (CARD32) client->appgroup->default_root; *buf++ = (CARD32) client->appgroup->root_visual; @@ -796,8 +813,8 @@ *buf = (CARD32) client->appgroup->white_pixel; } -void XagCallClientStateChange (client) - ClientPtr client; +void XagCallClientStateChange( + ClientPtr client) { if (appGrpList) { NewClientInfoRec clientinfo; Index: xc/programs/Xserver/Xext/appgroup.h diff -u /dev/null xc/programs/Xserver/Xext/appgroup.h:1.1 --- /dev/null Sat Feb 28 21:42:01 2004 +++ xc/programs/Xserver/Xext/appgroup.h Tue Jul 15 21:38:28 2003 @@ -0,0 +1,10 @@ +/* $XFree86: xc/programs/Xserver/Xext/appgroup.h,v 1.1 2003/07/16 01:38:28 dawes Exp $ */ + +void XagClientStateChange( + CallbackListPtr* pcbl, + pointer nulldata, + pointer calldata); +int ProcXagCreate ( + register ClientPtr client); +int ProcXagDestroy( + register ClientPtr client); Index: xc/programs/Xserver/Xext/bigreq.c diff -u xc/programs/Xserver/Xext/bigreq.c:3.5 xc/programs/Xserver/Xext/bigreq.c:3.9 --- xc/programs/Xserver/Xext/bigreq.c:3.5 Fri Dec 14 14:58:48 2001 +++ xc/programs/Xserver/Xext/bigreq.c Mon Nov 17 17:20:26 2003 @@ -26,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.5 2001/12/14 19:58:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.9 2003/11/17 22:20:26 dawes Exp $ */ #define NEED_EVENTS #include "X.h" @@ -36,26 +36,35 @@ #include "dixstruct.h" #include "extnsionst.h" #include "bigreqstr.h" +#include "opaque.h" +#include "modinit.h" +#if 0 static unsigned char XBigReqCode; +#endif static void BigReqResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static DISPATCH_PROC(ProcBigReqDispatch); void -BigReqExtensionInit() +BigReqExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(XBigReqExtensionName, 0, 0, ProcBigReqDispatch, ProcBigReqDispatch, BigReqResetProc, StandardMinorOpcode)) != 0) XBigReqCode = (unsigned char)extEntry->base; +#else + (void) AddExtension(XBigReqExtensionName, 0, 0, + ProcBigReqDispatch, ProcBigReqDispatch, + BigReqResetProc, StandardMinorOpcode); +#endif + DeclareExtensionSecurity(XBigReqExtensionName, TRUE); } @@ -84,7 +93,7 @@ rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.max_request_size = MAX_BIG_REQUEST_SIZE; + rep.max_request_size = maxBigRequestSize; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.max_request_size, n); Index: xc/programs/Xserver/Xext/cup.c diff -u xc/programs/Xserver/Xext/cup.c:1.10 xc/programs/Xserver/Xext/cup.c:1.12 --- xc/programs/Xserver/Xext/cup.c:1.10 Fri Dec 14 14:58:48 2001 +++ xc/programs/Xserver/Xext/cup.c Tue Oct 28 18:08:43 2003 @@ -24,7 +24,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/cup.c,v 1.10 2001/12/14 19:58:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/cup.c,v 1.12 2003/10/28 23:08:43 tsi Exp $ */ #define NEED_REPLIES #define NEED_EVENTS @@ -47,11 +47,16 @@ #include "xf86_ansic.h" #endif -static int ProcDispatch (), SProcDispatch (); -static void ResetProc (); +#include "modinit.h" +static int ProcDispatch(ClientPtr client); +static int SProcDispatch(ClientPtr client); +static void ResetProc(ExtensionEntry* extEntry); + +#if 0 static unsigned char ReqCode = 0; static int ErrorBase; +#endif #if defined(WIN32) || defined(TESTWIN32) #define HAVE_SPECIAL_DESKTOP_COLORS @@ -123,8 +128,9 @@ #define NUM_DESKTOP_COLORS (sizeof citems / sizeof citems[0]) void -XcupExtensionInit () +XcupExtensionInit (INITARGS) { +#if 0 ExtensionEntry* extEntry; if ((extEntry = AddExtension (XCUPNAME, @@ -137,20 +143,29 @@ ReqCode = (unsigned char)extEntry->base; ErrorBase = extEntry->errorBase; } +#else + (void) AddExtension (XCUPNAME, + 0, + XcupNumberErrors, + ProcDispatch, + SProcDispatch, + ResetProc, + StandardMinorOpcode); +#endif /* PC servers initialize the desktop colors (citems) here! */ } /*ARGSUSED*/ static -void ResetProc (extEntry) - ExtensionEntry* extEntry; +void ResetProc( + ExtensionEntry* extEntry) { } static -int ProcQueryVersion (client) - register ClientPtr client; +int ProcQueryVersion( + register ClientPtr client) { /* REQUEST (xXcupQueryVersionReq); */ xXcupQueryVersionReply rep; @@ -173,8 +188,8 @@ } static -int ProcGetReservedColormapEntries (client) - register ClientPtr client; +int ProcGetReservedColormapEntries( + register ClientPtr client) { REQUEST (xXcupGetReservedColormapEntriesReq); xXcupGetReservedColormapEntriesReply rep; @@ -206,8 +221,8 @@ } static -int ProcStoreColors (client) - register ClientPtr client; +int ProcStoreColors( + register ClientPtr client) { REQUEST (xXcupStoreColorsReq); ColormapPtr pcmp; @@ -265,8 +280,8 @@ } static -int ProcDispatch (client) - register ClientPtr client; +int ProcDispatch( + register ClientPtr client) { REQUEST (xReq); switch (stuff->data) @@ -283,8 +298,8 @@ } static -int SProcQueryVersion (client) - register ClientPtr client; +int SProcQueryVersion( + register ClientPtr client) { register int n; @@ -294,8 +309,8 @@ } static -int SProcGetReservedColormapEntries (client) - ClientPtr client; +int SProcGetReservedColormapEntries( + ClientPtr client) { register int n; @@ -307,8 +322,8 @@ } static -int SProcXcupStoreColors (client) - ClientPtr client; +int SProcXcupStoreColors( + ClientPtr client) { register int n; int count; @@ -325,8 +340,8 @@ } static -int SProcDispatch (client) - register ClientPtr client; +int SProcDispatch( + register ClientPtr client) { REQUEST(xReq); switch (stuff->data) Index: xc/programs/Xserver/Xext/dgaproc.h diff -u xc/programs/Xserver/Xext/dgaproc.h:1.21 xc/programs/Xserver/Xext/dgaproc.h:1.22 --- xc/programs/Xserver/Xext/dgaproc.h:1.21 Fri Jun 30 15:06:54 2000 +++ xc/programs/Xserver/Xext/dgaproc.h Tue Jul 15 21:38:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.22 2003/07/16 01:38:29 dawes Exp $ */ #ifndef __DGAPROC_H #define __DGAPROC_H @@ -53,9 +53,6 @@ int reserved2; } XDGAModeRec, *XDGAModePtr; - -void XFree86DGAExtensionInit(void); - /* DDX interface */ int Index: xc/programs/Xserver/Xext/dpms.c diff -u xc/programs/Xserver/Xext/dpms.c:3.9 xc/programs/Xserver/Xext/dpms.c:3.12 --- xc/programs/Xserver/Xext/dpms.c:3.9 Sat Oct 27 23:32:50 2001 +++ xc/programs/Xserver/Xext/dpms.c Tue Feb 17 10:30:23 2004 @@ -33,7 +33,7 @@ * @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00 */ -/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.9 2001/10/28 03:32:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.12 2004/02/17 15:30:23 eich Exp $ */ #include "X.h" #include "Xproto.h" @@ -46,8 +46,11 @@ #include "dpms.h" #include "dpmsstr.h" #include "dpmsproc.h" +#include "modinit.h" +#if 0 static unsigned char DPMSCode; +#endif static DISPATCH_PROC(ProcDPMSDispatch); static DISPATCH_PROC(SProcDPMSDispatch); static DISPATCH_PROC(ProcDPMSGetVersion); @@ -69,15 +72,20 @@ static void DPMSResetProc(ExtensionEntry* extEntry); void -DPMSExtensionInit() +DPMSExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, DPMSResetProc, StandardMinorOpcode))) DPMSCode = (unsigned char)extEntry->base; - return; +#else + (void) AddExtension(DPMSExtensionName, 0, 0, + ProcDPMSDispatch, SProcDPMSDispatch, + DPMSResetProc, StandardMinorOpcode); +#endif } /*ARGSUSED*/ @@ -181,7 +189,8 @@ DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND; DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND; DPMSOffTime = stuff->off * MILLI_PER_SECOND; - + SetDPMSTimers(); + return(client->noClientException); } Index: xc/programs/Xserver/Xext/dpmsproc.h diff -u xc/programs/Xserver/Xext/dpmsproc.h:1.3 xc/programs/Xserver/Xext/dpmsproc.h:1.4 --- xc/programs/Xserver/Xext/dpmsproc.h:1.3 Sat Oct 27 23:32:50 2001 +++ xc/programs/Xserver/Xext/dpmsproc.h Tue Jul 15 21:38:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.3 2001/10/28 03:32:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.4 2003/07/16 01:38:29 dawes Exp $ */ /* Prototypes for functions that the DDX must provide */ @@ -6,7 +6,7 @@ #define _DPMSPROC_H_ void DPMSSet(int level); -int DPMSGet(int *level); +int DPMSGet(int *plevel); Bool DPMSSupported(void); #endif Index: xc/programs/Xserver/Xext/dpmsstubs.c diff -u xc/programs/Xserver/Xext/dpmsstubs.c:3.4 xc/programs/Xserver/Xext/dpmsstubs.c:3.5 --- xc/programs/Xserver/Xext/dpmsstubs.c:3.4 Wed Jan 17 17:13:15 2001 +++ xc/programs/Xserver/Xext/dpmsstubs.c Tue Jul 15 21:38:29 2003 @@ -26,10 +26,12 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.4 2001/01/17 22:13:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */ typedef int Bool; +#include "dpmsproc.h" + #define FALSE 0 Bool DPMSSupported(void) @@ -37,7 +39,7 @@ return FALSE; } -int DPSMGet(int *level) +int DPMSGet(int *plevel) { return -1; } Index: xc/programs/Xserver/Xext/fontcache.c diff -u xc/programs/Xserver/Xext/fontcache.c:1.5 xc/programs/Xserver/Xext/fontcache.c:1.8 --- xc/programs/Xserver/Xext/fontcache.c:1.5 Wed Feb 23 15:29:39 2000 +++ xc/programs/Xserver/Xext/fontcache.c Mon Nov 17 17:20:26 2003 @@ -27,7 +27,7 @@ * * Id: fontcache.c,v 1.12 1999/01/31 13:47:45 akiyama Exp $ */ -/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.5 2000/02/23 20:29:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.8 2003/11/17 22:20:26 dawes Exp $ */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ @@ -47,13 +47,12 @@ #include "Xfuncproto.h" #include "swaprep.h" +#include "modinit.h" static int miscErrorBase; static void FontCacheResetProc( -#if NeedFunctionPrototypes ExtensionEntry* /* extEntry */ -#endif ); static DISPATCH_PROC(ProcFontCacheDispatch); @@ -67,11 +66,12 @@ static DISPATCH_PROC(SProcFontCacheQueryVersion); static DISPATCH_PROC(SProcFontCacheChangeCacheSettings); +#if 0 static unsigned char FontCacheReqCode = 0; - +#endif void -FontCacheExtensionInit() +FontCacheExtensionInit(INITARGS) { ExtensionEntry* extEntry; @@ -83,7 +83,9 @@ SProcFontCacheDispatch, FontCacheResetProc, StandardMinorOpcode))) { +#if 0 FontCacheReqCode = (unsigned char)extEntry->base; +#endif miscErrorBase = extEntry->errorBase; } } Index: xc/programs/Xserver/Xext/mbuf.c diff -u xc/programs/Xserver/Xext/mbuf.c:3.14 xc/programs/Xserver/Xext/mbuf.c:3.16 --- xc/programs/Xserver/Xext/mbuf.c:3.14 Fri Dec 14 14:58:49 2001 +++ xc/programs/Xserver/Xext/mbuf.c Mon Nov 17 17:20:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/mbuf.c,v 3.14 2001/12/14 19:58:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/mbuf.c,v 3.16 2003/11/17 22:20:26 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -61,50 +61,40 @@ #define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask) +#if 0 static unsigned char MultibufferReqCode; +#endif static int MultibufferEventBase; static int MultibufferErrorBase; int MultibufferScreenIndex = -1; int MultibufferWindowIndex = -1; static void PerformDisplayRequest ( -#if NeedFunctionPrototypes MultibuffersPtr * /* ppMultibuffers */, MultibufferPtr * /* pMultibuffer */, int /* nbuf */ -#endif ); static Bool QueueDisplayRequest ( -#if NeedFunctionPrototypes ClientPtr /* client */, TimeStamp /* activateTime */ -#endif ); static void BumpTimeStamp ( -#if NeedFunctionPrototypes TimeStamp * /* ts */, CARD32 /* inc */ -#endif ); static void AliasMultibuffer ( -#if NeedFunctionPrototypes MultibuffersPtr /* pMultibuffers */, int /* i */ -#endif ); static void RecalculateMultibufferOtherEvents ( -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */ -#endif ); static int EventSelectForMultibuffer( -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */, ClientPtr /* client */, Mask /* mask */ -#endif ); /* @@ -113,10 +103,8 @@ */ RESTYPE MultibufferDrawableResType; static int MultibufferDrawableDelete ( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); /* * The per-buffer data can be found as a resource with this type. @@ -125,10 +113,8 @@ */ static RESTYPE MultibufferResType; static int MultibufferDelete ( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); /* @@ -137,10 +123,8 @@ */ static RESTYPE MultibuffersResType; static int MultibuffersDelete ( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); /* @@ -149,10 +133,8 @@ */ static RESTYPE OtherClientResType; static int OtherClientDelete ( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); /**************** @@ -187,44 +169,32 @@ static DISPATCH_PROC(SProcSetMBufferAttributes); static void MultibufferResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static void SClobberNotifyEvent( -#if NeedFunctionPrototypes xMbufClobberNotifyEvent * /* from */, xMbufClobberNotifyEvent * /* to */ -# endif ); static void SUpdateNotifyEvent( -#if NeedFunctionPrototypes xMbufUpdateNotifyEvent * /* from */, xMbufUpdateNotifyEvent * /* to */ -#endif ); static Bool MultibufferPositionWindow( -#if NeedFunctionPrototypes WindowPtr /* pWin */, int /* x */, int /* y */ -#endif ); static void SetupBackgroundPainter ( -#if NeedFunctionPrototypes WindowPtr /* pWin */, GCPtr /* pGC */ -#endif ); static int DeliverEventsToMultibuffer ( -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */, xEvent * /* pEvents */, int /* count */, Mask /* filter */ -#endif ); void @@ -279,7 +249,9 @@ ProcMultibufferDispatch, SProcMultibufferDispatch, MultibufferResetProc, StandardMinorOpcode))) { +#if 0 MultibufferReqCode = (unsigned char)extEntry->base; +#endif MultibufferEventBase = extEntry->eventBase; MultibufferErrorBase = extEntry->errorBase; EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent; Index: xc/programs/Xserver/Xext/mbufbf.c diff -u xc/programs/Xserver/Xext/mbufbf.c:3.4 xc/programs/Xserver/Xext/mbufbf.c:3.6 --- xc/programs/Xserver/Xext/mbufbf.c:3.4 Fri Dec 14 14:58:49 2001 +++ xc/programs/Xserver/Xext/mbufbf.c Mon Nov 10 13:21:42 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/mbufbf.c,v 3.4 2001/12/14 19:58:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/mbufbf.c,v 3.6 2003/11/10 18:21:42 tsi Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -243,7 +243,7 @@ pMBPriv->rgnChanged = TRUE; REGION_INIT(pScreen, &pMBPriv->backBuffer, &box, 1); REGION_INIT(pScreen, &pMBPriv->subtractRgn, &box, 1); - REGION_INIT(pScreen, &pMBPriv->unionRgn, NullBox, 0); + REGION_NULL(pScreen, &pMBPriv->unionRgn); /* Misc functions */ pMBPriv->CopyBufferBits = bufCopyBufferBitsFunc[pScreen->myNum]; @@ -778,7 +778,7 @@ pUnionRgn); /* Paint gained and lost backbuffer areas in select plane */ - REGION_INIT(pScreen, &exposed, NullBox, 0); + REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, pSubtractRgn, pUnionRgn); (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane, &exposed, FRONT_BUFFER); @@ -793,33 +793,6 @@ } } -/* XXX - Knows region internals. */ - -static Bool -RegionsEqual(reg1, reg2) - RegionPtr reg1; - RegionPtr reg2; -{ - int i; - BoxPtr rects1, rects2; - - if (reg1->extents.x1 != reg2->extents.x1) return FALSE; - if (reg1->extents.x2 != reg2->extents.x2) return FALSE; - if (reg1->extents.y1 != reg2->extents.y1) return FALSE; - if (reg1->extents.y2 != reg2->extents.y2) return FALSE; - if (REGION_NUM_RECTS(reg1) != REGION_NUM_RECTS(reg2)) return FALSE; - - rects1 = REGION_RECTS(reg1); - rects2 = REGION_RECTS(reg2); - for (i = 0; i != REGION_NUM_RECTS(reg1); i++) { - if (rects1[i].x1 != rects2[i].x1) return FALSE; - if (rects1[i].x2 != rects2[i].x2) return FALSE; - if (rects1[i].y1 != rects2[i].y1) return FALSE; - if (rects1[i].y2 != rects2[i].y2) return FALSE; - } - return TRUE; -} - /* * If the window is multibuffered and displaying the backbuffer, * add the old clipList to the subtractRgn and add the new clipList @@ -849,7 +822,7 @@ { RegionPtr pOldClipList = (RegionPtr) pMBWindow->devPrivate.ptr; - if (! RegionsEqual(pOldClipList, &pWin->clipList)) + if (! REGION_EQUAL(pScreen, pOldClipList, &pWin->clipList)) { if (pMBWindow->displayedMultibuffer == BACK_BUFFER) { @@ -940,8 +913,8 @@ /* miWindowExposures munges prgn and other_exposed. */ if (handleBuffers) { - REGION_INIT(pScreen, &tmp_rgn, NullBox, 0); - REGION_COPY(pScreen, &tmp_rgn,prgn); + REGION_NULL(pScreen, &tmp_rgn); + REGION_COPY(pScreen, &tmp_rgn, prgn); } UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures); Index: xc/programs/Xserver/Xext/mitmisc.c diff -u xc/programs/Xserver/Xext/mitmisc.c:3.4 xc/programs/Xserver/Xext/mitmisc.c:3.7 --- xc/programs/Xserver/Xext/mitmisc.c:3.4 Fri Dec 14 14:58:49 2001 +++ xc/programs/Xserver/Xext/mitmisc.c Mon Nov 17 17:20:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.4 2001/12/14 19:58:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.7 2003/11/17 22:20:26 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -38,15 +38,16 @@ #include "extnsionst.h" #define _MITMISC_SERVER_ #include "mitmiscstr.h" +#include "modinit.h" extern Bool permitOldBugs; +#if 0 static unsigned char MITReqCode; +#endif static void MITResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static DISPATCH_PROC(ProcMITDispatch); @@ -57,14 +58,20 @@ static DISPATCH_PROC(SProcMITSetBugMode); void -MITMiscExtensionInit() +MITMiscExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(MITMISCNAME, 0, 0, ProcMITDispatch, SProcMITDispatch, MITResetProc, StandardMinorOpcode)) != 0) MITReqCode = (unsigned char)extEntry->base; +#else + (void) AddExtension(MITMISCNAME, 0, 0, + ProcMITDispatch, SProcMITDispatch, + MITResetProc, StandardMinorOpcode); +#endif } /*ARGSUSED*/ Index: xc/programs/Xserver/Xext/panoramiX.c diff -u xc/programs/Xserver/Xext/panoramiX.c:3.32 xc/programs/Xserver/Xext/panoramiX.c:3.38 --- xc/programs/Xserver/Xext/panoramiX.c:3.32 Wed Jul 31 20:30:34 2002 +++ xc/programs/Xserver/Xext/panoramiX.c Mon Nov 10 13:21:43 2003 @@ -23,7 +23,7 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.32 2002/08/01 00:30:34 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.38 2003/11/10 18:21:43 tsi Exp $ */ #define NEED_REPLIES #include @@ -50,9 +50,12 @@ #ifdef RENDER #include "picturestr.h" #endif +#include "modinit.h" +#if 0 static unsigned char PanoramiXReqCode = 0; +#endif /* * PanoramiX data declarations */ @@ -62,14 +65,13 @@ int PanoramiXNumScreens = 0; PanoramiXData *panoramiXdataPtr = NULL; +RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL}; +static int PanoramiXNumDepths; +static DepthPtr PanoramiXDepths; +static int PanoramiXNumVisuals; +static VisualPtr PanoramiXVisuals; -RegionRec PanoramiXScreenRegion; - -int PanoramiXNumDepths; -DepthPtr PanoramiXDepths; -int PanoramiXNumVisuals; -VisualPtr PanoramiXVisuals; /* We support at most 256 visuals */ XID *PanoramiXVisualTable = NULL; @@ -79,57 +81,23 @@ unsigned long XRT_GC; unsigned long XRT_COLORMAP; - -int (* SavedProcVector[256]) (); -ScreenInfo *GlobalScrInfo; - -static int panoramiXGeneration; -static int ProcPanoramiXDispatch(); /* * Function prototypes */ +static int panoramiXGeneration; +static int ProcPanoramiXDispatch(ClientPtr client); + static void PanoramiXResetProc(ExtensionEntry*); /* - * External references for data variables + * External references for functions and data variables */ -extern int SProcPanoramiXDispatch(); -extern char *ConnectionInfo; -extern int connBlockScreenStart; -extern xConnSetupPrefix connSetupPrefix; - -/* - * Server dispatcher function replacements - */ +#include "panoramiXh.h" -int PanoramiXCreateWindow(), PanoramiXChangeWindowAttributes(); -int PanoramiXDestroyWindow(), PanoramiXDestroySubwindows(); -int PanoramiXChangeSaveSet(), PanoramiXReparentWindow(); -int PanoramiXMapWindow(), PanoramiXMapSubwindows(); -int PanoramiXUnmapWindow(), PanoramiXUnmapSubwindows(); -int PanoramiXConfigureWindow(), PanoramiXCirculateWindow(); -int PanoramiXGetGeometry(), PanoramiXTranslateCoords(); -int PanoramiXCreatePixmap(), PanoramiXFreePixmap(); -int PanoramiXCreateGC(), PanoramiXChangeGC(); -int PanoramiXCopyGC(), PanoramiXCopyColormapAndFree(); -int PanoramiXSetDashes(), PanoramiXSetClipRectangles(); -int PanoramiXFreeGC(), PanoramiXClearToBackground(); -int PanoramiXCopyArea(), PanoramiXCopyPlane(); -int PanoramiXPolyPoint(), PanoramiXPolyLine(); -int PanoramiXPolySegment(), PanoramiXPolyRectangle(); -int PanoramiXPolyArc(), PanoramiXFillPoly(); -int PanoramiXPolyFillArc(), PanoramiXPolyFillRectangle(); -int PanoramiXPutImage(), PanoramiXGetImage(); -int PanoramiXPolyText8(), PanoramiXPolyText16(); -int PanoramiXImageText8(), PanoramiXImageText16(); -int PanoramiXCreateColormap(), PanoramiXFreeColormap(); -int PanoramiXInstallColormap(), PanoramiXUninstallColormap(); -int PanoramiXAllocColor(), PanoramiXAllocNamedColor(); -int PanoramiXAllocColorCells(), PanoramiXStoreNamedColor(); -int PanoramiXFreeColors(), PanoramiXStoreColors(); -int PanoramiXAllocColorPlanes(); +int (* SavedProcVector[256]) (ClientPtr client) = { NULL, }; +ScreenInfo *GlobalScrInfo = NULL; static int PanoramiXGCIndex = -1; static int PanoramiXScreenIndex = -1; @@ -460,7 +428,7 @@ int i; Bool success = FALSE; ExtensionEntry *extEntry; - ScreenPtr pScreen; + ScreenPtr pScreen = screenInfo.screens[0]; PanoramiXScreenPtr pScreenPriv; int w, h; @@ -483,7 +451,10 @@ ErrorF("PanoramiXExtensionInit(): failed to AddExtension\n"); break; } + +#if 0 PanoramiXReqCode = (unsigned char)extEntry->base; +#endif /* * First make sure all the basic allocations succeed. If not, @@ -539,14 +510,16 @@ } - REGION_INIT(pScreen, &PanoramiXScreenRegion, NullBox, 1); + REGION_NULL(pScreen, &PanoramiXScreenRegion); for (i = 0; i < PanoramiXNumScreens; i++) { BoxRec TheBox; + pScreen = screenInfo.screens[i]; + panoramiXdataPtr[i].x = dixScreenOrigins[i].x; panoramiXdataPtr[i].y = dixScreenOrigins[i].y; - panoramiXdataPtr[i].width = (screenInfo.screens[i])->width; - panoramiXdataPtr[i].height = (screenInfo.screens[i])->height; + panoramiXdataPtr[i].width = pScreen->width; + panoramiXdataPtr[i].height = pScreen->height; TheBox.x1 = panoramiXdataPtr[i].x; TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width; @@ -646,7 +619,6 @@ int old_width, old_height; float width_mult, height_mult; xWindowRoot *root; - xConnSetup *setup; xVisualType *visual; xDepth *depth; VisualPtr pVisual; @@ -692,7 +664,6 @@ screenInfo.numScreens = i; - setup = (xConnSetup *) ConnectionInfo; root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart); length = connBlockScreenStart + sizeof(xWindowRoot); @@ -764,19 +735,54 @@ int i, j, k; VisualPtr pVisual, pVisual2; ScreenPtr pScreen, pScreen2; - PanoramiXRes *root, *defmap; + DepthPtr pDepth, pDepth2; + PanoramiXRes *root, *defmap, *saver; + Bool foundDepth, missingDepth; if(!PanoramiXVisualTable) PanoramiXVisualTable = xcalloc(256 * MAXSCREENS, sizeof(XID)); pScreen = screenInfo.screens[0]; pVisual = pScreen->visuals; + pDepth = pScreen->allowedDepths; PanoramiXNumDepths = 0; PanoramiXDepths = xcalloc(pScreen->numDepths,sizeof(DepthRec)); PanoramiXNumVisuals = 0; PanoramiXVisuals = xcalloc(pScreen->numVisuals,sizeof(VisualRec)); + for (i = 0; i < pScreen->numDepths; i++, pDepth++) { + missingDepth = FALSE; + for (j = 1; j < PanoramiXNumScreens; j++) { + pScreen2 = screenInfo.screens[j]; + pDepth2 = pScreen2->allowedDepths; + + foundDepth = FALSE; + for (k = 0; k < pScreen2->numDepths; k++, pDepth2++) { + if(pDepth2->depth == pDepth->depth) { + foundDepth = TRUE; + break; + } + } + + if(!foundDepth) { + missingDepth = TRUE; + break; + } + } + + if(!missingDepth) { + PanoramiXDepths[PanoramiXNumDepths].depth = pDepth->depth; + PanoramiXDepths[PanoramiXNumDepths].numVids = 0; + if(pDepth->numVids) + PanoramiXDepths[PanoramiXNumDepths].vids = + xalloc(sizeof(VisualID) * pDepth->numVids); + else + PanoramiXDepths[PanoramiXNumDepths].vids = NULL; + PanoramiXNumDepths++; + } + } + for (i = 0; i < pScreen->numVisuals; i++, pVisual++) { PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = pVisual->vid; @@ -796,23 +802,12 @@ (pVisual->offsetGreen == pVisual2->offsetGreen) && (pVisual->offsetBlue == pVisual2->offsetBlue)) { - Bool AlreadyUsed = FALSE; -#if 0 -/* Open GL should do this reduction, not us */ - for (l = 0; l < 256; l++) { - if (pVisual2->vid == - PanoramiXVisualTable[(l * MAXSCREENS) + j]) - { - AlreadyUsed = TRUE; - break; - } - } -#endif - if (!AlreadyUsed) { + /* We merely assign the first visual that matches. OpenGL + will need to get involved at some point if you want + match GLX visuals */ PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] = pVisual2->vid; break; - } } } } @@ -827,8 +822,6 @@ /* if it does, make sure it's in the list of supported depths and visuals */ if(PanoramiXVisualTable[pVisual->vid * MAXSCREENS]) { - Bool GotIt = FALSE; - PanoramiXVisuals[PanoramiXNumVisuals].vid = pVisual->vid; PanoramiXVisuals[PanoramiXNumVisuals].class = pVisual->class; PanoramiXVisuals[PanoramiXNumVisuals].bitsPerRGBValue = pVisual->bitsPerRGBValue; @@ -846,18 +839,9 @@ if (PanoramiXDepths[j].depth == pVisual->nplanes) { PanoramiXDepths[j].vids[PanoramiXDepths[j].numVids] = pVisual->vid; PanoramiXDepths[j].numVids++; - GotIt = TRUE; break; } } - - if (!GotIt) { - PanoramiXDepths[PanoramiXNumDepths].depth = pVisual->nplanes; - PanoramiXDepths[PanoramiXNumDepths].numVids = 1; - PanoramiXDepths[PanoramiXNumDepths].vids = xalloc(sizeof(VisualID) * 256); - PanoramiXDepths[PanoramiXNumDepths].vids[0] = pVisual->vid; - PanoramiXNumDepths++; - } } } @@ -866,14 +850,22 @@ root->type = XRT_WINDOW; defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)); defmap->type = XRT_COLORMAP; + saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)); + saver->type = XRT_WINDOW; + for (i = 0; i < PanoramiXNumScreens; i++) { root->info[i].id = WindowTable[i]->drawable.id; root->u.win.class = InputOutput; + root->u.win.root = TRUE; + saver->info[i].id = savedScreenInfo[i].wid; + saver->u.win.class = InputOutput; + saver->u.win.root = TRUE; defmap->info[i].id = (screenInfo.screens[i])->defColormap; } AddResource(root->info[0].id, XRT_WINDOW, root); + AddResource(saver->info[0].id, XRT_WINDOW, saver); AddResource(defmap->info[0].id, XRT_COLORMAP, defmap); } @@ -1134,6 +1126,7 @@ BoxRec SrcBox, *pbox; int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth; DrawablePtr pDraw = pDrawables[0]; + ScreenPtr pScreen = pDraw->pScreen; char *ScratchMem = NULL; size = 0; @@ -1149,7 +1142,7 @@ SrcBox.y2 = SrcBox.y1 + height; REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1); - REGION_INIT(pScreen, &GrabRegion, NullBox, 1); + REGION_NULL(pScreen, &GrabRegion); depth = (format == XYPixmap) ? 1 : pDraw->depth; Index: xc/programs/Xserver/Xext/panoramiX.h diff -u xc/programs/Xserver/Xext/panoramiX.h:1.5 xc/programs/Xserver/Xext/panoramiX.h:1.6 --- xc/programs/Xserver/Xext/panoramiX.h:1.5 Tue Jan 2 21:54:17 2001 +++ xc/programs/Xserver/Xext/panoramiX.h Sat Mar 22 23:56:02 2003 @@ -19,7 +19,7 @@ * or in FAR 52.227-19, as applicable. * * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2001/01/03 02:54:17 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.6 2003/03/23 04:56:02 mvojkovi Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ @@ -52,6 +52,7 @@ struct { char visibility; char class; + char root; } win; struct { Bool shared; Index: xc/programs/Xserver/Xext/panoramiXSwap.c diff -u xc/programs/Xserver/Xext/panoramiXSwap.c:3.8 xc/programs/Xserver/Xext/panoramiXSwap.c:3.10 --- xc/programs/Xserver/Xext/panoramiXSwap.c:3.8 Thu Aug 23 09:01:36 2001 +++ xc/programs/Xserver/Xext/panoramiXSwap.c Sat Sep 13 17:33:03 2003 @@ -23,7 +23,7 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.8 2001/08/23 13:01:36 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.10 2003/09/13 21:33:03 dawes Exp $ */ #include #include "X.h" @@ -47,28 +47,7 @@ #include "panoramiXproto.h" #include "panoramiXsrv.h" #include "globals.h" - - -/* - * External references for data variables - */ - -extern char *ConnectionInfo; -extern int connBlockScreenStart; - -#if NeedFunctionPrototypes -#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr) -#else -#define PROC_EXTERN(pfunc) extern int pfunc() -#endif - -PROC_EXTERN(ProcPanoramiXQueryVersion); -PROC_EXTERN(ProcPanoramiXGetState); -PROC_EXTERN(ProcPanoramiXGetScreenCount); -PROC_EXTERN(ProcPanoramiXGetScreenSize); - -PROC_EXTERN(ProcXineramaIsActive); -PROC_EXTERN(ProcXineramaQueryScreens); +#include "panoramiXh.h" static int SProcPanoramiXQueryVersion (ClientPtr client) Index: xc/programs/Xserver/Xext/panoramiXh.h diff -u /dev/null xc/programs/Xserver/Xext/panoramiXh.h:1.3 --- /dev/null Sat Feb 28 21:42:01 2004 +++ xc/programs/Xserver/Xext/panoramiXh.h Mon Nov 17 17:20:26 2003 @@ -0,0 +1,78 @@ +/* $XFree86: xc/programs/Xserver/Xext/panoramiXh.h,v 1.3 2003/11/17 22:20:26 dawes Exp $ */ + +/* + * Server dispatcher function replacements + */ + +extern int PanoramiXCreateWindow(ClientPtr client); +extern int PanoramiXChangeWindowAttributes(ClientPtr client); +extern int PanoramiXDestroyWindow(ClientPtr client); +extern int PanoramiXDestroySubwindows(ClientPtr client); +extern int PanoramiXChangeSaveSet(ClientPtr client); +extern int PanoramiXReparentWindow(ClientPtr client); +extern int PanoramiXMapWindow(ClientPtr client); +extern int PanoramiXMapSubwindows(ClientPtr client); +extern int PanoramiXUnmapWindow(ClientPtr client); +extern int PanoramiXUnmapSubwindows(ClientPtr client); +extern int PanoramiXConfigureWindow(ClientPtr client); +extern int PanoramiXCirculateWindow(ClientPtr client); +extern int PanoramiXGetGeometry(ClientPtr client); +extern int PanoramiXTranslateCoords(ClientPtr client); +extern int PanoramiXCreatePixmap(ClientPtr client); +extern int PanoramiXFreePixmap(ClientPtr client); +extern int PanoramiXCreateGC(ClientPtr client); +extern int PanoramiXChangeGC(ClientPtr client); +extern int PanoramiXCopyGC(ClientPtr client); +extern int PanoramiXCopyColormapAndFree(ClientPtr client); +extern int PanoramiXSetDashes(ClientPtr client); +extern int PanoramiXSetClipRectangles(ClientPtr client); +extern int PanoramiXFreeGC(ClientPtr client); +extern int PanoramiXClearToBackground(ClientPtr client); +extern int PanoramiXCopyArea(ClientPtr client); +extern int PanoramiXCopyPlane(ClientPtr client); +extern int PanoramiXPolyPoint(ClientPtr client); +extern int PanoramiXPolyLine(ClientPtr client); +extern int PanoramiXPolySegment(ClientPtr client); +extern int PanoramiXPolyRectangle(ClientPtr client); +extern int PanoramiXPolyArc(ClientPtr client); +extern int PanoramiXFillPoly(ClientPtr client); +extern int PanoramiXPolyFillArc(ClientPtr client); +extern int PanoramiXPolyFillRectangle(ClientPtr client); +extern int PanoramiXPutImage(ClientPtr client); +extern int PanoramiXGetImage(ClientPtr client); +extern int PanoramiXPolyText8(ClientPtr client); +extern int PanoramiXPolyText16(ClientPtr client); +extern int PanoramiXImageText8(ClientPtr client); +extern int PanoramiXImageText16(ClientPtr client); +extern int PanoramiXCreateColormap(ClientPtr client); +extern int PanoramiXFreeColormap(ClientPtr client); +extern int PanoramiXInstallColormap(ClientPtr client); +extern int PanoramiXUninstallColormap(ClientPtr client); +extern int PanoramiXAllocColor(ClientPtr client); +extern int PanoramiXAllocNamedColor(ClientPtr client); +extern int PanoramiXAllocColorCells(ClientPtr client); +extern int PanoramiXStoreNamedColor(ClientPtr client); +extern int PanoramiXFreeColors(ClientPtr client); +extern int PanoramiXStoreColors(ClientPtr client); +extern int PanoramiXAllocColorPlanes(ClientPtr client); + +#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr) + +PROC_EXTERN(ProcPanoramiXQueryVersion); +PROC_EXTERN(ProcPanoramiXGetState); +PROC_EXTERN(ProcPanoramiXGetScreenCount); +PROC_EXTERN(ProcPanoramiXGetScreenSize); + +PROC_EXTERN(ProcXineramaQueryScreens); +PROC_EXTERN(ProcXineramaIsActive); +extern Bool XineramaCreateGC(GCPtr pGC); + +extern int SProcPanoramiXDispatch(ClientPtr client); + +extern char *ConnectionInfo; +extern int connBlockScreenStart; +extern xConnSetupPrefix connSetupPrefix; + +extern ScreenInfo *GlobalScrInfo; +extern int (* SavedProcVector[256]) (ClientPtr client); + Index: xc/programs/Xserver/Xext/panoramiXprocs.c diff -u xc/programs/Xserver/Xext/panoramiXprocs.c:3.33 xc/programs/Xserver/Xext/panoramiXprocs.c:3.37 --- xc/programs/Xserver/Xext/panoramiXprocs.c:3.33 Wed Apr 10 17:38:53 2002 +++ xc/programs/Xserver/Xext/panoramiXprocs.c Mon Nov 10 13:21:43 2003 @@ -26,7 +26,7 @@ /* Massively rewritten by Mark Vojkovich */ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.33 2002/04/10 21:38:53 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.37 2003/11/10 18:21:43 tsi Exp $ */ #include #include "X.h" @@ -46,20 +46,21 @@ #include "panoramiX.h" #include "panoramiXsrv.h" #include "resource.h" +#include "panoramiXh.h" #define XINERAMA_IMAGE_BUFSIZE (256*1024) #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ CWDontPropagate | CWOverrideRedirect | CWCursor ) -extern ScreenInfo *GlobalScrInfo; -extern char *ConnectionInfo; -extern int connBlockScreenStart; - -extern int (* SavedProcVector[256]) (); -extern void (* EventSwapVector[128]) (); -extern void Swap32Write(), SLHostsExtend(), SQColorsExtend(), +#if 0 +extern void (* EventSwapVector[128]) (fsError *, fsError *); + +extern void Swap32Write(); +extern void SLHostsExtend(); +extern void SQColorsExtend(); WriteSConnectionInfo(); extern void WriteSConnSetupPrefix(); +#endif /* Various of the DIX function interfaces were not designed to allow * the client->errorValue to be set on BadValue and other errors. @@ -131,6 +132,7 @@ newWin->type = XRT_WINDOW; newWin->u.win.visibility = VisibilityNotViewable; newWin->u.win.class = stuff->class; + newWin->u.win.root = FALSE; newWin->info[0].id = stuff->wid; for(j = 1; j < PanoramiXNumScreens; j++) newWin->info[j].id = FakeClientID(client->index); @@ -140,7 +142,8 @@ orig_visual = stuff->visual; orig_x = stuff->x; orig_y = stuff->y; - parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id); + parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) || + (stuff->parent == savedScreenInfo[0].wid); FOR_NSCREENS_BACKWARD(j) { stuff->wid = newWin->info[j].id; stuff->parent = parent->info[j].id; @@ -329,7 +332,8 @@ x = stuff->x; y = stuff->y; - parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id); + parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) || + (stuff->parent == savedScreenInfo[0].wid); FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; stuff->parent = parent->info[j].id; @@ -468,7 +472,9 @@ } } - if(pWin->parent && (pWin->parent == WindowTable[0])) { + if(pWin->parent && ((pWin->parent == WindowTable[0]) || + (pWin->parent->drawable.id == savedScreenInfo[0].wid))) + { if ((Mask)stuff->mask & CWX) { x_offset = 0; x = *((CARD32 *)&stuff[1]); @@ -548,7 +554,9 @@ WindowPtr pWin = (WindowPtr)pDraw; rep.x = pWin->origin.x - wBorderWidth (pWin); rep.y = pWin->origin.y - wBorderWidth (pWin); - if(pWin->parent == WindowTable[0]) { + if((pWin->parent == WindowTable[0]) || + (pWin->parent->drawable.id == savedScreenInfo[0].wid)) + { rep.x += panoramiXdataPtr[0].x; rep.y += panoramiXdataPtr[0].y; } @@ -582,7 +590,9 @@ rep.sameScreen = xTrue; rep.child = None; - if(pWin == WindowTable[0]) { + if((pWin == WindowTable[0]) || + (pWin->drawable.id == savedScreenInfo[0].wid)) + { x = stuff->srcX - panoramiXdataPtr[0].x; y = stuff->srcY - panoramiXdataPtr[0].y; } else { @@ -622,7 +632,9 @@ } rep.dstX = x - pDst->drawable.x; rep.dstY = y - pDst->drawable.y; - if(pDst == WindowTable[0]) { + if((pDst == WindowTable[0]) || + (pDst->drawable.id == savedScreenInfo[0].wid)) + { rep.dstX += panoramiXdataPtr[0].x; rep.dstY += panoramiXdataPtr[0].y; } @@ -947,7 +959,7 @@ x = stuff->x; y = stuff->y; - isRoot = (stuff->window == WindowTable[0]->drawable.id); + isRoot = win->u.win.root; FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; if(isRoot) { @@ -1002,11 +1014,9 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - if((dst->type == XRT_WINDOW) && - (stuff->dstDrawable == WindowTable[0]->drawable.id)) + if((dst->type == XRT_WINDOW) && dst->u.win.root) dstIsRoot = TRUE; - if((src->type == XRT_WINDOW) && - (stuff->srcDrawable == WindowTable[0]->drawable.id)) + if((src->type == XRT_WINDOW) && src->u.win.root) srcIsRoot = TRUE; srcx = stuff->srcX; srcy = stuff->srcY; @@ -1095,7 +1105,7 @@ RegionRec totalReg; Bool overlap; - REGION_INIT(pScreen, &totalReg, NullBox, 1); + REGION_NULL(pScreen, &totalReg); FOR_NSCREENS_BACKWARD(j) { if(pRgn[j]) { if(srcIsRoot) { @@ -1152,11 +1162,9 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - if((dst->type == XRT_WINDOW) && - (stuff->dstDrawable == WindowTable[0]->drawable.id)) + if((dst->type == XRT_WINDOW) && dst->u.win.root) dstIsRoot = TRUE; - if((src->type == XRT_WINDOW) && - (stuff->srcDrawable == WindowTable[0]->drawable.id)) + if((src->type == XRT_WINDOW) && src->u.win.root) srcIsRoot = TRUE; srcx = stuff->srcX; srcy = stuff->srcY; @@ -1208,7 +1216,7 @@ RegionRec totalReg; Bool overlap; - REGION_INIT(pScreen, &totalReg, NullBox, 1); + REGION_NULL(pScreen, &totalReg); FOR_NSCREENS_BACKWARD(j) { if(pRgn[j]) { REGION_APPEND(pScreen, &totalReg, pRgn[j]); @@ -1246,8 +1254,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; if (npoint > 0) { origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); @@ -1305,8 +1312,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; if (npoint > 0){ origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint)); @@ -1364,8 +1370,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); if(nsegs & 4) return BadLength; @@ -1427,8 +1432,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); if(nrects & 4) return BadLength; @@ -1488,8 +1492,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; narcs = (client->req_len << 2) - sizeof(xPolyArcReq); if(narcs % sizeof(xArc)) return BadLength; @@ -1547,8 +1550,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; if (count > 0){ @@ -1607,8 +1609,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); if(things & 4) return BadLength; @@ -1667,8 +1668,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); IF_RETURN((narcs % sizeof(xArc)), BadLength); @@ -1726,8 +1726,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->dstX; orig_y = stuff->dstY; @@ -1786,8 +1785,7 @@ format = stuff->format; planemask = stuff->planeMask; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; if(isRoot) { if( /* check for being onscreen */ @@ -1919,8 +1917,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->x; orig_y = stuff->y; @@ -1959,8 +1956,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->x; orig_y = stuff->y; @@ -1999,8 +1995,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->x; orig_y = stuff->y; @@ -2039,8 +2034,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->x; orig_y = stuff->y; Index: xc/programs/Xserver/Xext/sampleEVI.c diff -u xc/programs/Xserver/Xext/sampleEVI.c:3.4 xc/programs/Xserver/Xext/sampleEVI.c:3.5 --- xc/programs/Xserver/Xext/sampleEVI.c:3.4 Wed Jan 17 17:13:16 2001 +++ xc/programs/Xserver/Xext/sampleEVI.c Tue Jul 15 21:38:29 2003 @@ -21,6 +21,8 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xext/sampleEVI.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */ + #include "X.h" #include "Xproto.h" #include "dixstruct.h" @@ -76,6 +78,7 @@ *n_info_rn = sz_evi; return Success; } + static void sampleFreeVisualInfo( xExtendedVisualInfo *evi, VisualID32 *conflict) @@ -85,13 +88,15 @@ if (conflict) xfree(conflict); } -EviPrivPtr eviDDXInit() + +EviPrivPtr eviDDXInit(void) { static EviPrivRec eviPriv; eviPriv.getVisualInfo = sampleGetVisualInfo; eviPriv.freeVisualInfo = sampleFreeVisualInfo; return &eviPriv; } -void eviDDXReset() + +void eviDDXReset(void) { } Index: xc/programs/Xserver/Xext/saver.c diff -u xc/programs/Xserver/Xext/saver.c:3.4 xc/programs/Xserver/Xext/saver.c:3.8 --- xc/programs/Xserver/Xext/saver.c:3.4 Thu Aug 23 09:01:36 2001 +++ xc/programs/Xserver/Xext/saver.c Mon Nov 17 17:20:26 2003 @@ -1,6 +1,5 @@ /* * $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $ - * $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.4 2001/08/23 13:01:36 alanh Exp $ * Copyright (c) 1992 X Consortium @@ -28,6 +27,8 @@ * Author: Keith Packard, MIT X Consortium */ +/* $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.8 2003/11/17 22:20:26 dawes Exp $ */ + #define NEED_REPLIES #define NEED_EVENTS #include "X.h" @@ -45,6 +46,11 @@ #include "gcstruct.h" #include "cursorstr.h" #include "colormapst.h" +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" +#endif + #ifdef IN_MODULE #include @@ -52,7 +58,11 @@ #include #endif +#include "modinit.h" + +#if 0 static unsigned char ScreenSaverReqCode = 0; +#endif static int ScreenSaverEventBase = 0; extern DISPATCH_PROC(ProcScreenSaverQueryInfo); @@ -69,52 +79,38 @@ static DISPATCH_PROC(SProcScreenSaverUnsetAttributes); static Bool ScreenSaverHandle ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, int /* xstate */, Bool /* force */ -#endif ); static Bool CreateSaverWindow ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); static Bool DestroySaverWindow ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); static void UninstallSaverColormap ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); static void CheckScreenPrivate ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); static void SScreenSaverNotifyEvent ( -#if NeedFunctionPrototypes xScreenSaverNotifyEvent * /* from */, xScreenSaverNotifyEvent * /* to */ -#endif ); static void ScreenSaverResetProc ( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); /* @@ -138,25 +134,19 @@ } ScreenSaverEventRec; static int ScreenSaverFreeEvents( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); static Bool setEventMask ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, ClientPtr /* client */, unsigned long /* mask */ -#endif ); static unsigned long getEventMask ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, ClientPtr /* client */ -#endif ); /* @@ -184,31 +174,23 @@ } ScreenSaverAttrRec, *ScreenSaverAttrPtr; static int ScreenSaverFreeAttr ( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); static void FreeAttrs ( -#if NeedFunctionPrototypes ScreenSaverAttrPtr /* pAttr */ -#endif ); static void FreeScreenAttr ( -#if NeedFunctionPrototypes ScreenSaverAttrPtr /* pAttr */ -#endif ); static void SendScreenSaverNotify ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, int /* state */, Bool /* forced */ -#endif ); typedef struct _ScreenSaverScreenPrivate { @@ -220,9 +202,7 @@ static ScreenSaverScreenPrivatePtr MakeScreenPrivate ( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); static int ScreenPrivateIndex; @@ -242,7 +222,7 @@ ****************/ void -ScreenSaverExtensionInit() +ScreenSaverExtensionInit(INITARGS) { ExtensionEntry *extEntry; int i; @@ -261,7 +241,9 @@ ProcScreenSaverDispatch, SProcScreenSaverDispatch, ScreenSaverResetProc, StandardMinorOpcode))) { +#if 0 ScreenSaverReqCode = (unsigned char)extEntry->base; +#endif ScreenSaverEventBase = extEntry->eventBase; EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent; } @@ -460,7 +442,6 @@ xScreenSaverNotifyEvent ev; ClientPtr client; int kind; - ScreenSaverStuffPtr pSaver; UpdateCurrentTimeIf (); mask = ScreenSaverNotifyMask; @@ -470,7 +451,6 @@ pPriv = GetScreenPrivate(pScreen); if (!pPriv) return; - pSaver = &savedScreenInfo[pScreen->myNum]; if (pPriv->attr) kind = ScreenSaverExternal; else if (ScreenSaverBlanking != DontPreferBlanking) @@ -696,7 +676,10 @@ ret = TRUE; } - SendScreenSaverNotify (pScreen, state, force); +#ifdef PANORAMIX + if(noPanoramiXExtension || !pScreen->myNum) +#endif + SendScreenSaverNotify (pScreen, state, force); return ret; } @@ -810,8 +793,7 @@ } static int -ProcScreenSaverSetAttributes (client) - register ClientPtr client; +ScreenSaverSetAttributes (ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; @@ -829,7 +811,6 @@ WindowOptPtr ancwopt; unsigned long *pVlist; unsigned long *values = 0; - int valuei; unsigned long tmask, imask; unsigned long val; Pixmap pixID; @@ -957,7 +938,6 @@ ret = BadAlloc; goto bail; } - valuei = 0; pAttr->screen = pScreen; pAttr->client = client; pAttr->x = stuff->x; @@ -1191,8 +1171,7 @@ } static int -ProcScreenSaverUnsetAttributes (client) - register ClientPtr client; +ScreenSaverUnsetAttributes (ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; @@ -1212,6 +1191,110 @@ return Success; } +static int +ProcScreenSaverSetAttributes (ClientPtr client) +{ +#ifdef PANORAMIX + if(!noPanoramiXExtension) { + REQUEST(xScreenSaverSetAttributesReq); + PanoramiXRes *draw; + PanoramiXRes *backPix = NULL; + PanoramiXRes *bordPix = NULL; + PanoramiXRes *cmap = NULL; + int i, status = 0, len; + int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; + XID orig_visual, tmp; + + REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); + + if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( + client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + return BadDrawable; + + len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2); + if (Ones(stuff->mask) != len) + return BadLength; + + if((Mask)stuff->mask & CWBackPixmap) { + pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1)); + tmp = *((CARD32 *) &stuff[1] + pback_offset); + if ((tmp != None) && (tmp != ParentRelative)) { + if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( + client, tmp, XRT_PIXMAP, SecurityReadAccess))) + return BadPixmap; + } + } + + if ((Mask)stuff->mask & CWBorderPixmap) { + pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1)); + tmp = *((CARD32 *) &stuff[1] + pbord_offset); + if (tmp != CopyFromParent) { + if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( + client, tmp, XRT_PIXMAP, SecurityReadAccess))) + return BadPixmap; + } + } + + if ((Mask)stuff->mask & CWColormap) { + cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1)); + tmp = *((CARD32 *) &stuff[1] + cmap_offset); + if ((tmp != CopyFromParent) && (tmp != None)) { + if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( + client, tmp, XRT_COLORMAP, SecurityReadAccess))) + return BadColor; + } + } + + orig_visual = stuff->visualID; + + FOR_NSCREENS_BACKWARD(i) { + stuff->drawable = draw->info[i].id; + if (backPix) + *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id; + if (bordPix) + *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id; + if (cmap) + *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id; + + if (orig_visual != CopyFromParent) + stuff->visualID = + PanoramiXVisualTable[(orig_visual*MAXSCREENS) + i]; + + status = ScreenSaverSetAttributes(client); + } + + return status; + } +#endif + + return ScreenSaverSetAttributes(client); +} + +static int +ProcScreenSaverUnsetAttributes (ClientPtr client) +{ +#ifdef PANORAMIX + if(!noPanoramiXExtension) { + REQUEST(xScreenSaverUnsetAttributesReq); + PanoramiXRes *draw; + int i; + + if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( + client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + return BadDrawable; + + for(i = PanoramiXNumScreens - 1; i > 0; i--) { + stuff->drawable = draw->info[i].id; + ScreenSaverUnsetAttributes(client); + } + + stuff->drawable = draw->info[0].id; + } +#endif + + return ScreenSaverUnsetAttributes(client); +} + static DISPATCH_PROC((*NormalVector[])) = { ProcScreenSaverQueryVersion, ProcScreenSaverQueryInfo, Index: xc/programs/Xserver/Xext/security.c diff -u xc/programs/Xserver/Xext/security.c:1.11 xc/programs/Xserver/Xext/security.c:1.17 --- xc/programs/Xserver/Xext/security.c:1.11 Fri May 31 14:45:53 2002 +++ xc/programs/Xserver/Xext/security.c Thu Dec 4 11:59:35 2003 @@ -24,12 +24,13 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.11 2002/05/31 18:45:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.17 2003/12/04 16:59:35 tsi Exp $ */ #include "dixstruct.h" #include "extnsionst.h" #include "windowstr.h" #include "inputstr.h" +#include "scrnintstr.h" #include "gcstruct.h" #include "colormapst.h" #include "propertyst.h" @@ -56,6 +57,8 @@ #undef index #endif +#include "modinit.h" + static int SecurityErrorBase; /* first Security error number */ static int SecurityEventBase; /* first Security event number */ @@ -73,14 +76,10 @@ * the extension can't be listed or queried. */ int (*UntrustedProcVector[256])( -#if NeedNestedPrototypes ClientPtr /*client*/ -#endif ); int (*SwappedUntrustedProcVector[256])( -#if NeedNestedPrototypes ClientPtr /*client*/ -#endif ); /* SecurityAudit @@ -102,9 +101,8 @@ if (auditTrailLevel < SECURITY_AUDIT_LEVEL) return; - AuditPrefix(format); va_start(args, format); - VErrorF(format, args); + VAuditF(format, args); va_end(args); } /* SecurityAudit */ @@ -123,9 +121,9 @@ */ static int -SecurityDeleteAuthorization(value, id) - pointer value; - XID id; +SecurityDeleteAuthorization( + pointer value, + XID id) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; unsigned short name_len, data_len; @@ -141,6 +139,7 @@ assert(status); status = RemoveAuthorization(name_len, name, data_len, data); assert(status); + (void)status; /* free the auth timer if there is one */ @@ -181,9 +180,9 @@ /* resource delete function for RTEventClient */ static int -SecurityDeleteAuthorizationEventClient(value, id) - pointer value; - XID id; +SecurityDeleteAuthorizationEventClient( + pointer value, + XID id) { OtherClientsPtr pEventClient, prev = NULL; SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; @@ -223,9 +222,9 @@ */ static CARD32 -SecurityComputeAuthorizationTimeout(pAuth, seconds) - SecurityAuthorizationPtr pAuth; - unsigned int seconds; +SecurityComputeAuthorizationTimeout( + SecurityAuthorizationPtr pAuth, + unsigned int seconds) { /* maxSecs is the number of full seconds that can be expressed in * 32 bits worth of milliseconds @@ -264,10 +263,10 @@ */ static CARD32 -SecurityAuthorizationExpired(timer, time, pval) - OsTimerPtr timer; - CARD32 time; - pointer pval; +SecurityAuthorizationExpired( + OsTimerPtr timer, + CARD32 time, + pointer pval) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval; @@ -299,8 +298,8 @@ */ static void -SecurityStartAuthorizationTimer(pAuth) - SecurityAuthorizationPtr pAuth; +SecurityStartAuthorizationTimer( + SecurityAuthorizationPtr pAuth) { pAuth->timer = TimerSet(pAuth->timer, 0, SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout), @@ -313,8 +312,8 @@ */ static int -ProcSecurityQueryVersion(client) - ClientPtr client; +ProcSecurityQueryVersion( + ClientPtr client) { /* REQUEST(xSecurityQueryVersionReq); */ xSecurityQueryVersionReply rep; @@ -345,10 +344,10 @@ static int -SecurityEventSelectForAuthorization(pAuth, client, mask) - SecurityAuthorizationPtr pAuth; - ClientPtr client; - Mask mask; +SecurityEventSelectForAuthorization( + SecurityAuthorizationPtr pAuth, + ClientPtr client, + Mask mask) { OtherClients *pEventClient; @@ -385,8 +384,8 @@ static int -ProcSecurityGenerateAuthorization(client) - ClientPtr client; +ProcSecurityGenerateAuthorization( + ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); int len; /* request length in CARD32s*/ @@ -582,8 +581,8 @@ } /* ProcSecurityGenerateAuthorization */ static int -ProcSecurityRevokeAuthorization(client) - ClientPtr client; +ProcSecurityRevokeAuthorization( + ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); SecurityAuthorizationPtr pAuth; @@ -607,8 +606,8 @@ static int -ProcSecurityDispatch(client) - ClientPtr client; +ProcSecurityDispatch( + ClientPtr client) { REQUEST(xReq); @@ -626,8 +625,8 @@ } /* ProcSecurityDispatch */ static int -SProcSecurityQueryVersion(client) - ClientPtr client; +SProcSecurityQueryVersion( + ClientPtr client) { REQUEST(xSecurityQueryVersionReq); register char n; @@ -641,8 +640,8 @@ static int -SProcSecurityGenerateAuthorization(client) - ClientPtr client; +SProcSecurityGenerateAuthorization( + ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); register char n; @@ -664,8 +663,8 @@ static int -SProcSecurityRevokeAuthorization(client) - ClientPtr client; +SProcSecurityRevokeAuthorization( + ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); register char n; @@ -678,8 +677,8 @@ static int -SProcSecurityDispatch(client) - ClientPtr client; +SProcSecurityDispatch( + ClientPtr client) { REQUEST(xReq); @@ -697,8 +696,9 @@ } /* SProcSecurityDispatch */ static void -SwapSecurityAuthorizationRevokedEvent(from, to) - xSecurityAuthorizationRevokedEvent *from, *to; +SwapSecurityAuthorizationRevokedEvent( + xSecurityAuthorizationRevokedEvent *from, + xSecurityAuthorizationRevokedEvent *to) { to->type = from->type; to->detail = from->detail; @@ -726,10 +726,10 @@ */ static void -SecurityDetermineEventPropogationLimits(dev, ppWin, ppStopWin) - DeviceIntPtr dev; - WindowPtr *ppWin; - WindowPtr *ppStopWin; +SecurityDetermineEventPropogationLimits( + DeviceIntPtr dev, + WindowPtr *ppWin, + WindowPtr *ppStopWin) { WindowPtr pFocusWin = dev->focus ? dev->focus->win : NoneWin; @@ -896,9 +896,9 @@ */ static pointer -SecurityAuditResourceIDAccess(client, id) - ClientPtr client; - XID id; +SecurityAuditResourceIDAccess( + ClientPtr client, + XID id) { int cid = CLIENT_ID(id); int reqtype = ((xReq *)client->requestBuffer)->reqType; @@ -950,12 +950,12 @@ */ static pointer -SecurityCheckResourceIDAccess(client, id, rtype, access_mode, rval) - ClientPtr client; - XID id; - RESTYPE rtype; - Mask access_mode; - pointer rval; +SecurityCheckResourceIDAccess( + ClientPtr client, + XID id, + RESTYPE rtype, + Mask access_mode, + pointer rval) { int cid = CLIENT_ID(id); int reqtype = ((xReq *)client->requestBuffer)->reqType; @@ -1116,10 +1116,10 @@ */ static void -SecurityClientStateCallback(pcbl, nulldata, calldata) - CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; +SecurityClientStateCallback( + CallbackListPtr *pcbl, + pointer nulldata, + pointer calldata) { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; ClientPtr client = pci->client; @@ -1220,6 +1220,7 @@ unsigned int format; char * pBuf; { + ScreenPtr pScreen = pDraw->pScreen; RegionRec imageRegion; /* region representing x,y,w,h */ RegionRec censorRegion; /* region to obliterate */ BoxRec imageBox; @@ -1230,7 +1231,7 @@ imageBox.x2 = x + w; imageBox.y2 = y + h; REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_INIT(pScreen, &censorRegion, NullBox, 0); + REGION_NULL(pScreen, &censorRegion); /* censorRegion = imageRegion - visibleRegion */ REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); @@ -1348,7 +1349,7 @@ /*#define PROPDEBUG 1*/ static void -SecurityFreePropertyAccessList() +SecurityFreePropertyAccessList(void) { while (PropertyAccessList) { @@ -1365,8 +1366,8 @@ #endif static char * -SecuritySkipWhitespace(p) - char *p; +SecuritySkipWhitespace( + char *p) { while (SecurityIsWhitespace(*p)) p++; @@ -1375,8 +1376,8 @@ static char * -SecurityParseString(rest) - char **rest; +SecurityParseString( + char **rest) { char *startOfString; char *s = *rest; @@ -1412,8 +1413,8 @@ static int -SecurityParseKeyword(p) - char **p; +SecurityParseKeyword( + char **p) { int i; char *s = *p; @@ -1433,8 +1434,8 @@ static Bool -SecurityParsePropertyAccessRule(p) - char *p; +SecurityParsePropertyAccessRule( + char *p) { char *propname; char c; @@ -1574,8 +1575,8 @@ static int nSecurityPolicyStrings = 0; static Bool -SecurityParseSitePolicy(p) - char *p; +SecurityParseSitePolicy( + char *p) { char *policyStr = SecurityParseString(&p); char *copyPolicyStr; @@ -1613,7 +1614,7 @@ } /* SecurityGetSitePolicyStrings */ static void -SecurityFreeSitePolicyStrings() +SecurityFreeSitePolicyStrings(void) { if (SecurityPolicyStrings) { @@ -1630,7 +1631,7 @@ static void -SecurityLoadPropertyAccessList() +SecurityLoadPropertyAccessList(void) { FILE *f; int lineNumber = 0; @@ -1732,9 +1733,9 @@ static Bool -SecurityMatchString(ws, cs) - char *ws; - char *cs; +SecurityMatchString( + char *ws, + char *cs) { while (*ws && *cs) { @@ -1908,8 +1909,8 @@ */ static void -SecurityResetProc(extEntry) - ExtensionEntry *extEntry; +SecurityResetProc( + ExtensionEntry *extEntry) { SecurityFreePropertyAccessList(); SecurityFreeSitePolicyStrings(); @@ -1944,7 +1945,7 @@ */ void -SecurityExtensionInit() +SecurityExtensionInit(INITARGS) { ExtensionEntry *extEntry; int i; Index: xc/programs/Xserver/Xext/shape.c diff -u xc/programs/Xserver/Xext/shape.c:3.16 xc/programs/Xserver/Xext/shape.c:3.19 --- xc/programs/Xserver/Xext/shape.c:3.16 Fri Dec 14 14:58:50 2001 +++ xc/programs/Xserver/Xext/shape.c Mon Nov 17 17:20:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.16 2001/12/14 19:58:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.19 2003/11/17 22:20:26 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -46,45 +46,33 @@ #ifdef EXTMODULE #include "xf86_ansic.h" #endif +#include "modinit.h" typedef RegionPtr (*CreateDftPtr)( -#if NeedNestedPrototypes WindowPtr /* pWin */ -#endif ); static int ShapeFreeClient( -#if NeedFunctionPrototypes pointer /* data */, XID /* id */ -#endif ); static int ShapeFreeEvents( -#if NeedFunctionPrototypes pointer /* data */, XID /* id */ -#endif ); static void SendShapeNotify( -#if NeedFunctionPrototypes WindowPtr /* pWin */, int /* which */ -#endif ); static void ShapeResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static void SShapeNotifyEvent( -#if NeedFunctionPrototypes xShapeNotifyEvent * /* from */, xShapeNotifyEvent * /* to */ -#endif ); static int RegionOperate ( -#if NeedFunctionPrototypes ClientPtr /* client */, WindowPtr /* pWin */, int /* kind */, @@ -94,14 +82,9 @@ int /* xoff */, int /* yoff */, CreateDftPtr /* create */ -#endif ); -#if NeedFunctionPrototypes #define CREATE_PROC(func) RegionPtr func(WindowPtr /* pWin */) -#else -#define CREATE_PROC(func) RegionPtr func(/* WindowPtr pWin */) -#endif static CREATE_PROC(CreateBoundingShape); static CREATE_PROC(CreateClipShape); @@ -134,7 +117,9 @@ #include "panoramiXsrv.h" #endif +#if 0 static unsigned char ShapeReqCode = 0; +#endif static int ShapeEventBase = 0; static RESTYPE ClientType, EventType; /* resource types for event masks */ @@ -164,7 +149,7 @@ ****************/ void -ShapeExtensionInit() +ShapeExtensionInit(INITARGS) { ExtensionEntry *extEntry; @@ -175,7 +160,9 @@ ProcShapeDispatch, SProcShapeDispatch, ShapeResetProc, StandardMinorOpcode))) { +#if 0 ShapeReqCode = (unsigned char)extEntry->base; +#endif ShapeEventBase = extEntry->eventBase; EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent; } @@ -390,8 +377,8 @@ #ifdef PANORAMIX static int -ProcPanoramiXShapeRectangles (client) - register ClientPtr client; +ProcPanoramiXShapeRectangles( + register ClientPtr client) { REQUEST(xShapeRectanglesReq); PanoramiXRes *win; @@ -479,8 +466,8 @@ #ifdef PANORAMIX static int -ProcPanoramiXShapeMask (client) - register ClientPtr client; +ProcPanoramiXShapeMask( + register ClientPtr client) { REQUEST(xShapeMaskReq); PanoramiXRes *win, *pmap; @@ -594,8 +581,8 @@ #ifdef PANORAMIX static int -ProcPanoramiXShapeCombine (client) - register ClientPtr client; +ProcPanoramiXShapeCombine( + register ClientPtr client) { REQUEST(xShapeCombineReq); PanoramiXRes *win, *win2; @@ -663,8 +650,8 @@ #ifdef PANORAMIX static int -ProcPanoramiXShapeOffset (client) - register ClientPtr client; +ProcPanoramiXShapeOffset( + register ClientPtr client) { REQUEST(xShapeOffsetReq); PanoramiXRes *win; Index: xc/programs/Xserver/Xext/shm.c diff -u xc/programs/Xserver/Xext/shm.c:3.36 xc/programs/Xserver/Xext/shm.c:3.42 --- xc/programs/Xserver/Xext/shm.c:3.36 Wed Apr 3 14:51:11 2002 +++ xc/programs/Xserver/Xext/shm.c Thu Dec 18 05:15:24 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.36 2002/04/03 19:51:11 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.42 2003/12/18 10:15:24 alanh Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -29,6 +29,8 @@ /* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ +#define SHM + #include #ifndef Lynx #include @@ -65,6 +67,8 @@ #include "panoramiXsrv.h" #endif +#include "modinit.h" + typedef struct _ShmDesc { struct _ShmDesc *next; int shmid; @@ -78,21 +82,15 @@ static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); static int ShmDetachSegment( -#if NeedFunctionPrototypes pointer /* value */, XID /* shmseg */ -#endif ); static void ShmResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static void SShmCompletionEvent( -#if NeedFunctionPrototypes xShmCompletionEvent * /* from */, xShmCompletionEvent * /* to */ -#endif ); static Bool ShmDestroyPixmap (PixmapPtr pPixmap); @@ -159,7 +157,7 @@ } -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) #include static Bool badSysCall = FALSE; @@ -181,23 +179,32 @@ badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - /* Clean up */ + if (shmid != -1) { + /* Successful allocation - clean up */ shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); } + else + { + /* Allocation failed */ + badSysCall = TRUE; + } signal(SIGSYS, oldHandler); return(!badSysCall); } + +#define MUST_CHECK_FOR_SHM_SYSCALL + #endif - + void -ShmExtensionInit() +ShmExtensionInit(INITARGS) { ExtensionEntry *extEntry; int i; -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#ifdef MUST_CHECK_FOR_SHM_SYSCALL if (!CheckForShmSyscall()) { ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); @@ -270,17 +277,17 @@ } void -ShmRegisterFuncs(pScreen, funcs) - ScreenPtr pScreen; - ShmFuncsPtr funcs; +ShmRegisterFuncs( + ScreenPtr pScreen, + ShmFuncsPtr funcs) { shmFuncs[pScreen->myNum] = funcs; } void -ShmSetPixmapFormat(pScreen, format) - ScreenPtr pScreen; - int format; +ShmSetPixmapFormat( + ScreenPtr pScreen, + int format) { shmPixFormat[pScreen->myNum] = format; } @@ -572,8 +579,7 @@ client, stuff->gc, XRT_GC, SecurityReadAccess))) return BadGC; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->dstX; orig_y = stuff->dstY; @@ -633,8 +639,7 @@ format = stuff->format; planemask = stuff->planeMask; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; if(isRoot) { if( /* check for being onscreen */ @@ -709,8 +714,8 @@ } static int -ProcPanoramiXShmCreatePixmap(client) - register ClientPtr client; +ProcPanoramiXShmCreatePixmap( + register ClientPtr client) { ScreenPtr pScreen = NULL; PixmapPtr pMap = NULL; Index: xc/programs/Xserver/Xext/sleepuntil.c diff -u xc/programs/Xserver/Xext/sleepuntil.c:3.5 xc/programs/Xserver/Xext/sleepuntil.c:3.7 --- xc/programs/Xserver/Xext/sleepuntil.c:3.5 Fri Dec 14 14:58:51 2001 +++ xc/programs/Xserver/Xext/sleepuntil.c Mon Nov 17 17:20:27 2003 @@ -25,7 +25,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.5 2001/12/14 19:58:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.7 2003/11/17 22:20:27 dawes Exp $ */ /* dixsleep.c - implement millisecond timeouts for X clients */ @@ -44,10 +44,8 @@ ClientPtr pClient; XID id; void (*notifyFunc)( -#if NeedNestedPrototypes ClientPtr /* client */, pointer /* closure */ -#endif ); pointer closure; @@ -59,37 +57,31 @@ static int SertafiedGeneration; static void ClientAwaken( -#if NeedFunctionPrototypes ClientPtr /* client */, pointer /* closure */ -#endif ); static int SertafiedDelete( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); static void SertafiedBlockHandler( -#if NeedFunctionPrototypes pointer /* data */, OSTimePtr /* wt */, pointer /* LastSelectMask */ -#endif ); static void SertafiedWakeupHandler( -#if NeedFunctionPrototypes pointer /* data */, int /* i */, pointer /* LastSelectMask */ -#endif ); int ClientSleepUntil (client, revive, notifyFunc, closure) ClientPtr client; TimeStamp *revive; - void (*notifyFunc)(); + void (*notifyFunc)( + ClientPtr /* client */, + pointer /* closure */); pointer closure; { SertafiedPtr pRequest, pReq, pPrev; Index: xc/programs/Xserver/Xext/sleepuntil.h diff -u xc/programs/Xserver/Xext/sleepuntil.h:1.1 xc/programs/Xserver/Xext/sleepuntil.h:1.3 --- xc/programs/Xserver/Xext/sleepuntil.h:1.1 Tue Jul 31 20:44:44 2001 +++ xc/programs/Xserver/Xext/sleepuntil.h Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.1 2001/08/01 00:44:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.3 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 2001 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _SLEEPUNTIL_H_ @@ -31,17 +52,13 @@ #include "dix.h" extern int ClientSleepUntil( -#if NeedFunctionPrototypes ClientPtr client, TimeStamp *revive, void (*notifyFunc)( -#if NeedNestedPrototypes ClientPtr /* client */, pointer /* closure */ -#endif ), pointer Closure -#endif ); #endif Index: xc/programs/Xserver/Xext/sync.c diff -u xc/programs/Xserver/Xext/sync.c:3.11 xc/programs/Xserver/Xext/sync.c:3.14 --- xc/programs/Xserver/Xext/sync.c:3.11 Fri Dec 14 14:58:51 2001 +++ xc/programs/Xserver/Xext/sync.c Mon Nov 17 17:20:27 2003 @@ -50,7 +50,7 @@ PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.11 2001/12/14 19:58:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.14 2003/11/17 22:20:27 dawes Exp $ */ #define NEED_REPLIES #define NEED_EVENTS @@ -76,10 +76,11 @@ #endif #endif +#include "modinit.h" + /* * Local Global Variables */ -static int SyncReqCode; static int SyncEventBase; static int SyncErrorBase; static RESTYPE RTCounter = 0; @@ -98,219 +99,165 @@ static int FreeAlarm( -#if NeedFunctionPrototypes pointer /* addr */, XID /* id */ -#endif ); static int FreeAlarmClient( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); static int FreeAwait( -#if NeedFunctionPrototypes pointer /* addr */, XID /* id */ -#endif ); static void ServertimeBracketValues( -#if NeedFunctionPrototypes pointer /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */ -#endif ); static void ServertimeQueryValue( -#if NeedFunctionPrototypes pointer /* pCounter */, CARD64 * /* pValue_return */ -#endif ); static void ServertimeWakeupHandler( -#if NeedFunctionPrototypes pointer /* env */, int /* rc */, pointer /* LastSelectMask */ -#endif ); static int SyncInitTrigger( -#if NeedFunctionPrototypes ClientPtr /* client */, SyncTrigger * /* pTrigger */, XSyncCounter /* counter */, Mask /* changes */ -#endif ); static void SAlarmNotifyEvent( -#if NeedFunctionPrototypes xSyncAlarmNotifyEvent * /* from */, xSyncAlarmNotifyEvent * /* to */ -#endif ); static void SCounterNotifyEvent( -#if NeedFunctionPrototypes xSyncCounterNotifyEvent * /* from */, xSyncCounterNotifyEvent * /* to */ -#endif ); static void ServertimeBlockHandler( -#if NeedFunctionPrototypes pointer /* env */, struct timeval ** /* wt */, pointer /* LastSelectMask */ -#endif ); static int SyncAddTriggerToCounter( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */ -#endif ); extern void SyncAlarmCounterDestroyed( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */ -#endif ); static void SyncAlarmTriggerFired( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */ -#endif ); static void SyncAwaitTriggerFired( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */ -#endif ); static int SyncChangeAlarmAttributes( -#if NeedFunctionPrototypes ClientPtr /* client */, SyncAlarm * /* pAlarm */, Mask /* mask */, CARD32 * /* values */ -#endif ); static Bool SyncCheckTriggerNegativeComparison( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */, CARD64 /* oldval */ -#endif ); static Bool SyncCheckTriggerNegativeTransition( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */, CARD64 /* oldval */ -#endif ); static Bool SyncCheckTriggerPositiveComparison( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */, CARD64 /* oldval */ -#endif ); static Bool SyncCheckTriggerPositiveTransition( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */, CARD64 /* oldval */ -#endif ); static SyncCounter * SyncCreateCounter( -#if NeedFunctionPrototypes ClientPtr /* client */, XSyncCounter /* id */, CARD64 /* initialvalue */ -#endif ); static void SyncComputeBracketValues( -#if NeedFunctionPrototypes SyncCounter * /* pCounter */, Bool /* startOver */ -#endif ); static void SyncDeleteTriggerFromCounter( -#if NeedFunctionPrototypes SyncTrigger * /* pTrigger */ -#endif ); static Bool SyncEventSelectForAlarm( -#if NeedFunctionPrototypes SyncAlarm * /* pAlarm */, ClientPtr /* client */, Bool /* wantevents */ -#endif ); static void SyncInitServerTime( -#if NeedFunctionPrototypes void -#endif ); static void SyncResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static void SyncSendAlarmNotifyEvents( -#if NeedFunctionPrototypes SyncAlarm * /* pAlarm */ -#endif ); static void SyncSendCounterNotifyEvents( -#if NeedFunctionPrototypes ClientPtr /* client */, SyncAwait ** /* ppAwait */, int /* num_events */ -#endif ); static DISPATCH_PROC(ProcSyncAwait); @@ -1081,10 +1028,8 @@ } static int FreeCounter( -#if NeedFunctionPrototypes pointer /*env*/, XID /*id*/ -#endif ); /* @@ -1098,8 +1043,13 @@ CARD64 initial; CARD64 resolution; SyncCounterType counterType; - void (*QueryValue) (); - void (*BracketValues) (); + void (*QueryValue) ( + pointer /* pCounter */, + CARD64 * /* pValue_return */); + void (*BracketValues) ( + pointer /* pCounter */, + CARD64 * /* pbracket_less */, + CARD64 * /* pbracket_greater */); { SyncCounter *pCounter; @@ -1588,6 +1538,8 @@ SyncCounter *pCounter; CARD64 newvalue; + REQUEST_SIZE_MATCH(xSyncSetCounterReq); + pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid, RTCounter, SecurityWriteAccess); if (pCounter == NULL) @@ -2031,12 +1983,11 @@ ProcSyncDestroyAlarm(client) ClientPtr client; { - SyncAlarm *pAlarm; REQUEST(xSyncDestroyAlarmReq); REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); - if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, + if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, RTAlarm, SecurityDestroyAccess))) { client->errorValue = stuff->alarm; @@ -2399,7 +2350,7 @@ * ** Initialise the extension. */ void -SyncExtensionInit() +SyncExtensionInit(INITARGS) { ExtensionEntry *extEntry; @@ -2424,7 +2375,6 @@ return; } - SyncReqCode = extEntry->base; SyncEventBase = extEntry->eventBase; SyncErrorBase = extEntry->errorBase; EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent; @@ -2488,6 +2438,7 @@ { Bool overflow; XSyncValueSubtract(&delay, *pnext_time, Now, &overflow); + (void)overflow; timeout = XSyncValueLow32(delay); } AdjustWaitForDelay(wt, timeout); /* os/utils.c */ Index: xc/programs/Xserver/Xext/xcmisc.c diff -u xc/programs/Xserver/Xext/xcmisc.c:3.5 xc/programs/Xserver/Xext/xcmisc.c:3.8 --- xc/programs/Xserver/Xext/xcmisc.c:3.5 Fri Dec 14 14:58:51 2001 +++ xc/programs/Xserver/Xext/xcmisc.c Mon Nov 17 17:20:27 2003 @@ -26,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.5 2001/12/14 19:58:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.8 2003/11/17 22:20:27 dawes Exp $ */ #define NEED_EVENTS #define NEED_REPLIES @@ -38,13 +38,14 @@ #include "extnsionst.h" #include "swaprep.h" #include "xcmiscstr.h" +#include "modinit.h" +#if 0 static unsigned char XCMiscCode; +#endif static void XCMiscResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static DISPATCH_PROC(ProcXCMiscDispatch); @@ -57,14 +58,21 @@ static DISPATCH_PROC(SProcXCMiscGetXIDRange); void -XCMiscExtensionInit() +XCMiscExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(XCMiscExtensionName, 0, 0, ProcXCMiscDispatch, SProcXCMiscDispatch, XCMiscResetProc, StandardMinorOpcode)) != 0) XCMiscCode = (unsigned char)extEntry->base; +#else + (void) AddExtension(XCMiscExtensionName, 0, 0, + ProcXCMiscDispatch, SProcXCMiscDispatch, + XCMiscResetProc, StandardMinorOpcode); +#endif + DeclareExtensionSecurity(XCMiscExtensionName, TRUE); } Index: xc/programs/Xserver/Xext/xf86bigfont.c diff -u xc/programs/Xserver/Xext/xf86bigfont.c:1.13 xc/programs/Xserver/Xext/xf86bigfont.c:1.18 --- xc/programs/Xserver/Xext/xf86bigfont.c:1.13 Sat Jun 30 18:41:44 2001 +++ xc/programs/Xserver/Xext/xf86bigfont.c Mon Nov 17 17:20:27 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.13 2001/06/30 22:41:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.18 2003/11/17 22:20:27 dawes Exp $ */ /* * BIGFONT extension for sharing font metrics between clients (if possible) * and for transmitting font metrics to clients in a compressed form. @@ -73,9 +73,7 @@ #include "xf86bigfstr.h" static void XF86BigfontResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static DISPATCH_PROC(ProcXF86BigfontDispatch); @@ -85,7 +83,9 @@ static DISPATCH_PROC(SProcXF86BigfontQueryVersion); static DISPATCH_PROC(SProcXF86BigfontQueryFont); +#if 0 static unsigned char XF86BigfontReqCode; +#endif #ifdef HAS_SHM @@ -112,9 +112,10 @@ badSysCall = TRUE; } -static Bool CheckForShmSyscall() +static Bool +CheckForShmSyscall(void) { - void (*oldHandler)(); + void (*oldHandler)(int); int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ @@ -122,10 +123,16 @@ badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - /* Clean up */ - if (shmid != -1) { + if (shmid != -1) + { + /* Successful allocation - clean up */ shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); } + else + { + /* Allocation failed */ + badSysCall = TRUE; + } signal(SIGSYS, oldHandler); return (!badSysCall); } @@ -139,6 +146,7 @@ void XFree86BigfontExtensionInit() { +#if 0 ExtensionEntry* extEntry; if ((extEntry = AddExtension(XF86BIGFONTNAME, @@ -149,10 +157,25 @@ XF86BigfontResetProc, StandardMinorOpcode))) { XF86BigfontReqCode = (unsigned char) extEntry->base; +#else + if (AddExtension(XF86BIGFONTNAME, + XF86BigfontNumberEvents, + XF86BigfontNumberErrors, + ProcXF86BigfontDispatch, + SProcXF86BigfontDispatch, + XF86BigfontResetProc, + StandardMinorOpcode)) { +#endif #ifdef HAS_SHM #ifdef MUST_CHECK_FOR_SHM_SYSCALL + /* + * Note: Local-clients will not be optimized without shared memory + * support. Remote-client optimization does not depend on shared + * memory support. Thus, the extension is still registered even + * when shared memory support is not functional. + */ if (!CheckForShmSyscall()) { - ErrorF(XF86BIGFONTNAME " extension disabled due to lack of shared memory support in the kernel\n"); + ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n"); return; } #endif Index: xc/programs/Xserver/Xext/xf86dga.c diff -u xc/programs/Xserver/Xext/xf86dga.c:3.21 xc/programs/Xserver/Xext/xf86dga.c:3.22 --- xc/programs/Xserver/Xext/xf86dga.c:3.21 Fri Jun 30 15:06:54 2000 +++ xc/programs/Xserver/Xext/xf86dga.c Tue Jul 15 21:38:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.22 2003/07/16 01:38:30 dawes Exp $ */ /* @@ -24,6 +24,8 @@ #include "swaprep.h" #include "dgaproc.h" +#include "xf86dgaext.h" + static DISPATCH_PROC(ProcXF86DGADirectVideo); static DISPATCH_PROC(ProcXF86DGAGetVidPage); @@ -270,8 +272,7 @@ } int -ProcXF86DGADispatch (client) - register ClientPtr client; +ProcXF86DGADispatch(register ClientPtr client) { REQUEST(xReq); Index: xc/programs/Xserver/Xext/xf86dga2.c diff -u xc/programs/Xserver/Xext/xf86dga2.c:1.17 xc/programs/Xserver/Xext/xf86dga2.c:1.18 --- xc/programs/Xserver/Xext/xf86dga2.c:1.17 Sat Oct 27 23:32:51 2001 +++ xc/programs/Xserver/Xext/xf86dga2.c Tue Jul 15 21:38:30 2003 @@ -3,7 +3,7 @@ Written by Mark Vojkovich */ -/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.18 2003/07/16 01:38:30 dawes Exp $ */ #define NEED_REPLIES @@ -24,6 +24,7 @@ #include "xf86dgastr.h" #include "swaprep.h" #include "dgaproc.h" +#include "xf86dgaext.h" #ifdef EXTMODULE #include "xf86_ansic.h" @@ -31,6 +32,7 @@ #include #endif +#include "modinit.h" static DISPATCH_PROC(ProcXDGADispatch); static DISPATCH_PROC(SProcXDGADispatch); @@ -51,10 +53,6 @@ static DISPATCH_PROC(ProcXDGAChangePixmapMode); static DISPATCH_PROC(ProcXDGACreateColormap); - -extern DISPATCH_PROC(ProcXF86DGADispatch); - - static void XDGAResetProc(ExtensionEntry *extEntry); static void DGAClientStateChange (CallbackListPtr*, pointer, pointer); @@ -78,7 +76,7 @@ #define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr) void -XFree86DGAExtensionInit(void) +XFree86DGAExtensionInit(INITARGS) { ExtensionEntry* extEntry; @@ -766,7 +764,7 @@ #ifdef EXTMODULE void -XFree86DGARegister() +XFree86DGARegister(INITARGS) { XDGAEventBase = &DGAEventBase; } Index: xc/programs/Xserver/Xext/xf86dgaext.h diff -u /dev/null xc/programs/Xserver/Xext/xf86dgaext.h:1.1 --- /dev/null Sat Feb 28 21:42:01 2004 +++ xc/programs/Xserver/Xext/xf86dgaext.h Tue Jul 15 21:38:30 2003 @@ -0,0 +1,8 @@ +/* $XFree86: xc/programs/Xserver/Xext/xf86dgaext.h,v 1.1 2003/07/16 01:38:30 dawes Exp $ */ + +#ifndef _XF86DGAEXT_H_ +#define _XF86DGAEXT_H_ + +extern DISPATCH_PROC(ProcXF86DGADispatch); + +#endif /* _XF86DGAEXT_H_ */ Index: xc/programs/Xserver/Xext/xf86misc.c diff -u xc/programs/Xserver/Xext/xf86misc.c:3.37 xc/programs/Xserver/Xext/xf86misc.c:3.42 --- xc/programs/Xserver/Xext/xf86misc.c:3.37 Tue Nov 19 23:04:58 2002 +++ xc/programs/Xserver/Xext/xf86misc.c Fri Feb 13 18:58:30 2004 @@ -1,7 +1,50 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.42 2004/02/13 23:58:30 dawes Exp $ */ /* * Copyright (c) 1995, 1996 The XFree86 Project, Inc + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ @@ -54,9 +97,7 @@ #define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr) static void XF86MiscResetProc( -#if NeedFunctionPrototypes ExtensionEntry* /* extEntry */ -#endif ); static void @@ -84,6 +125,7 @@ static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState); static DISPATCH_PROC(ProcXF86MiscSetClientVersion); static DISPATCH_PROC(ProcXF86MiscGetFilePaths); +static DISPATCH_PROC(ProcXF86MiscPassMessage); #ifdef _XF86MISC_SAVER_COMPAT_ static DISPATCH_PROC(ProcXF86MiscGetSaver); static DISPATCH_PROC(ProcXF86MiscSetSaver); @@ -97,12 +139,15 @@ static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState); static DISPATCH_PROC(SProcXF86MiscSetClientVersion); static DISPATCH_PROC(SProcXF86MiscGetFilePaths); +static DISPATCH_PROC(SProcXF86MiscPassMessage); #ifdef _XF86MISC_SAVER_COMPAT_ static DISPATCH_PROC(SProcXF86MiscGetSaver); static DISPATCH_PROC(SProcXF86MiscSetSaver); #endif +#if 0 static unsigned char XF86MiscReqCode = 0; +#endif #ifdef DEBUG # define DEBUG_P(x) ErrorF(x"\n"); @@ -148,7 +193,9 @@ SProcXF86MiscDispatch, XF86MiscResetProc, StandardMinorOpcode))) { +#if 0 XF86MiscReqCode = (unsigned char)extEntry->base; +#endif miscErrorBase = extEntry->errorBase; } } @@ -354,14 +401,13 @@ if (xf86GetVerbosity() > 1) { ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n", - stuff->mousetype, stuff->baudrate, - stuff->samplerate, stuff->chordmiddle); - ErrorF(" em3but: %d em3tim: %d res: %d flags: %d\n", - stuff->emulate3buttons, stuff->emulate3timeout, - stuff->resolution, stuff->flags); + (int)stuff->mousetype, (int)stuff->baudrate, + (int)stuff->samplerate, stuff->chordmiddle); + ErrorF(" em3but: %d em3tim: %d res: %d flags: %ld\n", + stuff->emulate3buttons, (int)stuff->emulate3timeout, + (int)stuff->resolution, (unsigned long)stuff->flags); } - if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0) return BadAlloc; @@ -427,8 +473,8 @@ if (xf86GetVerbosity() > 1) ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n", - stuff->kbdtype, stuff->rate, - stuff->delay, stuff->servnumlock); + (int)stuff->kbdtype, (int)stuff->rate, + (int)stuff->delay, stuff->servnumlock); if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0) return BadAlloc; @@ -555,6 +601,59 @@ } static int +ProcXF86MiscPassMessage(client) + register ClientPtr client; +{ + xXF86MiscPassMessageReply rep; + char *msgtype, *msgval, *retstr; + int retval, size; + register int n; + + REQUEST(xXF86MiscPassMessageReq); + + DEBUG_P("XF86MiscPassMessage"); + + REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq); + size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2; + size+= (stuff->typelen + 3) >> 2; + size+= (stuff->vallen + 3) >> 2; + if (client->req_len < size) + return BadLength; + if (stuff->typelen) { + if (!(msgtype = xalloc(stuff->typelen))) + return BadAlloc; + strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen); + } else return BadValue; + if (stuff->vallen) { + if (!(msgval = xalloc(stuff->vallen))) + return BadAlloc; + strncpy(msgval,(char*)(&stuff[1] + ((stuff->typelen + 3) & ~3)), + stuff->vallen); + } else return BadValue; + + if ((retval= MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0) + return retval; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.mesglen = (retstr? strlen(retstr): 0); + rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) + + ((rep.mesglen + 3) & ~3)) >> 2; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.mesglen, n); + } + WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep); + + if (rep.mesglen) + WriteToClient(client, rep.mesglen, (char *)retstr); + + return (client->noClientException); +} + +static int ProcXF86MiscDispatch (client) register ClientPtr client; { @@ -577,6 +676,8 @@ return ProcXF86MiscSetClientVersion(client); case X_XF86MiscGetFilePaths: return ProcXF86MiscGetFilePaths(client); + case X_XF86MiscPassMessage: + return ProcXF86MiscPassMessage(client); default: if (!xf86GetModInDevEnabled()) return miscErrorBase + XF86MiscModInDevDisabled; @@ -724,6 +825,17 @@ } static int +SProcXF86MiscPassMessage(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscPassMessageReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq); + return ProcXF86MiscPassMessage(client); +} + +static int SProcXF86MiscDispatch (client) register ClientPtr client; { @@ -746,6 +858,8 @@ return SProcXF86MiscSetClientVersion(client); case X_XF86MiscGetFilePaths: return SProcXF86MiscGetFilePaths(client); + case X_XF86MiscPassMessage: + return SProcXF86MiscPassMessage(client); default: if (!xf86GetModInDevEnabled()) return miscErrorBase + XF86MiscModInDevDisabled; Index: xc/programs/Xserver/Xext/xf86miscproc.h diff -u xc/programs/Xserver/Xext/xf86miscproc.h:1.5 xc/programs/Xserver/Xext/xf86miscproc.h:1.6 --- xc/programs/Xserver/Xext/xf86miscproc.h:1.5 Tue Nov 19 23:04:58 2002 +++ xc/programs/Xserver/Xext/xf86miscproc.h Thu Apr 3 11:15:47 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.6 2003/04/03 16:15:47 dawes Exp $ */ /* Prototypes for Pointer/Keyboard functions that the DDX must provide */ @@ -59,6 +59,8 @@ Bool MiscExtSetMouseDevice(pointer mouse, char* device); Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, const char **logfile); +int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval, + char **retstr); #endif Index: xc/programs/Xserver/Xext/xf86vmode.c diff -u xc/programs/Xserver/Xext/xf86vmode.c:3.54 xc/programs/Xserver/Xext/xf86vmode.c:3.59 --- xc/programs/Xserver/Xext/xf86vmode.c:3.54 Sat Dec 21 19:46:51 2002 +++ xc/programs/Xserver/Xext/xf86vmode.c Mon Nov 17 17:20:27 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.54 2002/12/22 00:46:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.59 2003/11/17 22:20:27 dawes Exp $ */ /* @@ -64,9 +64,7 @@ #define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr) static void XF86VidModeResetProc( -#if NeedFunctionPrototypes ExtensionEntry* /* extEntry */ -#endif ); static DISPATCH_PROC(ProcXF86VidModeDispatch); @@ -112,8 +110,9 @@ static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp); static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize); +#if 0 static unsigned char XF86VidModeReqCode = 0; - +#endif /* The XF86VIDMODE_EVENTS code is far from complete */ @@ -217,7 +216,9 @@ SProcXF86VidModeDispatch, XF86VidModeResetProc, StandardMinorOpcode))) { +#if 0 XF86VidModeReqCode = (unsigned char)extEntry->base; +#endif VidModeErrorBase = extEntry->errorBase; #ifdef XF86VIDMODE_EVENTS XF86VidModeEventBase = extEntry->eventBase; @@ -467,14 +468,14 @@ rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); if (xf86GetVerbosity() > 1) { - ErrorF("GetModeLine - scrn: %d clock: %d\n", - stuff->screen, rep.dotclock); + ErrorF("GetModeLine - scrn: %d clock: %ld\n", + stuff->screen, (unsigned long)rep.dotclock); ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", rep.vdisplay, rep.vsyncstart, rep.vsyncend, - rep.vtotal, rep.flags); + rep.vtotal, (unsigned long)rep.flags); } /* @@ -675,22 +676,23 @@ stuff->after_flags = oldstuff->after_flags; } if (xf86GetVerbosity() > 1) { - ErrorF("AddModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("AddModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); - ErrorF(" after - scrn: %d clock: %d\n", - stuff->screen, stuff->after_dotclock); + stuff->vtotal, (unsigned long)stuff->flags); + ErrorF(" after - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->after_dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->after_hdisplay, stuff->after_hsyncstart, stuff->after_hsyncend, stuff->after_htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->after_vdisplay, stuff->after_vsyncstart, - stuff->after_vsyncend, stuff->after_vtotal, stuff->after_flags); + stuff->after_vsyncend, stuff->after_vtotal, + (unsigned long)stuff->after_flags); } if (ver < 2) { @@ -742,6 +744,7 @@ if (mode == NULL) return BadValue; + VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend); @@ -821,14 +824,14 @@ stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("DeleteModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock, stuff->dotclock); + ErrorF("DeleteModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -840,8 +843,11 @@ } if (len != stuff->privsize) { if (xf86GetVerbosity() > 1) { - ErrorF("req_len = %d, sizeof(Req) = %d, privsize = %d, len = %d, length = %d\n", - client->req_len, sizeof(xXF86VidModeDeleteModeLineReq)>>2, stuff->privsize, len, stuff->length); + ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, " + "len = %d, length = %d\n", + (unsigned long)client->req_len, + (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2, + (unsigned long)stuff->privsize, len, stuff->length); } return BadLength; } @@ -935,11 +941,11 @@ } if (xf86GetVerbosity() > 1) { ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n", - stuff->screen, stuff->hdisplay, stuff->hsyncstart, + (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -989,18 +995,23 @@ break; case MODE_HSYNC: case MODE_H_ILLEGAL: + xfree(modetmp); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: + xfree(modetmp); return VidModeErrorBase + XF86VidModeBadVTimings; default: + xfree(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) { + xfree(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } + xfree(modetmp); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); @@ -1029,7 +1040,7 @@ (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; xXF86VidModeValidateModeLineReply rep; - pointer mode, modetmp; + pointer mode, modetmp = NULL; int len, status, dotClock; int ver; @@ -1055,14 +1066,14 @@ stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("ValidateModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("ValidateModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -1119,6 +1130,9 @@ status = VidModeCheckModeForDriver(stuff->screen, modetmp); status_reply: + if(modetmp) + xfree(modetmp); + rep.type = X_Reply; rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply) - SIZEOF(xGenericReply)) >> 2; @@ -1186,14 +1200,14 @@ stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("SwitchToMode - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("SwitchToMode - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { Index: xc/programs/Xserver/Xext/xprint.c diff -u xc/programs/Xserver/Xext/xprint.c:1.13 xc/programs/Xserver/Xext/xprint.c:1.15 --- xc/programs/Xserver/Xext/xprint.c:1.13 Fri Nov 23 14:21:31 2001 +++ xc/programs/Xserver/Xext/xprint.c Tue Oct 28 18:08:44 2003 @@ -64,7 +64,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.13 2001/11/23 19:21:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.15 2003/10/28 23:08:44 tsi Exp $ */ #define _XP_PRINT_SERVER_ #include "X.h" @@ -83,6 +83,7 @@ #include "Printstr.h" #include "../Xprint/DiPrint.h" #include "../Xprint/attributes.h" +#include "modinit.h" static void XpResetProc(ExtensionEntry *); @@ -282,7 +283,7 @@ */ void -XpExtensionInit(void) +XpExtensionInit(INITARGS) { ExtensionEntry *extEntry; int i; @@ -753,15 +754,17 @@ return XpErrorBase+XPBadContext; } - if(pContext->funcs.GetMediumDimensions != 0) - result = pContext->funcs.GetMediumDimensions(pContext, &width, &height); - else + if((pContext->funcs.GetMediumDimensions == 0) || + (pContext->funcs.GetReproducibleArea == 0)) return BadImplementation; - if(pContext->funcs.GetReproducibleArea != 0) + result = pContext->funcs.GetMediumDimensions(pContext, &width, &height); + if(result != Success) + return result; + result = pContext->funcs.GetReproducibleArea(pContext, &rect); - else - return BadImplementation; + if(result != Success) + return result; rep.type = X_Reply; rep.sequenceNumber = client->sequence; @@ -814,11 +817,13 @@ } rep.prevRes = pContext->imageRes; - if(pContext->funcs.SetImageResolution != 0) + if(pContext->funcs.SetImageResolution != 0) { result = pContext->funcs.SetImageResolution(pContext, (int)stuff->imageRes, &status); - else + if(result != Success) + status = FALSE; + } else status = FALSE; rep.type = X_Reply; @@ -1491,7 +1496,6 @@ REQUEST(xPrintStartJobReq); XpContextPtr pContext; int result = Success; - XpScreenPtr pPrintScreen; REQUEST_SIZE_MATCH(xPrintStartJobReq); @@ -1509,7 +1513,6 @@ return BadValue; } - pPrintScreen = XpScreens[pContext->screenNum]; if(pContext->funcs.StartJob != 0) result = pContext->funcs.StartJob(pContext, (stuff->saveData == XPGetData)? TRUE:FALSE, @@ -1533,7 +1536,6 @@ ProcXpEndJob(ClientPtr client) { REQUEST(xPrintEndJobReq); - XpScreenPtr pPrintScreen; int result = Success; XpContextPtr pContext; @@ -1543,8 +1545,6 @@ == (XpContextPtr)NULL) return XpErrorBase+XPBadSequence; - pPrintScreen = XpScreens[pContext->screenNum]; - if(!(pContext->state & JOB_STARTED)) return XpErrorBase+XPBadSequence; @@ -1603,8 +1603,6 @@ static Bool DoStartDoc(ClientPtr client, XpStDocPtr c) { - XpScreenPtr pPrintScreen; - int result = Success; XpContextPtr pContext = c->pContext; if(c->pContext->state & JOB_GET_DATA && @@ -1619,10 +1617,8 @@ return TRUE; } - pPrintScreen = XpScreens[pContext->screenNum]; - if(pContext->funcs.StartDoc != 0) - result = pContext->funcs.StartDoc(pContext, c->type); + (void) pContext->funcs.StartDoc(pContext, c->type); else { SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0, @@ -1682,7 +1678,6 @@ ProcXpEndDoc(ClientPtr client) { REQUEST(xPrintEndDocReq); - XpScreenPtr pPrintScreen; XpContextPtr pContext; int result = Success; @@ -1692,8 +1687,6 @@ == (XpContextPtr)NULL) return XpErrorBase+XPBadSequence; - pPrintScreen = XpScreens[pContext->screenNum]; - if(!(pContext->state & DOC_RAW_STARTED) && !(pContext->state & DOC_COOKED_STARTED)) return XpErrorBase+XPBadSequence; @@ -1744,7 +1737,6 @@ ClientPtr client, XpStPagePtr c) { - XpScreenPtr pPrintScreen; WindowPtr pWin = c->pWin; int result = Success; XpContextPtr pContext = c->pContext; @@ -1815,9 +1807,6 @@ pPage->context = pContext; pContext->pageWin = c->pWin->drawable.id; - pPrintScreen = XpScreens[pContext->screenNum]; - - if(pContext->funcs.StartPage != 0) result = pContext->funcs.StartPage(pContext, pWin); else @@ -1884,7 +1873,6 @@ ProcXpEndPage(ClientPtr client) { REQUEST(xPrintEndPageReq); - XpScreenPtr pPrintScreen; int result = Success; XpContextPtr pContext; XpPagePtr page; @@ -1899,7 +1887,6 @@ if(!(pContext->state & PAGE_STARTED)) return XpErrorBase+XPBadSequence; - pPrintScreen = XpScreens[pContext->screenNum]; pWin = (WindowPtr )LookupIDByType(pContext->pageWin, RT_WINDOW); /* Call the ddx's EndPage proc. */ Index: xc/programs/Xserver/Xext/xres.c diff -u xc/programs/Xserver/Xext/xres.c:1.5 xc/programs/Xserver/Xext/xres.c:1.8 --- xc/programs/Xserver/Xext/xres.c:1.5 Sun Jun 30 22:25:55 2002 +++ xc/programs/Xserver/Xext/xres.c Tue Oct 28 18:08:44 2003 @@ -1,7 +1,7 @@ /* Copyright (c) 2002 XFree86 Inc */ -/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.5 2002/07/01 02:25:55 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.8 2003/10/28 23:08:44 tsi Exp $ */ #define NEED_EVENTS #define NEED_REPLIES @@ -14,10 +14,7 @@ #include "swaprep.h" #include "XResproto.h" #include "pixmapstr.h" - -extern RESTYPE lastResourceType; -extern RESTYPE TypeMask; -extern Atom *ResourceNames; +#include "modinit.h" static int ProcXResQueryVersion (ClientPtr client) @@ -30,6 +27,8 @@ client_major = stuff->client_major; client_minor = stuff->client_minor; + (void) client_major; + (void) client_minor; rep.type = X_Reply; rep.length = 0; @@ -314,11 +313,9 @@ } void -ResExtensionInit(void) +ResExtensionInit(INITARGS) { - ExtensionEntry *extEntry; - - extEntry = AddExtension(XRES_NAME, 0, 0, + (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, ResResetProc, StandardMinorOpcode); Index: xc/programs/Xserver/Xext/xtest.c diff -u xc/programs/Xserver/Xext/xtest.c:3.7 xc/programs/Xserver/Xext/xtest.c:3.11 --- xc/programs/Xserver/Xext/xtest.c:3.7 Fri Dec 14 14:58:51 2001 +++ xc/programs/Xserver/Xext/xtest.c Mon Nov 17 17:20:27 2003 @@ -26,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.7 2001/12/14 19:58:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.11 2003/11/17 22:20:27 dawes Exp $ */ #include "X.h" #define NEED_EVENTS @@ -53,22 +53,27 @@ #include "xf86_ansic.h" #endif +#include "modinit.h" + +#if 0 static unsigned char XTestReqCode; +#endif #ifdef XINPUT extern int DeviceValuator; #endif /* XINPUT */ +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" +#endif + static void XTestResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static int XTestSwapFakeInput( -#if NeedFunctionPrototypes ClientPtr /* client */, xReq * /* req */ -#endif ); static DISPATCH_PROC(ProcXTestCompareCursor); @@ -83,14 +88,20 @@ static DISPATCH_PROC(SProcXTestGrabControl); void -XTestExtensionInit() +XTestExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestResetProc, StandardMinorOpcode)) != 0) XTestReqCode = (unsigned char)extEntry->base; +#else + (void) AddExtension(XTestExtensionName, 0, 0, + ProcXTestDispatch, SProcXTestDispatch, + XTestResetProc, StandardMinorOpcode); +#endif } /*ARGSUSED*/ @@ -378,6 +389,33 @@ client->errorValue = ev->u.u.detail; return BadValue; } + +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + ScreenPtr pScreen = root->drawable.pScreen; + BoxRec box; + int i; + int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x; + int y = ev->u.keyButtonPointer.rootY + panoramiXdataPtr[0].y; + if (!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], + x, y, &box)) { + FOR_NSCREENS(i) { + if (i == pScreen->myNum) continue; + if (POINT_IN_REGION(pScreen, + &XineramaScreenRegions[i], + x, y, &box)) { + root = WindowTable[i]; + x -= panoramiXdataPtr[i].x; + y -= panoramiXdataPtr[i].y; + ev->u.keyButtonPointer.rootX = x; + ev->u.keyButtonPointer.rootY = y; + break; + } + } + } + } +#endif + if (ev->u.keyButtonPointer.rootX < 0) ev->u.keyButtonPointer.rootX = 0; else if (ev->u.keyButtonPointer.rootX >= root->drawable.width) @@ -386,7 +424,15 @@ ev->u.keyButtonPointer.rootY = 0; else if (ev->u.keyButtonPointer.rootY >= root->drawable.height) ev->u.keyButtonPointer.rootY = root->drawable.height - 1; + +#ifdef PANORAMIX + if ((!noPanoramiXExtension + && root->drawable.pScreen->myNum != XineramaGetCursorScreen()) + || (noPanoramiXExtension && root != GetCurrentRootWindow())) + +#else if (root != GetCurrentRootWindow()) +#endif { NewCurrentScreen(root->drawable.pScreen, ev->u.keyButtonPointer.rootX, Index: xc/programs/Xserver/Xext/xtest1dd.c diff -u xc/programs/Xserver/Xext/xtest1dd.c:3.5 xc/programs/Xserver/Xext/xtest1dd.c:3.7 --- xc/programs/Xserver/Xext/xtest1dd.c:3.5 Fri Dec 14 14:58:52 2001 +++ xc/programs/Xserver/Xext/xtest1dd.c Mon Nov 17 17:20:28 2003 @@ -52,7 +52,7 @@ University of California. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.5 2001/12/14 19:58:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.7 2003/11/17 22:20:28 dawes Exp $ */ /*************************************************************** * include files @@ -158,11 +158,6 @@ */ static int packet_index; /* - * set to 1 when the input action event is full and needs to be sent to the - * client - */ -static int input_action_event_full = 0; -/* * logical x position of the mouse during input action gathering */ short xtest_mousex; @@ -171,14 +166,6 @@ */ short xtest_mousey; /* - * logical x position of the mouse during input action playback - */ -static short mx; -/* - * logical y position of the mouse during input action playback - */ -static short my; -/* * logical x position of the mouse while we are reading fake input actions * from the client and putting them into the fake input action array */ @@ -288,60 +275,38 @@ ***************************************************************/ static void parse_key_fake( -#if NeedFunctionPrototypes XTestKeyInfo * /* fkey */ -#endif ); static void parse_motion_fake( -#if NeedFunctionPrototypes XTestMotionInfo * /* fmotion */ -#endif ); static void parse_jump_fake( -#if NeedFunctionPrototypes XTestJumpInfo * /* fjump */ -#endif ); static void parse_delay_fake( -#if NeedFunctionPrototypes XTestDelayInfo * /* tevent */ -#endif ); static void send_ack( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); static void start_play_clock( -#if NeedFunctionPrototypes void -#endif ); static void compute_action_time( -#if NeedFunctionPrototypes struct timeval * /* rtime */ -#endif ); static int find_residual_time( -#if NeedFunctionPrototypes struct timeval * /* rtime */ -#endif ); static CARD16 check_time_event( -#if NeedFunctionPrototypes void -#endif ); static CARD32 current_ms( -#if NeedFunctionPrototypes struct timeval * /* otime */ -#endif ); static int there_is_room( -#if NeedFunctionPrototypes int /* actsize */ -#endif ); /****************************************************************************** @@ -471,7 +436,6 @@ /* * re-initialize the input action event */ - input_action_event_full = 0; input_action_packet.type = XTestInputActionType; packet_index = 0; } @@ -690,7 +654,6 @@ { if ((packet_index + actsize) > XTestACTIONS_SIZE) { - input_action_event_full = 1; return(0); } else @@ -1316,8 +1279,6 @@ action_array[read_index].x, action_array[read_index].y, action_array[read_index].device); - mx = action_array[read_index].x; - my = action_array[read_index].y; } if (action_array[read_index].type == XTestKEY_ACTION) { Index: xc/programs/Xserver/Xext/xtest1dd.h diff -u xc/programs/Xserver/Xext/xtest1dd.h:3.2 xc/programs/Xserver/Xext/xtest1dd.h:3.3 --- xc/programs/Xserver/Xext/xtest1dd.h:3.2 Tue Jul 31 20:44:44 2001 +++ xc/programs/Xserver/Xext/xtest1dd.h Mon Nov 17 17:20:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.2 2001/08/01 00:44:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.3 2003/11/17 22:20:28 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -35,117 +35,89 @@ extern KeyCode xtest_command_key; extern void stop_stealing_input( -#if NeedFunctionPrototypes void -#endif ); extern void steal_input( -#if NeedFunctionPrototypes ClientPtr /* client */, CARD32 /* mode */ -#endif ); extern void flush_input_actions( -#if NeedFunctionPrototypes void -#endif ); extern void XTestStealJumpData( -#if NeedFunctionPrototypes int /* jx */, int /* jy */, int /* dev_type */ -#endif ); extern void XTestStealMotionData( -#if NeedFunctionPrototypes int /* dx */, int /* dy */, int /* dev_type */, int /* mx */, int /* my */ -#endif ); extern Bool XTestStealKeyData( -#if NeedFunctionPrototypes unsigned /* keycode */, int /* keystate */, int /* dev_type */, int /* locx */, int /* locy */ -#endif ); extern void parse_fake_input( -#if NeedFunctionPrototypes ClientPtr /* client */, char * /* req */ -#endif ); extern void XTestComputeWaitTime( -#if NeedFunctionPrototypes struct timeval * /* waittime */ -#endif ); extern int XTestProcessInputAction( -#if NeedFunctionPrototypes int /* readable */, struct timeval * /* waittime */ -#endif ); extern void abort_play_back( -#if NeedFunctionPrototypes void -#endif ); extern void return_input_array_size( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern void XTestGenerateEvent( -#if NeedFunctionPrototypes int /* dev_type */, int /* keycode */, int /* keystate */, int /* mousex */, int /* mousey */ -#endif ); extern void XTestGetPointerPos( -#if NeedFunctionPrototypes short * /* fmousex */, short * /* fmousey */ -#endif ); extern void XTestJumpPointer( -#if NeedFunctionPrototypes int /* jx */, int /* jy */, int /* dev_type */ -#endif ); #endif /* XTEST1DD_H */ Index: xc/programs/Xserver/Xext/xtest1di.c diff -u xc/programs/Xserver/Xext/xtest1di.c:3.3 xc/programs/Xserver/Xext/xtest1di.c:3.6 --- xc/programs/Xserver/Xext/xtest1di.c:3.3 Fri Dec 14 14:58:52 2001 +++ xc/programs/Xserver/Xext/xtest1di.c Mon Nov 17 17:20:28 2003 @@ -52,7 +52,7 @@ University of California. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.3 2001/12/14 19:58:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.6 2003/11/17 22:20:28 dawes Exp $ */ /***************************************************************************** * include files @@ -72,6 +72,7 @@ #include "opaque.h" #define XTestSERVER_SIDE #include "xtestext1.h" +#include "modinit.h" #include "xtest1dd.h" @@ -80,23 +81,6 @@ ****************************************************************************/ /***************************************************************************** - * externals - ****************************************************************************/ - -/* - * id of client using XTestGetInput - * - * defined in xtest1dd.c - */ -extern ClientPtr current_xtest_client; -/* - * id of client using XTestFakeInput - * - * defined in xtest1dd.c - */ -extern ClientPtr playback_client; - -/***************************************************************************** * variables ****************************************************************************/ @@ -150,29 +134,21 @@ static DISPATCH_PROC(SProcTestQueryInputSize); static void XTestResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* unused */ -#endif ); static void SReplyXTestDispatch( -#if NeedFunctionPrototypes ClientPtr /* client_ptr */, int /* size */, char * /* reply_ptr */ -#endif ); static void SEventXTestDispatch( -#if NeedFunctionPrototypes xEvent * /* from */, xEvent * /* to */ -#endif ); static int XTestCurrentClientGone( -#if NeedFunctionPrototypes pointer /* value */, XID /* id */ -#endif ); /***************************************************************************** @@ -186,7 +162,7 @@ * (other than the core errors). */ void -XTestExtension1Init() +XTestExtension1Init(INITARGS) { /* * holds the pointer to the extension entry structure Index: xc/programs/Xserver/Xext/xvdisp.c diff -u xc/programs/Xserver/Xext/xvdisp.c:1.25 xc/programs/Xserver/Xext/xvdisp.c:1.29 --- xc/programs/Xserver/Xext/xvdisp.c:1.25 Sun Nov 18 18:55:48 2001 +++ xc/programs/Xserver/Xext/xvdisp.c Thu Oct 2 09:29:39 2003 @@ -21,7 +21,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.25 2001/11/18 23:55:48 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.29 2003/10/02 13:29:39 eich Exp $ */ /* ** File: @@ -70,6 +70,8 @@ #include "xf86_ansic.h" #endif +#include "xvdisp.h" + #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" @@ -1207,7 +1209,7 @@ #endif #ifdef XvMCExtension -XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); +#include "xvmcext.h" #endif static int @@ -1939,8 +1941,7 @@ client, stuff->port, XvXRTPort, SecurityReadAccess))) return _XvBadPort; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; @@ -1987,8 +1988,7 @@ client, stuff->port, XvXRTPort, SecurityReadAccess))) return _XvBadPort; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; @@ -2033,8 +2033,7 @@ client, stuff->port, XvXRTPort, SecurityReadAccess))) return _XvBadPort; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; @@ -2079,8 +2078,7 @@ client, stuff->port, XvXRTPort, SecurityReadAccess))) return _XvBadPort; - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); + isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; Index: xc/programs/Xserver/Xext/xvdisp.h diff -u /dev/null xc/programs/Xserver/Xext/xvdisp.h:1.1 --- /dev/null Sat Feb 28 21:42:02 2004 +++ xc/programs/Xserver/Xext/xvdisp.h Tue Jul 15 21:38:31 2003 @@ -0,0 +1,3 @@ +/* $XFree86: xc/programs/Xserver/Xext/xvdisp.h,v 1.1 2003/07/16 01:38:31 dawes Exp $ */ + +extern void XineramifyXv(void); Index: xc/programs/Xserver/Xext/xvmain.c diff -u xc/programs/Xserver/Xext/xvmain.c:1.13 xc/programs/Xserver/Xext/xvmain.c:1.16 --- xc/programs/Xserver/Xext/xvmain.c:1.13 Thu Aug 23 09:01:36 2001 +++ xc/programs/Xserver/Xext/xvmain.c Tue Oct 28 18:08:44 2003 @@ -21,7 +21,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.13 2001/08/23 13:01:36 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.16 2003/10/28 23:08:44 tsi Exp $ */ /* ** File: @@ -101,7 +101,7 @@ #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" -extern void XineramifyXv(void); +#include "xvdisp.h" #endif int XvScreenIndex = -1; @@ -594,6 +594,15 @@ } + +#define CHECK_SIZE(dw, dh, sw, sh) { \ + if(!dw || !dh || !sw || !sh) return Success; \ + /* The region code will break these if they are too large */ \ + if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \ + return BadValue; \ +} + + int XvdiPutVideo( ClientPtr client, @@ -605,11 +614,9 @@ INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ - int status; DrawablePtr pOldDraw; - if(!drw_w || !drw_h || !vid_w || !vid_h) - return Success; + CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ @@ -633,7 +640,7 @@ XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - status = (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC, + (void) (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -662,8 +669,7 @@ ){ int status; - if(!drw_w || !drw_h || !vid_w || !vid_h) - return Success; + CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ @@ -703,8 +709,7 @@ Bool sync, CARD16 width, CARD16 height ){ - if(!drw_w || !drw_h || !src_w || !src_h) - return Success; + CHECK_SIZE(drw_w, drw_h, src_w, src_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ @@ -739,11 +744,9 @@ INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ - int status; DrawablePtr pOldDraw; - if(!drw_w || !drw_h || !vid_w || !vid_h) - return Success; + CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ @@ -767,7 +770,7 @@ XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - status = (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC, + (void) (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -796,8 +799,7 @@ ){ int status; - if(!drw_w || !drw_h || !vid_w || !vid_h) - return Success; + CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ Index: xc/programs/Xserver/Xext/xvmc.c diff -u xc/programs/Xserver/Xext/xvmc.c:1.7 xc/programs/Xserver/Xext/xvmc.c:1.9 --- xc/programs/Xserver/Xext/xvmc.c:1.7 Sun Nov 18 18:55:48 2001 +++ xc/programs/Xserver/Xext/xvmc.c Thu Jul 17 12:04:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.7 2001/11/18 23:55:48 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.9 2003/07/17 16:04:33 dawes Exp $ */ #define NEED_REPLIES #define NEED_EVENTS Index: xc/programs/Xserver/Xext/xvmcext.h diff -u xc/programs/Xserver/Xext/xvmcext.h:1.1 xc/programs/Xserver/Xext/xvmcext.h:1.2 --- xc/programs/Xserver/Xext/xvmcext.h:1.1 Sat Apr 7 07:04:21 2001 +++ xc/programs/Xserver/Xext/xvmcext.h Thu Jul 17 12:04:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.1 2001/04/07 11:04:21 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.2 2003/07/17 16:04:33 dawes Exp $ */ #ifndef _XVMC_H #define _XVMC_H @@ -106,4 +106,6 @@ int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt); +XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); + #endif /* _XVMC_H */ Index: xc/programs/Xserver/Xext/extmod/modinit.c diff -u xc/programs/Xserver/Xext/extmod/modinit.c:1.16 xc/programs/Xserver/Xext/extmod/modinit.c:1.17 --- xc/programs/Xserver/Xext/extmod/modinit.c:1.16 Wed Mar 6 16:12:33 2002 +++ xc/programs/Xserver/Xext/extmod/modinit.c Tue Jul 15 21:38:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.17 2003/07/16 01:38:33 dawes Exp $ */ /* * @@ -31,113 +31,9 @@ #include "Xproto.h" -static MODULESETUPPROTO(extmodSetup); - -extern Bool noTestExtensions; - -#ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); -#define _SHAPE_SERVER_ /* don't want Xlib structures */ -#include "shapestr.h" -#endif - -#ifdef MULTIBUFFER -extern void MultibufferExtensionInit(INITARGS); -#define _MULTIBUF_SERVER_ /* don't want Xlib structures */ -#include "multibufst.h" -#endif - -#ifdef MITMISC -extern void MITMiscExtensionInit(INITARGS); -#define _MITMISC_SERVER_ -#include "mitmiscstr.h" -#endif - -#ifdef XTEST -extern void XTestExtensionInit(INITARGS); -#define _XTEST_SERVER_ -#include "XTest.h" -#include "xteststr.h" -#endif - -#ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); -#include "bigreqstr.h" -#endif - -#ifdef XSYNC -extern void SyncExtensionInit(INITARGS); -#define _SYNC_SERVER -#include "sync.h" -#include "syncstr.h" -#endif - -#ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); -#include "saver.h" -#endif - -#ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); -#include "xcmiscstr.h" -#endif - -#ifdef XF86VIDMODE -extern void XFree86VidModeExtensionInit(INITARGS); -#define _XF86VIDMODE_SERVER_ -#include "xf86vmstr.h" -#endif - -#ifdef XF86MISC -extern void XFree86MiscExtensionInit(INITARGS); -#define _XF86MISC_SERVER_ -#define _XF86MISC_SAVER_COMPAT_ -#include "xf86mscstr.h" -#endif - -#ifdef XFreeXDGA -extern void XFree86DGAExtensionInit(INITARGS); -extern void XFree86DGARegister(INITARGS); -#define _XF86DGA_SERVER_ -#include "xf86dgastr.h" -#endif - -#ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); -#include "dpmsstr.h" -#endif - -#ifdef FONTCACHE -extern void FontCacheExtensionInit(INITARGS); -#define _FONTCACHE_SERVER_ -#include "fontcacheP.h" -#include "fontcachstr.h" -#endif - -#ifdef TOGCUP -extern void XcupExtensionInit(INITARGS); -#define _XCUP_SERVER_ -#include "Xcupstr.h" -#endif - -#ifdef EVI -extern void EVIExtensionInit(INITARGS); -#define _XEVI_SERVER_ -#include "XEVIstr.h" -#endif +#include "modinit.h" -#ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -extern void XvRegister(INITARGS); -#include "Xv.h" -#include "XvMC.h" -#endif - -#ifdef RES -extern void ResExtensionInit(INITARGS); -#include "XResproto.h" -#endif +static MODULESETUPPROTO(extmodSetup); /* * Array describing extensions to be initialized Index: xc/programs/Xserver/Xext/extmod/modinit.h diff -u /dev/null xc/programs/Xserver/Xext/extmod/modinit.h:1.2 --- /dev/null Sat Feb 28 21:42:02 2004 +++ xc/programs/Xserver/Xext/extmod/modinit.h Sat Sep 13 17:33:04 2003 @@ -0,0 +1,144 @@ +/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.2 2003/09/13 21:33:04 dawes Exp $ */ + +#ifndef INITARGS +#define INITARGS void +#endif + +#ifdef SHAPE +extern void ShapeExtensionInit(INITARGS); +#define _SHAPE_SERVER_ /* don't want Xlib structures */ +#include "shapestr.h" +#endif + +#ifdef MULTIBUFFER +extern void MultibufferExtensionInit(INITARGS); +#define _MULTIBUF_SERVER_ /* don't want Xlib structures */ +#include "multibufst.h" +#endif + +#ifdef MITMISC +extern void MITMiscExtensionInit(INITARGS); +#define _MITMISC_SERVER_ +#include "mitmiscstr.h" +#endif + +#ifdef XTEST +extern void XTestExtensionInit(INITARGS); +#define _XTEST_SERVER_ +#include "XTest.h" +#include "xteststr.h" +#endif + +#if 1 +extern void XTestExtension1Init(INITARGS); +#endif + +#ifdef BIGREQS +extern void BigReqExtensionInit(INITARGS); +#include "bigreqstr.h" +#endif + +#ifdef XSYNC +extern void SyncExtensionInit(INITARGS); +#define _SYNC_SERVER +#include "sync.h" +#include "syncstr.h" +#endif + +#ifdef SCREENSAVER +extern void ScreenSaverExtensionInit (INITARGS); +#include "saver.h" +#endif + +#ifdef XCMISC +extern void XCMiscExtensionInit(INITARGS); +#include "xcmiscstr.h" +#endif + +#ifdef XF86VIDMODE +extern void XFree86VidModeExtensionInit(INITARGS); +#define _XF86VIDMODE_SERVER_ +#include "xf86vmstr.h" +#endif + +#ifdef XF86MISC +extern void XFree86MiscExtensionInit(INITARGS); +#define _XF86MISC_SERVER_ +#define _XF86MISC_SAVER_COMPAT_ +#include "xf86mscstr.h" +#endif + +#ifdef XFreeXDGA +extern void XFree86DGAExtensionInit(INITARGS); +extern void XFree86DGARegister(INITARGS); +#define _XF86DGA_SERVER_ +#include "xf86dgastr.h" +#endif + +#ifdef DPMSExtension +extern void DPMSExtensionInit(INITARGS); +#include "dpmsstr.h" +#endif + +#ifdef FONTCACHE +extern void FontCacheExtensionInit(INITARGS); +#define _FONTCACHE_SERVER_ +#include "fontcacheP.h" +#include "fontcachstr.h" +#endif + +#ifdef TOGCUP +extern void XcupExtensionInit(INITARGS); +#define _XCUP_SERVER_ +#include "Xcupstr.h" +#endif + +#ifdef EVI +extern void EVIExtensionInit(INITARGS); +#define _XEVI_SERVER_ +#include "XEVIstr.h" +#endif + +#ifdef XV +extern void XvExtensionInit(INITARGS); +extern void XvMCExtensionInit(INITARGS); +extern void XvRegister(INITARGS); +#include "Xv.h" +#include "XvMC.h" +#endif + +#ifdef RES +extern void ResExtensionInit(INITARGS); +#include "XResproto.h" +#endif + +#ifdef SHM +extern void ShmExtensionInit(INITARGS); +#include "shmstr.h" +extern void ShmSetPixmapFormat( + ScreenPtr pScreen, + int format); +extern void ShmRegisterFuncs( + ScreenPtr pScreen, + ShmFuncsPtr funcs); +#endif + +#if 1 +extern void SecurityExtensionInit(INITARGS); +#endif + +#if 1 +extern void XagExtensionInit(INITARGS); +#endif + +#if 1 +extern void XpExtensionInit(INITARGS); +#endif + +#if 1 +extern void PanoramiXExtensionInit(int argc, char *argv[]); +#endif + +#if 1 +extern void XkbExtensionInit(INITARGS); +#endif Index: xc/programs/Xserver/Xi/allowev.h diff -u xc/programs/Xserver/Xi/allowev.h:3.1 xc/programs/Xserver/Xi/allowev.h:3.2 --- xc/programs/Xserver/Xi/allowev.h:3.1 Mon Apr 15 07:18:23 1996 +++ xc/programs/Xserver/Xi/allowev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.1 1996/04/15 11:18:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXAllowDeviceEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXAllowDeviceEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* ALLOWEV_H */ Index: xc/programs/Xserver/Xi/chgdctl.h diff -u xc/programs/Xserver/Xi/chgdctl.h:3.1 xc/programs/Xserver/Xi/chgdctl.h:3.2 --- xc/programs/Xserver/Xi/chgdctl.h:3.1 Mon Apr 15 07:18:25 1996 +++ xc/programs/Xserver/Xi/chgdctl.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.1 1996/04/15 11:18:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXChangeDeviceControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangeDeviceControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXChangeDeviceControl ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xChangeDeviceControlReply * /* rep */ -#endif ); #endif /* CHGDCTL_H */ Index: xc/programs/Xserver/Xi/chgfctl.h diff -u xc/programs/Xserver/Xi/chgfctl.h:3.1 xc/programs/Xserver/Xi/chgfctl.h:3.2 --- xc/programs/Xserver/Xi/chgfctl.h:3.1 Mon Apr 15 07:18:26 1996 +++ xc/programs/Xserver/Xi/chgfctl.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.1 1996/04/15 11:18:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,82 +29,66 @@ int SProcXChangeFeedbackControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangeFeedbackControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ChangeKbdFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, KbdFeedbackPtr /* k */, xKbdFeedbackCtl * /* f */ -#endif ); int ChangePtrFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, PtrFeedbackPtr /* p */, xPtrFeedbackCtl * /* f */ -#endif ); int ChangeIntegerFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, IntegerFeedbackPtr /* i */, xIntegerFeedbackCtl * /* f */ -#endif ); int ChangeStringFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, StringFeedbackPtr /* s */, xStringFeedbackCtl * /* f */ -#endif ); int ChangeBellFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, BellFeedbackPtr /* b */, xBellFeedbackCtl * /* f */ -#endif ); int ChangeLedFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned long /* mask */, LedFeedbackPtr /* l */, xLedFeedbackCtl * /* f */ -#endif ); #endif /* CHGFCTL_H */ Index: xc/programs/Xserver/Xi/chgkbd.h diff -u xc/programs/Xserver/Xi/chgkbd.h:3.1 xc/programs/Xserver/Xi/chgkbd.h:3.2 --- xc/programs/Xserver/Xi/chgkbd.h:3.1 Mon Apr 15 07:18:27 1996 +++ xc/programs/Xserver/Xi/chgkbd.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.1 1996/04/15 11:18:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXChangeKeyboardDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangeKeyboardDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXChangeKeyboardDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xChangeKeyboardDeviceReply * /* rep */ -#endif ); Index: xc/programs/Xserver/Xi/chgkmap.h diff -u xc/programs/Xserver/Xi/chgkmap.h:3.1 xc/programs/Xserver/Xi/chgkmap.h:3.2 --- xc/programs/Xserver/Xi/chgkmap.h:3.1 Mon Apr 15 07:18:28 1996 +++ xc/programs/Xserver/Xi/chgkmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.1 1996/04/15 11:18:28 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXChangeDeviceKeyMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangeDeviceKeyMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* CHGKMAP_H */ Index: xc/programs/Xserver/Xi/chgprop.h diff -u xc/programs/Xserver/Xi/chgprop.h:3.1 xc/programs/Xserver/Xi/chgprop.h:3.2 --- xc/programs/Xserver/Xi/chgprop.h:3.1 Mon Apr 15 07:18:29 1996 +++ xc/programs/Xserver/Xi/chgprop.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.1 1996/04/15 11:18:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXChangeDeviceDontPropagateList ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangeDeviceDontPropagateList ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* CHGPROP_H */ Index: xc/programs/Xserver/Xi/chgptr.h diff -u xc/programs/Xserver/Xi/chgptr.h:3.1 xc/programs/Xserver/Xi/chgptr.h:3.2 --- xc/programs/Xserver/Xi/chgptr.h:3.1 Mon Apr 15 07:18:31 1996 +++ xc/programs/Xserver/Xi/chgptr.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.1 1996/04/15 11:18:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,53 +29,41 @@ int SProcXChangePointerDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXChangePointerDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void DeleteFocusClassDeviceStruct( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */ -#endif ); void SendEventToAllWindows ( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, Mask /* mask */, xEvent * /* ev */, int /* count */ -#endif ); void FindInterestedChildren ( /* FIXME: could be static? */ -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, WindowPtr /* p1 */, Mask /* mask */, xEvent * /* ev */, int /* count */ -#endif ); void SRepXChangePointerDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xChangePointerDeviceReply * /* rep */ -#endif ); #endif /* CHGPTR_H */ Index: xc/programs/Xserver/Xi/closedev.h diff -u xc/programs/Xserver/Xi/closedev.h:3.1 xc/programs/Xserver/Xi/closedev.h:3.2 --- xc/programs/Xserver/Xi/closedev.h:3.1 Mon Apr 15 07:18:32 1996 +++ xc/programs/Xserver/Xi/closedev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,34 +29,26 @@ int SProcXCloseDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXCloseDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void DeleteEventsFromChildren( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, WindowPtr /* p1 */, ClientPtr /* client */ -#endif ); void DeleteDeviceEvents ( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, WindowPtr /* pWin */, ClientPtr /* client */ -#endif ); #endif /* CLOSEDEV_H */ Index: xc/programs/Xserver/Xi/devbell.h diff -u xc/programs/Xserver/Xi/devbell.h:3.1 xc/programs/Xserver/Xi/devbell.h:3.2 --- xc/programs/Xserver/Xi/devbell.h:3.1 Mon Apr 15 07:18:32 1996 +++ xc/programs/Xserver/Xi/devbell.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXDeviceBell ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXDeviceBell ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* DEVBELL_H */ Index: xc/programs/Xserver/Xi/exevents.c diff -u xc/programs/Xserver/Xi/exevents.c:3.10 xc/programs/Xserver/Xi/exevents.c:3.11 --- xc/programs/Xserver/Xi/exevents.c:3.10 Fri Dec 14 14:58:55 2001 +++ xc/programs/Xserver/Xi/exevents.c Mon Nov 17 17:20:29 2003 @@ -44,7 +44,7 @@ SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/exevents.c,v 3.10 2001/12/14 19:58:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/exevents.c,v 3.11 2003/11/17 22:20:29 dawes Exp $ */ /******************************************************************** * @@ -82,15 +82,11 @@ (class)->state | (class)->motionMask) static Bool ShouldFreeInputMasks( -#if NeedFunctionPrototypes WindowPtr /* pWin */, Bool /* ignoreSelectedEvents */ -#endif ); static Bool MakeInputMasks ( -#if NeedFunctionPrototypes WindowPtr /* pWin */ -#endif ); /************************************************************************** @@ -328,7 +324,6 @@ } static void -#if NeedFunctionPrototypes FixDeviceStateNotify ( DeviceIntPtr dev, deviceStateNotify *ev, @@ -336,15 +331,6 @@ ButtonClassPtr b, ValuatorClassPtr v, int first) -#else -FixDeviceStateNotify (dev, ev, k, b, v, first) - DeviceIntPtr dev; - deviceStateNotify *ev; - KeyClassPtr k; - ButtonClassPtr b; - ValuatorClassPtr v; - int first; -#endif { ev->type = DeviceStateNotify; ev->deviceid = dev->id; @@ -383,19 +369,11 @@ } static void -#if NeedFunctionPrototypes FixDeviceValuator ( DeviceIntPtr dev, deviceValuator *ev, ValuatorClassPtr v, int first) -#else -FixDeviceValuator (dev, ev, v, first) - DeviceIntPtr dev; - deviceValuator *ev; - ValuatorClassPtr v; - int first; -#endif { int nval = v->numAxes - first; @@ -538,7 +516,6 @@ } int -#if NeedFunctionPrototypes GrabButton( ClientPtr client, DeviceIntPtr dev, @@ -552,23 +529,6 @@ Cursor rcursor, Window rconfineTo, Mask eventMask) -#else -GrabButton(client, dev, this_device_mode, other_devices_mode, modifiers, - modifier_device, button, grabWindow, ownerEvents, rcursor, rconfineTo, - eventMask) - ClientPtr client; - DeviceIntPtr dev; - BYTE this_device_mode; - BYTE other_devices_mode; - CARD16 modifiers; - DeviceIntPtr modifier_device; - CARD8 button; - Window grabWindow; - BOOL ownerEvents; - Cursor rcursor; - Window rconfineTo; - Mask eventMask; -#endif { WindowPtr pWin, confineTo; CursorPtr cursor; @@ -630,7 +590,6 @@ } int -#if NeedFunctionPrototypes GrabKey( ClientPtr client, DeviceIntPtr dev, @@ -642,20 +601,6 @@ Window grabWindow, BOOL ownerEvents, Mask mask) -#else -GrabKey(client, dev, this_device_mode, other_devices_mode, modifiers, - modifier_device, key, grabWindow, ownerEvents, mask) - ClientPtr client; - DeviceIntPtr dev; - BYTE this_device_mode; - BYTE other_devices_mode; - CARD16 modifiers; - DeviceIntPtr modifier_device; - CARD8 key; - Window grabWindow; - BOOL ownerEvents; - Mask mask; -#endif { WindowPtr pWin; GrabPtr grab; @@ -1102,18 +1047,11 @@ } void -#if NeedFunctionPrototypes SendDeviceMappingNotify( CARD8 request, KeyCode firstKeyCode, CARD8 count, DeviceIntPtr dev) -#else -SendDeviceMappingNotify(request, firstKeyCode, count, dev) - CARD8 request, count; - KeyCode firstKeyCode; - DeviceIntPtr dev; -#endif { xEvent event; deviceMappingNotify *ev = (deviceMappingNotify *) &event; @@ -1132,7 +1070,6 @@ } int -#if NeedFunctionPrototypes ChangeKeyMapping( ClientPtr client, DeviceIntPtr dev, @@ -1142,18 +1079,6 @@ CARD8 keyCodes, CARD8 keySymsPerKeyCode, KeySym *map) -#else -ChangeKeyMapping(client, dev, len, type, firstKeyCode, keyCodes, - keySymsPerKeyCode, map) - ClientPtr client; - DeviceIntPtr dev; - unsigned len; - int type; - KeyCode firstKeyCode; - CARD8 keyCodes; - CARD8 keySymsPerKeyCode; - KeySym *map; -#endif { KeySymsRec keysyms; KeyClassPtr k = dev->key; Index: xc/programs/Xserver/Xi/extinit.c diff -u xc/programs/Xserver/Xi/extinit.c:3.6 xc/programs/Xserver/Xi/extinit.c:3.7 --- xc/programs/Xserver/Xi/extinit.c:3.6 Fri Dec 14 14:58:55 2001 +++ xc/programs/Xserver/Xi/extinit.c Mon Nov 17 17:20:29 2003 @@ -45,7 +45,7 @@ SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/extinit.c,v 3.6 2001/12/14 19:58:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/extinit.c,v 3.7 2003/11/17 22:20:29 dawes Exp $ */ /******************************************************************** * @@ -894,13 +894,8 @@ */ DeviceIntPtr -#if NeedFunctionPrototypes LookupDeviceIntRec ( CARD8 id) -#else -LookupDeviceIntRec (id) - CARD8 id; -#endif { DeviceIntPtr dev; Index: xc/programs/Xserver/Xi/getbmap.h diff -u xc/programs/Xserver/Xi/getbmap.h:3.1 xc/programs/Xserver/Xi/getbmap.h:3.2 --- xc/programs/Xserver/Xi/getbmap.h:3.1 Mon Apr 15 07:18:37 1996 +++ xc/programs/Xserver/Xi/getbmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.1 1996/04/15 11:18:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetDeviceButtonMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceButtonMapping ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetDeviceButtonMapping ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceButtonMappingReply * /* rep */ -#endif ); #endif /* GETBMAP_H */ Index: xc/programs/Xserver/Xi/getdctl.h diff -u xc/programs/Xserver/Xi/getdctl.h:3.1 xc/programs/Xserver/Xi/getdctl.h:3.2 --- xc/programs/Xserver/Xi/getdctl.h:3.1 Mon Apr 15 07:18:38 1996 +++ xc/programs/Xserver/Xi/getdctl.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.1 1996/04/15 11:18:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,35 +29,27 @@ int SProcXGetDeviceControl ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceControl ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void CopySwapDeviceResolution ( -#if NeedFunctionPrototypes ClientPtr /* client */, ValuatorClassPtr /* v */, char * /* buf */, int /* length */ -#endif ); void SRepXGetDeviceControl ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceControlReply * /* rep */ -#endif ); #endif /* GETDCTL_H */ Index: xc/programs/Xserver/Xi/getfctl.h diff -u xc/programs/Xserver/Xi/getfctl.h:3.1 xc/programs/Xserver/Xi/getfctl.h:3.2 --- xc/programs/Xserver/Xi/getfctl.h:3.1 Mon Apr 15 07:18:39 1996 +++ xc/programs/Xserver/Xi/getfctl.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.1 1996/04/15 11:18:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,79 +29,61 @@ int SProcXGetFeedbackControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetFeedbackControl( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void CopySwapKbdFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, KbdFeedbackPtr /* k */, char ** /* buf */ -#endif ); void CopySwapPtrFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, PtrFeedbackPtr /* p */, char ** /* buf */ -#endif ); void CopySwapIntegerFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, IntegerFeedbackPtr /* i */, char ** /* buf */ -#endif ); void CopySwapStringFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, StringFeedbackPtr /* s */, char ** /* buf */ -#endif ); void CopySwapLedFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, LedFeedbackPtr /* l */, char ** /* buf */ -#endif ); void CopySwapBellFeedback ( -#if NeedFunctionPrototypes ClientPtr /* client */, BellFeedbackPtr /* b */, char ** /* buf */ -#endif ); void SRepXGetFeedbackControl ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetFeedbackControlReply * /* rep */ -#endif ); #endif /* GETFCTL_H */ Index: xc/programs/Xserver/Xi/getfocus.h diff -u xc/programs/Xserver/Xi/getfocus.h:3.1 xc/programs/Xserver/Xi/getfocus.h:3.2 --- xc/programs/Xserver/Xi/getfocus.h:3.1 Mon Apr 15 07:18:40 1996 +++ xc/programs/Xserver/Xi/getfocus.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.1 1996/04/15 11:18:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetDeviceFocus( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceFocus( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetDeviceFocus ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceFocusReply * /* rep */ -#endif ); #endif /* GETFOCUS_H */ Index: xc/programs/Xserver/Xi/getkmap.h diff -u xc/programs/Xserver/Xi/getkmap.h:3.1 xc/programs/Xserver/Xi/getkmap.h:3.2 --- xc/programs/Xserver/Xi/getkmap.h:3.1 Mon Apr 15 07:18:41 1996 +++ xc/programs/Xserver/Xi/getkmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.1 1996/04/15 11:18:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetDeviceKeyMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceKeyMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetDeviceKeyMapping ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceKeyMappingReply * /* rep */ -#endif ); #endif /* GETKMAP_H */ Index: xc/programs/Xserver/Xi/getmmap.h diff -u xc/programs/Xserver/Xi/getmmap.h:3.1 xc/programs/Xserver/Xi/getmmap.h:3.2 --- xc/programs/Xserver/Xi/getmmap.h:3.1 Mon Apr 15 07:18:42 1996 +++ xc/programs/Xserver/Xi/getmmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.1 1996/04/15 11:18:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetDeviceModifierMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceModifierMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetDeviceModifierMapping ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceModifierMappingReply * /* rep */ -#endif ); #endif /* GETMMAP_H */ Index: xc/programs/Xserver/Xi/getprop.h diff -u xc/programs/Xserver/Xi/getprop.h:3.1 xc/programs/Xserver/Xi/getprop.h:3.2 --- xc/programs/Xserver/Xi/getprop.h:3.1 Mon Apr 15 07:18:44 1996 +++ xc/programs/Xserver/Xi/getprop.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.1 1996/04/15 11:18:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,36 +29,28 @@ int SProcXGetDeviceDontPropagateList( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceDontPropagateList ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); XEventClass * ClassFromMask ( -#if NeedFunctionPrototypes XEventClass * /* buf */, Mask /* mask */, int /* maskndx */, CARD16 * /* count */, int /* mode */ -#endif ); void SRepXGetDeviceDontPropagateList ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceDontPropagateListReply * /* rep */ -#endif ); #endif /* GETPROP_H */ Index: xc/programs/Xserver/Xi/getselev.h diff -u xc/programs/Xserver/Xi/getselev.h:3.1 xc/programs/Xserver/Xi/getselev.h:3.2 --- xc/programs/Xserver/Xi/getselev.h:3.1 Mon Apr 15 07:18:49 1996 +++ xc/programs/Xserver/Xi/getselev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.1 1996/04/15 11:18:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetSelectedExtensionEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetSelectedExtensionEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetSelectedExtensionEvents ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetSelectedExtensionEventsReply * /* rep */ -#endif ); #endif /* GETSELEV_H */ Index: xc/programs/Xserver/Xi/getvers.h diff -u xc/programs/Xserver/Xi/getvers.h:3.1 xc/programs/Xserver/Xi/getvers.h:3.2 --- xc/programs/Xserver/Xi/getvers.h:3.1 Mon Apr 15 07:18:50 1996 +++ xc/programs/Xserver/Xi/getvers.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.1 1996/04/15 11:18:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetExtensionVersion( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetExtensionVersion ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetExtensionVersion ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetExtensionVersionReply * /* rep */ -#endif ); #endif /* GETVERS_H */ Index: xc/programs/Xserver/Xi/grabdev.h diff -u xc/programs/Xserver/Xi/grabdev.h:3.1 xc/programs/Xserver/Xi/grabdev.h:3.2 --- xc/programs/Xserver/Xi/grabdev.h:3.1 Mon Apr 15 07:18:51 1996 +++ xc/programs/Xserver/Xi/grabdev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.1 1996/04/15 11:18:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,37 +29,29 @@ int SProcXGrabDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGrabDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int CreateMaskFromList ( -#if NeedFunctionPrototypes ClientPtr /* client */, XEventClass * /* list */, int /* count */, struct tmask /* mask */[], DeviceIntPtr /* dev */, int /* req */ -#endif ); void SRepXGrabDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGrabDeviceReply * /* rep */ -#endif ); #endif /* GRABDEV_H */ Index: xc/programs/Xserver/Xi/grabdevb.h diff -u xc/programs/Xserver/Xi/grabdevb.h:3.1 xc/programs/Xserver/Xi/grabdevb.h:3.2 --- xc/programs/Xserver/Xi/grabdevb.h:3.1 Mon Apr 15 07:18:52 1996 +++ xc/programs/Xserver/Xi/grabdevb.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.1 1996/04/15 11:18:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXGrabDeviceButton( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGrabDeviceButton( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* GRABDEVB_H */ Index: xc/programs/Xserver/Xi/grabdevk.h diff -u xc/programs/Xserver/Xi/grabdevk.h:3.1 xc/programs/Xserver/Xi/grabdevk.h:3.2 --- xc/programs/Xserver/Xi/grabdevk.h:3.1 Mon Apr 15 07:18:53 1996 +++ xc/programs/Xserver/Xi/grabdevk.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.1 1996/04/15 11:18:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXGrabDeviceKey( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGrabDeviceKey( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* GRABDEVK_H */ Index: xc/programs/Xserver/Xi/gtmotion.h diff -u xc/programs/Xserver/Xi/gtmotion.h:3.1 xc/programs/Xserver/Xi/gtmotion.h:3.2 --- xc/programs/Xserver/Xi/gtmotion.h:3.1 Mon Apr 15 07:18:56 1996 +++ xc/programs/Xserver/Xi/gtmotion.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.1 1996/04/15 11:18:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXGetDeviceMotionEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXGetDeviceMotionEvents( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXGetDeviceMotionEvents ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xGetDeviceMotionEventsReply * /* rep */ -#endif ); #endif /* GTMOTION_H */ Index: xc/programs/Xserver/Xi/listdev.h diff -u xc/programs/Xserver/Xi/listdev.h:3.1 xc/programs/Xserver/Xi/listdev.h:3.2 --- xc/programs/Xserver/Xi/listdev.h:3.1 Mon Apr 15 07:18:57 1996 +++ xc/programs/Xserver/Xi/listdev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.1 1996/04/15 11:18:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,91 +29,71 @@ int SProcXListInputDevices( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXListInputDevices ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SizeDeviceInfo ( -#if NeedFunctionPrototypes DeviceIntPtr /* d */, int * /* namesize */, int * /* size */ -#endif ); void ListDeviceInfo ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* d */, xDeviceInfoPtr /* dev */, char ** /* devbuf */, char ** /* classbuf */, char ** /* namebuf */ -#endif ); void CopyDeviceName ( -#if NeedFunctionPrototypes char ** /* namebuf */, char * /* name */ -#endif ); void CopySwapDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */, DeviceIntPtr /* d */, int /* num_classes */, char ** /* buf */ -#endif ); void CopySwapKeyClass ( -#if NeedFunctionPrototypes ClientPtr /* client */, KeyClassPtr /* k */, char ** /* buf */ -#endif ); void CopySwapButtonClass ( -#if NeedFunctionPrototypes ClientPtr /* client */, ButtonClassPtr /* b */, char ** /* buf */ -#endif ); int CopySwapValuatorClass ( -#if NeedFunctionPrototypes ClientPtr /* client */, ValuatorClassPtr /* v */, char ** /* buf */ -#endif ); void SRepXListInputDevices ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xListInputDevicesReply * /* rep */ -#endif ); #endif /* LISTDEV_H */ Index: xc/programs/Xserver/Xi/opendev.h diff -u xc/programs/Xserver/Xi/opendev.h:3.1 xc/programs/Xserver/Xi/opendev.h:3.2 --- xc/programs/Xserver/Xi/opendev.h:3.1 Mon Apr 15 07:18:58 1996 +++ xc/programs/Xserver/Xi/opendev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.1 1996/04/15 11:18:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXOpenDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXOpenDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXOpenDevice ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xOpenDeviceReply * /* rep */ -#endif ); #endif /* OPENDEV_H */ Index: xc/programs/Xserver/Xi/queryst.h diff -u xc/programs/Xserver/Xi/queryst.h:3.1 xc/programs/Xserver/Xi/queryst.h:3.2 --- xc/programs/Xserver/Xi/queryst.h:3.1 Mon Apr 15 07:19:00 1996 +++ xc/programs/Xserver/Xi/queryst.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.1 1996/04/15 11:19:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXQueryDeviceState( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXQueryDeviceState( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXQueryDeviceState ( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xQueryDeviceStateReply * /* rep */ -#endif ); #endif /* QUERYST_H */ Index: xc/programs/Xserver/Xi/selectev.h diff -u xc/programs/Xserver/Xi/selectev.h:3.1 xc/programs/Xserver/Xi/selectev.h:3.2 --- xc/programs/Xserver/Xi/selectev.h:3.1 Mon Apr 15 07:19:01 1996 +++ xc/programs/Xserver/Xi/selectev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.1 1996/04/15 11:19:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXSelectExtensionEvent ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSelectExtensionEvent ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* SELECTEV_H */ Index: xc/programs/Xserver/Xi/sendexev.h diff -u xc/programs/Xserver/Xi/sendexev.h:3.1 xc/programs/Xserver/Xi/sendexev.h:3.2 --- xc/programs/Xserver/Xi/sendexev.h:3.1 Mon Apr 15 07:19:02 1996 +++ xc/programs/Xserver/Xi/sendexev.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.1 1996/04/15 11:19:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXSendExtensionEvent( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSendExtensionEvent( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* SENDEXEV_H */ Index: xc/programs/Xserver/Xi/setbmap.h diff -u xc/programs/Xserver/Xi/setbmap.h:3.1 xc/programs/Xserver/Xi/setbmap.h:3.2 --- xc/programs/Xserver/Xi/setbmap.h:3.1 Mon Apr 15 07:19:03 1996 +++ xc/programs/Xserver/Xi/setbmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.1 1996/04/15 11:19:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXSetDeviceButtonMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSetDeviceButtonMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXSetDeviceButtonMapping( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xSetDeviceButtonMappingReply * /* rep */ -#endif ); #endif /* SETBMAP_H */ Index: xc/programs/Xserver/Xi/setdval.h diff -u xc/programs/Xserver/Xi/setdval.h:3.1 xc/programs/Xserver/Xi/setdval.h:3.2 --- xc/programs/Xserver/Xi/setdval.h:3.1 Mon Apr 15 07:19:04 1996 +++ xc/programs/Xserver/Xi/setdval.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.1 1996/04/15 11:19:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXSetDeviceValuators( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSetDeviceValuators( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXSetDeviceValuators( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xSetDeviceValuatorsReply * /* rep */ -#endif ); #endif /* SETDVAL_H */ Index: xc/programs/Xserver/Xi/setfocus.h diff -u xc/programs/Xserver/Xi/setfocus.h:3.1 xc/programs/Xserver/Xi/setfocus.h:3.2 --- xc/programs/Xserver/Xi/setfocus.h:3.1 Mon Apr 15 07:19:05 1996 +++ xc/programs/Xserver/Xi/setfocus.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.1 1996/04/15 11:19:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXSetDeviceFocus( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSetDeviceFocus( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* SETFOCUS_H */ Index: xc/programs/Xserver/Xi/setmmap.h diff -u xc/programs/Xserver/Xi/setmmap.h:3.1 xc/programs/Xserver/Xi/setmmap.h:3.2 --- xc/programs/Xserver/Xi/setmmap.h:3.1 Mon Apr 15 07:19:06 1996 +++ xc/programs/Xserver/Xi/setmmap.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.1 1996/04/15 11:19:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXSetDeviceModifierMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSetDeviceModifierMapping( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXSetDeviceModifierMapping( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xSetDeviceModifierMappingReply * /* rep */ -#endif ); #endif /* SETMMAP_H */ Index: xc/programs/Xserver/Xi/setmode.h diff -u xc/programs/Xserver/Xi/setmode.h:3.1 xc/programs/Xserver/Xi/setmode.h:3.2 --- xc/programs/Xserver/Xi/setmode.h:3.1 Mon Apr 15 07:19:07 1996 +++ xc/programs/Xserver/Xi/setmode.h Mon Nov 17 17:20:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.1 1996/04/15 11:19:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,25 +29,19 @@ int SProcXSetDeviceMode( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXSetDeviceMode( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); void SRepXSetDeviceMode( -#if NeedFunctionPrototypes ClientPtr /* client */, int /* size */, xSetDeviceModeReply * /* rep */ -#endif ); #endif /* SETMODE_H */ Index: xc/programs/Xserver/Xi/stubs.c diff -u xc/programs/Xserver/Xi/stubs.c:3.4 xc/programs/Xserver/Xi/stubs.c:3.5 --- xc/programs/Xserver/Xi/stubs.c:3.4 Fri Dec 14 14:58:59 2001 +++ xc/programs/Xserver/Xi/stubs.c Mon Nov 17 17:20:30 2003 @@ -45,7 +45,7 @@ SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.4 2001/12/14 19:58:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.5 2003/11/17 22:20:30 dawes Exp $ */ /* * stubs.c -- stub routines for the X server side of the XINPUT @@ -132,17 +132,11 @@ */ int -#if NeedFunctionPrototypes ChangePointerDevice ( DeviceIntPtr old_dev, DeviceIntPtr new_dev, unsigned char x, unsigned char y) -#else -ChangePointerDevice (old_dev, new_dev, x, y) - DeviceIntPtr old_dev, new_dev; - unsigned char x, y; -#endif { /*********************************************************************** InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* Index: xc/programs/Xserver/Xi/ungrdev.h diff -u xc/programs/Xserver/Xi/ungrdev.h:3.1 xc/programs/Xserver/Xi/ungrdev.h:3.2 --- xc/programs/Xserver/Xi/ungrdev.h:3.1 Mon Apr 15 07:19:08 1996 +++ xc/programs/Xserver/Xi/ungrdev.h Mon Nov 17 17:20:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.1 1996/04/15 11:19:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXUngrabDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXUngrabDevice( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* UNGRDEV_H */ Index: xc/programs/Xserver/Xi/ungrdevb.h diff -u xc/programs/Xserver/Xi/ungrdevb.h:3.1 xc/programs/Xserver/Xi/ungrdevb.h:3.2 --- xc/programs/Xserver/Xi/ungrdevb.h:3.1 Mon Apr 15 07:19:10 1996 +++ xc/programs/Xserver/Xi/ungrdevb.h Mon Nov 17 17:20:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.h,v 3.1 1996/04/15 11:19:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXUngrabDeviceButton( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXUngrabDeviceButton( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* UNGRDEVB_H */ Index: xc/programs/Xserver/Xi/ungrdevk.h diff -u xc/programs/Xserver/Xi/ungrdevk.h:3.1 xc/programs/Xserver/Xi/ungrdevk.h:3.2 --- xc/programs/Xserver/Xi/ungrdevk.h:3.1 Mon Apr 15 07:19:12 1996 +++ xc/programs/Xserver/Xi/ungrdevk.h Mon Nov 17 17:20:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.h,v 3.1 1996/04/15 11:19:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey @@ -29,16 +29,12 @@ int SProcXUngrabDeviceKey( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); int ProcXUngrabDeviceKey( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); #endif /* UNGRDEVK_H */ Index: xc/programs/Xserver/Xprint/Imakefile diff -u xc/programs/Xserver/Xprint/Imakefile:1.19 xc/programs/Xserver/Xprint/Imakefile:1.20 --- xc/programs/Xserver/Xprint/Imakefile:1.19 Mon Nov 11 12:55:01 2002 +++ xc/programs/Xserver/Xprint/Imakefile Tue Jul 15 21:38:33 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/programs/Xserver/Xprint/Imakefile,v 1.19 2002/11/11 17:55:01 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/Xprint/Imakefile,v 1.20 2003/07/16 01:38:33 dawes Exp $ #include @@ -114,6 +114,7 @@ SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(PO_DEFINES) $(OS_DEFINES) $(XPEXT_DEFINES) -DXPRINT -UGLXEXT) #if PrintOnlyServer LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext) +LinkSourceFile(dpmsproc.h,$(SERVERSRC)/Xext) SpecialCObjectRule(dpmsstubs,$(ICONFIGFILES),$(PO_DEFINES) $(OS_DEFINES) $(XPEXT_DEFINES) -DXPRINT) #endif #endif Index: xc/programs/Xserver/Xprint/Init.c diff -u xc/programs/Xserver/Xprint/Init.c:1.13 xc/programs/Xserver/Xprint/Init.c:1.15 --- xc/programs/Xserver/Xprint/Init.c:1.13 Fri Dec 21 16:02:04 2001 +++ xc/programs/Xserver/Xprint/Init.c Wed Oct 29 17:11:54 2003 @@ -50,7 +50,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/Init.c,v 1.13 2001/12/21 21:02:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/Init.c,v 1.15 2003/10/29 22:11:54 tsi Exp $ */ #include #include @@ -325,11 +325,6 @@ int screenNum; } DriverMapEntry, *DriverMapPtr; -static const char configFilePath[] = -"/etc/dt/config/print:/usr/dt/config/print"; - -static const char printServerConfigDir[] = "XPSERVERCONFIGDIR"; - static char *configFileName = (char *)NULL; static Bool freeDefaultFontPath = FALSE; static char *origFontPath = (char *)NULL; @@ -1511,57 +1506,6 @@ } /* - * QualifyName - takes an unqualified file name such as X6printers and - * a colon-separated list of directory path names such as - * /etc/opt/dt:/opt/dt/config. - * - * Returns a fully qualified file path name such as /etc/opt/dt/X6printers. - * The returned value is malloc'd, and the caller is responsible for - * freeing the associated memory. - */ -static char * -QualifyName( - char *fileName, - char *searchPath) -{ - char * curPath = searchPath; - char * nextPath; - char * chance; - FILE *pFile; - - if (fileName == NULL || searchPath == NULL) - return NULL; - - while (1) { - if ((nextPath = strchr(curPath, ':')) != NULL) - *nextPath = 0; - - chance = (char *)xalloc(strlen(curPath) + strlen(fileName) + 2); - sprintf(chance,"%s/%s",curPath,fileName); - - /* see if we can read from the file */ - if((pFile = fopen(chance, "r")) != (FILE *)NULL) - { - fclose(pFile); - /* ... restore the colon, .... */ - if (nextPath) - *nextPath = ':'; - - return chance; - } - - xfree(chance); - - if (nextPath == NULL) /* End of path list? */ - break; - - /* try the next path */ - curPath = nextPath + 1; - } - return NULL; -} - -/* * FillPrinterListEntry fills in a single XpDiListEntry element with data * derived from the supplied PrinterDbPtr element. * Index: xc/programs/Xserver/Xprint/Oid.c diff -u xc/programs/Xserver/Xprint/Oid.c:1.5 xc/programs/Xserver/Xprint/Oid.c:1.6 --- xc/programs/Xserver/Xprint/Oid.c:1.5 Sat Oct 27 23:32:53 2001 +++ xc/programs/Xserver/Xprint/Oid.c Wed Oct 29 17:11:54 2003 @@ -30,7 +30,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/Oid.c,v 1.5 2001/10/28 03:32:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/Oid.c,v 1.6 2003/10/29 22:11:54 tsi Exp $ */ #include "attributes.h" @@ -274,7 +274,7 @@ */ if(ptr_return != (const char**)NULL) *ptr_return = ptr+length; - return i; + return (XpOid)i; } /* Index: xc/programs/Xserver/Xprint/ValTree.c diff -u xc/programs/Xserver/Xprint/ValTree.c:1.1.1.2 xc/programs/Xserver/Xprint/ValTree.c:1.2 --- xc/programs/Xserver/Xprint/ValTree.c:1.1.1.2 Tue Jan 16 17:41:46 2001 +++ xc/programs/Xserver/Xprint/ValTree.c Mon Nov 10 13:21:44 2003 @@ -30,6 +30,8 @@ dealings in this Software without prior written authorization from said copyright holders. */ +/* $XFree86: xc/programs/Xserver/Xprint/ValTree.c,v 1.2 2003/11/10 18:21:44 tsi Exp $ */ + #include "X.h" #include "scrnintstr.h" #include "validate.h" @@ -116,7 +118,7 @@ * borderSize. */ origPrntClip = pParent->clipList; - REGION_INIT(pScreen, &tmpPrntClip, NullBox, 0); + REGION_NULL(pScreen, &tmpPrntClip); REGION_SUBRACT(pScreen, &tmpPrntClip, &pParent->winSize, &pChild->borderSize); pParent->clipList = tmpPrntClip; @@ -149,7 +151,7 @@ * Compute pParent's AfterValidate structure by subracting the original * clipList from the newly computed clipList. */ - REGION_INIT(pScreen, &pParent->valdata->after.exposed, NullBox, 0); + REGION_NULL(pScreen, &pParent->valdata->after.exposed); REGION_SUBTRACT(pScreen, &pParent->valdata->after.exposed, &pParent->clipList, &origPrntClip); Index: xc/programs/Xserver/Xprint/attributes.c diff -u xc/programs/Xserver/Xprint/attributes.c:1.18 xc/programs/Xserver/Xprint/attributes.c:1.21 --- xc/programs/Xserver/Xprint/attributes.c:1.18 Fri May 31 14:45:53 2002 +++ xc/programs/Xserver/Xprint/attributes.c Thu Dec 18 21:05:38 2003 @@ -44,7 +44,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/attributes.c,v 1.18 2002/05/31 18:45:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/attributes.c,v 1.21 2003/12/19 02:05:38 dawes Exp $ */ #include #include @@ -52,7 +52,7 @@ #include #include #include -#if defined(sun) && defined(SVR4) +#if (defined(sun) && defined(SVR4)) || (defined(SCO)) #include #endif @@ -61,6 +61,9 @@ #include #include "attributes.h" + +#include "Xlib.h" +#include "Xresource.h" #include "Xrm.c" static XrmDatabase CopyDb(XrmDatabase inDb); @@ -1116,9 +1119,7 @@ */ if(userName) { - uid_t myUid; - - if((myUid = geteuid()) == (uid_t)0) + if(geteuid() == (uid_t)0) { struct passwd *pPasswd; @@ -1366,12 +1367,11 @@ XpContextPtr pContext) { char *cmdName; - int numChars; if(command == (char *)NULL) return (char *)NULL; - numChars = GetToken(command, &cmdName); + (void) GetToken(command, &cmdName); if(cmdName == (char *)NULL) return (char *)NULL; Index: xc/programs/Xserver/Xprint/ddxInit.c diff -u xc/programs/Xserver/Xprint/ddxInit.c:1.14 xc/programs/Xserver/Xprint/ddxInit.c:1.15 --- xc/programs/Xserver/Xprint/ddxInit.c:1.14 Sat Oct 27 23:32:53 2001 +++ xc/programs/Xserver/Xprint/ddxInit.c Mon Jun 23 13:35:44 2003 @@ -30,7 +30,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/ddxInit.c,v 1.14 2001/10/28 03:32:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ddxInit.c,v 1.15 2003/06/23 17:35:44 eich Exp $ */ #include "X.h" #include "Xproto.h" @@ -39,8 +39,6 @@ #include "Xos.h" #include "DiPrint.h" -static void Exit(int); - /*- *----------------------------------------------------------------------- * InitOutput -- @@ -240,12 +238,6 @@ /* Right now, let's just do nothing */ } -static void Exit (code) - int code; -{ - exit (code); -} - void AbortDDX (void) { } Index: xc/programs/Xserver/Xprint/pcl/Pcl.h diff -u xc/programs/Xserver/Xprint/pcl/Pcl.h:1.12 xc/programs/Xserver/Xprint/pcl/Pcl.h:1.13 --- xc/programs/Xserver/Xprint/pcl/Pcl.h:1.12 Fri Dec 21 16:02:05 2001 +++ xc/programs/Xserver/Xprint/pcl/Pcl.h Tue Jul 15 21:38:34 2003 @@ -44,7 +44,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.12 2001/12/21 21:02:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.13 2003/07/16 01:38:34 dawes Exp $ */ #ifndef _PCL_H_ #define _PCL_H_ @@ -59,7 +59,7 @@ #include #include -#include "miscstruct.h" +#include "regionstr.h" #include "fontstruct.h" #include "dixfontstr.h" #include "gcstruct.h" Index: xc/programs/Xserver/Xprint/pcl/PclColor.c diff -u xc/programs/Xserver/Xprint/pcl/PclColor.c:1.9 xc/programs/Xserver/Xprint/pcl/PclColor.c:1.10 --- xc/programs/Xserver/Xprint/pcl/PclColor.c:1.9 Sat Oct 27 23:32:54 2001 +++ xc/programs/Xserver/Xprint/pcl/PclColor.c Wed Oct 29 17:11:00 2003 @@ -45,7 +45,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclColor.c,v 1.9 2001/10/28 03:32:54 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclColor.c,v 1.10 2003/10/29 22:11:00 tsi Exp $ */ #include #include @@ -396,7 +396,7 @@ PclContextPrivPtr cPriv; PclPaletteMapPtr pMap; - PclCmapToContexts *pCmap, *tCmap; + PclCmapToContexts *pCmap; PclContextListPtr new; char t[80]; Colormap c; @@ -437,13 +437,8 @@ sPriv = (PclScreenPrivPtr)cmap->pScreen ->devPrivates[PclScreenPrivateIndex].ptr; pCmap = sPriv->colormaps; - while( pCmap ) - { - if( pCmap->colormapId == cmap->mid ) - break; - tCmap = pCmap; + while( pCmap && ( pCmap->colormapId != cmap->mid ) ) pCmap = pCmap->next; - } new = (PclContextListPtr)xalloc( sizeof( PclContextList ) ); new->context = pCon; new->next = pCmap->contexts; Index: xc/programs/Xserver/Xprint/pcl/PclFonts.c diff -u xc/programs/Xserver/Xprint/pcl/PclFonts.c:1.1.1.2 xc/programs/Xserver/Xprint/pcl/PclFonts.c:1.2 --- xc/programs/Xserver/Xprint/pcl/PclFonts.c:1.1.1.2 Tue Jan 16 17:41:53 2001 +++ xc/programs/Xserver/Xprint/pcl/PclFonts.c Tue Jul 15 21:38:34 2003 @@ -13,6 +13,7 @@ ** ********************************************************* ** ********************************************************************/ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclFonts.c,v 1.2 2003/07/16 01:38:34 dawes Exp $ */ /* (c) Copyright 1996 Hewlett-Packard Company (c) Copyright 1996 International Business Machines Corp. @@ -45,7 +46,7 @@ copyright holders. */ -#include "miscstruct.h" +#include "regionstr.h" #include "fontstruct.h" #include "dixfontstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/Xprint/pcl/PclMisc.c diff -u xc/programs/Xserver/Xprint/pcl/PclMisc.c:1.10 xc/programs/Xserver/Xprint/pcl/PclMisc.c:1.11 --- xc/programs/Xserver/Xprint/pcl/PclMisc.c:1.10 Sun Dec 2 08:35:28 2001 +++ xc/programs/Xserver/Xprint/pcl/PclMisc.c Wed Oct 29 17:11:00 2003 @@ -44,7 +44,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclMisc.c,v 1.10 2001/12/02 13:35:28 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclMisc.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */ #include #include @@ -153,14 +153,14 @@ static void SigchldHndlr ( int dummy) { - int status, w; + int status; int olderrno = errno; struct sigaction act; sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SigchldHndlr; - w = wait (&status); + (void) wait (&status); /* * Is this really necessary? Index: xc/programs/Xserver/Xprint/pcl/PclPixel.c diff -u xc/programs/Xserver/Xprint/pcl/PclPixel.c:1.6 xc/programs/Xserver/Xprint/pcl/PclPixel.c:1.7 --- xc/programs/Xserver/Xprint/pcl/PclPixel.c:1.6 Sat Oct 27 23:32:55 2001 +++ xc/programs/Xserver/Xprint/pcl/PclPixel.c Wed Oct 29 17:11:00 2003 @@ -44,7 +44,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixel.c,v 1.6 2001/10/28 03:32:55 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixel.c,v 1.7 2003/10/29 22:11:00 tsi Exp $ */ #include @@ -66,9 +66,11 @@ int xoffset, yoffset; BoxRec box; int xloc, yloc, i; +#if 0 XpContextPtr pCon; PclContextPrivPtr cPriv; PclPixmapPrivPtr pPriv; +#endif if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE ) return; @@ -113,6 +115,7 @@ } } +#if 0 /* * Change the line style and width back to what they were before * this routine was called. No, this isn't pretty... @@ -121,18 +124,15 @@ { pCon = PclGetContextFromWindow( (WindowPtr)pDrawable ); cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr; -/* cPriv->changeMask = GCLineWidth | GCLineStyle; -*/ } else { pPriv = ((PixmapPtr)pDrawable)->devPrivates[PclPixmapPrivateIndex].ptr; -/* pPriv->changeMask = GCLineWidth | GCLineStyle; -*/ } +#endif PclUpdateDrawableGC( pGC, pDrawable, &outFile ); Index: xc/programs/Xserver/Xprint/pcl/PclPrint.c diff -u xc/programs/Xserver/Xprint/pcl/PclPrint.c:1.7 xc/programs/Xserver/Xprint/pcl/PclPrint.c:1.8 --- xc/programs/Xserver/Xprint/pcl/PclPrint.c:1.7 Sat Oct 27 23:32:55 2001 +++ xc/programs/Xserver/Xprint/pcl/PclPrint.c Wed Oct 29 17:11:00 2003 @@ -43,7 +43,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPrint.c,v 1.7 2001/10/28 03:32:55 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPrint.c,v 1.8 2003/10/29 22:11:00 tsi Exp $ */ #include #include @@ -137,7 +137,6 @@ int retVal; char *fileName, *trailer; struct stat statBuf; - int n; PclPaletteMapPtr p; trailer = "\033%-12345X@PJL RESET\n"; @@ -199,14 +198,14 @@ * purposes. */ rewind( priv->pJobFile ); - n = stat( priv->jobFileName, &statBuf ); + stat( priv->jobFileName, &statBuf ); #ifdef CCP_DEBUG unlink( "/users/prince/XpOutput" ); xpoutput = fopen( "/users/prince/XpOutput", "w" ); rewind( priv->pJobFile ); - n = TransferBytes( priv->pJobFile, xpoutput, + TransferBytes( priv->pJobFile, xpoutput, (int)statBuf.st_size ); fclose( xpoutput ); #endif Index: xc/programs/Xserver/Xprint/pcl/PclSFonts.c diff -u xc/programs/Xserver/Xprint/pcl/PclSFonts.c:1.6 xc/programs/Xserver/Xprint/pcl/PclSFonts.c:1.8 --- xc/programs/Xserver/Xprint/pcl/PclSFonts.c:1.6 Sat Oct 27 23:32:55 2001 +++ xc/programs/Xserver/Xprint/pcl/PclSFonts.c Mon Dec 22 12:48:05 2003 @@ -45,7 +45,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSFonts.c,v 1.6 2001/10/28 03:32:55 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSFonts.c,v 1.8 2003/12/22 17:48:05 tsi Exp $ */ #include @@ -58,7 +58,6 @@ #define ESC 0x1b #define SYMBOL_SET 277 -#define MAX_CINDEX 255 static unsigned int PclDownloadChar(FILE *,PclCharDataPtr,unsigned short,unsigned char); static unsigned int PclDownloadHeader(FILE *, PclFontDescPtr, unsigned short); @@ -117,8 +116,6 @@ } pfh->index[row][col].fid = pfh->cur_fid; pfh->index[row][col].cindex = pfh->cur_cindex++; - if ( pfh->cur_cindex > MAX_CINDEX ) - pfh->cur_cindex = 0; PclDownloadChar(fp, pcd, pfh->index[row][col].fid, pfh->index[row][col].cindex); } @@ -151,7 +148,7 @@ PclFontHead8Ptr pfh8, pfh8_next; PclFontHead16Ptr pfh16, pfh16_next; PclInternalFontPtr pin, pin_next; -unsigned char nindex_row, nindex_col; +unsigned char nindex_row; int i; if ( pSoftFontInfo == (PclSoftFontInfoPtr) NULL ) @@ -169,7 +166,6 @@ pfh16 = pSoftFontInfo->phead16; while (pfh16 != (PclFontHead16Ptr) NULL) { xfree(pfh16->fontname); - nindex_col = pfh16->lastCol - pfh16->firstCol + 1; nindex_row = pfh16->lastRow - pfh16->firstRow + 1; for (i=0; iindex[i]); Index: xc/programs/Xserver/Xprint/pcl/PclText.c diff -u xc/programs/Xserver/Xprint/pcl/PclText.c:1.10 xc/programs/Xserver/Xprint/pcl/PclText.c:1.11 --- xc/programs/Xserver/Xprint/pcl/PclText.c:1.10 Wed Dec 19 16:55:58 2001 +++ xc/programs/Xserver/Xprint/pcl/PclText.c Wed Oct 29 17:11:00 2003 @@ -44,7 +44,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclText.c,v 1.10 2001/12/19 21:55:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclText.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */ #ifdef DO_TWO_BYTE_PCL #include "iconv.h" @@ -673,7 +673,7 @@ FontInfoPtr pfi; char *fontname; Atom xa_pcl_font_name, xa_res, xa_ave_width, xa_spacing; -int res, width = 1; +int width = 1; int mask; int i; @@ -723,7 +723,6 @@ pin->height = (float) props->value / 10.0; mask |= 0x2; } else if ( (Atom) props->name == xa_res ) { - res = (int) props->value; mask |= 0x4; } else if ( (Atom) props->name == xa_ave_width ) { width = (int) props->value / 10; Index: xc/programs/Xserver/Xprint/pcl/PclWindow.c diff -u xc/programs/Xserver/Xprint/pcl/PclWindow.c:1.10 xc/programs/Xserver/Xprint/pcl/PclWindow.c:1.11 --- xc/programs/Xserver/Xprint/pcl/PclWindow.c:1.10 Wed Dec 19 16:55:58 2001 +++ xc/programs/Xserver/Xprint/pcl/PclWindow.c Wed Oct 29 17:11:00 2003 @@ -44,7 +44,7 @@ dealings in this Software without prior written authorization from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclWindow.c,v 1.10 2001/12/19 21:55:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclWindow.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */ #include @@ -208,7 +208,6 @@ RegionPtr pRegion, int what) { - WindowPtr pRoot; #define FUNCTION 0 #define FOREGROUND 1 @@ -292,7 +291,6 @@ gcmask |= GCFunction | GCClipMask; i = pScreen->myNum; - pRoot = WindowTable[i]; pBgWin = pWin; if (what == PW_BORDER) Index: xc/programs/Xserver/Xprint/ps/Ps.h diff -u xc/programs/Xserver/Xprint/ps/Ps.h:1.13 xc/programs/Xserver/Xprint/ps/Ps.h:1.14 --- xc/programs/Xserver/Xprint/ps/Ps.h:1.13 Fri Dec 21 16:02:05 2001 +++ xc/programs/Xserver/Xprint/ps/Ps.h Tue Jul 15 21:38:34 2003 @@ -73,7 +73,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/ps/Ps.h,v 1.13 2001/12/21 21:02:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/Ps.h,v 1.14 2003/07/16 01:38:34 dawes Exp $ */ #ifndef _PS_H_ #define _PS_H_ @@ -93,7 +93,7 @@ #include #include -#include "miscstruct.h" +#include "regionstr.h" #include "fontstruct.h" #include "dixfontstr.h" #include "gcstruct.h" Index: xc/programs/Xserver/Xprint/ps/PsFonts.c diff -u xc/programs/Xserver/Xprint/ps/PsFonts.c:1.6 xc/programs/Xserver/Xprint/ps/PsFonts.c:1.7 --- xc/programs/Xserver/Xprint/ps/PsFonts.c:1.6 Wed Dec 19 16:55:59 2001 +++ xc/programs/Xserver/Xprint/ps/PsFonts.c Tue Jul 15 21:38:34 2003 @@ -57,7 +57,7 @@ * or other dealings in this Software without prior written authorization * from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsFonts.c,v 1.6 2001/12/19 21:55:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/PsFonts.c,v 1.7 2003/07/16 01:38:34 dawes Exp $ */ /******************************************************************* ** @@ -75,7 +75,7 @@ ** ********************************************************************/ -#include "miscstruct.h" +#include "regionstr.h" #include "fontstruct.h" #include "dixfontstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/Xprint/ps/PsGC.c diff -u xc/programs/Xserver/Xprint/ps/PsGC.c:1.6 xc/programs/Xserver/Xprint/ps/PsGC.c:1.7 --- xc/programs/Xserver/Xprint/ps/PsGC.c:1.6 Fri Dec 14 14:59:15 2001 +++ xc/programs/Xserver/Xprint/ps/PsGC.c Wed Oct 29 17:11:55 2003 @@ -57,7 +57,7 @@ * or other dealings in this Software without prior written authorization * from said copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsGC.c,v 1.6 2001/12/14 19:59:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/PsGC.c,v 1.7 2003/10/29 22:11:55 tsi Exp $ */ /******************************************************************* ** @@ -181,7 +181,6 @@ GC dGC; unsigned long valid; int i; - PsContextPrivPtr cPriv; BoxPtr boxes; if (!PsGetDrawablePrivateStuff(pDrawable, &dGC, &valid, psOut, cMap)) @@ -233,8 +232,6 @@ PsOut_Offset(*psOut, pDrawable->x, pDrawable->y); PsOut_Clip(*psOut, pGC->clientClipType, (PsClipPtr)pGC->clientClip); } - cPriv = ( PsGetContextFromWindow( (WindowPtr)pDrawable ) ) - ->devPrivates[PsContextPrivateIndex].ptr; break; } return TRUE; Index: xc/programs/Xserver/Xprint/ps/PsInit.c diff -u xc/programs/Xserver/Xprint/ps/PsInit.c:1.13 xc/programs/Xserver/Xprint/ps/PsInit.c:1.14 --- xc/programs/Xserver/Xprint/ps/PsInit.c:1.13 Wed Oct 16 17:13:33 2002 +++ xc/programs/Xserver/Xprint/ps/PsInit.c Wed Oct 29 17:11:55 2003 @@ -73,7 +73,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsInit.c,v 1.13 2002/10/16 21:13:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/PsInit.c,v 1.14 2003/10/29 22:11:55 tsi Exp $ */ #include #include @@ -108,7 +108,9 @@ int argc; char **argv; { +#if 0 PsScreenPrivPtr pPriv; +#endif int nVisuals; int nDepths; VisualPtr visuals; @@ -125,8 +127,10 @@ */ AllocatePsPrivates(pScreen); +#if 0 pPriv = (PsScreenPrivPtr)pScreen->devPrivates[PsScreenPrivateIndex].ptr; -/*pPriv->resDB = rmdb;*/ + pPriv->resDB = rmdb; +#endif pScreen->defColormap = (Colormap) FakeClientID(0); pScreen->blackPixel = 1; Index: xc/programs/Xserver/Xprint/ps/PsText.c diff -u xc/programs/Xserver/Xprint/ps/PsText.c:1.12 xc/programs/Xserver/Xprint/ps/PsText.c:1.13 --- xc/programs/Xserver/Xprint/ps/PsText.c:1.12 Fri Dec 14 14:59:17 2001 +++ xc/programs/Xserver/Xprint/ps/PsText.c Wed Oct 29 17:11:55 2003 @@ -73,7 +73,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsText.c,v 1.12 2001/12/14 19:59:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/PsText.c,v 1.13 2003/10/29 22:11:55 tsi Exp $ */ #include "Ps.h" #include "gcstruct.h" @@ -164,7 +164,6 @@ /* If Type1 font, try to download to printer first */ if(strstr(ffname, "Type1") && readFontName(ffname, file_name, dlfnam)) { - int iso; int siz; float mtx[4]; PsOutPtr psOut; @@ -177,7 +176,6 @@ PsOut_Offset(psOut, pDrawable->x, pDrawable->y); PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); siz = PsGetFontSize(pGC->font, mtx); - iso = PsIsISOLatin1Encoding(pGC->font); if( !siz ) PsOut_TextAttrsMtx(psOut, file_name, mtx, 1); else PsOut_TextAttrs(psOut, file_name, siz, 1); PsOut_Text(psOut, x, y, string, count, -1); @@ -401,7 +399,7 @@ int gWidth, gHeight; /* width and height of glyph */ register int nbyGlyphWidth; /* bytes per scanline of glyph */ int nbyPadGlyph; /* server padded line of glyph */ - int w, tmpx; + int w; XID gcvals[3]; pfont = pGC->font; @@ -437,7 +435,6 @@ PsDestroyPixmap(pPixmap); return; } - tmpx = 0; while(nGlyphs--) { pci = *pCharInfo++; Index: xc/programs/Xserver/Xprint/ps/PsWindow.c diff -u xc/programs/Xserver/Xprint/ps/PsWindow.c:1.12 xc/programs/Xserver/Xprint/ps/PsWindow.c:1.13 --- xc/programs/Xserver/Xprint/ps/PsWindow.c:1.12 Wed Dec 19 16:55:59 2001 +++ xc/programs/Xserver/Xprint/ps/PsWindow.c Wed Oct 29 17:11:55 2003 @@ -73,7 +73,7 @@ ** ********************************************************* ** ********************************************************************/ -/* $XFree86: xc/programs/Xserver/Xprint/ps/PsWindow.c,v 1.12 2001/12/19 21:55:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/ps/PsWindow.c,v 1.13 2003/10/29 22:11:55 tsi Exp $ */ #include #include @@ -219,7 +219,6 @@ RegionPtr pRegion, int what) { - WindowPtr pRoot; #define FUNCTION 0 #define FOREGROUND 1 @@ -299,7 +298,6 @@ gcmask |= GCFunction | GCClipMask; i = pScreen->myNum; - pRoot = WindowTable[i]; pBgWin = pWin; if (what == PW_BORDER) Index: xc/programs/Xserver/Xprint/raster/Raster.c diff -u xc/programs/Xserver/Xprint/raster/Raster.c:1.11 xc/programs/Xserver/Xprint/raster/Raster.c:1.12 --- xc/programs/Xserver/Xprint/raster/Raster.c:1.11 Fri Dec 21 16:02:06 2001 +++ xc/programs/Xserver/Xprint/raster/Raster.c Wed Oct 29 17:11:55 2003 @@ -31,7 +31,7 @@ copyright holders. */ -/* $XFree86: xc/programs/Xserver/Xprint/raster/Raster.c,v 1.11 2001/12/21 21:02:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xprint/raster/Raster.c,v 1.12 2003/10/29 22:11:55 tsi Exp $ */ /******************************************************************* ** @@ -1505,14 +1505,14 @@ /* ARGSUSED */ static void SigchldHndlr (int dummy) { - int status, w; + int status; int olderrno = errno; struct sigaction act; sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SigchldHndlr; - w = wait (&status); + (void) wait (&status); /* * Is this really necessary? Index: xc/programs/Xserver/afb/afb.h diff -u xc/programs/Xserver/afb/afb.h:3.8 xc/programs/Xserver/afb/afb.h:3.11 --- xc/programs/Xserver/afb/afb.h:3.8 Sat Oct 27 23:32:57 2001 +++ xc/programs/Xserver/afb/afb.h Mon Nov 17 17:20:32 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.8 2001/10/28 03:32:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.11 2003/11/17 22:20:32 dawes Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -56,7 +56,7 @@ #include "region.h" #include "gc.h" #include "colormap.h" -#include "miscstruct.h" +#include "regionstr.h" #include "mibstore.h" #include "mfb.h" @@ -64,7 +64,7 @@ extern int afbScreenPrivateIndex; /* warning: PixelType definition duplicated in maskbits.h */ #ifndef PixelType -#define PixelType CARD32 +#define PixelType CARD32 #endif /* PixelType */ #define AFB_MAX_DEPTH 8 @@ -72,18 +72,15 @@ /* afbbitblt.c */ extern void afbDoBitblt( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); extern RegionPtr afbBitBlt( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, GCPtr /*pGC*/, @@ -94,21 +91,17 @@ int /*dstx*/, int /*dsty*/, void (*doBitBlt)( -#if NeedNestedPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ), unsigned long /*planemask*/ -#endif ); extern RegionPtr afbCopyArea( -#if NeedFunctionPrototypes DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr/*pGC*/, @@ -118,11 +111,9 @@ int /*height*/, int /*dstx*/, int /*dsty*/ -#endif ); extern RegionPtr afbCopyPlane( -#if NeedFunctionPrototypes DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr/*pGC*/, @@ -133,83 +124,69 @@ int /*dstx*/, int /*dsty*/, unsigned long /*plane*/ -#endif ); extern void afbCopy1ToN( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbltC.c */ extern void afbDoBitbltCopy( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbltCI.c */ extern void afbDoBitbltCopyInverted( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbltG.c */ extern void afbDoBitbltGeneral( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbltO.c */ extern void afbDoBitbltOr( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbltX.c */ extern void afbDoBitbltXor( -#if NeedFunctionPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/ -#endif ); /* afbbres.c */ extern void afbBresS( -#if NeedFunctionPrototypes PixelType * /*addrl*/, int /*nlwidth*/, int /*sizeDst*/, @@ -224,12 +201,10 @@ int /*e2*/, int /*len*/, unsigned char * /*rrops*/ -#endif ); /* afbbresd.c */ extern void afbBresD( -#if NeedFunctionPrototypes int * /*pdashIndex*/, unsigned char * /*pDash*/, int /*numInDashList*/, @@ -250,98 +225,74 @@ int /*len*/, unsigned char * /*rrops*/, unsigned char * /*bgrrops*/ -#endif ); /* afbbstore.c */ extern void afbSaveAreas( -#if NeedFunctionPrototypes PixmapPtr /*pPixmap*/, RegionPtr /*prgnSave*/, int /*xorg*/, int /*yorg*/, WindowPtr /*pWin*/ -#endif ); extern void afbRestoreAreas( -#if NeedFunctionPrototypes PixmapPtr /*pPixmap*/, RegionPtr /*prgnRestore*/, int /*xorg*/, int /*yorg*/, WindowPtr /*pWin*/ -#endif ); /* afbclip.c */ extern RegionPtr afbPixmapToRegion( -#if NeedFunctionPrototypes PixmapPtr /*pPix*/ -#endif ); /* afbcmap.c */ extern int afbListInstalledColormaps( -#if NeedFunctionPrototypes ScreenPtr /*pScreen*/, Colormap * /*pmaps*/ -#endif ); extern void afbInstallColormap( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/ -#endif ); extern void afbUninstallColormap( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/ -#endif ); extern void afbResolveColor( -#if NeedFunctionPrototypes unsigned short * /*pred*/, unsigned short * /*pgreen*/, unsigned short * /*pblue*/, VisualPtr /*pVisual*/ -#endif ); extern Bool afbInitializeColormap( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/ -#endif ); extern int afbExpandDirectColors( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/, int /*ndefs*/, xColorItem * /*indefs*/, xColorItem * /*outdefs*/ -#endif ); extern Bool afbCreateDefColormap( -#if NeedFunctionPrototypes ScreenPtr /*pScreen*/ -#endif ); extern Bool afbSetVisualTypes( -#if NeedFunctionPrototypes int /*depth*/, int /*visuals*/, int /*bitsPerRGB*/ -#endif ); extern Bool afbInitVisuals( -#if NeedFunctionPrototypes VisualPtr * /*visualp*/, DepthPtr * /*depthp*/, int * /*nvisualp*/, @@ -350,201 +301,161 @@ VisualID * /*defaultVisp*/, unsigned long /*sizes*/, int /*bitsPerRGB*/ -#endif ); /* afbfillarc.c */ extern void afbPolyFillArcSolid( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*narcs*/, xArc * /*parcs*/ -#endif ); /* afbfillrct.c */ extern void afbPolyFillRect( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nrectFill*/, xRectangle * /*prectInit*/ -#endif ); /* afbply1rct.c */ extern void afbFillPolygonSolid( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*shape*/, int /*count*/, DDXPointPtr /*ptsIn*/ -#endif ); /* afbfillsp.c */ extern void afbSolidFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbStippleFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbTileFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbUnnaturalTileFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbUnnaturalStippleFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbOpaqueStippleFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); extern void afbUnnaturalOpaqueStippleFS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); /* afbfont.c */ extern Bool afbRealizeFont( -#if NeedFunctionPrototypes ScreenPtr /*pscr*/, FontPtr /*pFont*/ -#endif ); extern Bool afbUnrealizeFont( -#if NeedFunctionPrototypes ScreenPtr /*pscr*/, FontPtr /*pFont*/ -#endif ); /* afbgc.c */ extern Bool afbCreateGC( -#if NeedFunctionPrototypes GCPtr /*pGC*/ -#endif ); extern void afbValidateGC( -#if NeedFunctionPrototypes GCPtr /*pGC*/, unsigned long /*changes*/, DrawablePtr /*pDrawable*/ -#endif ); extern void afbDestroyGC( -#if NeedFunctionPrototypes GCPtr /*pGC*/ -#endif ); extern void afbReduceRop( -#if NeedFunctionPrototypes int /*alu*/, Pixel /*src*/, unsigned long /*planemask*/, int /*depth*/, unsigned char * /*rrops*/ -#endif ); extern void afbReduceOpaqueStipple ( -#if NeedFunctionPrototypes Pixel /*fg*/, Pixel /*bg*/, unsigned long /*planemask*/, int /*depth*/, unsigned char * /*rrops*/ -#endif ); extern void afbComputeCompositeClip( -#if NeedFunctionPrototypes GCPtr /*pGC*/, DrawablePtr /*pDrawable*/ -#endif ); /* afbgetsp.c */ extern void afbGetSpans( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, int /*wMax*/, DDXPointPtr /*ppt*/, int * /*pwidth*/, int /*nspans*/, char * /*pdstStart*/ -#endif ); /* afbhrzvert.c */ extern void afbHorzS( -#if NeedFunctionPrototypes PixelType * /*addrl*/, int /*nlwidth*/, int /*sizeDst*/, @@ -553,11 +464,9 @@ int /*y1*/, int /*len*/, unsigned char * /*rrops*/ -#endif ); extern void afbVertS( -#if NeedFunctionPrototypes PixelType * /*addrl*/, int /*nlwidth*/, int /*sizeDst*/, @@ -566,12 +475,10 @@ int /*y1*/, int /*len*/, unsigned char * /*rrops*/ -#endif ); /* afbigbblak.c */ extern void afbImageGlyphBlt ( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*x*/, @@ -579,14 +486,12 @@ unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, pointer /*pglyphBase*/ -#endif ); /* afbigbwht.c */ /* afbimage.c */ extern void afbPutImage( -#if NeedFunctionPrototypes DrawablePtr /*dst*/, GCPtr /*pGC*/, int /*depth*/, @@ -597,11 +502,9 @@ int /*leftPad*/, int /*format*/, char * /*pImage*/ -#endif ); extern void afbGetImage( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, int /*sx*/, int /*sy*/, @@ -610,62 +513,50 @@ unsigned int /*format*/, unsigned long /*planeMask*/, char * /*pdstLine*/ -#endif ); /* afbline.c */ extern void afbLineSS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, DDXPointPtr /*pptInit*/ -#endif ); extern void afbLineSD( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, DDXPointPtr /*pptInit*/ -#endif ); /* afbmisc.c */ extern void afbQueryBestSize( -#if NeedFunctionPrototypes int /*class*/, unsigned short * /*pwidth*/, unsigned short * /*pheight*/, ScreenPtr /*pScreen*/ -#endif ); /* afbpntarea.c */ extern void afbSolidFillArea( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, unsigned char * /*rrops*/ -#endif ); extern void afbStippleAreaPPW( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, PixmapPtr /*pstipple*/, unsigned char * /*rrops*/ -#endif ); extern void afbStippleArea( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -673,12 +564,10 @@ int /*xOff*/, int /*yOff*/, unsigned char * /*rrops*/ -#endif ); /* afbplygblt.c */ extern void afbPolyGlyphBlt( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, @@ -686,82 +575,62 @@ unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, pointer /*pglyphBase*/ -#endif ); /* afbpixmap.c */ extern PixmapPtr afbCreatePixmap( -#if NeedFunctionPrototypes ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, int /*depth*/ -#endif ); extern Bool afbDestroyPixmap( -#if NeedFunctionPrototypes PixmapPtr /*pPixmap*/ -#endif ); extern PixmapPtr afbCopyPixmap( -#if NeedFunctionPrototypes PixmapPtr /*pSrc*/ -#endif ); extern void afbPadPixmap( -#if NeedFunctionPrototypes PixmapPtr /*pPixmap*/ -#endif ); extern void afbXRotatePixmap( -#if NeedFunctionPrototypes PixmapPtr /*pPix*/, int /*rw*/ -#endif ); extern void afbYRotatePixmap( -#if NeedFunctionPrototypes PixmapPtr /*pPix*/, int /*rh*/ -#endif ); extern void afbCopyRotatePixmap( -#if NeedFunctionPrototypes PixmapPtr /*psrcPix*/, PixmapPtr * /*ppdstPix*/, int /*xrot*/, int /*yrot*/ -#endif ); extern void afbPaintWindow( -#if NeedFunctionPrototypes WindowPtr /*pWin*/, RegionPtr /*pRegion*/, int /*what*/ -#endif ); /* afbpolypnt.c */ extern void afbPolyPoint( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, xPoint * /*pptInit*/ -#endif ); /* afbpushpxl.c */ extern void afbPushPixels( -#if NeedFunctionPrototypes GCPtr /*pGC*/, PixmapPtr /*pBitMap*/, DrawablePtr /*pDrawable*/, @@ -769,28 +638,22 @@ int /*dy*/, int /*xOrg*/, int /*yOrg*/ -#endif ); /* afbscrclse.c */ extern Bool afbCloseScreen( -#if NeedFunctionPrototypes int /*index*/, ScreenPtr /*pScreen*/ -#endif ); /* afbscrinit.c */ extern Bool afbAllocatePrivates( -#if NeedFunctionPrototypes ScreenPtr /*pScreen*/, int * /*pWinIndex*/, int * /*pGCIndex*/ -#endif ); extern Bool afbScreenInit( -#if NeedFunctionPrototypes ScreenPtr /*pScreen*/, pointer /*pbits*/, int /*xsize*/, @@ -798,45 +661,35 @@ int /*dpix*/, int /*dpiy*/, int /*width*/ -#endif ); extern PixmapPtr afbGetWindowPixmap( -#if NeedFunctionPrototypes WindowPtr /*pWin*/ -#endif ); extern void afbSetWindowPixmap( -#if NeedFunctionPrototypes WindowPtr /*pWin*/, PixmapPtr /*pPix*/ -#endif ); /* afbseg.c */ extern void afbSegmentSS( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nseg*/, xSegment * /*pSeg*/ -#endif ); extern void afbSegmentSD( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nseg*/, xSegment * /*pSeg*/ -#endif ); /* afbsetsp.c */ extern void afbSetScanline( -#if NeedFunctionPrototypes int /*y*/, int /*xOrigin*/, int /*xStart*/, @@ -848,11 +701,9 @@ int /*sizeDst*/, int /*depthDst*/, int /*sizeSrc*/ -#endif ); extern void afbSetSpans( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, char * /*psrc*/, @@ -860,12 +711,10 @@ int * /*pwidth*/, int /*nspans*/, int /*fSorted*/ -#endif ); /* afbtegblt.c */ extern void afbTEGlyphBlt( -#if NeedFunctionPrototypes DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*x*/, @@ -873,35 +722,29 @@ unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, pointer /*pglyphBase*/ -#endif ); /* afbtileC.c */ extern void afbTileAreaPPWCopy( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, int /*alu*/, PixmapPtr /*ptile*/, unsigned long /*planemask*/ -#endif ); /* afbtileG.c */ extern void afbTileAreaPPWGeneral( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, int /*alu*/, PixmapPtr /*ptile*/, unsigned long /*planemask*/ -#endif ); extern void afbTileAreaCopy( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -910,12 +753,10 @@ int /*xOff*/, int /*yOff*/, unsigned long /*planemask*/ -#endif ); /* afbtileG.c */ extern void afbTileAreaGeneral( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -924,11 +765,9 @@ int /*xOff*/, int /*yOff*/, unsigned long /*planemask*/ -#endif ); extern void afbOpaqueStippleAreaPPWCopy( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -936,12 +775,10 @@ PixmapPtr /*ptile*/, unsigned char */*rropsOS*/, unsigned long /*planemask*/ -#endif ); /* afbtileG.c */ extern void afbOpaqueStippleAreaPPWGeneral( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -949,11 +786,9 @@ PixmapPtr /*ptile*/, unsigned char */*rropsOS*/, unsigned long /*planemask*/ -#endif ); extern void afbOpaqueStippleAreaCopy( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -963,12 +798,10 @@ int /*yOff*/, unsigned char */*rropsOS*/, unsigned long /*planemask*/ -#endif ); /* afbtileG.c */ extern void afbOpaqueStippleAreaGeneral( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, @@ -978,66 +811,49 @@ int /*yOff*/, unsigned char */*rropsOS*/, unsigned long /*planemask*/ -#endif ); /* afbwindow.c */ extern Bool afbCreateWindow( -#if NeedFunctionPrototypes WindowPtr /*pWin*/ -#endif ); extern Bool afbDestroyWindow( -#if NeedFunctionPrototypes WindowPtr /*pWin*/ -#endif ); extern Bool afbMapWindow( -#if NeedFunctionPrototypes WindowPtr /*pWindow*/ -#endif ); extern Bool afbPositionWindow( -#if NeedFunctionPrototypes WindowPtr /*pWin*/, int /*x*/, int /*y*/ -#endif ); extern Bool afbUnmapWindow( -#if NeedFunctionPrototypes WindowPtr /*pWindow*/ -#endif ); extern void afbCopyWindow( -#if NeedFunctionPrototypes WindowPtr /*pWin*/, DDXPointRec /*ptOldOrg*/, RegionPtr /*prgnSrc*/ -#endif ); extern Bool afbChangeWindowAttributes( -#if NeedFunctionPrototypes WindowPtr /*pWin*/, unsigned long /*mask*/ -#endif ); /* afbzerarc.c */ extern void afbZeroPolyArcSS( -#if NeedFunctionPrototypes DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*narcs*/, xArc * /*parcs*/ -#endif ); /* @@ -1110,7 +926,7 @@ (pointer) = (PixelType *)_pPix->devPrivate.ptr; \ (width) = ((int)_pPix->devKind) / sizeof (PixelType); \ (size) = (width) * _pPix->drawable.height; \ - (dep) = _pPix->drawable.depth; \ + (dep) = _pPix->drawable.depth; (void)(dep); \ } #define afbGetByteWidthAndPointer(pDrawable, width, pointer) \ Index: xc/programs/Xserver/afb/afbbitblt.c diff -u xc/programs/Xserver/afb/afbbitblt.c:3.3 xc/programs/Xserver/afb/afbbitblt.c:3.6 --- xc/programs/Xserver/afb/afbbitblt.c:3.3 Sat Oct 27 23:32:57 2001 +++ xc/programs/Xserver/afb/afbbitblt.c Mon Nov 10 13:21:44 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbbitblt.c,v 3.3 2001/10/28 03:32:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbbitblt.c,v 3.6 2003/11/10 18:21:44 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -52,7 +52,6 @@ #include "X.h" #include "Xprotostr.h" -#include "miscstruct.h" #include "regionstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -236,7 +235,7 @@ fastExpose = 1; /* * clip the source; if regions extend beyond the source size, - * make sure exposure events get sent + * make sure exposure events get sent */ if (fastBox.x1 < pSrcDrawable->x) { fastBox.x1 = pSrcDrawable->x; @@ -302,7 +301,7 @@ /* Check to see if the region is empty */ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pGC->pScreen, &rgnDst); } else { REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); } Index: xc/programs/Xserver/afb/afbclip.c diff -u xc/programs/Xserver/afb/afbclip.c:3.2 xc/programs/Xserver/afb/afbclip.c:3.3 --- xc/programs/Xserver/afb/afbclip.c:3.2 Sat Oct 27 23:32:57 2001 +++ xc/programs/Xserver/afb/afbclip.c Tue Jul 15 21:38:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbclip.c,v 3.2 2001/10/28 03:32:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbclip.c,v 3.3 2003/07/16 01:38:35 dawes Exp $ */ /*********************************************************** Copyright (c) 1987 X Consortium @@ -49,10 +49,9 @@ /* $XConsortium: afbclip.c,v 5.6 94/04/17 20:28:19 dpw Exp $ */ #include "X.h" -#include "miscstruct.h" +#include "regionstr.h" #include "pixmapstr.h" #include "scrnintstr.h" -#include "regionstr.h" #include "gc.h" #include "maskbits.h" #include "mi.h" Index: xc/programs/Xserver/afb/afbfillarc.c diff -u xc/programs/Xserver/afb/afbfillarc.c:3.1 xc/programs/Xserver/afb/afbfillarc.c:3.2 --- xc/programs/Xserver/afb/afbfillarc.c:3.1 Fri Mar 20 16:04:54 1998 +++ xc/programs/Xserver/afb/afbfillarc.c Tue Jul 15 21:38:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbfillarc.c,v 3.1 1998/03/20 21:04:54 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbfillarc.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */ /************************************************************ Copyright (c) 1989 X Consortium @@ -30,7 +30,7 @@ #include "X.h" #include "Xprotostr.h" -#include "miscstruct.h" +#include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/afb/afbfillrct.c diff -u xc/programs/Xserver/afb/afbfillrct.c:3.1 xc/programs/Xserver/afb/afbfillrct.c:3.3 --- xc/programs/Xserver/afb/afbfillrct.c:3.1 Fri Mar 20 16:04:54 1998 +++ xc/programs/Xserver/afb/afbfillrct.c Wed Oct 29 17:15:19 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbfillrct.c,v 3.1 1998/03/20 21:04:54 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbfillrct.c,v 3.3 2003/10/29 22:15:19 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -54,7 +54,6 @@ #include "pixmapstr.h" #include "gcstruct.h" #include "windowstr.h" -#include "miscstruct.h" #include "regionstr.h" #include "scrnintstr.h" @@ -76,8 +75,8 @@ afbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) DrawablePtr pDrawable; GCPtr pGC; - int nrectFill; /* number of rectangles to fill */ - xRectangle *prectInit; /* Pointer to first rectangle to fill */ + int nrectFill; /* number of rectangles to fill */ + xRectangle *prectInit; /* Pointer to first rectangle to fill */ { xRectangle *prect; RegionPtr prgnClip; @@ -90,12 +89,10 @@ int n; int xorg, yorg; afbPrivGC *priv; - PixmapPtr ppix; unsigned char *rrops; unsigned char *rropsOS; priv = (afbPrivGC *)pGC->devPrivates[afbGCPrivateIndex].ptr; - ppix = pGC->pRotatedPixmap; prgnClip = pGC->pCompositeClip; rrops = priv->rrops; rropsOS = priv->rropOS; Index: xc/programs/Xserver/afb/afbimggblt.c diff -u xc/programs/Xserver/afb/afbimggblt.c:3.1 xc/programs/Xserver/afb/afbimggblt.c:3.2 --- xc/programs/Xserver/afb/afbimggblt.c:3.1 Fri Mar 20 16:04:55 1998 +++ xc/programs/Xserver/afb/afbimggblt.c Wed Oct 29 17:15:19 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbimggblt.c,v 3.1 1998/03/20 21:04:55 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbimggblt.c,v 3.2 2003/10/29 22:15:19 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -95,8 +95,8 @@ void afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DrawablePtr pDrawable; - GC *pGC; - int x, y; + GC *pGC; + int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ pointer pglyphBase; /* start of array of glyphs */ @@ -292,7 +292,9 @@ int glyphRow; /* first row of glyph not wholly clipped out */ int glyphCol; /* leftmost visible column of glyph */ +#if GETLEFTBITS_ALIGNMENT > 1 int getWidth; /* bits to get from glyph */ +#endif if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) return; @@ -384,7 +386,9 @@ glyphCol = (leftEdge - ppos[i].xpos) - (pci->metrics.leftSideBearing); +#if GETLEFTBITS_ALIGNMENT > 1 getWidth = w + glyphCol; +#endif pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), widthDst); Index: xc/programs/Xserver/afb/afbmodule.c diff -u xc/programs/Xserver/afb/afbmodule.c:1.1 xc/programs/Xserver/afb/afbmodule.c:1.2 --- xc/programs/Xserver/afb/afbmodule.c:1.1 Sun Jun 13 09:47:38 1999 +++ xc/programs/Xserver/afb/afbmodule.c Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.1 1999/06/13 13:47:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.2 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef XFree86LOADER Index: xc/programs/Xserver/afb/afbplygblt.c diff -u xc/programs/Xserver/afb/afbplygblt.c:3.2 xc/programs/Xserver/afb/afbplygblt.c:3.3 --- xc/programs/Xserver/afb/afbplygblt.c:3.2 Sat Oct 27 23:32:58 2001 +++ xc/programs/Xserver/afb/afbplygblt.c Wed Oct 29 17:15:19 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbplygblt.c,v 3.2 2001/10/28 03:32:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbplygblt.c,v 3.3 2003/10/29 22:15:19 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -86,8 +86,8 @@ void afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DrawablePtr pDrawable; - GC *pGC; - int x, y; + GC *pGC; + int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ pointer pglyphBase; /* start of array of glyphs */ @@ -272,7 +272,9 @@ int glyphRow; /* first row of glyph not wholly clipped out */ int glyphCol; /* leftmost visible column of glyph */ +#if GETLEFTBITS_ALIGNMENT > 1 int getWidth; /* bits to get from glyph */ +#endif if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS)))) return; @@ -364,7 +366,9 @@ glyphCol = (leftEdge - ppos[i].xpos) - (pci->metrics.leftSideBearing); +#if GETLEFTBITS_ALIGNMENT > 1 getWidth = w + glyphCol; +#endif pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), widthDst); Index: xc/programs/Xserver/afb/afbpolypnt.c diff -u xc/programs/Xserver/afb/afbpolypnt.c:3.1 xc/programs/Xserver/afb/afbpolypnt.c:3.2 --- xc/programs/Xserver/afb/afbpolypnt.c:3.1 Fri Mar 20 16:04:56 1998 +++ xc/programs/Xserver/afb/afbpolypnt.c Tue Jul 15 21:38:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpolypnt.c,v 3.1 1998/03/20 21:04:56 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbpolypnt.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -54,7 +54,6 @@ #include "pixmapstr.h" #include "gcstruct.h" #include "windowstr.h" -#include "miscstruct.h" #include "regionstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/afb/afbpushpxl.c diff -u xc/programs/Xserver/afb/afbpushpxl.c:3.1 xc/programs/Xserver/afb/afbpushpxl.c:3.2 --- xc/programs/Xserver/afb/afbpushpxl.c:3.1 Fri Mar 20 16:04:56 1998 +++ xc/programs/Xserver/afb/afbpushpxl.c Tue Jul 15 21:38:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbpushpxl.c,v 3.1 1998/03/20 21:04:56 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbpushpxl.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */ /*********************************************************** Copyright (c) 1987 X Consortium @@ -52,9 +52,8 @@ #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" -#include "miscstruct.h" -#include "maskbits.h" #include "regionstr.h" +#include "maskbits.h" #include "afb.h" /* afbSolidPP is courtesy of xhacks@csri.toronto.edu Index: xc/programs/Xserver/afb/afbtile.c diff -u xc/programs/Xserver/afb/afbtile.c:3.3 xc/programs/Xserver/afb/afbtile.c:3.4 --- xc/programs/Xserver/afb/afbtile.c:3.3 Sat Oct 27 23:32:59 2001 +++ xc/programs/Xserver/afb/afbtile.c Wed Oct 29 17:15:19 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbtile.c,v 3.3 2001/10/28 03:32:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbtile.c,v 3.4 2003/10/29 22:15:19 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -94,7 +94,6 @@ register PixelType *p; /* pointer to bits we're writing */ int sizeDst; int depthDst; - int tlwidth; register int d; PixelType startmask; PixelType endmask; /* masks for reggedy bits at either end of line */ @@ -113,7 +112,6 @@ MROP_INITIALIZE(alu,~0) tileHeight = ptile->drawable.height; - tlwidth = ptile->devKind / sizeof (PixelType); pSaveSrc = (PixelType *)(ptile->devPrivate.ptr); while (nbox--) { @@ -249,11 +247,11 @@ int depthDst; int sizeTile; int tileLine; - int iline; - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - int saveW; - PixelType *psrcT; + int iline; + int w, width, x, xSrc, ySrc, srcStartOver, nend; + int tlwidth, rem, tileWidth, tileHeight, endinc; + int saveW; + PixelType *psrcT; int d; int nstart; PixelType startmask; @@ -637,11 +635,11 @@ int sizeDst; int depthDst; int tileLine; - int iline; - int w, width, x, xSrc, ySrc, srcStartOver, nend; - int tlwidth, rem, tileWidth, tileHeight, endinc; - int saveW; - PixelType *psrcT; + int iline; + int w, width, x, xSrc, ySrc, srcStartOver, nend; + int tlwidth, rem, tileWidth, tileHeight, endinc; + int saveW; + PixelType *psrcT; int d; int nstart; PixelType startmask; Index: xc/programs/Xserver/afb/afbwindow.c diff -u xc/programs/Xserver/afb/afbwindow.c:3.0 xc/programs/Xserver/afb/afbwindow.c:3.1 --- xc/programs/Xserver/afb/afbwindow.c:3.0 Sat Aug 17 21:45:58 1996 +++ xc/programs/Xserver/afb/afbwindow.c Sat Sep 13 17:33:04 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbwindow.c,v 3.0 1996/08/18 01:45:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbwindow.c,v 3.1 2003/09/13 21:33:04 dawes Exp $ */ /* $XConsortium: afbwindow.c,v 5.14 94/04/17 20:28:36 dpw Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -57,8 +57,6 @@ #include "regionstr.h" #include "maskbits.h" -extern WindowPtr *WindowTable; - Bool afbCreateWindow(pWin) register WindowPtr pWin; Index: xc/programs/Xserver/afb/afbzerarc.c diff -u xc/programs/Xserver/afb/afbzerarc.c:3.2 xc/programs/Xserver/afb/afbzerarc.c:3.3 --- xc/programs/Xserver/afb/afbzerarc.c:3.2 Sat Oct 27 23:32:59 2001 +++ xc/programs/Xserver/afb/afbzerarc.c Tue Jul 15 21:38:36 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/afb/afbzerarc.c,v 3.2 2001/10/28 03:32:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/afb/afbzerarc.c,v 3.3 2003/07/16 01:38:36 dawes Exp $ */ /************************************************************ Copyright (c) 1989 X Consortium @@ -36,7 +36,7 @@ #include "X.h" #include "Xprotostr.h" -#include "miscstruct.h" +#include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/cfb/cfb.h diff -u xc/programs/Xserver/cfb/cfb.h:3.27 xc/programs/Xserver/cfb/cfb.h:3.30 --- xc/programs/Xserver/cfb/cfb.h:3.27 Tue Jan 30 17:06:15 2001 +++ xc/programs/Xserver/cfb/cfb.h Sat Jul 19 09:22:27 2003 @@ -27,7 +27,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.27 2001/01/30 22:06:15 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.30 2003/07/19 13:22:27 tsi Exp $ */ #if !defined(__CFB_H__) || defined(CFB_PROTOTYPES_ONLY) @@ -336,8 +336,31 @@ int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/ + ), + unsigned long /*bitPlane*/ +); + +#define cfbCopyPlaneExpand cfbBitBlt + +extern RegionPtr cfbCopyPlaneReduce( + DrawablePtr /*pSrcDrawable*/, + DrawablePtr /*pDstDrawable*/, + GCPtr /*pGC*/, + int /*srcx*/, + int /*srcy*/, + int /*width*/, + int /*height*/, + int /*dstx*/, + int /*dsty*/, + void (* /*doCopyPlane*/)( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, unsigned long /*planemask*/, - unsigned long /*bitPlane*/ + unsigned long /*bitPlane*/ /* We must know which plane to reduce! */ ), unsigned long /*bitPlane*/ ); @@ -370,8 +393,7 @@ int /*rop*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/, - unsigned long /*planemask*/, - unsigned long /*bitPlane*/ + unsigned long /*planemask*/ ); #endif Index: xc/programs/Xserver/cfb/cfb16.h diff -u xc/programs/Xserver/cfb/cfb16.h:1.4 xc/programs/Xserver/cfb/cfb16.h:1.5 --- xc/programs/Xserver/cfb/cfb16.h:1.4 Sat Nov 28 05:42:50 1998 +++ xc/programs/Xserver/cfb/cfb16.h Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb16.h,v 1.4 1998/11/28 10:42:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb16.h,v 1.5 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1994-1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _CFB16_H_ Index: xc/programs/Xserver/cfb/cfb24.h diff -u xc/programs/Xserver/cfb/cfb24.h:1.4 xc/programs/Xserver/cfb/cfb24.h:1.5 --- xc/programs/Xserver/cfb/cfb24.h:1.4 Sat Nov 28 05:42:51 1998 +++ xc/programs/Xserver/cfb/cfb24.h Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb24.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb24.h,v 1.5 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1994-1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _CFB24_H_ Index: xc/programs/Xserver/cfb/cfb32.h diff -u xc/programs/Xserver/cfb/cfb32.h:1.4 xc/programs/Xserver/cfb/cfb32.h:1.5 --- xc/programs/Xserver/cfb/cfb32.h:1.4 Sat Nov 28 05:42:51 1998 +++ xc/programs/Xserver/cfb/cfb32.h Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfb32.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb32.h,v 1.5 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1994-1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _CFB32_H_ Index: xc/programs/Xserver/cfb/cfb8bit.h diff -u xc/programs/Xserver/cfb/cfb8bit.h:3.7 xc/programs/Xserver/cfb/cfb8bit.h:3.8 --- xc/programs/Xserver/cfb/cfb8bit.h:3.7 Fri Dec 14 14:59:20 2001 +++ xc/programs/Xserver/cfb/cfb8bit.h Mon Nov 17 17:20:32 2003 @@ -7,7 +7,7 @@ * are used for depths other than 8. Perhaps the file should be * renamed. dpw */ -/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.7 2001/12/14 19:59:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.8 2003/11/17 22:20:32 dawes Exp $ */ /* @@ -1545,24 +1545,19 @@ extern PixelGroup cfb8BitLenMasks[PGSZ]; extern int cfb8SetStipple ( -#if NeedFunctionPrototypes int /*alu*/, CfbBits /*fg*/, CfbBits /*planemask*/ -#endif ); extern int cfb8SetOpaqueStipple ( -#if NeedFunctionPrototypes int /*alu*/, CfbBits /*fg*/, CfbBits /*bg*/, CfbBits /*planemask*/ -#endif ); extern int cfb8ComputeClipMasks32 ( -#if NeedFunctionPrototypes BoxPtr /*pBox*/, int /*numRects*/, int /*x*/, @@ -1570,5 +1565,4 @@ int /*w*/, int /*h*/, CARD32 * /*clips*/ -#endif ); Index: xc/programs/Xserver/cfb/cfb8line.c diff -u xc/programs/Xserver/cfb/cfb8line.c:3.18 xc/programs/Xserver/cfb/cfb8line.c:3.19 --- xc/programs/Xserver/cfb/cfb8line.c:3.18 Wed Sep 18 13:11:47 2002 +++ xc/programs/Xserver/cfb/cfb8line.c Wed Oct 29 17:44:52 2003 @@ -25,7 +25,7 @@ * * Author: Keith Packard, MIT X Consortium * - * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.18 2002/09/18 17:11:47 tsi Exp $ + * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.19 2003/10/29 22:44:52 tsi Exp $ * Jeff Anton'x fixes: cfb8line.c 97/02/07 */ @@ -337,9 +337,13 @@ char *addrb; int stepmajor3, stepminor3, majordx, minordx; #endif +#ifndef POLYSEGMENT +#ifndef ORIGIN #ifdef BUGFIX_clip int ex_x1, ex_y1, ex_x2, ex_y2; #endif +#endif +#endif int octant; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); @@ -355,12 +359,16 @@ upperleft = *((int *) &extents->x1) - c2; lowerright = *((int *) &extents->x2) - c2 - 0x00010001; #endif /* !PREVIOUS */ +#ifndef POLYSEGMENT +#ifndef ORIGIN #ifdef BUGFIX_clip ex_x1 = extents->x1 - pDrawable->x; ex_y1 = extents->y1 - pDrawable->y; ex_x2 = extents->x2 - pDrawable->x; ex_y2 = extents->y2 - pDrawable->y; #endif +#endif +#endif #if PSZ == 24 xBase = pDrawable->x; addr += WIDTH_MUL(pDrawable->y,nwidth); @@ -1079,6 +1087,7 @@ # endif } #endif /* !POLYSEGMENT */ + RROP_UNDECLARE; return -1; } @@ -1264,7 +1273,6 @@ Bool pt1_clipped, pt2_clipped; int changex, changey, result; #if PSZ == 24 - int xOffset; PixelType *addrLineEnd; char *addrb; int stepx3, stepy3; @@ -1382,7 +1390,6 @@ RROP_FETCH_GC(pGC); #if PSZ == 24 - xOffset = x1; addrLineEnd = addr + (y1 * nwidth); addrb = (char *)addrLineEnd + x1 * 3; if (stepx == 1 || stepx == -1){ @@ -1485,6 +1492,7 @@ RROP_SOLID(addrp); #endif #undef body + RROP_UNDECLARE } } Index: xc/programs/Xserver/cfb/cfbbitblt.c diff -u xc/programs/Xserver/cfb/cfbbitblt.c:1.14 xc/programs/Xserver/cfb/cfbbitblt.c:1.20 --- xc/programs/Xserver/cfb/cfbbitblt.c:1.14 Fri Dec 14 14:59:21 2001 +++ xc/programs/Xserver/cfb/cfbbitblt.c Mon Nov 10 13:21:44 2003 @@ -2,7 +2,7 @@ * cfb copy area */ -/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.14 2001/12/14 19:59:21 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.20 2003/11/10 18:21:44 tsi Exp $ */ /* @@ -68,17 +68,23 @@ # endif #endif +/* cfbBitBltcfb == cfbCopyPlaneExpand */ RegionPtr -cfbBitBlt (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, bitPlane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - void (*doBitBlt)(); - unsigned long bitPlane; +cfbBitBlt ( + register DrawablePtr pSrcDrawable, + register DrawablePtr pDstDrawable, + GC *pGC, + int srcx, int srcy, + int width, int height, + int dstx, int dsty, + void (*doBitBlt)( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/), + unsigned long bitPlane) { RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ Bool freeSrcClip = FALSE; @@ -254,7 +260,7 @@ /* Check to see if the region is empty */ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pGC->pScreen, &rgnDst); } else { @@ -302,15 +308,276 @@ ppt->y = pbox->y1 + dy; } - (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); + (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask); DEALLOCATE_LOCAL(pptSrc); } prgnExposed = NULL; if (pGC->fExpose) { - extern RegionPtr miHandleExposures(); + /* Pixmap sources generate a NoExposed (we return NULL to do this) */ + if (!fastExpose) + prgnExposed = + miHandleExposures(pSrcDrawable, pDstDrawable, pGC, + origSource.x, origSource.y, + (int)origSource.width, + (int)origSource.height, + origDest.x, origDest.y, bitPlane); + } + REGION_UNINIT(pGC->pScreen, &rgnDst); + if (freeSrcClip) + REGION_DESTROY(pGC->pScreen, prgnSrcClip); + return prgnExposed; +} + + +RegionPtr +cfbCopyPlaneReduce ( + register DrawablePtr pSrcDrawable, + register DrawablePtr pDstDrawable, + GC *pGC, + int srcx, int srcy, + int width, int height, + int dstx, int dsty, + void (*doCopyPlane)( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/, + unsigned long /*bitPlane*/), + unsigned long bitPlane) +{ + RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ + Bool freeSrcClip = FALSE; + + RegionPtr prgnExposed; + RegionRec rgnDst; + DDXPointPtr pptSrc; + register DDXPointPtr ppt; + register BoxPtr pbox; + int i; + register int dx; + register int dy; + xRectangle origSource; + DDXPointRec origDest; + int numRects; + BoxRec fastBox; + int fastClip = 0; /* for fast clipping with pixmap source */ + int fastExpose = 0; /* for fast exposures with pixmap source */ + + origSource.x = srcx; + origSource.y = srcy; + origSource.width = width; + origSource.height = height; + origDest.x = dstx; + origDest.y = dsty; + + if ((pSrcDrawable != pDstDrawable) && + pSrcDrawable->pScreen->SourceValidate) + { + (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height); + } + + srcx += pSrcDrawable->x; + srcy += pSrcDrawable->y; + + /* clip the source */ + + if (pSrcDrawable->type == DRAWABLE_PIXMAP) + { + if ((pSrcDrawable == pDstDrawable) && + (pGC->clientClipType == CT_NONE)) + { + prgnSrcClip = cfbGetCompositeClip(pGC); + } + else + { + fastClip = 1; + } + } + else + { + if (pGC->subWindowMode == IncludeInferiors) + { + /* + * XFree86 DDX empties the border clip when the + * VT is inactive + */ + if (!((WindowPtr) pSrcDrawable)->parent && + REGION_NOTEMPTY (pSrcDrawable->pScreen, + &((WindowPtr) pSrcDrawable)->borderClip)) + { + /* + * special case bitblt from root window in + * IncludeInferiors mode; just like from a pixmap + */ + fastClip = 1; + } + else if ((pSrcDrawable == pDstDrawable) && + (pGC->clientClipType == CT_NONE)) + { + prgnSrcClip = cfbGetCompositeClip(pGC); + } + else + { + prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable); + freeSrcClip = TRUE; + } + } + else + { + prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList; + } + } + + fastBox.x1 = srcx; + fastBox.y1 = srcy; + fastBox.x2 = srcx + width; + fastBox.y2 = srcy + height; + + /* Don't create a source region if we are doing a fast clip */ + if (fastClip) + { + fastExpose = 1; + /* + * clip the source; if regions extend beyond the source size, + * make sure exposure events get sent + */ + if (fastBox.x1 < pSrcDrawable->x) + { + fastBox.x1 = pSrcDrawable->x; + fastExpose = 0; + } + if (fastBox.y1 < pSrcDrawable->y) + { + fastBox.y1 = pSrcDrawable->y; + fastExpose = 0; + } + if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) + { + fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; + fastExpose = 0; + } + if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) + { + fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; + fastExpose = 0; + } + } + else + { + REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); + REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); + } + + dstx += pDstDrawable->x; + dsty += pDstDrawable->y; + + if (pDstDrawable->type == DRAWABLE_WINDOW) + { + if (!((WindowPtr)pDstDrawable)->realized) + { + if (!fastClip) + REGION_UNINIT(pGC->pScreen, &rgnDst); + if (freeSrcClip) + REGION_DESTROY(pGC->pScreen, prgnSrcClip); + return NULL; + } + } + + dx = srcx - dstx; + dy = srcy - dsty; + + /* Translate and clip the dst to the destination composite clip */ + if (fastClip) + { + RegionPtr cclip; + + /* Translate the region directly */ + fastBox.x1 -= dx; + fastBox.x2 -= dx; + fastBox.y1 -= dy; + fastBox.y2 -= dy; + /* If the destination composite clip is one rectangle we can + do the clip directly. Otherwise we have to create a full + blown region and call intersect */ + + /* XXX because CopyPlane uses this routine for 8-to-1 bit + * copies, this next line *must* also correctly fetch the + * composite clip from an mfb gc + */ + + cclip = cfbGetCompositeClip(pGC); + if (REGION_NUM_RECTS(cclip) == 1) + { + BoxPtr pBox = REGION_RECTS(cclip); + + if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1; + if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2; + if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1; + if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2; + + /* Check to see if the region is empty */ + if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) + { + REGION_NULL(pGC->pScreen, &rgnDst); + } + else + { + REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); + } + } + else + { + /* We must turn off fastClip now, since we must create + a full blown region. It is intersected with the + composite clip below. */ + fastClip = 0; + REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); + } + } + else + { + REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + } + + if (!fastClip) + { + REGION_INTERSECT(pGC->pScreen, &rgnDst, + &rgnDst, + cfbGetCompositeClip(pGC)); + } + + /* Do bit blitting */ + numRects = REGION_NUM_RECTS(&rgnDst); + if (numRects && width && height) + { + if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + sizeof(DDXPointRec)))) + { + REGION_UNINIT(pGC->pScreen, &rgnDst); + if (freeSrcClip) + REGION_DESTROY(pGC->pScreen, prgnSrcClip); + return NULL; + } + pbox = REGION_RECTS(&rgnDst); + ppt = pptSrc; + for (i = numRects; --i >= 0; pbox++, ppt++) + { + ppt->x = pbox->x1 + dx; + ppt->y = pbox->y1 + dy; + } + + (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); + DEALLOCATE_LOCAL(pptSrc); + } + + prgnExposed = NULL; + if (pGC->fExpose) + { /* Pixmap sources generate a NoExposed (we return NULL to do this) */ if (!fastExpose) prgnExposed = @@ -335,21 +602,29 @@ DDXPointPtr pptSrc; unsigned long planemask; { - void (*blt)() = cfbDoBitbltGeneral; + void (*doBitBlt)( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/) + = cfbDoBitbltGeneral; + if ((planemask & PMSK) == PMSK) { switch (alu) { case GXcopy: - blt = cfbDoBitbltCopy; + doBitBlt = cfbDoBitbltCopy; break; case GXxor: - blt = cfbDoBitbltXor; + doBitBlt = cfbDoBitbltXor; break; case GXor: - blt = cfbDoBitbltOr; + doBitBlt = cfbDoBitbltOr; break; } } - (*blt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask); + (*doBitBlt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask); } RegionPtr @@ -362,7 +637,13 @@ int width, height; int dstx, dsty; { - void (*doBitBlt) (); + void (*doBitBlt) ( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/); doBitBlt = cfbDoBitbltCopy; if (pGC->alu != GXcopy || (pGC->planemask & PMSK) != PMSK) @@ -386,18 +667,17 @@ #if PSZ == 8 void -cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, bitPlane) +cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask) DrawablePtr pSrcDrawable; /* must be a bitmap */ DrawablePtr pDstDrawable; /* must be depth 8 drawable */ int rop; /* not used; caller must call cfb8CheckOpaqueStipple * beforehand to get cfb8StippleRRop set correctly */ - unsigned long planemask; /* to apply to destination writes */ RegionPtr prgnDst; /* region in destination to draw to; * screen relative coords. if dest is a window; * drawable relative if dest is a pixmap */ DDXPointPtr pptSrc; /* drawable relative src coords to copy from; * must be one point for each box in prgnDst */ - unsigned long bitPlane; /* not used; assumed always to be 1 */ + unsigned long planemask; /* to apply to destination writes */ { int srcx, srcy; /* upper left corner of box being copied in source */ int dstx, dsty; /* upper left corner of box being copied in dest */ @@ -718,26 +998,23 @@ /******************************************************************/ -void +static void #if PSZ == 16 -cfbCopyPlane1to16 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane1to16 #endif #if PSZ == 24 -cfbCopyPlane1to24 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane1to24 #endif #if PSZ == 32 -cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane1to32 #endif - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - int rop; - unsigned long planemask; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long bitPlane; +( + DrawablePtr pSrcDrawable, + DrawablePtr pDstDrawable, + int rop, + RegionPtr prgnDst, + DDXPointPtr pptSrc, + unsigned long planemask) { int srcx, srcy, dstx, dsty; int width, height; @@ -1078,13 +1355,19 @@ #if IMAGE_BYTE_ORDER == LSBFirst - void (*doBitBlt)(); + void (*doCopyPlaneExpand)( + DrawablePtr /*pSrc*/, + DrawablePtr /*pDst*/, + int /*alu*/, + RegionPtr /*prgnDst*/, + DDXPointPtr /*pptSrc*/, + unsigned long /*planemask*/); if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == PSZ) { if (bitPlane == 1) { - doBitBlt = cfbCopyPlane1toN; + doCopyPlaneExpand = cfbCopyPlane1toN; #if PSZ == 8 cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, @@ -1093,8 +1376,8 @@ FgPixel = pGC->fgPixel; BgPixel = pGC->bgPixel; #endif - ret = cfbBitBlt (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, bitPlane); + ret = cfbCopyPlaneExpand (pSrcDrawable, pDstDrawable, + pGC, srcx, srcy, width, height, dstx, dsty, doCopyPlaneExpand, bitPlane); } else ret = miHandleExposures (pSrcDrawable, pDstDrawable, @@ -1102,7 +1385,6 @@ } else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == 1) { - extern int InverseAlu[16]; int oldalu; oldalu = pGC->alu; @@ -1110,7 +1392,7 @@ pGC->alu = InverseAlu[pGC->alu]; else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel); - ret = cfbBitBlt (pSrcDrawable, pDstDrawable, + ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, cfbCopyPlaneNto1, bitPlane); pGC->alu = oldalu; @@ -1137,7 +1419,7 @@ */ ValidateGC ((DrawablePtr) pBitmap, pGC1); /* no exposures here, scratch GC's don't get graphics expose */ - (void) cfbBitBlt (pSrcDrawable, (DrawablePtr) pBitmap, + cfbCopyPlaneReduce(pSrcDrawable, (DrawablePtr) pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlaneNto1, bitPlane); #if PSZ == 8 @@ -1149,7 +1431,7 @@ BgPixel = pGC->bgPixel; #endif /* no exposures here, copy bits from inside a pixmap */ - (void) cfbBitBlt ((DrawablePtr) pBitmap, pDstDrawable, pGC, + cfbCopyPlaneExpand((DrawablePtr) pBitmap, pDstDrawable, pGC, 0, 0, width, height, dstx, dsty, cfbCopyPlane1toN, 1); FreeScratchGC (pGC1); (*pScreen->DestroyPixmap) (pBitmap); Index: xc/programs/Xserver/cfb/cfbblt.c diff -u xc/programs/Xserver/cfb/cfbblt.c:3.12 xc/programs/Xserver/cfb/cfbblt.c:3.14 --- xc/programs/Xserver/cfb/cfbblt.c:3.12 Fri Dec 14 14:59:21 2001 +++ xc/programs/Xserver/cfb/cfbblt.c Wed Oct 29 17:44:53 2003 @@ -1,7 +1,7 @@ /* * cfb copy area */ -/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.12 2001/12/14 19:59:21 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.14 2003/10/29 22:44:53 tsi Exp $ */ /* @@ -118,12 +118,13 @@ #endif void -MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; +MROP_NAME(cfbDoBitblt)( + DrawablePtr pSrc, + DrawablePtr pDst, + int alu, + RegionPtr prgnDst, + DDXPointPtr pptSrc, + unsigned long planemask) { CfbBits *psrcBase, *pdstBase; /* start of src and dst bitmaps */ @@ -167,12 +168,8 @@ #endif #if MROP == 0 - unsigned char *psrcBaseByte, *pdstBaseByte; - int widthSrcBytes, widthDstBytes; - - cfbGetByteWidthAndPointer (pSrc, widthSrcBytes, psrcBaseByte) - - cfbGetByteWidthAndPointer (pDst, widthDstBytes, pdstBaseByte) + int widthSrcBytes = cfbGetByteWidth(pSrc); + int widthDstBytes = cfbGetByteWidth(pDst); #endif #endif Index: xc/programs/Xserver/cfb/cfbcppl.c diff -u xc/programs/Xserver/cfb/cfbcppl.c:1.6 xc/programs/Xserver/cfb/cfbcppl.c:1.7 --- xc/programs/Xserver/cfb/cfbcppl.c:1.6 Fri Dec 14 14:59:22 2001 +++ xc/programs/Xserver/cfb/cfbcppl.c Tue Jul 15 21:38:37 2003 @@ -25,7 +25,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.6 2001/12/14 19:59:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.7 2003/07/16 01:38:37 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -40,18 +40,23 @@ #include "maskbits.h" #define PSZ 8 #include "mergerop.h" -#endif +#else /* PSZ==8 */ +#include "cfbtab.h" /* provides starttab, endttab, partmasks */ +#endif /* PSZ==8 */ void -cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - int rop; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; +cfbCopyImagePlane( + DrawablePtr pSrcDrawable, + DrawablePtr pDstDrawable, + int rop, + RegionPtr prgnDst, + DDXPointPtr pptSrc, + unsigned long planemask) { + /* note: there must be some sort of trick behind, + passing a planemask value with all bits set + whilst using the current planemask for the bitPlane value. */ #if PSZ == 8 cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, (unsigned long) ~0L, planemask); @@ -90,14 +95,14 @@ } void -cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, bitPlane) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - int rop; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; - unsigned long bitPlane; +cfbCopyPlane8to1( + DrawablePtr pSrcDrawable, + DrawablePtr pDstDrawable, + int rop, + RegionPtr prgnDst, + DDXPointPtr pptSrc, + unsigned long planemask, + unsigned long bitPlane) { int srcx, srcy, dstx, dsty, width, height; unsigned char *psrcBase; @@ -291,24 +296,22 @@ void #if PSZ == 16 -cfbCopyPlane16to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane16to1 #endif #if PSZ == 24 -cfbCopyPlane24to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane24to1 #endif #if PSZ == 32 -cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, - planemask, bitPlane) +cfbCopyPlane32to1 #endif - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - int rop; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; - unsigned long bitPlane; +( + DrawablePtr pSrcDrawable, + DrawablePtr pDstDrawable, + int rop, + RegionPtr prgnDst, + DDXPointPtr pptSrc, + unsigned long planemask, + unsigned long bitPlane) { int srcx, srcy, dstx, dsty, width, height; CfbBits *psrcBase; @@ -332,7 +335,7 @@ register int curBit; register int bitPos; register unsigned int bits; - unsigned int startmask, endmask; + unsigned int startmask = 0, endmask = 0; int niStart = 0, niEnd = 0; int bitStart = 0, bitEnd = 0; int nl, nlMiddle; @@ -340,9 +343,6 @@ BoxPtr pbox; int result; - extern int starttab[32], endtab[32]; - extern unsigned int partmasks[32][32]; - if (!(planemask & 1)) return; Index: xc/programs/Xserver/cfb/cfbfillarc.c diff -u xc/programs/Xserver/cfb/cfbfillarc.c:3.5 xc/programs/Xserver/cfb/cfbfillarc.c:3.7 --- xc/programs/Xserver/cfb/cfbfillarc.c:3.5 Fri Dec 14 14:59:22 2001 +++ xc/programs/Xserver/cfb/cfbfillarc.c Wed Oct 29 17:44:53 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.5 2001/12/14 19:59:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -29,7 +29,7 @@ #include "X.h" #include "Xprotostr.h" -#include "miscstruct.h" +#include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" @@ -47,10 +47,10 @@ #endif static void -RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; +RROP_NAME(cfbFillEllipseSolid)( + DrawablePtr pDraw, + GCPtr pGC, + xArc *arc) { STUPID int x, y, e; STUPID int yk, xk, ym, xm, dx, dy, xorg, yorg; @@ -181,6 +181,7 @@ RROP_SOLID_MASK(addrl, endmask); #endif /* PSZ == 24 */ } + RROP_UNDECLARE } #if PSZ == 24 @@ -254,10 +255,10 @@ } static void -RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; +RROP_NAME(cfbFillArcSliceSolid)( + DrawablePtr pDraw, + GCPtr pGC, + xArc *arc) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; register int x, y, e; @@ -313,6 +314,7 @@ FILLSLICESPANS(slice.flip_bot, addrlb); } } + RROP_UNDECLARE } void Index: xc/programs/Xserver/cfb/cfbfillsp.c diff -u xc/programs/Xserver/cfb/cfbfillsp.c:3.7 xc/programs/Xserver/cfb/cfbfillsp.c:3.8 --- xc/programs/Xserver/cfb/cfbfillsp.c:3.7 Fri Dec 14 14:59:22 2001 +++ xc/programs/Xserver/cfb/cfbfillsp.c Wed Oct 29 17:44:53 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.7 2001/12/14 19:59:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -509,7 +509,10 @@ width = *pwidth; while(width > 0) { - int xtemp, tmpx; + int xtemp; +#if PSZ != 32 || PPW != 1 + int tmpx; +#endif register CfbBits *ptemp; register CfbBits *pdsttmp; /* @@ -541,7 +544,9 @@ tmpx = x & 3; pdsttmp = pdst + ((x * 3)>>2); #else +#if PSZ != 32 || PPW != 1 tmpx = x & PIM; +#endif pdsttmp = pdst + (x>>PWSH); #endif switch ( pGC->fillStyle ) { Index: xc/programs/Xserver/cfb/cfbgetsp.c diff -u xc/programs/Xserver/cfb/cfbgetsp.c:3.9 xc/programs/Xserver/cfb/cfbgetsp.c:3.10 --- xc/programs/Xserver/cfb/cfbgetsp.c:3.9 Fri Dec 14 14:59:22 2001 +++ xc/programs/Xserver/cfb/cfbgetsp.c Wed Oct 29 17:44:53 2003 @@ -45,7 +45,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.9 2001/12/14 19:59:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.10 2003/10/29 22:44:53 tsi Exp $ */ #include "X.h" #include "Xmd.h" @@ -91,7 +91,9 @@ register int xIndex = 0; #else register int nstart; +#if PSZ != 32 || PPW != 1 int nend; +#endif PixelGroup startmask, endmask; int nlMiddle; #endif @@ -158,7 +160,7 @@ psrc = (PixelGroup *)((unsigned long)psrcb & ~0x03); getbits24(psrc, tmpSrc, srcBit); pdst = (PixelGroup *)((unsigned long)pdstb & ~0x03); - putbits24(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0), xIndex); + putbits24(tmpSrc, PPW, pdst, ~((CfbBits)0), xIndex); srcBit++; psrcb += 3; xIndex++; @@ -194,7 +196,9 @@ } if (endmask) { +#if PSZ != 32 || PPW != 1 nend = xEnd & PIM; +#endif getbits(psrc, 0, nend, tmpSrc); putbits(tmpSrc, nstart, nend, pdst, ~((CfbBits)0)); } Index: xc/programs/Xserver/cfb/cfbglblt8.c diff -u xc/programs/Xserver/cfb/cfbglblt8.c:3.6 xc/programs/Xserver/cfb/cfbglblt8.c:3.8 --- xc/programs/Xserver/cfb/cfbglblt8.c:3.6 Fri Dec 14 14:59:23 2001 +++ xc/programs/Xserver/cfb/cfbglblt8.c Wed Aug 6 10:04:02 2003 @@ -23,7 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.6 2001/12/14 19:59:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.8 2003/08/06 14:04:02 eich Exp $ */ /* * Poly glyph blt. Accepts an arbitrary font <= 32 bits wide, in Copy mode @@ -87,7 +87,14 @@ #endif -static void cfbPolyGlyphBlt8Clipped(); +static void cfbPolyGlyphBlt8Clipped( + DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, /* array of character info */ + unsigned char *pglyphBase); /* start of array of glyphs */ #if defined(HAS_STIPPLE_CODE) && !defined(GLYPHROP) && !defined(USE_LEFTBITS) #define USE_STIPPLE_CODE @@ -267,13 +274,14 @@ } static void -cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - unsigned char *pglyphBase; /* start of array of glyphs */ +cfbPolyGlyphBlt8Clipped( + DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, /* array of character info */ + unsigned char *pglyphBase) /* start of array of glyphs */ { #ifndef GLYPHROP register CfbBits pixel; @@ -283,7 +291,7 @@ #endif register glyphPointer glyphBits; register int xoff; -#if defined(USE_LEFT_BITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE)) +#if defined(USE_LEFTBITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE)) register CfbBits *dst; #endif @@ -291,7 +299,7 @@ FontPtr pfont = pGC->font; CfbBits *dstLine; CfbBits *pdstBase; -#ifdef USE_LEFT_BITS +#ifdef USE_LEFTBITS CARD32 *cTmp; #endif CARD32 *clips; @@ -398,7 +406,7 @@ } } while (--hTmp); break; -#else /* !USE_LEFT_BITS */ +#else /* !USE_LEFTBITS */ { int h; @@ -411,7 +419,7 @@ } glyphBits = clips; /* fall through */ -#endif /* USE_LEFT_BITS */ +#endif /* USE_LEFTBITS */ case rgnIN: #ifdef STIPPLE STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); Index: xc/programs/Xserver/cfb/cfbmap.h diff -u xc/programs/Xserver/cfb/cfbmap.h:3.11 xc/programs/Xserver/cfb/cfbmap.h:3.12 --- xc/programs/Xserver/cfb/cfbmap.h:3.11 Fri Dec 14 14:59:23 2001 +++ xc/programs/Xserver/cfb/cfbmap.h Sat Jul 19 09:22:27 2003 @@ -26,7 +26,7 @@ * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.11 2001/12/14 19:59:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.12 2003/07/19 13:22:27 tsi Exp $ */ /* * Map names around so that multiple depths can be supported simultaneously @@ -59,6 +59,7 @@ #undef cfbCopyImagePlane #undef cfbCopyPixmap #undef cfbCopyPlane +#undef cfbCopyPlaneReduce #undef cfbCopyRotatePixmap #undef cfbCopyWindow #undef cfbCreateGC @@ -227,6 +228,7 @@ #define cfbCopyImagePlane CFBNAME(CopyImagePlane) #define cfbCopyPixmap CFBNAME(CopyPixmap) #define cfbCopyPlane CFBNAME(CopyPlane) +#define cfbCopyPlaneReduce CFBNAME(CopyPlaneReduce) #define cfbCopyRotatePixmap CFBNAME(CopyRotatePixmap) #define cfbCopyWindow CFBNAME(CopyWindow) #define cfbCreateGC CFBNAME(CreateGC) Index: xc/programs/Xserver/cfb/cfbmodule.c diff -u xc/programs/Xserver/cfb/cfbmodule.c:1.8 xc/programs/Xserver/cfb/cfbmodule.c:1.9 --- xc/programs/Xserver/cfb/cfbmodule.c:1.8 Tue Jan 26 00:53:48 1999 +++ xc/programs/Xserver/cfb/cfbmodule.c Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.8 1999/01/26 05:53:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.9 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef XFree86LOADER Index: xc/programs/Xserver/cfb/cfbmskbits.h diff -u xc/programs/Xserver/cfb/cfbmskbits.h:3.13 xc/programs/Xserver/cfb/cfbmskbits.h:3.14 --- xc/programs/Xserver/cfb/cfbmskbits.h:3.13 Sat Oct 27 23:33:01 2001 +++ xc/programs/Xserver/cfb/cfbmskbits.h Wed Oct 29 17:44:53 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.13 2001/10/28 03:33:01 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.14 2003/10/29 22:44:53 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -446,7 +446,7 @@ }; \ } -#define putbits24(src, x, w, pdst, planemask, index) {\ +#define putbits24(src, w, pdst, planemask, index) {\ register PixelGroup dstpixel; \ register unsigned int idx; \ switch(idx = ((index)&3)<<1){ \ @@ -531,7 +531,7 @@ abort() #define getbits24(psrc, dst, index) \ abort() -#define putbits24(src, x, w, pdst, planemask, index) \ +#define putbits24(src, w, pdst, planemask, index) \ abort() #define putbitsrop24(src, x, pdst, planemask, rop) \ abort() Index: xc/programs/Xserver/cfb/cfbply1rct.c diff -u xc/programs/Xserver/cfb/cfbply1rct.c:3.9 xc/programs/Xserver/cfb/cfbply1rct.c:3.11 --- xc/programs/Xserver/cfb/cfbply1rct.c:3.9 Fri Dec 14 14:59:24 2001 +++ xc/programs/Xserver/cfb/cfbply1rct.c Thu Oct 30 09:53:39 2003 @@ -25,7 +25,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.9 2001/12/14 19:59:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.11 2003/10/30 14:53:39 tsi Exp $ */ #include "X.h" @@ -76,7 +76,10 @@ int step1 = 0, step2 = 0; int sign1 = 0, sign2 = 0; int h; - int l, r; + int l; +#if PSZ != 24 && PPW > 1 + int r; +#endif int nmiddle; RROP_DECLARE @@ -262,13 +265,17 @@ for (;;) { l = x1; +#if PSZ != 24 && PPW > 1 r = x2; +#endif nmiddle = x2 - x1; if (nmiddle < 0) { nmiddle = -nmiddle; l = x2; +#if PSZ != 24 && PPW > 1 r = x1; +#endif } #if PPW > 1 c = l & PIM; @@ -283,16 +290,6 @@ #if PSZ == 24 addr = (CfbBits *)((char *)addrl + ((l * 3) & ~0x03)); -#else /* PSZ == 24 */ -#if PWSH > LWRD_SHIFT - l = l >> (PWSH - LWRD_SHIFT); -#endif -#if PWSH < LWRD_SHIFT - l = l << (LWRD_SHIFT - PWSH); -#endif - addr = (CfbBits *) (((char *) addrl) + l); -#endif /* PSZ == 24 */ -#if PSZ == 24 if (nmiddle <= 1){ if (nmiddle) RROP_SOLID24(addr, l); @@ -315,6 +312,13 @@ RROP_SOLID_MASK(addr, endmask, pidx); } #else /* PSZ == 24 */ +#if PWSH > LWRD_SHIFT + l = l >> (PWSH - LWRD_SHIFT); +#endif +#if PWSH < LWRD_SHIFT + l = l << (LWRD_SHIFT - PWSH); +#endif + addr = (CfbBits *) (((char *) addrl) + l); #if PPW > 1 if (c + nmiddle < PPW) { @@ -351,4 +355,5 @@ break; addrl = AddrYPlus (addrl, 1); } + RROP_UNDECLARE } Index: xc/programs/Xserver/cfb/cfbpntwin.c diff -u xc/programs/Xserver/cfb/cfbpntwin.c:3.7 xc/programs/Xserver/cfb/cfbpntwin.c:3.8 --- xc/programs/Xserver/cfb/cfbpntwin.c:3.7 Mon Sep 16 14:05:31 2002 +++ xc/programs/Xserver/cfb/cfbpntwin.c Wed Oct 29 17:44:53 2003 @@ -45,7 +45,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.7 2002/09/16 18:05:31 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */ #include "X.h" @@ -226,7 +226,6 @@ CfbBits *pdstBase; int widthDst; register int h; - register CfbBits rrop_xor; register CfbBits *pdst; int nmiddle; int w; @@ -238,13 +237,16 @@ piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16); #else + register CfbBits rrop_xor; register CfbBits leftMask, rightMask; register int m; #endif cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase); +#if PSZ != 24 rrop_xor = PFILL(pixel); +#endif for (; nBox; nBox--, pBox++) { pdst = pdstBase + pBox->y1 * widthDst; Index: xc/programs/Xserver/cfb/cfbrrop.h diff -u xc/programs/Xserver/cfb/cfbrrop.h:3.10 xc/programs/Xserver/cfb/cfbrrop.h:3.11 --- xc/programs/Xserver/cfb/cfbrrop.h:3.10 Fri Dec 14 14:59:24 2001 +++ xc/programs/Xserver/cfb/cfbrrop.h Wed Oct 29 17:44:53 2003 @@ -26,7 +26,7 @@ * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.10 2001/12/14 19:59:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.11 2003/10/29 22:44:53 tsi Exp $ */ #ifndef GXcopy #include "X.h" @@ -66,11 +66,13 @@ (*(dst) = piQxelXor[(idx)]) #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) = (*(dst) & ~(mask))|(piQxelXor[(idx)] & (mask))) +#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; #else #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; #define RROP_DECLARE register CfbBits rrop_xor; #define RROP_SOLID(dst) (*(dst) = (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask))) +#define RROP_UNDECLARE #endif #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Copy) #endif /* GXcopy */ @@ -100,11 +102,13 @@ (*(dst) ^= piQxelXor[(idx)]) #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) ^= (piQxelXor[(idx)] & (mask))) +#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; #else #define RROP_DECLARE register CfbBits rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) ^= (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask))) +#define RROP_UNDECLARE #endif #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Xor) #endif /* GXxor */ @@ -145,11 +149,13 @@ (*(dst) &= piQxelAnd[(idx)]) #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) &= (piQxelAnd[(idx)] | ~(mask))) +#define RROP_UNDECLARE (void)piQxelAnd; (void)spiQxelAnd; #else #define RROP_DECLARE register CfbBits rrop_and; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; #define RROP_SOLID(dst) (*(dst) &= (rrop_and)) #define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask))) +#define RROP_UNDECLARE #endif #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,And) #endif /* GXand */ @@ -190,11 +196,13 @@ (*(dst) |= piQxelOr[(idx)]) #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) |= (piQxelOr[(idx)] & (mask))) +#define RROP_UNDECLARE (void)piQxelOr; (void)spiQxelOr; #else #define RROP_DECLARE register CfbBits rrop_or; #define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) |= (rrop_or)) #define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask))) +#define RROP_UNDECLARE #endif #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Or) #endif /* GXor */ @@ -205,6 +213,7 @@ #define RROP_SOLID(dst) #define RROP_SOLID_MASK(dst,mask) #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Noop) +#define RROP_UNDECLARE #endif /* GXnoop */ #if RROP == GXset @@ -253,12 +262,15 @@ (*(dst) = DoRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)])) #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) = DoMaskRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)], (mask))) +#define RROP_UNDECLARE (void)piQxelAnd; (void)piQxelXor; \ + (void)spiQxelAnd; (void)spiQxelXor; #else #define RROP_DECLARE register CfbBits rrop_and, rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) = DoMaskRRop (*(dst), rrop_and, rrop_xor, (mask))) +#define RROP_UNDECLARE #endif #define RROP_NAME(prefix) RROP_NAME_CAT(prefix,General) #endif /* GXset */ Index: xc/programs/Xserver/cfb/cfbscrinit.c diff -u xc/programs/Xserver/cfb/cfbscrinit.c:1.19 xc/programs/Xserver/cfb/cfbscrinit.c:1.20 --- xc/programs/Xserver/cfb/cfbscrinit.c:1.19 Wed Jan 17 17:36:36 2001 +++ xc/programs/Xserver/cfb/cfbscrinit.c Tue Jul 15 21:38:37 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.19 2001/01/17 22:36:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.20 2003/07/16 01:38:37 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -72,6 +72,20 @@ return TRUE; } +static void DestroyColormapNoop( + ColormapPtr pColormap) +{ + /* NOOP */ +} + +static void StoreColorsNoop( + ColormapPtr pColormap, + int ndef, + xColorItem * pdef) +{ + /* NOOP */ +} + Bool cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) register ScreenPtr pScreen; @@ -104,11 +118,11 @@ pScreen->UnrealizeFont = mfbUnrealizeFont; pScreen->CreateGC = cfbCreateGC; pScreen->CreateColormap = cfbInitializeColormap; - pScreen->DestroyColormap = (void (*)())NoopDDA; + pScreen->DestroyColormap = DestroyColormapNoop; pScreen->InstallColormap = cfbInstallColormap; pScreen->UninstallColormap = cfbUninstallColormap; pScreen->ListInstalledColormaps = cfbListInstalledColormaps; - pScreen->StoreColors = (void (*)())NoopDDA; + pScreen->StoreColors = StoreColorsNoop; pScreen->ResolveColor = cfbResolveColor; pScreen->BitmapToRegion = mfbPixmapToRegion; Index: xc/programs/Xserver/cfb/cfbsetsp.c diff -u xc/programs/Xserver/cfb/cfbsetsp.c:3.5 xc/programs/Xserver/cfb/cfbsetsp.c:3.6 --- xc/programs/Xserver/cfb/cfbsetsp.c:3.5 Fri Dec 14 14:59:24 2001 +++ xc/programs/Xserver/cfb/cfbsetsp.c Wed Oct 29 17:44:53 2003 @@ -45,7 +45,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.5 2001/12/14 19:59:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.6 2003/10/29 22:44:53 tsi Exp $ */ #include "X.h" #include "Xmd.h" @@ -83,16 +83,18 @@ int w; /* width of scanline in bits */ register int *pdst; /* where to put the bits */ register int tmpSrc; /* scratch buffer to collect bits in */ - int dstBit; /* offset in bits from beginning of - * word */ int offSrc; int nl; #if PSZ == 24 register char *psrcb, *pdstb; register int xIndex; #else + int dstBit; /* offset in bits from beginning of + * word */ register int nstart; /* number of bits from first partial */ +#if PSZ != 32 || PPW != 1 register int nend; /* " " last partial word */ +#endif int startmask, endmask, nlMiddle; #endif DeclareMergeRop() @@ -110,7 +112,6 @@ offSrc = (xStart - xOrigin) & PIM; #endif w = xEnd - xStart; - dstBit = xStart & PIM; #if PSZ == 24 nl = w; @@ -125,6 +126,7 @@ pdstb += 3; } #else /* PSZ == 24 */ + dstBit = xStart & PIM; if (dstBit + w <= PPW) { maskpartialbits(dstBit, w, startmask); @@ -139,10 +141,12 @@ nstart = PPW - dstBit; else nstart = 0; +#if PSZ != 32 || PPW != 1 if (endmask) nend = xEnd & PIM; else nend = 0; +#endif if (startmask) { getbits(psrc, offSrc, nstart, tmpSrc); Index: xc/programs/Xserver/cfb/cfbsolid.c diff -u xc/programs/Xserver/cfb/cfbsolid.c:3.8 xc/programs/Xserver/cfb/cfbsolid.c:3.9 --- xc/programs/Xserver/cfb/cfbsolid.c:3.8 Mon Sep 16 14:05:31 2002 +++ xc/programs/Xserver/cfb/cfbsolid.c Wed Oct 29 17:44:53 2003 @@ -25,7 +25,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.8 2002/09/16 18:05:31 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.9 2003/10/29 22:44:53 tsi Exp $ */ #include "X.h" @@ -771,6 +771,7 @@ } #endif } + RROP_UNDECLARE } void @@ -1358,4 +1359,5 @@ } DEALLOCATE_LOCAL(pptFree); DEALLOCATE_LOCAL(pwidthFree); + RROP_UNDECLARE } Index: xc/programs/Xserver/cfb/cfbtab.h diff -u /dev/null xc/programs/Xserver/cfb/cfbtab.h:1.1 --- /dev/null Sat Feb 28 21:42:05 2004 +++ xc/programs/Xserver/cfb/cfbtab.h Tue Jul 15 21:38:37 2003 @@ -0,0 +1,10 @@ +/* $XFree86: xc/programs/Xserver/cfb/cfbtab.h,v 1.1 2003/07/16 01:38:37 dawes Exp $ */ + +#ifndef _CFBTAB_H_ +#define _CFBTAB_H_ + +/* prototypes */ +extern int starttab[32], endtab[32]; +extern unsigned int partmasks[32][32]; + +#endif /* _CFBTAB_H_ */ Index: xc/programs/Xserver/cfb/cfbtegblt.c diff -u xc/programs/Xserver/cfb/cfbtegblt.c:3.6 xc/programs/Xserver/cfb/cfbtegblt.c:3.7 --- xc/programs/Xserver/cfb/cfbtegblt.c:3.6 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/cfbtegblt.c Wed Oct 29 17:44:53 2003 @@ -45,7 +45,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ #include "X.h" #include "Xmd.h" @@ -109,7 +109,9 @@ register int wtmp,xtemp,width; CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp; +#if PSZ != 24 int tmpx; +#endif xpos += pDrawable->x; ypos += pDrawable->y; @@ -177,23 +179,15 @@ while (width > 0) { #if PSZ == 24 - tmpx = x & 3; w = 1; + ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2)); + getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp); + getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp); #else tmpx = x & PIM; w = min(width, PPW - tmpx); w = min(w, (PGSZ - xtemp)); -#endif - -#if PSZ == 24 - ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2)); -#else ptemp = (CfbBits *)(pglyph + (xtemp >> MFB_PWSH)); -#endif -#if PSZ == 24 - getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp); - getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp); -#else getstipplepixels(ptemp,xtemp,w,0,&bgfill,&tmpDst1); getstipplepixels(ptemp,xtemp,w,1,&fgfill,&tmpDst2); #endif @@ -202,7 +196,7 @@ CfbBits tmpDst = tmpDst1 | tmpDst2; #if PSZ == 24 CfbBits *pdsttmp = pdst + ((x*3) >> 2); - putbits24(tmpDst,tmpx,w,pdsttmp,pGC->planemask,x); + putbits24(tmpDst,w,pdsttmp,pGC->planemask,x); #else CfbBits *pdsttmp = pdst + (x >> PWSH); putbits(tmpDst,tmpx,w,pdsttmp,pGC->planemask); Index: xc/programs/Xserver/cfb/cfbtile32.c diff -u xc/programs/Xserver/cfb/cfbtile32.c:3.6 xc/programs/Xserver/cfb/cfbtile32.c:3.7 --- xc/programs/Xserver/cfb/cfbtile32.c:3.6 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/cfbtile32.c Wed Oct 29 17:44:53 2003 @@ -2,7 +2,7 @@ * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ /* @@ -234,7 +234,11 @@ CfbBits *pbits;/* pointer to start of pixmap */ PixmapPtr tile; /* rotated, expanded tile */ +#if MROP == 0 && PSZ == 24 + DeclareMergeRop() +#else MROP_DECLARE_REG() +#endif MROP_PREBUILT_DECLARE() #if PSZ == 24 CfbBits xtmp; @@ -244,7 +248,11 @@ tileHeight = tile->drawable.height; psrc = (CfbBits *)tile->devPrivate.ptr; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop(pGC->alu, pGC->planemask); +#else MROP_INITIALIZE(pGC->alu, pGC->planemask); +#endif cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) @@ -346,7 +354,11 @@ PixmapPtr tile; CfbBits *psrc; /* pointer to bits in tile */ int tileHeight;/* height of the tile */ - MROP_DECLARE_REG () +#if MROP == 0 && PSZ == 24 + DeclareMergeRop() +#else + MROP_DECLARE_REG() +#endif MROP_PREBUILT_DECLARE() #if PSZ == 24 CfbBits xtmp; @@ -371,7 +383,11 @@ tileHeight = tile->drawable.height; psrc = (CfbBits *)tile->devPrivate.ptr; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop(pGC->alu, pGC->planemask); +#else MROP_INITIALIZE(pGC->alu, pGC->planemask); +#endif cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) Index: xc/programs/Xserver/cfb/cfbtileodd.c diff -u xc/programs/Xserver/cfb/cfbtileodd.c:3.6 xc/programs/Xserver/cfb/cfbtileodd.c:3.7 --- xc/programs/Xserver/cfb/cfbtileodd.c:3.6 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/cfbtileodd.c Wed Oct 29 17:44:53 2003 @@ -2,7 +2,7 @@ * Fill odd tiled rectangles and spans. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ /* @@ -139,7 +139,11 @@ int xoffDst, xoffSrc; int leftShift, rightShift; +#if MROP == 0 && PSZ == 24 + DeclareMergeRop24() +#else MROP_DECLARE_REG() +#endif CfbBits *pdstBase; /* pointer to start of dest */ CfbBits *pDstLine; /* poitner to start of dest box */ @@ -160,7 +164,11 @@ int narrowShift = 0; Bool narrowTile; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop24 (alu, planemask) +#else MROP_INITIALIZE (alu, planemask) +#endif tileHeight = tile->drawable.height; tileWidth = tile->drawable.width; @@ -395,7 +403,11 @@ int xoffDst, xoffSrc; int leftShift, rightShift; +#if MROP == 0 && PSZ == 24 + DeclareMergeRop24() +#else MROP_DECLARE_REG() +#endif CfbBits *pdstBase; /* pointer to start of dest */ CfbBits *pDstLine; /* poitner to start of dest box */ @@ -416,7 +428,11 @@ int narrowShift = 0; Bool narrowTile; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop24 (alu, planemask) +#else MROP_INITIALIZE (alu, planemask) +#endif tileHeight = tile->drawable.height; tileWidth = tile->drawable.width; @@ -643,7 +659,11 @@ int srcStart; /* number of longwords source offset at left of box */ int leftShift, rightShift; +#if MROP == 0 && PSZ == 24 + DeclareMergeRop24() +#else MROP_DECLARE_REG() +#endif CfbBits *pdstBase; /* pointer to start of dest */ CfbBits *pdstLine; /* poitner to start of dest box */ @@ -655,7 +675,11 @@ register CfbBits bits, bits1; register int nlTemp; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop24 (alu, planemask) +#else MROP_INITIALIZE (alu, planemask) +#endif psrcBase = (CfbBits *)tile->devPrivate.ptr; tileHeight = tile->drawable.height; @@ -954,7 +978,11 @@ int srcStart; /* number of longwords source offset at left of box */ int leftShift, rightShift; +#if MROP == 0 && PSZ == 24 + DeclareMergeRop24() +#else MROP_DECLARE_REG() +#endif CfbBits *pdstBase; /* pointer to start of dest */ CfbBits *pdstLine; /* poitner to start of dest box */ @@ -966,7 +994,11 @@ register CfbBits bits, bits1; register int nlTemp; +#if MROP == 0 && PSZ == 24 + InitializeMergeRop24 (alu, planemask) +#else MROP_INITIALIZE (alu, planemask) +#endif psrcBase = (CfbBits *)tile->devPrivate.ptr; tileHeight = tile->drawable.height; Index: xc/programs/Xserver/cfb/cfbunmap.h diff -u xc/programs/Xserver/cfb/cfbunmap.h:1.5 xc/programs/Xserver/cfb/cfbunmap.h:1.7 --- xc/programs/Xserver/cfb/cfbunmap.h:1.5 Sun Dec 12 21:13:07 1999 +++ xc/programs/Xserver/cfb/cfbunmap.h Fri Feb 13 18:58:30 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.5 1999/12/13 02:13:07 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.7 2004/02/13 23:58:30 dawes Exp $ */ /* - * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1994-1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @@ -58,6 +79,7 @@ #undef cfbCopyImagePlane #undef cfbCopyPixmap #undef cfbCopyPlane +#undef cfbCopyPlaneReduce #undef cfbCopyRotatePixmap #undef cfbCopyWindow #undef cfbCreateGC Index: xc/programs/Xserver/cfb/cfbwindow.c diff -u xc/programs/Xserver/cfb/cfbwindow.c:1.2 xc/programs/Xserver/cfb/cfbwindow.c:1.6 --- xc/programs/Xserver/cfb/cfbwindow.c:1.2 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/cfbwindow.c Mon Nov 10 13:21:45 2003 @@ -45,6 +45,7 @@ SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.6 2003/11/10 18:21:45 tsi Exp $ */ #include "X.h" #include "scrnintstr.h" @@ -54,8 +55,6 @@ #include "regionstr.h" #include "cfbmskbits.h" -extern WindowPtr *WindowTable; - Bool cfbCreateWindow(pWin) WindowPtr pWin; @@ -178,7 +177,7 @@ pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; - REGION_INIT(pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; Index: xc/programs/Xserver/cfb/cfbzerarc.c diff -u xc/programs/Xserver/cfb/cfbzerarc.c:3.3 xc/programs/Xserver/cfb/cfbzerarc.c:3.5 --- xc/programs/Xserver/cfb/cfbzerarc.c:3.3 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/cfbzerarc.c Wed Oct 29 17:44:53 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.3 2001/12/14 19:59:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.5 2003/10/29 22:44:53 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -35,7 +35,7 @@ #include "X.h" #include "Xprotostr.h" -#include "miscstruct.h" +#include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" @@ -48,10 +48,10 @@ #ifdef PIXEL_ADDR static void -RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; +RROP_NAME(cfbZeroArcSS8)( + DrawablePtr pDraw, + GCPtr pGC, + xArc *arc) { miZeroArcRec info; Bool do360; @@ -266,6 +266,7 @@ RROP_SOLID(yorgop - yoffset + info.xorg + x); #endif /* PSZ == 24 */ } + RROP_UNDECLARE } void Index: xc/programs/Xserver/cfb/module/Imakefile diff -u xc/programs/Xserver/cfb/module/Imakefile:1.1 xc/programs/Xserver/cfb/module/Imakefile:1.2 --- xc/programs/Xserver/cfb/module/Imakefile:1.1 Fri May 31 11:12:56 2002 +++ xc/programs/Xserver/cfb/module/Imakefile Mon Mar 24 23:18:16 2003 @@ -1,8 +1,11 @@ -XCOMM $XFree86: xc/programs/Xserver/cfb/module/Imakefile,v 1.1 2002/05/31 15:12:56 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb/module/Imakefile,v 1.2 2003/03/25 04:18:16 dawes Exp $ #define IHaveModules #define PixelSize 8 #define LinkDirectory .. +#ifdef OS2Architecture +CFBCMAP = cfbcmap.o +#endif #include "../Imakefile.inc" Index: xc/programs/Xserver/cfb16/cfbmodule.c diff -u xc/programs/Xserver/cfb16/cfbmodule.c:1.8 xc/programs/Xserver/cfb16/cfbmodule.c:1.9 --- xc/programs/Xserver/cfb16/cfbmodule.c:1.8 Tue Jan 26 00:53:49 1999 +++ xc/programs/Xserver/cfb16/cfbmodule.c Fri Feb 13 18:58:31 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef XFree86LOADER Index: xc/programs/Xserver/cfb24/cfbmodule.c diff -u xc/programs/Xserver/cfb24/cfbmodule.c:1.8 xc/programs/Xserver/cfb24/cfbmodule.c:1.9 --- xc/programs/Xserver/cfb24/cfbmodule.c:1.8 Tue Jan 26 00:53:49 1999 +++ xc/programs/Xserver/cfb24/cfbmodule.c Fri Feb 13 18:58:31 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef XFree86LOADER Index: xc/programs/Xserver/cfb24/cfbrrop24.h diff -u xc/programs/Xserver/cfb24/cfbrrop24.h:3.1 xc/programs/Xserver/cfb24/cfbrrop24.h:3.2 --- xc/programs/Xserver/cfb24/cfbrrop24.h:3.1 Sat Oct 27 23:33:03 2001 +++ xc/programs/Xserver/cfb24/cfbrrop24.h Wed Oct 29 17:46:27 2003 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/cfb24/cfbrrop24.h,v 3.1 2001/10/28 03:33:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb24/cfbrrop24.h,v 3.2 2003/10/29 22:46:27 tsi Exp $ */ #define RROP_DECLARE \ - unsigned long piQxelAnd[3], piQxelXor[3], spiQxelAnd[8], spiQxelXor[8]; + unsigned long piQxelAnd[3], piQxelXor[3], spiQxelXor[8]; #define RROP_COPY_SETUP(ptn) \ spiQxelXor[0] = ptn & 0xFFFFFF; \ @@ -26,12 +26,6 @@ spiQxelXor[3] = xor << 8; \ spiQxelXor[4] = (xor >> 8) & 0xFFFF; \ spiQxelXor[5] = (xor >> 16) & 0xFF; \ - spiQxelAnd[0] = (and & 0xFFFFFF) | 0xFF000000; \ - spiQxelAnd[1] = (and << 24) | 0xFFFFFF; \ - spiQxelAnd[2] = (and << 16) | 0xFFFF; \ - spiQxelAnd[3] = (and << 8) | 0xFF; \ - spiQxelAnd[4] = ((and >> 8) & 0xFFFF) | 0xFFFF0000; \ - spiQxelAnd[5] = ((and >> 16) & 0xFF) | 0xFFFFFF00; \ piQxelAnd[0] = (and & 0xFFFFFF)|(and << 24); \ piQxelAnd[1] = (and << 16)|((and >> 8) & 0xFFFF); \ piQxelAnd[2] = (and << 8)|((and >> 16) & 0xFF); \ Index: xc/programs/Xserver/cfb32/cfbmodule.c diff -u xc/programs/Xserver/cfb32/cfbmodule.c:1.8 xc/programs/Xserver/cfb32/cfbmodule.c:1.9 --- xc/programs/Xserver/cfb32/cfbmodule.c:1.8 Tue Jan 26 00:53:49 1999 +++ xc/programs/Xserver/cfb32/cfbmodule.c Fri Feb 13 18:58:31 2004 @@ -1,28 +1,49 @@ -/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef XFree86LOADER Index: xc/programs/Xserver/dbe/dbestruct.h diff -u xc/programs/Xserver/dbe/dbestruct.h:3.1 xc/programs/Xserver/dbe/dbestruct.h:3.2 --- xc/programs/Xserver/dbe/dbestruct.h:3.1 Wed Jan 17 17:36:41 2001 +++ xc/programs/Xserver/dbe/dbestruct.h Mon Nov 17 17:20:32 2003 @@ -30,6 +30,7 @@ * Header file for DIX-related DBE * *****************************************************************************/ +/* $XFree86: xc/programs/Xserver/dbe/dbestruct.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */ #ifndef DBE_STRUCT_H @@ -179,77 +180,53 @@ /* Per-screen DIX routines */ Bool (*SetupBackgroundPainter)( -#if NeedNestedPrototypes WindowPtr /*pWin*/, GCPtr /*pGC*/ -#endif ); DbeWindowPrivPtr (*AllocWinPriv)( -#if NeedNestedPrototypes ScreenPtr /*pScreen*/ -#endif ); int (*AllocWinPrivPrivIndex)( -#if NeedNestedPrototypes void -#endif ); Bool (*AllocWinPrivPriv)( -#if NeedNestedPrototypes ScreenPtr /*pScreen*/, int /*index*/, unsigned /*amount*/ -#endif ); /* Per-screen DDX routines */ Bool (*GetVisualInfo)( -#if NeedNestedPrototypes ScreenPtr /*pScreen*/, XdbeScreenVisualInfo * /*pVisInfo*/ -#endif ); int (*AllocBackBufferName)( -#if NeedNestedPrototypes WindowPtr /*pWin*/, XID /*bufId*/, int /*swapAction*/ -#endif ); int (*SwapBuffers)( -#if NeedNestedPrototypes ClientPtr /*client*/, int * /*pNumWindows*/, DbeSwapInfoPtr /*swapInfo*/ -#endif ); void (*BeginIdiom)( -#if NeedNestedPrototypes ClientPtr /*client*/ -#endif ); void (*EndIdiom)( -#if NeedNestedPrototypes ClientPtr /*client*/ -#endif ); void (*WinPrivDelete)( -#if NeedNestedPrototypes DbeWindowPrivPtr /*pDbeWindowPriv*/, XID /*bufId*/ -#endif ); void (*ResetProc)( -#if NeedNestedPrototypes ScreenPtr /*pScreen*/ -#endif ); void (*ValidateBuffer)( -#if NeedNestedPrototypes WindowPtr /*pWin*/, XID /*bufId*/, Bool /*dstbuffer*/ -#endif ); /* Device-specific private information. Index: xc/programs/Xserver/dbe/midbe.h diff -u xc/programs/Xserver/dbe/midbe.h:3.1 xc/programs/Xserver/dbe/midbe.h:3.2 --- xc/programs/Xserver/dbe/midbe.h:3.1 Wed Jan 17 17:36:42 2001 +++ xc/programs/Xserver/dbe/midbe.h Mon Nov 17 17:20:32 2003 @@ -30,6 +30,7 @@ * Header file for users of machine-independent DBE code * *****************************************************************************/ +/* $XFree86: xc/programs/Xserver/dbe/midbe.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */ #ifndef MIDBE_H @@ -38,10 +39,8 @@ /* EXTERNS */ extern Bool miDbeInit( -#if NeedFunctionPrototypes ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv -#endif ); #endif /* MIDBE_H */ Index: xc/programs/Xserver/dix/Imakefile diff -u xc/programs/Xserver/dix/Imakefile:3.15 xc/programs/Xserver/dix/Imakefile:3.18 --- xc/programs/Xserver/dix/Imakefile:3.15 Thu Nov 14 16:01:20 2002 +++ xc/programs/Xserver/dix/Imakefile Fri Nov 14 18:52:50 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.15 2002/11/14 21:01:20 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.18 2003/11/14 23:52:50 torrey Exp $ #include @@ -73,7 +73,7 @@ #ifdef DarwinArchitecture #if DarwinQuartzSupport - QUARTZ_DEFINES = -DDARWIN_WITH_QUARTZ + QUARTZ_DEFINES = -DDARWIN_WITH_QUARTZ -DROOTLESS #endif #endif Index: xc/programs/Xserver/dix/colormap.c diff -u xc/programs/Xserver/dix/colormap.c:3.10 xc/programs/Xserver/dix/colormap.c:3.12 --- xc/programs/Xserver/dix/colormap.c:3.10 Sat Apr 13 20:45:54 2002 +++ xc/programs/Xserver/dix/colormap.c Mon Nov 17 17:20:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.10 2002/04/14 00:45:54 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.12 2003/11/17 22:20:33 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -66,74 +66,55 @@ extern int colormapPrivateCount; static Pixel FindBestPixel( -#if NeedFunctionPrototypes EntryPtr /*pentFirst*/, int /*size*/, xrgb * /*prgb*/, int /*channel*/ -#endif ); static int AllComp( -#if NeedFunctionPrototypes EntryPtr /*pent*/, xrgb * /*prgb*/ -#endif ); static int RedComp( -#if NeedFunctionPrototypes EntryPtr /*pent*/, xrgb * /*prgb*/ -#endif ); static int GreenComp( -#if NeedFunctionPrototypes EntryPtr /*pent*/, xrgb * /*prgb*/ -#endif ); static int BlueComp( -#if NeedFunctionPrototypes EntryPtr /*pent*/, xrgb * /*prgb*/ -#endif ); static void FreePixels( -#if NeedFunctionPrototypes register ColormapPtr /*pmap*/, register int /*client*/ -#endif ); static void CopyFree( -#if NeedFunctionPrototypes int /*channel*/, int /*client*/, ColormapPtr /*pmapSrc*/, ColormapPtr /*pmapDst*/ -#endif ); static void FreeCell( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/, Pixel /*i*/, int /*channel*/ -#endif ); static void UpdateColors( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/ -#endif ); static int AllocDirect( -#if NeedFunctionPrototypes int /*client*/, ColormapPtr /*pmap*/, int /*c*/, @@ -145,11 +126,9 @@ Pixel * /*prmask*/, Pixel * /*pgmask*/, Pixel * /*pbmask*/ -#endif ); static int AllocPseudo( -#if NeedFunctionPrototypes int /*client*/, ColormapPtr /*pmap*/, int /*c*/, @@ -158,11 +137,9 @@ Pixel * /*pixels*/, Pixel * /*pmask*/, Pixel ** /*pppixFirst*/ -#endif ); static Bool AllocCP( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/, EntryPtr /*pentFirst*/, int /*count*/, @@ -170,11 +147,9 @@ Bool /*contig*/, Pixel * /*pixels*/, Pixel * /*pMask*/ -#endif ); static Bool AllocShared( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/, Pixel * /*ppix*/, int /*c*/, @@ -185,29 +160,23 @@ Pixel /*gmask*/, Pixel /*bmask*/, Pixel * /*ppixFirst*/ -#endif ); static int FreeCo( -#if NeedFunctionPrototypes ColormapPtr /*pmap*/, int /*client*/, int /*color*/, int /*npixIn*/, Pixel * /*ppixIn*/, Pixel /*mask*/ -#endif ); static int TellNoMap( -#if NeedFunctionPrototypes WindowPtr /*pwin*/, Colormap * /*pmid*/ -#endif ); static void FindColorInRootCmap ( -#if NeedFunctionPrototypes ColormapPtr /* pmap */, EntryPtr /* pentFirst */, int /* size */, @@ -215,7 +184,6 @@ Pixel* /* pPixel */, int /* channel */, ColorCompareProcPtr /* comp */ -#endif ); #define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1) @@ -635,7 +603,7 @@ int channel, client; ColormapPtr pmapSrc, pmapDst; { - int z, npix, oldFree; + int z, npix; EntryPtr pentSrcFirst, pentDstFirst; EntryPtr pentSrc, pentDst; Pixel *ppix; @@ -649,21 +617,18 @@ npix = (pmapSrc->numPixelsRed)[client]; pentSrcFirst = pmapSrc->red; pentDstFirst = pmapDst->red; - oldFree = pmapSrc->freeRed; break; case GREENMAP: ppix = (pmapSrc->clientPixelsGreen)[client]; npix = (pmapSrc->numPixelsGreen)[client]; pentSrcFirst = pmapSrc->green; pentDstFirst = pmapDst->green; - oldFree = pmapSrc->freeGreen; break; case BLUEMAP: ppix = (pmapSrc->clientPixelsBlue)[client]; npix = (pmapSrc->numPixelsBlue)[client]; pentSrcFirst = pmapSrc->blue; pentDstFirst = pmapDst->blue; - oldFree = pmapSrc->freeBlue; break; } nalloc = 0; @@ -1146,12 +1111,7 @@ ((r)->lower = BIGNUMLOWER-1)) static void -#if NeedFunctionPrototypes BigNumAdd (BigNumPtr x, BigNumPtr y, BigNumPtr r) -#else -BigNumAdd (x, y, r) - BigNumPtr x, y, r; -#endif { BigNumLower lower, carry = 0; Index: xc/programs/Xserver/dix/cursor.c diff -u xc/programs/Xserver/dix/cursor.c:3.8 xc/programs/Xserver/dix/cursor.c:3.9 --- xc/programs/Xserver/dix/cursor.c:3.8 Sat Jan 11 21:44:26 2003 +++ xc/programs/Xserver/dix/cursor.c Mon Nov 17 17:20:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.8 2003/01/12 02:44:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.9 2003/11/17 22:20:33 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -69,12 +69,7 @@ static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL; static void -#if NeedFunctionPrototypes FreeCursorBits(CursorBitsPtr bits) -#else -FreeCursorBits(bits) - CursorBitsPtr bits; -#endif { if (--bits->refcnt > 0) return; Index: xc/programs/Xserver/dix/devices.c diff -u xc/programs/Xserver/dix/devices.c:3.20 xc/programs/Xserver/dix/devices.c:3.21 --- xc/programs/Xserver/dix/devices.c:3.20 Fri Dec 14 14:59:30 2001 +++ xc/programs/Xserver/dix/devices.c Mon Nov 17 17:20:33 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.20 2001/12/14 19:59:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.21 2003/11/17 22:20:33 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -197,12 +197,7 @@ } static void -#if NeedFunctionPrototypes CloseDevice(register DeviceIntPtr dev) -#else -CloseDevice(dev) - register DeviceIntPtr dev; -#endif { KbdFeedbackPtr k, knext; PtrFeedbackPtr p, pnext; @@ -501,12 +496,7 @@ } static Bool -#if NeedFunctionPrototypes InitModMap(register KeyClassPtr keyc) -#else -InitModMap(keyc) - register KeyClassPtr keyc; -#endif { int i, j; CARD8 keysPerModifier[8]; @@ -1712,17 +1702,10 @@ #ifdef AddInputDevice #undef AddInputDevice -#if NeedFunctionPrototypes DevicePtr AddInputDevice( DeviceProc deviceProc, Bool autoStart) -#else -DevicePtr -AddInputDevice(deviceProc, autoStart) - DeviceProc deviceProc; - Bool autoStart; -#endif { return (DevicePtr)_AddInputDevice(deviceProc, autoStart); } @@ -1731,14 +1714,8 @@ #ifdef RegisterPointerDevice #undef RegisterPointerDevice -#if NeedFunctionPrototypes void RegisterPointerDevice(DevicePtr device) -#else -void -RegisterPointerDevice(device) - DevicePtr device; -#endif { _RegisterPointerDevice((DeviceIntPtr)device); } @@ -1747,14 +1724,8 @@ #ifdef RegisterKeyboardDevice #undef RegisterKeyboardDevice -#if NeedFunctionPrototypes void RegisterKeyboardDevice(DevicePtr device) -#else -void -RegisterKeyboardDevice(device) - DevicePtr device; -#endif { _RegisterKeyboardDevice((DeviceIntPtr)device); } Index: xc/programs/Xserver/dix/dispatch.c diff -u xc/programs/Xserver/dix/dispatch.c:3.29 xc/programs/Xserver/dix/dispatch.c:3.33 --- xc/programs/Xserver/dix/dispatch.c:3.29 Sat Jan 11 21:44:26 2003 +++ xc/programs/Xserver/dix/dispatch.c Mon Nov 17 17:20:33 2003 @@ -68,7 +68,7 @@ * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.29 2003/01/12 02:44:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.33 2003/11/17 22:20:33 dawes Exp $ */ #ifdef PANORAMIX_DEBUG #include @@ -136,15 +136,11 @@ extern int connBlockScreenStart; static void KillAllClients( -#if NeedFunctionPrototypes void -#endif ); static void DeleteClientFromAnySelections( -#if NeedFunctionPrototypes ClientPtr /*client*/ -#endif ); static int nextFreeClientID; /* always MIN free client ID */ @@ -444,7 +440,7 @@ client->requestLog[client->requestLogIndex] = MAJOROP; client->requestLogIndex++; #endif - if (result > (MAX_BIG_REQUEST_SIZE << 2)) + if (result > (maxBigRequestSize << 2)) result = BadLength; else result = (* client->requestVector[MAJOROP])(client); @@ -1172,12 +1168,7 @@ } static void -#if NeedFunctionPrototypes UngrabServer(ClientPtr client) -#else -UngrabServer(client) - ClientPtr client; -#endif { int i; @@ -2226,7 +2217,7 @@ pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); if (pVisibleRegion) { - REGION_TRANSLATE(pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); + REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); } } #endif @@ -2320,7 +2311,7 @@ } #ifdef XCSECURITY if (pVisibleRegion) - REGION_DESTROY(pScreen, pVisibleRegion); + REGION_DESTROY(pDraw->pScreen, pVisibleRegion); #endif if (!im_return) DEALLOCATE_LOCAL(pBuf); @@ -3297,6 +3288,8 @@ ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; else ScreenSaverInterval = defaultScreenSaverInterval; + + SetScreenSaverTimer(); return (client->noClientException); } Index: xc/programs/Xserver/dix/dixfonts.c diff -u xc/programs/Xserver/dix/dixfonts.c:3.27 xc/programs/Xserver/dix/dixfonts.c:3.29 --- xc/programs/Xserver/dix/dixfonts.c:3.27 Fri Feb 14 22:47:05 2003 +++ xc/programs/Xserver/dix/dixfonts.c Mon Nov 17 17:20:34 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.27 2003/02/15 03:47:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.29 2003/11/17 22:20:34 dawes Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -193,23 +193,13 @@ /* XXX -- these two funcs may want to be broken into macros */ static void -#if NeedFunctionPrototypes UseFPE(FontPathElementPtr fpe) -#else -UseFPE(fpe) - FontPathElementPtr fpe; -#endif { fpe->refcount++; } static void -#if NeedFunctionPrototypes FreeFPE (FontPathElementPtr fpe) -#else -FreeFPE (fpe) - FontPathElementPtr fpe; -#endif { fpe->refcount--; if (fpe->refcount == 0) { @@ -220,13 +210,7 @@ } static Bool -#if NeedFunctionPrototypes doOpenFont(ClientPtr client, OFclosurePtr c) -#else -doOpenFont(client, c) - ClientPtr client; - OFclosurePtr c; -#endif { FontPtr pfont = NullFont; FontPathElementPtr fpe = NULL; @@ -576,13 +560,7 @@ } static Bool -#if NeedFunctionPrototypes doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -#else -doListFontsAndAliases(client, c) - ClientPtr client; - LFclosurePtr c; -#endif { FontPathElementPtr fpe; int err = Successful; @@ -998,7 +976,11 @@ c->saved = c->current; c->haveSaved = TRUE; c->savedNumFonts = numFonts; - c->savedName = (char *) pFontInfo; + if (c->savedName) + xfree(c->savedName); + c->savedName = (char *)xalloc(namelen + 1); + if (c->savedName) + memmove(c->savedName, name, namelen + 1); aliascount = 20; } memmove(c->current.pattern, name, namelen); @@ -1105,6 +1087,7 @@ FreeFPE(c->fpe_list[i]); xfree(c->reply); xfree(c->fpe_list); + if (c->savedName) xfree(c->savedName); xfree(c); return TRUE; } @@ -1155,6 +1138,7 @@ c->savedNumFonts = 0; c->haveSaved = FALSE; c->slept = FALSE; + c->savedName = 0; doListFontsWithInfo(client, c); return Success; badAlloc: @@ -1642,12 +1626,7 @@ /* does the necessary magic to figure out the fpe type */ static int -#if NeedFunctionPrototypes DetermineFPEType(char *pathname) -#else -DetermineFPEType(pathname) - char *pathname; -#endif { int i; @@ -1660,14 +1639,7 @@ static void -#if NeedFunctionPrototypes FreeFontPath(FontPathElementPtr *list, int n, Bool force) -#else -FreeFontPath(list, n, force) - FontPathElementPtr *list; - Bool force; - int n; -#endif { int i; @@ -1694,15 +1666,7 @@ } static FontPathElementPtr -#if NeedFunctionPrototypes find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -#else -find_existing_fpe(list, num, name, len) - FontPathElementPtr *list; - int num; - unsigned char *name; - int len; -#endif { FontPathElementPtr fpe; int i; @@ -1717,15 +1681,7 @@ static int -#if NeedFunctionPrototypes SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -#else -SetFontPathElements(npaths, paths, bad, persist) - int npaths; - unsigned char *paths; - int *bad; - Bool persist; -#endif { int i, err = 0; int valid_paths = 0; Index: xc/programs/Xserver/dix/dixutils.c diff -u xc/programs/Xserver/dix/dixutils.c:3.13 xc/programs/Xserver/dix/dixutils.c:3.14 --- xc/programs/Xserver/dix/dixutils.c:3.13 Sat Jan 11 21:44:26 2003 +++ xc/programs/Xserver/dix/dixutils.c Mon Nov 17 17:20:34 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.13 2003/01/12 02:44:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -604,22 +604,13 @@ } Bool -#if NeedFunctionPrototypes QueueWorkProc ( Bool (*function)( -#if NeedNestedPrototypes ClientPtr /* pClient */, pointer /* closure */ -#endif ), ClientPtr client, pointer closure) -#else -QueueWorkProc (function, client, closure) - Bool (*function)(); - ClientPtr client; - pointer closure; -#endif { WorkQueuePtr q; @@ -736,17 +727,10 @@ static CallbackListPtr **listsToCleanup = NULL; static Bool -#if NeedFunctionPrototypes _AddCallback( CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) -#else -_AddCallback(pcbl, callback, data) - CallbackListPtr *pcbl; - CallbackProcPtr callback; - pointer data; -#endif { CallbackPtr cbr; @@ -762,17 +746,10 @@ } static Bool -#if NeedFunctionPrototypes _DeleteCallback( CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) -#else -_DeleteCallback(pcbl, callback, data) - CallbackListPtr *pcbl; - CallbackProcPtr callback; - pointer data; -#endif { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -805,15 +782,9 @@ } static void -#if NeedFunctionPrototypes _CallCallbacks( CallbackListPtr *pcbl, pointer call_data) -#else -_CallCallbacks(pcbl, call_data) - CallbackListPtr *pcbl; - pointer call_data; -#endif { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -868,13 +839,8 @@ } static void -#if NeedFunctionPrototypes _DeleteCallbackList( CallbackListPtr *pcbl) -#else -_DeleteCallbackList(pcbl) - CallbackListPtr *pcbl; -#endif { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, nextcbr; Index: xc/programs/Xserver/dix/events.c diff -u xc/programs/Xserver/dix/events.c:3.46 xc/programs/Xserver/dix/events.c:3.52 --- xc/programs/Xserver/dix/events.c:3.46 Mon Sep 16 21:15:09 2002 +++ xc/programs/Xserver/dix/events.c Fri Jan 23 02:23:34 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.46 2002/09/17 01:15:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.52 2004/01/23 07:23:34 herrb Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -90,11 +90,7 @@ #ifdef XKB #include "XKBsrv.h" -#if NeedFunctionPrototypes extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#else -extern Bool XkbFilterEvents(); -#endif #endif #ifdef XCSECURITY @@ -204,18 +200,14 @@ } sprite; /* info about the cursor sprite */ static void DoEnterLeaveEvents( -#if NeedFunctionPrototypes WindowPtr /*fromWin*/, WindowPtr /*toWin*/, int /*mode*/ -#endif ); static WindowPtr XYToWindow( -#if NeedFunctionPrototypes int /*x*/, int /*y*/ -#endif ); extern int lastEvent; @@ -613,12 +605,7 @@ } static void -#if NeedFunctionPrototypes SyntheticMotion(int x, int y) -#else -SyntheticMotion(x, y) - int x, y; -#endif { xEvent xE; @@ -643,13 +630,7 @@ #ifdef SHAPE static void -#if NeedFunctionPrototypes ConfineToShape(RegionPtr shape, int *px, int *py) -#else -ConfineToShape(shape, px, py) - RegionPtr shape; - int *px, *py; -#endif { BoxRec box; int x = *px, y = *py; @@ -686,19 +667,11 @@ #endif static void -#if NeedFunctionPrototypes CheckPhysLimits( CursorPtr cursor, Bool generateEvents, Bool confineToScreen, ScreenPtr pScreen) -#else -CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen) - CursorPtr cursor; - Bool generateEvents; - Bool confineToScreen; - ScreenPtr pScreen; -#endif { HotSpot new; @@ -739,15 +712,9 @@ } static void -#if NeedFunctionPrototypes CheckVirtualMotion( register QdEventPtr qe, register WindowPtr pWin) -#else -CheckVirtualMotion(qe, pWin) - register QdEventPtr qe; - register WindowPtr pWin; -#endif { #ifdef PANORAMIX if(!noPanoramiXExtension) { @@ -831,12 +798,7 @@ } static void -#if NeedFunctionPrototypes ChangeToCursor(CursorPtr cursor) -#else -ChangeToCursor(cursor) - CursorPtr cursor; -#endif { #ifdef PANORAMIX if(!noPanoramiXExtension) { @@ -868,11 +830,7 @@ } static void -#if NeedFunctionPrototypes PostNewCursor(void) -#else -PostNewCursor() -#endif { register WindowPtr win; register GrabPtr grab = inputInfo.pointer->grab; @@ -942,12 +900,7 @@ #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ static void -#if NeedFunctionPrototypes MonthChangedOrBadTime(register xEvent *xE) -#else -MonthChangedOrBadTime(xE) - register xEvent *xE; -#endif { /* If the ddx/OS is careless about not processing timestamped events from * different sources in sorted order, then it's possible for time to go @@ -988,6 +941,14 @@ xEvent *qxE; NoticeTime(xE); + +#ifdef XKB + /* Fix for key repeating bug. */ + if (device->key != NULL && device->key->xkbInfo != NULL && + xE->u.u.type == KeyRelease) + AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); +#endif + if (DeviceEventCallback) { DeviceEventInfoRec eventinfo; @@ -1048,11 +1009,7 @@ } static void -#if NeedFunctionPrototypes PlayReleasedEvents(void) -#else -PlayReleasedEvents() -#endif { register QdEventPtr *prev, qe; register DeviceIntPtr dev; @@ -1099,13 +1056,7 @@ } static void -#if NeedFunctionPrototypes FreezeThaw(register DeviceIntPtr dev, Bool frozen) -#else -FreezeThaw(dev, frozen) - register DeviceIntPtr dev; - Bool frozen; -#endif { dev->sync.frozen = frozen; if (frozen) @@ -1697,8 +1648,11 @@ #ifdef XINPUT else { - if (((type == DeviceMotionNotify) || (type == DeviceButtonPress)) && - deliveries) + if (((type == DeviceMotionNotify) +#ifdef XKB + || (type == DeviceButtonPress) +#endif + ) && deliveries) CheckDeviceGrabAndHintWindow (pWin, type, (deviceKeyButtonPointer*) pEvents, grab, client, deliveryMask); @@ -1774,19 +1728,11 @@ } static void -#if NeedFunctionPrototypes FixUpEventFromWindow( xEvent *xE, WindowPtr pWin, Window child, Bool calcChild) -#else -FixUpEventFromWindow(xE, pWin, child, calcChild) - xEvent *xE; - WindowPtr pWin; - Window child; - Bool calcChild; -#endif { if (calcChild) { @@ -1970,12 +1916,7 @@ } static WindowPtr -#if NeedFunctionPrototypes XYToWindow(int x, int y) -#else -XYToWindow(x, y) - int x, y; -#endif { register WindowPtr pWin; @@ -2017,12 +1958,7 @@ } static Bool -#if NeedFunctionPrototypes CheckMotion(xEvent *xE) -#else -CheckMotion(xE) - xEvent *xE; -#endif { WindowPtr prevSpriteWin = sprite.win; @@ -2123,10 +2059,13 @@ sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y; sprite.physLimits = sprite.hotLimits; sprite.confineWin = NullWindow; +#ifdef SHAPE + sprite.hotShape = NullRegion; +#endif sprite.screen = pScreen; /* gotta UNINIT these someplace */ - REGION_INIT(pScreen, &sprite.Reg1, NullBox, 1); - REGION_INIT(pScreen, &sprite.Reg2, NullBox, 1); + REGION_NULL(pScreen, &sprite.Reg1); + REGION_NULL(pScreen, &sprite.Reg2); } #endif } @@ -2404,19 +2343,11 @@ passive grab set on the window to be activated. */ static Bool -#if NeedFunctionPrototypes CheckPassiveGrabsOnWindow( WindowPtr pWin, register DeviceIntPtr device, register xEvent *xE, int count) -#else -CheckPassiveGrabsOnWindow(pWin, device, xE, count) - WindowPtr pWin; - register DeviceIntPtr device; - register xEvent *xE; - int count; -#endif { register GrabPtr grab = wPassiveGrabs(pWin); GrabRec tempGrab; @@ -2440,10 +2371,10 @@ xkbi= gdev->key->xkbInfo; #endif tempGrab.modifierDevice = grab->modifierDevice; - if (device == grab->modifierDevice && - (xE->u.u.type == KeyPress -#ifdef XINPUT - || xE->u.u.type == DeviceKeyPress + if ((device == grab->modifierDevice) && + ((xE->u.u.type == KeyPress) +#if defined(XINPUT) && defined(XKB) + || (xE->u.u.type == DeviceKeyPress) #endif )) tempGrab.modifiersDetail.exact = @@ -2528,11 +2459,11 @@ register WindowPtr pWin = NULL; register FocusClassPtr focus = device->focus; - if ((xE->u.u.type == ButtonPress -#ifdef XINPUT - || xE->u.u.type == DeviceButtonPress + if (((xE->u.u.type == ButtonPress) +#if defined(XINPUT) && defined(XKB) + || (xE->u.u.type == DeviceButtonPress) #endif - ) && device->button->buttonsDown != 1) + ) && (device->button->buttonsDown != 1)) return FALSE; i = checkFirst; @@ -3150,14 +3081,9 @@ } static WindowPtr -#if NeedFunctionPrototypes CommonAncestor( register WindowPtr a, register WindowPtr b) -#else -CommonAncestor(a, b) - register WindowPtr a, b; -#endif { for (b = b->parent; b; b = b->parent) if (IsParent(b, a)) return b; @@ -3165,19 +3091,12 @@ } static void -#if NeedFunctionPrototypes EnterLeaveEvent( int type, int mode, int detail, register WindowPtr pWin, Window child) -#else -EnterLeaveEvent(type, mode, detail, pWin, child) - int type, mode, detail; - register WindowPtr pWin; - Window child; -#endif { xEvent event; register DeviceIntPtr keybd = inputInfo.keyboard; @@ -3258,13 +3177,7 @@ } static void -#if NeedFunctionPrototypes EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) -#else -EnterNotifies(ancestor, child, mode, detail) - WindowPtr ancestor, child; - int mode, detail; -#endif { WindowPtr parent = child->parent; @@ -3275,13 +3188,7 @@ } static void -#if NeedFunctionPrototypes LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) -#else -LeaveNotifies(child, ancestor, mode, detail) - WindowPtr child, ancestor; - int detail, mode; -#endif { register WindowPtr pWin; @@ -3295,13 +3202,7 @@ } static void -#if NeedFunctionPrototypes DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) -#else -DoEnterLeaveEvents(fromWin, toWin, mode) - WindowPtr fromWin, toWin; - int mode; -#endif { if (fromWin == toWin) return; @@ -3329,14 +3230,7 @@ } static void -#if NeedFunctionPrototypes FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) -#else -FocusEvent(dev, type, mode, detail, pWin) - DeviceIntPtr dev; - int type, mode, detail; - register WindowPtr pWin; -#endif { xEvent event; @@ -3377,19 +3271,11 @@ * no-op if child not descended from ancestor */ static Bool -#if NeedFunctionPrototypes FocusInEvents( DeviceIntPtr dev, WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, int mode, int detail, Bool doAncestor) -#else -FocusInEvents(dev, ancestor, child, skipChild, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr ancestor, child, skipChild; - int mode, detail; - Bool doAncestor; -#endif { if (child == NullWindow) return ancestor == NullWindow; @@ -3411,20 +3297,11 @@ /* dies horribly if ancestor is not an ancestor of child */ static void -#if NeedFunctionPrototypes FocusOutEvents( DeviceIntPtr dev, WindowPtr child, WindowPtr ancestor, int mode, int detail, Bool doAncestor) -#else -FocusOutEvents(dev, child, ancestor, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr child, ancestor; - int mode; - int detail; - Bool doAncestor; -#endif { register WindowPtr pWin; @@ -3564,7 +3441,6 @@ } int -#if NeedFunctionPrototypes SetInputFocus( ClientPtr client, DeviceIntPtr dev, @@ -3572,15 +3448,6 @@ CARD8 revertTo, Time ctime, Bool followOK) -#else -SetInputFocus(client, dev, focusID, revertTo, ctime, followOK) - ClientPtr client; - DeviceIntPtr dev; - Window focusID; - CARD8 revertTo; - Time ctime; - Bool followOK; -#endif { register FocusClassPtr focus; register WindowPtr focusWin; Index: xc/programs/Xserver/dix/gc.c diff -u xc/programs/Xserver/dix/gc.c:3.9 xc/programs/Xserver/dix/gc.c:3.10 --- xc/programs/Xserver/dix/gc.c:3.9 Fri Dec 14 14:59:32 2001 +++ xc/programs/Xserver/dix/gc.c Mon Nov 17 17:20:34 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.9 2001/12/14 19:59:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.10 2003/11/17 22:20:34 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -66,9 +66,7 @@ extern FontPtr defaultFont; static Bool CreateDefaultTile( -#if NeedFunctionPrototypes GCPtr /*pGC*/ -#endif ); unsigned char DefaultDash[2] = {4, 4}; @@ -585,12 +583,7 @@ */ static GCPtr -#if NeedFunctionPrototypes AllocateGC(ScreenPtr pScreen) -#else -AllocateGC(pScreen) - ScreenPtr pScreen; -#endif { GCPtr pGC; register char *ptr; Index: xc/programs/Xserver/dix/globals.c diff -u xc/programs/Xserver/dix/globals.c:1.10 xc/programs/Xserver/dix/globals.c:1.13 --- xc/programs/Xserver/dix/globals.c:1.10 Tue Oct 8 19:55:18 2002 +++ xc/programs/Xserver/dix/globals.c Wed Dec 3 12:11:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.10 2002/10/08 23:55:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.13 2003/12/03 17:11:29 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -79,6 +79,7 @@ ClientPtr *clients; ClientPtr serverClient; int currentMaxClients; /* current size of clients array */ +long maxBigRequestSize = MAX_BIG_REQUEST_SIZE; WindowPtr *WindowTable; Index: xc/programs/Xserver/dix/grabs.c diff -u xc/programs/Xserver/dix/grabs.c:3.4 xc/programs/Xserver/dix/grabs.c:3.5 --- xc/programs/Xserver/dix/grabs.c:3.4 Tue Feb 19 06:09:22 2002 +++ xc/programs/Xserver/dix/grabs.c Mon Nov 17 17:20:34 2003 @@ -46,7 +46,7 @@ SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.4 2002/02/19 11:09:22 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.5 2003/11/17 22:20:34 dawes Exp $ */ #include "X.h" #include "misc.h" @@ -65,7 +65,6 @@ #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) GrabPtr -#if NeedFunctionPrototypes CreateGrab( int client, DeviceIntPtr device, @@ -78,21 +77,6 @@ KeyCode keybut, /* key or button */ WindowPtr confineTo, CursorPtr cursor) -#else -CreateGrab(client, device, window, eventMask, ownerEvents, keyboardMode, - pointerMode, modDevice, modifiers, type, keybut, confineTo, cursor) - int client; - DeviceIntPtr device; - WindowPtr window; - Mask eventMask; - Bool ownerEvents, keyboardMode, pointerMode; - DeviceIntPtr modDevice; - unsigned short modifiers; - int type; - KeyCode keybut; /* key or button */ - WindowPtr confineTo; - CursorPtr cursor; -#endif { GrabPtr grab; @@ -125,12 +109,7 @@ } static void -#if NeedFunctionPrototypes FreeGrab(GrabPtr pGrab) -#else -FreeGrab(pGrab) - GrabPtr pGrab; -#endif { if (pGrab->modifiersDetail.pMask != NULL) xfree(pGrab->modifiersDetail.pMask); @@ -173,13 +152,7 @@ } static Mask * -#if NeedFunctionPrototypes DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail) -#else -DeleteDetailFromMask(pDetailMask, detail) - Mask *pDetailMask; - unsigned short detail; -#endif { register Mask *mask; register int i; @@ -199,16 +172,10 @@ } static Bool -#if NeedFunctionPrototypes IsInGrabMask( DetailRec firstDetail, DetailRec secondDetail, unsigned short exception) -#else -IsInGrabMask(firstDetail, secondDetail, exception) - DetailRec firstDetail, secondDetail; - unsigned short exception; -#endif { if (firstDetail.exact == exception) { @@ -227,15 +194,10 @@ } static Bool -#if NeedFunctionPrototypes IdenticalExactDetails( unsigned short firstExact, unsigned short secondExact, unsigned short exception) -#else -IdenticalExactDetails(firstExact, secondExact, exception) - unsigned short firstExact, secondExact, exception; -#endif { if ((firstExact == exception) || (secondExact == exception)) return FALSE; @@ -247,16 +209,10 @@ } static Bool -#if NeedFunctionPrototypes DetailSupersedesSecond( DetailRec firstDetail, DetailRec secondDetail, unsigned short exception) -#else -DetailSupersedesSecond(firstDetail, secondDetail, exception) - DetailRec firstDetail, secondDetail; - unsigned short exception; -#endif { if (IsInGrabMask(firstDetail, secondDetail, exception)) return TRUE; @@ -269,12 +225,7 @@ } static Bool -#if NeedFunctionPrototypes GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab) -#else -GrabSupersedesSecond(pFirstGrab, pSecondGrab) - GrabPtr pFirstGrab, pSecondGrab; -#endif { if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail, pSecondGrab->modifiersDetail, Index: xc/programs/Xserver/dix/main.c diff -u xc/programs/Xserver/dix/main.c:3.40 xc/programs/Xserver/dix/main.c:3.44 --- xc/programs/Xserver/dix/main.c:3.40 Mon Feb 17 11:55:31 2003 +++ xc/programs/Xserver/dix/main.c Mon Nov 17 17:20:34 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.40 2003/02/17 16:55:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.44 2003/11/17 22:20:34 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -106,15 +106,11 @@ #endif extern int InitClientPrivates( -#if NeedFunctionPrototypes ClientPtr /*client*/ -#endif ); extern void Dispatch( -#if NeedFunctionPrototypes void -#endif ); char *ConnectionInfo; @@ -151,11 +147,9 @@ /*ARGSUSED*/ void ReplyNotSwappd( -#if NeedNestedPrototypes ClientPtr pClient , int size , void * pbuf -#endif ) { FatalError("Not implemented"); @@ -319,8 +313,8 @@ } else ResetWellKnownSockets (); - clients[0] = serverClient; - currentMaxClients = 1; + clients[0] = serverClient; + currentMaxClients = 1; if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); @@ -418,8 +412,11 @@ for (i = 0; i < screenInfo.numScreens; i++) InitRootWindow(WindowTable[i]); - DefineInitialRootWindow(WindowTable[0]); + DefineInitialRootWindow(WindowTable[0]); SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); +#ifdef DPMSExtension + SetDPMSTimers(); +#endif #ifdef PANORAMIX if (!noPanoramiXExtension) { @@ -437,6 +434,7 @@ /* Now free up whatever must be freed */ if (screenIsSaved == SCREEN_SAVER_ON) SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset); + FreeScreenSaverTimer(); CloseDownExtensions(); #ifdef PANORAMIX @@ -463,7 +461,12 @@ CloseDownEvents(); xfree(WindowTable); WindowTable = NULL; - FreeFonts (); + FreeFonts(); + +#ifdef DPMSExtension + FreeDPMSTimers(); +#endif + FreeAuditTimer(); xfree(serverClient->devPrivates); serverClient->devPrivates = NULL; @@ -471,7 +474,12 @@ if (dispatchException & DE_TERMINATE) { CloseWellKnownConnections(); - OsCleanup(); + } + + OsCleanup((dispatchException & DE_TERMINATE) != 0); + + if (dispatchException & DE_TERMINATE) + { ddxGiveUp(); break; } @@ -540,7 +548,7 @@ i = padlength[setup.nbytesVendor & 3]; sizesofar += i; while (--i >= 0) - *pBuf++ = 0; + *pBuf++ = 0; for (i=0; inItems = 0; reply->length = 0; Index: xc/programs/Xserver/dix/resource.c diff -u xc/programs/Xserver/dix/resource.c:3.12 xc/programs/Xserver/dix/resource.c:3.14 --- xc/programs/Xserver/dix/resource.c:3.12 Wed Mar 6 16:13:38 2002 +++ xc/programs/Xserver/dix/resource.c Mon Nov 17 17:20:34 2003 @@ -72,7 +72,7 @@ * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a * resource "owned" by the client. */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.12 2002/03/06 21:13:38 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */ #define NEED_EVENTS #include "X.h" @@ -95,9 +95,7 @@ #include static void RebuildTable( -#if NeedFunctionPrototypes int /*client*/ -#endif ); #define SERVER_MINID 32 @@ -253,13 +251,7 @@ static int -#if NeedFunctionPrototypes Hash(int client, register XID id) -#else -Hash(client, id) - int client; - register XID id; -#endif { id &= RESOURCE_ID_MASK; switch (clientTable[client].hashsize) @@ -281,17 +273,11 @@ } static XID -#if NeedFunctionPrototypes AvailableID( register int client, register XID id, register XID maxid, register XID goodid) -#else -AvailableID(client, id, maxid, goodid) - register int client; - register XID id, maxid, goodid; -#endif { register ResourcePtr res; @@ -427,8 +413,8 @@ rrec = &clientTable[client]; if (!rrec->buckets) { - ErrorF("AddResource(%x, %x, %x), client=%d \n", - id, type, (unsigned long)value, client); + ErrorF("AddResource(%lx, %lx, %lx), client=%d \n", + (unsigned long)id, type, (unsigned long)value, client); FatalError("client not in use\n"); } if ((rrec->elements >= 4*rrec->buckets) && @@ -546,7 +532,8 @@ } } if (!gotOne) - FatalError("Freeing resource id=%X which isn't there", id); + FatalError("Freeing resource id=%lX which isn't there", + (unsigned long)id); } Index: xc/programs/Xserver/dix/swaprep.c diff -u xc/programs/Xserver/dix/swaprep.c:3.7 xc/programs/Xserver/dix/swaprep.c:3.8 --- xc/programs/Xserver/dix/swaprep.c:3.7 Fri Dec 14 14:59:33 2001 +++ xc/programs/Xserver/dix/swaprep.c Mon Nov 17 17:20:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.7 2001/12/14 19:59:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.8 2003/11/17 22:20:35 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -60,23 +60,17 @@ #include "globals.h" static void SwapFontInfo( -#if NeedFunctionPrototypes xQueryFontReply * /* pr */ -#endif ); #ifndef LBX static void SwapCharInfo( -#if NeedFunctionPrototypes xCharInfo * /* pInfo */ -#endif ); static void SwapFont( -#if NeedFunctionPrototypes xQueryFontReply * /* pr */, Bool /* hasGlyphs */ -#endif ); #endif Index: xc/programs/Xserver/dix/tables.c diff -u xc/programs/Xserver/dix/tables.c:3.5 xc/programs/Xserver/dix/tables.c:3.6 --- xc/programs/Xserver/dix/tables.c:3.5 Tue Feb 19 06:09:22 2002 +++ xc/programs/Xserver/dix/tables.c Mon Nov 17 17:20:35 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.5 2002/02/19 11:09:22 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.6 2003/11/17 22:20:35 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -65,9 +65,7 @@ #endif int (* InitialVector[3]) ( -#if NeedNestedPrototypes ClientPtr /* client */ -#endif ) = { 0, @@ -76,9 +74,7 @@ }; int (* ProcVector[256]) ( -#if NeedNestedPrototypes ClientPtr /* client */ -#endif ) = { ProcBadRequest, @@ -212,9 +208,7 @@ }; int (* SwappedProcVector[256]) ( -#if NeedNestedPrototypes ClientPtr /* client */ -#endif ) = { ProcBadRequest, Index: xc/programs/Xserver/dix/window.c diff -u xc/programs/Xserver/dix/window.c:3.32 xc/programs/Xserver/dix/window.c:3.37 --- xc/programs/Xserver/dix/window.c:3.32 Sat Jan 11 21:44:26 2003 +++ xc/programs/Xserver/dix/window.c Mon Nov 17 17:20:35 2003 @@ -70,7 +70,7 @@ * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.32 2003/01/12 02:44:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.37 2003/11/17 22:20:35 dawes Exp $ */ #include "misc.h" #include "scrnintstr.h" @@ -100,13 +100,6 @@ #include "security.h" #endif -#if defined(NEED_SCREEN_REGIONS) -#define REGION_PTR(pScreen,pWin) \ - register ScreenPtr pScreen = pWin->drawable.pScreen; -#else -#define REGION_PTR(pScreen,pWin) /* nothing */ -#endif - /****** * Window stuff for server * @@ -132,10 +125,8 @@ #endif static Bool TileScreenSaver( -#if NeedFunctionPrototypes int /*i*/, int /*kind*/ -#endif ); @@ -260,12 +251,7 @@ Bool disableSaveUnders = FALSE; static void -#if NeedFunctionPrototypes SetWindowToDefaults(register WindowPtr pWin) -#else -SetWindowToDefaults(pWin) - register WindowPtr pWin; -#endif { pWin->prevSib = NullWindow; pWin->firstChild = NullWindow; @@ -300,12 +286,7 @@ } static void -#if NeedFunctionPrototypes MakeRootTile(WindowPtr pWin) -#else -MakeRootTile(pWin) - WindowPtr pWin; -#endif { ScreenPtr pScreen = pWin->drawable.pScreen; GCPtr pGC; @@ -500,9 +481,8 @@ InitRootWindow(pWin) WindowPtr pWin; { - ScreenPtr pScreen; + ScreenPtr pScreen = pWin->drawable.pScreen; - pScreen = pWin->drawable.pScreen; if (!(*pScreen->CreateWindow)(pWin)) return; /* XXX */ (*pScreen->PositionWindow)(pWin, 0, 0); @@ -532,7 +512,7 @@ register int x, y; int w, h; { - REGION_PTR(pScreen, pWin) + ScreenPtr pScreen = pWin->drawable.pScreen; BoxRec box; box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); @@ -744,10 +724,10 @@ pWin->drawable.y = pParent->drawable.y + y + (int)bw; /* set up clip list correctly for unobscured WindowPtr */ - REGION_INIT(pScreen, &pWin->clipList, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderClip, NullBox, 1); - REGION_INIT(pScreen, &pWin->winSize, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderSize, NullBox, 1); + REGION_NULL(pScreen, &pWin->clipList); + REGION_NULL(pScreen, &pWin->borderClip); + REGION_NULL(pScreen, &pWin->winSize); + REGION_NULL(pScreen, &pWin->borderSize); pHead = RealChildHead(pParent); if (pHead) @@ -820,12 +800,7 @@ } static void -#if NeedFunctionPrototypes FreeWindowResources(register WindowPtr pWin) -#else -FreeWindowResources(pWin) - register WindowPtr pWin; -#endif { register ScreenPtr pScreen = pWin->drawable.pScreen; @@ -854,12 +829,7 @@ } static void -#if NeedFunctionPrototypes CrushTree(WindowPtr pWin) -#else -CrushTree(pWin) - WindowPtr pWin; -#endif { register WindowPtr pChild, pSib, pParent; UnrealizeWindowProcPtr UnrealizeWindow; @@ -1513,7 +1483,7 @@ { RegionRec exposed; - REGION_INIT(pScreen, &exposed, NullBox, 0); + REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); REGION_UNINIT(pScreen, &exposed); @@ -1637,6 +1607,17 @@ (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib); } +#ifdef ROOTLESS + /* + * In rootless mode we can't optimize away window restacks. + * There may be non-X windows around, so even if the window + * is in the correct position from X's point of view, + * the underlying window system may want to reorder it. + */ + else if (pWin->drawable.pScreen->RestackWindow) + (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib); +#endif + return( pFirstChange ); } @@ -1654,7 +1635,7 @@ pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) + ScreenPtr pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - pWin->drawable.y); @@ -1678,7 +1659,7 @@ (int)pWin->drawable.height); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) + ScreenPtr pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - pWin->drawable.y); @@ -1708,7 +1689,7 @@ (int)(pWin->drawable.height + (bw<<1))); #ifdef SHAPE if (wBoundingShape (pWin)) { - REGION_PTR(pScreen, pWin) + ScreenPtr pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - pWin->drawable.y); @@ -1876,14 +1857,9 @@ */ static int -#if NeedFunctionPrototypes IsSiblingAboveMe( register WindowPtr pMe, register WindowPtr pSib) -#else -IsSiblingAboveMe(pMe, pSib) - register WindowPtr pMe, pSib; -#endif { register WindowPtr pWin; @@ -1900,15 +1876,9 @@ } static BoxPtr -#if NeedFunctionPrototypes WindowExtents( register WindowPtr pWin, register BoxPtr pBox) -#else -WindowExtents(pWin, pBox) - register WindowPtr pWin; - register BoxPtr pBox; -#endif { pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); @@ -1923,18 +1893,12 @@ #define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) static RegionPtr -#if NeedFunctionPrototypes MakeBoundingRegion ( register WindowPtr pWin, BoxPtr pBox) -#else -MakeBoundingRegion (pWin, pBox) - register WindowPtr pWin; - BoxPtr pBox; -#endif { RegionPtr pRgn; - REGION_PTR(pScreen, pWin) + ScreenPtr pScreen = pWin->drawable.pScreen; pRgn = REGION_CREATE(pScreen, pBox, 1); if (wBoundingShape (pWin)) { @@ -1948,17 +1912,11 @@ } static Bool -#if NeedFunctionPrototypes ShapeOverlap ( WindowPtr pWin, BoxPtr pWinBox, WindowPtr pSib, BoxPtr pSibBox) -#else -ShapeOverlap (pWin, pWinBox, pSib, pSibBox) - WindowPtr pWin, pSib; - BoxPtr pWinBox, pSibBox; -#endif { RegionPtr pWinRgn, pSibRgn; register ScreenPtr pScreen; @@ -1978,16 +1936,10 @@ #endif static Bool -#if NeedFunctionPrototypes AnyWindowOverlapsMe( WindowPtr pWin, WindowPtr pHead, register BoxPtr box) -#else -AnyWindowOverlapsMe(pWin, pHead, box) - WindowPtr pWin, pHead; - register BoxPtr box; -#endif { register WindowPtr pSib; BoxRec sboxrec; @@ -2010,15 +1962,9 @@ } static Bool -#if NeedFunctionPrototypes IOverlapAnyWindow( WindowPtr pWin, register BoxPtr box) -#else -IOverlapAnyWindow(pWin, box) - WindowPtr pWin; - register BoxPtr box; -#endif { register WindowPtr pSib; BoxRec sboxrec; @@ -2069,7 +2015,6 @@ */ static WindowPtr -#if NeedFunctionPrototypes WhereDoIGoInTheStack( register WindowPtr pWin, register WindowPtr pSib, @@ -2078,13 +2023,6 @@ unsigned short w, unsigned short h, int smode) -#else -WhereDoIGoInTheStack(pWin, pSib, x, y, w, h, smode) - register WindowPtr pWin, pSib; - short x, y; - unsigned short w, h; - int smode; -#endif { BoxRec box; register ScreenPtr pScreen; @@ -2183,21 +2121,14 @@ } static void -#if NeedFunctionPrototypes ReflectStackChange( register WindowPtr pWin, register WindowPtr pSib, VTKind kind) -#else -ReflectStackChange(pWin, pSib, kind) - register WindowPtr pWin, pSib; - VTKind kind; -#endif { /* Note that pSib might be NULL */ Bool WasViewable = (Bool)pWin->viewable; - WindowPtr pParent; Bool anyMarked; WindowPtr pFirstChange; #ifdef DO_SAVE_UNDERS @@ -2207,8 +2138,8 @@ ScreenPtr pScreen = pWin->drawable.pScreen; /* if this is a root window, can't be restacked */ - if (!(pParent = pWin->parent)) - return ; + if (!pWin->parent) + return; pFirstChange = MoveWindowInStack(pWin, pSib); @@ -2456,7 +2387,10 @@ goto ActuallyDoSomething; if (mask & CWStackMode) { +#ifndef ROOTLESS + /* See above for why we always reorder in rootless mode. */ if (pWin->nextSib != pSib) +#endif goto ActuallyDoSomething; } return(Success); @@ -2588,15 +2522,9 @@ } static int -#if NeedFunctionPrototypes CompareWIDs( WindowPtr pWin, pointer value) /* must conform to VisitWindowProcPtr */ -#else -CompareWIDs(pWin, value) - WindowPtr pWin; - pointer value; /* must conform to VisitWindowProcPtr */ -#endif { Window *wid = (Window *)value; @@ -2705,12 +2633,7 @@ } static void -#if NeedFunctionPrototypes RealizeTree(WindowPtr pWin) -#else -RealizeTree(pWin) - WindowPtr pWin; -#endif { register WindowPtr pChild; RealizeWindowProcPtr Realize; @@ -2862,7 +2785,7 @@ (*pScreen->ClipNotify) (pWin, 0, 0); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_INIT(pScreen, &temp, NullBox, 0); + REGION_NULL(pScreen, &temp); REGION_COPY(pScreen, &temp, &pWin->clipList); (*pScreen->WindowExposures) (pWin, &temp, NullRegion); REGION_UNINIT(pScreen, &temp); @@ -2997,15 +2920,9 @@ } static void -#if NeedFunctionPrototypes UnrealizeTree( WindowPtr pWin, Bool fromConfigure) -#else -UnrealizeTree(pWin, fromConfigure) - WindowPtr pWin; - Bool fromConfigure; -#endif { register WindowPtr pChild; UnrealizeWindowProcPtr Unrealize; @@ -3370,9 +3287,7 @@ #ifndef NOLOGOHACK static void DrawLogo( -#if NeedFunctionPrototypes WindowPtr /*pWin*/ -#endif ); #endif @@ -3487,16 +3402,12 @@ } } screenIsSaved = what; + if (mode == ScreenSaverReset) + SetScreenSaverTimer(); } static Bool -#if NeedFunctionPrototypes TileScreenSaver(int i, int kind) -#else -TileScreenSaver(i, kind) - int i; - int kind; -#endif { int j; int result; @@ -3764,12 +3675,7 @@ #ifndef NOLOGOHACK static void -#if NeedFunctionPrototypes DrawLogo(WindowPtr pWin) -#else -DrawLogo(pWin) - WindowPtr pWin; -#endif { DrawablePtr pDraw; ScreenPtr pScreen; Index: xc/programs/Xserver/fb/fb.h diff -u xc/programs/Xserver/fb/fb.h:1.35 xc/programs/Xserver/fb/fb.h:1.37 --- xc/programs/Xserver/fb/fb.h:1.35 Thu Jan 30 16:46:30 2003 +++ xc/programs/Xserver/fb/fb.h Mon Nov 3 00:11:00 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.35 2003/01/30 21:46:30 tsi Exp $ + * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.37 2003/11/03 05:11:00 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -105,7 +105,8 @@ defined(ia64) || defined(__ia64__) || \ defined(__sparc64__) || \ defined(__s390x__) || \ - defined(x86_64) || defined (__x86_64__) + defined(AMD64) || defined (__AMD64__) || \ + (defined(sgi) && (_MIPS_SZLONG == 64)) typedef unsigned long FbBits; # else typedef unsigned long long FbBits; @@ -652,10 +653,10 @@ else \ _pPix = (PixmapPtr) (pDrawable); \ (pointer) = (FbBits *) _pPix->devPrivate.ptr; \ - (stride) = ((int) _pPix->devKind) / sizeof (FbBits); \ - (bpp) = _pPix->drawable.bitsPerPixel; \ - (xoff) = __fbPixOriginX(_pPix); \ - (yoff) = __fbPixOriginY(_pPix); \ + (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \ + (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ + (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \ + (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \ } #define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \ @@ -665,10 +666,10 @@ else \ _pPix = (PixmapPtr) (pDrawable); \ (pointer) = (FbStip *) _pPix->devPrivate.ptr; \ - (stride) = ((int) _pPix->devKind) / sizeof (FbStip); \ - (bpp) = _pPix->drawable.bitsPerPixel; \ - (xoff) = __fbPixOriginX(_pPix); \ - (yoff) = __fbPixOriginY(_pPix); \ + (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \ + (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ + (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \ + (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \ } /* Index: xc/programs/Xserver/fb/fbbits.h diff -u xc/programs/Xserver/fb/fbbits.h:1.13 xc/programs/Xserver/fb/fbbits.h:1.14 --- xc/programs/Xserver/fb/fbbits.h:1.13 Sun Nov 18 00:00:25 2001 +++ xc/programs/Xserver/fb/fbbits.h Mon Nov 3 00:11:00 2003 @@ -1,5 +1,5 @@ /* - * Id: fbbits.h,v 1.1 1999/11/02 03:54:45 keithp Exp $ + * $XFree86: xc/programs/Xserver/fb/fbbits.h,v 1.14 2003/11/03 05:11:00 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbits.h,v 1.13 2001/11/18 05:00:25 torrey Exp $ */ /* * This file defines functions for drawing some primitives using @@ -824,8 +823,6 @@ ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); - bits += bitsStride * yoff + xoff * MUL; - capNotLast = pGC->capStyle == CapNotLast; while (nseg--) Index: xc/programs/Xserver/fb/fbcompose.c diff -u xc/programs/Xserver/fb/fbcompose.c:1.16 xc/programs/Xserver/fb/fbcompose.c:1.18 --- xc/programs/Xserver/fb/fbcompose.c:1.16 Wed Nov 6 17:45:35 2002 +++ xc/programs/Xserver/fb/fbcompose.c Thu Dec 4 12:15:12 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.16 2002/11/06 22:45:35 keithp Exp $ + * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.18 2003/12/04 17:15:12 tsi Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -2424,6 +2424,8 @@ (*op[2].store) (&op[2], value & 0xff000000); } +#define dummyScreen screenInfo.screens[0] + CARD32 fbFetch_transform (FbCompositeOperand *op) { @@ -2445,7 +2447,7 @@ case PictFilterNearest: y = xFixedToInt (v.vector[1]) + op->u.transform.top_y; x = xFixedToInt (v.vector[0]) + op->u.transform.left_x; - if (POINT_IN_REGION (0, op->clip, x, y, &box)) + if (POINT_IN_REGION (dummyScreen, op->clip, x, y, &box)) { (*op[1].set) (&op[1], x, y); bits = (*op[1].fetch) (&op[1]); @@ -2469,7 +2471,7 @@ xerr = xFixed1 - xFixedFrac (v.vector[0]); for (x = minx; x <= maxx; x++) { - if (POINT_IN_REGION (0, op->clip, x, y, &box)) + if (POINT_IN_REGION (dummyScreen, op->clip, x, y, &box)) { (*op[1].set) (&op[1], x, y); bits = (*op[1].fetch) (&op[1]); @@ -2527,7 +2529,7 @@ case PictFilterNearest: y = xFixedToInt (v.vector[1]) + op->u.transform.left_x; x = xFixedToInt (v.vector[0]) + op->u.transform.top_y; - if (POINT_IN_REGION (0, op->clip, x, y, &box)) + if (POINT_IN_REGION (dummyScreen, op->clip, x, y, &box)) { (*op[1].set) (&op[1], x, y); bits = (*op[1].fetcha) (&op[1]); @@ -2551,7 +2553,7 @@ xerr = xFixed1 - xFixedFrac (v.vector[0]); for (x = minx; x <= maxx; x++) { - if (POINT_IN_REGION (0, op->clip, x, y, &box)) + if (POINT_IN_REGION (dummyScreen, op->clip, x, y, &box)) { (*op[1].set) (&op[1], x, y); bits = (*op[1].fetcha) (&op[1]); @@ -2826,9 +2828,6 @@ CARD16 height) { FbCompositeOperand src[4],msk[4],dst[4],*pmsk; - FbCompositeOperand *srcPict, *srcAlpha; - FbCompositeOperand *dstPict, *dstAlpha; - FbCompositeOperand *mskPict = 0, *mskAlpha = 0; FbCombineFunc f; int w; @@ -2836,26 +2835,6 @@ return; if (!fbBuildCompositeOperand (pDst, dst, xDst, yDst, FALSE, TRUE)) return; - if (pSrc->alphaMap) - { - srcPict = &src[1]; - srcAlpha = &src[2]; - } - else - { - srcPict = &src[0]; - srcAlpha = 0; - } - if (pDst->alphaMap) - { - dstPict = &dst[1]; - dstAlpha = &dst[2]; - } - else - { - dstPict = &dst[0]; - dstAlpha = 0; - } f = fbCombineFuncU[op]; if (pMask) { @@ -2864,16 +2843,6 @@ pmsk = msk; if (pMask->componentAlpha) f = fbCombineFuncC[op]; - if (pMask->alphaMap) - { - mskPict = &msk[1]; - mskAlpha = &msk[2]; - } - else - { - mskPict = &msk[0]; - mskAlpha = 0; - } } else pmsk = 0; Index: xc/programs/Xserver/fb/fbcopy.c diff -u xc/programs/Xserver/fb/fbcopy.c:1.12 xc/programs/Xserver/fb/fbcopy.c:1.14 --- xc/programs/Xserver/fb/fbcopy.c:1.12 Mon Jul 16 01:04:05 2001 +++ xc/programs/Xserver/fb/fbcopy.c Sun Dec 28 12:22:25 2003 @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.12 2001/07/16 05:04:05 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.14 2003/12/28 17:22:25 alanh Exp $ */ #include "fb.h" #ifdef IN_MODULE @@ -398,7 +398,10 @@ int dx; int dy; int numRects; - BoxRec box; + int box_x1; + int box_y1; + int box_x2; + int box_y2; Bool fastSrc = FALSE; /* for fast clipping with pixmap source */ Bool fastDst = FALSE; /* for fast clipping with one rect dest */ Bool fastExpose = FALSE; /* for fast exposures with pixmap source */ @@ -466,10 +469,10 @@ xOut += pDstDrawable->x; yOut += pDstDrawable->y; - box.x1 = xIn; - box.y1 = yIn; - box.x2 = xIn + widthSrc; - box.y2 = yIn + heightSrc; + box_x1 = xIn; + box_y1 = yIn; + box_x2 = xIn + widthSrc; + box_y2 = yIn + heightSrc; dx = xIn - xOut; dy = yIn - yOut; @@ -484,32 +487,32 @@ * clip the source; if regions extend beyond the source size, * make sure exposure events get sent */ - if (box.x1 < pSrcDrawable->x) + if (box_x1 < pSrcDrawable->x) { - box.x1 = pSrcDrawable->x; + box_x1 = pSrcDrawable->x; fastExpose = FALSE; } - if (box.y1 < pSrcDrawable->y) + if (box_y1 < pSrcDrawable->y) { - box.y1 = pSrcDrawable->y; + box_y1 = pSrcDrawable->y; fastExpose = FALSE; } - if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) + if (box_x2 > pSrcDrawable->x + (int) pSrcDrawable->width) { - box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; + box_x2 = pSrcDrawable->x + (int) pSrcDrawable->width; fastExpose = FALSE; } - if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) + if (box_y2 > pSrcDrawable->y + (int) pSrcDrawable->height) { - box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; + box_y2 = pSrcDrawable->y + (int) pSrcDrawable->height; fastExpose = FALSE; } /* Translate and clip the dst to the destination composite clip */ - box.x1 -= dx; - box.x2 -= dx; - box.y1 -= dy; - box.y2 -= dy; + box_x1 -= dx; + box_x2 -= dx; + box_y1 -= dy; + box_y2 -= dy; /* If the destination composite clip is one rectangle we can do the clip directly. Otherwise we have to create a full @@ -520,21 +523,26 @@ { BoxPtr pBox = REGION_RECTS(cclip); - if (box.x1 < pBox->x1) box.x1 = pBox->x1; - if (box.x2 > pBox->x2) box.x2 = pBox->x2; - if (box.y1 < pBox->y1) box.y1 = pBox->y1; - if (box.y2 > pBox->y2) box.y2 = pBox->y2; + if (box_x1 < pBox->x1) box_x1 = pBox->x1; + if (box_x2 > pBox->x2) box_x2 = pBox->x2; + if (box_y1 < pBox->y1) box_y1 = pBox->y1; + if (box_y2 > pBox->y2) box_y2 = pBox->y2; fastDst = TRUE; } } /* Check to see if the region is empty */ - if (box.x1 >= box.x2 || box.y1 >= box.y2) + if (box_x1 >= box_x2 || box_y1 >= box_y2) { - REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pGC->pScreen, &rgnDst); } else { + BoxRec box; + box.x1 = box_x1; + box.y1 = box_y1; + box.x2 = box_x2; + box.y2 = box_y2; REGION_INIT(pGC->pScreen, &rgnDst, &box, 1); } Index: xc/programs/Xserver/fb/fbgc.c diff -u xc/programs/Xserver/fb/fbgc.c:1.12 xc/programs/Xserver/fb/fbgc.c:1.15 --- xc/programs/Xserver/fb/fbgc.c:1.12 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbgc.c Thu Dec 18 10:25:41 2003 @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.12 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.15 2003/12/18 15:25:41 alanh Exp $ */ #include "fb.h" #ifdef IN_MODULE @@ -253,17 +253,19 @@ } if (changes & GCStipple) { - if (pGC->stipple && - (FbEvenStip (pGC->stipple->drawable.width, - pDrawable->bitsPerPixel) || - fbCanEvenStipple (pGC->stipple, pDrawable->bitsPerPixel))) - { - pPriv->evenStipple = TRUE; + pPriv->evenStipple = FALSE; + + if (pGC->stipple) { + + /* can we do an even stipple ?? */ + if (FbEvenStip (pGC->stipple->drawable.width, + pDrawable->bitsPerPixel) && + (fbCanEvenStipple (pGC->stipple, pDrawable->bitsPerPixel))) + pPriv->evenStipple = TRUE; + if (pGC->stipple->drawable.width * pDrawable->bitsPerPixel < FB_UNIT) fbPadPixmap (pGC->stipple); } - else - pPriv->evenStipple = FALSE; } /* * Recompute reduced rop values Index: xc/programs/Xserver/fb/fbglyph.c diff -u xc/programs/Xserver/fb/fbglyph.c:1.12 xc/programs/Xserver/fb/fbglyph.c:1.13 --- xc/programs/Xserver/fb/fbglyph.c:1.12 Fri Sep 7 11:16:00 2001 +++ xc/programs/Xserver/fb/fbglyph.c Thu Dec 4 12:15:12 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.12 2001/09/07 15:16:00 keithp Exp $ + * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.13 2003/12/04 17:15:12 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -25,6 +25,8 @@ #include "fb.h" #include "fontstruct.h" #include "dixfontstr.h" + +#define dummyScreen screenInfo.screens[0] Bool fbGlyphIn (RegionPtr pRegion, @@ -34,7 +36,7 @@ int height) { BoxRec box; - BoxPtr pExtents = REGION_EXTENTS (0, pRegion); + BoxPtr pExtents = REGION_EXTENTS (dummyScreen, pRegion); /* * Check extents by hand to avoid 16 bit overflows @@ -51,7 +53,7 @@ box.x2 = x + width; box.y1 = y; box.y2 = y + height; - return RECT_IN_REGION (0, pRegion, &box) == rgnIN; + return RECT_IN_REGION (dummyScreen, pRegion, &box) == rgnIN; } #ifdef FB_24BIT Index: xc/programs/Xserver/fb/fbline.c diff -u xc/programs/Xserver/fb/fbline.c:1.7 xc/programs/Xserver/fb/fbline.c:1.8 --- xc/programs/Xserver/fb/fbline.c:1.7 Wed Jan 17 02:40:02 2001 +++ xc/programs/Xserver/fb/fbline.c Mon Nov 3 00:11:00 2003 @@ -1,5 +1,5 @@ /* - * Id: fbline.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ + * $XFree86: xc/programs/Xserver/fb/fbline.c,v 1.8 2003/11/03 05:11:00 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbline.c,v 1.7 2001/01/17 07:40:02 keithp Exp $ */ #include "fb.h" @@ -32,20 +31,15 @@ int npt, DDXPointPtr ppt) { - FbGCPrivPtr pPriv = fbGetGCPrivate (pGC); int x1, y1, x2, y2; int x, y; int dashOffset; - int totalDash; x = pDrawable->x; y = pDrawable->y; x1 = ppt->x; y1 = ppt->y; dashOffset = pGC->dashOffset; - totalDash = 0; - if (pGC->lineStyle != LineSolid) - totalDash = pPriv->dashLength; while (--npt) { ++ppt; Index: xc/programs/Xserver/fb/fbmodule.c diff -u xc/programs/Xserver/fb/fbmodule.c:1.3 xc/programs/Xserver/fb/fbmodule.c:1.4 --- xc/programs/Xserver/fb/fbmodule.c:1.3 Mon Feb 14 14:20:29 2000 +++ xc/programs/Xserver/fb/fbmodule.c Fri Feb 13 18:58:31 2004 @@ -1,29 +1,50 @@ /* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1998 The XFree86 Project, Inc. + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.3 2000/02/14 19:20:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.4 2004/02/13 23:58:31 dawes Exp $ */ #ifdef XFree86LOADER Index: xc/programs/Xserver/fb/fboverlay.c diff -u xc/programs/Xserver/fb/fboverlay.c:1.5 xc/programs/Xserver/fb/fboverlay.c:1.7 --- xc/programs/Xserver/fb/fboverlay.c:1.5 Mon Sep 16 14:05:34 2002 +++ xc/programs/Xserver/fb/fboverlay.c Mon Nov 10 13:21:47 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.5 2002/09/16 18:05:34 eich Exp $ + * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.7 2003/11/10 18:21:47 tsi Exp $ * * Copyright © 2000 SuSE, Inc. * @@ -179,7 +179,7 @@ &pScrPriv->layer[i].u.run.region)) { /* paint new piece with chroma key */ - REGION_INIT (pScreen, &rgnNew, NullBox, 0); + REGION_NULL (pScreen, &rgnNew); REGION_INTERSECT (pScreen, &rgnNew, prgn, @@ -210,13 +210,10 @@ FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen); RegionRec rgnDst; int dx, dy; - WindowPtr pwinRoot; int i; RegionRec layerRgn[FB_OVERLAY_MAX]; PixmapPtr pPixmap; - pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; - dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; @@ -224,7 +221,7 @@ * Clip to existing bits */ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pScreen, &rgnDst, NullBox, 0); + REGION_NULL (pScreen, &rgnDst); REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); REGION_TRANSLATE(pScreen, &rgnDst, dx, dy); /* @@ -232,7 +229,7 @@ */ for (i = 0; i < pScrPriv->nlayers; i++) { - REGION_INIT (pScreen, &layerRgn[i], NullBox, 0); + REGION_NULL (pScreen, &layerRgn[i]); REGION_INTERSECT(pScreen, &layerRgn[i], &rgnDst, &pScrPriv->layer[i].u.run.region); if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) Index: xc/programs/Xserver/fb/fbwindow.c diff -u xc/programs/Xserver/fb/fbwindow.c:1.10 xc/programs/Xserver/fb/fbwindow.c:1.11 --- xc/programs/Xserver/fb/fbwindow.c:1.10 Thu Jan 30 19:01:45 2003 +++ xc/programs/Xserver/fb/fbwindow.c Mon Nov 10 13:21:47 2003 @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.10 2003/01/31 00:01:45 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.11 2003/11/10 18:21:47 tsi Exp $ */ #include "fb.h" #ifdef IN_MODULE @@ -129,7 +129,7 @@ dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL (pWin->drawable.pScreen, &rgnDst); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); Index: xc/programs/Xserver/glxStub/Imakefile diff -u xc/programs/Xserver/glxStub/Imakefile:1.5 xc/programs/Xserver/glxStub/Imakefile:removed --- xc/programs/Xserver/glxStub/Imakefile:1.5 Sat Apr 17 05:08:28 1999 +++ xc/programs/Xserver/glxStub/Imakefile Sat Feb 28 21:42:07 2004 @@ -1,19 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/glxStub/Imakefile,v 1.5 1999/04/17 09:08:28 dawes Exp $ - - - -#include - -SRCS = glxstub.c - -OBJS = glxstub.o - -INCLUDES = -I../include -I$(XINCLUDESRC) -I$(SERVERSRC)/include - - -NormalLibraryObjectRule() -NormalLibraryTarget(ServerGlx,$(OBJS)) -LintLibraryTarget(ServerGlx,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() Index: xc/programs/Xserver/glxStub/glxstub.c diff -u xc/programs/Xserver/glxStub/glxstub.c:1.4 xc/programs/Xserver/glxStub/glxstub.c:removed --- xc/programs/Xserver/glxStub/glxstub.c:1.4 Sat May 3 05:15:55 1997 +++ xc/programs/Xserver/glxStub/glxstub.c Sat Feb 28 21:42:07 2004 @@ -1,55 +0,0 @@ -/* $XFree86: xc/programs/Xserver/glxStub/glxstub.c,v 1.4 1997/05/03 09:15:55 dawes Exp $ */ - -/* - * Copyright 1997 The XFree86 Project - * - * 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 - * HARM HANEMAAYER 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. - * - */ - -#include "X.h" -#include "misc.h" -#include "dixstruct.h" - -/* - * Stubs for systems that don't support loadable modules. - * This allows the server to be relinked via the linkkit with - * compatible implementations of the GLX protocol. - */ - -void -GlxExtensionInit(INITARGS) -{ - ErrorF("GLX extension library not linked, use linkkit\n"); -} - -int -GlxInitVisuals ( -#if NeedFunctionPrototypes - VisualPtr * visualp, - DepthPtr * depthp, - int * nvisualp, - int * ndepthp, - int * rootDepthp, - VisualID * defaultVisp, - unsigned long sizes, - int bitsPerRGB -#endif -) {} - Index: xc/programs/Xserver/hw/darwin/Imakefile diff -u xc/programs/Xserver/hw/darwin/Imakefile:1.15 xc/programs/Xserver/hw/darwin/Imakefile:1.20 --- xc/programs/Xserver/hw/darwin/Imakefile:1.15 Fri Oct 11 20:32:43 2002 +++ xc/programs/Xserver/hw/darwin/Imakefile Mon Nov 10 20:29:47 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.15 2002/10/12 00:32:43 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.20 2003/11/11 01:29:47 torrey Exp $ #include #define IHaveSubdirs @@ -7,19 +7,16 @@ SRCS = darwin.c \ darwinEvents.c \ - darwinKeyboard.c \ - xfIOKit.c \ - xfIOKitCursor.c + darwinKeyboard.c OBJS = darwin.o \ darwinEvents.o \ - darwinKeyboard.o \ - xfIOKit.o \ - xfIOKitCursor.o + darwinKeyboard.o INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) + -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ + -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/hw/xfree86 OSNAME = OSName OSVENDOR = OSVendor @@ -33,27 +30,30 @@ BUILDERMSG = -DBUILDERSTRING='$(BUILDERSTRING)' #endif +#if OSMajorVersion >= 6 +CLUTDEF = -DUSE_NEW_CLUT +#endif + #if DarwinQuartzSupport -# if HasNSCarbonWindow -SUBDIRS = bundle quartz utils +# if (OSMajorVersion == 1 && OSMinorVersion >= 4) || OSMajorVersion >= 5 +SUBDIRS = iokit bundle quartz utils # else -SUBDIRS = bundle quartz_1.3 utils +SUBDIRS = iokit bundle quartz_1.3 utils # endif QUARTZDEF = -DDARWIN_WITH_QUARTZ #else -SUBDIRS = utils +SUBDIRS = iokit utils #endif DEFINES = $(QUARTZDEF) EXTRAMANDEFS = $(QUARTZDEF) -D__logdir__=$(LOGDIRECTORY) -SpecialCObjectRule(darwin,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) $(CUSTOMVERDEF)) +SpecialCObjectRule(darwin,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) \ + $(CUSTOMVERDEF) $(CLUTDEF)) NormalLibraryObjectRule() NormalLibraryTarget(darwin,$(OBJS)) -AllTarget(xfIOKitStartup.o) - InstallManPage(XDarwin,$(MANDIR)) InstallManPage(XFree86,$(MANDIR)) Index: xc/programs/Xserver/hw/darwin/darwin.c diff -u xc/programs/Xserver/hw/darwin/darwin.c:1.50 xc/programs/Xserver/hw/darwin/darwin.c:1.56 --- xc/programs/Xserver/hw/darwin/darwin.c:1.50 Wed Feb 26 04:21:33 2003 +++ xc/programs/Xserver/hw/darwin/darwin.c Mon Nov 24 00:39:01 2003 @@ -1,11 +1,11 @@ /************************************************************** * * Shared code for the Darwin X Server - * running with Quartz or the IOKit + * running with Quartz or IOKit display mode * **************************************************************/ /* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,7 +29,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.50 2003/02/26 09:21:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.56 2003/11/24 05:39:01 torrey Exp $ */ #include "X.h" #include "Xproto.h" @@ -52,6 +52,7 @@ #include #include #include +#include #define NO_CFPLUGIN #include @@ -60,8 +61,6 @@ #include "darwin.h" #include "darwinClut8.h" -#include "quartz/quartz.h" -#include "xfIOKit.h" /* * X server shared global variables @@ -69,9 +68,9 @@ int darwinScreensFound = 0; int darwinScreenIndex = 0; io_connect_t darwinParamConnect = 0; -int darwinEventFD = -1; -Bool quartz = FALSE; -int quartzMouseAccelChange = 1; +int darwinEventReadFD = -1; +int darwinEventWriteFD = -1; +int darwinMouseAccelChange = 1; int darwinFakeButtons = 0; // location of X11's (0,0) point in global screen coordinates @@ -113,7 +112,7 @@ #define PRE_RELEASE XF86_VERSION_SNAP #endif -static void +void DarwinPrintBanner() { #if PRE_RELEASE @@ -193,11 +192,7 @@ SCREEN_PRIV(pScreen) = dfb; // setup hardware/mode specific details - if (quartz) { - ret = QuartzAddScreen(foundIndex, pScreen); - } else { - ret = XFIOKitAddScreen(foundIndex, pScreen); - } + ret = DarwinModeAddScreen(foundIndex, pScreen); foundIndex++; if (! ret) return FALSE; @@ -276,14 +271,8 @@ pScreen->SaveScreen = DarwinSaveScreen; // finish mode dependent screen setup including cursor support - if (quartz) { - if (! QuartzSetupScreen(index, pScreen)) { - return FALSE; - } - } else { - if (! XFIOKitSetupScreen(index, pScreen)) { - return FALSE; - } + if (!DarwinModeSetupScreen(index, pScreen)) { + return FALSE; } // create and install the default colormap and @@ -337,7 +326,7 @@ kern_return_t kr; double acceleration; - if (!quartzMouseAccelChange) + if (!darwinMouseAccelChange) return; acceleration = ctrl->num / ctrl->den; @@ -378,13 +367,13 @@ case DEVICE_ON: pPointer->public.on = TRUE; - AddEnabledDevice( darwinEventFD ); + AddEnabledDevice( darwinEventReadFD ); return Success; case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice( darwinEventFD ); + RemoveEnabledDevice( darwinEventReadFD ); return Success; } @@ -404,11 +393,11 @@ break; case DEVICE_ON: pDev->public.on = TRUE; - AddEnabledDevice( darwinEventFD ); + AddEnabledDevice( darwinEventReadFD ); break; case DEVICE_OFF: pDev->public.on = FALSE; - RemoveEnabledDevice( darwinEventFD ); + RemoveEnabledDevice( darwinEventReadFD ); break; case DEVICE_CLOSE: break; @@ -531,10 +520,57 @@ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer ); - if (quartz) { - QuartzInitInput(argc, argv); - } else { - XFIOKitInitInput(argc, argv); + DarwinModeInitInput(argc, argv); +} + + +/* + * DarwinAdjustScreenOrigins + * Shift all screens so the X11 (0, 0) coordinate is at the top + * left of the global screen coordinates. + * + * Screens can be arranged so the top left isn't on any screen, so + * instead use the top left of the leftmost screen as (0,0). This + * may mean some screen space is in -y, but it's better that (0,0) + * be onscreen, or else default xterms disappear. It's better that + * -y be used than -x, because when popup menus are forced + * "onscreen" by dumb window managers like twm, they'll shift the + * menus down instead of left, which still looks funny but is an + * easier target to hit. + */ +void +DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) +{ + int i, left, top; + + left = dixScreenOrigins[0].x; + top = dixScreenOrigins[0].y; + + /* Find leftmost screen. If there's a tie, take the topmost of the two. */ + for (i = 1; i < pScreenInfo->numScreens; i++) { + if (dixScreenOrigins[i].x < left || + (dixScreenOrigins[i].x == left && + dixScreenOrigins[i].y < top)) + { + left = dixScreenOrigins[i].x; + top = dixScreenOrigins[i].y; + } + } + + darwinMainScreenX = left; + darwinMainScreenY = top; + + /* Shift all screens so that there is a screen whose top left + is at X11 (0,0) and at global screen coordinate + (darwinMainScreenX, darwinMainScreenY). */ + + if (darwinMainScreenX != 0 || darwinMainScreenY != 0) { + for (i = 0; i < pScreenInfo->numScreens; i++) { + dixScreenOrigins[i].x -= darwinMainScreenX; + dixScreenOrigins[i].y -= darwinMainScreenY; + ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", + i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); + } } } @@ -554,7 +590,7 @@ */ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) { - int i, left, top; + int i; static unsigned long generation = 0; pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; @@ -574,55 +610,14 @@ } // Discover screens and do mode specific initialization - if (quartz) { - QuartzInitOutput(argc, argv); - } else { - XFIOKitInitOutput(argc, argv); - } + DarwinModeInitOutput(argc, argv); // Add screens for (i = 0; i < darwinScreensFound; i++) { AddScreen( DarwinAddScreen, argc, argv ); } - // Shift all screens so the X11 (0, 0) coordinate is at the top left - // of the global screen coordinates. - // Screens can be arranged so the top left isn't on any screen, - // so instead use the top left of the leftmost screen as (0,0). - // This may mean some screen space is in -y, but it's better - // that (0,0) be onscreen, or else default xterms disappear. - // It's better that -y be used than -x, because when popup - // menus are forced "onscreen" by dumb window managers like twm, - // they'll shift the menus down instead of left, which still looks - // funny but is an easier target to hit. - left = dixScreenOrigins[0].x; - top = dixScreenOrigins[0].y; - - // Find leftmost screen. If there's a tie, take the topmost of the two. - for (i = 1; i < pScreenInfo->numScreens; i++) { - if (dixScreenOrigins[i].x < left || - (dixScreenOrigins[i].x == left && - dixScreenOrigins[i].y < top)) - { - left = dixScreenOrigins[i].x; - top = dixScreenOrigins[i].y; - } - } - - darwinMainScreenX = left; - darwinMainScreenY = top; - - // Shift all screens so that there is a screen whose top left - // is at X11 (0,0) and at global screen coordinate - // (darwinMainScreenX, darwinMainScreenY). - if (darwinMainScreenX != 0 || darwinMainScreenY != 0) { - for (i = 0; i < pScreenInfo->numScreens; i++) { - dixScreenOrigins[i].x -= darwinMainScreenX; - dixScreenOrigins[i].y -= darwinMainScreenY; - ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); - } - } + DarwinAdjustScreenOrigins(pScreenInfo); } @@ -648,13 +643,16 @@ // Find the full path to the keymapping file. if ( darwinKeymapFile ) { char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards"); - if ( !tempStr ) - FatalError("Could not find keymapping file %s.\n", - darwinKeymapFile); + if ( !tempStr ) { + ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile); + } else { + ErrorF("Using keymapping provided in %s.\n", tempStr); + } darwinKeymapFile = tempStr; - ErrorF("Using keymapping provided in %s.\n", darwinKeymapFile); - } else { - ErrorF("Reading keymapping from the kernel.\n"); + } + + if ( !darwinKeymapFile ) { + ErrorF("Reading keymap from the system.\n"); } } @@ -667,12 +665,10 @@ */ int ddxProcessArgument( int argc, char *argv[], int i ) { -#ifdef DARWIN_WITH_QUARTZ int numDone; - if ((numDone = QuartzProcessArgument( argc, argv, i ))) + if ((numDone = DarwinModeProcessArgument( argc, argv, i ))) return numDone; -#endif if ( !strcmp( argv[i], "-fakebuttons" ) ) { darwinFakeButtons = TRUE; @@ -833,11 +829,7 @@ { ErrorF( "Quitting XDarwin...\n" ); - if (quartz) { - QuartzGiveUp(); - } else { - XFIOKitGiveUp(); - } + DarwinModeGiveUp(); } Index: xc/programs/Xserver/hw/darwin/darwin.h diff -u xc/programs/Xserver/hw/darwin/darwin.h:1.15 xc/programs/Xserver/hw/darwin/darwin.h:1.20 --- xc/programs/Xserver/hw/darwin/darwin.h:1.15 Mon Dec 9 19:00:38 2002 +++ xc/programs/Xserver/hw/darwin/darwin.h Fri Nov 14 19:07:09 2003 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,16 +23,15 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.15 2002/12/10 00:00:38 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */ #ifndef _DARWIN_H #define _DARWIN_H #include #include "inputstr.h" -#include "screenint.h" +#include "scrnintstr.h" #include "extensions/XKB.h" -#include "quartz/quartzShared.h" typedef struct { void *framebuffer; @@ -48,6 +47,9 @@ } DarwinFramebufferRec, *DarwinFramebufferPtr; +// From darwin.c +void DarwinPrintBanner(); +void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); // From darwinEvents.c @@ -64,6 +66,17 @@ int DarwinModifierNXMaskToNXKey(int mask); int DarwinModifierStringToNXKey(const char *string); +// Mode specific functions +Bool DarwinModeAddScreen(int index, ScreenPtr pScreen); +Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen); +void DarwinModeInitOutput(int argc,char **argv); +void DarwinModeInitInput(int argc, char **argv); +int DarwinModeProcessArgument(int argc, char *argv[], int i); +void DarwinModeProcessEvent(xEvent *xe); +void DarwinModeGiveUp(void); +void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class); + + #undef assert #define assert(x) { if ((x) == 0) \ FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); } @@ -76,31 +89,60 @@ #define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0... + /* * Global variables from darwin.c */ extern int darwinScreenIndex; // index into pScreen.devPrivates extern int darwinScreensFound; extern io_connect_t darwinParamConnect; -extern int darwinEventFD; -extern Bool quartz; +extern int darwinEventReadFD; +extern int darwinEventWriteFD; + +// User preferences +extern int darwinMouseAccelChange; +extern int darwinFakeButtons; +extern int darwinFakeMouse2Mask; +extern int darwinFakeMouse3Mask; +extern char *darwinKeymapFile; +extern unsigned int darwinDesiredWidth, darwinDesiredHeight; +extern int darwinDesiredDepth; +extern int darwinDesiredRefresh; + +// location of X11's (0,0) point in global screen coordinates +extern int darwinMainScreenX; +extern int darwinMainScreenY; + /* * Special ddx events understood by the X server */ enum { - kXDarwinUpdateModifiers // update all modifier keys - = LASTEvent+1, // (from X.h list of event names) - kXDarwinUpdateButtons, // update state of mouse buttons 2 and up - kXDarwinScrollWheel, // scroll wheel event - kXDarwinShow, // vt switch to X server; - // recapture screen and restore X drawing - kXDarwinHide, // vt switch away from X server; - // release screen and clip X drawing - kXDarwinSetRootClip, // enable or disable drawing to the X screen - kXDarwinQuit, // kill the X server and release the display - kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer - kXDarwinWritePasteboard // copy X cut buffer onto Mac OS X pasteboard + kXDarwinUpdateModifiers // update all modifier keys + = LASTEvent+1, // (from X.h list of event names) + kXDarwinUpdateButtons, // update state of mouse buttons 2 and up + kXDarwinScrollWheel, // scroll wheel event + + /* + * Quartz-specific events -- not used in IOKit mode + */ + kXDarwinActivate, // restore X drawing and cursor + kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor + kXDarwinSetRootClip, // enable or disable drawing to the X screen + kXDarwinQuit, // kill the X server and release the display + kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer + kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard + /* + * AppleWM events + */ + kXDarwinControllerNotify, // send an AppleWMControllerNotify event + kXDarwinPasteboardNotify, // notify the WM to copy or paste + /* + * Xplugin notification events + */ + kXDarwinDisplayChanged, // display configuration has changed + kXDarwinWindowState, // window visibility state has changed + kXDarwinWindowMoved // window has moved on screen }; #endif /* _DARWIN_H */ Index: xc/programs/Xserver/hw/darwin/darwinClut8.h diff -u xc/programs/Xserver/hw/darwin/darwinClut8.h:1.1 xc/programs/Xserver/hw/darwin/darwinClut8.h:1.2 --- xc/programs/Xserver/hw/darwin/darwinClut8.h:1.1 Thu Apr 12 16:09:53 2001 +++ xc/programs/Xserver/hw/darwin/darwinClut8.h Mon Mar 3 20:37:59 2003 @@ -1 +1,532 @@ -/* * Darwin default 8-bit Colormap for StaticColor */ /* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.1 2001/04/12 20:09:53 torrey Exp $ */ #ifndef _DARWIN_CLUT8_ #define _DARWIN_CLUT8_ static xColorItem darwinClut8[] = { { 0, 0x0000, 0x0000, 0x0000, 0, 0 }, { 1, 0xffff, 0xffff, 0xcccc, 0, 0 }, { 2, 0xffff, 0xffff, 0x9999, 0, 0 }, { 3, 0xffff, 0xffff, 0x6666, 0, 0 }, { 4, 0xffff, 0xffff, 0x3333, 0, 0 }, { 5, 0xffff, 0xffff, 0x0000, 0, 0 }, { 6, 0xffff, 0xcccc, 0xffff, 0, 0 }, { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 }, { 8, 0xffff, 0xcccc, 0x9999, 0, 0 }, { 9, 0xffff, 0xcccc, 0x6666, 0, 0 }, { 10, 0xffff, 0xcccc, 0x3333, 0, 0 }, { 11, 0xffff, 0xcccc, 0x0000, 0, 0 }, { 12, 0xffff, 0x9999, 0xffff, 0, 0 }, { 13, 0xffff, 0x9999, 0xcccc, 0, 0 }, { 14, 0xffff, 0x9999, 0x9999, 0, 0 }, { 15, 0xffff, 0x9999, 0x6666, 0, 0 }, { 16, 0xffff, 0x9999, 0x3333, 0, 0 }, { 17, 0xffff, 0x9999, 0x0000, 0, 0 }, { 18, 0xffff, 0x6666, 0xffff, 0, 0 }, { 19, 0xffff, 0x6666, 0xcccc, 0, 0 }, { 20, 0xffff, 0x6666, 0x9999, 0, 0 }, { 21, 0xffff, 0x6666, 0x6666, 0, 0 }, { 22, 0xffff, 0x6666, 0x3333, 0, 0 }, { 23, 0xffff, 0x6666, 0x0000, 0, 0 }, { 24, 0xffff, 0x3333, 0xffff, 0, 0 }, { 25, 0xffff, 0x3333, 0xcccc, 0, 0 }, { 26, 0xffff, 0x3333, 0x9999, 0, 0 }, { 27, 0xffff, 0x3333, 0x6666, 0, 0 }, { 28, 0xffff, 0x3333, 0x3333, 0, 0 }, { 29, 0xffff, 0x3333, 0x0000, 0, 0 }, { 30, 0xffff, 0x0000, 0xffff, 0, 0 }, { 31, 0xffff, 0x0000, 0xcccc, 0, 0 }, { 32, 0xffff, 0x0000, 0x9999, 0, 0 }, { 33, 0xffff, 0x0000, 0x6666, 0, 0 }, { 34, 0xffff, 0x0000, 0x3333, 0, 0 }, { 35, 0xffff, 0x0000, 0x0000, 0, 0 }, { 36, 0xcccc, 0xffff, 0xffff, 0, 0 }, { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 }, { 38, 0xcccc, 0xffff, 0x9999, 0, 0 }, { 39, 0xcccc, 0xffff, 0x6666, 0, 0 }, { 40, 0xcccc, 0xffff, 0x3333, 0, 0 }, { 41, 0xcccc, 0xffff, 0x0000, 0, 0 }, { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 }, { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 }, { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 }, { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 }, { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 }, { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 }, { 48, 0xcccc, 0x9999, 0xffff, 0, 0 }, { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 }, { 50, 0xcccc, 0x9999, 0x9999, 0, 0 }, { 51, 0xcccc, 0x9999, 0x6666, 0, 0 }, { 52, 0xcccc, 0x9999, 0x3333, 0, 0 }, { 53, 0xcccc, 0x9999, 0x0000, 0, 0 }, { 54, 0xcccc, 0x6666, 0xffff, 0, 0 }, { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 }, { 56, 0xcccc, 0x6666, 0x9999, 0, 0 }, { 57, 0xcccc, 0x6666, 0x6666, 0, 0 }, { 58, 0xcccc, 0x6666, 0x3333, 0, 0 }, { 59, 0xcccc, 0x6666, 0x0000, 0, 0 }, { 60, 0xcccc, 0x3333, 0xffff, 0, 0 }, { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 }, { 62, 0xcccc, 0x3333, 0x9999, 0, 0 }, { 63, 0xcccc, 0x3333, 0x6666, 0, 0 }, { 64, 0xcccc, 0x3333, 0x3333, 0, 0 }, { 65, 0xcccc, 0x3333, 0x0000, 0, 0 }, { 66, 0xcccc, 0x0000, 0xffff, 0, 0 }, { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 }, { 68, 0xcccc, 0x0000, 0x9999, 0, 0 }, { 69, 0xcccc, 0x0000, 0x6666, 0, 0 }, { 70, 0xcccc, 0x0000, 0x3333, 0, 0 }, { 71, 0xcccc, 0x0000, 0x0000, 0, 0 }, { 72, 0x9999, 0xffff, 0xffff, 0, 0 }, { 73, 0x9999, 0xffff, 0xcccc, 0, 0 }, { 74, 0x9999, 0xffff, 0x9999, 0, 0 }, { 75, 0x9999, 0xffff, 0x6666, 0, 0 }, { 76, 0x9999, 0xffff, 0x3333, 0, 0 }, { 77, 0x9999, 0xffff, 0x0000, 0, 0 }, { 78, 0x9999, 0xcccc, 0xffff, 0, 0 }, { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 }, { 80, 0x9999, 0xcccc, 0x9999, 0, 0 }, { 81, 0x9999, 0xcccc, 0x6666, 0, 0 }, { 82, 0x9999, 0xcccc, 0x3333, 0, 0 }, { 83, 0x9999, 0xcccc, 0x0000, 0, 0 }, { 84, 0x9999, 0x9999, 0xffff, 0, 0 }, { 85, 0x9999, 0x9999, 0xcccc, 0, 0 }, { 86, 0x9999, 0x9999, 0x9999, 0, 0 }, { 87, 0x9999, 0x9999, 0x6666, 0, 0 }, { 88, 0x9999, 0x9999, 0x3333, 0, 0 }, { 89, 0x9999, 0x9999, 0x0000, 0, 0 }, { 90, 0x9999, 0x6666, 0xffff, 0, 0 }, { 91, 0x9999, 0x6666, 0xcccc, 0, 0 }, { 92, 0x9999, 0x6666, 0x9999, 0, 0 }, { 93, 0x9999, 0x6666, 0x6666, 0, 0 }, { 94, 0x9999, 0x6666, 0x3333, 0, 0 }, { 95, 0x9999, 0x6666, 0x0000, 0, 0 }, { 96, 0x9999, 0x3333, 0xffff, 0, 0 }, { 97, 0x9999, 0x3333, 0xcccc, 0, 0 }, { 98, 0x9999, 0x3333, 0x9999, 0, 0 }, { 99, 0x9999, 0x3333, 0x6666, 0, 0 }, { 100, 0x9999, 0x3333, 0x3333, 0, 0 }, { 101, 0x9999, 0x3333, 0x0000, 0, 0 }, { 102, 0x9999, 0x0000, 0xffff, 0, 0 }, { 103, 0x9999, 0x0000, 0xcccc, 0, 0 }, { 104, 0x9999, 0x0000, 0x9999, 0, 0 }, { 105, 0x9999, 0x0000, 0x6666, 0, 0 }, { 106, 0x9999, 0x0000, 0x3333, 0, 0 }, { 107, 0x9999, 0x0000, 0x0000, 0, 0 }, { 108, 0x6666, 0xffff, 0xffff, 0, 0 }, { 109, 0x6666, 0xffff, 0xcccc, 0, 0 }, { 110, 0x6666, 0xffff, 0x9999, 0, 0 }, { 111, 0x6666, 0xffff, 0x6666, 0, 0 }, { 112, 0x6666, 0xffff, 0x3333, 0, 0 }, { 113, 0x6666, 0xffff, 0x0000, 0, 0 }, { 114, 0x6666, 0xcccc, 0xffff, 0, 0 }, { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 }, { 116, 0x6666, 0xcccc, 0x9999, 0, 0 }, { 117, 0x6666, 0xcccc, 0x6666, 0, 0 }, { 118, 0x6666, 0xcccc, 0x3333, 0, 0 }, { 119, 0x6666, 0xcccc, 0x0000, 0, 0 }, { 120, 0x6666, 0x9999, 0xffff, 0, 0 }, { 121, 0x6666, 0x9999, 0xcccc, 0, 0 }, { 122, 0x6666, 0x9999, 0x9999, 0, 0 }, { 123, 0x6666, 0x9999, 0x6666, 0, 0 }, { 124, 0x6666, 0x9999, 0x3333, 0, 0 }, { 125, 0x6666, 0x9999, 0x0000, 0, 0 }, { 126, 0x6666, 0x6666, 0xffff, 0, 0 }, { 127, 0x6666, 0x6666, 0xcccc, 0, 0 }, { 128, 0x6666, 0x6666, 0x9999, 0, 0 }, { 129, 0x6666, 0x6666, 0x6666, 0, 0 }, { 130, 0x6666, 0x6666, 0x3333, 0, 0 }, { 131, 0x6666, 0x6666, 0x0000, 0, 0 }, { 132, 0x6666, 0x3333, 0xffff, 0, 0 }, { 133, 0x6666, 0x3333, 0xcccc, 0, 0 }, { 134, 0x6666, 0x3333, 0x9999, 0, 0 }, { 135, 0x6666, 0x3333, 0x6666, 0, 0 }, { 136, 0x6666, 0x3333, 0x3333, 0, 0 }, { 137, 0x6666, 0x3333, 0x0000, 0, 0 }, { 138, 0x6666, 0x0000, 0xffff, 0, 0 }, { 139, 0x6666, 0x0000, 0xcccc, 0, 0 }, { 140, 0x6666, 0x0000, 0x9999, 0, 0 }, { 141, 0x6666, 0x0000, 0x6666, 0, 0 }, { 142, 0x6666, 0x0000, 0x3333, 0, 0 }, { 143, 0x6666, 0x0000, 0x0000, 0, 0 }, { 144, 0x3333, 0xffff, 0xffff, 0, 0 }, { 145, 0x3333, 0xffff, 0xcccc, 0, 0 }, { 146, 0x3333, 0xffff, 0x9999, 0, 0 }, { 147, 0x3333, 0xffff, 0x6666, 0, 0 }, { 148, 0x3333, 0xffff, 0x3333, 0, 0 }, { 149, 0x3333, 0xffff, 0x0000, 0, 0 }, { 150, 0x3333, 0xcccc, 0xffff, 0, 0 }, { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 }, { 152, 0x3333, 0xcccc, 0x9999, 0, 0 }, { 153, 0x3333, 0xcccc, 0x6666, 0, 0 }, { 154, 0x3333, 0xcccc, 0x3333, 0, 0 }, { 155, 0x3333, 0xcccc, 0x0000, 0, 0 }, { 156, 0x3333, 0x9999, 0xffff, 0, 0 }, { 157, 0x3333, 0x9999, 0xcccc, 0, 0 }, { 158, 0x3333, 0x9999, 0x9999, 0, 0 }, { 159, 0x3333, 0x9999, 0x6666, 0, 0 }, { 160, 0x3333, 0x9999, 0x3333, 0, 0 }, { 161, 0x3333, 0x9999, 0x0000, 0, 0 }, { 162, 0x3333, 0x6666, 0xffff, 0, 0 }, { 163, 0x3333, 0x6666, 0xcccc, 0, 0 }, { 164, 0x3333, 0x6666, 0x9999, 0, 0 }, { 165, 0x3333, 0x6666, 0x6666, 0, 0 }, { 166, 0x3333, 0x6666, 0x3333, 0, 0 }, { 167, 0x3333, 0x6666, 0x0000, 0, 0 }, { 168, 0x3333, 0x3333, 0xffff, 0, 0 }, { 169, 0x3333, 0x3333, 0xcccc, 0, 0 }, { 170, 0x3333, 0x3333, 0x9999, 0, 0 }, { 171, 0x3333, 0x3333, 0x6666, 0, 0 }, { 172, 0x3333, 0x3333, 0x3333, 0, 0 }, { 173, 0x3333, 0x3333, 0x0000, 0, 0 }, { 174, 0x3333, 0x0000, 0xffff, 0, 0 }, { 175, 0x3333, 0x0000, 0xcccc, 0, 0 }, { 176, 0x3333, 0x0000, 0x9999, 0, 0 }, { 177, 0x3333, 0x0000, 0x6666, 0, 0 }, { 178, 0x3333, 0x0000, 0x3333, 0, 0 }, { 179, 0x3333, 0x0000, 0x0000, 0, 0 }, { 180, 0x0000, 0xffff, 0xffff, 0, 0 }, { 181, 0x0000, 0xffff, 0xcccc, 0, 0 }, { 182, 0x0000, 0xffff, 0x9999, 0, 0 }, { 183, 0x0000, 0xffff, 0x6666, 0, 0 }, { 184, 0x0000, 0xffff, 0x3333, 0, 0 }, { 185, 0x0000, 0xffff, 0x0000, 0, 0 }, { 186, 0x0000, 0xcccc, 0xffff, 0, 0 }, { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 }, { 188, 0x0000, 0xcccc, 0x9999, 0, 0 }, { 189, 0x0000, 0xcccc, 0x6666, 0, 0 }, { 190, 0x0000, 0xcccc, 0x3333, 0, 0 }, { 191, 0x0000, 0xcccc, 0x0000, 0, 0 }, { 192, 0x0000, 0x9999, 0xffff, 0, 0 }, { 193, 0x0000, 0x9999, 0xcccc, 0, 0 }, { 194, 0x0000, 0x9999, 0x9999, 0, 0 }, { 195, 0x0000, 0x9999, 0x6666, 0, 0 }, { 196, 0x0000, 0x9999, 0x3333, 0, 0 }, { 197, 0x0000, 0x9999, 0x0000, 0, 0 }, { 198, 0x0000, 0x6666, 0xffff, 0, 0 }, { 199, 0x0000, 0x6666, 0xcccc, 0, 0 }, { 200, 0x0000, 0x6666, 0x9999, 0, 0 }, { 201, 0x0000, 0x6666, 0x6666, 0, 0 }, { 202, 0x0000, 0x6666, 0x3333, 0, 0 }, { 203, 0x0000, 0x6666, 0x0000, 0, 0 }, { 204, 0x0000, 0x3333, 0xffff, 0, 0 }, { 205, 0x0000, 0x3333, 0xcccc, 0, 0 }, { 206, 0x0000, 0x3333, 0x9999, 0, 0 }, { 207, 0x0000, 0x3333, 0x6666, 0, 0 }, { 208, 0x0000, 0x3333, 0x3333, 0, 0 }, { 209, 0x0000, 0x3333, 0x0000, 0, 0 }, { 210, 0x0000, 0x0000, 0xffff, 0, 0 }, { 211, 0x0000, 0x0000, 0xcccc, 0, 0 }, { 212, 0x0000, 0x0000, 0x9999, 0, 0 }, { 213, 0x0000, 0x0000, 0x6666, 0, 0 }, { 214, 0x0000, 0x0000, 0x3333, 0, 0 }, { 215, 0xeeee, 0x0000, 0x0000, 0, 0 }, { 216, 0xdddd, 0x0000, 0x0000, 0, 0 }, { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 }, { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 }, { 219, 0x8888, 0x0000, 0x0000, 0, 0 }, { 220, 0x7777, 0x0000, 0x0000, 0, 0 }, { 221, 0x5555, 0x0000, 0x0000, 0, 0 }, { 222, 0x4444, 0x0000, 0x0000, 0, 0 }, { 223, 0x2222, 0x0000, 0x0000, 0, 0 }, { 224, 0x1111, 0x0000, 0x0000, 0, 0 }, { 225, 0x0000, 0xeeee, 0x0000, 0, 0 }, { 226, 0x0000, 0xdddd, 0x0000, 0, 0 }, { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 }, { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 }, { 229, 0x0000, 0x8888, 0x0000, 0, 0 }, { 230, 0x0000, 0x7777, 0x0000, 0, 0 }, { 231, 0x0000, 0x5555, 0x0000, 0, 0 }, { 232, 0x0000, 0x4444, 0x0000, 0, 0 }, { 233, 0x0000, 0x2222, 0x0000, 0, 0 }, { 234, 0x0000, 0x1111, 0x0000, 0, 0 }, { 235, 0x0000, 0x0000, 0xeeee, 0, 0 }, { 236, 0x0000, 0x0000, 0xdddd, 0, 0 }, { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 }, { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 }, { 239, 0x0000, 0x0000, 0x8888, 0, 0 }, { 240, 0x0000, 0x0000, 0x7777, 0, 0 }, { 241, 0x0000, 0x0000, 0x5555, 0, 0 }, { 242, 0x0000, 0x0000, 0x4444, 0, 0 }, { 243, 0x0000, 0x0000, 0x2222, 0, 0 }, { 244, 0x0000, 0x0000, 0x1111, 0, 0 }, { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 }, { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 }, { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 }, { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 }, { 249, 0x8888, 0x8888, 0x8888, 0, 0 }, { 250, 0x7777, 0x7777, 0x7777, 0, 0 }, { 251, 0x5555, 0x5555, 0x5555, 0, 0 }, { 252, 0x4444, 0x4444, 0x4444, 0, 0 }, { 253, 0x2222, 0x2222, 0x2222, 0, 0 }, { 254, 0x1111, 0x1111, 0x1111, 0, 0 }, { 255, 0xffff, 0xffff, 0xffff, 0, 0 } }; #endif /* _DARWIN_CLUT8_ */ \ No newline at end of file +/* + * Darwin default 8-bit Colormap for StaticColor + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.2 2003/03/04 01:37:59 torrey Exp $ */ + +#ifndef _DARWIN_CLUT8_ +#define _DARWIN_CLUT8_ + +#ifdef USE_NEW_CLUT + +static xColorItem darwinClut8[] = { + { 0, 0xffff, 0xffff, 0xffff, 0, 0 }, + { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 }, + { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 }, + { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 }, + { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 }, + { 5, 0xffff, 0xffff, 0x0, 0, 0 }, + { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 }, + { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 }, + { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 }, + { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 }, + { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 }, + { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 }, + { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 }, + { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 }, + { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 }, + { 15, 0x0, 0x0, 0x0, 0, 0 }, + { 16, 0xefef, 0xefef, 0xefef, 0, 0 }, + { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 }, + { 18, 0xeded, 0xeded, 0xeded, 0, 0 }, + { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 }, + { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 }, + { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 }, + { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 }, + { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 }, + { 24, 0xffff, 0x0, 0xffff, 0, 0 }, + { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 }, + { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 }, + { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 }, + { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 }, + { 29, 0xdede, 0xdede, 0xdede, 0, 0 }, + { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 }, + { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 }, + { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 }, + { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 }, + { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 }, + { 35, 0xffff, 0x0, 0x0, 0, 0 }, + { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 }, + { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 }, + { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 }, + { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 }, + { 40, 0xa3a3, 0x606, 0x4545, 0, 0 }, + { 41, 0xcece, 0xcece, 0xcece, 0, 0 }, + { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 }, + { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 }, + { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 }, + { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 }, + { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 }, + { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 }, + { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 }, + { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 }, + { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 }, + { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 }, + { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 }, + { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 }, + { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 }, + { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 }, + { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 }, + { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 }, + { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 }, + { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 }, + { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 }, + { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 }, + { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 }, + { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 }, + { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 }, + { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 }, + { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 }, + { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 }, + { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 }, + { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 }, + { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 }, + { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 }, + { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 }, + { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 }, + { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 }, + { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 }, + { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 }, + { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 }, + { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 }, + { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 }, + { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 }, + { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 }, + { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 }, + { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 }, + { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 }, + { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 }, + { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 }, + { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 }, + { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 }, + { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 }, + { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 }, + { 91, 0x6060, 0x5353, 0xadad, 0, 0 }, + { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 }, + { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 }, + { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 }, + { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 }, + { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 }, + { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 }, + { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 }, + { 99, 0x4141, 0x4444, 0xbaba, 0, 0 }, + { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 }, + { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 }, + { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 }, + { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 }, + { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 }, + { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 }, + { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 }, + { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 }, + { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 }, + { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 }, + { 110, 0x3434, 0x6565, 0xafaf, 0, 0 }, + { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 }, + { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 }, + { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 }, + { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 }, + { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 }, + { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 }, + { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 }, + { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 }, + { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 }, + { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 }, + { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 }, + { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 }, + { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 }, + { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 }, + { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 }, + { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 }, + { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 }, + { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 }, + { 129, 0x0, 0x5f5f, 0x7979, 0, 0 }, + { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 }, + { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 }, + { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 }, + { 133, 0x2424, 0x8282, 0x8383, 0, 0 }, + { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 }, + { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 }, + { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 }, + { 137, 0xa0a, 0x9393, 0x8585, 0, 0 }, + { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 }, + { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 }, + { 140, 0x404, 0x8181, 0x7272, 0, 0 }, + { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 }, + { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 }, + { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 }, + { 144, 0x202, 0x8c8c, 0x5050, 0, 0 }, + { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 }, + { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 }, + { 147, 0x202, 0x7d7d, 0x3939, 0, 0 }, + { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 }, + { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 }, + { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 }, + { 151, 0x101, 0x8888, 0x2a2a, 0, 0 }, + { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 }, + { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 }, + { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 }, + { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 }, + { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 }, + { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 }, + { 158, 0x0, 0x8e8e, 0x1919, 0, 0 }, + { 159, 0x1010, 0xafaf, 0x2828, 0, 0 }, + { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 }, + { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 }, + { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 }, + { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 }, + { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 }, + { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 }, + { 166, 0x1212, 0xbaba, 0x1717, 0, 0 }, + { 167, 0x101, 0x8a8a, 0x202, 0, 0 }, + { 168, 0x303, 0x9a9a, 0x202, 0, 0 }, + { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 }, + { 170, 0x808, 0xb2b2, 0x505, 0, 0 }, + { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 }, + { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 }, + { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 }, + { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 }, + { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 }, + { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 }, + { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 }, + { 178, 0x2929, 0xa5a5, 0x808, 0, 0 }, + { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 }, + { 180, 0x0, 0xffff, 0xffff, 0, 0 }, + { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 }, + { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 }, + { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 }, + { 184, 0x5555, 0xcccc, 0x1515, 0, 0 }, + { 185, 0x0, 0xffff, 0x0, 0, 0 }, + { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 }, + { 187, 0x4343, 0xa7a7, 0x101, 0, 0 }, + { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 }, + { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 }, + { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 }, + { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 }, + { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 }, + { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 }, + { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 }, + { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 }, + { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 }, + { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 }, + { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 }, + { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 }, + { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 }, + { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 }, + { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 }, + { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 }, + { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 }, + { 205, 0x9898, 0x9696, 0x202, 0, 0 }, + { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 }, + { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 }, + { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 }, + { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 }, + { 210, 0x0, 0x0, 0xffff, 0, 0 }, + { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 }, + { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 }, + { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 }, + { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 }, + { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 }, + { 216, 0xdddd, 0x0, 0x0, 0, 0 }, + { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 }, + { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 }, + { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 }, + { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 }, + { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 }, + { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 }, + { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 }, + { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 }, + { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 }, + { 226, 0xadad, 0x5252, 0xf0f, 0, 0 }, + { 227, 0x0, 0xbbbb, 0x0, 0, 0 }, + { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 }, + { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 }, + { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 }, + { 231, 0xa4a4, 0x3434, 0x303, 0, 0 }, + { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 }, + { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 }, + { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 }, + { 235, 0xa9a9, 0x2222, 0x606, 0, 0 }, + { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 }, + { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 }, + { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 }, + { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 }, + { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 }, + { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 }, + { 242, 0xacac, 0xacac, 0xacac, 0, 0 }, + { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 }, + { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 }, + { 245, 0x9292, 0x9292, 0x9292, 0, 0 }, + { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 }, + { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 }, + { 248, 0x8181, 0x8181, 0x8181, 0, 0 }, + { 249, 0x8888, 0x8888, 0x8888, 0, 0 }, + { 250, 0x7777, 0x7777, 0x7777, 0, 0 }, + { 251, 0x5555, 0x5555, 0x5555, 0, 0 }, + { 252, 0x4444, 0x4444, 0x4444, 0, 0 }, + { 253, 0x2222, 0x2222, 0x2222, 0, 0 }, + { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 }, + { 255, 0x0, 0x0, 0x0, 0, 0 }, +}; + +#else /* !USE_NEW_CLUT */ + +static xColorItem darwinClut8[] = { + { 0, 0x0000, 0x0000, 0x0000, 0, 0 }, + { 1, 0xffff, 0xffff, 0xcccc, 0, 0 }, + { 2, 0xffff, 0xffff, 0x9999, 0, 0 }, + { 3, 0xffff, 0xffff, 0x6666, 0, 0 }, + { 4, 0xffff, 0xffff, 0x3333, 0, 0 }, + { 5, 0xffff, 0xffff, 0x0000, 0, 0 }, + { 6, 0xffff, 0xcccc, 0xffff, 0, 0 }, + { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 }, + { 8, 0xffff, 0xcccc, 0x9999, 0, 0 }, + { 9, 0xffff, 0xcccc, 0x6666, 0, 0 }, + { 10, 0xffff, 0xcccc, 0x3333, 0, 0 }, + { 11, 0xffff, 0xcccc, 0x0000, 0, 0 }, + { 12, 0xffff, 0x9999, 0xffff, 0, 0 }, + { 13, 0xffff, 0x9999, 0xcccc, 0, 0 }, + { 14, 0xffff, 0x9999, 0x9999, 0, 0 }, + { 15, 0xffff, 0x9999, 0x6666, 0, 0 }, + { 16, 0xffff, 0x9999, 0x3333, 0, 0 }, + { 17, 0xffff, 0x9999, 0x0000, 0, 0 }, + { 18, 0xffff, 0x6666, 0xffff, 0, 0 }, + { 19, 0xffff, 0x6666, 0xcccc, 0, 0 }, + { 20, 0xffff, 0x6666, 0x9999, 0, 0 }, + { 21, 0xffff, 0x6666, 0x6666, 0, 0 }, + { 22, 0xffff, 0x6666, 0x3333, 0, 0 }, + { 23, 0xffff, 0x6666, 0x0000, 0, 0 }, + { 24, 0xffff, 0x3333, 0xffff, 0, 0 }, + { 25, 0xffff, 0x3333, 0xcccc, 0, 0 }, + { 26, 0xffff, 0x3333, 0x9999, 0, 0 }, + { 27, 0xffff, 0x3333, 0x6666, 0, 0 }, + { 28, 0xffff, 0x3333, 0x3333, 0, 0 }, + { 29, 0xffff, 0x3333, 0x0000, 0, 0 }, + { 30, 0xffff, 0x0000, 0xffff, 0, 0 }, + { 31, 0xffff, 0x0000, 0xcccc, 0, 0 }, + { 32, 0xffff, 0x0000, 0x9999, 0, 0 }, + { 33, 0xffff, 0x0000, 0x6666, 0, 0 }, + { 34, 0xffff, 0x0000, 0x3333, 0, 0 }, + { 35, 0xffff, 0x0000, 0x0000, 0, 0 }, + { 36, 0xcccc, 0xffff, 0xffff, 0, 0 }, + { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 }, + { 38, 0xcccc, 0xffff, 0x9999, 0, 0 }, + { 39, 0xcccc, 0xffff, 0x6666, 0, 0 }, + { 40, 0xcccc, 0xffff, 0x3333, 0, 0 }, + { 41, 0xcccc, 0xffff, 0x0000, 0, 0 }, + { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 }, + { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 }, + { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 }, + { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 }, + { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 }, + { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 }, + { 48, 0xcccc, 0x9999, 0xffff, 0, 0 }, + { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 }, + { 50, 0xcccc, 0x9999, 0x9999, 0, 0 }, + { 51, 0xcccc, 0x9999, 0x6666, 0, 0 }, + { 52, 0xcccc, 0x9999, 0x3333, 0, 0 }, + { 53, 0xcccc, 0x9999, 0x0000, 0, 0 }, + { 54, 0xcccc, 0x6666, 0xffff, 0, 0 }, + { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 }, + { 56, 0xcccc, 0x6666, 0x9999, 0, 0 }, + { 57, 0xcccc, 0x6666, 0x6666, 0, 0 }, + { 58, 0xcccc, 0x6666, 0x3333, 0, 0 }, + { 59, 0xcccc, 0x6666, 0x0000, 0, 0 }, + { 60, 0xcccc, 0x3333, 0xffff, 0, 0 }, + { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 }, + { 62, 0xcccc, 0x3333, 0x9999, 0, 0 }, + { 63, 0xcccc, 0x3333, 0x6666, 0, 0 }, + { 64, 0xcccc, 0x3333, 0x3333, 0, 0 }, + { 65, 0xcccc, 0x3333, 0x0000, 0, 0 }, + { 66, 0xcccc, 0x0000, 0xffff, 0, 0 }, + { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 }, + { 68, 0xcccc, 0x0000, 0x9999, 0, 0 }, + { 69, 0xcccc, 0x0000, 0x6666, 0, 0 }, + { 70, 0xcccc, 0x0000, 0x3333, 0, 0 }, + { 71, 0xcccc, 0x0000, 0x0000, 0, 0 }, + { 72, 0x9999, 0xffff, 0xffff, 0, 0 }, + { 73, 0x9999, 0xffff, 0xcccc, 0, 0 }, + { 74, 0x9999, 0xffff, 0x9999, 0, 0 }, + { 75, 0x9999, 0xffff, 0x6666, 0, 0 }, + { 76, 0x9999, 0xffff, 0x3333, 0, 0 }, + { 77, 0x9999, 0xffff, 0x0000, 0, 0 }, + { 78, 0x9999, 0xcccc, 0xffff, 0, 0 }, + { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 }, + { 80, 0x9999, 0xcccc, 0x9999, 0, 0 }, + { 81, 0x9999, 0xcccc, 0x6666, 0, 0 }, + { 82, 0x9999, 0xcccc, 0x3333, 0, 0 }, + { 83, 0x9999, 0xcccc, 0x0000, 0, 0 }, + { 84, 0x9999, 0x9999, 0xffff, 0, 0 }, + { 85, 0x9999, 0x9999, 0xcccc, 0, 0 }, + { 86, 0x9999, 0x9999, 0x9999, 0, 0 }, + { 87, 0x9999, 0x9999, 0x6666, 0, 0 }, + { 88, 0x9999, 0x9999, 0x3333, 0, 0 }, + { 89, 0x9999, 0x9999, 0x0000, 0, 0 }, + { 90, 0x9999, 0x6666, 0xffff, 0, 0 }, + { 91, 0x9999, 0x6666, 0xcccc, 0, 0 }, + { 92, 0x9999, 0x6666, 0x9999, 0, 0 }, + { 93, 0x9999, 0x6666, 0x6666, 0, 0 }, + { 94, 0x9999, 0x6666, 0x3333, 0, 0 }, + { 95, 0x9999, 0x6666, 0x0000, 0, 0 }, + { 96, 0x9999, 0x3333, 0xffff, 0, 0 }, + { 97, 0x9999, 0x3333, 0xcccc, 0, 0 }, + { 98, 0x9999, 0x3333, 0x9999, 0, 0 }, + { 99, 0x9999, 0x3333, 0x6666, 0, 0 }, + { 100, 0x9999, 0x3333, 0x3333, 0, 0 }, + { 101, 0x9999, 0x3333, 0x0000, 0, 0 }, + { 102, 0x9999, 0x0000, 0xffff, 0, 0 }, + { 103, 0x9999, 0x0000, 0xcccc, 0, 0 }, + { 104, 0x9999, 0x0000, 0x9999, 0, 0 }, + { 105, 0x9999, 0x0000, 0x6666, 0, 0 }, + { 106, 0x9999, 0x0000, 0x3333, 0, 0 }, + { 107, 0x9999, 0x0000, 0x0000, 0, 0 }, + { 108, 0x6666, 0xffff, 0xffff, 0, 0 }, + { 109, 0x6666, 0xffff, 0xcccc, 0, 0 }, + { 110, 0x6666, 0xffff, 0x9999, 0, 0 }, + { 111, 0x6666, 0xffff, 0x6666, 0, 0 }, + { 112, 0x6666, 0xffff, 0x3333, 0, 0 }, + { 113, 0x6666, 0xffff, 0x0000, 0, 0 }, + { 114, 0x6666, 0xcccc, 0xffff, 0, 0 }, + { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 }, + { 116, 0x6666, 0xcccc, 0x9999, 0, 0 }, + { 117, 0x6666, 0xcccc, 0x6666, 0, 0 }, + { 118, 0x6666, 0xcccc, 0x3333, 0, 0 }, + { 119, 0x6666, 0xcccc, 0x0000, 0, 0 }, + { 120, 0x6666, 0x9999, 0xffff, 0, 0 }, + { 121, 0x6666, 0x9999, 0xcccc, 0, 0 }, + { 122, 0x6666, 0x9999, 0x9999, 0, 0 }, + { 123, 0x6666, 0x9999, 0x6666, 0, 0 }, + { 124, 0x6666, 0x9999, 0x3333, 0, 0 }, + { 125, 0x6666, 0x9999, 0x0000, 0, 0 }, + { 126, 0x6666, 0x6666, 0xffff, 0, 0 }, + { 127, 0x6666, 0x6666, 0xcccc, 0, 0 }, + { 128, 0x6666, 0x6666, 0x9999, 0, 0 }, + { 129, 0x6666, 0x6666, 0x6666, 0, 0 }, + { 130, 0x6666, 0x6666, 0x3333, 0, 0 }, + { 131, 0x6666, 0x6666, 0x0000, 0, 0 }, + { 132, 0x6666, 0x3333, 0xffff, 0, 0 }, + { 133, 0x6666, 0x3333, 0xcccc, 0, 0 }, + { 134, 0x6666, 0x3333, 0x9999, 0, 0 }, + { 135, 0x6666, 0x3333, 0x6666, 0, 0 }, + { 136, 0x6666, 0x3333, 0x3333, 0, 0 }, + { 137, 0x6666, 0x3333, 0x0000, 0, 0 }, + { 138, 0x6666, 0x0000, 0xffff, 0, 0 }, + { 139, 0x6666, 0x0000, 0xcccc, 0, 0 }, + { 140, 0x6666, 0x0000, 0x9999, 0, 0 }, + { 141, 0x6666, 0x0000, 0x6666, 0, 0 }, + { 142, 0x6666, 0x0000, 0x3333, 0, 0 }, + { 143, 0x6666, 0x0000, 0x0000, 0, 0 }, + { 144, 0x3333, 0xffff, 0xffff, 0, 0 }, + { 145, 0x3333, 0xffff, 0xcccc, 0, 0 }, + { 146, 0x3333, 0xffff, 0x9999, 0, 0 }, + { 147, 0x3333, 0xffff, 0x6666, 0, 0 }, + { 148, 0x3333, 0xffff, 0x3333, 0, 0 }, + { 149, 0x3333, 0xffff, 0x0000, 0, 0 }, + { 150, 0x3333, 0xcccc, 0xffff, 0, 0 }, + { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 }, + { 152, 0x3333, 0xcccc, 0x9999, 0, 0 }, + { 153, 0x3333, 0xcccc, 0x6666, 0, 0 }, + { 154, 0x3333, 0xcccc, 0x3333, 0, 0 }, + { 155, 0x3333, 0xcccc, 0x0000, 0, 0 }, + { 156, 0x3333, 0x9999, 0xffff, 0, 0 }, + { 157, 0x3333, 0x9999, 0xcccc, 0, 0 }, + { 158, 0x3333, 0x9999, 0x9999, 0, 0 }, + { 159, 0x3333, 0x9999, 0x6666, 0, 0 }, + { 160, 0x3333, 0x9999, 0x3333, 0, 0 }, + { 161, 0x3333, 0x9999, 0x0000, 0, 0 }, + { 162, 0x3333, 0x6666, 0xffff, 0, 0 }, + { 163, 0x3333, 0x6666, 0xcccc, 0, 0 }, + { 164, 0x3333, 0x6666, 0x9999, 0, 0 }, + { 165, 0x3333, 0x6666, 0x6666, 0, 0 }, + { 166, 0x3333, 0x6666, 0x3333, 0, 0 }, + { 167, 0x3333, 0x6666, 0x0000, 0, 0 }, + { 168, 0x3333, 0x3333, 0xffff, 0, 0 }, + { 169, 0x3333, 0x3333, 0xcccc, 0, 0 }, + { 170, 0x3333, 0x3333, 0x9999, 0, 0 }, + { 171, 0x3333, 0x3333, 0x6666, 0, 0 }, + { 172, 0x3333, 0x3333, 0x3333, 0, 0 }, + { 173, 0x3333, 0x3333, 0x0000, 0, 0 }, + { 174, 0x3333, 0x0000, 0xffff, 0, 0 }, + { 175, 0x3333, 0x0000, 0xcccc, 0, 0 }, + { 176, 0x3333, 0x0000, 0x9999, 0, 0 }, + { 177, 0x3333, 0x0000, 0x6666, 0, 0 }, + { 178, 0x3333, 0x0000, 0x3333, 0, 0 }, + { 179, 0x3333, 0x0000, 0x0000, 0, 0 }, + { 180, 0x0000, 0xffff, 0xffff, 0, 0 }, + { 181, 0x0000, 0xffff, 0xcccc, 0, 0 }, + { 182, 0x0000, 0xffff, 0x9999, 0, 0 }, + { 183, 0x0000, 0xffff, 0x6666, 0, 0 }, + { 184, 0x0000, 0xffff, 0x3333, 0, 0 }, + { 185, 0x0000, 0xffff, 0x0000, 0, 0 }, + { 186, 0x0000, 0xcccc, 0xffff, 0, 0 }, + { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 }, + { 188, 0x0000, 0xcccc, 0x9999, 0, 0 }, + { 189, 0x0000, 0xcccc, 0x6666, 0, 0 }, + { 190, 0x0000, 0xcccc, 0x3333, 0, 0 }, + { 191, 0x0000, 0xcccc, 0x0000, 0, 0 }, + { 192, 0x0000, 0x9999, 0xffff, 0, 0 }, + { 193, 0x0000, 0x9999, 0xcccc, 0, 0 }, + { 194, 0x0000, 0x9999, 0x9999, 0, 0 }, + { 195, 0x0000, 0x9999, 0x6666, 0, 0 }, + { 196, 0x0000, 0x9999, 0x3333, 0, 0 }, + { 197, 0x0000, 0x9999, 0x0000, 0, 0 }, + { 198, 0x0000, 0x6666, 0xffff, 0, 0 }, + { 199, 0x0000, 0x6666, 0xcccc, 0, 0 }, + { 200, 0x0000, 0x6666, 0x9999, 0, 0 }, + { 201, 0x0000, 0x6666, 0x6666, 0, 0 }, + { 202, 0x0000, 0x6666, 0x3333, 0, 0 }, + { 203, 0x0000, 0x6666, 0x0000, 0, 0 }, + { 204, 0x0000, 0x3333, 0xffff, 0, 0 }, + { 205, 0x0000, 0x3333, 0xcccc, 0, 0 }, + { 206, 0x0000, 0x3333, 0x9999, 0, 0 }, + { 207, 0x0000, 0x3333, 0x6666, 0, 0 }, + { 208, 0x0000, 0x3333, 0x3333, 0, 0 }, + { 209, 0x0000, 0x3333, 0x0000, 0, 0 }, + { 210, 0x0000, 0x0000, 0xffff, 0, 0 }, + { 211, 0x0000, 0x0000, 0xcccc, 0, 0 }, + { 212, 0x0000, 0x0000, 0x9999, 0, 0 }, + { 213, 0x0000, 0x0000, 0x6666, 0, 0 }, + { 214, 0x0000, 0x0000, 0x3333, 0, 0 }, + { 215, 0xeeee, 0x0000, 0x0000, 0, 0 }, + { 216, 0xdddd, 0x0000, 0x0000, 0, 0 }, + { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 }, + { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 }, + { 219, 0x8888, 0x0000, 0x0000, 0, 0 }, + { 220, 0x7777, 0x0000, 0x0000, 0, 0 }, + { 221, 0x5555, 0x0000, 0x0000, 0, 0 }, + { 222, 0x4444, 0x0000, 0x0000, 0, 0 }, + { 223, 0x2222, 0x0000, 0x0000, 0, 0 }, + { 224, 0x1111, 0x0000, 0x0000, 0, 0 }, + { 225, 0x0000, 0xeeee, 0x0000, 0, 0 }, + { 226, 0x0000, 0xdddd, 0x0000, 0, 0 }, + { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 }, + { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 }, + { 229, 0x0000, 0x8888, 0x0000, 0, 0 }, + { 230, 0x0000, 0x7777, 0x0000, 0, 0 }, + { 231, 0x0000, 0x5555, 0x0000, 0, 0 }, + { 232, 0x0000, 0x4444, 0x0000, 0, 0 }, + { 233, 0x0000, 0x2222, 0x0000, 0, 0 }, + { 234, 0x0000, 0x1111, 0x0000, 0, 0 }, + { 235, 0x0000, 0x0000, 0xeeee, 0, 0 }, + { 236, 0x0000, 0x0000, 0xdddd, 0, 0 }, + { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 }, + { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 }, + { 239, 0x0000, 0x0000, 0x8888, 0, 0 }, + { 240, 0x0000, 0x0000, 0x7777, 0, 0 }, + { 241, 0x0000, 0x0000, 0x5555, 0, 0 }, + { 242, 0x0000, 0x0000, 0x4444, 0, 0 }, + { 243, 0x0000, 0x0000, 0x2222, 0, 0 }, + { 244, 0x0000, 0x0000, 0x1111, 0, 0 }, + { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 }, + { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 }, + { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 }, + { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 }, + { 249, 0x8888, 0x8888, 0x8888, 0, 0 }, + { 250, 0x7777, 0x7777, 0x7777, 0, 0 }, + { 251, 0x5555, 0x5555, 0x5555, 0, 0 }, + { 252, 0x4444, 0x4444, 0x4444, 0, 0 }, + { 253, 0x2222, 0x2222, 0x2222, 0, 0 }, + { 254, 0x1111, 0x1111, 0x1111, 0, 0 }, + { 255, 0xffff, 0xffff, 0xffff, 0, 0 } +}; +#endif /* USE_NEW_CLUT */ + +#endif /* _DARWIN_CLUT8_ */ Index: xc/programs/Xserver/hw/darwin/darwinEvents.c diff -u xc/programs/Xserver/hw/darwin/darwinEvents.c:1.2 xc/programs/Xserver/hw/darwin/darwinEvents.c:1.5 --- xc/programs/Xserver/hw/darwin/darwinEvents.c:1.2 Tue Nov 19 18:01:30 2002 +++ xc/programs/Xserver/hw/darwin/darwinEvents.c Mon Nov 3 00:36:30 2003 @@ -28,6 +28,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.5 2003/11/03 05:36:30 tsi Exp $ */ #define NEED_EVENTS #include "X.h" @@ -42,7 +43,6 @@ #include "mipointer.h" #include "darwin.h" -#include "quartz/quartz.h" #include #include @@ -181,6 +181,7 @@ const xEvent *e) { HWEventQueueType oldtail, newtail; + char byte = 0; oldtail = darwinEventQueue.tail; @@ -209,6 +210,9 @@ // Update the tail after the event is prepared darwinEventQueue.tail = newtail; + + // Signal there is an event ready to handle + write(darwinEventWriteFD, &byte, 1); } @@ -253,7 +257,7 @@ // Empty the signaling pipe x = sizeof(xe); while (x == sizeof(xe)) { - x = read(darwinEventFD, &xe, sizeof(xe)); + x = read(darwinEventReadFD, &xe, sizeof(xe)); } while (darwinEventQueue.head != darwinEventQueue.tail) @@ -425,11 +429,8 @@ } default: - if (quartz) { - QuartzProcessEvent(&xe); - } else { - ErrorF("Unknown X event caught: %d\n", xe.u.u.type); - } + // Check for mode specific event + DarwinModeProcessEvent(&xe); } } } Index: xc/programs/Xserver/hw/darwin/darwinKeyboard.c diff -u xc/programs/Xserver/hw/darwin/darwinKeyboard.c:1.17 xc/programs/Xserver/hw/darwin/darwinKeyboard.c:1.19 --- xc/programs/Xserver/hw/darwin/darwinKeyboard.c:1.17 Mon Dec 9 19:00:38 2002 +++ xc/programs/Xserver/hw/darwin/darwinKeyboard.c Sat Nov 1 03:13:08 2003 @@ -2,7 +2,8 @@ // // Keyboard support for the Darwin X Server // -// Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. +// Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved. +// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved. // // The code to parse the Darwin keymap is derived from dumpkeymap.c // by Eric Sunshine, which includes the following copyright: @@ -36,7 +37,7 @@ // //============================================================================= -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.17 2002/12/10 00:00:38 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.19 2003/11/01 08:13:08 torrey Exp $ */ /* =========================================================================== @@ -59,26 +60,18 @@ // in determining how the X server is interpreting the Darwin keymap. #undef DUMP_DARWIN_KEYMAP +/* Define this to use Alt for Mode_switch. */ +#define ALT_IS_MODE_SWITCH 1 + #include #include #include #include +#include #include #include // For the NXSwap* #include "darwin.h" -#include "xfIOKit.h" -#include "quartz/quartzAudio.h" -#include "quartz/quartzShared.h" - -#define XK_TECHNICAL // needed to get XK_Escape -#define XK_PUBLISHING -#include "keysym.h" - -// Each key can generate 4 glyphs. They are, in order: -// unshifted, shifted, modeswitch unshifted, modeswitch shifted -#define GLYPHS_PER_KEY 4 -#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better -#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 +#include "darwinKeyboard.h" #define AltMask Mod1Mask #define MetaMask Mod2Mask @@ -224,11 +217,9 @@ // keyclick, bell volume / pitch, autorepead, LED's } -static CARD8 modMap[MAP_LENGTH]; -static KeySym map[MAP_LENGTH * GLYPHS_PER_KEY]; -static unsigned char modifierKeycodes[NX_NUMMODIFIERS][2]; -static FILE *fref = NULL; -static char *inBuffer = NULL; +static darwinKeyboardInfo keyInfo; +static FILE *fref = NULL; +static char *inBuffer = NULL; //----------------------------------------------------------------------------- // Data Stream Object @@ -449,34 +440,18 @@ /* - * DarwinKeyboardInit - * Get the Darwin keyboard map and compute an equivalent - * X keyboard map and modifier map. Set the new keyboard - * device structure. + * DarwinParseNXKeyMapping */ -void DarwinKeyboardInit( - DeviceIntPtr pDev ) +Bool DarwinParseNXKeyMapping( + darwinKeyboardInfo *info) { KeySym *k; int i; short numMods, numKeys, numPadKeys = 0; - KeySymsRec keySyms; + Bool haveKeymap = FALSE; NXKeyMapping keyMap; DataStream *keyMapStream; unsigned char const *numPadStart = 0; - BellProcPtr bellProc; - Bool haveKeymap = FALSE; - - memset( modMap, NoSymbol, sizeof( modMap ) ); - memset( map, 0, sizeof( map ) ); - for (i = 0; i < NX_NUMMODIFIERS; i++) { - modifierKeycodes[i][0] = modifierKeycodes[i][1] = 0; - } - - // Open a shared connection to the HID System. - // Note that the Event Status Driver is really just a wrapper - // for a kIOHIDParamConnectType connection. - assert( darwinParamConnect = NXOpenEventStatus() ); if (darwinKeymapFile) { haveKeymap = DarwinReadKeymapFile(&keyMap); @@ -494,7 +469,7 @@ keyMap.size = NXKeyMappingLength( darwinParamConnect ); keyMap.mapping = (char*) xalloc( keyMap.size ); if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) { - FatalError("Could not get kernel keymapping! Load keymapping from file instead.\n"); + return FALSE; } } @@ -507,9 +482,7 @@ ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n"); } - // Compute the modifier map and - // insert X modifier KeySyms into keyboard map. - // Store modifier keycodes in modifierKeycodes. + // Insert X modifier KeySyms into the keyboard map. numMods = get_number(keyMapStream); while (numMods-- > 0) { int left = 1; // first keycode is left @@ -526,40 +499,33 @@ while (numKeyCodes-- > 0) { const short keyCode = get_number(keyMapStream); if (charCode != NX_MODIFIERKEY_NUMERICPAD) { - modifierKeycodes[charCode][1-left] = keyCode; switch (charCode) { case NX_MODIFIERKEY_ALPHALOCK: - modMap[keyCode + MIN_KEYCODE] = LockMask; - map[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock; + info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock; break; case NX_MODIFIERKEY_SHIFT: - modMap[keyCode + MIN_KEYCODE] = ShiftMask; - map[keyCode * GLYPHS_PER_KEY] = + info->keyMap[keyCode * GLYPHS_PER_KEY] = (left ? XK_Shift_L : XK_Shift_R); break; case NX_MODIFIERKEY_CONTROL: - modMap[keyCode + MIN_KEYCODE] = ControlMask; - map[keyCode * GLYPHS_PER_KEY] = + info->keyMap[keyCode * GLYPHS_PER_KEY] = (left ? XK_Control_L : XK_Control_R); break; case NX_MODIFIERKEY_ALTERNATE: - modMap[keyCode + MIN_KEYCODE] = AltMask; - map[keyCode * GLYPHS_PER_KEY] = + info->keyMap[keyCode * GLYPHS_PER_KEY] = (left ? XK_Mode_switch : XK_Alt_R); break; case NX_MODIFIERKEY_COMMAND: - modMap[keyCode + MIN_KEYCODE] = MetaMask; - map[keyCode * GLYPHS_PER_KEY] = + info->keyMap[keyCode * GLYPHS_PER_KEY] = (left ? XK_Meta_L : XK_Meta_R); break; case NX_MODIFIERKEY_SECONDARYFN: - modMap[keyCode + MIN_KEYCODE] = FunctionMask; - map[keyCode * GLYPHS_PER_KEY] = + info->keyMap[keyCode * GLYPHS_PER_KEY] = (left ? XK_Control_L : XK_Control_R); break; case NX_MODIFIERKEY_HELP: // Help is not an X11 modifier; treat as normal key - map[keyCode * GLYPHS_PER_KEY] = XK_Help; + info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help; break; } } @@ -567,12 +533,12 @@ } } - // Convert the Darwin keyboard map to an X keyboard map. + // Convert the Darwin keyboard mapping to an X keyboard map. // A key can have a different character code for each combination of // modifiers. We currently ignore all modifier combinations except // those with Shift, AlphaLock, and Alt. numKeys = get_number(keyMapStream); - for (i = 0, k = map; i < numKeys; i++, k += GLYPHS_PER_KEY) { + for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) { short const charGenMask = get_number(keyMapStream); if (charGenMask != 0xFF) { // is key bound? short numKeyCodes = 1 << bits_set(charGenMask); @@ -656,7 +622,7 @@ keyMapStream->data = numPadStart; while(numPadKeys-- > 0) { const short keyCode = get_number(keyMapStream); - k = &map[keyCode * GLYPHS_PER_KEY]; + k = &info->keyMap[keyCode * GLYPHS_PER_KEY]; for (i = 0; i < NUM_KEYPAD; i++) { if (*k == normal_to_keypad[i].normalSym) { k[0] = normal_to_keypad[i].keypadSym; @@ -671,7 +637,9 @@ #ifdef DUMP_DARWIN_KEYMAP ErrorF("Darwin -> X converted keyboard map\n"); - for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) { + for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES; + i++, k += GLYPHS_PER_KEY) + { int j; ErrorF("0x%02x:", i); for (j = 0; j < GLYPHS_PER_KEY; j++) { @@ -685,18 +653,145 @@ } #endif - keySyms.map = map; + return TRUE; +} + + +/* + * DarwinBuildModifierMaps + * Use the keyMap field of keyboard info structure to populate + * the modMap and modifierKeycodes fields. + */ +static void +DarwinBuildModifierMaps( + darwinKeyboardInfo *info) +{ + int i; + KeySym *k; + int darwinSwapAltMeta = 0; + + memset(info->modMap, NoSymbol, sizeof(info->modMap)); + memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes)); + + for (i = 0; i < NUM_KEYCODES; i++) + { + k = info->keyMap + i * GLYPHS_PER_KEY; + + switch (k[0]) { + case XK_Shift_L: + info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; + info->modMap[MIN_KEYCODE + i] = ShiftMask; + break; + + case XK_Shift_R: + info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][1] = i; + info->modMap[MIN_KEYCODE + i] = ShiftMask; + break; + + case XK_Control_L: + info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; + info->modMap[MIN_KEYCODE + i] = ControlMask; + break; + + case XK_Control_R: + info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][1] = i; + info->modMap[MIN_KEYCODE + i] = ControlMask; + break; + + case XK_Caps_Lock: + info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i; + info->modMap[MIN_KEYCODE + i] = LockMask; + break; + + case XK_Alt_L: + info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + break; + + case XK_Alt_R: + info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][1] = i; + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + break; + + case XK_Mode_switch: + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + break; + + case XK_Meta_L: + info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; + info->modMap[MIN_KEYCODE + i] = Mod2Mask; + break; + + case XK_Meta_R: + info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][1] = i; + info->modMap[MIN_KEYCODE + i] = Mod2Mask; + break; + + case XK_Num_Lock: + info->modMap[MIN_KEYCODE + i] = Mod3Mask; + break; + } + + if (darwinSwapAltMeta) + { + switch (k[0]) + { + case XK_Alt_L: + k[0] = XK_Meta_L; + break; + case XK_Alt_R: + k[0] = XK_Meta_R; + break; + case XK_Meta_L: + k[0] = XK_Alt_L; + break; + case XK_Meta_R: + k[0] = XK_Alt_R; + break; + } + } + +#if ALT_IS_MODE_SWITCH + if (k[0] == XK_Alt_L || k[0] == XK_Alt_R) + k[0] = XK_Mode_switch; +#endif + } +} + + +/* + * DarwinKeyboardInit + * Get the Darwin keyboard map and compute an equivalent + * X keyboard map and modifier map. Set the new keyboard + * device structure. + */ +void DarwinKeyboardInit( + DeviceIntPtr pDev ) +{ + KeySymsRec keySyms; + + memset( keyInfo.keyMap, 0, sizeof( keyInfo.keyMap ) ); + + // Open a shared connection to the HID System. + // Note that the Event Status Driver is really just a wrapper + // for a kIOHIDParamConnectType connection. + assert( darwinParamConnect = NXOpenEventStatus() ); + + if (!DarwinParseNXKeyMapping(&keyInfo)) { + if (!DarwinModeReadSystemKeymap(&keyInfo)) { + FatalError("Could not build a valid keymap."); + } + } + + DarwinBuildModifierMaps(&keyInfo); + + keySyms.map = keyInfo.keyMap; keySyms.mapWidth = GLYPHS_PER_KEY; keySyms.minKeyCode = MIN_KEYCODE; keySyms.maxKeyCode = MAX_KEYCODE; - if (quartz) - bellProc = QuartzBell; - else - bellProc = XFIOKitBell; - - assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, modMap, - bellProc, + assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, + keyInfo.modMap, DarwinModeBell, DarwinChangeKeyboardControl )); } @@ -718,7 +813,7 @@ */ int DarwinModifierNXKeyToNXKeycode(int key, int side) { - return modifierKeycodes[key][side]; + return keyInfo.modifierKeycodes[key][side]; } /* @@ -734,7 +829,7 @@ // search modifierKeycodes for this keycode+side for (key = 0; key < NX_NUMMODIFIERS; key++) { for (side = 0; side <= 1; side++) { - if (modifierKeycodes[key][side] == keycode) break; + if (keyInfo.modifierKeycodes[key][side] == keycode) break; } } if (key == NX_NUMMODIFIERS) return -1; Index: xc/programs/Xserver/hw/darwin/darwinKeyboard.h diff -u /dev/null xc/programs/Xserver/hw/darwin/darwinKeyboard.h:1.1 --- /dev/null Sat Feb 28 21:42:11 2004 +++ xc/programs/Xserver/hw/darwin/darwinKeyboard.h Sat Nov 1 03:13:08 2003 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.h,v 1.1 2003/11/01 08:13:08 torrey Exp $ */ + +#ifndef DARWIN_KEYBOARD_H +#define DARWIN_KEYBOARD_H 1 + +#define XK_TECHNICAL // needed to get XK_Escape +#define XK_PUBLISHING +#include "keysym.h" +#include "inputstr.h" + +// Each key can generate 4 glyphs. They are, in order: +// unshifted, shifted, modeswitch unshifted, modeswitch shifted +#define GLYPHS_PER_KEY 4 +#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better +#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 + +typedef struct darwinKeyboardInfo_struct { + CARD8 modMap[MAP_LENGTH]; + KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY]; + unsigned char modifierKeycodes[32][2]; +} darwinKeyboardInfo; + +Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info); + +#endif /* DARWIN_KEYBOARD_H */ Index: xc/programs/Xserver/hw/darwin/xfIOKit.c diff -u xc/programs/Xserver/hw/darwin/xfIOKit.c:1.17 xc/programs/Xserver/hw/darwin/xfIOKit.c:removed --- xc/programs/Xserver/hw/darwin/xfIOKit.c:1.17 Sun Dec 15 01:10:15 2002 +++ xc/programs/Xserver/hw/darwin/xfIOKit.c Sat Feb 28 21:42:11 2004 @@ -1,711 +0,0 @@ -/************************************************************** - * - * IOKit support for the Darwin X Server - * - * HISTORY: - * Original port to Mac OS X Server by John Carmack - * Port to Darwin 1.0 by Dave Zarzycki - * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons - * - **************************************************************/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.c,v 1.17 2002/12/15 06:10:15 torrey Exp $ */ - -#include "X.h" -#include "Xproto.h" -#include "os.h" -#include "servermd.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "mi.h" -#include "mibstore.h" -#include "mipointer.h" -#include "micmap.h" - -#include -#include -#include -#include -#include - -#include - -#define NO_CFPLUGIN -#include -#include -#include -#include - -// Define this to work around bugs in the display drivers for -// older PowerBook G3's. If the X server starts without this -// #define, you don't need it. -#undef OLD_POWERBOOK_G3 - -#include "darwin.h" -#include "xfIOKit.h" - -// Globals -int xfIOKitScreenIndex = 0; -io_connect_t xfIOKitInputConnect = 0; - -static pthread_t inputThread; -static EvGlobals * evg; -static mach_port_t masterPort; -static mach_port_t notificationPort; -static IONotificationPortRef NotificationPortRef; -static mach_port_t pmNotificationPort; -static io_iterator_t fbIter; - - -/* - * XFIOKitStoreColors - * This is a callback from X to change the hardware colormap - * when using PsuedoColor. - */ -static void XFIOKitStoreColors( - ColormapPtr pmap, - int numEntries, - xColorItem *pdefs) -{ - kern_return_t kr; - int i; - IOColorEntry *newColors; - ScreenPtr pScreen = pmap->pScreen; - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - - assert( newColors = (IOColorEntry *) - xalloc( numEntries*sizeof(IOColorEntry) )); - - // Convert xColorItem values to IOColorEntry - // assume the colormap is PsuedoColor - // as we do not support DirectColor - for (i = 0; i < numEntries; i++) { - newColors[i].index = pdefs[i].pixel; - newColors[i].red = pdefs[i].red; - newColors[i].green = pdefs[i].green; - newColors[i].blue = pdefs[i].blue; - } - - kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries, - kSetCLUTByValue, newColors ); - kern_assert( kr ); - - xfree( newColors ); -} - - -/* - * XFIOKitBell - * FIXME - */ -void XFIOKitBell( - int loud, - DeviceIntPtr pDevice, - pointer ctrl, - int fbclass) -{ -} - - -/* - * XFIOKitGiveUp - * Closes the connections to IOKit services - */ -void XFIOKitGiveUp( void ) -{ - int i; - - // we must close the HID System first - // because it is a client of the framebuffer - NXCloseEventStatus( darwinParamConnect ); - IOServiceClose( xfIOKitInputConnect ); - for (i = 0; i < screenInfo.numScreens; i++) { - XFIOKitScreenPtr iokitScreen = - XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]); - IOServiceClose( iokitScreen->fbService ); - } -} - - -/* - * ClearEvent - * Clear an event from the HID System event queue - */ -static void ClearEvent(NXEvent * ep) -{ - static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 }; - - *ep = nullEvent; - ep->data.compound.subType = ep->data.compound.misc.L[0] = - ep->data.compound.misc.L[1] = 0; -} - - -/* - * XFIOKitHIDThread - * Read the HID System event queue, translate it to an X event, - * and queue it for processing. - */ -static void *XFIOKitHIDThread(void *arg) -{ - int iokitEventWriteFD = (int)arg; - - for (;;) { - NXEQElement *oldHead; - mach_msg_return_t kr; - mach_msg_empty_rcv_t msg; - - kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, - sizeof(msg), notificationPort, 0, MACH_PORT_NULL); - kern_assert(kr); - - while (evg->LLEHead != evg->LLETail) { - NXEvent ev; - xEvent xe; - char byte = 0; - - // Extract the next event from the kernel queue - oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead]; - ev_lock(&oldHead->sema); - ev = oldHead->event; - ClearEvent(&oldHead->event); - evg->LLEHead = oldHead->next; - ev_unlock(&oldHead->sema); - - memset(&xe, 0, sizeof(xe)); - - // These fields should be filled in for every event - xe.u.keyButtonPointer.rootX = ev.location.x; - xe.u.keyButtonPointer.rootY = ev.location.y; - xe.u.keyButtonPointer.time = GetTimeInMillis(); - - switch( ev.type ) { - case NX_MOUSEMOVED: - xe.u.u.type = MotionNotify; - break; - - case NX_LMOUSEDOWN: - xe.u.u.type = ButtonPress; - xe.u.u.detail = 1; - break; - - case NX_LMOUSEUP: - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 1; - break; - - // A newer kernel generates multi-button events with - // NX_SYSDEFINED. Button 2 isn't handled correctly by - // older kernels anyway. Just let NX_SYSDEFINED events - // handle these. -#if 0 - case NX_RMOUSEDOWN: - xe.u.u.type = ButtonPress; - xe.u.u.detail = 2; - break; - - case NX_RMOUSEUP: - xe.u.u.type = ButtonRelease; - xe.u.u.detail = 2; - break; -#endif - - case NX_KEYDOWN: - xe.u.u.type = KeyPress; - xe.u.u.detail = ev.data.key.keyCode; - break; - - case NX_KEYUP: - xe.u.u.type = KeyRelease; - xe.u.u.detail = ev.data.key.keyCode; - break; - - case NX_FLAGSCHANGED: - xe.u.u.type = kXDarwinUpdateModifiers; - xe.u.clientMessage.u.l.longs0 = ev.flags; - break; - - case NX_SYSDEFINED: - if (ev.data.compound.subType == 7) { - xe.u.u.type = kXDarwinUpdateButtons; - xe.u.clientMessage.u.l.longs0 = - ev.data.compound.misc.L[0]; - xe.u.clientMessage.u.l.longs1 = - ev.data.compound.misc.L[1]; - } else { - continue; - } - break; - - case NX_SCROLLWHEELMOVED: - xe.u.u.type = kXDarwinScrollWheel; - xe.u.clientMessage.u.s.shorts0 = - ev.data.scrollWheel.deltaAxis1; - break; - - default: - continue; - } - - DarwinEQEnqueue(&xe); - // signal there is an event ready to handle - write(iokitEventWriteFD, &byte, 1); - } - } - - return NULL; -} - - -/* - * XFIOKitPMThread - * Handle power state notifications - */ -static void *XFIOKitPMThread(void *arg) -{ - ScreenPtr pScreen = (ScreenPtr)arg; - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - - for (;;) { - mach_msg_return_t kr; - mach_msg_empty_rcv_t msg; - - kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, - sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL); - kern_assert(kr); - - // display is powering down - if (msg.header.msgh_id == 0) { - IOFBAcknowledgePM( iokitScreen->fbService ); - xf86SetRootClip(pScreen, FALSE); - } - // display just woke up - else if (msg.header.msgh_id == 1) { - xf86SetRootClip(pScreen, TRUE); - } - } - return NULL; -} - - -/* - * SetupFBandHID - * Setup an IOFramebuffer service and connect the HID system to it. - */ -static Bool SetupFBandHID( - int index, - DarwinFramebufferPtr dfb, - XFIOKitScreenPtr iokitScreen) -{ - kern_return_t kr; - io_service_t service; - io_connect_t fbService; - vm_address_t vram; - vm_size_t shmemSize; - int i; - UInt32 numModes; - IODisplayModeInformation modeInfo; - IODisplayModeID displayMode, *allModes; - IOIndex displayDepth; - IOFramebufferInformation fbInfo; - IOPixelInformation pixelInfo; - StdFBShmem_t *cshmem; - - // find and open the IOFrameBuffer service - service = IOIteratorNext(fbIter); - if (service == 0) - return FALSE; - - kr = IOServiceOpen( service, mach_task_self(), - kIOFBServerConnectType, &iokitScreen->fbService ); - IOObjectRelease( service ); - if (kr != KERN_SUCCESS) { - ErrorF("Failed to connect as window server to screen %i.\n", index); - return FALSE; - } - fbService = iokitScreen->fbService; - - // create the slice of shared memory containing cursor state data - kr = IOFBCreateSharedCursor( fbService, - kIOFBCurrentShmemVersion, - 32, 32 ); - if (kr != KERN_SUCCESS) - return FALSE; - - // Register for power management events for the framebuffer's device - kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort); - kern_assert(kr); - kr = IOConnectSetNotificationPort( fbService, 0, - pmNotificationPort, 0 ); - if (kr != KERN_SUCCESS) { - ErrorF("Power management registration failed.\n"); - } - - // SET THE SCREEN PARAMETERS - // get the current screen resolution, refresh rate and depth - kr = IOFBGetCurrentDisplayModeAndDepth( fbService, - &displayMode, - &displayDepth ); - if (kr != KERN_SUCCESS) - return FALSE; - - // use the current screen resolution if the user - // only wants to change the refresh rate - if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) { - kr = IOFBGetDisplayModeInformation( fbService, - displayMode, - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - darwinDesiredWidth = modeInfo.nominalWidth; - darwinDesiredHeight = modeInfo.nominalHeight; - } - - // use the current resolution and refresh rate - // if the user doesn't have a preference - if (darwinDesiredWidth == 0) { - - // change the pixel depth if desired - if (darwinDesiredDepth != -1) { - kr = IOFBGetDisplayModeInformation( fbService, - displayMode, - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - if (modeInfo.maxDepthIndex < darwinDesiredDepth) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Current screen resolution does not support desired pixel depth.\n"); - return FALSE; - } - - displayDepth = darwinDesiredDepth; - kr = IOFBSetDisplayModeAndDepth( fbService, displayMode, - displayDepth ); - if (kr != KERN_SUCCESS) - return FALSE; - } - - // look for display mode with correct resolution and refresh rate - } else { - - // get an array of all supported display modes - kr = IOFBGetDisplayModeCount( fbService, &numModes ); - if (kr != KERN_SUCCESS) - return FALSE; - assert(allModes = (IODisplayModeID *) - xalloc( numModes * sizeof(IODisplayModeID) )); - kr = IOFBGetDisplayModes( fbService, numModes, allModes ); - if (kr != KERN_SUCCESS) - return FALSE; - - for (i = 0; i < numModes; i++) { - kr = IOFBGetDisplayModeInformation( fbService, allModes[i], - &modeInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - - if (modeInfo.flags & kDisplayModeValidFlag && - modeInfo.nominalWidth == darwinDesiredWidth && - modeInfo.nominalHeight == darwinDesiredHeight) { - - if (darwinDesiredDepth == -1) - darwinDesiredDepth = modeInfo.maxDepthIndex; - if (modeInfo.maxDepthIndex < darwinDesiredDepth) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Desired screen resolution does not support desired pixel depth.\n"); - return FALSE; - } - - if ((darwinDesiredRefresh == -1 || - (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) { - displayMode = allModes[i]; - displayDepth = darwinDesiredDepth; - kr = IOFBSetDisplayModeAndDepth(fbService, - displayMode, - displayDepth); - if (kr != KERN_SUCCESS) - return FALSE; - break; - } - } - } - - xfree( allModes ); - if (i >= numModes) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Desired screen resolution or refresh rate is not supported.\n"); - return FALSE; - } - } - - kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth, - kIOFBSystemAperture, &pixelInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - -#ifdef __i386__ - /* x86 in 8bit mode currently needs fixed color map... */ - if( pixelInfo.bitsPerComponent == 8 ) { - pixelInfo.pixelType = kIOFixedCLUTPixels; - } -#endif - -#ifdef OLD_POWERBOOK_G3 - if (pixelInfo.pixelType == kIOCLUTPixels) - pixelInfo.pixelType = kIOFixedCLUTPixels; -#endif - - kr = IOFBGetFramebufferInformationForAperture( fbService, - kIOFBSystemAperture, - &fbInfo ); - if (kr != KERN_SUCCESS) - return FALSE; - - // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video - // outputs without a monitor connected to them. Since IOKit Xinerama - // does not really work, this often causes problems on PowerBooks. - // For now we explicitly check and ignore these screens. - if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) { - ErrorF("Discarding screen %i:\n", index); - ErrorF("Invalid width or height.\n"); - return FALSE; - } - - kr = IOConnectMapMemory( fbService, kIOFBCursorMemory, - mach_task_self(), (vm_address_t *) &cshmem, - &shmemSize, kIOMapAnywhere ); - if (kr != KERN_SUCCESS) - return FALSE; - iokitScreen->cursorShmem = cshmem; - - kr = IOConnectMapMemory( fbService, kIOFBSystemAperture, - mach_task_self(), &vram, &shmemSize, - kIOMapAnywhere ); - if (kr != KERN_SUCCESS) - return FALSE; - - dfb->framebuffer = (void*)vram; - dfb->x = cshmem->screenBounds.minx; - dfb->y = cshmem->screenBounds.miny; - dfb->width = fbInfo.activeWidth; - dfb->height = fbInfo.activeHeight; - dfb->pitch = fbInfo.bytesPerRow; - dfb->bitsPerPixel = fbInfo.bitsPerPixel; - dfb->colorBitsPerPixel = pixelInfo.componentCount * - pixelInfo.bitsPerComponent; - dfb->bitsPerComponent = pixelInfo.bitsPerComponent; - - // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor - if (pixelInfo.pixelType == kIORGBDirectPixels) { - dfb->colorType = TrueColor; - } else if (pixelInfo.pixelType == kIOCLUTPixels) { - dfb->colorType = PseudoColor; - } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) { - dfb->colorType = StaticColor; - } - - // Inform the HID system that the framebuffer is also connected to it. - kr = IOConnectAddClient( xfIOKitInputConnect, fbService ); - kern_assert( kr ); - - // We have to have added at least one screen - // before we can enable the cursor. - kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE); - kern_assert( kr ); - - return TRUE; -} - - -/* - * XFIOKitAddScreen - * IOKit specific initialization for each screen. - */ -Bool XFIOKitAddScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - XFIOKitScreenPtr iokitScreen; - - // allocate space for private per screen storage - iokitScreen = xalloc(sizeof(XFIOKitScreenRec)); - XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen; - - // setup hardware framebuffer - iokitScreen->fbService = 0; - if (! SetupFBandHID(index, dfb, iokitScreen)) { - if (iokitScreen->fbService) { - IOServiceClose(iokitScreen->fbService); - } - return FALSE; - } - - return TRUE; -} - - -/* - * XFIOKitSetupScreen - * Finalize IOKit specific initialization of each screen. - */ -Bool XFIOKitSetupScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - pthread_t pmThread; - - // initalize cursor support - if (! XFIOKitInitCursor(pScreen)) { - return FALSE; - } - - // initialize colormap handling as needed - if (dfb->colorType == PseudoColor) { - pScreen->StoreColors = XFIOKitStoreColors; - } - - // initialize power manager handling - pthread_create( &pmThread, NULL, XFIOKitPMThread, - (void *) pScreen ); - - return TRUE; -} - - -/* - * XFIOKitInitOutput - * One-time initialization of IOKit output support. - */ -void XFIOKitInitOutput( - int argc, - char **argv) -{ - static unsigned long generation = 0; - kern_return_t kr; - io_iterator_t iter; - io_service_t service; - vm_address_t shmem; - vm_size_t shmemSize; - - ErrorF("Display mode: IOKit\n"); - - // Allocate private storage for each screen's IOKit specific info - if (generation != serverGeneration) { - xfIOKitScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - kr = IOMasterPort(bootstrap_port, &masterPort); - kern_assert( kr ); - - // Find and open the HID System Service - // Do this now to be sure the Mac OS X window server is not running. - kr = IOServiceGetMatchingServices( masterPort, - IOServiceMatching( kIOHIDSystemClass ), - &iter ); - kern_assert( kr ); - - assert( service = IOIteratorNext( iter ) ); - - kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType, - &xfIOKitInputConnect ); - if (kr != KERN_SUCCESS) { - ErrorF("Failed to connect to the HID System as the window server!\n"); -#ifdef DARWIN_WITH_QUARTZ - FatalError("Quit the Mac OS X window server or use the -quartz option.\n"); -#else - FatalError("Make sure you have quit the Mac OS X window server.\n"); -#endif - } - - IOObjectRelease( service ); - IOObjectRelease( iter ); - - // Setup the event queue in memory shared by the kernel and X server - kr = IOHIDCreateSharedMemory( xfIOKitInputConnect, - kIOHIDCurrentShmemVersion ); - kern_assert( kr ); - - kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory, - mach_task_self(), &shmem, &shmemSize, - kIOMapAnywhere ); - kern_assert( kr ); - - evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset); - - assert(sizeof(EvGlobals) == evg->structSize); - - NotificationPortRef = IONotificationPortCreate( masterPort ); - - notificationPort = IONotificationPortGetMachPort(NotificationPortRef); - - kr = IOConnectSetNotificationPort( xfIOKitInputConnect, - kIOHIDEventNotification, - notificationPort, 0 ); - kern_assert( kr ); - - evg->movedMask |= NX_MOUSEMOVEDMASK; - - // find number of framebuffers - kr = IOServiceGetMatchingServices( masterPort, - IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ), - &fbIter ); - kern_assert( kr ); - - darwinScreensFound = 0; - while ((service = IOIteratorNext(fbIter))) { - IOObjectRelease( service ); - darwinScreensFound++; - } - IOIteratorReset(fbIter); -} - - -/* - * XFIOKitInitInput - * One-time initialization of IOKit input support. - */ -void XFIOKitInitInput( - int argc, - char **argv) -{ - kern_return_t kr; - int fd[2]; - - kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE); - kern_assert( kr ); - - // Start event passing thread - assert( pipe(fd) == 0 ); - darwinEventFD = fd[0]; - fcntl(darwinEventFD, F_SETFL, O_NONBLOCK); - pthread_create(&inputThread, NULL, - XFIOKitHIDThread, (void *) fd[1]); - -} Index: xc/programs/Xserver/hw/darwin/xfIOKit.h diff -u xc/programs/Xserver/hw/darwin/xfIOKit.h:1.9 xc/programs/Xserver/hw/darwin/xfIOKit.h:removed --- xc/programs/Xserver/hw/darwin/xfIOKit.h:1.9 Sun Dec 15 01:10:15 2002 +++ xc/programs/Xserver/hw/darwin/xfIOKit.h Sat Feb 28 21:42:11 2004 @@ -1,61 +0,0 @@ -/* - xfIOKit.h - - IOKit specific functions and definitions -*/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.h,v 1.9 2002/12/15 06:10:15 torrey Exp $ */ - -#ifndef _XFIOKIT_H -#define _XFIOKIT_H - -#include -#include -#include "X11/Xproto.h" -#include "screenint.h" -#include "darwin.h" - -typedef struct { - io_connect_t fbService; - StdFBShmem_t *cursorShmem; -} XFIOKitScreenRec, *XFIOKitScreenPtr; - -#define XFIOKIT_SCREEN_PRIV(pScreen) \ - ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr) - -extern int xfIOKitScreenIndex; // index into pScreen.devPrivates -extern io_connect_t xfIOKitInputConnect; - -Bool XFIOKitAddScreen(int index, ScreenPtr pScreen); -Bool XFIOKitSetupScreen(int index, ScreenPtr pScreen); -Bool XFIOKitInitCursor(ScreenPtr pScreen); -void XFIOKitInitOutput(int argc, char **argv); -void XFIOKitInitInput(int argc, char **argv); -void XFIOKitGiveUp(void); -void XFIOKitBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class); - -#endif /* _XFIOKIT_H */ Index: xc/programs/Xserver/hw/darwin/xfIOKitCursor.c diff -u xc/programs/Xserver/hw/darwin/xfIOKitCursor.c:1.6 xc/programs/Xserver/hw/darwin/xfIOKitCursor.c:removed --- xc/programs/Xserver/hw/darwin/xfIOKitCursor.c:1.6 Mon Dec 9 19:00:39 2002 +++ xc/programs/Xserver/hw/darwin/xfIOKitCursor.c Sat Feb 28 21:42:11 2004 @@ -1,735 +0,0 @@ -/************************************************************** - * - * Cursor support for Darwin X Server - * - * Three different cursor modes are possible: - * X (0) - tracking via Darwin kernel, - * display via X machine independent - * Kernel (1) - tracking and display via Darwin kernel - * (not currently supported) - * Hardware (2) - tracking and display via hardware - * - * The X software cursor uses the Darwin software cursor - * routines in IOFramebuffer.cpp to track the cursor, but - * displays the cursor image using the X machine - * independent display cursor routines in midispcur.c. - * - * The kernel cursor uses IOFramebuffer.cpp routines to - * track and display the cursor. This gives better - * performance as the display calls don't have to cross - * the kernel boundary. Unfortunately, this mode has - * synchronization issues with the user land X server - * and isn't currently used. - * - * Hardware cursor support lets the hardware handle these - * details. - * - * Kernel and hardware cursor mode only work for cursors - * up to a certain size, currently 16x16 pixels. If a - * bigger cursor is set, we fallback to X cursor mode. - * - * HISTORY: - * 1.0 by Torrey T. Lyons, October 30, 2000 - * - **************************************************************/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKitCursor.c,v 1.6 2002/12/10 00:00:39 torrey Exp $ */ - -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "micmap.h" -#define NO_CFPLUGIN -#include -#include -#include "darwin.h" -#include "xfIOKit.h" - -#define DUMP_DARWIN_CURSOR FALSE - -#define CURSOR_PRIV(pScreen) \ - ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) - -// The cursors format are documented in IOFramebufferShared.h. -#define RGBto34WithGamma(red, green, blue) \ - ( 0x000F \ - | (((red) & 0xF) << 12) \ - | (((green) & 0xF) << 8) \ - | (((blue) & 0xF) << 4) ) -#define RGBto38WithGamma(red, green, blue) \ - ( 0xFF << 24 \ - | (((red) & 0xFF) << 16) \ - | (((green) & 0xFF) << 8) \ - | (((blue) & 0xFF)) ) -#define HighBitOf32 0x80000000 - -typedef struct { - Bool canHWCursor; - short cursorMode; - RecolorCursorProcPtr RecolorCursor; - InstallColormapProcPtr InstallColormap; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; - ColormapPtr pInstalledMap; -} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr; - -static int darwinCursorScreenIndex = -1; -static unsigned long darwinCursorGeneration = 0; - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - Realizing the Darwin hardware cursor (ie. converting from the - X representation to the IOKit representation) is complicated - by the fact that we have three different potential cursor - formats to go to, one for each bit depth (8, 15, or 24). - The IOKit formats are documented in IOFramebufferShared.h. - X cursors are represented as two pieces, a source and a mask. - The mask is a bitmap indicating which parts of the cursor are - transparent and which parts are drawn. The source is a bitmap - indicating which parts of the non-transparent portion of the the - cursor should be painted in the foreground color and which should - be painted in the background color. The bitmaps are given in - 32-bit format with least significant byte and bit first. - (This is opposite PowerPC Darwin.) -*/ - -typedef struct { - unsigned char image[CURSORWIDTH*CURSORHEIGHT]; - unsigned char mask[CURSORWIDTH*CURSORHEIGHT]; -} cursorPrivRec, *cursorPrivPtr; - -/* - * XFIOKitRealizeCursor8 - * Convert the X cursor representation to an 8-bit depth - * format for Darwin. This function assumes the maximum cursor - * width is a multiple of 8. - */ -static Bool -XFIOKitRealizeCursor8( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - cursorPrivPtr newCursor; - unsigned char *newSourceP, *newMaskP; - CARD32 *oldSourceP, *oldMaskP; - xColorItem fgColor, bgColor; - int index, x, y, rowPad; - int cursorWidth, cursorHeight; - ColormapPtr pmap; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // get cursor colors in colormap - index = pScreen->myNum; - pmap = miInstalledMaps[index]; - if (!pmap) return FALSE; - - fgColor.red = pCursor->foreRed; - fgColor.green = pCursor->foreGreen; - fgColor.blue = pCursor->foreBlue; - FakeAllocColor(pmap, &fgColor); - bgColor.red = pCursor->backRed; - bgColor.green = pCursor->backGreen; - bgColor.blue = pCursor->backBlue; - FakeAllocColor(pmap, &bgColor); - FakeFreeColor(pmap, fgColor.pixel); - FakeFreeColor(pmap, bgColor.pixel); - - // allocate memory for new cursor image - newCursor = xalloc( sizeof(cursorPrivRec) ); - if (!newCursor) - return FALSE; - memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT ); - memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT ); - - // convert to 8-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor->image; - newMaskP = newCursor->mask; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgColor.pixel; - else - *newSourceP = bgColor.pixel; - if (*oldMaskP & (HighBitOf32 >> x)) - *newMaskP = 255; - else - *newSourceP = pScreen->blackPixel; - newSourceP++; newMaskP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; newMaskP += rowPad; - } - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor15 - * Convert the X cursor representation to an 15-bit depth - * format for Darwin. - */ -static Bool -XFIOKitRealizeCursor15( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - unsigned short *newCursor; - unsigned short fgPixel, bgPixel; - unsigned short *newSourceP; - CARD32 *oldSourceP, *oldMaskP; - int x, y, rowPad; - int cursorWidth, cursorHeight; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // allocate memory for new cursor image - newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); - if (!newCursor) - return FALSE; - memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); - - // calculate pixel values - fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue ); - bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen, - pCursor->backBlue ); - - // convert to 15-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldMaskP & (HighBitOf32 >> x)) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgPixel; - else - *newSourceP = bgPixel; - } else { - *newSourceP = 0; - } - newSourceP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; - } - -#if DUMP_DARWIN_CURSOR - // Write out the cursor - ErrorF("Cursor: 0x%x\n", pCursor); - ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, - cursorHeight, rowPad); - for (y = 0; y < cursorHeight; y++) { - newSourceP = newCursor + y*CURSORWIDTH; - for (x = 0; x < cursorWidth; x++) { - if (*newSourceP == fgPixel) - ErrorF("x"); - else if (*newSourceP == bgPixel) - ErrorF("o"); - else - ErrorF(" "); - newSourceP++; - } - ErrorF("\n"); - } -#endif - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor24 - * Convert the X cursor representation to an 24-bit depth - * format for Darwin. This function assumes the maximum cursor - * width is a multiple of 8. - */ -static Bool -XFIOKitRealizeCursor24( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - unsigned int *newCursor; - unsigned int fgPixel, bgPixel; - unsigned int *newSourceP; - CARD32 *oldSourceP, *oldMaskP; - int x, y, rowPad; - int cursorWidth, cursorHeight; - - // check cursor size just to be sure - cursorWidth = pCursor->bits->width; - cursorHeight = pCursor->bits->height; - if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) - return FALSE; - - // allocate memory for new cursor image - newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); - if (!newCursor) - return FALSE; - memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); - - // calculate pixel values - fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue ); - bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen, - pCursor->backBlue ); - - // convert to 24-bit Darwin cursor format - oldSourceP = (CARD32 *) pCursor->bits->source; - oldMaskP = (CARD32 *) pCursor->bits->mask; - newSourceP = newCursor; - rowPad = CURSORWIDTH - cursorWidth; - - for (y = 0; y < cursorHeight; y++) { - for (x = 0; x < cursorWidth; x++) { - if (*oldMaskP & (HighBitOf32 >> x)) { - if (*oldSourceP & (HighBitOf32 >> x)) - *newSourceP = fgPixel; - else - *newSourceP = bgPixel; - } else { - *newSourceP = 0; - } - newSourceP++; - } - oldSourceP++; oldMaskP++; - newSourceP += rowPad; - } - -#if DUMP_DARWIN_CURSOR - // Write out the cursor - ErrorF("Cursor: 0x%x\n", pCursor); - ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, - cursorHeight, rowPad); - for (y = 0; y < cursorHeight; y++) { - newSourceP = newCursor + y*CURSORWIDTH; - for (x = 0; x < cursorWidth; x++) { - if (*newSourceP == fgPixel) - ErrorF("x"); - else if (*newSourceP == bgPixel) - ErrorF("o"); - else - ErrorF(" "); - newSourceP++; - } - ErrorF("\n"); - } -#endif - - // save the result - pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; - return TRUE; -} - - -/* - * XFIOKitRealizeCursor - * - */ -static Bool -XFIOKitRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - Bool result; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || - // FIXME: this condition is not needed after kernel cursor works - !ScreenPriv->canHWCursor) { - result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor); - } else if (dfb->bitsPerPixel == 8) { - result = XFIOKitRealizeCursor8(pScreen, pCursor); - } else if (dfb->bitsPerPixel == 16) { - result = XFIOKitRealizeCursor15(pScreen, pCursor); - } else { - result = XFIOKitRealizeCursor24(pScreen, pCursor); - } - - return result; -} - - -/* - * XFIOKitUnrealizeCursor - * - */ -static Bool -XFIOKitUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor) -{ - Bool result; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || - // FIXME: this condition is not needed after kernel cursor works - !ScreenPriv->canHWCursor) { - result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor); - } else { - xfree( pCursor->devPriv[pScreen->myNum] ); - result = TRUE; - } - - return result; -} - - -/* - * XFIOKitSetCursor - * Set the cursor sprite and position - * Use hardware cursor if possible - */ -static void -XFIOKitSetCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - int x, - int y) -{ - kern_return_t kr; - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - StdFBShmem_t *cshmem = iokitScreen->cursorShmem; - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // are we supposed to remove the cursor? - if (!pCursor) { - if (ScreenPriv->cursorMode == 0) - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - else { - if (!cshmem->cursorShow) { - cshmem->cursorShow++; - if (cshmem->hardwareCursorActive) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - kern_assert( kr ); - } - } - } - return; - } - - // can we use the kernel or hardware cursor? - if ((pCursor->bits->height <= CURSORHEIGHT) && - (pCursor->bits->width <= CURSORWIDTH) && - // FIXME: condition not needed when kernel cursor works - ScreenPriv->canHWCursor) { - - if (ScreenPriv->cursorMode == 0) // remove the X cursor - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - ScreenPriv->cursorMode = 1; // kernel cursor - - // change the cursor image in shared memory - if (dfb->bitsPerPixel == 8) { - cursorPrivPtr newCursor = - (cursorPrivPtr) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.bw8.image[0], newCursor->image, - CURSORWIDTH*CURSORHEIGHT); - memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask, - CURSORWIDTH*CURSORHEIGHT); - } else if (dfb->bitsPerPixel == 16) { - unsigned short *newCursor = - (unsigned short *) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.rgb.image[0], newCursor, - 2*CURSORWIDTH*CURSORHEIGHT); - } else { - unsigned int *newCursor = - (unsigned int *) pCursor->devPriv[pScreen->myNum]; - memcpy(cshmem->cursor.rgb24.image[0], newCursor, - 4*CURSORWIDTH*CURSORHEIGHT); - } - - // FIXME: We always use a full size cursor, even if the image - // is smaller because I couldn't get the padding to come out - // right otherwise. - cshmem->cursorSize[0].width = CURSORWIDTH; - cshmem->cursorSize[0].height = CURSORHEIGHT; - cshmem->hotSpot[0].x = pCursor->bits->xhot; - cshmem->hotSpot[0].y = pCursor->bits->yhot; - - // try to use a hardware cursor - if (ScreenPriv->canHWCursor) { - kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); - // FIXME: this is a fatal error without the kernel cursor - kern_assert( kr ); -#if 0 - if (kr != KERN_SUCCESS) { - ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } -#endif - } - - // make the new cursor visible - if (cshmem->cursorShow) - cshmem->cursorShow--; - - if (!cshmem->cursorShow && ScreenPriv->canHWCursor) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); - // FIXME: this is a fatal error without the kernel cursor - kern_assert( kr ); -#if 0 - if (kr != KERN_SUCCESS) { - ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } else -#endif - ScreenPriv->cursorMode = 2; // hardware cursor - } - - return; - } - - // otherwise we use a software cursor - if (ScreenPriv->cursorMode) { - /* remove the kernel or hardware cursor */ - XFIOKitSetCursor(pScreen, 0, x, y); - } - - ScreenPriv->cursorMode = 0; - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); -} - - -/* - * XFIOKitMoveCursor - * Move the cursor. This is a noop for a kernel or hardware cursor. - */ -static void -XFIOKitMoveCursor( - ScreenPtr pScreen, - int x, - int y) -{ - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // only the X cursor needs to be explicitly moved - if (!ScreenPriv->cursorMode) - (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -} - -static miPointerSpriteFuncRec darwinSpriteFuncsRec = { - XFIOKitRealizeCursor, - XFIOKitUnrealizeCursor, - XFIOKitSetCursor, - XFIOKitMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * XFIOKitCursorOffScreen - */ -static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ return FALSE; -} - - -/* - * XFIOKitCrossScreen - */ -static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering) -{ return; -} - - -/* - * XFIOKitWarpCursor - * Change the cursor position without generating an event or motion history - */ -static void -XFIOKitWarpCursor( - ScreenPtr pScreen, - int x, - int y) -{ - kern_return_t kr; - - kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y ); - if (kr != KERN_SUCCESS) { - ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr); - } - miPointerWarpCursor(pScreen, x, y); -} - -static miPointerScreenFuncRec darwinScreenFuncsRec = { - XFIOKitCursorOffScreen, - XFIOKitCrossScreen, - XFIOKitWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * XFIOKitCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -XFIOKitCursorQueryBestSize( - int class, - unsigned short *width, - unsigned short *height, - ScreenPtr pScreen) -{ - XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) { - *width = CURSORWIDTH; - *height = CURSORHEIGHT; - } else - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); -} - - -/* - * XFIOKitInitCursor - * Initialize cursor support - */ -Bool -XFIOKitInitCursor( - ScreenPtr pScreen) -{ - XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); - XFIOKitCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - kern_return_t kr; - - // start with no cursor displayed - if (!iokitScreen->cursorShmem->cursorShow++) { - if (iokitScreen->cursorShmem->hardwareCursorActive) { - kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - kern_assert( kr ); - } - } - - // initialize software cursor handling (always needed as backup) - if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) { - return FALSE; - } - - // allocate private storage for this screen's hardware cursor info - if (darwinCursorGeneration != serverGeneration) { - if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - darwinCursorGeneration = serverGeneration; - } - - ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) ); - if (!ScreenPriv) return FALSE; - - pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv; - - // check if a hardware cursor is supported - if (!iokitScreen->cursorShmem->hardwareCursorCapable) { - ScreenPriv->canHWCursor = FALSE; - ErrorF("Hardware cursor not supported.\n"); - } else { - // we need to make sure that the hardware cursor really works - ScreenPriv->canHWCursor = TRUE; - kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); - if (kr != KERN_SUCCESS) { - ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } - kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); - if (kr != KERN_SUCCESS) { - ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); - ScreenPriv->canHWCursor = FALSE; - } - IOFBSetCursorVisible(iokitScreen->fbService, FALSE); - } - - ScreenPriv->cursorMode = 0; - ScreenPriv->pInstalledMap = NULL; - - // override some screen procedures - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = XFIOKitCursorQueryBestSize; -// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor; -// pScreen->ConstrainCursor = XFIOKitConstrainCursor; - - // initialize hardware cursor handling - PointPriv = (miPointerScreenPtr) - pScreen->devPrivates[miPointerScreenIndex].ptr; - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &darwinSpriteFuncsRec; - - /* Other routines that might be overridden */ -/* - CursorLimitsProcPtr CursorLimits; - RecolorCursorProcPtr RecolorCursor; -*/ - - return TRUE; -} Index: xc/programs/Xserver/hw/darwin/xfIOKitStartup.c diff -u xc/programs/Xserver/hw/darwin/xfIOKitStartup.c:1.12 xc/programs/Xserver/hw/darwin/xfIOKitStartup.c:removed --- xc/programs/Xserver/hw/darwin/xfIOKitStartup.c:1.12 Tue Jan 14 21:34:04 2003 +++ xc/programs/Xserver/hw/darwin/xfIOKitStartup.c Sat Feb 28 21:42:11 2004 @@ -1,118 +0,0 @@ -/************************************************************** - * - * Startup code for the IOKit Darwin X Server - * - **************************************************************/ -/* - * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKitStartup.c,v 1.12 2003/01/15 02:34:04 torrey Exp $ */ - -#include "quartz/quartz.h" -#include "micmap.h" - -void GlxExtensionInit(void); -void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr); - - -/* - * DarwinHandleGUI - * This function is called first from main(). - * It does nothing for the IOKit X server. - */ -void DarwinHandleGUI( - int argc, - char *argv[], - char *envp[] ) -{ -} - - -/* - * DarwinGlxExtensionInit - * Initialize the GLX extension. - * Mesa is linked into the IOKit mode X server so we just call directly. - */ -void DarwinGlxExtensionInit(void) -{ - GlxExtensionInit(); -} - - -/* - * DarwinGlxWrapInitVisuals - */ -void DarwinGlxWrapInitVisuals( - miInitVisualsProcPtr *procPtr) -{ - GlxWrapInitVisuals(procPtr); -} - - -// The IOKit X server does not accept any Quartz command line options. -int QuartzProcessArgument( int argc, char *argv[], int i ) -{ - if (!strcmp( argv[i], "-fullscreen" ) || - !strcmp( argv[i], "-rootless" ) || - !strcmp( argv[i], "-quartz" )) - { - FatalError("Command line option %s is not available without Quartz " - "support.\nInstall the optional Xquartz.tgz tarball for " - "Quartz support.\n", argv[i]); - } - - return 0; -} - - -// No Quartz support. All Quartz functions are no-ops. - -Bool QuartzAddScreen(int index, ScreenPtr pScreen) { - FatalError("QuartzAddScreen called without Quartz support.\n"); -} - -Bool QuartzSetupScreen(int index, ScreenPtr pScreen) { - FatalError("QuartzInitCursor called without Quartz support.\n"); -} - -void QuartzInitOutput(int argc, char **argv) { - FatalError("QuartzInitOutput called without Quartz support.\n"); -} - -void QuartzInitInput(int argc, char **argv) { - FatalError("QuartzInitInput called without Quartz support.\n"); -} - -void QuartzGiveUp(void) { - return; // no message, we are quitting anyway -} - -void QuartzProcessEvent(xEvent *xe) { - FatalError("QuartzProcessEvent called without Quartz support.\n"); -} - -void QuartzBell(void) { - FatalError("QuartzBell called without Quartz support.\n"); -} Index: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf:1.4 xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf:1.6 --- xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf:1.4 Thu Jan 10 00:25:36 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/Credits.rtf Wed Feb 25 14:36:21 2004 @@ -1,124 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 +\vieww9000\viewh9000\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:02 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib Mon Dec 15 20:28:32 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf:1.8 xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf:1.11 --- xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf:1.8 Tue Jun 18 16:41:09 2002 +++ xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf Wed Feb 25 14:36:22 2004 @@ -1,138 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} +\vieww5160\viewh6300\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2.99.x: -\f1\b0 \ +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Fabr\'92cio Luis de Castro\ \f2\i Portuguese localization -\f1\i0 \ +\f0\i0 \ Michael Oland\ \f2\i New XDarwin icon -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings diff -u xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings:1.3 xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings:1.4 --- xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings:1.3 Wed Jan 30 01:50:46 2002 +++ xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings Tue Nov 4 17:48:14 2003 @@ -1,5 +1,5 @@ /* English localized versions of strings used by the Mac OS X front end. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.4 2003/11/04 22:48:14 torrey Exp $ */ /* Title of alert panel */ "Quit X server?" = "Quit X server?"; @@ -14,10 +14,10 @@ "Cancel" = "Cancel"; /* Default keymapping file */ -"USA.keymapping" = "USA.keymapping" +"USA.keymapping" = "USA.keymapping"; /* Default switch string */ -"Cmd-Opt-a" = "Cmd-Opt-a" +"Cmd-Opt-a" = "Cmd-Opt-a"; /* Button title when changing switch key */ -"Press key" = "Press key" +"Press key" = "Press key"; Index: xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib:1.11 xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib:1.13 --- xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib:1.11 Wed Jun 19 14:12:03 2002 +++ xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib Thu Oct 16 19:50:08 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf:1.5 xc/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf:1.7 --- xc/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf:1.5 Thu Jan 31 21:45:33 2002 +++ xc/programs/Xserver/hw/darwin/bundle/French.lproj/Credits.rtf Wed Feb 25 14:36:22 2004 @@ -1,123 +1,156 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} \vieww5160\viewh4480\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b\fs24 \cf0 Participants \'88 XonX pour XFree86 4.2 : -\f1\b0 \ +\f1\b \cf0 \ +Participants \'88 XonX pour XFree86 4.2 : +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Version pour Darwin x86 -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Traduction en espagnol -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Traduction en allemand -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Traduction en cor\'8een -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Claviers non-US -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Direction du projet -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Traduction en allemand -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Traduction en su\'8edois -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Version \'c7 rootless \'c8 -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Traduction en japonais -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i Traduction en fran\'8dais -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Remerciements : -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman et Zero G Software, Inc.\ \f2\i Installeur -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Participants \'88 XonX pour XFree86 4.2 : -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Version pour Darwin x86 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Direction du projet -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Version Cocoa de l'interface de XDarwin -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Impl\'8ementation initiale sur Quartz -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Librairies partag\'8ees dynamiquement -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Traduction en japonais -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Remerciements : -\f1\b0 \ +\f1\b \cf0 Remerciements : +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ Ic\'99ne \f2\i XDarwin -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Historique : -\f1\b0 \ +\f1\b \cf0 Historique : +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i Adaptation de Free86 4.0 pour Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:03 2002 +++ xc/programs/Xserver/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib Mon Dec 15 20:32:02 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf:1.4 xc/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf:1.6 --- xc/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf:1.4 Thu Jan 10 00:25:37 2002 +++ xc/programs/Xserver/hw/darwin/bundle/German.lproj/Credits.rtf Wed Feb 25 14:36:22 2004 @@ -1,124 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 +\vieww5160\viewh6300\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:03 2002 +++ xc/programs/Xserver/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib Mon Dec 15 20:40:44 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf:1.8 xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf:1.10 --- xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf:1.8 Fri May 3 21:25:40 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf Wed Feb 25 14:36:23 2004 @@ -1,135 +1,175 @@ -{\rtf1\mac\ansicpg10001\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; \f3\fnil\fcharset78 HiraKakuPro-W3;} {\colortbl;\red255\green255\blue255;} \vieww13980\viewh11160\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper +\f2\i \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f3\i0 \cf0 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'41\'83\'4e\'83\'5a\'83\'89\'83\'8c\'81\'5b\'83\'56\'83\'87\'83\'93 \'82\'a8\'82\'e6\'82\'d1 Apple-WM \'8a\'67\'92\'a3 +\f0 \ +Torrey T. Lyons\ + +\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f3 \'83\'7c\'83\'8b\'83\'67\'83\'4b\'83\'8b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 +\f0 \ +Michael Oland\ + +\f3 \'90\'56\'82\'b5\'82\'a2 +\f0 XDarwin +\f3 \'83\'41\'83\'43\'83\'52\'83\'93 +\f0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ Darwin x86 \f2\i \f3\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ +\f0 \ Pablo Di Noto\ \f2\i \f3\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Paul Edens\ \f2\i \f3\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Kyunghwan Kim\ \f2\i \f3\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Mario Klebsch\ \f3 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ +\f0 \ Torrey T. Lyons\ \f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b -\f1 \ +\f0 \ Andreas Monitzer\ \f3 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Patrik Montgomery\ \f2\i \f3\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Greg Parker\ \f3 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ +\f0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 -\f1 \ +\f3 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 +\f0 \ \f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ Olivier Verdier\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\i +\f2\i \cf0 \f3\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i \f3\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89 -\f1 \ +\f0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ Darwin x86 \f3 \'83\'54\'83\'7c\'81\'5b\'83\'67 -\f1 \ +\f0 \ Torrey T. Lyons\ \f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b -\f1 \ +\f0 \ Andreas Monitzer\ Cocoa \f3 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68 -\f1 \ +\f0 \ Greg Parker\ \f3 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67 -\f1 \ +\f0 \ Christoph Pfisterer\ \f3 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a -\f1 \ +\f0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 -\f1 \ +\f3 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5 +\f0 \ \f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59 -\f1 \ +\f0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ XDarwin \f3 \'83\'41\'83\'43\'83\'52\'83\'93 -\f1 \ +\f0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f3 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41 -\f1 \ +\f0 \ Dave Zarzycki\ XFree86 4.0 \f3 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41 -\f1 \ +\f0 \ Torrey T. Lyons\ XFree86 4.0.2 \f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib:1.10 xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib:1.11 --- xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib:1.10 Wed Jun 19 14:12:05 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib Tue Dec 16 12:01:36 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf:1.2 xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf:1.4 --- xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf:1.2 Thu Jan 31 21:59:35 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/Credits.rtf Wed Feb 25 14:36:23 2004 @@ -1,139 +1,161 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5340\viewh4520\viewkind0 +\vieww5140\viewh4980\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b\fs24 \cf0 Contribuidores do XonX ao XFree86 4.2.99.x: -\f1\b0 \ +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Contribuidores do XonX ao XFree86 4.3: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Fabr\'92cio Luis de Castro -\f0\b \ +\f1\b \ \f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\i0\b \cf0 \ +\f0\i0 Michael Oland\ + +\f2\i New XDarwin icon +\f1\i0\b \ +\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Contribuidores do XonX ao XFree86 4.2: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Suporte para o Darwin x86\ -\f1\i0 Pablo Di Noto\ +\f0\i0 Pablo Di Noto\ \f2\i Localiza\'8d\'8bo para o Espanhol -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Localiza\'8d\'8bo para o Holand\'90s -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Localiza\'8d\'8bo para o Coreano -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Suporte para teclados Non-US -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i L\'92der de Projeto -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Localiza\'8d\'8bo para o Alem\'8bo -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Localiza\'8d\'8bo para o Sueco -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Suporte ao modo Compartilhado (Rootless) -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Localiza\'8d\'8bo para o Japon\'90s -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Agradecimentos Especiais: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Instalador -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Membros do Time XonX\ Contribuindo com o XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Suporte ao Darwin x86\ -\f1\i0 Torrey T. Lyons\ +\f0\i0 Torrey T. Lyons\ \f2\i L\'92der de Projeto -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Vers\'8bo Cocoa da interface XDarwin -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Implementa\'8d\'8bo Original -\f1\i0 +\f0\i0 \f2\i ao Quartz \ -\f1\i0 Christoph Pfisterer\ +\f0\i0 Christoph Pfisterer\ \f2\i Bibliotecas Din\'89micas Compartilhadas -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Localiza\'8d\'8bo para o Japon\'90s -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Agradecimento Especial: -\f1\b0 \ +\f1\b \cf0 Agradecimento Especial: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i \'eacone do XDarwin -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Hist\'97rico: -\f1\b0 \ +\f1\b \cf0 Hist\'97rico: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Suporte Original do XFree86 no Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i Suporte ao -\f1\i0 +\f0\i0 \f2\i XFree86 4.0 no Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:05 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib Tue Dec 16 12:03:18 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf:1.4 xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf:1.6 --- xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf:1.4 Thu Jan 10 00:25:37 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/Credits.rtf Wed Feb 25 14:36:23 2004 @@ -1,124 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 +\vieww5160\viewh6300\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:06 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib Tue Dec 16 12:05:39 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf:1.4 xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf:1.6 --- xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf:1.4 Thu Jan 10 00:25:37 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/Credits.rtf Wed Feb 25 14:36:23 2004 @@ -1,124 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 +\vieww5160\viewh6300\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:06 2002 +++ xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib Tue Dec 16 12:07:56 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf diff -u xc/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf:1.4 xc/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf:1.6 --- xc/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf:1.4 Thu Jan 10 00:25:37 2002 +++ xc/programs/Xserver/hw/darwin/bundle/ko.lproj/Credits.rtf Wed Feb 25 14:36:24 2004 @@ -1,124 +1,158 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique; } {\colortbl;\red255\green255\blue255;} -\vieww5160\viewh4480\viewkind0 +\vieww5160\viewh6300\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f1\b \cf0 Contributors to XFree86 4.4: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Harper\ + +\f2\i Rootless acceleration and Apple-WM extension +\f0\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 Additional XonX Contributors to XFree86 4.3: +\f0\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Fabr\'92cio Luis de Castro\ + +\f2\i Portuguese localization +\f0\i0 \ +Michael Oland\ + +\f2\i New XDarwin icon +\f0\i0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2: -\f1\b0 \ +\f1\b \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc +\cf0 XonX Contributors to XFree86 4.2: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Pablo Di Noto\ \f2\i Spanish localization -\f1\i0 \ +\f0\i0 \ Paul Edens\ \f2\i Dutch localization -\f1\i0 \ +\f0\i0 \ Kyunghwan Kim\ \f2\i Korean localization -\f1\i0 \ +\f0\i0 \ Mario Klebsch\ \f2\i Non-US keyboard support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i German localization -\f1\i0 \ +\f0\i0 \ Patrik Montgomery\ \f2\i Swedish localization -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Rootless support -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ Olivier Verdier\ \f2\i French localization -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 Special Thanks: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Devin Poolman and Zero G Software, Inc.\ \f2\i Installer -\f1\i0 \ +\f0\i0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f0\b \cf0 \ +\f1\b \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 XonX Team Members\ Contributing to XFree86 4.1: -\f1\b0 \ +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Rob Braun\ \f2\i Darwin x86 support -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Project Lead -\f1\i0 \ +\f0\i0 \ Andreas Monitzer\ \f2\i Cocoa version of XDarwin front end -\f1\i0 \ +\f0\i0 \ Greg Parker\ \f2\i Original Quartz implementation -\f1\i0 \ +\f0\i0 \ Christoph Pfisterer\ \f2\i Dynamic shared libraries -\f1\i0 \ +\f0\i0 \ Toshimitsu Tanaka\ \f2\i Japanese localization -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 Special Thanks: -\f1\b0 \ +\f1\b \cf0 Special Thanks: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Tiago Ribeiro\ \f2\i XDarwin icon -\f1\i0 \ +\f0\i0 \ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\b \cf0 History: -\f1\b0 \ +\f1\b \cf0 History: +\f0\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 John Carmack\ \f2\i Original XFree86 port to Mac OS X Server -\f1\i0 \ +\f0\i0 \ Dave Zarzycki\ \f2\i XFree86 4.0 port to Darwin 1.0 -\f1\i0 \ +\f0\i0 \ Torrey T. Lyons\ \f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib diff -u xc/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib:1.3 xc/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib:1.4 --- xc/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib:1.3 Wed Jun 19 14:12:07 2002 +++ xc/programs/Xserver/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib Tue Dec 16 12:09:58 2003 @@ -41,14 +41,20 @@ }, { ACTIONS = { + bringAllToFront = id; closeHelpAndShow = id; + itemSelected = id; + nextWindow = id; + previousWindow = id; showAction = id; + showSwitchPanel = id; startFullScreen = id; startRootless = id; }; CLASS = XServer; LANGUAGE = ObjC; OUTLETS = { + dockMenu = NSMenu; helpWindow = NSWindow; modeWindow = NSWindow; startFullScreenButton = NSButton; @@ -56,6 +62,8 @@ startupHelpButton = NSButton; startupModeButton = NSButton; switchWindow = NSPanel; + windowMenu = NSMenu; + windowSeparator = NSMenuItem; }; SUPERCLASS = NSObject; } Index: xc/programs/Xserver/hw/darwin/iokit/Imakefile diff -u /dev/null xc/programs/Xserver/hw/darwin/iokit/Imakefile:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/iokit/Imakefile Wed May 14 01:27:55 2003 @@ -0,0 +1,25 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/iokit/Imakefile,v 1.1 2003/05/14 05:27:55 torrey Exp $ + +#include + +SRCS = xfIOKit.c \ + xfIOKitCursor.c \ + xfIOKitStartup.c + +OBJS = xfIOKit.o \ + xfIOKitCursor.o \ + xfIOKitStartup.o + +INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ + -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ + -I$(SERVERSRC)/miext/shadow -I.. + +#if DarwinQuartzSupport +DEFINES = -DDARWIN_WITH_QUARTZ +#endif + +NormalLibraryObjectRule() +NormalLibraryTarget(iokit,$(OBJS)) + +DependTarget() Index: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c diff -u /dev/null xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c:1.3 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c Mon Dec 8 23:42:36 2003 @@ -0,0 +1,769 @@ +/************************************************************** + * + * IOKit support for the Darwin X Server + * + * HISTORY: + * Original port to Mac OS X Server by John Carmack + * Port to Darwin 1.0 by Dave Zarzycki + * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons + * + **************************************************************/ +/* + * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.3 2003/12/09 04:42:36 torrey Exp $ */ + +#include "X.h" +#include "Xproto.h" +#include "os.h" +#include "servermd.h" +#include "inputstr.h" +#include "scrnintstr.h" +#include "mi.h" +#include "mibstore.h" +#include "mipointer.h" +#include "micmap.h" +#include "shadow.h" + +#include +#include +#include +#include +#include + +#include + +#define NO_CFPLUGIN +#include +#include +#include +#include + +// Define this to work around bugs in the display drivers for +// older PowerBook G3's. If the X server starts without this +// #define, you don't need it. +#undef OLD_POWERBOOK_G3 + +#include "darwin.h" +#include "xfIOKit.h" + +// Globals +int xfIOKitScreenIndex = 0; +io_connect_t xfIOKitInputConnect = 0; + +static pthread_t inputThread; +static EvGlobals * evg; +static mach_port_t masterPort; +static mach_port_t notificationPort; +static IONotificationPortRef NotificationPortRef; +static mach_port_t pmNotificationPort; +static io_iterator_t fbIter; + + +/* + * XFIOKitStoreColors + * This is a callback from X to change the hardware colormap + * when using PsuedoColor. + */ +static void XFIOKitStoreColors( + ColormapPtr pmap, + int numEntries, + xColorItem *pdefs) +{ + kern_return_t kr; + int i; + IOColorEntry *newColors; + ScreenPtr pScreen = pmap->pScreen; + XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); + + assert( newColors = (IOColorEntry *) + xalloc( numEntries*sizeof(IOColorEntry) )); + + // Convert xColorItem values to IOColorEntry + // assume the colormap is PsuedoColor + // as we do not support DirectColor + for (i = 0; i < numEntries; i++) { + newColors[i].index = pdefs[i].pixel; + newColors[i].red = pdefs[i].red; + newColors[i].green = pdefs[i].green; + newColors[i].blue = pdefs[i].blue; + } + + kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries, + kSetCLUTByValue, newColors ); + kern_assert( kr ); + + xfree( newColors ); +} + + +/* + * DarwinModeBell + * FIXME + */ +void DarwinModeBell( + int loud, + DeviceIntPtr pDevice, + pointer ctrl, + int fbclass) +{ +} + + +/* + * DarwinModeGiveUp + * Closes the connections to IOKit services + */ +void DarwinModeGiveUp( void ) +{ + int i; + + // we must close the HID System first + // because it is a client of the framebuffer + NXCloseEventStatus( darwinParamConnect ); + IOServiceClose( xfIOKitInputConnect ); + for (i = 0; i < screenInfo.numScreens; i++) { + XFIOKitScreenPtr iokitScreen = + XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]); + IOServiceClose( iokitScreen->fbService ); + } +} + + +/* + * ClearEvent + * Clear an event from the HID System event queue + */ +static void ClearEvent(NXEvent * ep) +{ + static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 }; + + *ep = nullEvent; + ep->data.compound.subType = ep->data.compound.misc.L[0] = + ep->data.compound.misc.L[1] = 0; +} + + +/* + * XFIOKitHIDThread + * Read the HID System event queue, translate it to an X event, + * and queue it for processing. + */ +static void *XFIOKitHIDThread(void *unused) +{ + for (;;) { + NXEQElement *oldHead; + mach_msg_return_t kr; + mach_msg_empty_rcv_t msg; + + kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, + sizeof(msg), notificationPort, 0, MACH_PORT_NULL); + kern_assert(kr); + + while (evg->LLEHead != evg->LLETail) { + NXEvent ev; + xEvent xe; + + // Extract the next event from the kernel queue + oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead]; + ev_lock(&oldHead->sema); + ev = oldHead->event; + ClearEvent(&oldHead->event); + evg->LLEHead = oldHead->next; + ev_unlock(&oldHead->sema); + + memset(&xe, 0, sizeof(xe)); + + // These fields should be filled in for every event + xe.u.keyButtonPointer.rootX = ev.location.x; + xe.u.keyButtonPointer.rootY = ev.location.y; + xe.u.keyButtonPointer.time = GetTimeInMillis(); + + switch( ev.type ) { + case NX_MOUSEMOVED: + xe.u.u.type = MotionNotify; + break; + + case NX_LMOUSEDOWN: + xe.u.u.type = ButtonPress; + xe.u.u.detail = 1; + break; + + case NX_LMOUSEUP: + xe.u.u.type = ButtonRelease; + xe.u.u.detail = 1; + break; + + // A newer kernel generates multi-button events with + // NX_SYSDEFINED. Button 2 isn't handled correctly by + // older kernels anyway. Just let NX_SYSDEFINED events + // handle these. +#if 0 + case NX_RMOUSEDOWN: + xe.u.u.type = ButtonPress; + xe.u.u.detail = 2; + break; + + case NX_RMOUSEUP: + xe.u.u.type = ButtonRelease; + xe.u.u.detail = 2; + break; +#endif + + case NX_KEYDOWN: + xe.u.u.type = KeyPress; + xe.u.u.detail = ev.data.key.keyCode; + break; + + case NX_KEYUP: + xe.u.u.type = KeyRelease; + xe.u.u.detail = ev.data.key.keyCode; + break; + + case NX_FLAGSCHANGED: + xe.u.u.type = kXDarwinUpdateModifiers; + xe.u.clientMessage.u.l.longs0 = ev.flags; + break; + + case NX_SYSDEFINED: + if (ev.data.compound.subType == 7) { + xe.u.u.type = kXDarwinUpdateButtons; + xe.u.clientMessage.u.l.longs0 = + ev.data.compound.misc.L[0]; + xe.u.clientMessage.u.l.longs1 = + ev.data.compound.misc.L[1]; + } else { + continue; + } + break; + + case NX_SCROLLWHEELMOVED: + xe.u.u.type = kXDarwinScrollWheel; + xe.u.clientMessage.u.s.shorts0 = + ev.data.scrollWheel.deltaAxis1; + break; + + default: + continue; + } + + DarwinEQEnqueue(&xe); + } + } + + return NULL; +} + + +/* + * XFIOKitPMThread + * Handle power state notifications + */ +static void *XFIOKitPMThread(void *arg) +{ + ScreenPtr pScreen = (ScreenPtr)arg; + XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); + + for (;;) { + mach_msg_return_t kr; + mach_msg_empty_rcv_t msg; + + kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, + sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL); + kern_assert(kr); + + // display is powering down + if (msg.header.msgh_id == 0) { + IOFBAcknowledgePM( iokitScreen->fbService ); + xf86SetRootClip(pScreen, FALSE); + } + // display just woke up + else if (msg.header.msgh_id == 1) { + xf86SetRootClip(pScreen, TRUE); + } + } + return NULL; +} + + +/* + * SetupFBandHID + * Setup an IOFramebuffer service and connect the HID system to it. + */ +static Bool SetupFBandHID( + int index, + DarwinFramebufferPtr dfb, + XFIOKitScreenPtr iokitScreen) +{ + kern_return_t kr; + io_service_t service; + io_connect_t fbService; + vm_address_t vram; + vm_size_t shmemSize; + int i; + UInt32 numModes; + IODisplayModeInformation modeInfo; + IODisplayModeID displayMode, *allModes; + IOIndex displayDepth; + IOFramebufferInformation fbInfo; + IOPixelInformation pixelInfo; + StdFBShmem_t *cshmem; + + // find and open the IOFrameBuffer service + service = IOIteratorNext(fbIter); + if (service == 0) + return FALSE; + + kr = IOServiceOpen( service, mach_task_self(), + kIOFBServerConnectType, &iokitScreen->fbService ); + IOObjectRelease( service ); + if (kr != KERN_SUCCESS) { + ErrorF("Failed to connect as window server to screen %i.\n", index); + return FALSE; + } + fbService = iokitScreen->fbService; + + // create the slice of shared memory containing cursor state data + kr = IOFBCreateSharedCursor( fbService, + kIOFBCurrentShmemVersion, + 32, 32 ); + if (kr != KERN_SUCCESS) + return FALSE; + + // Register for power management events for the framebuffer's device + kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort); + kern_assert(kr); + kr = IOConnectSetNotificationPort( fbService, 0, + pmNotificationPort, 0 ); + if (kr != KERN_SUCCESS) { + ErrorF("Power management registration failed.\n"); + } + + // SET THE SCREEN PARAMETERS + // get the current screen resolution, refresh rate and depth + kr = IOFBGetCurrentDisplayModeAndDepth( fbService, + &displayMode, + &displayDepth ); + if (kr != KERN_SUCCESS) + return FALSE; + + // use the current screen resolution if the user + // only wants to change the refresh rate + if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) { + kr = IOFBGetDisplayModeInformation( fbService, + displayMode, + &modeInfo ); + if (kr != KERN_SUCCESS) + return FALSE; + darwinDesiredWidth = modeInfo.nominalWidth; + darwinDesiredHeight = modeInfo.nominalHeight; + } + + // use the current resolution and refresh rate + // if the user doesn't have a preference + if (darwinDesiredWidth == 0) { + + // change the pixel depth if desired + if (darwinDesiredDepth != -1) { + kr = IOFBGetDisplayModeInformation( fbService, + displayMode, + &modeInfo ); + if (kr != KERN_SUCCESS) + return FALSE; + if (modeInfo.maxDepthIndex < darwinDesiredDepth) { + ErrorF("Discarding screen %i:\n", index); + ErrorF("Current screen resolution does not support desired pixel depth.\n"); + return FALSE; + } + + displayDepth = darwinDesiredDepth; + kr = IOFBSetDisplayModeAndDepth( fbService, displayMode, + displayDepth ); + if (kr != KERN_SUCCESS) + return FALSE; + } + + // look for display mode with correct resolution and refresh rate + } else { + + // get an array of all supported display modes + kr = IOFBGetDisplayModeCount( fbService, &numModes ); + if (kr != KERN_SUCCESS) + return FALSE; + assert(allModes = (IODisplayModeID *) + xalloc( numModes * sizeof(IODisplayModeID) )); + kr = IOFBGetDisplayModes( fbService, numModes, allModes ); + if (kr != KERN_SUCCESS) + return FALSE; + + for (i = 0; i < numModes; i++) { + kr = IOFBGetDisplayModeInformation( fbService, allModes[i], + &modeInfo ); + if (kr != KERN_SUCCESS) + return FALSE; + + if (modeInfo.flags & kDisplayModeValidFlag && + modeInfo.nominalWidth == darwinDesiredWidth && + modeInfo.nominalHeight == darwinDesiredHeight) { + + if (darwinDesiredDepth == -1) + darwinDesiredDepth = modeInfo.maxDepthIndex; + if (modeInfo.maxDepthIndex < darwinDesiredDepth) { + ErrorF("Discarding screen %i:\n", index); + ErrorF("Desired screen resolution does not support desired pixel depth.\n"); + return FALSE; + } + + if ((darwinDesiredRefresh == -1 || + (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) { + displayMode = allModes[i]; + displayDepth = darwinDesiredDepth; + kr = IOFBSetDisplayModeAndDepth(fbService, + displayMode, + displayDepth); + if (kr != KERN_SUCCESS) + return FALSE; + break; + } + } + } + + xfree( allModes ); + if (i >= numModes) { + ErrorF("Discarding screen %i:\n", index); + ErrorF("Desired screen resolution or refresh rate is not supported.\n"); + return FALSE; + } + } + + kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth, + kIOFBSystemAperture, &pixelInfo ); + if (kr != KERN_SUCCESS) + return FALSE; + +#ifdef __i386__ + /* x86 in 8bit mode currently needs fixed color map... */ + if( pixelInfo.bitsPerComponent == 8 ) { + pixelInfo.pixelType = kIOFixedCLUTPixels; + } +#endif + +#ifdef OLD_POWERBOOK_G3 + if (pixelInfo.pixelType == kIOCLUTPixels) + pixelInfo.pixelType = kIOFixedCLUTPixels; +#endif + + kr = IOFBGetFramebufferInformationForAperture( fbService, + kIOFBSystemAperture, + &fbInfo ); + if (kr != KERN_SUCCESS) + return FALSE; + + // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video + // outputs without a monitor connected to them. Since IOKit Xinerama + // does not really work, this often causes problems on PowerBooks. + // For now we explicitly check and ignore these screens. + if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) { + ErrorF("Discarding screen %i:\n", index); + ErrorF("Invalid width or height.\n"); + return FALSE; + } + + kr = IOConnectMapMemory( fbService, kIOFBCursorMemory, + mach_task_self(), (vm_address_t *) &cshmem, + &shmemSize, kIOMapAnywhere ); + if (kr != KERN_SUCCESS) + return FALSE; + iokitScreen->cursorShmem = cshmem; + + kr = IOConnectMapMemory( fbService, kIOFBSystemAperture, + mach_task_self(), &vram, &shmemSize, + kIOMapAnywhere ); + if (kr != KERN_SUCCESS) + return FALSE; + + iokitScreen->framebuffer = (void*)vram; + dfb->x = cshmem->screenBounds.minx; + dfb->y = cshmem->screenBounds.miny; + dfb->width = fbInfo.activeWidth; + dfb->height = fbInfo.activeHeight; + dfb->pitch = fbInfo.bytesPerRow; + dfb->bitsPerPixel = fbInfo.bitsPerPixel; + dfb->colorBitsPerPixel = pixelInfo.componentCount * + pixelInfo.bitsPerComponent; + dfb->bitsPerComponent = pixelInfo.bitsPerComponent; + + // allocate shadow framebuffer + iokitScreen->shadowPtr = xalloc(dfb->pitch * dfb->height); + dfb->framebuffer = iokitScreen->shadowPtr; + + // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor + if (pixelInfo.pixelType == kIORGBDirectPixels) { + dfb->colorType = TrueColor; + } else if (pixelInfo.pixelType == kIOCLUTPixels) { + dfb->colorType = PseudoColor; + } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) { + dfb->colorType = StaticColor; + } + + // Inform the HID system that the framebuffer is also connected to it. + kr = IOConnectAddClient( xfIOKitInputConnect, fbService ); + kern_assert( kr ); + + // We have to have added at least one screen + // before we can enable the cursor. + kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE); + kern_assert( kr ); + + return TRUE; +} + + +/* + * DarwinModeAddScreen + * IOKit specific initialization for each screen. + */ +Bool DarwinModeAddScreen( + int index, + ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + XFIOKitScreenPtr iokitScreen; + + // allocate space for private per screen storage + iokitScreen = xalloc(sizeof(XFIOKitScreenRec)); + XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen; + + // setup hardware framebuffer + iokitScreen->fbService = 0; + if (! SetupFBandHID(index, dfb, iokitScreen)) { + if (iokitScreen->fbService) { + IOServiceClose(iokitScreen->fbService); + } + return FALSE; + } + + return TRUE; +} + + +/* + * XFIOKitShadowUpdate + * Update the damaged regions of the shadow framebuffer on the screen. + */ +static void XFIOKitShadowUpdate(ScreenPtr pScreen, + shadowBufPtr pBuf) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); + RegionPtr damage = &pBuf->damage; + int numBox = REGION_NUM_RECTS(damage); + BoxPtr pBox = REGION_RECTS(damage); + int pitch = dfb->pitch; + int bpp = dfb->bitsPerPixel/8; + + // Loop through all the damaged boxes + while (numBox--) { + int width, height, offset; + unsigned char *src, *dst; + + width = (pBox->x2 - pBox->x1) * bpp; + height = pBox->y2 - pBox->y1; + offset = (pBox->y1 * pitch) + (pBox->x1 * bpp); + src = iokitScreen->shadowPtr + offset; + dst = iokitScreen->framebuffer + offset; + + while (height--) { + memcpy(dst, src, width); + dst += pitch; + src += pitch; + } + + // Get the next box + pBox++; + } +} + + +/* + * DarwinModeSetupScreen + * Finalize IOKit specific initialization of each screen. + */ +Bool DarwinModeSetupScreen( + int index, + ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + pthread_t pmThread; + + // initalize cursor support + if (! XFIOKitInitCursor(pScreen)) { + return FALSE; + } + + // initialize shadow framebuffer support + if (! shadowInit(pScreen, XFIOKitShadowUpdate, NULL)) { + ErrorF("Failed to initalize shadow framebuffer for screen %i.\n", + index); + return FALSE; + } + + // initialize colormap handling as needed + if (dfb->colorType == PseudoColor) { + pScreen->StoreColors = XFIOKitStoreColors; + } + + // initialize power manager handling + pthread_create( &pmThread, NULL, XFIOKitPMThread, + (void *) pScreen ); + + return TRUE; +} + + +/* + * DarwinModeInitOutput + * One-time initialization of IOKit output support. + */ +void DarwinModeInitOutput( + int argc, + char **argv) +{ + static unsigned long generation = 0; + kern_return_t kr; + io_iterator_t iter; + io_service_t service; + vm_address_t shmem; + vm_size_t shmemSize; + + ErrorF("Display mode: IOKit\n"); + + // Allocate private storage for each screen's IOKit specific info + if (generation != serverGeneration) { + xfIOKitScreenIndex = AllocateScreenPrivateIndex(); + generation = serverGeneration; + } + + kr = IOMasterPort(bootstrap_port, &masterPort); + kern_assert( kr ); + + // Find and open the HID System Service + // Do this now to be sure the Mac OS X window server is not running. + kr = IOServiceGetMatchingServices( masterPort, + IOServiceMatching( kIOHIDSystemClass ), + &iter ); + kern_assert( kr ); + + assert( service = IOIteratorNext( iter ) ); + + kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType, + &xfIOKitInputConnect ); + if (kr != KERN_SUCCESS) { + ErrorF("Failed to connect to the HID System as the window server!\n"); +#ifdef DARWIN_WITH_QUARTZ + FatalError("Quit the Mac OS X window server or use the -quartz option.\n"); +#else + FatalError("Make sure you have quit the Mac OS X window server.\n"); +#endif + } + + IOObjectRelease( service ); + IOObjectRelease( iter ); + + // Setup the event queue in memory shared by the kernel and X server + kr = IOHIDCreateSharedMemory( xfIOKitInputConnect, + kIOHIDCurrentShmemVersion ); + kern_assert( kr ); + + kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory, + mach_task_self(), &shmem, &shmemSize, + kIOMapAnywhere ); + kern_assert( kr ); + + evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset); + + assert(sizeof(EvGlobals) == evg->structSize); + + NotificationPortRef = IONotificationPortCreate( masterPort ); + + notificationPort = IONotificationPortGetMachPort(NotificationPortRef); + + kr = IOConnectSetNotificationPort( xfIOKitInputConnect, + kIOHIDEventNotification, + notificationPort, 0 ); + kern_assert( kr ); + + evg->movedMask |= NX_MOUSEMOVEDMASK; + + // find number of framebuffers + kr = IOServiceGetMatchingServices( masterPort, + IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ), + &fbIter ); + kern_assert( kr ); + + darwinScreensFound = 0; + while ((service = IOIteratorNext(fbIter))) { + IOObjectRelease( service ); + darwinScreensFound++; + } + IOIteratorReset(fbIter); +} + + +/* + * DarwinModeInitInput + * One-time initialization of IOKit input support. + */ +void DarwinModeInitInput( + int argc, + char **argv) +{ + kern_return_t kr; + int fd[2]; + + kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE); + kern_assert( kr ); + + // Start event passing thread + assert( pipe(fd) == 0 ); + darwinEventReadFD = fd[0]; + darwinEventWriteFD = fd[1]; + fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK); + pthread_create(&inputThread, NULL, + XFIOKitHIDThread, NULL); + +} + + +/* + * DarwinModeProcessEvent + * Process IOKit specific events. + */ +void DarwinModeProcessEvent( + xEvent *xe) +{ + // No mode specific events + ErrorF("Unknown X event caught: %d\n", xe->u.u.type); +} Index: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.h diff -u /dev/null xc/programs/Xserver/hw/darwin/iokit/xfIOKit.h:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/iokit/xfIOKit.h Wed May 14 01:27:56 2003 @@ -0,0 +1,57 @@ +/* + xfIOKit.h + + IOKit specific functions and definitions +*/ +/* + * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.h,v 1.1 2003/05/14 05:27:56 torrey Exp $ */ + +#ifndef _XFIOKIT_H +#define _XFIOKIT_H + +#include +#include +#include "X11/Xproto.h" +#include "screenint.h" +#include "darwin.h" + +typedef struct { + io_connect_t fbService; + StdFBShmem_t *cursorShmem; + unsigned char *framebuffer; + unsigned char *shadowPtr; +} XFIOKitScreenRec, *XFIOKitScreenPtr; + +#define XFIOKIT_SCREEN_PRIV(pScreen) \ + ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr) + +extern int xfIOKitScreenIndex; // index into pScreen.devPrivates +extern io_connect_t xfIOKitInputConnect; + +Bool XFIOKitInitCursor(ScreenPtr pScreen); + +#endif /* _XFIOKIT_H */ Index: xc/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c diff -u /dev/null xc/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c Wed May 14 01:27:56 2003 @@ -0,0 +1,735 @@ +/************************************************************** + * + * Cursor support for Darwin X Server + * + * Three different cursor modes are possible: + * X (0) - tracking via Darwin kernel, + * display via X machine independent + * Kernel (1) - tracking and display via Darwin kernel + * (not currently supported) + * Hardware (2) - tracking and display via hardware + * + * The X software cursor uses the Darwin software cursor + * routines in IOFramebuffer.cpp to track the cursor, but + * displays the cursor image using the X machine + * independent display cursor routines in midispcur.c. + * + * The kernel cursor uses IOFramebuffer.cpp routines to + * track and display the cursor. This gives better + * performance as the display calls don't have to cross + * the kernel boundary. Unfortunately, this mode has + * synchronization issues with the user land X server + * and isn't currently used. + * + * Hardware cursor support lets the hardware handle these + * details. + * + * Kernel and hardware cursor mode only work for cursors + * up to a certain size, currently 16x16 pixels. If a + * bigger cursor is set, we fallback to X cursor mode. + * + * HISTORY: + * 1.0 by Torrey T. Lyons, October 30, 2000 + * + **************************************************************/ +/* + * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c,v 1.1 2003/05/14 05:27:56 torrey Exp $ */ + +#include "scrnintstr.h" +#include "cursorstr.h" +#include "mipointrst.h" +#include "micmap.h" +#define NO_CFPLUGIN +#include +#include +#include "darwin.h" +#include "xfIOKit.h" + +#define DUMP_DARWIN_CURSOR FALSE + +#define CURSOR_PRIV(pScreen) \ + ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) + +// The cursors format are documented in IOFramebufferShared.h. +#define RGBto34WithGamma(red, green, blue) \ + ( 0x000F \ + | (((red) & 0xF) << 12) \ + | (((green) & 0xF) << 8) \ + | (((blue) & 0xF) << 4) ) +#define RGBto38WithGamma(red, green, blue) \ + ( 0xFF << 24 \ + | (((red) & 0xFF) << 16) \ + | (((green) & 0xFF) << 8) \ + | (((blue) & 0xFF)) ) +#define HighBitOf32 0x80000000 + +typedef struct { + Bool canHWCursor; + short cursorMode; + RecolorCursorProcPtr RecolorCursor; + InstallColormapProcPtr InstallColormap; + QueryBestSizeProcPtr QueryBestSize; + miPointerSpriteFuncPtr spriteFuncs; + ColormapPtr pInstalledMap; +} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr; + +static int darwinCursorScreenIndex = -1; +static unsigned long darwinCursorGeneration = 0; + +/* +=========================================================================== + + Pointer sprite functions + +=========================================================================== +*/ + +/* + Realizing the Darwin hardware cursor (ie. converting from the + X representation to the IOKit representation) is complicated + by the fact that we have three different potential cursor + formats to go to, one for each bit depth (8, 15, or 24). + The IOKit formats are documented in IOFramebufferShared.h. + X cursors are represented as two pieces, a source and a mask. + The mask is a bitmap indicating which parts of the cursor are + transparent and which parts are drawn. The source is a bitmap + indicating which parts of the non-transparent portion of the the + cursor should be painted in the foreground color and which should + be painted in the background color. The bitmaps are given in + 32-bit format with least significant byte and bit first. + (This is opposite PowerPC Darwin.) +*/ + +typedef struct { + unsigned char image[CURSORWIDTH*CURSORHEIGHT]; + unsigned char mask[CURSORWIDTH*CURSORHEIGHT]; +} cursorPrivRec, *cursorPrivPtr; + +/* + * XFIOKitRealizeCursor8 + * Convert the X cursor representation to an 8-bit depth + * format for Darwin. This function assumes the maximum cursor + * width is a multiple of 8. + */ +static Bool +XFIOKitRealizeCursor8( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + cursorPrivPtr newCursor; + unsigned char *newSourceP, *newMaskP; + CARD32 *oldSourceP, *oldMaskP; + xColorItem fgColor, bgColor; + int index, x, y, rowPad; + int cursorWidth, cursorHeight; + ColormapPtr pmap; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // get cursor colors in colormap + index = pScreen->myNum; + pmap = miInstalledMaps[index]; + if (!pmap) return FALSE; + + fgColor.red = pCursor->foreRed; + fgColor.green = pCursor->foreGreen; + fgColor.blue = pCursor->foreBlue; + FakeAllocColor(pmap, &fgColor); + bgColor.red = pCursor->backRed; + bgColor.green = pCursor->backGreen; + bgColor.blue = pCursor->backBlue; + FakeAllocColor(pmap, &bgColor); + FakeFreeColor(pmap, fgColor.pixel); + FakeFreeColor(pmap, bgColor.pixel); + + // allocate memory for new cursor image + newCursor = xalloc( sizeof(cursorPrivRec) ); + if (!newCursor) + return FALSE; + memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT ); + memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT ); + + // convert to 8-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor->image; + newMaskP = newCursor->mask; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgColor.pixel; + else + *newSourceP = bgColor.pixel; + if (*oldMaskP & (HighBitOf32 >> x)) + *newMaskP = 255; + else + *newSourceP = pScreen->blackPixel; + newSourceP++; newMaskP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; newMaskP += rowPad; + } + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * XFIOKitRealizeCursor15 + * Convert the X cursor representation to an 15-bit depth + * format for Darwin. + */ +static Bool +XFIOKitRealizeCursor15( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + unsigned short *newCursor; + unsigned short fgPixel, bgPixel; + unsigned short *newSourceP; + CARD32 *oldSourceP, *oldMaskP; + int x, y, rowPad; + int cursorWidth, cursorHeight; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // allocate memory for new cursor image + newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); + if (!newCursor) + return FALSE; + memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); + + // calculate pixel values + fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen, + pCursor->foreBlue ); + bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen, + pCursor->backBlue ); + + // convert to 15-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldMaskP & (HighBitOf32 >> x)) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgPixel; + else + *newSourceP = bgPixel; + } else { + *newSourceP = 0; + } + newSourceP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; + } + +#if DUMP_DARWIN_CURSOR + // Write out the cursor + ErrorF("Cursor: 0x%x\n", pCursor); + ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, + cursorHeight, rowPad); + for (y = 0; y < cursorHeight; y++) { + newSourceP = newCursor + y*CURSORWIDTH; + for (x = 0; x < cursorWidth; x++) { + if (*newSourceP == fgPixel) + ErrorF("x"); + else if (*newSourceP == bgPixel) + ErrorF("o"); + else + ErrorF(" "); + newSourceP++; + } + ErrorF("\n"); + } +#endif + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * XFIOKitRealizeCursor24 + * Convert the X cursor representation to an 24-bit depth + * format for Darwin. This function assumes the maximum cursor + * width is a multiple of 8. + */ +static Bool +XFIOKitRealizeCursor24( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + unsigned int *newCursor; + unsigned int fgPixel, bgPixel; + unsigned int *newSourceP; + CARD32 *oldSourceP, *oldMaskP; + int x, y, rowPad; + int cursorWidth, cursorHeight; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // allocate memory for new cursor image + newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); + if (!newCursor) + return FALSE; + memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); + + // calculate pixel values + fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen, + pCursor->foreBlue ); + bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen, + pCursor->backBlue ); + + // convert to 24-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldMaskP & (HighBitOf32 >> x)) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgPixel; + else + *newSourceP = bgPixel; + } else { + *newSourceP = 0; + } + newSourceP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; + } + +#if DUMP_DARWIN_CURSOR + // Write out the cursor + ErrorF("Cursor: 0x%x\n", pCursor); + ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, + cursorHeight, rowPad); + for (y = 0; y < cursorHeight; y++) { + newSourceP = newCursor + y*CURSORWIDTH; + for (x = 0; x < cursorWidth; x++) { + if (*newSourceP == fgPixel) + ErrorF("x"); + else if (*newSourceP == bgPixel) + ErrorF("o"); + else + ErrorF(" "); + newSourceP++; + } + ErrorF("\n"); + } +#endif + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * XFIOKitRealizeCursor + * + */ +static Bool +XFIOKitRealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + Bool result; + XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || + // FIXME: this condition is not needed after kernel cursor works + !ScreenPriv->canHWCursor) { + result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor); + } else if (dfb->bitsPerPixel == 8) { + result = XFIOKitRealizeCursor8(pScreen, pCursor); + } else if (dfb->bitsPerPixel == 16) { + result = XFIOKitRealizeCursor15(pScreen, pCursor); + } else { + result = XFIOKitRealizeCursor24(pScreen, pCursor); + } + + return result; +} + + +/* + * XFIOKitUnrealizeCursor + * + */ +static Bool +XFIOKitUnrealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + Bool result; + XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || + // FIXME: this condition is not needed after kernel cursor works + !ScreenPriv->canHWCursor) { + result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor); + } else { + xfree( pCursor->devPriv[pScreen->myNum] ); + result = TRUE; + } + + return result; +} + + +/* + * XFIOKitSetCursor + * Set the cursor sprite and position + * Use hardware cursor if possible + */ +static void +XFIOKitSetCursor( + ScreenPtr pScreen, + CursorPtr pCursor, + int x, + int y) +{ + kern_return_t kr; + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); + StdFBShmem_t *cshmem = iokitScreen->cursorShmem; + XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + // are we supposed to remove the cursor? + if (!pCursor) { + if (ScreenPriv->cursorMode == 0) + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + else { + if (!cshmem->cursorShow) { + cshmem->cursorShow++; + if (cshmem->hardwareCursorActive) { + kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); + kern_assert( kr ); + } + } + } + return; + } + + // can we use the kernel or hardware cursor? + if ((pCursor->bits->height <= CURSORHEIGHT) && + (pCursor->bits->width <= CURSORWIDTH) && + // FIXME: condition not needed when kernel cursor works + ScreenPriv->canHWCursor) { + + if (ScreenPriv->cursorMode == 0) // remove the X cursor + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + ScreenPriv->cursorMode = 1; // kernel cursor + + // change the cursor image in shared memory + if (dfb->bitsPerPixel == 8) { + cursorPrivPtr newCursor = + (cursorPrivPtr) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.bw8.image[0], newCursor->image, + CURSORWIDTH*CURSORHEIGHT); + memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask, + CURSORWIDTH*CURSORHEIGHT); + } else if (dfb->bitsPerPixel == 16) { + unsigned short *newCursor = + (unsigned short *) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.rgb.image[0], newCursor, + 2*CURSORWIDTH*CURSORHEIGHT); + } else { + unsigned int *newCursor = + (unsigned int *) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.rgb24.image[0], newCursor, + 4*CURSORWIDTH*CURSORHEIGHT); + } + + // FIXME: We always use a full size cursor, even if the image + // is smaller because I couldn't get the padding to come out + // right otherwise. + cshmem->cursorSize[0].width = CURSORWIDTH; + cshmem->cursorSize[0].height = CURSORHEIGHT; + cshmem->hotSpot[0].x = pCursor->bits->xhot; + cshmem->hotSpot[0].y = pCursor->bits->yhot; + + // try to use a hardware cursor + if (ScreenPriv->canHWCursor) { + kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); + // FIXME: this is a fatal error without the kernel cursor + kern_assert( kr ); +#if 0 + if (kr != KERN_SUCCESS) { + ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } +#endif + } + + // make the new cursor visible + if (cshmem->cursorShow) + cshmem->cursorShow--; + + if (!cshmem->cursorShow && ScreenPriv->canHWCursor) { + kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); + // FIXME: this is a fatal error without the kernel cursor + kern_assert( kr ); +#if 0 + if (kr != KERN_SUCCESS) { + ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } else +#endif + ScreenPriv->cursorMode = 2; // hardware cursor + } + + return; + } + + // otherwise we use a software cursor + if (ScreenPriv->cursorMode) { + /* remove the kernel or hardware cursor */ + XFIOKitSetCursor(pScreen, 0, x, y); + } + + ScreenPriv->cursorMode = 0; + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); +} + + +/* + * XFIOKitMoveCursor + * Move the cursor. This is a noop for a kernel or hardware cursor. + */ +static void +XFIOKitMoveCursor( + ScreenPtr pScreen, + int x, + int y) +{ + XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + // only the X cursor needs to be explicitly moved + if (!ScreenPriv->cursorMode) + (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); +} + +static miPointerSpriteFuncRec darwinSpriteFuncsRec = { + XFIOKitRealizeCursor, + XFIOKitUnrealizeCursor, + XFIOKitSetCursor, + XFIOKitMoveCursor +}; + + +/* +=========================================================================== + + Pointer screen functions + +=========================================================================== +*/ + +/* + * XFIOKitCursorOffScreen + */ +static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) +{ return FALSE; +} + + +/* + * XFIOKitCrossScreen + */ +static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering) +{ return; +} + + +/* + * XFIOKitWarpCursor + * Change the cursor position without generating an event or motion history + */ +static void +XFIOKitWarpCursor( + ScreenPtr pScreen, + int x, + int y) +{ + kern_return_t kr; + + kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y ); + if (kr != KERN_SUCCESS) { + ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr); + } + miPointerWarpCursor(pScreen, x, y); +} + +static miPointerScreenFuncRec darwinScreenFuncsRec = { + XFIOKitCursorOffScreen, + XFIOKitCrossScreen, + XFIOKitWarpCursor, + DarwinEQPointerPost, + DarwinEQSwitchScreen +}; + + +/* +=========================================================================== + + Other screen functions + +=========================================================================== +*/ + +/* + * XFIOKitCursorQueryBestSize + * Handle queries for best cursor size + */ +static void +XFIOKitCursorQueryBestSize( + int class, + unsigned short *width, + unsigned short *height, + ScreenPtr pScreen) +{ + XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if (class == CursorShape) { + *width = CURSORWIDTH; + *height = CURSORHEIGHT; + } else + (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); +} + + +/* + * XFIOKitInitCursor + * Initialize cursor support + */ +Bool +XFIOKitInitCursor( + ScreenPtr pScreen) +{ + XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen); + XFIOKitCursorScreenPtr ScreenPriv; + miPointerScreenPtr PointPriv; + kern_return_t kr; + + // start with no cursor displayed + if (!iokitScreen->cursorShmem->cursorShow++) { + if (iokitScreen->cursorShmem->hardwareCursorActive) { + kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE); + kern_assert( kr ); + } + } + + // initialize software cursor handling (always needed as backup) + if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) { + return FALSE; + } + + // allocate private storage for this screen's hardware cursor info + if (darwinCursorGeneration != serverGeneration) { + if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + darwinCursorGeneration = serverGeneration; + } + + ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) ); + if (!ScreenPriv) return FALSE; + + pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv; + + // check if a hardware cursor is supported + if (!iokitScreen->cursorShmem->hardwareCursorCapable) { + ScreenPriv->canHWCursor = FALSE; + ErrorF("Hardware cursor not supported.\n"); + } else { + // we need to make sure that the hardware cursor really works + ScreenPriv->canHWCursor = TRUE; + kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0); + if (kr != KERN_SUCCESS) { + ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } + kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE); + if (kr != KERN_SUCCESS) { + ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } + IOFBSetCursorVisible(iokitScreen->fbService, FALSE); + } + + ScreenPriv->cursorMode = 0; + ScreenPriv->pInstalledMap = NULL; + + // override some screen procedures + ScreenPriv->QueryBestSize = pScreen->QueryBestSize; + pScreen->QueryBestSize = XFIOKitCursorQueryBestSize; +// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor; +// pScreen->ConstrainCursor = XFIOKitConstrainCursor; + + // initialize hardware cursor handling + PointPriv = (miPointerScreenPtr) + pScreen->devPrivates[miPointerScreenIndex].ptr; + + ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &darwinSpriteFuncsRec; + + /* Other routines that might be overridden */ +/* + CursorLimitsProcPtr CursorLimits; + RecolorCursorProcPtr RecolorCursor; +*/ + + return TRUE; +} Index: xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c diff -u /dev/null xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c:1.2 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c Sat Nov 1 03:13:08 2003 @@ -0,0 +1,115 @@ +/************************************************************** + * + * Startup code for the IOKit Darwin X Server + * + **************************************************************/ +/* + * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c,v 1.2 2003/11/01 08:13:08 torrey Exp $ */ + +#include "darwin.h" +#include "darwinKeyboard.h" +#include "micmap.h" + +void GlxExtensionInit(void); +void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr); + + +/* + * DarwinHandleGUI + * This function is called first from main(). + * It does nothing for the IOKit X server. + */ +void DarwinHandleGUI( + int argc, + char *argv[], + char *envp[] ) +{ +} + + +/* + * DarwinGlxExtensionInit + * Initialize the GLX extension. + * Mesa is linked into the IOKit mode X server so we just call directly. + */ +void DarwinGlxExtensionInit(void) +{ + GlxExtensionInit(); +} + + +/* + * DarwinGlxWrapInitVisuals + */ +void DarwinGlxWrapInitVisuals( + miInitVisualsProcPtr *procPtr) +{ + GlxWrapInitVisuals(procPtr); +} + + +/* + * DarwinModeProcessArgument + * Process IOKit specific command line arguments. + */ +int DarwinModeProcessArgument( + int argc, + char *argv[], + int i) +{ +#ifdef DARWIN_WITH_QUARTZ + // XDarwinStartup uses these arguments to indicate which X server + // should be started. Ignore them here. + if (!strcmp( argv[i], "-fullscreen" ) || + !strcmp( argv[i], "-rootless" ) || + !strcmp( argv[i], "-quartz" )) + { + return 1; + } +#else + if (!strcmp( argv[i], "-fullscreen" ) || + !strcmp( argv[i], "-rootless" ) || + !strcmp( argv[i], "-quartz" )) + { + FatalError("Command line option %s is not available without Quartz " + "support.\n", argv[i]); + } +#endif + + return 0; +} + + +/* + * DarwinModeReadSystemKeymap + * IOKit has no alternative to NXKeyMapping API. + */ +Bool DarwinModeReadSystemKeymap( + darwinKeyboardInfo *info) +{ + return FALSE; +} Index: xc/programs/Xserver/hw/darwin/quartz/Imakefile diff -u xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.5 xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.13 --- xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.5 Wed Dec 4 20:07:40 2002 +++ xc/programs/Xserver/hw/darwin/quartz/Imakefile Tue Feb 10 17:51:23 2004 @@ -1,70 +1,71 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/Imakefile,v 1.5 2002/12/05 01:07:40 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/Imakefile,v 1.13 2004/02/10 22:51:23 torrey Exp $ #include +#define IHaveSubdirs SRCS = Preferences.m \ XApplication.m \ XServer.m \ - XView.m \ - aquaPicture.c \ - aquaWindow.c \ - fullscreen.c \ + applewm.c \ + keysym2ucs.c \ quartz.c \ quartzAudio.c \ quartzCocoa.m \ - quartzCursor.c \ quartzPasteboard.c \ - rootlessAquaGlue.c \ - rootlessAquaImp.m \ - rootlessCommon.c \ - rootlessGC.c \ - rootlessScreen.c \ - rootlessValTree.c \ - rootlessWindow.c \ + quartzKeyboard.c \ + quartzStartup.c \ pseudoramiX.c OBJS = Preferences.o \ XApplication.o \ XServer.o \ - XView.o \ - aquaPicture.o \ - aquaWindow.o \ - fullscreen.o \ + applewm.o \ + keysym2ucs.o \ quartz.o \ quartzAudio.o \ quartzCocoa.o \ - quartzCursor.o \ quartzPasteboard.o \ - rootlessAquaGlue.o \ - rootlessAquaImp.o \ - rootlessCommon.o \ - rootlessGC.o \ - rootlessScreen.o \ - rootlessValTree.o \ - rootlessWindow.o \ + quartzKeyboard.o \ + quartzStartup.o \ pseudoramiX.o INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I.. -I$(SERVERSRC)/Xext + -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ + -I.. -I$(APPLEWMLIBSRC) #if defined(XFree86CustomVersion) CUSTOMVERSION = XFree86CustomVersion CUSTOMVERDEF = -DXF86_CUSTOM_VERSION='$(CUSTOMVERSION)' #endif -#if HasCGMachPort -QUARTZDEFINES = -DHAS_CG_MACH_PORT -#endif #if XFree86Devel -PBXBUILDSTYLE = -buildstyle Development +BUILDSTYLE = -buildstyle Development DEBUGDEFINES = -DROOTLESSDEBUG #else -PBXBUILDSTYLE = -buildstyle Deployment +BUILDSTYLE = -buildstyle Deployment +#endif + +#if OSMajorVersion >= 7 +PROJ_TARGET = -project XDarwin.pbproj -target XDarwin +#else +PROJ_TARGET = -target XDarwin +#endif + +#if (OSMajorVersion == 1 && OSMinorVersion >= 4) || OSMajorVersion >= 5 +QUARTZDEFINES = -DHAS_CG_MACH_PORT +#endif + +#if HasXplugin +XPRDEFINES = -DBUILD_XPR +#endif + +#if OSMajorVersion >= 6 +KLDEFINES = -DHAS_KL_API #endif DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(BINDIR) -DXINITDIR=$(XINITDIR) \ - $(QUARTZDEFINES) $(DEBUGDEFINES) + $(QUARTZDEFINES) $(DEBUGDEFINES) $(XPRDEFINES) $(KLDEFINES) EXTRAMANDEFS = -D__XBinDir__=$(BINDIR) #if NothingOutsideProjectRoot XDARWINROOT = $(BINDIR) @@ -72,11 +73,15 @@ XDARWINROOT = /Applications #endif +#if HasXplugin +SUBDIRS = cr fullscreen xpr +#else +SUBDIRS = cr fullscreen +#endif + NormalLibraryObjectRule() NormalLibraryTarget(XQuartz,$(OBJS)) -AllTarget(quartzStartup.o) - AllTarget(XDarwinStartup) NormalProgramTarget(XDarwinStartup,XDarwinStartup.o, \ NullParameter,NullParameter, \ @@ -87,16 +92,18 @@ AllTarget(XDarwin) XDarwin: - pbxbuild -target XDarwin $(PBXBUILDSTYLE) + $(PROJ_BUILD) $(PROJ_TARGET) $(BUILDSTYLE) install:: - pbxbuild install -target XDarwin $(PBXBUILDSTYLE) \ + $(PROJ_BUILD) install $(PROJ_TARGET) $(BUILDSTYLE) \ DSTROOT=$(DESTDIR)$(XDARWINROOT) InstallManPage(XDarwinStartup,$(MANDIR)) clean:: - pbxbuild "clean" -target XDarwin $(PBXBUILDSTYLE) + $(PROJ_BUILD) "clean" $(PROJ_TARGET) $(BUILDSTYLE) DependTarget() +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) Index: xc/programs/Xserver/hw/darwin/quartz/Preferences.h diff -u xc/programs/Xserver/hw/darwin/quartz/Preferences.h:1.2 xc/programs/Xserver/hw/darwin/quartz/Preferences.h:1.3 --- xc/programs/Xserver/hw/darwin/quartz/Preferences.h:1.2 Tue Jan 14 21:34:05 2003 +++ xc/programs/Xserver/hw/darwin/quartz/Preferences.h Mon Sep 15 20:36:12 2003 @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */ +/* + * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.3 2003/09/16 00:36:12 torrey Exp $ */ #import @@ -35,14 +62,14 @@ - (IBAction)saveChanges:(id)sender; - (IBAction)setKey:(id)sender; -- (BOOL)sendEvent:(NSEvent*)anEvent; +- (BOOL)sendEvent:(NSEvent *)anEvent; - (void)awakeFromNib; - (void)windowWillClose:(NSNotification *)aNotification; + (void)setUseKeymapFile:(BOOL)newUseKeymapFile; -+ (void)setKeymapFile:(NSString*)newFile; -+ (void)setSwitchString:(NSString*)newString; ++ (void)setKeymapFile:(NSString *)newFile; ++ (void)setSwitchString:(NSString *)newString; + (void)setKeyCode:(int)newKeyCode; + (void)setModifiers:(int)newModifiers; + (void)setDisplay:(int)newDisplay; @@ -59,15 +86,16 @@ + (void)setSystemBeep:(BOOL)newSystemBeep; + (void)setXinerama:(BOOL)newXinerama; + (void)setAddToPath:(BOOL)newAddToPath; -+ (void)setAddToPathString:(NSString*)newAddToPathString; ++ (void)setAddToPathString:(NSString *)newAddToPathString; + (void)setUseDefaultShell:(BOOL)newUseDefaultShell; -+ (void)setShellString:(NSString*)newShellString; ++ (void)setShellString:(NSString *)newShellString; + (void)setDepth:(int)newDepth; ++ (void)setDisplayModeBundles:(NSArray *)newBundles; + (void)saveToDisk; + (BOOL)useKeymapFile; -+ (NSString*)keymapFile; -+ (NSString*)switchString; ++ (NSString *)keymapFile; ++ (NSString *)switchString; + (unsigned int)keyCode; + (unsigned int)modifiers; + (int)display; @@ -84,10 +112,11 @@ + (BOOL)systemBeep; + (BOOL)xinerama; + (BOOL)addToPath; -+ (NSString*)addToPathString; ++ (NSString *)addToPathString; + (BOOL)useDefaultShell; -+ (NSString*)shellString; ++ (NSString *)shellString; + (int)depth; ++ (NSArray *)displayModeBundles; @end Index: xc/programs/Xserver/hw/darwin/quartz/Preferences.m diff -u xc/programs/Xserver/hw/darwin/quartz/Preferences.m:1.2 xc/programs/Xserver/hw/darwin/quartz/Preferences.m:1.4 --- xc/programs/Xserver/hw/darwin/quartz/Preferences.m:1.2 Tue Jan 14 21:34:06 2003 +++ xc/programs/Xserver/hw/darwin/quartz/Preferences.m Mon Sep 15 20:36:12 2003 @@ -3,10 +3,43 @@ // // This class keeps track of the user preferences. // -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.2 2003/01/15 02:34:06 torrey Exp $ */ +/* + * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.4 2003/09/16 00:36:12 torrey Exp $ */ -#import "Preferences.h" #import "quartzCommon.h" + +#define BOOL xBOOL +#include "darwin.h" +#undef BOOL + +#import "Preferences.h" + #include // for modifier masks // Macros to build the path name @@ -36,8 +69,8 @@ @"YES", @"ShowStartupHelp", [NSNumber numberWithInt:0], @"SwitchKeyCode", [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)], - @"SwitchModifiers", @"NO", @"UseSystemBeep", - @"YES", @"DockSwitch", + @"SwitchModifiers", @"NO", @"UseSystemBeep", + @"YES", @"DockSwitch", @"NO", @"AllowMouseAccelChange", [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor", @"YES", @"Xinerama", @@ -45,7 +78,13 @@ [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString", @"YES", @"UseDefaultShell", @"/bin/tcsh", @"Shell", - [NSNumber numberWithInt:depth_Current], @"Depth", nil]; + [NSNumber numberWithInt:depth_Current], @"Depth", +#ifdef BUILD_XPR + [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil], +#else + [NSArray arrayWithObjects:@"cr.bundle", nil], +#endif + @"DisplayModeBundles", nil]; [super initialize]; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; @@ -207,7 +246,7 @@ [switchString setString:@""]; } -- (BOOL)sendEvent:(NSEvent*)anEvent +- (BOOL)sendEvent:(NSEvent *)anEvent { if(isGettingKeyCode) { if([anEvent type]==NSKeyDown) // wait for keyup @@ -240,7 +279,7 @@ return NO; } -+ (void)setKeymapFile:(NSString*)newFile ++ (void)setKeymapFile:(NSString *)newFile { [[NSUserDefaults standardUserDefaults] setObject:newFile forKey:@"KeymappingFile"]; @@ -252,7 +291,7 @@ forKey:@"UseKeymappingFile"]; } -+ (void)setSwitchString:(NSString*)newString ++ (void)setSwitchString:(NSString *)newString { [[NSUserDefaults standardUserDefaults] setObject:newString forKey:@"SwitchString"]; @@ -311,7 +350,7 @@ [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange forKey:@"AllowMouseAccelChange"]; // Update the setting used by the X server thread - quartzMouseAccelChange = newMouseAccelChange; + darwinMouseAccelChange = newMouseAccelChange; } + (void)setUseQDCursor:(int)newUseQDCursor @@ -364,7 +403,7 @@ forKey:@"AddToPath"]; } -+ (void)setAddToPathString:(NSString*)newAddToPathString ++ (void)setAddToPathString:(NSString *)newAddToPathString { [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString forKey:@"AddToPathString"]; @@ -376,7 +415,7 @@ forKey:@"UseDefaultShell"]; } -+ (void)setShellString:(NSString*)newShellString ++ (void)setShellString:(NSString *)newShellString { [[NSUserDefaults standardUserDefaults] setObject:newShellString forKey:@"Shell"]; @@ -388,6 +427,12 @@ forKey:@"Depth"]; } ++ (void)setDisplayModeBundles:(NSArray *)newBundles +{ + [[NSUserDefaults standardUserDefaults] setObject:newBundles + forKey:@"DisplayModeBundles"]; +} + + (void)saveToDisk { [[NSUserDefaults standardUserDefaults] synchronize]; @@ -399,13 +444,13 @@ boolForKey:@"UseKeymappingFile"]; } -+ (NSString*)keymapFile ++ (NSString *)keymapFile { return [[NSUserDefaults standardUserDefaults] stringForKey:@"KeymappingFile"]; } -+ (NSString*)switchString ++ (NSString *)switchString { return [[NSUserDefaults standardUserDefaults] stringForKey:@"SwitchString"]; @@ -502,7 +547,7 @@ return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"]; } -+ (NSString*)addToPathString ++ (NSString *)addToPathString { return [[NSUserDefaults standardUserDefaults] stringForKey:@"AddToPathString"]; @@ -514,7 +559,7 @@ boolForKey:@"UseDefaultShell"]; } -+ (NSString*)shellString ++ (NSString *)shellString { return [[NSUserDefaults standardUserDefaults] stringForKey:@"Shell"]; @@ -526,5 +571,10 @@ integerForKey:@"Depth"]; } ++ (NSArray *)displayModeBundles +{ + return [[NSUserDefaults standardUserDefaults] + objectForKey:@"DisplayModeBundles"]; +} @end Index: xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h diff -u xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h:1.1 xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h:removed --- xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h Sat Feb 28 21:42:13 2004 @@ -1,41 +0,0 @@ -/* - * XCarbonWindow category for Mac OS X rootless X server - * - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -#import - -@interface NSCarbonWindow : NSWindow - -@end - - -@interface NSCarbonWindow(XCarbonWindow) - -- (void)display; - -@end Index: xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m diff -u xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m:1.1 xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m:removed --- xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m Sat Feb 28 21:42:13 2004 @@ -1,45 +0,0 @@ -/* - * XCarbonWindow category for Mac OS X rootless X server - * - * This category extends/replaces the functionality of NSCarbonWindow. - * - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XCarbonWindow.m,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -#import "XCarbonWindow.h" - - -@implementation NSCarbonWindow(XCarbonWindow) - -// Unfortunately, NSCarbonWindow does not always respect autoDisplay:NO. -// NSCarbonWindow's display method erases the window content, -// so we override it. -- (void)display -{ - // Don't do anything here. -} - -@end Index: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c diff -u xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c:1.1 xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c Wed May 14 01:15:56 2003 @@ -38,16 +38,15 @@ * dealings in this Software without prior written authorization from * Torrey T. Lyons. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.2 2003/05/14 05:15:56 torrey Exp $ */ #include #include #include +#include #include #include -extern int errno; - // Macros to build the path name #ifndef XBINDIR #define XBINDIR /usr/X11R6/bin Index: xc/programs/Xserver/hw/darwin/quartz/XServer.h diff -u xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.8 xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.17 --- xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.8 Wed Jan 22 19:34:26 2003 +++ xc/programs/Xserver/hw/darwin/quartz/XServer.h Mon Nov 24 00:39:01 2003 @@ -29,7 +29,7 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.17 2003/11/24 05:39:01 torrey Exp $ */ #define BOOL xBOOL #include "Xproto.h" @@ -41,15 +41,15 @@ // server state int serverState; NSRecursiveLock *serverLock; + NSMutableArray *pendingClients; BOOL serverVisible; BOOL rootlessMenuBarVisible; BOOL queueShowServer; + BOOL quitWithoutQuery; + BOOL pendingAppQuitReply; UInt32 mouseState; - Class windowClass; - - // server event queue BOOL sendServerEvents; - int eventWriteFD; + BOOL x11Active; // Aqua interface IBOutlet NSWindow *modeWindow; @@ -59,6 +59,12 @@ IBOutlet NSWindow *helpWindow; IBOutlet NSButton *startupHelpButton; IBOutlet NSPanel *switchWindow; + + // Menu elements setable by Apple-WM extension + IBOutlet NSMenu *windowMenu; + IBOutlet NSMenuItem *windowSeparator; + IBOutlet NSMenu *dockMenu; + int checkedWindowItem; } - (id)init; @@ -68,9 +74,11 @@ + (void)append:(NSString *)value toEnv:(NSString *)name; +- (BOOL)loadDisplayBundle; - (void)startX; - (void)finishStartX; - (BOOL)startXClients; +- (void)runClient:(NSString *)filename; - (void)run; - (void)toggle; - (void)showServer:(BOOL)show; @@ -82,19 +90,36 @@ - (void)sendXEvent:(xEvent *)xe; - (void)sendShowHide:(BOOL)show; - (void)clientProcessDone:(int)clientStatus; +- (void)activateX11:(BOOL)state; +- (void)windowBecameKey:(NSNotification *)notification; +- (void)setX11WindowList:(NSArray *)list; +- (void)setX11WindowCheck:(NSNumber *)nn; // Aqua interface actions - (IBAction)startFullScreen:(id)sender; - (IBAction)startRootless:(id)sender; - (IBAction)closeHelpAndShow:(id)sender; +- (IBAction)showSwitchPanel:(id)sender; - (IBAction)showAction:(id)sender; +- (IBAction)itemSelected:(id)sender; +- (IBAction)nextWindow:(id)sender; +- (IBAction)previousWindow:(id)sender; +- (IBAction)performClose:(id)sender; +- (IBAction)performMiniaturize:(id)sender; +- (IBAction)performZoom:(id)sender; +- (IBAction)bringAllToFront:(id)sender; +- (IBAction)copy:(id)sender; // NSApplication delegate - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; +- (void)applicationWillTerminate:(NSNotification *)aNotification; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification; +- (void)applicationDidHide:(NSNotification *)aNotification; +- (void)applicationDidUnhide:(NSNotification *)aNotification; - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag; - (void)applicationWillResignActive:(NSNotification *)aNotification; - (void)applicationWillBecomeActive:(NSNotification *)aNotification; +- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename; // NSPort delegate - (void)handlePortMessage:(NSPortMessage *)portMessage; @@ -109,4 +134,3 @@ server_Quitting, server_Done }; - Index: xc/programs/Xserver/hw/darwin/quartz/XServer.m diff -u xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.8 xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.20 --- xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.8 Wed Jan 22 19:34:26 2003 +++ xc/programs/Xserver/hw/darwin/quartz/XServer.m Wed Nov 26 20:59:53 2003 @@ -34,7 +34,7 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.8 2003/01/23 00:34:26 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.20 2003/11/27 01:59:53 torrey Exp $ */ #include "quartzCommon.h" @@ -42,7 +42,12 @@ #include "X.h" #include "Xproto.h" #include "os.h" +#include "opaque.h" #include "darwin.h" +#include "quartz.h" +#define _APPLEWM_SERVER_ +#include "applewm.h" +#include "applewmExt.h" #undef BOOL #import "XServer.h" @@ -64,14 +69,6 @@ #import #import -#define ENQUEUE(xe) \ -{ \ - char byte = 0; \ - DarwinEQEnqueue(xe); \ - /* signal there is an event ready to handle */ \ - write(eventWriteFD, &byte, 1); \ -} - // Types of shells enum { shell_Unknown, @@ -90,7 +87,7 @@ { "sh", shell_Bourne }, // standard Bourne shell { "zsh", shell_Bourne }, // Z shell { "bash", shell_Bourne }, // GNU Bourne again shell - { NULL, shell_Unknown } + { NULL, shell_Unknown } }; extern int argcGlobal; @@ -99,7 +96,6 @@ extern int main(int argc, char *argv[], char *envp[]); extern void HideMenuBar(void); extern void ShowMenuBar(void); -extern void QuartzReallySetCursor(); static void childDone(int sig); static void powerDidChange(void *x, io_service_t y, natural_t messageType, void *messageArgument); @@ -122,15 +118,16 @@ serverState = server_NotStarted; serverLock = [[NSRecursiveLock alloc] init]; + pendingClients = nil; clientPID = 0; sendServerEvents = NO; + x11Active = YES; serverVisible = NO; rootlessMenuBarVisible = YES; queueShowServer = YES; quartzServerQuitting = NO; + pendingAppQuitReply = NO; mouseState = 0; - eventWriteFD = quartzEventWriteFD; - windowClass = [NSWindow class]; // set up a port to safely send messages to main thread from server thread signalPort = [[NSPort port] retain]; @@ -164,7 +161,7 @@ [self showServer:NO]; sendServerEvents = NO; - if (clientPID != 0 || !quartzStartClients) { + if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) { int but; but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""), @@ -190,6 +187,7 @@ // At this point the X server is either running or starting. if (serverState == server_Starting) { // Quit will be queued later when server is running + pendingAppQuitReply = YES; return NSTerminateLater; } else if (serverState == server_Running) { [self quitServer]; @@ -270,11 +268,18 @@ break; case NSLeftMouseDown: [self getMousePosition:&xe fromEvent:anEvent]; - if (quartzRootless && - ! ([anEvent window] && - [[anEvent window] isKindOfClass:windowClass])) { - // Click in non X window - ignore - return NO; + if (quartzRootless) { + // Check that event is in X11 window + if (!quartzProcs->IsX11Window([anEvent window], + [anEvent windowNumber])) + { + if (x11Active) + [self activateX11:NO]; + return NO; + } else { + if (!x11Active) + [self activateX11:YES]; + } } mouse1Pressed = YES; xe.u.u.type = ButtonPress; @@ -310,6 +315,8 @@ break; case NSKeyDown: case NSKeyUp: + if (!x11Active) + return NO; // If the mouse is not on the valid X display area, // we don't send the X server key events. if (![self getMousePosition:&xe fromEvent:nil]) @@ -321,6 +328,8 @@ xe.u.u.detail = [anEvent keyCode]; break; case NSFlagsChanged: + if (!x11Active) + return NO; [self getMousePosition:&xe fromEvent:nil]; xe.u.u.type = kXDarwinUpdateModifiers; xe.u.clientMessage.u.l.longs0 = flags; @@ -335,14 +344,13 @@ [self sendXEvent:&xe]; - // Rootless: Send first NSLeftMouseDown to windows and views so window - // ordering can be suppressed. + // Rootless: Send first NSLeftMouseDown to Cocoa windows and views so + // window ordering can be suppressed. // Don't pass further events - they (incorrectly?) bring the window // forward no matter what. if (quartzRootless && (type == NSLeftMouseDown || type == NSLeftMouseUp) && - [anEvent clickCount] == 1 && - [[anEvent window] isKindOfClass:windowClass]) + [anEvent clickCount] == 1 && [anEvent window]) { return NO; } @@ -429,6 +437,27 @@ } } + +// Load the appropriate display mode bundle +- (BOOL)loadDisplayBundle +{ + if (quartzRootless) { + NSEnumerator *enumerator = [[Preferences displayModeBundles] + objectEnumerator]; + NSString *bundleName; + + while ((bundleName = [enumerator nextObject])) { + if (QuartzLoadDisplayBundle([bundleName cString])) + return YES; + } + + return NO; + } else { + return QuartzLoadDisplayBundle("fullscreen.bundle"); + } +} + + // Start the X server thread and the client process - (void)startX { @@ -455,6 +484,18 @@ else NSLog(@"No version"); + if (![self loadDisplayBundle]) + [NSApp terminate:nil]; + + // In rootless mode register to receive notification of key window changes + if (quartzRootless) { + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(windowBecameKey:) + name:NSWindowDidBecomeKeyNotification + object:nil]; + } + // Start the X server thread serverState = server_Starting; [NSThread detachNewThreadSelector:@selector(run) toTarget:self @@ -502,7 +543,7 @@ // Finish starting the X server thread // This includes anything that must be done after the X server is -// ready to process events. +// ready to process events after the first or subsequent generations. - (void)finishStartX { sendServerEvents = YES; @@ -516,7 +557,21 @@ if (quartzServerQuitting) { [self quitServer]; - [NSApp replyToApplicationShouldTerminate:YES]; + if (pendingAppQuitReply) + [NSApp replyToApplicationShouldTerminate:YES]; + return; + } + + if (pendingClients) { + NSEnumerator *enumerator = [pendingClients objectEnumerator]; + NSString *filename; + + while ((filename = [enumerator nextObject])) { + [self runClient:filename]; + } + + [pendingClients release]; + pendingClients = nil; } } @@ -666,6 +721,87 @@ return YES; } +// Start the specified client in its own task +// FIXME: This should be unified with startXClients +- (void)runClient:(NSString *)filename +{ + const char *command = [filename UTF8String]; + const char *shell; + const char *argv[5]; + int child1, child2 = 0; + int status; + + shell = getenv("SHELL"); + if (shell == NULL) + shell = "/bin/bash"; + + /* At least [ba]sh, [t]csh and zsh all work with this syntax. We + need to use an interactive shell to force it to load the user's + environment. */ + + argv[0] = shell; + argv[1] = "-i"; + argv[2] = "-c"; + argv[3] = command; + argv[4] = NULL; + + /* Do the fork-twice trick to avoid having to reap zombies */ + + child1 = fork(); + + switch (child1) { + case -1: /* error */ + break; + + case 0: /* child1 */ + child2 = fork(); + + switch (child2) { + int max_files, i; + char buf[1024], *tem; + + case -1: /* error */ + _exit(1); + + case 0: /* child2 */ + /* close all open files except for standard streams */ + max_files = sysconf(_SC_OPEN_MAX); + for (i = 3; i < max_files; i++) + close(i); + + /* ensure stdin is on /dev/null */ + close(0); + open("/dev/null", O_RDONLY); + + /* cd $HOME */ + tem = getenv("HOME"); + if (tem != NULL) + chdir(tem); + + /* Setup environment */ + snprintf(buf, sizeof(buf), ":%s", display); + setenv("DISPLAY", buf, TRUE); + tem = getenv("PATH"); + if (tem != NULL && tem[0] != NULL) + snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem); + else + snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin"); + setenv("PATH", buf, TRUE); + + execvp(argv[0], (char **const) argv); + + _exit(2); + + default: /* parent (child1) */ + _exit(0); + } + break; + + default: /* parent */ + waitpid(child1, &status, 0); + } +} + // Run the X server thread - (void)run { @@ -712,6 +848,12 @@ [NSApp activateIgnoringOtherApps:YES]; } +// Show the Aqua-X11 switch panel useful for fullscreen mode +- (IBAction)showSwitchPanel:(id)sender +{ + [switchWindow orderFront:nil]; +} + // Show the X server when sent message from GUI - (IBAction)showAction:(id)sender { @@ -787,11 +929,10 @@ if (show) { if (!quartzRootless) { - QuartzFSCapture(); + quartzProcs->CaptureScreens(); HideMenuBar(); } - xe.u.u.type = kXDarwinShow; - [self sendXEvent:&xe]; + [self activateX11:YES]; // the mouse location will have moved; track it xe.u.u.type = MotionNotify; @@ -802,14 +943,19 @@ xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags]; [self sendXEvent:&xe]; - // put the pasteboard into the X cut buffer - [self readPasteboard]; + // If there is no AppleWM-aware cut and paste manager, do what we can. + if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) { + // put the pasteboard into the X cut buffer + [self readPasteboard]; + } } else { - // put the X cut buffer on the pasteboard - [self writePasteboard]; + // If there is no AppleWM-aware cut and paste manager, do what we can. + if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) { + // put the X cut buffer on the pasteboard + [self writePasteboard]; + } - xe.u.u.type = kXDarwinHide; - [self sendXEvent:&xe]; + [self activateX11:NO]; } serverVisible = show; @@ -862,22 +1008,7 @@ // This field should be filled in for every event xe->u.keyButtonPointer.time = GetTimeInMillis(); -#if 0 - // FIXME: Really? - if (quartzRootless && - (ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp || - (ev->type == NSSystemDefined && ev->data.compound.subType == 7))) - { - // mouse button event - send mouseMoved to this position too - // X gets confused if it gets a click that isn't at the last - // reported mouse position. - xEvent moveEvent = *ev; - xe.u.u.type = NSMouseMoved; - [self sendXEvent:&moveEvent]; - } -#endif - - ENQUEUE(xe); + DarwinEQEnqueue(xe); } // Handle messages from the X server thread @@ -885,12 +1016,12 @@ { unsigned msg = [portMessage msgid]; - switch(msg) { + switch (msg) { case kQuartzServerHidden: // Make sure the X server wasn't queued to be shown again while // the hide was pending. if (!quartzRootless && !serverVisible) { - QuartzFSRelease(); + quartzProcs->ReleaseScreens(); ShowMenuBar(); } break; @@ -908,13 +1039,43 @@ break; case kQuartzCursorUpdate: - QuartzReallySetCursor(); + if (quartzProcs->CursorUpdate) + quartzProcs->CursorUpdate(); break; case kQuartzPostEvent: { const xEvent *xe = [[[portMessage components] lastObject] bytes]; - ENQUEUE(xe); + DarwinEQEnqueue(xe); + break; + } + + case kQuartzSetWindowMenu: + { + NSArray *list; + [[[portMessage components] lastObject] getBytes:&list]; + [self setX11WindowList:list]; + [list release]; + break; + } + + case kQuartzSetWindowMenuCheck: + { + int n; + [[[portMessage components] lastObject] getBytes:&n]; + [self setX11WindowCheck:[NSNumber numberWithInt:n]]; + break; + } + + case kQuartzSetFrontProcess: + [NSApp activateIgnoringOtherApps:YES]; + break; + + case kQuartzSetCanQuit: + { + int n; + [[[portMessage components] lastObject] getBytes:&n]; + quitWithoutQuery = (BOOL) n; break; } @@ -939,6 +1100,238 @@ } } +// User selected an X11 window from a menu +- (IBAction)itemSelected:(id)sender +{ + xEvent xe; + + [NSApp activateIgnoringOtherApps:YES]; + + // Notify the client of the change through the X server thread + xe.u.u.type = kXDarwinControllerNotify; + xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem; + xe.u.clientMessage.u.l.longs1 = [sender tag]; + [self sendXEvent:&xe]; +} + +// User selected Next from window menu +- (IBAction)nextWindow:(id)sender +{ + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMNextWindow); +} + +// User selected Previous from window menu +- (IBAction)previousWindow:(id)sender +{ + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMPreviousWindow); +} + +/* + * The XPR implementation handles close, minimize, and zoom actions for X11 + * windows here, while CR handles these in the NSWindow class. + */ + +// Handle Close from window menu for X11 window in XPR implementation +- (IBAction)performClose:(id)sender +{ + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMCloseWindow); +} + +// Handle Minimize from window menu for X11 window in XPR implementation +- (IBAction)performMiniaturize:(id)sender +{ + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMMinimizeWindow); +} + +// Handle Zoom from window menu for X11 window in XPR implementation +- (IBAction)performZoom:(id)sender +{ + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMZoomWindow); +} + +// Handle "Bring All to Front" from window menu +- (IBAction)bringAllToFront:(id)sender +{ + if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMBringAllToFront); + } else { + [NSApp arrangeInFront:nil]; + } +} + +// This ends up at the end of the responder chain. +- (IBAction)copy:(id)sender +{ + QuartzMessageServerThread(kXDarwinPasteboardNotify, 1, + AppleWMCopyToPasteboard); +} + +// Set whether or not X11 is active and should receive all key events +- (void)activateX11:(BOOL)state +{ + if (state) { + QuartzMessageServerThread(kXDarwinActivate, 0); + } + else { + QuartzMessageServerThread(kXDarwinDeactivate, 0); + } + + x11Active = state; +} + +// Some NSWindow became the key window +- (void)windowBecameKey:(NSNotification *)notification +{ + NSWindow *window = [notification object]; + + if (quartzProcs->IsX11Window(window, [window windowNumber])) { + if (!x11Active) + [self activateX11:YES]; + } else { + if (x11Active) + [self activateX11:NO]; + } +} + +// Set the Apple-WM specifiable part of the window menu +- (void)setX11WindowList:(NSArray *)list +{ + NSMenuItem *item; + int first, count, i; + xEvent xe; + + /* Work backwards so we don't mess up the indices */ + first = [windowMenu indexOfItem:windowSeparator] + 1; + if (first > 0) { + count = [windowMenu numberOfItems]; + for (i = count - 1; i >= first; i--) + [windowMenu removeItemAtIndex:i]; + } else { + windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@"" + action:nil + keyEquivalent:@""]; + } + + count = [dockMenu numberOfItems]; + for (i = 0; i < count; i++) + [dockMenu removeItemAtIndex:0]; + + count = [list count]; + + for (i = 0; i < count; i++) + { + NSString *name, *shortcut; + + name = [[list objectAtIndex:i] objectAtIndex:0]; + shortcut = [[list objectAtIndex:i] objectAtIndex:1]; + + item = (NSMenuItem *)[windowMenu addItemWithTitle:name + action:@selector(itemSelected:) + keyEquivalent:shortcut]; + [item setTarget:self]; + [item setTag:i]; + [item setEnabled:YES]; + + item = (NSMenuItem *)[dockMenu insertItemWithTitle:name + action:@selector(itemSelected:) + keyEquivalent:shortcut atIndex:i]; + [item setTarget:self]; + [item setTag:i]; + [item setEnabled:YES]; + } + + if (checkedWindowItem >= 0 && checkedWindowItem < count) + { + item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem]; + [item setState:NSOnState]; + item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem]; + [item setState:NSOnState]; + } + + // Notify the client of the change through the X server thread + xe.u.u.type = kXDarwinControllerNotify; + xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify; + [self sendXEvent:&xe]; +} + +// Set the checked item on the Apple-WM specifiable window menu +- (void)setX11WindowCheck:(NSNumber *)nn +{ + NSMenuItem *item; + int first, count; + int n = [nn intValue]; + + first = [windowMenu indexOfItem:windowSeparator] + 1; + count = [windowMenu numberOfItems] - first; + + if (checkedWindowItem >= 0 && checkedWindowItem < count) + { + item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem]; + [item setState:NSOffState]; + item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem]; + [item setState:NSOffState]; + } + if (n >= 0 && n < count) + { + item = (NSMenuItem *)[windowMenu itemAtIndex:first + n]; + [item setState:NSOnState]; + item = (NSMenuItem *)[dockMenu itemAtIndex:n]; + [item setState:NSOnState]; + } + checkedWindowItem = n; +} + +// Return whether or not a menu item should be enabled +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + NSMenu *menu = [item menu]; + + if (menu == windowMenu && [item tag] == 30) { + // Mode switch panel is for fullscreen only + return !quartzRootless; + } + else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) { + // The special window and dock menu items should not be active unless + // there is an AppleWM-aware window manager running. + return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0; + } + else { + return TRUE; + } +} + +/* + * Application Delegate Methods + */ + +- (void)applicationDidHide:(NSNotification *)aNotification +{ + if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMHideAll); + } else { + if (quartzProcs->HideWindows) + quartzProcs->HideWindows(YES); + } +} + +- (void)applicationDidUnhide:(NSNotification *)aNotification +{ + if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) { + QuartzMessageServerThread(kXDarwinControllerNotify, 1, + AppleWMShowAll); + } else { + if (quartzProcs->HideWindows) + quartzProcs->HideWindows(NO); + } +} + // Called when the user clicks the application icon, // but not when Cmd-Tab is used. // Rootless: Don't switch until applicationWillBecomeActive. @@ -958,8 +1351,38 @@ - (void)applicationWillBecomeActive:(NSNotification *)aNotification { - if (quartzRootless) + if (quartzRootless) { [self showServer:YES]; + + // If there is no AppleWM-aware window manager, we can't allow + // interleaving of Aqua and X11 windows. + if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) { + [NSApp arrangeInFront:nil]; + } + } +} + +// Called when the user opens a document type that we claim (ie. an X11 executable). +- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename +{ + if (serverState == server_Running) { + [self runClient:filename]; + return YES; + } + else if (serverState == server_NotStarted || serverState == server_Starting) { + if ([filename UTF8String][0] != ':') { // Ignore display names + if (!pendingClients) { + pendingClients = [[NSMutableArray alloc] initWithCapacity:1]; + } + [pendingClients addObject:filename]; + return YES; // Assume it will launch successfully + } + return NO; + } + + // If the server is quitting or done, + // its too late to launch new clients this time. + return NO; } @end @@ -970,7 +1393,7 @@ // NSPort is not thread safe. void QuartzMessageMainThread(unsigned msg, void *data, unsigned length) { - if (msg == kQuartzPostEvent) { + if (length > 0) { NSData *eventData = [NSData dataWithBytes:data length:length]; NSArray *eventArray = [NSArray arrayWithObject:eventData]; NSPortMessage *newMessage = @@ -986,6 +1409,36 @@ } } +void +QuartzSetWindowMenu(int nitems, const char **items, + const char *shortcuts) +{ + NSMutableArray *array; + int i; + + array = [[NSMutableArray alloc] initWithCapacity:nitems]; + + for (i = 0; i < nitems; i++) { + NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2]; + NSString *string = [NSString stringWithUTF8String:items[i]]; + + [subarray addObject:string]; + + if (shortcuts[i] != 0) { + NSString *number = [NSString stringWithFormat:@"%d", + shortcuts[i]]; + [subarray addObject:number]; + } else + [subarray addObject:@""]; + + [array addObject:subarray]; + } + + /* Send the array of strings over to the main thread. */ + /* Will be released in main thread. */ + QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *)); +} + // Handle SIGCHLD signals static void childDone(int sig) { @@ -1025,5 +1478,5 @@ } break; } - + } Index: xc/programs/Xserver/hw/darwin/quartz/XView.h diff -u xc/programs/Xserver/hw/darwin/quartz/XView.h:1.2 xc/programs/Xserver/hw/darwin/quartz/XView.h:removed --- xc/programs/Xserver/hw/darwin/quartz/XView.h:1.2 Mon Jul 15 15:58:31 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XView.h Sat Feb 28 21:42:13 2004 @@ -1,42 +0,0 @@ -/* - * NSView subclass for Mac OS X rootless X server - * - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XView.h,v 1.2 2002/07/15 19:58:31 torrey Exp $ */ - -#import - -@interface XView : NSQuickDrawView - -- (BOOL)isFlipped; -- (BOOL)isOpaque; -- (BOOL)acceptsFirstResponder; -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent; -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent; - -- (void)mouseDown:(NSEvent *)anEvent; - -@end Index: xc/programs/Xserver/hw/darwin/quartz/XView.m diff -u xc/programs/Xserver/hw/darwin/quartz/XView.m:1.2 xc/programs/Xserver/hw/darwin/quartz/XView.m:removed --- xc/programs/Xserver/hw/darwin/quartz/XView.m:1.2 Mon Jul 15 15:58:31 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XView.m Sat Feb 28 21:42:13 2004 @@ -1,76 +0,0 @@ -/* - * NSView subclass for Mac OS X rootless X server - * - * Each rootless window contains an instance of this class. - * This class handles events while drawing is handled by Carbon - * code in the rootless Aqua implementation. - * - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XView.m,v 1.2 2002/07/15 19:58:31 torrey Exp $ */ - -#import "XView.h" - - -@implementation XView - -- (BOOL)isFlipped -{ - return NO; -} - -- (BOOL)isOpaque -{ - return YES; -} - -- (BOOL)acceptsFirstResponder -{ - return YES; -} - -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent -{ - return YES; -} - -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent -{ - return YES; -} - -- (void)mouseDown:(NSEvent *)anEvent -{ - // Only X is allowed to restack windows. - [NSApp preventWindowOrdering]; - if (! [NSApp isActive]) { - [NSApp activateIgnoringOtherApps:YES]; - // FIXME: Interleaving with other apps would be nice, but has issues. - [NSApp arrangeInFront:nil]; - } - [[self nextResponder] mouseDown:anEvent]; -} - -@end Index: xc/programs/Xserver/hw/darwin/quartz/applewm.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/applewm.c:1.3 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/applewm.c Tue Nov 11 18:48:41 2003 @@ -0,0 +1,697 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.3 2003/11/11 23:48:41 torrey Exp $ */ +/************************************************************************** + +Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. +Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +#include "quartzCommon.h" + +#define NEED_REPLIES +#define NEED_EVENTS +#include "misc.h" +#include "dixstruct.h" +#include "globals.h" +#include "extnsionst.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "servermd.h" +#include "swaprep.h" +#include "Xatom.h" +#include "darwin.h" +#define _APPLEWM_SERVER_ +#include "applewmstr.h" +#include "applewmExt.h" + +#define DEFINE_ATOM_HELPER(func,atom_name) \ +static Atom func (void) { \ + static int generation; \ + static Atom atom; \ + if (generation != serverGeneration) { \ + generation = serverGeneration; \ + atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ + } \ + return atom; \ +} + +DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN") + +static AppleWMProcsPtr appleWMProcs; + +static int WMErrorBase; + +static DISPATCH_PROC(ProcAppleWMDispatch); +static DISPATCH_PROC(SProcAppleWMDispatch); + +static void AppleWMResetProc(ExtensionEntry* extEntry); + +static unsigned char WMReqCode = 0; +static int WMEventBase = 0; + +static RESTYPE ClientType, EventType; /* resource types for event masks */ +static XID eventResource; + +/* Currently selected events */ +static unsigned int eventMask = 0; + +static int WMFreeClient (pointer data, XID id); +static int WMFreeEvents (pointer data, XID id); +static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to); + +typedef struct _WMEvent *WMEventPtr; +typedef struct _WMEvent { + WMEventPtr next; + ClientPtr client; + XID clientResource; + unsigned int mask; +} WMEventRec; + +static inline BoxRec +make_box (int x, int y, int w, int h) +{ + BoxRec r; + r.x1 = x; + r.y1 = y; + r.x2 = x + w; + r.y2 = y + h; + return r; +} + +void +AppleWMExtensionInit( + AppleWMProcsPtr procsPtr) +{ + ExtensionEntry* extEntry; + + ClientType = CreateNewResourceType(WMFreeClient); + EventType = CreateNewResourceType(WMFreeEvents); + eventResource = FakeClientID(0); + + if (ClientType && EventType && + (extEntry = AddExtension(APPLEWMNAME, + AppleWMNumberEvents, + AppleWMNumberErrors, + ProcAppleWMDispatch, + SProcAppleWMDispatch, + AppleWMResetProc, + StandardMinorOpcode))) + { + WMReqCode = (unsigned char)extEntry->base; + WMErrorBase = extEntry->errorBase; + WMEventBase = extEntry->eventBase; + EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; + appleWMProcs = procsPtr; + } +} + +/*ARGSUSED*/ +static void +AppleWMResetProc ( + ExtensionEntry* extEntry +) +{ +} + +/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */ +void +AppleWMSetScreenOrigin( + WindowPtr pWin +) +{ + long data[2]; + + data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x + + darwinMainScreenX); + data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y + + darwinMainScreenY); + + ChangeWindowProperty(pWin, xa_native_screen_origin(), XA_INTEGER, + 32, PropModeReplace, 2, data, TRUE); +} + +static int +ProcAppleWMQueryVersion( + register ClientPtr client +) +{ + xAppleWMQueryVersionReply rep; + register int n; + + REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = APPLE_WM_MAJOR_VERSION; + rep.minorVersion = APPLE_WM_MINOR_VERSION; + rep.patchVersion = APPLE_WM_PATCH_VERSION; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + + +/* events */ + +static inline void +updateEventMask (WMEventPtr *pHead) +{ + WMEventPtr pCur; + + eventMask = 0; + for (pCur = *pHead; pCur != NULL; pCur = pCur->next) + eventMask |= pCur->mask; +} + +/*ARGSUSED*/ +static int +WMFreeClient (data, id) + pointer data; + XID id; +{ + WMEventPtr pEvent; + WMEventPtr *pHead, pCur, pPrev; + + pEvent = (WMEventPtr) data; + pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); + if (pHead) { + pPrev = 0; + for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next) + pPrev = pCur; + if (pCur) { + if (pPrev) + pPrev->next = pEvent->next; + else + *pHead = pEvent->next; + } + updateEventMask (pHead); + } + xfree ((pointer) pEvent); + return 1; +} + +/*ARGSUSED*/ +static int +WMFreeEvents (data, id) + pointer data; + XID id; +{ + WMEventPtr *pHead, pCur, pNext; + + pHead = (WMEventPtr *) data; + for (pCur = *pHead; pCur; pCur = pNext) { + pNext = pCur->next; + FreeResource (pCur->clientResource, ClientType); + xfree ((pointer) pCur); + } + xfree ((pointer) pHead); + eventMask = 0; + return 1; +} + +static int +ProcAppleWMSelectInput (client) + register ClientPtr client; +{ + REQUEST(xAppleWMSelectInputReq); + WMEventPtr pEvent, pNewEvent, *pHead; + XID clientResource; + + REQUEST_SIZE_MATCH (xAppleWMSelectInputReq); + pHead = (WMEventPtr *)SecurityLookupIDByType(client, + eventResource, EventType, SecurityWriteAccess); + if (stuff->mask != 0) { + if (pHead) { + /* check for existing entry. */ + for (pEvent = *pHead; pEvent; pEvent = pEvent->next) + { + if (pEvent->client == client) + { + pEvent->mask = stuff->mask; + updateEventMask (pHead); + return Success; + } + } + } + + /* build the entry */ + pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec)); + if (!pNewEvent) + return BadAlloc; + pNewEvent->next = 0; + pNewEvent->client = client; + pNewEvent->mask = stuff->mask; + /* + * add a resource that will be deleted when + * the client goes away + */ + clientResource = FakeClientID (client->index); + pNewEvent->clientResource = clientResource; + if (!AddResource (clientResource, ClientType, (pointer)pNewEvent)) + return BadAlloc; + /* + * create a resource to contain a pointer to the list + * of clients selecting input. This must be indirect as + * the list may be arbitrarily rearranged which cannot be + * done through the resource database. + */ + if (!pHead) + { + pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr)); + if (!pHead || + !AddResource (eventResource, EventType, (pointer)pHead)) + { + FreeResource (clientResource, RT_NONE); + return BadAlloc; + } + *pHead = 0; + } + pNewEvent->next = *pHead; + *pHead = pNewEvent; + updateEventMask (pHead); + } else if (stuff->mask == 0) { + /* delete the interest */ + if (pHead) { + pNewEvent = 0; + for (pEvent = *pHead; pEvent; pEvent = pEvent->next) { + if (pEvent->client == client) + break; + pNewEvent = pEvent; + } + if (pEvent) { + FreeResource (pEvent->clientResource, ClientType); + if (pNewEvent) + pNewEvent->next = pEvent->next; + else + *pHead = pEvent->next; + xfree (pEvent); + updateEventMask (pHead); + } + } + } else { + client->errorValue = stuff->mask; + return BadValue; + } + return Success; +} + +/* + * deliver the event + */ + +void +AppleWMSendEvent (type, mask, which, arg) + int type, which, arg; + unsigned int mask; +{ + WMEventPtr *pHead, pEvent; + ClientPtr client; + xAppleWMNotifyEvent se; + + pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); + if (!pHead) + return; + for (pEvent = *pHead; pEvent; pEvent = pEvent->next) { + client = pEvent->client; + if ((pEvent->mask & mask) == 0 + || client == serverClient || client->clientGone) + { + continue; + } + se.type = type + WMEventBase; + se.kind = which; + se.arg = arg; + se.sequenceNumber = client->sequence; + se.time = currentTime.milliseconds; + WriteEventsToClient (client, 1, (xEvent *) &se); + } +} + +/* Safe to call from any thread. */ +unsigned int +AppleWMSelectedEvents (void) +{ + return eventMask; +} + + +/* general utility functions */ + +static int +ProcAppleWMDisableUpdate( + register ClientPtr client +) +{ + REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq); + + appleWMProcs->DisableUpdate(); + + return (client->noClientException); +} + +static int +ProcAppleWMReenableUpdate( + register ClientPtr client +) +{ + REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq); + + appleWMProcs->EnableUpdate(); + + return (client->noClientException); +} + + +/* window functions */ + +static int +ProcAppleWMSetWindowMenu( + register ClientPtr client +) +{ + const char *bytes, **items; + char *shortcuts; + int max_len, nitems, i, j; + REQUEST(xAppleWMSetWindowMenuReq); + + REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq); + + nitems = stuff->nitems; + items = xalloc (sizeof (char *) * nitems); + shortcuts = xalloc (sizeof (char) * nitems); + + max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq); + bytes = (char *) &stuff[1]; + + for (i = j = 0; i < max_len && j < nitems;) + { + shortcuts[j] = bytes[i++]; + items[j++] = bytes + i; + + while (i < max_len) + { + if (bytes[i++] == 0) + break; + } + } + + QuartzSetWindowMenu (nitems, items, shortcuts); + + free(items); + free(shortcuts); + + return (client->noClientException); +} + +static int +ProcAppleWMSetWindowMenuCheck( + register ClientPtr client +) +{ + REQUEST(xAppleWMSetWindowMenuCheckReq); + + REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq); + + QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index, + sizeof(stuff->index)); + + return (client->noClientException); +} + +static int +ProcAppleWMSetFrontProcess( + register ClientPtr client +) +{ + REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq); + + QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0); + + return (client->noClientException); +} + +static int +ProcAppleWMSetWindowLevel( + register ClientPtr client +) +{ + REQUEST(xAppleWMSetWindowLevelReq); + WindowPtr pWin; + int errno; + + REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); + + if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, + client, SecurityReadAccess))) + { + return BadValue; + } + + if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { + return BadValue; + } + + errno = appleWMProcs->SetWindowLevel(pWin, stuff->level); + if (errno != Success) { + return errno; + } + + return (client->noClientException); +} + +static int +ProcAppleWMSetCanQuit( + register ClientPtr client +) +{ + REQUEST(xAppleWMSetCanQuitReq); + + REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq); + + QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state, + sizeof(stuff->state)); + + return (client->noClientException); +} + + +/* frame functions */ + +static int +ProcAppleWMFrameGetRect( + register ClientPtr client +) +{ + xAppleWMFrameGetRectReply rep; + BoxRec ir, or, rr; + REQUEST(xAppleWMFrameGetRectReq); + + REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); + or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); + + if (appleWMProcs->FrameGetRect(stuff->frame_rect, + stuff->frame_class, + &or, &ir, &rr) != Success) + { + return BadValue; + } + + rep.x = rr.x1; + rep.y = rr.y1; + rep.w = rr.x2 - rr.x1; + rep.h = rr.y2 - rr.y1; + + WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcAppleWMFrameHitTest( + register ClientPtr client +) +{ + xAppleWMFrameHitTestReply rep; + BoxRec ir, or; + int ret; + REQUEST(xAppleWMFrameHitTestReq); + + REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); + or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); + + if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px, + stuff->py, &or, &ir, &ret) != Success) + { + return BadValue; + } + + rep.ret = ret; + + WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcAppleWMFrameDraw( + register ClientPtr client +) +{ + BoxRec ir, or; + unsigned int title_length, title_max; + unsigned char *title_bytes; + REQUEST(xAppleWMFrameDrawReq); + WindowPtr pWin; + + REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq); + + if (!(pWin = SecurityLookupWindow((Drawable)stuff->window, + client, SecurityReadAccess))) + { + return BadValue; + } + + ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); + or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); + + title_length = stuff->title_length; + title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq); + + if (title_max < title_length) + return BadValue; + + title_bytes = (unsigned char *) &stuff[1]; + + errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class, + stuff->frame_attr, &or, &ir, + title_length, title_bytes); + if (errno != Success) { + return errno; + } + + return (client->noClientException); +} + + +/* dispatch */ + +static int +ProcAppleWMDispatch ( + register ClientPtr client +) +{ + REQUEST(xReq); + + switch (stuff->data) + { + case X_AppleWMQueryVersion: + return ProcAppleWMQueryVersion(client); + } + + if (!LocalClient(client)) + return WMErrorBase + AppleWMClientNotLocal; + + switch (stuff->data) + { + case X_AppleWMSelectInput: + return ProcAppleWMSelectInput(client); + case X_AppleWMDisableUpdate: + return ProcAppleWMDisableUpdate(client); + case X_AppleWMReenableUpdate: + return ProcAppleWMReenableUpdate(client); + case X_AppleWMSetWindowMenu: + return ProcAppleWMSetWindowMenu(client); + case X_AppleWMSetWindowMenuCheck: + return ProcAppleWMSetWindowMenuCheck(client); + case X_AppleWMSetFrontProcess: + return ProcAppleWMSetFrontProcess(client); + case X_AppleWMSetWindowLevel: + return ProcAppleWMSetWindowLevel(client); + case X_AppleWMSetCanQuit: + return ProcAppleWMSetCanQuit(client); + case X_AppleWMFrameGetRect: + return ProcAppleWMFrameGetRect(client); + case X_AppleWMFrameHitTest: + return ProcAppleWMFrameHitTest(client); + case X_AppleWMFrameDraw: + return ProcAppleWMFrameDraw(client); + default: + return BadRequest; + } +} + +static void +SNotifyEvent(from, to) + xAppleWMNotifyEvent *from, *to; +{ + to->type = from->type; + to->kind = from->kind; + cpswaps (from->sequenceNumber, to->sequenceNumber); + cpswapl (from->time, to->time); + cpswapl (from->arg, to->arg); +} + +static int +SProcAppleWMQueryVersion( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleWMQueryVersionReq); + swaps(&stuff->length, n); + return ProcAppleWMQueryVersion(client); +} + +static int +SProcAppleWMDispatch ( + register ClientPtr client +) +{ + REQUEST(xReq); + + /* It is bound to be non-local when there is byte swapping */ + if (!LocalClient(client)) + return WMErrorBase + AppleWMClientNotLocal; + + /* only local clients are allowed WM access */ + switch (stuff->data) + { + case X_AppleWMQueryVersion: + return SProcAppleWMQueryVersion(client); + default: + return BadRequest; + } +} Index: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/applewmExt.h:1.3 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/applewmExt.h Mon Nov 17 17:20:35 2003 @@ -0,0 +1,83 @@ +/* + * External interface for the server's AppleWM support + */ +/************************************************************************** + +Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. +Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h,v 1.3 2003/11/17 22:20:35 dawes Exp $ */ + +#ifndef _APPLEWMEXT_H_ +#define _APPLEWMEXT_H_ + +#include "window.h" + +typedef int (*DisableUpdateProc)(void); +typedef int (*EnableUpdateProc)(void); +typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level); +typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer, + const BoxRec *inner, BoxRec *ret); +typedef int (*FrameHitTestProc)(int class, int x, int y, + const BoxRec *outer, + const BoxRec *inner, int *ret); +typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, + const BoxRec *outer, const BoxRec *inner, + unsigned int title_len, + const unsigned char *title_bytes); + +/* + * AppleWM implementation function list + */ +typedef struct _AppleWMProcs { + DisableUpdateProc DisableUpdate; + EnableUpdateProc EnableUpdate; + SetWindowLevelProc SetWindowLevel; + FrameGetRectProc FrameGetRect; + FrameHitTestProc FrameHitTest; + FrameDrawProc FrameDraw; +} AppleWMProcsRec, *AppleWMProcsPtr; + +extern AppleWMProcsPtr appleWMProcs; + +void AppleWMExtensionInit( + AppleWMProcsPtr procsPtr +); + +void AppleWMSetScreenOrigin( + WindowPtr pWin +); + +void AppleWMSendEvent( + int /* type */, + unsigned int /* mask */, + int /* which */, + int /* arg */ +); + +unsigned int AppleWMSelectedEvents( + void +); + +#endif /* _APPLEWMEXT_H_ */ Index: xc/programs/Xserver/hw/darwin/quartz/aqua.h diff -u xc/programs/Xserver/hw/darwin/quartz/aqua.h:1.3 xc/programs/Xserver/hw/darwin/quartz/aqua.h:removed --- xc/programs/Xserver/hw/darwin/quartz/aqua.h:1.3 Mon Jan 20 00:42:52 2003 +++ xc/programs/Xserver/hw/darwin/quartz/aqua.h Sat Feb 28 21:42:13 2004 @@ -1,54 +0,0 @@ -/* - * Rootless implementation for the Mac OS X Aqua environment - */ -/* - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/aqua.h,v 1.3 2003/01/20 05:42:52 torrey Exp $ */ - -#ifndef _AQUA_H -#define _AQUA_H - -#include "picturestr.h" - -void AquaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - -#ifdef RENDER -void -AquaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); -#endif /* RENDER */ - - -/* - * AquaAlphaMask - * Bit mask for alpha channel with a particular number of bits per pixel. - * Note that we only care for 32bpp data. Mac OS X uses planar alpha for - * 16bpp. - */ -#define AquaAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) - -#endif /* _AQUA_H */ Index: xc/programs/Xserver/hw/darwin/quartz/aquaCommon.h diff -u xc/programs/Xserver/hw/darwin/quartz/aquaCommon.h:1.1 xc/programs/Xserver/hw/darwin/quartz/aquaCommon.h:removed --- xc/programs/Xserver/hw/darwin/quartz/aquaCommon.h:1.1 Wed Aug 28 02:41:26 2002 +++ xc/programs/Xserver/hw/darwin/quartz/aquaCommon.h Sat Feb 28 21:42:13 2004 @@ -1,56 +0,0 @@ -/* - * Common internal definitions and code of the rootless implementation - * for the Mac OS X Aqua environment - */ -/* - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef _AQUACOMMON_H -#define _AQUACOMMON_H - -#include "quartzCommon.h" - -#ifdef __OBJC__ -#undef BOOL -#import -#import "XView.h" -#else -typedef struct OpaqueNSWindow NSWindow; -typedef struct OpaqueXView XView; -#endif - - -typedef struct { - NSWindow *window; - XView *view; - GrafPtr port; - CGContextRef context; - GWorldPtr rootGWorld; -} AquaWindowRec; - -#define AQUA_WINREC(rw) ((AquaWindowRec *)rw) - -#endif /* _AQUACOMMON_H */ \ No newline at end of file Index: xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c diff -u xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c:1.3 xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c:removed --- xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c:1.3 Fri Sep 27 20:00:03 2002 +++ xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c Sat Feb 28 21:42:13 2004 @@ -1,268 +0,0 @@ -/* - * Support for RENDER extension with rootless Aqua - */ -/* - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* This file is largely based on fbcompose.c and fbpict.c, which contain - * the following copyright: - * - * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. - */ - /* $XFree86: xc/programs/Xserver/hw/darwin/quartz/aquaPicture.c,v 1.3 2002/09/28 00:00:03 torrey Exp $ */ - -#ifdef RENDER - -#include "fb.h" -#include "picturestr.h" -#include "mipict.h" -#include "fbpict.h" -#include "aqua.h" - -# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) - - -// Replacement for fbStore_x8r8g8b8 that sets the Aqua alpha channel -void -AquaStore_x8r8g8b8 (FbCompositeOperand *op, CARD32 value) -{ - FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset; - ((CARD32 *)line)[offset >> 5] = (value & 0xffffff) | 0xff000000; -} - - -// Defined in fbcompose.c -extern FbCombineFunc fbCombineFuncU[]; -extern FbCombineFunc fbCombineFuncC[]; - -void -AquaCompositeGeneral( - CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - FbCompositeOperand src[4],msk[4],dst[4],*pmsk; - FbCompositeOperand *srcPict, *srcAlpha; - FbCompositeOperand *dstPict, *dstAlpha; - FbCompositeOperand *mskPict = 0, *mskAlpha = 0; - FbCombineFunc f; - int w; - - if (!fbBuildCompositeOperand (pSrc, src, xSrc, ySrc, TRUE, TRUE)) - return; - if (!fbBuildCompositeOperand (pDst, dst, xDst, yDst, FALSE, TRUE)) - return; - - // Use Aqua operands for on screen picture formats - if (pDst->format == PICT_x8r8g8b8) { - dst[0].store = AquaStore_x8r8g8b8; - } - - if (pSrc->alphaMap) - { - srcPict = &src[1]; - srcAlpha = &src[2]; - } - else - { - srcPict = &src[0]; - srcAlpha = 0; - } - if (pDst->alphaMap) - { - dstPict = &dst[1]; - dstAlpha = &dst[2]; - } - else - { - dstPict = &dst[0]; - dstAlpha = 0; - } - f = fbCombineFuncU[op]; - if (pMask) - { - if (!fbBuildCompositeOperand (pMask, msk, xMask, yMask, TRUE, TRUE)) - return; - pmsk = msk; - if (pMask->componentAlpha) - f = fbCombineFuncC[op]; - if (pMask->alphaMap) - { - mskPict = &msk[1]; - mskAlpha = &msk[2]; - } - else - { - mskPict = &msk[0]; - mskAlpha = 0; - } - } - else - pmsk = 0; - while (height--) - { - w = width; - - while (w--) - { - (*f) (src, pmsk, dst); - (*src->over) (src); - (*dst->over) (dst); - if (pmsk) - (*pmsk->over) (pmsk); - } - (*src->down) (src); - (*dst->down) (dst); - if (pmsk) - (*pmsk->down) (pmsk); - } -} - - -void -AquaComposite( - CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - RegionRec region; - int n; - BoxPtr pbox; - CompositeFunc func; - Bool srcRepeat = pSrc->repeat; - Bool maskRepeat = FALSE; - Bool maskAlphaMap = FALSE; - int x_msk, y_msk, x_src, y_src, x_dst, y_dst; - int w, h, w_this, h_this; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - if (pMask) - { - xMask += pMask->pDrawable->x; - yMask += pMask->pDrawable->y; - maskRepeat = pMask->repeat; - maskAlphaMap = pMask->alphaMap != 0; - } - - if (!miComputeCompositeRegion (®ion, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height)) - return; - - // To preserve the alpha channel we only use a special, - // non-optimzied compositor. - func = AquaCompositeGeneral; - - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); - while (n--) - { - h = pbox->y2 - pbox->y1; - y_src = pbox->y1 - yDst + ySrc; - y_msk = pbox->y1 - yDst + yMask; - y_dst = pbox->y1; - while (h) - { - h_this = h; - w = pbox->x2 - pbox->x1; - x_src = pbox->x1 - xDst + xSrc; - x_msk = pbox->x1 - xDst + xMask; - x_dst = pbox->x1; - if (maskRepeat) - { - y_msk = mod (y_msk, pMask->pDrawable->height); - if (h_this > pMask->pDrawable->height - y_msk) - h_this = pMask->pDrawable->height - y_msk; - } - if (srcRepeat) - { - y_src = mod (y_src, pSrc->pDrawable->height); - if (h_this > pSrc->pDrawable->height - y_src) - h_this = pSrc->pDrawable->height - y_src; - } - while (w) - { - w_this = w; - if (maskRepeat) - { - x_msk = mod (x_msk, pMask->pDrawable->width); - if (w_this > pMask->pDrawable->width - x_msk) - w_this = pMask->pDrawable->width - x_msk; - } - if (srcRepeat) - { - x_src = mod (x_src, pSrc->pDrawable->width); - if (w_this > pSrc->pDrawable->width - x_src) - w_this = pSrc->pDrawable->width - x_src; - } - (*func) (op, pSrc, pMask, pDst, - x_src, y_src, x_msk, y_msk, x_dst, y_dst, - w_this, h_this); - w -= w_this; - x_src += w_this; - x_msk += w_this; - x_dst += w_this; - } - h -= h_this; - y_src += h_this; - y_msk += h_this; - y_dst += h_this; - } - pbox++; - } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); -} - -#endif /* RENDER */ Index: xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c diff -u xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c:1.2 xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c:removed --- xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c:1.2 Thu Jan 30 19:01:45 2003 +++ xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c Sat Feb 28 21:42:13 2004 @@ -1,173 +0,0 @@ -/* - * Specialized window functions for rootless Aqua - */ -/* - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* Portions of this file are based on fbwindow.c, which contains the - * following copyright: - * - * Copyright © 1998 Keith Packard - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/aquaWindow.c,v 1.2 2003/01/31 00:01:45 torrey Exp $ */ - -#include "fb.h" -#include "aqua.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - * AquaFillRegionTiled - * Fill using a tile while leaving the alpha channel untouched. - * Based on fbfillRegionTiled. - */ -void -AquaFillRegionTiled( - DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile) -{ - FbBits *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbBits *tile; - FbStride tileStride; - int tileBpp; - int tileXoff, tileYoff; /* XXX assumed to be zero */ - int tileWidth, tileHeight; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); - int xRot = pDrawable->x; - int yRot = pDrawable->y; - FbBits planeMask; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - { - int index = pDrawable->pScreen->myNum; - if(&WindowTable[index]->drawable == pDrawable) - { - xRot -= panoramiXdataPtr[index].x; - yRot -= panoramiXdataPtr[index].y; - } - } -#endif - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, - tileXoff, tileYoff); - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - xRot += dstXoff; - yRot += dstYoff; - planeMask = FB_ALLONES & ~AquaAlphaMask(dstBpp); - - while (n--) - { - fbTile (dst + (pbox->y1 + dstYoff) * dstStride, - dstStride, - (pbox->x1 + dstXoff) * dstBpp, - (pbox->x2 - pbox->x1) * dstBpp, - pbox->y2 - pbox->y1, - tile, - tileStride, - tileWidth * dstBpp, - tileHeight, - GXcopy, - planeMask, - dstBpp, - xRot * dstBpp, - yRot - pbox->y1); - pbox++; - } -} - - -/* - * AquaPaintWindow - * Paint the window while filling in the alpha channel with all on. - * We can't use fbPaintWindow because it zeros the alpha channel. - */ -void -AquaPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - switch (what) { - case PW_BACKGROUND: - - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - AquaFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap); - break; - case BackgroundPixel: - { - Pixel pixel = pWin->background.pixel | - AquaAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - break; - } - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - Pixel pixel = pWin->border.pixel | - AquaAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - } - else - { - WindowPtr pBgWin; - for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - AquaFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap); - } - break; - } - fbValidateDrawable (&pWin->drawable); -} Index: xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h diff -u xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h:1.1 xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h:removed --- xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h Sat Feb 28 21:42:13 2004 @@ -1,15 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fakeBoxRec.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -#ifndef FAKEBOXREC_H -#define FAKEBOXREC_H - -// This struct is byte-compatible with X11's BoxRec, for use in -// code that can't include X headers. -typedef struct _fakeBox { - short x1; - short y1; - short x2; - short y2; -} fakeBoxRec; - -#endif Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen.c diff -u xc/programs/Xserver/hw/darwin/quartz/fullscreen.c:1.3 xc/programs/Xserver/hw/darwin/quartz/fullscreen.c:removed --- xc/programs/Xserver/hw/darwin/quartz/fullscreen.c:1.3 Mon Dec 9 19:00:39 2002 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen.c Sat Feb 28 21:42:13 2004 @@ -1,500 +0,0 @@ -/* - * Screen routines for full screen Quartz mode - * - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * TORREY T. LYONS 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 Torrey T. Lyons shall not - * be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from - * Torrey T. Lyons. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen.c,v 1.3 2002/12/10 00:00:39 torrey Exp $ */ - -#include "quartzCommon.h" -#include "darwin.h" -#include "colormapst.h" -#include "scrnintstr.h" -#include "micmap.h" -#include "shadow.h" - -// Full screen specific per screen storage structure -typedef struct { - CGDirectDisplayID displayID; - CFDictionaryRef xDisplayMode; - CFDictionaryRef aquaDisplayMode; - CGDirectPaletteRef xPalette; - CGDirectPaletteRef aquaPalette; - unsigned char *framebuffer; - unsigned char *shadowPtr; -} QuartzFSScreenRec, *QuartzFSScreenPtr; - -#define FULLSCREEN_PRIV(pScreen) \ - ((QuartzFSScreenPtr)pScreen->devPrivates[quartzFSScreenIndex].ptr) - -static int quartzFSScreenIndex; -static CGDirectDisplayID *quartzDisplayList = NULL; -static int quartzNumScreens = 0; -static QuartzFSScreenPtr quartzScreens[MAXSCREENS]; - -static int darwinCmapPrivateIndex = -1; -static unsigned long darwinCmapGeneration = 0; - -#define CMAP_PRIV(pCmap) \ - ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr) - -/* - ============================================================================= - - Colormap handling - - ============================================================================= -*/ - -/* - * QuartzFSInitCmapPrivates - * Colormap privates may be allocated after the default colormap has - * already been created for some screens. This initialization procedure - * is called for each default colormap that is found. - */ -static Bool -QuartzFSInitCmapPrivates( - ColormapPtr pCmap) -{ - return TRUE; -} - - -/* - * QuartzFSCreateColormap - * This is a callback from X after a new colormap is created. - * We allocate a new CoreGraphics pallete for each colormap. - */ -Bool -QuartzFSCreateColormap( - ColormapPtr pCmap) -{ - CGDirectPaletteRef pallete; - - // Allocate private storage for the hardware dependent colormap info. - if (darwinCmapGeneration != serverGeneration) { - if ((darwinCmapPrivateIndex = - AllocateColormapPrivateIndex(QuartzFSInitCmapPrivates)) < 0) - { - return FALSE; - } - darwinCmapGeneration = serverGeneration; - } - - pallete = CGPaletteCreateDefaultColorPalette(); - if (!pallete) return FALSE; - - CMAP_PRIV(pCmap) = pallete; - return TRUE; -} - - -/* - * QuartzFSDestroyColormap - * This is called by DIX FreeColormap after it has uninstalled a colormap - * and notified all interested parties. We deallocated the corresponding - * CoreGraphics pallete. - */ -void -QuartzFSDestroyColormap( - ColormapPtr pCmap) -{ - CGPaletteRelease( CMAP_PRIV(pCmap) ); -} - - -/* - * QuartzFSInstallColormap - * Set the current CoreGraphics pallete to the pallete corresponding - * to the provided colormap. - */ -void -QuartzFSInstallColormap( - ColormapPtr pCmap) -{ - CGDirectPaletteRef palette = CMAP_PRIV(pCmap); - ScreenPtr pScreen = pCmap->pScreen; - QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - - // Inform all interested parties that the map is being changed. - miInstallColormap(pCmap); - - if (quartzServerVisible) - CGDisplaySetPalette(fsDisplayInfo->displayID, palette); - - fsDisplayInfo->xPalette = palette; -} - - -/* - * QuartzFSStoreColors - * This is a callback from X to change the hardware colormap - * when using PsuedoColor in full screen mode. - */ -static void -QuartzFSStoreColors( - ColormapPtr pCmap, - int numEntries, - xColorItem *pdefs) -{ - CGDirectPaletteRef palette = CMAP_PRIV(pCmap); - ScreenPtr pScreen = pCmap->pScreen; - QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - CGDeviceColor color; - int i; - - if (! palette) - return; - - for (i = 0; i < numEntries; i++) { - color.red = pdefs[i].red / 65535.0; - color.green = pdefs[i].green / 65535.0; - color.blue = pdefs[i].blue / 65535.0; - CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel); - } - - // Update hardware colormap - if (quartzServerVisible) - CGDisplaySetPalette(fsDisplayInfo->displayID, palette); -} - - -/* - ============================================================================= - - Screen initialization - - ============================================================================= -*/ - -/* - * QuartzFSDisplayInit - * Full screen specific initialization called from InitOutput. - */ -void QuartzFSDisplayInit(void) -{ - static unsigned long generation = 0; - CGDisplayCount quartzDisplayCount = 0; - - // Allocate private storage for each screen's mode specific info - if (generation != serverGeneration) { - quartzFSScreenIndex = AllocateScreenPrivateIndex(); - generation = serverGeneration; - } - - // Find all the CoreGraphics displays - CGGetActiveDisplayList(0, NULL, &quartzDisplayCount); - quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID)); - CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList, - &quartzDisplayCount); - - darwinScreensFound = quartzDisplayCount; - atexit(QuartzFSRelease); -} - - -/* - * QuartzFSFindDisplayMode - * Find the appropriate display mode to use in full screen mode. - * If display mode is not the same as the current Aqua mode, switch - * to the new mode. - */ -static Bool QuartzFSFindDisplayMode( - QuartzFSScreenPtr fsDisplayInfo) -{ - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - size_t height, width, bpp; - boolean_t exactMatch; - - fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); - - // If no user options, use current display mode - if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 && - darwinDesiredRefresh == -1) - { - fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; - return TRUE; - } - - // If the user has no choice for size, use current - if (darwinDesiredWidth == 0) { - width = CGDisplayPixelsWide(cgID); - height = CGDisplayPixelsHigh(cgID); - } else { - width = darwinDesiredWidth; - height = darwinDesiredHeight; - } - - switch (darwinDesiredDepth) { - case 0: - bpp = 8; - break; - case 1: - bpp = 16; - break; - case 2: - bpp = 32; - break; - default: - bpp = CGDisplayBitsPerPixel(cgID); - } - - if (darwinDesiredRefresh == -1) { - fsDisplayInfo->xDisplayMode = - CGDisplayBestModeForParameters(cgID, bpp, width, height, - &exactMatch); - } else { - fsDisplayInfo->xDisplayMode = - CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp, - width, height, darwinDesiredRefresh, &exactMatch); - } - if (!exactMatch) { - fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; - return FALSE; - } - - // Switch to the new display mode - CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); - return TRUE; -} - - -/* - * QuartzFSAddScreen - * Do initialization of each screen for Quartz in full screen mode. - */ -Bool QuartzFSAddScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); - CGDirectDisplayID cgID = quartzDisplayList[index]; - CGRect bounds; - QuartzFSScreenPtr fsDisplayInfo; - - // Allocate space for private per screen fullscreen specific storage. - fsDisplayInfo = xalloc(sizeof(QuartzFSScreenRec)); - FULLSCREEN_PRIV(pScreen) = fsDisplayInfo; - - displayInfo->displayCount = 1; - displayInfo->displayIDs = xrealloc(displayInfo->displayIDs, - 1 * sizeof(CGDirectDisplayID)); - displayInfo->displayIDs[0] = cgID; - - fsDisplayInfo->displayID = cgID; - fsDisplayInfo->xDisplayMode = 0; - fsDisplayInfo->aquaDisplayMode = 0; - fsDisplayInfo->xPalette = 0; - fsDisplayInfo->aquaPalette = 0; - - // Capture full screen because X doesn't like read-only framebuffer. - // We need to do this before we (potentially) switch the display mode. - CGDisplayCapture(cgID); - - if (! QuartzFSFindDisplayMode(fsDisplayInfo)) { - ErrorF("Could not support specified display mode on screen %i.\n", - index); - xfree(fsDisplayInfo); - return FALSE; - } - - // Don't need to flip y-coordinate as CoreGraphics treats (0, 0) - // as the top left of main screen. - bounds = CGDisplayBounds(cgID); - dfb->x = bounds.origin.x; - dfb->y = bounds.origin.y; - dfb->width = bounds.size.width; - dfb->height = bounds.size.height; - dfb->pitch = CGDisplayBytesPerRow(cgID); - dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID); - - if (dfb->bitsPerPixel == 8) { - if (CGDisplayCanSetPalette(cgID)) { - dfb->colorType = PseudoColor; - } else { - dfb->colorType = StaticColor; - } - dfb->bitsPerComponent = 8; - dfb->colorBitsPerPixel = 8; - } else { - dfb->colorType = TrueColor; - dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID); - dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) * - dfb->bitsPerComponent; - } - - fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID); - - // allocate shadow framebuffer - fsDisplayInfo->shadowPtr = shadowAlloc(dfb->width, dfb->height, - dfb->bitsPerPixel); - dfb->framebuffer = fsDisplayInfo->shadowPtr; - - return TRUE; -} - - -/* - * QuartzFSShadowUpdate - * Update the damaged regions of the shadow framebuffer on the display. - */ -static void QuartzFSShadowUpdate(ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - RegionPtr damage = &pBuf->damage; - int numBox = REGION_NUM_RECTS(damage); - BoxPtr pBox = REGION_RECTS(damage); - int pitch = dfb->pitch; - int bpp = dfb->bitsPerPixel/8; - - // Don't update if the X server is not visible - if (!quartzServerVisible) - return; - - // Loop through all the damaged boxes - while (numBox--) { - int width, height, offset; - unsigned char *src, *dst; - - width = (pBox->x2 - pBox->x1) * bpp; - height = pBox->y2 - pBox->y1; - offset = (pBox->y1 * pitch) + (pBox->x1 * bpp); - src = fsDisplayInfo->shadowPtr + offset; - dst = fsDisplayInfo->framebuffer + offset; - - while (height--) { - memcpy(dst, src, width); - dst += pitch; - src += pitch; - } - - // Get the next box - pBox++; - } -} - - -/* - * QuartzFSSetupScreen - * Finalize full screen specific setup of each screen. - */ -Bool QuartzFSSetupScreen( - int index, - ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzFSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - // Initialize shadow framebuffer support - if (! shadowInit(pScreen, QuartzFSShadowUpdate, NULL)) { - ErrorF("Failed to initalize shadow framebuffer for screen %i.\n", - index); - return FALSE; - } - - if (dfb->colorType == PseudoColor) { - // Initialize colormap handling - size_t aquaBpp; - - // If Aqua is using 8 bits we need to keep track of its pallete. - CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode, - kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp); - if (aquaBpp <= 8) - fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID); - - pScreen->CreateColormap = QuartzFSCreateColormap; - pScreen->DestroyColormap = QuartzFSDestroyColormap; - pScreen->InstallColormap = QuartzFSInstallColormap; - pScreen->StoreColors = QuartzFSStoreColors; - - } - - quartzScreens[quartzNumScreens++] = fsDisplayInfo; - return TRUE; -} - - -/* - ============================================================================= - - Switching between Aqua and X - - ============================================================================= -*/ - -/* - * QuartzFSCapture - * Capture the screen so we can draw. Called directly from the main thread - * to synchronize with hiding the menubar. - */ -void QuartzFSCapture(void) -{ - int i; - - if (quartzRootless) return; - - for (i = 0; i < quartzNumScreens; i++) { - QuartzFSScreenPtr fsDisplayInfo = quartzScreens[i]; - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - if (!CGDisplayIsCaptured(cgID)) { - CGDisplayCapture(cgID); - fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); - if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) - CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); - if (fsDisplayInfo->xPalette) - CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette); - } - } -} - - -/* - * QuartzFSRelease - * Release the screen so others can draw. - */ -void QuartzFSRelease(void) -{ - int i; - - if (quartzRootless) return; - - for (i = 0; i < quartzNumScreens; i++) { - QuartzFSScreenPtr fsDisplayInfo = quartzScreens[i]; - CGDirectDisplayID cgID = fsDisplayInfo->displayID; - - if (CGDisplayIsCaptured(cgID)) { - if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) - CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode); - if (fsDisplayInfo->aquaPalette) - CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette); - CGDisplayRelease(cgID); - } - } -} Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen.h diff -u xc/programs/Xserver/hw/darwin/quartz/fullscreen.h:1.1 xc/programs/Xserver/hw/darwin/quartz/fullscreen.h:removed --- xc/programs/Xserver/hw/darwin/quartz/fullscreen.h:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen.h Sat Feb 28 21:42:13 2004 @@ -1,33 +0,0 @@ -/* - * External interface for full screen Quartz mode - * - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * TORREY T. LYONS 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 Torrey T. Lyons shall not - * be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from - * Torrey T. Lyons. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ - -void QuartzFSDisplayInit(void); -Bool QuartzFSAddScreen(int index, ScreenPtr pScreen); -Bool QuartzFSSetupScreen(int index, ScreenPtr pScreen); Index: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c Sat Nov 1 03:13:08 2003 @@ -0,0 +1,909 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c,v 1.1 2003/11/01 08:13:08 torrey Exp $ + * + * This module converts keysym values into the corresponding ISO 10646 + * (UCS, Unicode) values. + * + * The array keysymtab[] contains pairs of X11 keysym values for graphical + * characters and the corresponding Unicode value. The function + * keysym2ucs() maps a keysym onto a Unicode value using a binary search, + * therefore keysymtab[] must remain SORTED by keysym value. + * + * The keysym -> UTF-8 conversion will hopefully one day be provided + * by Xlib via XmbLookupString() and should ideally not have to be + * done in X applications. But we are not there yet. + * + * We allow to represent any UCS character in the range U-00000000 to + * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff. + * This admittedly does not cover the entire 31-bit space of UCS, but + * it does cover all of the characters up to U-10FFFF, which can be + * represented by UTF-16, and more, and it is very unlikely that higher + * UCS codes will ever be assigned by ISO. So to get Unicode character + * U+ABCD you can directly use keysym 0x0100abcd. + * + * NOTE: The comments in the table below contain the actual character + * encoded in UTF-8, so for viewing and editing best use an editor in + * UTF-8 mode. + * + * Author: Markus G. Kuhn , University of Cambridge, April 2001 + * + * Special thanks to Richard Verhoeven for preparing + * an initial draft of the mapping table. + * + * This software is in the public domain. Share and enjoy! + * + * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl) + */ + +#include "keysym2ucs.h" + +#include +#include + +struct codepair { + unsigned short keysym; + unsigned short ucs; +}; + +const static struct codepair keysymtab[] = { + { 0x01a1, 0x0104 }, + { 0x01a2, 0x02d8 }, + { 0x01a3, 0x0141 }, + { 0x01a5, 0x013d }, + { 0x01a6, 0x015a }, + { 0x01a9, 0x0160 }, + { 0x01aa, 0x015e }, + { 0x01ab, 0x0164 }, + { 0x01ac, 0x0179 }, + { 0x01ae, 0x017d }, + { 0x01af, 0x017b }, + { 0x01b1, 0x0105 }, + { 0x01b2, 0x02db }, + { 0x01b3, 0x0142 }, + { 0x01b5, 0x013e }, + { 0x01b6, 0x015b }, + { 0x01b7, 0x02c7 }, + { 0x01b9, 0x0161 }, + { 0x01ba, 0x015f }, + { 0x01bb, 0x0165 }, + { 0x01bc, 0x017a }, + { 0x01bd, 0x02dd }, + { 0x01be, 0x017e }, + { 0x01bf, 0x017c }, + { 0x01c0, 0x0154 }, + { 0x01c3, 0x0102 }, + { 0x01c5, 0x0139 }, + { 0x01c6, 0x0106 }, + { 0x01c8, 0x010c }, + { 0x01ca, 0x0118 }, + { 0x01cc, 0x011a }, + { 0x01cf, 0x010e }, + { 0x01d0, 0x0110 }, + { 0x01d1, 0x0143 }, + { 0x01d2, 0x0147 }, + { 0x01d5, 0x0150 }, + { 0x01d8, 0x0158 }, + { 0x01d9, 0x016e }, + { 0x01db, 0x0170 }, + { 0x01de, 0x0162 }, + { 0x01e0, 0x0155 }, + { 0x01e3, 0x0103 }, + { 0x01e5, 0x013a }, + { 0x01e6, 0x0107 }, + { 0x01e8, 0x010d }, + { 0x01ea, 0x0119 }, + { 0x01ec, 0x011b }, + { 0x01ef, 0x010f }, + { 0x01f0, 0x0111 }, + { 0x01f1, 0x0144 }, + { 0x01f2, 0x0148 }, + { 0x01f5, 0x0151 }, + { 0x01f8, 0x0159 }, + { 0x01f9, 0x016f }, + { 0x01fb, 0x0171 }, + { 0x01fe, 0x0163 }, + { 0x01ff, 0x02d9 }, + { 0x02a1, 0x0126 }, + { 0x02a6, 0x0124 }, + { 0x02a9, 0x0130 }, + { 0x02ab, 0x011e }, + { 0x02ac, 0x0134 }, + { 0x02b1, 0x0127 }, + { 0x02b6, 0x0125 }, + { 0x02b9, 0x0131 }, + { 0x02bb, 0x011f }, + { 0x02bc, 0x0135 }, + { 0x02c5, 0x010a }, + { 0x02c6, 0x0108 }, + { 0x02d5, 0x0120 }, + { 0x02d8, 0x011c }, + { 0x02dd, 0x016c }, + { 0x02de, 0x015c }, + { 0x02e5, 0x010b }, + { 0x02e6, 0x0109 }, + { 0x02f5, 0x0121 }, + { 0x02f8, 0x011d }, + { 0x02fd, 0x016d }, + { 0x02fe, 0x015d }, + { 0x03a2, 0x0138 }, + { 0x03a3, 0x0156 }, + { 0x03a5, 0x0128 }, + { 0x03a6, 0x013b }, + { 0x03aa, 0x0112 }, + { 0x03ab, 0x0122 }, + { 0x03ac, 0x0166 }, + { 0x03b3, 0x0157 }, + { 0x03b5, 0x0129 }, + { 0x03b6, 0x013c }, + { 0x03ba, 0x0113 }, + { 0x03bb, 0x0123 }, + { 0x03bc, 0x0167 }, + { 0x03bd, 0x014a }, + { 0x03bf, 0x014b }, + { 0x03c0, 0x0100 }, + { 0x03c7, 0x012e }, + { 0x03cc, 0x0116 }, + { 0x03cf, 0x012a }, + { 0x03d1, 0x0145 }, + { 0x03d2, 0x014c }, + { 0x03d3, 0x0136 }, + { 0x03d9, 0x0172 }, + { 0x03dd, 0x0168 }, + { 0x03de, 0x016a }, + { 0x03e0, 0x0101 }, + { 0x03e7, 0x012f }, + { 0x03ec, 0x0117 }, + { 0x03ef, 0x012b }, + { 0x03f1, 0x0146 }, + { 0x03f2, 0x014d }, + { 0x03f3, 0x0137 }, + { 0x03f9, 0x0173 }, + { 0x03fd, 0x0169 }, + { 0x03fe, 0x016b }, + { 0x047e, 0x203e }, + { 0x04a1, 0x3002 }, + { 0x04a2, 0x300c }, + { 0x04a3, 0x300d }, + { 0x04a4, 0x3001 }, + { 0x04a5, 0x30fb }, + { 0x04a6, 0x30f2 }, + { 0x04a7, 0x30a1 }, + { 0x04a8, 0x30a3 }, + { 0x04a9, 0x30a5 }, + { 0x04aa, 0x30a7 }, + { 0x04ab, 0x30a9 }, + { 0x04ac, 0x30e3 }, + { 0x04ad, 0x30e5 }, + { 0x04ae, 0x30e7 }, + { 0x04af, 0x30c3 }, + { 0x04b0, 0x30fc }, + { 0x04b1, 0x30a2 }, + { 0x04b2, 0x30a4 }, + { 0x04b3, 0x30a6 }, + { 0x04b4, 0x30a8 }, + { 0x04b5, 0x30aa }, + { 0x04b6, 0x30ab }, + { 0x04b7, 0x30ad }, + { 0x04b8, 0x30af }, + { 0x04b9, 0x30b1 }, + { 0x04ba, 0x30b3 }, + { 0x04bb, 0x30b5 }, + { 0x04bc, 0x30b7 }, + { 0x04bd, 0x30b9 }, + { 0x04be, 0x30bb }, + { 0x04bf, 0x30bd }, + { 0x04c0, 0x30bf }, + { 0x04c1, 0x30c1 }, + { 0x04c2, 0x30c4 }, + { 0x04c3, 0x30c6 }, + { 0x04c4, 0x30c8 }, + { 0x04c5, 0x30ca }, + { 0x04c6, 0x30cb }, + { 0x04c7, 0x30cc }, + { 0x04c8, 0x30cd }, + { 0x04c9, 0x30ce }, + { 0x04ca, 0x30cf }, + { 0x04cb, 0x30d2 }, + { 0x04cc, 0x30d5 }, + { 0x04cd, 0x30d8 }, + { 0x04ce, 0x30db }, + { 0x04cf, 0x30de }, + { 0x04d0, 0x30df }, + { 0x04d1, 0x30e0 }, + { 0x04d2, 0x30e1 }, + { 0x04d3, 0x30e2 }, + { 0x04d4, 0x30e4 }, + { 0x04d5, 0x30e6 }, + { 0x04d6, 0x30e8 }, + { 0x04d7, 0x30e9 }, + { 0x04d8, 0x30ea }, + { 0x04d9, 0x30eb }, + { 0x04da, 0x30ec }, + { 0x04db, 0x30ed }, + { 0x04dc, 0x30ef }, + { 0x04dd, 0x30f3 }, + { 0x04de, 0x309b }, + { 0x04df, 0x309c }, + { 0x05ac, 0x060c }, + { 0x05bb, 0x061b }, + { 0x05bf, 0x061f }, + { 0x05c1, 0x0621 }, + { 0x05c2, 0x0622 }, + { 0x05c3, 0x0623 }, + { 0x05c4, 0x0624 }, + { 0x05c5, 0x0625 }, + { 0x05c6, 0x0626 }, + { 0x05c7, 0x0627 }, + { 0x05c8, 0x0628 }, + { 0x05c9, 0x0629 }, + { 0x05ca, 0x062a }, + { 0x05cb, 0x062b }, + { 0x05cc, 0x062c }, + { 0x05cd, 0x062d }, + { 0x05ce, 0x062e }, + { 0x05cf, 0x062f }, + { 0x05d0, 0x0630 }, + { 0x05d1, 0x0631 }, + { 0x05d2, 0x0632 }, + { 0x05d3, 0x0633 }, + { 0x05d4, 0x0634 }, + { 0x05d5, 0x0635 }, + { 0x05d6, 0x0636 }, + { 0x05d7, 0x0637 }, + { 0x05d8, 0x0638 }, + { 0x05d9, 0x0639 }, + { 0x05da, 0x063a }, + { 0x05e0, 0x0640 }, + { 0x05e1, 0x0641 }, + { 0x05e2, 0x0642 }, + { 0x05e3, 0x0643 }, + { 0x05e4, 0x0644 }, + { 0x05e5, 0x0645 }, + { 0x05e6, 0x0646 }, + { 0x05e7, 0x0647 }, + { 0x05e8, 0x0648 }, + { 0x05e9, 0x0649 }, + { 0x05ea, 0x064a }, + { 0x05eb, 0x064b }, + { 0x05ec, 0x064c }, + { 0x05ed, 0x064d }, + { 0x05ee, 0x064e }, + { 0x05ef, 0x064f }, + { 0x05f0, 0x0650 }, + { 0x05f1, 0x0651 }, + { 0x05f2, 0x0652 }, + { 0x06a1, 0x0452 }, + { 0x06a2, 0x0453 }, + { 0x06a3, 0x0451 }, + { 0x06a4, 0x0454 }, + { 0x06a5, 0x0455 }, + { 0x06a6, 0x0456 }, + { 0x06a7, 0x0457 }, + { 0x06a8, 0x0458 }, + { 0x06a9, 0x0459 }, + { 0x06aa, 0x045a }, + { 0x06ab, 0x045b }, + { 0x06ac, 0x045c }, + { 0x06ae, 0x045e }, + { 0x06af, 0x045f }, + { 0x06b0, 0x2116 }, + { 0x06b1, 0x0402 }, + { 0x06b2, 0x0403 }, + { 0x06b3, 0x0401 }, + { 0x06b4, 0x0404 }, + { 0x06b5, 0x0405 }, + { 0x06b6, 0x0406 }, + { 0x06b7, 0x0407 }, + { 0x06b8, 0x0408 }, + { 0x06b9, 0x0409 }, + { 0x06ba, 0x040a }, + { 0x06bb, 0x040b }, + { 0x06bc, 0x040c }, + { 0x06be, 0x040e }, + { 0x06bf, 0x040f }, + { 0x06c0, 0x044e }, + { 0x06c1, 0x0430 }, + { 0x06c2, 0x0431 }, + { 0x06c3, 0x0446 }, + { 0x06c4, 0x0434 }, + { 0x06c5, 0x0435 }, + { 0x06c6, 0x0444 }, + { 0x06c7, 0x0433 }, + { 0x06c8, 0x0445 }, + { 0x06c9, 0x0438 }, + { 0x06ca, 0x0439 }, + { 0x06cb, 0x043a }, + { 0x06cc, 0x043b }, + { 0x06cd, 0x043c }, + { 0x06ce, 0x043d }, + { 0x06cf, 0x043e }, + { 0x06d0, 0x043f }, + { 0x06d1, 0x044f }, + { 0x06d2, 0x0440 }, + { 0x06d3, 0x0441 }, + { 0x06d4, 0x0442 }, + { 0x06d5, 0x0443 }, + { 0x06d6, 0x0436 }, + { 0x06d7, 0x0432 }, + { 0x06d8, 0x044c }, + { 0x06d9, 0x044b }, + { 0x06da, 0x0437 }, + { 0x06db, 0x0448 }, + { 0x06dc, 0x044d }, + { 0x06dd, 0x0449 }, + { 0x06de, 0x0447 }, + { 0x06df, 0x044a }, + { 0x06e0, 0x042e }, + { 0x06e1, 0x0410 }, + { 0x06e2, 0x0411 }, + { 0x06e3, 0x0426 }, + { 0x06e4, 0x0414 }, + { 0x06e5, 0x0415 }, + { 0x06e6, 0x0424 }, + { 0x06e7, 0x0413 }, + { 0x06e8, 0x0425 }, + { 0x06e9, 0x0418 }, + { 0x06ea, 0x0419 }, + { 0x06eb, 0x041a }, + { 0x06ec, 0x041b }, + { 0x06ed, 0x041c }, + { 0x06ee, 0x041d }, + { 0x06ef, 0x041e }, + { 0x06f0, 0x041f }, + { 0x06f1, 0x042f }, + { 0x06f2, 0x0420 }, + { 0x06f3, 0x0421 }, + { 0x06f4, 0x0422 }, + { 0x06f5, 0x0423 }, + { 0x06f6, 0x0416 }, + { 0x06f7, 0x0412 }, + { 0x06f8, 0x042c }, + { 0x06f9, 0x042b }, + { 0x06fa, 0x0417 }, + { 0x06fb, 0x0428 }, + { 0x06fc, 0x042d }, + { 0x06fd, 0x0429 }, + { 0x06fe, 0x0427 }, + { 0x06ff, 0x042a }, + { 0x07a1, 0x0386 }, + { 0x07a2, 0x0388 }, + { 0x07a3, 0x0389 }, + { 0x07a4, 0x038a }, + { 0x07a5, 0x03aa }, + { 0x07a7, 0x038c }, + { 0x07a8, 0x038e }, + { 0x07a9, 0x03ab }, + { 0x07ab, 0x038f }, + { 0x07ae, 0x0385 }, + { 0x07af, 0x2015 }, + { 0x07b1, 0x03ac }, + { 0x07b2, 0x03ad }, + { 0x07b3, 0x03ae }, + { 0x07b4, 0x03af }, + { 0x07b5, 0x03ca }, + { 0x07b6, 0x0390 }, + { 0x07b7, 0x03cc }, + { 0x07b8, 0x03cd }, + { 0x07b9, 0x03cb }, + { 0x07ba, 0x03b0 }, + { 0x07bb, 0x03ce }, + { 0x07c1, 0x0391 }, + { 0x07c2, 0x0392 }, + { 0x07c3, 0x0393 }, + { 0x07c4, 0x0394 }, + { 0x07c5, 0x0395 }, + { 0x07c6, 0x0396 }, + { 0x07c7, 0x0397 }, + { 0x07c8, 0x0398 }, + { 0x07c9, 0x0399 }, + { 0x07ca, 0x039a }, + { 0x07cb, 0x039b }, + { 0x07cc, 0x039c }, + { 0x07cd, 0x039d }, + { 0x07ce, 0x039e }, + { 0x07cf, 0x039f }, + { 0x07d0, 0x03a0 }, + { 0x07d1, 0x03a1 }, + { 0x07d2, 0x03a3 }, + { 0x07d4, 0x03a4 }, + { 0x07d5, 0x03a5 }, + { 0x07d6, 0x03a6 }, + { 0x07d7, 0x03a7 }, + { 0x07d8, 0x03a8 }, + { 0x07d9, 0x03a9 }, + { 0x07e1, 0x03b1 }, + { 0x07e2, 0x03b2 }, + { 0x07e3, 0x03b3 }, + { 0x07e4, 0x03b4 }, + { 0x07e5, 0x03b5 }, + { 0x07e6, 0x03b6 }, + { 0x07e7, 0x03b7 }, + { 0x07e8, 0x03b8 }, + { 0x07e9, 0x03b9 }, + { 0x07ea, 0x03ba }, + { 0x07eb, 0x03bb }, + { 0x07ec, 0x03bc }, + { 0x07ed, 0x03bd }, + { 0x07ee, 0x03be }, + { 0x07ef, 0x03bf }, + { 0x07f0, 0x03c0 }, + { 0x07f1, 0x03c1 }, + { 0x07f2, 0x03c3 }, + { 0x07f3, 0x03c2 }, + { 0x07f4, 0x03c4 }, + { 0x07f5, 0x03c5 }, + { 0x07f6, 0x03c6 }, + { 0x07f7, 0x03c7 }, + { 0x07f8, 0x03c8 }, + { 0x07f9, 0x03c9 }, + { 0x08a1, 0x23b7 }, + { 0x08a2, 0x250c }, + { 0x08a3, 0x2500 }, + { 0x08a4, 0x2320 }, + { 0x08a5, 0x2321 }, + { 0x08a6, 0x2502 }, + { 0x08a7, 0x23a1 }, + { 0x08a8, 0x23a3 }, + { 0x08a9, 0x23a4 }, + { 0x08aa, 0x23a6 }, + { 0x08ab, 0x239b }, + { 0x08ac, 0x239d }, + { 0x08ad, 0x239e }, + { 0x08ae, 0x23a0 }, + { 0x08af, 0x23a8 }, + { 0x08b0, 0x23ac }, + { 0x08bc, 0x2264 }, + { 0x08bd, 0x2260 }, + { 0x08be, 0x2265 }, + { 0x08bf, 0x222b }, + { 0x08c0, 0x2234 }, + { 0x08c1, 0x221d }, + { 0x08c2, 0x221e }, + { 0x08c5, 0x2207 }, + { 0x08c8, 0x223c }, + { 0x08c9, 0x2243 }, + { 0x08cd, 0x21d4 }, + { 0x08ce, 0x21d2 }, + { 0x08cf, 0x2261 }, + { 0x08d6, 0x221a }, + { 0x08da, 0x2282 }, + { 0x08db, 0x2283 }, + { 0x08dc, 0x2229 }, + { 0x08dd, 0x222a }, + { 0x08de, 0x2227 }, + { 0x08df, 0x2228 }, + { 0x08ef, 0x2202 }, + { 0x08f6, 0x0192 }, + { 0x08fb, 0x2190 }, + { 0x08fc, 0x2191 }, + { 0x08fd, 0x2192 }, + { 0x08fe, 0x2193 }, + { 0x09e0, 0x25c6 }, + { 0x09e1, 0x2592 }, + { 0x09e2, 0x2409 }, + { 0x09e3, 0x240c }, + { 0x09e4, 0x240d }, + { 0x09e5, 0x240a }, + { 0x09e8, 0x2424 }, + { 0x09e9, 0x240b }, + { 0x09ea, 0x2518 }, + { 0x09eb, 0x2510 }, + { 0x09ec, 0x250c }, + { 0x09ed, 0x2514 }, + { 0x09ee, 0x253c }, + { 0x09ef, 0x23ba }, + { 0x09f0, 0x23bb }, + { 0x09f1, 0x2500 }, + { 0x09f2, 0x23bc }, + { 0x09f3, 0x23bd }, + { 0x09f4, 0x251c }, + { 0x09f5, 0x2524 }, + { 0x09f6, 0x2534 }, + { 0x09f7, 0x252c }, + { 0x09f8, 0x2502 }, + { 0x0aa1, 0x2003 }, + { 0x0aa2, 0x2002 }, + { 0x0aa3, 0x2004 }, + { 0x0aa4, 0x2005 }, + { 0x0aa5, 0x2007 }, + { 0x0aa6, 0x2008 }, + { 0x0aa7, 0x2009 }, + { 0x0aa8, 0x200a }, + { 0x0aa9, 0x2014 }, + { 0x0aaa, 0x2013 }, + { 0x0aae, 0x2026 }, + { 0x0aaf, 0x2025 }, + { 0x0ab0, 0x2153 }, + { 0x0ab1, 0x2154 }, + { 0x0ab2, 0x2155 }, + { 0x0ab3, 0x2156 }, + { 0x0ab4, 0x2157 }, + { 0x0ab5, 0x2158 }, + { 0x0ab6, 0x2159 }, + { 0x0ab7, 0x215a }, + { 0x0ab8, 0x2105 }, + { 0x0abb, 0x2012 }, + { 0x0abc, 0x2329 }, + { 0x0abe, 0x232a }, + { 0x0ac3, 0x215b }, + { 0x0ac4, 0x215c }, + { 0x0ac5, 0x215d }, + { 0x0ac6, 0x215e }, + { 0x0ac9, 0x2122 }, + { 0x0aca, 0x2613 }, + { 0x0acc, 0x25c1 }, + { 0x0acd, 0x25b7 }, + { 0x0ace, 0x25cb }, + { 0x0acf, 0x25af }, + { 0x0ad0, 0x2018 }, + { 0x0ad1, 0x2019 }, + { 0x0ad2, 0x201c }, + { 0x0ad3, 0x201d }, + { 0x0ad4, 0x211e }, + { 0x0ad6, 0x2032 }, + { 0x0ad7, 0x2033 }, + { 0x0ad9, 0x271d }, + { 0x0adb, 0x25ac }, + { 0x0adc, 0x25c0 }, + { 0x0add, 0x25b6 }, + { 0x0ade, 0x25cf }, + { 0x0adf, 0x25ae }, + { 0x0ae0, 0x25e6 }, + { 0x0ae1, 0x25ab }, + { 0x0ae2, 0x25ad }, + { 0x0ae3, 0x25b3 }, + { 0x0ae4, 0x25bd }, + { 0x0ae5, 0x2606 }, + { 0x0ae6, 0x2022 }, + { 0x0ae7, 0x25aa }, + { 0x0ae8, 0x25b2 }, + { 0x0ae9, 0x25bc }, + { 0x0aea, 0x261c }, + { 0x0aeb, 0x261e }, + { 0x0aec, 0x2663 }, + { 0x0aed, 0x2666 }, + { 0x0aee, 0x2665 }, + { 0x0af0, 0x2720 }, + { 0x0af1, 0x2020 }, + { 0x0af2, 0x2021 }, + { 0x0af3, 0x2713 }, + { 0x0af4, 0x2717 }, + { 0x0af5, 0x266f }, + { 0x0af6, 0x266d }, + { 0x0af7, 0x2642 }, + { 0x0af8, 0x2640 }, + { 0x0af9, 0x260e }, + { 0x0afa, 0x2315 }, + { 0x0afb, 0x2117 }, + { 0x0afc, 0x2038 }, + { 0x0afd, 0x201a }, + { 0x0afe, 0x201e }, + { 0x0ba3, 0x003c }, + { 0x0ba6, 0x003e }, + { 0x0ba8, 0x2228 }, + { 0x0ba9, 0x2227 }, + { 0x0bc0, 0x00af }, + { 0x0bc2, 0x22a5 }, + { 0x0bc3, 0x2229 }, + { 0x0bc4, 0x230a }, + { 0x0bc6, 0x005f }, + { 0x0bca, 0x2218 }, + { 0x0bcc, 0x2395 }, + { 0x0bce, 0x22a4 }, + { 0x0bcf, 0x25cb }, + { 0x0bd3, 0x2308 }, + { 0x0bd6, 0x222a }, + { 0x0bd8, 0x2283 }, + { 0x0bda, 0x2282 }, + { 0x0bdc, 0x22a2 }, + { 0x0bfc, 0x22a3 }, + { 0x0cdf, 0x2017 }, + { 0x0ce0, 0x05d0 }, + { 0x0ce1, 0x05d1 }, + { 0x0ce2, 0x05d2 }, + { 0x0ce3, 0x05d3 }, + { 0x0ce4, 0x05d4 }, + { 0x0ce5, 0x05d5 }, + { 0x0ce6, 0x05d6 }, + { 0x0ce7, 0x05d7 }, + { 0x0ce8, 0x05d8 }, + { 0x0ce9, 0x05d9 }, + { 0x0cea, 0x05da }, + { 0x0ceb, 0x05db }, + { 0x0cec, 0x05dc }, + { 0x0ced, 0x05dd }, + { 0x0cee, 0x05de }, + { 0x0cef, 0x05df }, + { 0x0cf0, 0x05e0 }, + { 0x0cf1, 0x05e1 }, + { 0x0cf2, 0x05e2 }, + { 0x0cf3, 0x05e3 }, + { 0x0cf4, 0x05e4 }, + { 0x0cf5, 0x05e5 }, + { 0x0cf6, 0x05e6 }, + { 0x0cf7, 0x05e7 }, + { 0x0cf8, 0x05e8 }, + { 0x0cf9, 0x05e9 }, + { 0x0cfa, 0x05ea }, + { 0x0da1, 0x0e01 }, + { 0x0da2, 0x0e02 }, + { 0x0da3, 0x0e03 }, + { 0x0da4, 0x0e04 }, + { 0x0da5, 0x0e05 }, + { 0x0da6, 0x0e06 }, + { 0x0da7, 0x0e07 }, + { 0x0da8, 0x0e08 }, + { 0x0da9, 0x0e09 }, + { 0x0daa, 0x0e0a }, + { 0x0dab, 0x0e0b }, + { 0x0dac, 0x0e0c }, + { 0x0dad, 0x0e0d }, + { 0x0dae, 0x0e0e }, + { 0x0daf, 0x0e0f }, + { 0x0db0, 0x0e10 }, + { 0x0db1, 0x0e11 }, + { 0x0db2, 0x0e12 }, + { 0x0db3, 0x0e13 }, + { 0x0db4, 0x0e14 }, + { 0x0db5, 0x0e15 }, + { 0x0db6, 0x0e16 }, + { 0x0db7, 0x0e17 }, + { 0x0db8, 0x0e18 }, + { 0x0db9, 0x0e19 }, + { 0x0dba, 0x0e1a }, + { 0x0dbb, 0x0e1b }, + { 0x0dbc, 0x0e1c }, + { 0x0dbd, 0x0e1d }, + { 0x0dbe, 0x0e1e }, + { 0x0dbf, 0x0e1f }, + { 0x0dc0, 0x0e20 }, + { 0x0dc1, 0x0e21 }, + { 0x0dc2, 0x0e22 }, + { 0x0dc3, 0x0e23 }, + { 0x0dc4, 0x0e24 }, + { 0x0dc5, 0x0e25 }, + { 0x0dc6, 0x0e26 }, + { 0x0dc7, 0x0e27 }, + { 0x0dc8, 0x0e28 }, + { 0x0dc9, 0x0e29 }, + { 0x0dca, 0x0e2a }, + { 0x0dcb, 0x0e2b }, + { 0x0dcc, 0x0e2c }, + { 0x0dcd, 0x0e2d }, + { 0x0dce, 0x0e2e }, + { 0x0dcf, 0x0e2f }, + { 0x0dd0, 0x0e30 }, + { 0x0dd1, 0x0e31 }, + { 0x0dd2, 0x0e32 }, + { 0x0dd3, 0x0e33 }, + { 0x0dd4, 0x0e34 }, + { 0x0dd5, 0x0e35 }, + { 0x0dd6, 0x0e36 }, + { 0x0dd7, 0x0e37 }, + { 0x0dd8, 0x0e38 }, + { 0x0dd9, 0x0e39 }, + { 0x0dda, 0x0e3a }, + { 0x0ddf, 0x0e3f }, + { 0x0de0, 0x0e40 }, + { 0x0de1, 0x0e41 }, + { 0x0de2, 0x0e42 }, + { 0x0de3, 0x0e43 }, + { 0x0de4, 0x0e44 }, + { 0x0de5, 0x0e45 }, + { 0x0de6, 0x0e46 }, + { 0x0de7, 0x0e47 }, + { 0x0de8, 0x0e48 }, + { 0x0de9, 0x0e49 }, + { 0x0dea, 0x0e4a }, + { 0x0deb, 0x0e4b }, + { 0x0dec, 0x0e4c }, + { 0x0ded, 0x0e4d }, + { 0x0df0, 0x0e50 }, + { 0x0df1, 0x0e51 }, + { 0x0df2, 0x0e52 }, + { 0x0df3, 0x0e53 }, + { 0x0df4, 0x0e54 }, + { 0x0df5, 0x0e55 }, + { 0x0df6, 0x0e56 }, + { 0x0df7, 0x0e57 }, + { 0x0df8, 0x0e58 }, + { 0x0df9, 0x0e59 }, + { 0x0ea1, 0x3131 }, + { 0x0ea2, 0x3132 }, + { 0x0ea3, 0x3133 }, + { 0x0ea4, 0x3134 }, + { 0x0ea5, 0x3135 }, + { 0x0ea6, 0x3136 }, + { 0x0ea7, 0x3137 }, + { 0x0ea8, 0x3138 }, + { 0x0ea9, 0x3139 }, + { 0x0eaa, 0x313a }, + { 0x0eab, 0x313b }, + { 0x0eac, 0x313c }, + { 0x0ead, 0x313d }, + { 0x0eae, 0x313e }, + { 0x0eaf, 0x313f }, + { 0x0eb0, 0x3140 }, + { 0x0eb1, 0x3141 }, + { 0x0eb2, 0x3142 }, + { 0x0eb3, 0x3143 }, + { 0x0eb4, 0x3144 }, + { 0x0eb5, 0x3145 }, + { 0x0eb6, 0x3146 }, + { 0x0eb7, 0x3147 }, + { 0x0eb8, 0x3148 }, + { 0x0eb9, 0x3149 }, + { 0x0eba, 0x314a }, + { 0x0ebb, 0x314b }, + { 0x0ebc, 0x314c }, + { 0x0ebd, 0x314d }, + { 0x0ebe, 0x314e }, + { 0x0ebf, 0x314f }, + { 0x0ec0, 0x3150 }, + { 0x0ec1, 0x3151 }, + { 0x0ec2, 0x3152 }, + { 0x0ec3, 0x3153 }, + { 0x0ec4, 0x3154 }, + { 0x0ec5, 0x3155 }, + { 0x0ec6, 0x3156 }, + { 0x0ec7, 0x3157 }, + { 0x0ec8, 0x3158 }, + { 0x0ec9, 0x3159 }, + { 0x0eca, 0x315a }, + { 0x0ecb, 0x315b }, + { 0x0ecc, 0x315c }, + { 0x0ecd, 0x315d }, + { 0x0ece, 0x315e }, + { 0x0ecf, 0x315f }, + { 0x0ed0, 0x3160 }, + { 0x0ed1, 0x3161 }, + { 0x0ed2, 0x3162 }, + { 0x0ed3, 0x3163 }, + { 0x0ed4, 0x11a8 }, + { 0x0ed5, 0x11a9 }, + { 0x0ed6, 0x11aa }, + { 0x0ed7, 0x11ab }, + { 0x0ed8, 0x11ac }, + { 0x0ed9, 0x11ad }, + { 0x0eda, 0x11ae }, + { 0x0edb, 0x11af }, + { 0x0edc, 0x11b0 }, + { 0x0edd, 0x11b1 }, + { 0x0ede, 0x11b2 }, + { 0x0edf, 0x11b3 }, + { 0x0ee0, 0x11b4 }, + { 0x0ee1, 0x11b5 }, + { 0x0ee2, 0x11b6 }, + { 0x0ee3, 0x11b7 }, + { 0x0ee4, 0x11b8 }, + { 0x0ee5, 0x11b9 }, + { 0x0ee6, 0x11ba }, + { 0x0ee7, 0x11bb }, + { 0x0ee8, 0x11bc }, + { 0x0ee9, 0x11bd }, + { 0x0eea, 0x11be }, + { 0x0eeb, 0x11bf }, + { 0x0eec, 0x11c0 }, + { 0x0eed, 0x11c1 }, + { 0x0eee, 0x11c2 }, + { 0x0eef, 0x316d }, + { 0x0ef0, 0x3171 }, + { 0x0ef1, 0x3178 }, + { 0x0ef2, 0x317f }, + { 0x0ef3, 0x3181 }, + { 0x0ef4, 0x3184 }, + { 0x0ef5, 0x3186 }, + { 0x0ef6, 0x318d }, + { 0x0ef7, 0x318e }, + { 0x0ef8, 0x11eb }, + { 0x0ef9, 0x11f0 }, + { 0x0efa, 0x11f9 }, + { 0x0eff, 0x20a9 }, +#if 0 + /* FIXME: there is no keysym 0x13a4? But 0x20ac is EuroSign in both + keysym and Unicode */ + { 0x13a4, 0x20ac }, +#endif + { 0x13bc, 0x0152 }, + { 0x13bd, 0x0153 }, + { 0x13be, 0x0178 }, + { 0x20ac, 0x20ac }, + + /* Special function keys. */ + + { 0xff08, 0x0008 }, /* XK_BackSpace */ + { 0xff09, 0x0009 }, /* XK_Tab */ + { 0xff0a, 0x000a }, /* XK_Linefeed */ + { 0xff0d, 0x000d }, /* XK_Return */ + { 0xff13, 0x0013 }, /* XK_Pause */ + { 0xff1b, 0x001b }, /* XK_Escape */ + { 0xff50, 0x0001 }, /* XK_Home */ + { 0xff51, 0x001c }, /* XK_Left */ + { 0xff52, 0x001e }, /* XK_Up */ + { 0xff53, 0x001d }, /* XK_Right */ + { 0xff54, 0x001f }, /* XK_Down */ + { 0xff55, 0x000b }, /* XK_Prior */ + { 0xff56, 0x000c }, /* XK_Next */ + { 0xff57, 0x0004 }, /* XK_End */ + { 0xff6a, 0x0005 }, /* XK_Help */ + { 0xffff, 0x007f }, /* XK_Delete */ +}; + +long keysym2ucs(int keysym) +{ + int min = 0; + int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; + int mid; + + /* first check for Latin-1 characters (1:1 mapping) */ + if ((keysym >= 0x0020 && keysym <= 0x007e) || + (keysym >= 0x00a0 && keysym <= 0x00ff)) + return keysym; + + /* also check for directly encoded 24-bit UCS characters */ + if ((keysym & 0xff000000) == 0x01000000) + return keysym & 0x00ffffff; + + /* binary search in table */ + while (max >= min) { + mid = (min + max) / 2; + if (keysymtab[mid].keysym < keysym) + min = mid + 1; + else if (keysymtab[mid].keysym > keysym) + max = mid - 1; + else { + /* found it */ + return keysymtab[mid].ucs; + } + } + + /* no matching Unicode value found */ + return -1; +} + +static int reverse_compare (const void *a, const void *b) +{ + const struct codepair *ca = a, *cb = b; + + return ca->ucs - cb->ucs; +} + +int ucs2keysym(long ucs) +{ + static struct codepair *reverse_keysymtab; + + int min = 0; + int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; + int mid; + + if (reverse_keysymtab == NULL) + { + reverse_keysymtab = malloc (sizeof (keysymtab)); + memcpy (reverse_keysymtab, keysymtab, sizeof (keysymtab)); + + qsort (reverse_keysymtab, + sizeof (keysymtab) / sizeof (struct codepair), + sizeof (struct codepair), + reverse_compare); + } + + /* first check for Latin-1 characters (1:1 mapping) */ + if ((ucs >= 0x0020 && ucs <= 0x007e) || + (ucs >= 0x00a0 && ucs <= 0x00ff)) + return ucs; + + /* binary search in table */ + while (max >= min) { + mid = (min + max) / 2; + if (reverse_keysymtab[mid].ucs < ucs) + min = mid + 1; + else if (reverse_keysymtab[mid].ucs > ucs) + max = mid - 1; + else { + /* found it */ + return reverse_keysymtab[mid].keysym; + } + } + + /* finally, assume a directly encoded 24-bit UCS character */ + return ucs | 0x01000000; +} Index: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h Sat Nov 1 03:13:08 2003 @@ -0,0 +1,37 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h,v 1.1 2003/11/01 08:13:08 torrey Exp $ + * + * This module converts keysym values into the corresponding ISO 10646 + * (UCS, Unicode) values. + * + * The array keysymtab[] contains pairs of X11 keysym values for graphical + * characters and the corresponding Unicode value. The function + * keysym2ucs() maps a keysym onto a Unicode value using a binary search, + * therefore keysymtab[] must remain SORTED by keysym value. + * + * The keysym -> UTF-8 conversion will hopefully one day be provided + * by Xlib via XmbLookupString() and should ideally not have to be + * done in X applications. But we are not there yet. + * + * We allow to represent any UCS character in the range U-00000000 to + * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff. + * This admittedly does not cover the entire 31-bit space of UCS, but + * it does cover all of the characters up to U-10FFFF, which can be + * represented by UTF-16, and more, and it is very unlikely that higher + * UCS codes will ever be assigned by ISO. So to get Unicode character + * U+ABCD you can directly use keysym 0x0100abcd. + * + * Author: Markus G. Kuhn , University of Cambridge, April 2001 + * + * Special thanks to Richard Verhoeven for preparing + * an initial draft of the mapping table. + * + * This software is in the public domain. Share and enjoy! + */ + +#ifndef KEYSYM2UCS_H +#define KEYSYM2UCS_H 1 + +extern long keysym2ucs(int keysym); +extern int ucs2keysym(long ucs); + +#endif /* KEYSYM2UCS_H */ Index: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c diff -u xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.2 xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.3 --- xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.2 Wed Oct 16 17:13:33 2002 +++ xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c Wed Apr 30 19:15:39 2003 @@ -32,7 +32,7 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.2 2002/10/16 21:13:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.3 2003/04/30 23:15:39 torrey Exp $ */ #include "pseudoramiX.h" @@ -111,7 +111,7 @@ if (noPseudoramiXExtension) return; - if (pseudoramiXNumScreens == 1 || aquaNumScreens == 1) { + if (pseudoramiXNumScreens == 1) { // Only one screen - disable Xinerama extension. noPseudoramiXExtension = TRUE; return; Index: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h diff -u xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h:1.1 xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h:1.2 --- xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h Wed Apr 30 19:15:39 2003 @@ -1,10 +1,9 @@ /* * Minimal implementation of PanoramiX/Xinerama */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.2 2003/04/30 23:15:39 torrey Exp $ */ extern int noPseudoramiXExtension; -extern int aquaNumScreens; void PseudoramiXAddScreen(int x, int y, int w, int h); void PseudoramiXExtensionInit(int argc, char *argv[]); Index: xc/programs/Xserver/hw/darwin/quartz/quartz.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.7 xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.14 --- xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.7 Wed Jan 22 19:34:26 2003 +++ xc/programs/Xserver/hw/darwin/quartz/quartz.c Mon Nov 24 00:39:02 2003 @@ -29,16 +29,16 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.7 2003/01/23 00:34:26 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.14 2003/11/24 05:39:02 torrey Exp $ */ #include "quartzCommon.h" #include "quartz.h" #include "darwin.h" #include "quartzAudio.h" -#include "quartzCursor.h" -#include "fullscreen.h" -#include "rootlessAqua.h" #include "pseudoramiX.h" +#define _APPLEWM_SERVER_ +#include "applewm.h" +#include "applewmExt.h" // X headers #include "scrnintstr.h" @@ -61,8 +61,8 @@ int quartzScreenIndex = 0; int aquaMenuBarHeight = 0; int noPseudoramiXExtension = TRUE; -int aquaNumScreens = 0; - +QuartzModeProcsPtr quartzProcs = NULL; +const char *quartzOpenGLBundle = NULL; /* =========================================================================== @@ -73,10 +73,10 @@ */ /* - * QuartzAddScreen + * DarwinModeAddScreen * Do mode dependent initialization of each screen for Quartz. */ -Bool QuartzAddScreen( +Bool DarwinModeAddScreen( int index, ScreenPtr pScreen) { @@ -84,34 +84,25 @@ QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1); QUARTZ_PRIV(pScreen) = displayInfo; - // do full screen or rootless specific initialization - if (quartzRootless) { - return AquaAddScreen(index, pScreen); - } else { - return QuartzFSAddScreen(index, pScreen); - } + // do Quartz mode specific initialization + return quartzProcs->AddScreen(index, pScreen); } /* - * QuartzSetupScreen + * DarwinModeSetupScreen * Finalize mode specific setup of each screen. */ -Bool QuartzSetupScreen( +Bool DarwinModeSetupScreen( int index, ScreenPtr pScreen) { - // do full screen or rootless specific setup - if (quartzRootless) { - if (! AquaSetupScreen(index, pScreen)) - return FALSE; - } else { - if (! QuartzFSSetupScreen(index, pScreen)) - return FALSE; - } + // do Quartz mode specific setup + if (! quartzProcs->SetupScreen(index, pScreen)) + return FALSE; // setup cursor support - if (! QuartzInitCursor(pScreen)) + if (! quartzProcs->InitCursor(pScreen)) return FALSE; return TRUE; @@ -119,10 +110,10 @@ /* - * QuartzInitOutput + * DarwinModeInitOutput * Quartz display initialization. */ -void QuartzInitOutput( +void DarwinModeInitOutput( int argc, char **argv ) { @@ -145,13 +136,8 @@ FatalError("Could not register block and wakeup handlers."); } - if (quartzRootless) { - ErrorF("Display mode: Rootless Quartz\n"); - AquaDisplayInit(); - } else { - ErrorF("Display mode: Full screen Quartz\n"); - QuartzFSDisplayInit(); - } + // Do display mode specific initialization + quartzProcs->DisplayInit(); // Init PseudoramiX implementation of Xinerama. // This should be in InitExtensions, but that causes link errors @@ -163,21 +149,26 @@ /* - * QuartzInitInput + * DarwinModeInitInput * Inform the main thread the X server is ready to handle events. */ -void QuartzInitInput( +void DarwinModeInitInput( int argc, char **argv ) { QuartzMessageMainThread(kQuartzServerStarted, NULL, 0); + + // Do final display mode specific initialization before handling events + if (quartzProcs->InitInput) + quartzProcs->InitInput(argc, argv); } /* * QuartzShow * Show the X server on screen. Does nothing if already shown. - * Restore the X clip regions and the X server cursor state. + * Calls mode specific screen resume to restore the X clip regions + * (if needed) and the X server cursor state. */ static void QuartzShow( int x, // cursor location @@ -189,9 +180,7 @@ quartzServerVisible = TRUE; for (i = 0; i < screenInfo.numScreens; i++) { if (screenInfo.screens[i]) { - QuartzResumeXCursor(screenInfo.screens[i], x, y); - if (!quartzRootless) - xf86SetRootClip(screenInfo.screens[i], TRUE); + quartzProcs->ResumeScreen(screenInfo.screens[i], x, y); } } } @@ -201,8 +190,8 @@ /* * QuartzHide * Remove the X server display from the screen. Does nothing if already - * hidden. Set X clip regions to prevent drawing, and restore the Aqua - * cursor. + * hidden. Calls mode specific screen suspend to set X clip regions to + * prevent drawing (if needed) and restore the Aqua cursor. */ static void QuartzHide(void) { @@ -211,9 +200,7 @@ if (quartzServerVisible) { for (i = 0; i < screenInfo.numScreens; i++) { if (screenInfo.screens[i]) { - QuartzSuspendXCursor(screenInfo.screens[i]); - if (!quartzRootless) - xf86SetRootClip(screenInfo.screens[i], FALSE); + quartzProcs->SuspendScreen(screenInfo.screens[i]); } } } @@ -243,20 +230,58 @@ /* - * QuartzProcessEvent + * QuartzMessageServerThread + * Send the X server thread a message by placing it on the event queue. + */ +void +QuartzMessageServerThread( + int type, + int argc, ...) +{ + xEvent xe; + INT32 *argv; + int i, max_args; + va_list args; + + memset(&xe, 0, sizeof(xe)); + xe.u.u.type = type; + xe.u.clientMessage.u.l.type = type; + + argv = &xe.u.clientMessage.u.l.longs0; + max_args = 4; + + if (argc > 0 && argc <= max_args) { + va_start (args, argc); + for (i = 0; i < argc; i++) + argv[i] = (int) va_arg (args, int); + va_end (args); + } + + DarwinEQEnqueue(&xe); +} + + +/* + * DarwinModeProcessEvent * Process Quartz specific events. */ -void QuartzProcessEvent( +void DarwinModeProcessEvent( xEvent *xe) { switch (xe->u.u.type) { - case kXDarwinShow: + case kXDarwinActivate: QuartzShow(xe->u.keyButtonPointer.rootX, xe->u.keyButtonPointer.rootY); + AppleWMSendEvent(AppleWMActivationNotify, + AppleWMActivationNotifyMask, + AppleWMIsActive, 0); break; - case kXDarwinHide: + case kXDarwinDeactivate: + AppleWMSendEvent(AppleWMActivationNotify, + AppleWMActivationNotifyMask, + AppleWMIsInactive, 0); QuartzHide(); break; @@ -276,18 +301,42 @@ QuartzWritePasteboard(); break; + /* + * AppleWM events + */ + case kXDarwinControllerNotify: + AppleWMSendEvent(AppleWMControllerNotify, + AppleWMControllerNotifyMask, + xe->u.clientMessage.u.l.longs0, + xe->u.clientMessage.u.l.longs1); + break; + + case kXDarwinPasteboardNotify: + AppleWMSendEvent(AppleWMPasteboardNotify, + AppleWMPasteboardNotifyMask, + xe->u.clientMessage.u.l.longs0, + xe->u.clientMessage.u.l.longs1); + break; + + case kXDarwinDisplayChanged: + case kXDarwinWindowState: + case kXDarwinWindowMoved: + // FIXME: Not implemented yet + break; + default: - ErrorF("Unknown application defined event.\n"); + ErrorF("Unknown application defined event type %d.\n", + xe->u.u.type); } } /* - * QuartzGiveUp + * DarwinModeGiveUp * Cleanup before X server shutdown * Release the screen and restore the Aqua cursor. */ -void QuartzGiveUp(void) +void DarwinModeGiveUp(void) { #if 0 // Trying to switch cursors when quitting causes deadlock @@ -301,5 +350,5 @@ #endif if (!quartzRootless) - QuartzFSRelease(); + quartzProcs->ReleaseScreens(); } Index: xc/programs/Xserver/hw/darwin/quartz/quartz.h diff -u xc/programs/Xserver/hw/darwin/quartz/quartz.h:1.4 xc/programs/Xserver/hw/darwin/quartz/quartz.h:1.8 --- xc/programs/Xserver/hw/darwin/quartz/quartz.h:1.4 Wed Nov 20 18:51:58 2002 +++ xc/programs/Xserver/hw/darwin/quartz/quartz.h Wed Nov 26 20:59:53 2003 @@ -1,11 +1,11 @@ /* * quartz.h * - * External interface of the Quartz modes seen by the generic, mode + * External interface of the Quartz display modes seen by the generic, mode * independent parts of the Darwin X server. */ /* - * Copyright (c) 2001-2002 Greg Parker and Torrey T. Lyons. + * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -30,21 +30,90 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.4 2002/11/20 23:51:58 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.8 2003/11/27 01:59:53 torrey Exp $ */ #ifndef _QUARTZ_H #define _QUARTZ_H -#include "screenint.h" -#include "Xproto.h" #include "quartzPasteboard.h" -int QuartzProcessArgument(int argc, char *argv[], int i); -void QuartzInitOutput(int argc, char **argv); -void QuartzInitInput(int argc, char **argv); -Bool QuartzAddScreen(int index, ScreenPtr pScreen); -Bool QuartzSetupScreen(int index, ScreenPtr pScreen); -void QuartzGiveUp(void); -void QuartzProcessEvent(xEvent *xe); +#include "screenint.h" +#include "window.h" + +/*------------------------------------------ + Quartz display mode function types + ------------------------------------------*/ + +/* + * Display mode initialization + */ +typedef void (*DisplayInitProc)(void); +typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen); +typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen); +typedef void (*InitInputProc)(int argc, char **argv); + +/* + * Cursor functions + */ +typedef Bool (*InitCursorProc)(ScreenPtr pScreen); +typedef void (*CursorUpdateProc)(void); + +/* + * Suspend and resume X11 activity + */ +typedef void (*SuspendScreenProc)(ScreenPtr pScreen); +typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y); +typedef void (*CaptureScreensProc)(void); +typedef void (*ReleaseScreensProc)(void); + +/* + * Rootless helper functions + */ +typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber); +typedef void (*HideWindowsProc)(Bool hide); + +/* + * Rootless functions for optional export to GLX layer + */ +typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create); +typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow); +typedef Bool (*CreateSurfaceProc) + (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, + unsigned int client_id, unsigned int *surface_id, + unsigned int key[2], void (*notify) (void *arg, void *data), + void *notify_data); +typedef Bool (*DestroySurfaceProc) + (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, + void (*notify) (void *arg, void *data), void *notify_data); + +/* + * Quartz display mode function list + */ +typedef struct _QuartzModeProcs { + DisplayInitProc DisplayInit; + AddScreenProc AddScreen; + SetupScreenProc SetupScreen; + InitInputProc InitInput; + + InitCursorProc InitCursor; + CursorUpdateProc CursorUpdate; // Not used if NULL + + SuspendScreenProc SuspendScreen; + ResumeScreenProc ResumeScreen; + CaptureScreensProc CaptureScreens; // Only called in fullscreen + ReleaseScreensProc ReleaseScreens; // Only called in fullscreen + + IsX11WindowProc IsX11Window; + HideWindowsProc HideWindows; + + FrameForWindowProc FrameForWindow; + TopLevelParentProc TopLevelParent; + CreateSurfaceProc CreateSurface; + DestroySurfaceProc DestroySurface; +} QuartzModeProcsRec, *QuartzModeProcsPtr; + +extern QuartzModeProcsPtr quartzProcs; + +Bool QuartzLoadDisplayBundle(const char *dpyBundleName); #endif Index: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.1 xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c Wed May 14 01:27:56 2003 @@ -35,7 +35,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.2 2003/05/14 05:27:56 torrey Exp $ */ #include "quartzCommon.h" #include "quartzAudio.h" @@ -242,10 +242,10 @@ /* - * QuartzBell + * DarwinModeBell * Ring the bell */ -void QuartzBell( +void DarwinModeBell( int volume, // volume in percent of max DeviceIntPtr pDevice, pointer ctrl, Index: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m diff -u xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m:1.3 xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m:1.4 --- xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m:1.3 Sun Jan 19 01:52:54 2003 +++ xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m Wed May 14 01:27:56 2003 @@ -33,12 +33,17 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.3 2003/01/19 06:52:54 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.4 2003/05/14 05:27:56 torrey Exp $ */ + +#include "quartzCommon.h" + +#define BOOL xBOOL +#include "darwin.h" +#undef BOOL #include #import "Preferences.h" -#include "quartzCommon.h" #include "pseudoramiX.h" extern void FatalError(const char *, ...); @@ -57,7 +62,7 @@ darwinFakeButtons = [Preferences fakeButtons]; darwinFakeMouse2Mask = [Preferences button2Mask]; darwinFakeMouse3Mask = [Preferences button3Mask]; - quartzMouseAccelChange = [Preferences mouseAccelChange]; + darwinMouseAccelChange = [Preferences mouseAccelChange]; quartzUseSysBeep = [Preferences systemBeep]; // quartzRootless has already been set Index: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h diff -u xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h:1.8 xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h:1.14 --- xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h:1.8 Wed Jan 22 19:34:26 2003 +++ xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h Wed Nov 12 15:21:51 2003 @@ -31,7 +31,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.14 2003/11/12 20:21:51 torrey Exp $ */ #ifndef _QUARTZCOMMON_H #define _QUARTZCOMMON_H @@ -48,8 +48,6 @@ #undef WindowPtr #undef Picture -#include "quartzShared.h" - // Quartz specific per screen storage structure typedef struct { // List of CoreGraphics displays that this X11 screen covers. @@ -78,11 +76,17 @@ extern int quartzScreenIndex; extern int aquaMenuBarHeight; +// Name of GLX bundle for native OpenGL +extern const char *quartzOpenGLBundle; + void QuartzReadPreferences(void); void QuartzMessageMainThread(unsigned msg, void *data, unsigned length); +void QuartzMessageServerThread(int type, int argc, ...); +void QuartzSetWindowMenu(int nitems, const char **items, + const char *shortcuts); void QuartzFSCapture(void); void QuartzFSRelease(void); -int QuartzFSUseQDCursor(int depth); +int QuartzFSUseQDCursor(int depth); void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask); void QuartzWakeupHandler(void *blockData, int result, void *pReadmask); @@ -92,7 +96,11 @@ kQuartzServerStarted, kQuartzServerDied, kQuartzCursorUpdate, - kQuartzPostEvent + kQuartzPostEvent, + kQuartzSetWindowMenu, + kQuartzSetWindowMenuCheck, + kQuartzSetFrontProcess, + kQuartzSetCanQuit }; #endif /* _QUARTZCOMMON_H */ Index: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c:1.2 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c Sun Jan 18 20:22:47 2004 @@ -0,0 +1,380 @@ +/* + quartzKeyboard.c + $Id: darwin-new-keymap.c,v 1.7 2003/02/21 22:33:19 jharper Exp $ + + Code to build a keymap using the Carbon Keyboard Layout API, + which is supported on Mac OS X 10.2 and newer. + + Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. +*/ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c,v 1.2 2004/01/19 01:22:47 torrey Exp $ */ + +#include "quartzCommon.h" + +#include +#include + +#include "darwinKeyboard.h" +#include "keysym.h" +#include "keysym2ucs.h" + +#ifdef HAS_KL_API + +#define HACK_MISSING 1 +#define HACK_KEYPAD 1 + +enum { + MOD_COMMAND = 256, + MOD_SHIFT = 512, + MOD_OPTION = 2048, + MOD_CONTROL = 4096, +}; + +#define UKEYSYM(u) ((u) | 0x01000000) + +/* Table of keycode->keysym mappings we use to fallback on for important + keys that are often not in the Unicode mapping. */ + +const static struct { + unsigned short keycode; + KeySym keysym; +} known_keys[] = { + {55, XK_Meta_L}, + {56, XK_Shift_L}, + {57, XK_Caps_Lock}, + {58, XK_Alt_L}, + {59, XK_Control_L}, + {60, XK_Shift_R}, + {61, XK_Alt_R}, + {62, XK_Control_R}, + + {122, XK_F1}, + {120, XK_F2}, + {99, XK_F3}, + {118, XK_F4}, + {96, XK_F5}, + {97, XK_F6}, + {98, XK_F7}, + {100, XK_F8}, + {101, XK_F9}, + {109, XK_F10}, + {103, XK_F11}, + {111, XK_F12}, + {105, XK_F13}, + {107, XK_F14}, + {113, XK_F15}, +}; + +/* Table of keycode->old,new-keysym mappings we use to fixup the numeric + keypad entries. */ + +const static struct { + unsigned short keycode; + KeySym normal, keypad; +} known_numeric_keys[] = { + {65, XK_period, XK_KP_Decimal}, + {67, XK_asterisk, XK_KP_Multiply}, + {69, XK_plus, XK_KP_Add}, + {75, XK_slash, XK_KP_Divide}, + {76, 0x01000003, XK_KP_Enter}, + {78, XK_minus, XK_KP_Subtract}, + {81, XK_equal, XK_KP_Equal}, + {82, XK_0, XK_KP_0}, + {83, XK_1, XK_KP_1}, + {84, XK_2, XK_KP_2}, + {85, XK_3, XK_KP_3}, + {86, XK_4, XK_KP_4}, + {87, XK_5, XK_KP_5}, + {88, XK_6, XK_KP_6}, + {89, XK_7, XK_KP_7}, + {91, XK_8, XK_KP_8}, + {92, XK_9, XK_KP_9}, +}; + +/* Table mapping normal keysyms to their dead equivalents. + FIXME: all the unicode keysyms (apart from circumflex) were guessed. */ + +const static struct { + KeySym normal, dead; +} dead_keys[] = { + {XK_grave, XK_dead_grave}, + {XK_acute, XK_dead_acute}, + {XK_asciicircum, XK_dead_circumflex}, + {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */ + {XK_asciitilde, XK_dead_tilde}, + {UKEYSYM (0x2dc), XK_dead_tilde}, /* SMALL TILDE */ + {XK_macron, XK_dead_macron}, + {XK_breve, XK_dead_breve}, + {XK_abovedot, XK_dead_abovedot}, + {XK_diaeresis, XK_dead_diaeresis}, + {UKEYSYM (0x2da), XK_dead_abovering}, /* DOT ABOVE */ + {XK_doubleacute, XK_dead_doubleacute}, + {XK_caron, XK_dead_caron}, + {XK_cedilla, XK_dead_cedilla}, + {XK_ogonek, XK_dead_ogonek}, + {UKEYSYM (0x269), XK_dead_iota}, /* LATIN SMALL LETTER IOTA */ + {UKEYSYM (0x2ec), XK_dead_voiced_sound}, /* MODIFIER LETTER VOICING */ +/* {XK_semivoiced_sound, XK_dead_semivoiced_sound}, */ + {UKEYSYM (0x323), XK_dead_belowdot}, /* COMBINING DOT BELOW */ + {UKEYSYM (0x309), XK_dead_hook}, /* COMBINING HOOK ABOVE */ + {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */ +}; + +unsigned int +DarwinSystemKeymapSeed (void) +{ + static unsigned int seed; + + static KeyboardLayoutRef last_key_layout; + KeyboardLayoutRef key_layout; + + KLGetCurrentKeyboardLayout (&key_layout); + + if (key_layout != last_key_layout) + seed++; + + last_key_layout = key_layout; + + return seed; +} + +static inline UniChar +macroman2ucs (unsigned char c) +{ + /* Precalculated table mapping MacRoman-128 to Unicode. Generated + by creating single element CFStringRefs then extracting the + first character. */ + + static const unsigned short table[128] = { + 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, + 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, + 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, + 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, + 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf, + 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8, + 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211, + 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8, + 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab, + 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca, + 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02, + 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1, + 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, + 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc, + 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7, + }; + + if (c < 128) + return c; + else + return table[c - 128]; +} + +static KeySym +make_dead_key (KeySym in) +{ + int i; + + for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++) + { + if (dead_keys[i].normal == in) + return dead_keys[i].dead; + } + + return in; +} + +Bool +DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) +{ + KeyboardLayoutRef key_layout; + const void *chr_data; + int num_keycodes = NUM_KEYCODES; + UInt32 keyboard_type = 0; + int is_uchr, i, j; + OSStatus err; + KeySym *k; + + KLGetCurrentKeyboardLayout (&key_layout); + KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); + + if (chr_data != NULL) + { + is_uchr = 1; + keyboard_type = LMGetKbdType (); + } + else + { + KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); + + if (chr_data == NULL) + { + ErrorF ( "Couldn't get uchr or kchr resource\n"); + return FALSE; + } + + is_uchr = 0; + num_keycodes = 128; + } + + + /* Scan the keycode range for the Unicode character that each + key produces in the four shift states. Then convert that to + an X11 keysym (which may just the bit that says "this is + Unicode" if it can't find the real symbol.) */ + + for (i = 0; i < num_keycodes; i++) + { + static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION, + MOD_OPTION | MOD_SHIFT}; + + k = info->keyMap + i * GLYPHS_PER_KEY; + + for (j = 0; j < 4; j++) + { + if (is_uchr) + { + UniChar s[8]; + UniCharCount len; + UInt32 dead_key_state, extra_dead; + + dead_key_state = 0; + err = UCKeyTranslate (chr_data, i, kUCKeyActionDown, + mods[j] >> 8, keyboard_type, 0, + &dead_key_state, 8, &len, s); + if (err != noErr) + continue; + + if (len == 0 && dead_key_state != 0) + { + /* Found a dead key. Work out which one it is, but + remembering that it's dead. */ + + extra_dead = 0; + err = UCKeyTranslate (chr_data, i, kUCKeyActionDown, + mods[j] >> 8, keyboard_type, + kUCKeyTranslateNoDeadKeysMask, + &extra_dead, 8, &len, s); + if (err != noErr) + continue; + } + + if (len > 0 && s[0] != 0x0010) + { + k[j] = ucs2keysym (s[0]); + + if (dead_key_state != 0) + k[j] = make_dead_key (k[j]); + } + } + else + { + UInt32 c, state = 0; + UInt16 code; + + code = i | mods[j]; + c = KeyTranslate (chr_data, code, &state); + + /* Dead keys are only processed on key-down, so ask + to translate those events. When we find a dead key, + translating the matching key up event will give + us the actual dead character. */ + + if (state != 0) + { + UInt32 state2 = 0; + c = KeyTranslate (chr_data, code | 128, &state2); + } + + /* Characters seem to be in MacRoman encoding. */ + + if (c != 0 && c != 0x0010) + { + k[j] = ucs2keysym (macroman2ucs (c & 255)); + + if (state != 0) + k[j] = make_dead_key (k[j]); + } + } + } + + if (k[3] == k[2]) + k[3] = NoSymbol; + if (k[2] == k[1]) + k[2] = NoSymbol; + if (k[1] == k[0]) + k[1] = NoSymbol; + if (k[0] == k[2] && k[1] == k[3]) + k[2] = k[3] = NoSymbol; + } + + /* Fix up some things that are normally missing.. */ + + if (HACK_MISSING) + { + for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++) + { + k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY; + + if (k[0] == NoSymbol && k[1] == NoSymbol + && k[2] == NoSymbol && k[3] == NoSymbol) + { + k[0] = known_keys[i].keysym; + } + } + } + + /* And some more things. We find the right symbols for the numeric + keypad, but not the KP_ keysyms. So try to convert known keycodes. */ + + if (HACK_KEYPAD) + { + for (i = 0; i < sizeof (known_numeric_keys) + / sizeof (known_numeric_keys[0]); i++) + { + k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY; + + if (k[0] == known_numeric_keys[i].normal) + { + k[0] = known_numeric_keys[i].keypad; + } + } + } + + return TRUE; +} + +#else /* !HAS_KL_API */ + +Bool +DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) +{ + return FALSE; +} + +#endif /* HAS_KL_API */ Index: xc/programs/Xserver/hw/darwin/quartz/quartzShared.h diff -u xc/programs/Xserver/hw/darwin/quartz/quartzShared.h:1.2 xc/programs/Xserver/hw/darwin/quartz/quartzShared.h:removed --- xc/programs/Xserver/hw/darwin/quartz/quartzShared.h:1.2 Fri Oct 11 20:32:45 2002 +++ xc/programs/Xserver/hw/darwin/quartz/quartzShared.h Sat Feb 28 21:42:13 2004 @@ -1,57 +0,0 @@ -/* - * quartzShared.h - * - * Shared definitions between the Darwin X Server and the Cocoa front end - * - * This file is included in all parts of the Darwin X Server and must not - * include any types defined in X11 or Mac OS X specific headers. - * Definitions that are internal to the Quartz modes or use Mac OS X - * specific types should be in quartzCommon.h instead of here. - */ -/* - * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzShared.h,v 1.2 2002/10/12 00:32:45 torrey Exp $ */ - -#ifndef _QUARTZSHARED_H -#define _QUARTZSHARED_H - -// User preferences used by generic Darwin X server code -extern int quartzMouseAccelChange; -extern int darwinFakeButtons; -extern int darwinFakeMouse2Mask; -extern int darwinFakeMouse3Mask; -extern char *darwinKeymapFile; -extern unsigned int darwinDesiredWidth, darwinDesiredHeight; -extern int darwinDesiredDepth; -extern int darwinDesiredRefresh; - -// location of X11's (0,0) point in global screen coordinates -extern int darwinMainScreenX; -extern int darwinMainScreenY; - -#endif /* _QUARTZSHARED_H */ - Index: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c:1.3 xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c:1.9 --- xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c:1.3 Sun Jan 19 01:35:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c Fri Nov 14 19:07:09 2003 @@ -28,13 +28,14 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.3 2003/01/19 06:35:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.9 2003/11/15 00:07:09 torrey Exp $ */ #include #include #include #include "quartzCommon.h" #include "darwin.h" +#include "quartz.h" #include "opaque.h" #include "micmap.h" @@ -50,6 +51,8 @@ typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *); static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL; +typedef Bool (*QuartzModeBundleInitPtr)(void); + /* * DarwinHandleGUI @@ -76,19 +79,25 @@ // Make a pipe to pass events assert( pipe(fd) == 0 ); - darwinEventFD = fd[0]; - quartzEventWriteFD = fd[1]; - fcntl(darwinEventFD, F_SETFL, O_NONBLOCK); + darwinEventReadFD = fd[0]; + darwinEventWriteFD = fd[1]; + fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK); // Store command line arguments to pass back to main() argcGlobal = argc; argvGlobal = argv; envpGlobal = envp; - // Determine if we need to start X clients - // and what display mode to use quartzStartClients = 1; for (i = 1; i < argc; i++) { + // Display version info without starting Mac OS X UI if requested + if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { + DarwinPrintBanner(); + exit(0); + } + + // Determine if we need to start X clients + // and what display mode to use if (!strcmp(argv[i], "-nostartx")) { quartzStartClients = 0; } else if (!strcmp( argv[i], "-fullscreen")) { @@ -98,13 +107,70 @@ } } - quartz = TRUE; main_exit = NSApplicationMain(argc, argv); exit(main_exit); } /* + * QuartzLoadDisplayBundle + * Try to load the appropriate bundle containing the back end display code. + */ +Bool QuartzLoadDisplayBundle( + const char *dpyBundleName) +{ + CFBundleRef mainBundle; + CFStringRef bundleName; + CFURLRef bundleURL; + CFBundleRef dpyBundle; + QuartzModeBundleInitPtr bundleInit; + + // Get the main bundle for the application + mainBundle = CFBundleGetMainBundle(); + + // Make CFString from bundle name + bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, + dpyBundleName, + kCFStringEncodingASCII, + kCFAllocatorNull); + + // Look for the appropriate bundle in the main bundle + bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName, + NULL, NULL); + if (!bundleURL) { + ErrorF("Could not find display mode bundle %s.\n", dpyBundleName); + return FALSE; + } + + // Make a bundle instance using the URLRef + dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL); + + if (!CFBundleLoadExecutable(dpyBundle)) { + ErrorF("Could not load display mode bundle %s.\n", dpyBundleName); + return FALSE; + } + + // Lookup the bundle initialization function + bundleInit = (void *) + CFBundleGetFunctionPointerForName(dpyBundle, + CFSTR("QuartzModeBundleInit")); + if (!bundleInit) { + ErrorF("Could not initialize display mode bundle %s.\n", + dpyBundleName); + return FALSE; + } + if (!bundleInit()) + return FALSE; + + // Release the CF objects + CFRelease(bundleName); + CFRelease(bundleURL); + + return TRUE; +} + + +/* * LoadGlxBundle * The Quartz mode X server needs to dynamically load the appropriate * bundle before initializing GLX. @@ -122,10 +188,14 @@ // Choose the bundle to load ErrorF("Loading GLX bundle "); if (quartzUseAGL) { - bundleName = CFSTR("glxAGL.bundle"); - ErrorF("glxAGL.bundle (using Apple's OpenGL)\n"); + bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, + quartzOpenGLBundle, + kCFStringEncodingASCII, + kCFAllocatorNull); + ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle); } else { bundleName = CFSTR("glxMesa.bundle"); + CFRetain(bundleName); // so we can release later ErrorF("glxMesa.bundle (using Mesa)\n"); } @@ -155,7 +225,7 @@ } // Release the CF objects - CFRelease(mainBundle); + CFRelease(bundleName); CFRelease(bundleURL); } @@ -186,7 +256,7 @@ } -int QuartzProcessArgument( int argc, char *argv[], int i ) +int DarwinModeProcessArgument( int argc, char *argv[], int i ) { // fullscreen: CoreGraphics full-screen mode // rootless: Cocoa rootless mode @@ -208,7 +278,7 @@ QUARTZ_SAFETY_DELAY ); #endif return 1; - } + } if ( !strcmp( argv[i], "-quartz" ) ) { ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" ); Index: xc/programs/Xserver/hw/darwin/quartz/rootless.h diff -u xc/programs/Xserver/hw/darwin/quartz/rootless.h:1.2 xc/programs/Xserver/hw/darwin/quartz/rootless.h:removed --- xc/programs/Xserver/hw/darwin/quartz/rootless.h:1.2 Wed Aug 28 02:41:26 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootless.h Sat Feb 28 21:42:13 2004 @@ -1,136 +0,0 @@ -/* - * External interface to generic rootless mode - * - * Greg Parker gparker@cs.stanford.edu March 3, 2001 - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootless.h,v 1.2 2002/08/28 06:41:26 torrey Exp $ */ - -#ifndef _ROOTLESS_H -#define _ROOTLESS_H - -#include "mi.h" -#include "gcstruct.h" - -// RootlessFrameRec -// Describes a single rootless window (aka frame). -// The rootless mode keeps track of window position, and the -// rootless implementation is responsible for the pixmap. -// Multiple screens: all coordinates are SCREEN-LOCAL, not global. - - -typedef struct RootlessFrameRec { - /* Data maintained by rootless mode */ - /* position and size, including window border, in screen coordinates */ - int x; - int y; - unsigned int w; - unsigned int h; - WindowPtr win; /* the top-level window drawn in this frame */ - int isRoot; /* TRUE if this is the root window */ - - /* Data maintained by rootless implementation */ - char *pixelData; - int depth; // color bits per pixel; depth <= bitsPerPixel - int bitsPerPixel; - int bytesPerRow; - - void *devPrivate; /* for caller's use */ -} RootlessFrameRec, *RootlessFramePtr; - - -// Create a new frame. -// pUpper is the window above the new frame, or NULL if the new -// frame will be on top. -// pFrame is completely initialized. devPrivate is NULL -// The pixmap must be valid when this is done. -typedef void (*RootlessCreateFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, RootlessFramePtr pUpper); - -// Destroy a frame. Caller must free any private data and the pixmap. -// All drawing is stopped and all updates are flushed before this is called. -typedef void (*RootlessDestroyFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame); - -// Move a frame on screen. -// The frame changes position and nothing else. -// pFrame and pFrame->win already contain the information about the -// new position. oldX and oldY are the old position. -// All updates are flushed before this is called. -// The pixmap may change during this function. -typedef void (*RootlessMoveFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, int oldX, int oldY); - -// Change frame ordering (aka stacking, layering) -// pFrame->win already has its new siblings. -// pOldNext is the window that was below this one, or NULL if this was -// at the bottom. -// pNewNext is the window that is now below this one, or NULL if this is -// now at the bottom. -typedef void (*RootlessRestackFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, - RootlessFramePtr pOldNext, RootlessFramePtr pNewNext); - -// Change the frame's shape. -// pNewShape is in frame-local coordinates. -// Everything outside pNewShape is no longer part of the frame. -// pNewShape is {0, 0, width, height} for a plain-shaped frame. -typedef void (*RootlessReshapeFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, RegionPtr pNewShape); - -// Flush drawing updates to the screen. -// pDamage contains all changed pixels. -// pDamage is in frame-local coordinates. -// pDamage is clipped to the frame bounds and the frame shape. -typedef void (*RootlessUpdateRegionProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, RegionPtr pDamage); - -// Prepare a window for direct access to its backing buffer. -typedef void (*RootlessStartDrawingProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame); - -// Stop access to a window's backing buffer. -typedef void (*RootlessStopDrawingProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame); - -// Frame is about to resize. -// The frame has its new position and size already. -// postconditions: -// The pixmap MUST point to a pixmap with the new size. -// The pixmap data is undefined. -// The old pixmap may be destroyed here. -typedef void (*RootlessStartResizeFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, - int oldX, int oldY, unsigned int oldW, unsigned int oldH); - -// Frame is done resizing. -// Destroy the old pixmap if you haven't already. -typedef void (*RootlessFinishResizeFrameProc) - (ScreenPtr pScreen, RootlessFramePtr pFrame, - int oldX, int oldY, unsigned int oldW, unsigned int oldH); - - -// The callback function list. -// Any of these may be NULL. -typedef struct RootlessFrameProcs { - RootlessCreateFrameProc CreateFrame; - RootlessDestroyFrameProc DestroyFrame; - - RootlessMoveFrameProc MoveFrame; - RootlessStartResizeFrameProc StartResizeFrame; - RootlessFinishResizeFrameProc FinishResizeFrame; - RootlessRestackFrameProc RestackFrame; - RootlessReshapeFrameProc ReshapeFrame; - - RootlessUpdateRegionProc UpdateRegion; - - RootlessStartDrawingProc StartDrawing; - RootlessStopDrawingProc StopDrawing; -} RootlessFrameProcs; - -// Initialize rootless mode on the given screen. -Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcs *procs); - -// Return the rootless frame for the given window or NULL if it's not framed -RootlessFramePtr RootlessFrameForWindow(WindowPtr pWin); - -#endif /* _ROOTLESS_H */ Index: xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h:1.1 xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h:1.2 --- xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h:1.1 Wed Mar 27 21:21:19 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h Wed Apr 30 19:15:39 2003 @@ -3,7 +3,7 @@ * * Greg Parker gparker@cs.stanford.edu */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessAqua.h,v 1.2 2003/04/30 23:15:39 torrey Exp $ */ #ifndef _ROOTLESSAQUA_H #define _ROOTLESSAQUA_H @@ -11,5 +11,6 @@ Bool AquaAddScreen(int index, ScreenPtr pScreen); Bool AquaSetupScreen(int index, ScreenPtr pScreen); void AquaDisplayInit(void); +void AquaInitInput(int argc, char **argv); #endif /* _ROOTLESSAQUA_H */ Index: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c:1.5 xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c:1.5 Mon Dec 9 19:00:39 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c Sat Feb 28 21:42:13 2004 @@ -1,242 +0,0 @@ -/* - * Generic rootless to Aqua specific glue code - * - * This code acts as a glue between the generic rootless X server code - * and the Aqua specific implementation, which includes definitions that - * conflict with stardard X types. - * - * Greg Parker gparker@cs.stanford.edu - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaGlue.c,v 1.5 2002/12/10 00:00:39 torrey Exp $ */ - -#include "quartzCommon.h" -#include "darwin.h" -#include "rootlessAqua.h" -#include "rootlessAquaImp.h" -#include "rootless.h" -#include "aqua.h" - -#include "regionstr.h" -#include "scrnintstr.h" -#include "picturestr.h" -#include "globals.h" // dixScreenOrigins[] - - -///////////////////////////////////////// -// Rootless mode callback glue - -static void -AquaGlueCreateFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - RootlessFramePtr pUpper) -{ - int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - pFrame->devPrivate = AquaNewWindow(pUpper ? pUpper->devPrivate : NULL, - pFrame->x + sx, pFrame->y + sy, - pFrame->w, pFrame->h, - pFrame->isRoot); -} - - -static void -AquaGlueDestroyFrame(ScreenPtr pScreen, RootlessFramePtr pFrame) -{ - AquaDestroyWindow(pFrame->devPrivate); -} - - -static void -AquaGlueMoveFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - int oldX, int oldY) -{ - int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - AquaMoveWindow(pFrame->devPrivate, pFrame->x + sx, pFrame->y + sy); -} - - -static void -AquaGlueStartResizeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - int oldX, int oldY, - unsigned int oldW, unsigned int oldH) -{ - int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - AquaStartResizeWindow(pFrame->devPrivate, - pFrame->x + sx, pFrame->y + sy, pFrame->w, pFrame->h); -} - -static void -AquaGlueFinishResizeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - int oldX, int oldY, - unsigned int oldW, unsigned int oldH) -{ - int sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; - int sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - - AquaFinishResizeWindow(pFrame->devPrivate, - pFrame->x + sx, pFrame->y + sy, - pFrame->w, pFrame->h); -} - - -static void -AquaGlueRestackFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - RootlessFramePtr pOldPrev, - RootlessFramePtr pNewPrev) -{ - AquaRestackWindow(pFrame->devPrivate, - pNewPrev ? pNewPrev->devPrivate : NULL); -} - - -static void -AquaGlueReshapeFrame(ScreenPtr pScreen, RootlessFramePtr pFrame, - RegionPtr pNewShape) -{ - BoxRec shapeBox = {0, 0, pFrame->w, pFrame->h}; - - // Don't correct for dixScreenOrigins here. - // pNewShape is in window-local coordinates. - - if (pFrame->isRoot) return; // shouldn't happen; mi or dix covers this - - REGION_INVERSE(pScreen, pNewShape, pNewShape, &shapeBox); - AquaReshapeWindow(pFrame->devPrivate, - (fakeBoxRec *) REGION_RECTS(pNewShape), - REGION_NUM_RECTS(pNewShape)); -} - - -static void -AquaGlueUpdateRegion(ScreenPtr pScreen, RootlessFramePtr pFrame, - RegionPtr pDamage) -{ - AquaUpdateRects(pFrame->devPrivate, - (fakeBoxRec *) REGION_RECTS(pDamage), - REGION_NUM_RECTS(pDamage)); -} - - -static void -AquaGlueStartDrawing(ScreenPtr pScreen, RootlessFramePtr pFrame) -{ - AquaStartDrawing(pFrame->devPrivate, &pFrame->pixelData, - &pFrame->bytesPerRow, &pFrame->depth, - &pFrame->bitsPerPixel); -} - -static void -AquaGlueStopDrawing(ScreenPtr pScreen, RootlessFramePtr pFrame) -{ - AquaStopDrawing(pFrame->devPrivate); -} - - -static RootlessFrameProcs aquaRootlessProcs = { - AquaGlueCreateFrame, - AquaGlueDestroyFrame, - AquaGlueMoveFrame, - AquaGlueStartResizeFrame, - AquaGlueFinishResizeFrame, - AquaGlueRestackFrame, - AquaGlueReshapeFrame, - AquaGlueUpdateRegion, - AquaGlueStartDrawing, - AquaGlueStopDrawing -}; - - -/////////////////////////////////////// -// Rootless mode initialization. -// Exported by rootlessAqua.h - -/* - * AquaDisplayInit - * Find all Aqua screens. - */ -void -AquaDisplayInit(void) -{ - darwinScreensFound = AquaDisplayCount(); -} - - -/* - * AquaAddScreen - * Init the framebuffer and record pixmap parameters for the screen. - */ -Bool -AquaAddScreen(int index, ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); - CGRect cgRect; - CGDisplayCount numDisplays; - CGDisplayCount allocatedDisplays = 0; - CGDirectDisplayID *displays = NULL; - CGDisplayErr cgErr; - int componentCount; - - dfb->colorType = TrueColor; - AquaScreenInit(index, &dfb->x, &dfb->y, &dfb->width, &dfb->height, - &dfb->pitch, &dfb->bitsPerComponent, - &componentCount, &dfb->bitsPerPixel); - dfb->colorBitsPerPixel = dfb->bitsPerComponent * componentCount; - - // No frame buffer - it's all in window pixmaps. - dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height); - - // Get all CoreGraphics displays covered by this X11 display. - cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height); - do { - cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays); - if (cgErr) break; - allocatedDisplays = numDisplays; - displays = xrealloc(displays, - numDisplays * sizeof(CGDirectDisplayID)); - cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays, - &numDisplays); - if (cgErr != CGDisplayNoErr) break; - } while (numDisplays > allocatedDisplays); - - if (cgErr != CGDisplayNoErr || numDisplays == 0) { - ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); - return FALSE; - } - - // This X11 screen covers all CoreGraphics displays we just found. - // If there's more than one CG display, then video mirroring is on - // or PseudoramiX is on. - displayInfo->displayCount = allocatedDisplays; - displayInfo->displayIDs = displays; - - return TRUE; -} - - -/* - * AquaSetupScreen - * Setup the screen for rootless access. - */ -Bool -AquaSetupScreen(int index, ScreenPtr pScreen) -{ - // Add Aqua specific replacements for fb screen functions - pScreen->PaintWindowBackground = AquaPaintWindow; - pScreen->PaintWindowBorder = AquaPaintWindow; - -#ifdef RENDER - { - PictureScreenPtr ps = GetPictureScreen(pScreen); - ps->Composite = AquaComposite; - } -#endif /* RENDER */ - - // Initialize generic rootless code - return RootlessInit(pScreen, &aquaRootlessProcs); -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h:1.2 xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h:1.2 Mon Dec 9 19:00:39 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h Sat Feb 28 21:42:13 2004 @@ -1,39 +0,0 @@ -/* - * Rootless implementation for Mac OS X Aqua environment - * - * Greg Parker gparker@cs.stanford.edu - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.h,v 1.2 2002/12/10 00:00:39 torrey Exp $ */ - -#ifndef _ROOTLESSAQUAIMP_H -#define _ROOTLESSAQUAIMP_H - -#include "fakeBoxRec.h" - -int AquaDisplayCount(); - -void AquaScreenInit(int index, int *x, int *y, int *width, int *height, - int *rowBytes, int *bps, int *spp, int *bpp); - -void *AquaNewWindow(void *upperw, int x, int y, int w, int h, int isRoot); - -void AquaDestroyWindow(void *rw); - -void AquaMoveWindow(void *rw, int x, int y); - -void AquaStartResizeWindow(void *rw, int x, int y, int w, int h); - -void AquaFinishResizeWindow(void *rw, int x, int y, int w, int h); - -void AquaUpdateRects(void *rw, fakeBoxRec *rects, int count); - -void AquaRestackWindow(void *rw, void *lowerw); - -void AquaReshapeWindow(void *rw, fakeBoxRec *rects, int count); - -void AquaStartDrawing(void *rw, char **bits, - int *rowBytes, int *depth, int *bpp); - -void AquaStopDrawing(void *rw); - -#endif /* _ROOTLESSAQUAIMP_H */ Index: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m:1.6 xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m:1.6 Thu Jan 23 19:11:39 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m Sat Feb 28 21:42:13 2004 @@ -1,433 +0,0 @@ -/* - * Rootless implementation for Mac OS X Aqua environment - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessAquaImp.m,v 1.6 2003/01/24 00:11:39 torrey Exp $ */ - -#include "rootlessAquaImp.h" -#include "fakeBoxRec.h" -#include "quartzCommon.h" -#include "aquaCommon.h" -#include "pseudoramiX.h" -#import -#include -#import "XView.h" - -extern void ErrorF(const char *, ...); - - -/* - * AquaDisplayCount - * Return the number of displays. - * Multihead note: When rootless mode uses PseudoramiX, the - * X server only sees one screen; only PseudoramiX itself knows - * about all of the screens. - */ -int AquaDisplayCount() -{ - aquaNumScreens = [[NSScreen screens] count]; - - if (noPseudoramiXExtension) { - return aquaNumScreens; - } else { - return 1; // only PseudoramiX knows about the rest - } -} - - -void AquaScreenInit(int index, int *x, int *y, int *width, int *height, - int *rowBytes, int *bps, int *spp, int *bpp) -{ - *spp = 3; - *bps = CGDisplayBitsPerSample(kCGDirectMainDisplay); - *bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); - - if (noPseudoramiXExtension) { - NSScreen *screen = [[NSScreen screens] objectAtIndex:index]; - NSRect frame = [screen frame]; - - // set x, y so (0,0) is top left of main screen - *x = NSMinX(frame); - *y = NSHeight([[NSScreen mainScreen] frame]) - NSHeight(frame) - - NSMinY(frame); - - *width = NSWidth(frame); - *height = NSHeight(frame); - *rowBytes = (*width) * (*bpp) / 8; - - // Shift the usable part of main screen down to avoid the menu bar. - if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) { - *y += aquaMenuBarHeight; - *height -= aquaMenuBarHeight; - } - - } else { - int i; - NSRect unionRect = NSMakeRect(0, 0, 0, 0); - NSArray *screens = [NSScreen screens]; - - // Get the union of all screens (minus the menu bar on main screen) - for (i = 0; i < [screens count]; i++) { - NSScreen *screen = [screens objectAtIndex:i]; - NSRect frame = [screen frame]; - frame.origin.y = [[NSScreen mainScreen] frame].size.height - - frame.size.height - frame.origin.y; - if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - unionRect = NSUnionRect(unionRect, frame); - } - - // Use unionRect as the screen size for the X server. - *x = unionRect.origin.x; - *y = unionRect.origin.y; - *width = unionRect.size.width; - *height = unionRect.size.height; - *rowBytes = (*width) * (*bpp) / 8; - - // Tell PseudoramiX about the real screens. - // InitOutput() will move the big screen to (0,0), - // so compensate for that here. - for (i = 0; i < [screens count]; i++) { - NSScreen *screen = [screens objectAtIndex:i]; - NSRect frame = [screen frame]; - int j; - - // Skip this screen if it's a mirrored copy of an earlier screen. - for (j = 0; j < i; j++) { - if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) { - ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n", - i, j); - break; - } - } - if (j < i) continue; // this screen is a mirrored copy - - frame.origin.y = [[NSScreen mainScreen] frame].size.height - - frame.size.height - frame.origin.y; - - if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - - ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); - - frame.origin.x -= unionRect.origin.x; - frame.origin.y -= unionRect.origin.y; - - ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", - i, (int)frame.origin.x, (int)frame.origin.y); - - PseudoramiXAddScreen(frame.origin.x, frame.origin.y, - frame.size.width, frame.size.height); - } - } -} - - -/* - * AquaNewWindow - * Create a new on-screen window. - * Rootless windows must not autodisplay! Autodisplay can cause a deadlock. - * Event thread - autodisplay: locks view hierarchy, then window - * X Server thread - window resize: locks window, then view hierarchy - * Deadlock occurs if each thread gets one lock and waits for the other. -*/ -void *AquaNewWindow(void *upperw, int x, int y, int w, int h, int isRoot) -{ - AquaWindowRec *winRec = (AquaWindowRec *)malloc(sizeof(AquaWindowRec)); - NSRect frame = NSMakeRect(x, NSHeight([[NSScreen mainScreen] frame]) - - y - h, w, h); - NSWindow *theWindow; - XView *theView; - - // Create an NSWindow for the new X11 window - theWindow = [[NSWindow alloc] initWithContentRect:frame - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:YES]; - if (!theWindow) return NULL; - - [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent - [theWindow setAlphaValue:1.0]; // draw opaque - [theWindow setOpaque:YES]; // changed when window is shaped - - [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views - [theWindow setAutodisplay:NO]; // See comment above - [theWindow disableFlushWindow]; // We do all the flushing manually - [theWindow setHasShadow:!isRoot]; // All windows have shadows except root - [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure - - theView = [[XView alloc] initWithFrame:frame]; - [theWindow setContentView:theView]; - [theWindow setInitialFirstResponder:theView]; - - if (upperw) { - AquaWindowRec *upperRec = AQUA_WINREC(upperw); - int uppernum = [upperRec->window windowNumber]; - [theWindow orderWindow:NSWindowBelow relativeTo:uppernum]; - } else { - if (!isRoot) { - [theWindow orderFront:nil]; - winRec->port = NULL; - } - } - - [theWindow setAcceptsMouseMovedEvents:YES]; - - winRec->window = theWindow; - winRec->view = theView; - - if (!isRoot) { - winRec->rootGWorld = NULL; - [theView lockFocus]; - // Fill the window with white to make sure alpha channel is set - NSEraseRect(frame); - winRec->port = [theView qdPort]; - winRec->context = [[NSGraphicsContext currentContext] graphicsPort]; - // CreateCGContextForPort(winRec->port, &winRec->context); - [theView unlockFocus]; - } else { - // Allocate the offscreen graphics world for root window drawing - GWorldPtr rootGWorld; - Rect globalRect; - - SetRect(&globalRect, x, y, x+w, y+h); - if (NewGWorld(&rootGWorld, 0, &globalRect, NULL, NULL, 0)) - return NULL; - winRec->rootGWorld = rootGWorld; - } - - return winRec; -} - - -void AquaDestroyWindow(void *rw) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - - [winRec->window orderOut:nil]; - [winRec->window close]; - [winRec->view release]; - if (winRec->rootGWorld) { - DisposeGWorld(winRec->rootGWorld); - } - free(rw); -} - - -void AquaMoveWindow(void *rw, int x, int y) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - NSPoint topLeft = NSMakePoint(x, NSHeight([[NSScreen mainScreen] frame]) - - y); - - [winRec->window setFrameTopLeftPoint:topLeft]; -} - - -/* - * AquaStartResizeWindow - * Resize the on screen window. - */ -void AquaStartResizeWindow(void *rw, int x, int y, int w, int h) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - NSRect frame = NSMakeRect(x, NSHeight([[NSScreen mainScreen] frame]) - - y - h, w, h); - - [winRec->window setFrame:frame display:NO]; -} - - -void AquaFinishResizeWindow(void *rw, int x, int y, int w, int h) -{ - // refresh everything? fixme yes for testing - fakeBoxRec box = {0, 0, w, h}; - AquaUpdateRects(rw, &box, 1); -} - - -/* - * AquaUpdateRects - * Flush rectangular regions from a window's backing buffer - * (or PixMap for the root window) to the screen. - */ -void AquaUpdateRects(void *rw, fakeBoxRec *fakeRects, int count) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - fakeBoxRec *rects, *end; - static RgnHandle rgn = NULL; - static RgnHandle box = NULL; - - if (!rgn) rgn = NewRgn(); - if (!box) box = NewRgn(); - - if (winRec->rootGWorld) { - // FIXME: Draw from the root PixMap to the normally - // invisible root window. - } else { - for (rects = fakeRects, end = fakeRects+count; rects < end; rects++) { - Rect qdrect; - qdrect.left = rects->x1; - qdrect.top = rects->y1; - qdrect.right = rects->x2; - qdrect.bottom = rects->y2; - - RectRgn(box, &qdrect); - UnionRgn(rgn, box, rgn); - } - - QDFlushPortBuffer(winRec->port, rgn); - } - - SetEmptyRgn(rgn); - SetEmptyRgn(box); -} - - -/* - * AquaRestackWindow - * Change the window order. Put the window behind upperw or on top if - * upperw is NULL. - */ -void AquaRestackWindow(void *rw, void *upperw) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - - if (upperw) { - AquaWindowRec *upperRec = AQUA_WINREC(upperw); - int uppernum = [upperRec->window windowNumber]; - [winRec->window orderWindow:NSWindowBelow relativeTo:uppernum]; - } else { - [winRec->window makeKeyAndOrderFront:nil]; - } -} - - -/* - * AquaReshapeWindow - * Set the shape of a window. The rectangles are the areas that are - * not part of the new shape. - */ -void AquaReshapeWindow(void *rw, fakeBoxRec *fakeRects, int count) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - NSRect frame = [winRec->view frame]; - int winHeight = NSHeight(frame); - - [winRec->view lockFocus]; - - // If window is currently shaped we need to undo the previous shape - if (![winRec->window isOpaque]) { - [[NSColor whiteColor] set]; - NSRectFillUsingOperation(frame, NSCompositeDestinationAtop); - } - - if (count > 0) { - fakeBoxRec *rects, *end; - - // Make transparent if window is now shaped. - [winRec->window setOpaque:NO]; - - // Clear the areas outside the window shape - [[NSColor clearColor] set]; - for (rects = fakeRects, end = fakeRects+count; rects < end; rects++) { - int rectHeight = rects->y2 - rects->y1; - NSRectFill( NSMakeRect(rects->x1, - winHeight - rects->y1 - rectHeight, - rects->x2 - rects->x1, rectHeight) ); - } - [[NSGraphicsContext currentContext] flushGraphics]; - - // force update of window shadow - [winRec->window setHasShadow:NO]; - [winRec->window setHasShadow:YES]; - - } else { - fakeBoxRec bounds = {0, 0, NSWidth(frame), winHeight}; - - [winRec->window setOpaque:YES]; - AquaUpdateRects(rw, &bounds, 1); - } - - [winRec->view unlockFocus]; -} - - -/* AquaStartDrawing - * When a window's buffer is not being drawn to, the CoreGraphics - * window server may compress or move it. Call this routine - * to lock down the buffer during direct drawing. It returns - * a pointer to the backing buffer and its depth, etc. - */ -void AquaStartDrawing(void *rw, char **bits, - int *rowBytes, int *depth, int *bpp) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - PixMapHandle pix; - - if (! winRec->rootGWorld) { - [winRec->view lockFocus]; - winRec->port = [winRec->view qdPort]; - LockPortBits(winRec->port); - [winRec->view unlockFocus]; - pix = GetPortPixMap(winRec->port); - } else { - pix = GetGWorldPixMap(winRec->rootGWorld); - LockPixels(pix); - } - - *bits = GetPixBaseAddr(pix); - *rowBytes = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed? - *depth = (**pix).cmpCount * (**pix).cmpSize; // fixme use GetPixDepth(pix)? - *bpp = (**pix).pixelSize; -} - - -/* - * AquaStopDrawing - * When direct access to a window's buffer is no longer needed, this - * routine should be called to allow CoreGraphics to compress or - * move it. - */ -void AquaStopDrawing(void *rw) -{ - AquaWindowRec *winRec = AQUA_WINREC(rw); - - if (! winRec->rootGWorld) { - UnlockPortBits(winRec->port); - } else { - PixMapHandle pix = GetGWorldPixMap(winRec->rootGWorld); - UnlockPixels(pix); - } -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c:1.7 xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c:1.7 Tue Jan 28 20:11:05 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c Sat Feb 28 21:42:13 2004 @@ -1,384 +0,0 @@ -/* - * Common rootless definitions and code - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.c,v 1.7 2003/01/29 01:11:05 torrey Exp $ */ - -#include "rootlessCommon.h" - - -RegionRec rootlessHugeRoot = {{-32767, -32767, 32767, 32767}, NULL}; - - -/* - * TopLevelParent - * Returns the top-level parent of pWindow. - * The root is the top-level parent of itself, even though the root is - * not otherwise considered to be a top-level window. - */ -WindowPtr TopLevelParent(WindowPtr pWindow) -{ - WindowPtr top = pWindow; - - if (IsRoot(pWindow)) return pWindow; // root is top-level parent of itself - while (top && ! IsTopLevel(top)) top = top->parent; - return top; -} - - -/* - * IsFramedWindow - * Returns TRUE if this window is visible inside a frame - * (e.g. it is visible and has a top-level or root parent) - */ -Bool IsFramedWindow(WindowPtr pWin) -{ - WindowPtr top; - - if (! pWin->realized) return FALSE; - top = TopLevelParent(pWin); - return (top && WINREC(top)); -} - - -/* - * RootlessStartDrawing - * Prepare a window for direct access to its backing buffer. - * Each top-level parent has a Pixmap representing its backing buffer, - * which all of its children inherit. - */ -void RootlessStartDrawing(WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - WindowPtr top = TopLevelParent(pWindow); - RootlessWindowRec *winRec; - - if (!top) return; - winRec = WINREC(top); - if (!winRec) return; - - // Make sure the window's top-level parent is prepared for drawing. - if (!winRec->drawing) { - int bw = wBorderWidth(top); - - CallFrameProc(pScreen, StartDrawing, (pScreen, &winRec->frame)); - winRec->pixmap = - GetScratchPixmapHeader(pScreen, winRec->frame.w, winRec->frame.h, - winRec->frame.depth, - winRec->frame.bitsPerPixel, - winRec->frame.bytesPerRow, - winRec->frame.pixelData); - SetPixmapBaseToScreen(winRec->pixmap, - top->drawable.x - bw, top->drawable.y - bw); - winRec->drawing = TRUE; - } - - winRec->oldPixmap = pScreen->GetWindowPixmap(pWindow); - pScreen->SetWindowPixmap(pWindow, winRec->pixmap); -} - - -/* - * RootlessStopDrawing - * Stop drawing to a window's backing buffer. - */ -void RootlessStopDrawing(WindowPtr pWindow) -{ - WindowPtr top = TopLevelParent(pWindow); - RootlessWindowRec *winRec; - - if (!top) return; - winRec = WINREC(top); - if (!winRec) return; - - if (winRec->drawing) { - ScreenPtr pScreen = pWindow->drawable.pScreen; - CallFrameProc(pScreen, StopDrawing, (pScreen, &winRec->frame)); - FreeScratchPixmapHeader(winRec->pixmap); - pScreen->SetWindowPixmap(pWindow, winRec->oldPixmap); - winRec->pixmap = NULL; - winRec->drawing = FALSE; - } -} - -#if 0 -// NSCarbonWindow Note: Windows no longer need a backing pixmap -// other than the one provided by the implementation. -// This routine is obsolete. - -// Update pWindow's pixmap. -// This needs to be called every time a window moves relative to -// its top-level parent, or the parent's pixmap data is reallocated. -// Three cases: -// * window is top-level with no existing pixmap: make one -// * window is top-level with existing pixmap: update it in place -// * window is descendant of top-level: point to top-level's pixmap -void UpdatePixmap(WindowPtr pWindow) -{ - WindowPtr top = TopLevelParent(pWindow); - RootlessWindowRec *winRec; - ScreenPtr pScreen = pWindow->drawable.pScreen; - PixmapPtr pix; - - RL_DEBUG_MSG("update pixmap (win 0x%x)", pWindow); - - // Don't use IsFramedWindow(); window is unrealized during RealizeWindow(). - - if (! top) { - RL_DEBUG_MSG("no parent\n"); - return; - } - winRec = WINREC(top); - if (!winRec) { - RL_DEBUG_MSG("not framed\n"); - return; - } - - if (pWindow == top) { - // This is the top window. Update its pixmap. - int bw = wBorderWidth(pWindow); - - if (winRec->pixmap == NULL) { - // Allocate a new pixmap. - pix = GetScratchPixmapHeader(pScreen, - winRec->frame.w, winRec->frame.h, - winRec->frame.depth, - winRec->frame.bitsPerPixel, - winRec->frame.bytesPerRow, - winRec->frame.pixelData); - SetPixmapBaseToScreen(pix, pWindow->drawable.x - bw, - pWindow->drawable.y - bw); - pScreen->SetWindowPixmap(pWindow, pix); - winRec->pixmap = pix; - } else { - // Update existing pixmap. Update in place so we don't have to - // change the children's pixmaps. - int bw = wBorderWidth(top); - - pix = winRec->pixmap; - pScreen->ModifyPixmapHeader(pix, - winRec->frame.w, winRec->frame.h, - winRec->frame.depth, - winRec->frame.bitsPerPixel, - winRec->frame.bytesPerRow, - winRec->frame.pixelData); - SetPixmapBaseToScreen(pix, top->drawable.x - bw, - top->drawable.y - bw); - } - } else { - // This is not the top window. Point to the parent's pixmap. - pix = winRec->pixmap; - pScreen->SetWindowPixmap(pWindow, pix); - } - - RL_DEBUG_MSG("done\n"); -} -#endif - -#ifdef SHAPE - -// boundingShape = outside border (like borderClip) -// clipShape = inside border (like clipList) -// Both are in window-local coordinates -// We only care about boundingShape (fixme true?) - -// RootlessReallySetShape is used in several places other than SetShape. -// Most importantly, SetShape is often called on unmapped windows, so we -// have to wait until the window is mapped to reshape the frame. -static void RootlessReallySetShape(WindowPtr pWin) -{ - RootlessWindowRec *winRec = WINREC(pWin); - ScreenPtr pScreen = pWin->drawable.pScreen; - RegionRec newShape; - - if (IsRoot(pWin)) return; - if (!IsTopLevel(pWin)) return; - if (!winRec) return; - - RootlessStopDrawing(pWin); - - if (wBoundingShape(pWin)) { - // wBoundingShape is relative to *inner* origin of window. - // Translate by borderWidth to get the outside-relative position. - REGION_INIT(pScreen, &newShape, NullBox, 0); - REGION_COPY(pScreen, &newShape, wBoundingShape(pWin)); - REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth, - pWin->borderWidth); - } else { - newShape.data = NULL; - newShape.extents.x1 = 0; - newShape.extents.y1 = 0; - newShape.extents.x2 = winRec->frame.w; - newShape.extents.y2 = winRec->frame.h; - } - RL_DEBUG_MSG("reshaping..."); - RL_DEBUG_MSG("numrects %d, extents %d %d %d %d ", - REGION_NUM_RECTS(&newShape), - newShape.extents.x1, newShape.extents.y1, - newShape.extents.x2, newShape.extents.y2); - CallFrameProc(pScreen, ReshapeFrame, (pScreen, &winRec->frame, &newShape)); - REGION_UNINIT(pScreen, &newShape); -} - -#endif // SHAPE - - -// pRegion is GLOBAL -void -RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) -{ - RL_DEBUG_MSG("Damaged win 0x%x ", pWindow); - pWindow = TopLevelParent(pWindow); - RL_DEBUG_MSG("parent 0x%x:\n", pWindow); - if (!pWindow) { - RL_DEBUG_MSG("RootlessDamageRegion: window is not framed\n"); - } else if (!WINREC(pWindow)) { - RL_DEBUG_MSG("RootlessDamageRegion: top-level window not a frame\n"); - } else { - REGION_UNION((pWindow)->drawable.pScreen, &WINREC(pWindow)->damage, - &WINREC(pWindow)->damage, (pRegion)); - } - -#ifdef ROOTLESSDEBUG - { - BoxRec *box = REGION_RECTS(pRegion), *end; - int numBox = REGION_NUM_RECTS(pRegion); - - for (end = box+numBox; box < end; box++) { - RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n", - box->x1, box->x2, box->y1, box->y2); - } - } -#endif -} - - -// pBox is GLOBAL -void -RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox) -{ - RegionRec region; - - REGION_INIT(pWindow->drawable.pScreen, ®ion, pBox, 1); - RootlessDamageRegion(pWindow, ®ion); -} - - -// (x, y, w, h) is in window-local coordinates. -void -RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h) -{ - BoxRec box; - RegionRec region; - - x += pWindow->drawable.x; - y += pWindow->drawable.y; - box.x1 = x; - box.x2 = x + w; - box.y1 = y; - box.y2 = y + h; - REGION_INIT(pWindow->drawable.pScreen, ®ion, &box, 1); - RootlessDamageRegion(pWindow, ®ion); -} - -#ifdef SHAPE - -void -RootlessDamageShape(WindowPtr pWin) -{ - RootlessWindowRec *winRec = WINREC(pWin); - - // We only care about the shape of top-level framed windows. - if (IsRoot(pWin)) return; - if (!IsTopLevel(pWin)) return; - if (!winRec) return; - - winRec->shapeDamage = TRUE; -} - -#endif // SHAPE - -/* - * RootlessRedisplay - * Stop drawing and redisplay the damaged region of a window. - */ -void -RootlessRedisplay(WindowPtr pWindow) -{ - RootlessWindowRec *winRec = WINREC(pWindow); - ScreenPtr pScreen = pWindow->drawable.pScreen; - -#ifdef SHAPE - if (winRec->shapeDamage) { - // Reshape the window. This will also update the entire window. - RootlessReallySetShape(pWindow); - REGION_EMPTY(pScreen, &winRec->damage); - winRec->shapeDamage = FALSE; - } else -#endif // SHAPE - { - RootlessStopDrawing(pWindow); - if (REGION_NOTEMPTY(pScreen, &winRec->damage)) { - RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n", - pWindow, winRec->frame.w, winRec->frame.h, - winRec->frame.x, winRec->frame.y); - - REGION_INTERSECT(pScreen, &winRec->damage, &winRec->damage, - &pWindow->borderSize); - - // move region to window local coords - REGION_TRANSLATE(pScreen, &winRec->damage, - -winRec->frame.x, -winRec->frame.y); - CallFrameProc(pScreen, UpdateRegion, - (pScreen, &winRec->frame, &winRec->damage)); - REGION_EMPTY(pScreen, &winRec->damage); - } - } -} - - -/* - * RootlessRedisplayScreen - * Walk every window on a screen and redisplay the damaged regions. - */ -void -RootlessRedisplayScreen(ScreenPtr pScreen) -{ - WindowPtr root = WindowTable[pScreen->myNum]; - - if (root) { - WindowPtr win; - - RootlessRedisplay(root); - for (win = root->firstChild; win; win = win->nextSib) { - if (WINREC(win)) { - RootlessRedisplay(win); - } - } - } -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h:1.7 xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h:1.7 Tue Jan 28 20:11:05 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h Sat Feb 28 21:42:13 2004 @@ -1,260 +0,0 @@ -/* - * Common internal rootless definitions and code - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessCommon.h,v 1.7 2003/01/29 01:11:05 torrey Exp $ */ - -#ifndef _ROOTLESSCOMMON_H -#define _ROOTLESSCOMMON_H - -#include "rootless.h" -#include "fb.h" - -#ifdef RENDER -#include "picturestr.h" -#endif - - -// Debug output, or not. -#ifdef ROOTLESSDEBUG -#define RL_DEBUG_MSG ErrorF -#else -#define RL_DEBUG_MSG(a, ...) -#endif - - -// Global variables -extern int rootlessGCPrivateIndex; -extern int rootlessScreenPrivateIndex; -extern int rootlessWindowPrivateIndex; - - -// RootlessGCRec: private per-gc data -typedef struct { - GCFuncs *originalFuncs; - GCOps *originalOps; -} RootlessGCRec; - - -// RootlessWindowRec: private per-window data -typedef struct RootlessWindowRec { - RootlessFrameRec frame; - RegionRec damage; - unsigned int borderWidth; // needed for MoveWindow(VTOther) (%$#@!!!) - PixmapPtr pixmap; - PixmapPtr oldPixmap; - BOOL drawing; // TRUE if currently drawing -#ifdef SHAPE - BOOL shapeDamage; // TRUE if shape has changed -#endif -} RootlessWindowRec; - - -// RootlessScreenRec: per-screen private data -typedef struct { - ScreenPtr pScreen; - RootlessFrameProcs frameProcs; - - CloseScreenProcPtr CloseScreen; - - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - MoveWindowProcPtr MoveWindow; - ResizeWindowProcPtr ResizeWindow; - RestackWindowProcPtr RestackWindow; - ChangeBorderWidthProcPtr ChangeBorderWidth; - PositionWindowProcPtr PositionWindow; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - - CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; - CopyWindowProcPtr CopyWindow; - GetImageProcPtr GetImage; - SourceValidateProcPtr SourceValidate; - - MarkOverlappedWindowsProcPtr MarkOverlappedWindows; - ValidateTreeProcPtr ValidateTree; - -#ifdef SHAPE - SetShapeProcPtr SetShape; -#endif - -#ifdef RENDER - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; -#endif - -} RootlessScreenRec; - - -// "Definition of the Porting Layer for the X11 Sample Server" says -// unwrap and rewrap of screen functions is unnecessary, but -// screen->CreateGC changes after a call to cfbCreateGC. - -#define SCREEN_UNWRAP(screen, fn) \ - screen->fn = SCREENREC(screen)->fn; - -#define SCREEN_WRAP(screen, fn) \ - SCREENREC(screen)->fn = screen->fn; \ - screen->fn = Rootless##fn - - -// Accessors for screen and window privates - -#define SCREENREC(pScreen) \ - ((RootlessScreenRec*)(pScreen)->devPrivates[rootlessScreenPrivateIndex].ptr) - -#define WINREC(pWin) \ - ((RootlessWindowRec *)(pWin)->devPrivates[rootlessWindowPrivateIndex].ptr) - - -// Call a rootless implementation function. -// Many rootless implementation functions are allowed to be NULL. -#define CallFrameProc(pScreen, proc, params) \ - if (SCREENREC(pScreen)->frameProcs.proc) { \ - RL_DEBUG_MSG("calling frame proc " #proc " "); \ - SCREENREC(pScreen)->frameProcs.proc params; \ - } - - -// BoxRec manipulators -// Copied from shadowfb - -#define TRIM_BOX(box, pGC) { \ - BoxPtr extents = &pGC->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ -} - -#define TRANSLATE_BOX(box, pDraw) { \ - box.x1 += pDraw->x; \ - box.x2 += pDraw->x; \ - box.y1 += pDraw->y; \ - box.y2 += pDraw->y; \ -} - -#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \ - TRANSLATE_BOX(box, pDraw); \ - TRIM_BOX(box, pGC); \ -} - -#define BOX_NOT_EMPTY(box) \ - (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) - - -// HUGE_ROOT and NORMAL_ROOT -// We don't want to clip windows to the edge of the screen. -// HUGE_ROOT temporarily makes the root window really big. -// This is needed as a wrapper around any function that calls -// SetWinSize or SetBorderSize which clip a window against its -// parents, including the root. - -extern RegionRec rootlessHugeRoot; - -#define HUGE_ROOT(pWin) \ - { \ - WindowPtr w = pWin; \ - while (w->parent) w = w->parent; \ - saveRoot = w->winSize; \ - w->winSize = rootlessHugeRoot; \ - } - -#define NORMAL_ROOT(pWin) \ - { \ - WindowPtr w = pWin; \ - while (w->parent) w = w->parent; \ - w->winSize = saveRoot; \ - } - - -// Returns TRUE if this window is a top-level window (i.e. child of the root) -// The root is not a top-level window. -#define IsTopLevel(pWin) \ - ((pWin) && (pWin)->parent && !(pWin)->parent->parent) - -// Returns TRUE if this window is a root window -#define IsRoot(pWin) \ - ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum]) - - -/* - * SetPixmapBaseToScreen - * Move the given pixmap's base address to where pixel (0, 0) - * would be if the pixmap's actual data started at (x, y). - * Can't access the bits before the first word of the drawable's data in - * rootless mode, so make sure our base address is always 32-bit aligned. - */ -#define SetPixmapBaseToScreen(pix, _x, _y) { \ - PixmapPtr _pPix = (PixmapPtr) (pix); \ - _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \ - ((int)(_x) * _pPix->drawable.bitsPerPixel/8 + \ - (int)(_y) * _pPix->devKind); \ - if (_pPix->drawable.bitsPerPixel != FB_UNIT) { \ - unsigned _diff = ((unsigned) _pPix->devPrivate.ptr) & \ - (FB_UNIT / CHAR_BIT - 1); \ - _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \ - _diff; \ - _pPix->drawable.x = _diff / \ - (_pPix->drawable.bitsPerPixel / CHAR_BIT); \ - } \ -} - - -// Returns the top-level parent of pWindow. -// The root is the top-level parent of itself, even though the root is -// not otherwise considered to be a top-level window. -WindowPtr TopLevelParent(WindowPtr pWindow); - -// Returns TRUE if this window is visible inside a frame -// (e.g. it is visible and has a top-level or root parent) -Bool IsFramedWindow(WindowPtr pWin); - -// Prepare a window for direct access to its backing buffer. -void RootlessStartDrawing(WindowPtr pWindow); - -// Finish drawing to a window's backing buffer. -void RootlessStopDrawing(WindowPtr pWindow); - -// Routines that cause regions to get redrawn. -// DamageRegion and DamageRect are in global coordinates. -// DamageBox is in window-local coordinates. -void RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion); -void RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h); -void RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox); -void RootlessRedisplay(WindowPtr pWindow); -void RootlessRedisplayScreen(ScreenPtr pScreen); - -// Window reshape needs to be updated. The reshape also forces complete redraw. -void RootlessDamageShape(WindowPtr pWin); - -#endif // _ROOTLESSCOMMON_H Index: xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c:1.4 xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c:1.4 Mon Jan 27 01:04:59 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c Sat Feb 28 21:42:13 2004 @@ -1,1219 +0,0 @@ -/* - * Graphics Context support for Mac OS X rootless X server - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessGC.c,v 1.4 2003/01/27 06:04:59 torrey Exp $ */ - -#include "mi.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "dixfontstr.h" -#include "mivalidate.h" -#include "fb.h" - -#include -#include -#include - -#include "rootlessCommon.h" -#include "aqua.h" - - -// GC functions -static void RootlessValidateGC(GCPtr pGC, unsigned long changes, - DrawablePtr pDrawable); -static void RootlessChangeGC(GCPtr pGC, unsigned long mask); -static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void RootlessDestroyGC(GCPtr pGC); -static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, - int nrects); -static void RootlessDestroyClip(GCPtr pGC); -static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc); - -GCFuncs rootlessGCFuncs = { - RootlessValidateGC, - RootlessChangeGC, - RootlessCopyGC, - RootlessDestroyGC, - RootlessChangeClip, - RootlessDestroyClip, - RootlessCopyClip, -}; - -// GC operations -static void RootlessFillSpans(); -static void RootlessSetSpans(); -static void RootlessPutImage(); -static RegionPtr RootlessCopyArea(); -static RegionPtr RootlessCopyPlane(); -static void RootlessPolyPoint(); -static void RootlessPolylines(); -static void RootlessPolySegment(); -static void RootlessPolyRectangle(); -static void RootlessPolyArc(); -static void RootlessFillPolygon(); -static void RootlessPolyFillRect(); -static void RootlessPolyFillArc(); -static int RootlessPolyText8(); -static int RootlessPolyText16(); -static void RootlessImageText8(); -static void RootlessImageText16(); -static void RootlessImageGlyphBlt(); -static void RootlessPolyGlyphBlt(); -static void RootlessPushPixels(); - -static GCOps rootlessGCOps = { - RootlessFillSpans, - RootlessSetSpans, - RootlessPutImage, - RootlessCopyArea, - RootlessCopyPlane, - RootlessPolyPoint, - RootlessPolylines, - RootlessPolySegment, - RootlessPolyRectangle, - RootlessPolyArc, - RootlessFillPolygon, - RootlessPolyFillRect, - RootlessPolyFillArc, - RootlessPolyText8, - RootlessPolyText16, - RootlessImageText8, - RootlessImageText16, - RootlessImageGlyphBlt, - RootlessPolyGlyphBlt, - RootlessPushPixels -#ifdef NEED_LINEHELPER - , NULL -#endif -}; - - -Bool -RootlessCreateGC(GCPtr pGC) -{ - RootlessGCRec *gcrec; - RootlessScreenRec *s; - Bool result; - - SCREEN_UNWRAP(pGC->pScreen, CreateGC); - s = (RootlessScreenRec *) pGC->pScreen-> - devPrivates[rootlessScreenPrivateIndex].ptr; - result = s->CreateGC(pGC); - gcrec = (RootlessGCRec *) pGC->devPrivates[rootlessGCPrivateIndex].ptr; - gcrec->originalOps = NULL; // don't wrap ops yet - gcrec->originalFuncs = pGC->funcs; - pGC->funcs = &rootlessGCFuncs; - - SCREEN_WRAP(pGC->pScreen, CreateGC); - return result; -} - - -// GC func wrapping -// ValidateGC wraps gcOps iff dest is viewable. All others just unwrap&call. - -// GCFUN_UNRAP assumes funcs have been wrapped and -// does not assume ops have been wrapped -#define GCFUNC_UNWRAP(pGC) \ - RootlessGCRec *gcrec = (RootlessGCRec *) \ - (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \ - (pGC)->funcs = gcrec->originalFuncs; \ - if (gcrec->originalOps) { \ - (pGC)->ops = gcrec->originalOps; \ -} - -#define GCFUNC_WRAP(pGC) \ - gcrec->originalFuncs = (pGC)->funcs; \ - (pGC)->funcs = &rootlessGCFuncs; \ - if (gcrec->originalOps) { \ - gcrec->originalOps = (pGC)->ops; \ - (pGC)->ops = &rootlessGCOps; \ -} - - -static void -RootlessValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) -{ - GCFUNC_UNWRAP(pGC); - - gcrec->originalOps = NULL; - - if (pDrawable->type == DRAWABLE_WINDOW) - { - int depth = pDrawable->depth; - - // We force a planemask so fb doesn't overwrite the alpha channel. - // Left to its own devices, fb will optimize away the planemask. - changes |= GCPlaneMask; - pDrawable->depth = pDrawable->bitsPerPixel; - pGC->planemask &= ~AquaAlphaMask(pDrawable->bitsPerPixel); - pGC->funcs->ValidateGC(pGC, changes, pDrawable); - pDrawable->depth = depth; - - if (((WindowPtr) pDrawable)->viewable) { - gcrec->originalOps = pGC->ops; - } - } else { - pGC->funcs->ValidateGC(pGC, changes, pDrawable); - } - - GCFUNC_WRAP(pGC); -} - -static void RootlessChangeGC(GCPtr pGC, unsigned long mask) -{ - GCFUNC_UNWRAP(pGC); - pGC->funcs->ChangeGC(pGC, mask); - GCFUNC_WRAP(pGC); -} - -static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) -{ - GCFUNC_UNWRAP(pGCDst); - pGCDst->funcs->CopyGC(pGCSrc, mask, pGCDst); - GCFUNC_WRAP(pGCDst); -} - -static void RootlessDestroyGC(GCPtr pGC) -{ - GCFUNC_UNWRAP(pGC); - pGC->funcs->DestroyGC(pGC); - GCFUNC_WRAP(pGC); -} - -static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) -{ - GCFUNC_UNWRAP(pGC); - pGC->funcs->ChangeClip(pGC, type, pvalue, nrects); - GCFUNC_WRAP(pGC); -} - -static void RootlessDestroyClip(GCPtr pGC) -{ - GCFUNC_UNWRAP(pGC); - pGC->funcs->DestroyClip(pGC); - GCFUNC_WRAP(pGC); -} - -static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - GCFUNC_UNWRAP(pgcDst); - pgcDst->funcs->CopyClip(pgcDst, pgcSrc); - GCFUNC_WRAP(pgcDst); -} - - -// GC ops -// We can't use shadowfb because shadowfb assumes one pixmap -// and our root window is a special case. -// So much of this code is copied from shadowfb. - -// assumes both funcs and ops are wrapped -#define GCOP_UNWRAP(pGC) \ - RootlessGCRec *gcrec = (RootlessGCRec *) \ - (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \ - GCFuncs *saveFuncs = pGC->funcs; \ - (pGC)->funcs = gcrec->originalFuncs; \ - (pGC)->ops = gcrec->originalOps; - -#define GCOP_WRAP(pGC) \ - gcrec->originalOps = (pGC)->ops; \ - (pGC)->funcs = saveFuncs; \ - (pGC)->ops = &rootlessGCOps; - - -static void -RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit, - DDXPointPtr pptInit, int *pwidthInit, int sorted) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("fill spans start "); - - if (nInit <= 0) { - pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted); - } else { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nInit; - BoxRec box; - - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while(--i) { - ppt++; - pwidthInit++; - if(box.x1 > ppt->x) - box.x1 = ppt->x; - if(box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if(box.y1 > ppt->y) - box.y1 = ppt->y; - else if(box.y2 < ppt->y) - box.y2 = ppt->y; - } - - box.y2++; - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted); - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("fill spans end\n"); -} - -static void -RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc, - DDXPointPtr pptInit, int *pwidthInit, - int nspans, int sorted) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("set spans start "); - - if (nspans <= 0) { - pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit, - nspans, sorted); - } else { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nspans; - BoxRec box; - - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while(--i) { - ppt++; - pwidth++; - if(box.x1 > ppt->x) - box.x1 = ppt->x; - if(box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if(box.y1 > ppt->y) - box.y1 = ppt->y; - else if(box.y2 < ppt->y) - box.y2 = ppt->y; - } - - box.y2++; - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit, - nspans, sorted); - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - GCOP_WRAP(pGC); - RL_DEBUG_MSG("set spans end\n"); -} - -static void -RootlessPutImage(DrawablePtr dst, GCPtr pGC, - int depth, int x, int y, int w, int h, - int leftPad, int format, char *pBits) -{ - BoxRec box; - - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("put image start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PutImage(dst, pGC, depth, x,y,w,h, leftPad, format, pBits); - - box.x1 = x + dst->x; - box.x2 = box.x1 + w; - box.y1 = y + dst->y; - box.y2 = box.y1 + h; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("put image end\n"); -} - -/* changed area is *dest* rect */ -static RegionPtr -RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, - int srcx, int srcy, int w, int h, - int dstx, int dsty) -{ - RegionPtr result; - BoxRec box; - - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst); - - if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) { - RootlessStartDrawing((WindowPtr) pSrc); - } - RootlessStartDrawing((WindowPtr) dst); - result = pGC->ops->CopyArea(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty); - - box.x1 = dstx + dst->x; - box.x2 = box.x1 + w; - box.y1 = dsty + dst->y; - box.y2 = box.y1 + h; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("copy area end\n"); - return result; -} - -/* changed area is *dest* rect */ -static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst, - GCPtr pGC, int srcx, int srcy, - int w, int h, int dstx, int dsty, - unsigned long plane) -{ - RegionPtr result; - BoxRec box; - - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("copy plane start "); - - if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) { - RootlessStartDrawing((WindowPtr) pSrc); - } - RootlessStartDrawing((WindowPtr) dst); - result = pGC->ops->CopyPlane(pSrc, dst, pGC, srcx, srcy, w, h, - dstx, dsty, plane); - - box.x1 = dstx + dst->x; - box.x2 = box.x1 + w; - box.y1 = dsty + dst->y; - box.y2 = box.y1 + h; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("copy plane end\n"); - return result; -} - -// Options for size of changed area: -// 0 = box per point -// 1 = big box around all points -// 2 = accumulate point in 20 pixel radius -#define ROOTLESS_CHANGED_AREA 1 -#define abs(a) ((a) > 0 ? (a) : -(a)) - -/* changed area is box around all points */ -static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC, - int mode, int npt, DDXPointPtr pptInit) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("polypoint start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit); - - if (npt > 0) { -#if ROOTLESS_CHANGED_AREA==0 - // box per point - BoxRec box; - - while (npt) { - box.x1 = pptInit->x; - box.y1 = pptInit->y; - box.x2 = box.x1 + 1; - box.y2 = box.y1 + 1; - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - npt--; - pptInit++; - } - -#elif ROOTLESS_CHANGED_AREA==1 - // one big box - BoxRec box; - - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - while(--npt) { - pptInit++; - if(box.x1 > pptInit->x) - box.x1 = pptInit->x; - else if(box.x2 < pptInit->x) - box.x2 = pptInit->x; - if(box.y1 > pptInit->y) - box.y1 = pptInit->y; - else if(box.y2 < pptInit->y) - box.y2 = pptInit->y; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - -#elif ROOTLESS_CHANGED_AREA==2 - // clever(?) method: accumulate point in 20-pixel radius - BoxRec box; - int firstx, firsty; - - box.x2 = box.x1 = firstx = pptInit->x; - box.y2 = box.y1 = firsty = pptInit->y; - while(--npt) { - pptInit++; - if (abs(pptInit->x - firstx) > 20 || - abs(pptInit->y - firsty) > 20) { - box.x2++; - box.y2++; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - box.x2 = box.x1 = firstx = pptInit->x; - box.y2 = box.y1 = firsty = pptInit->y; - } else { - if (box.x1 > pptInit->x) box.x1 = pptInit->x; - else if (box.x2 < pptInit->x) box.x2 = pptInit->x; - if (box.y1 > pptInit->y) box.y1 = pptInit->y; - else if (box.y2 < pptInit->y) box.y2 = pptInit->y; - } - } - box.x2++; - box.y2++; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); -#endif /* ROOTLESS_CHANGED_AREA */ - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("polypoint end\n"); -} - -#undef ROOTLESS_CHANGED_AREA - -/* changed area is box around each line */ -static void RootlessPolylines(DrawablePtr dst, GCPtr pGC, - int mode, int npt, DDXPointPtr pptInit) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("poly lines start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->Polylines(dst, pGC, mode, npt, pptInit); - - if (npt > 0) { - BoxRec box; - int extra = pGC->lineWidth >> 1; - - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - - if(npt > 1) { - if(pGC->joinStyle == JoinMiter) - extra = 6 * pGC->lineWidth; - else if(pGC->capStyle == CapProjecting) - extra = pGC->lineWidth; - } - - if(mode == CoordModePrevious) { - int x = box.x1; - int y = box.y1; - - while(--npt) { - pptInit++; - x += pptInit->x; - y += pptInit->y; - if(box.x1 > x) - box.x1 = x; - else if(box.x2 < x) - box.x2 = x; - if(box.y1 > y) - box.y1 = y; - else if(box.y2 < y) - box.y2 = y; - } - } else { - while(--npt) { - pptInit++; - if(box.x1 > pptInit->x) - box.x1 = pptInit->x; - else if(box.x2 < pptInit->x) - box.x2 = pptInit->x; - if(box.y1 > pptInit->y) - box.y1 = pptInit->y; - else if(box.y2 < pptInit->y) - box.y2 = pptInit->y; - } - } - - box.x2++; - box.y2++; - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("poly lines end\n"); -} - -/* changed area is box around each line segment */ -static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC, - int nseg, xSegment *pSeg) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("poly segment start (win 0x%x)", dst); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolySegment(dst, pGC, nseg, pSeg); - - if (nseg > 0) { - BoxRec box; - int extra = pGC->lineWidth; - - if(pGC->capStyle != CapProjecting) - extra >>= 1; - - if(pSeg->x2 > pSeg->x1) { - box.x1 = pSeg->x1; - box.x2 = pSeg->x2; - } else { - box.x2 = pSeg->x1; - box.x1 = pSeg->x2; - } - - if(pSeg->y2 > pSeg->y1) { - box.y1 = pSeg->y1; - box.y2 = pSeg->y2; - } else { - box.y2 = pSeg->y1; - box.y1 = pSeg->y2; - } - - while(--nseg) { - pSeg++; - if(pSeg->x2 > pSeg->x1) { - if(pSeg->x1 < box.x1) box.x1 = pSeg->x1; - if(pSeg->x2 > box.x2) box.x2 = pSeg->x2; - } else { - if(pSeg->x2 < box.x1) box.x1 = pSeg->x2; - if(pSeg->x1 > box.x2) box.x2 = pSeg->x1; - } - if(pSeg->y2 > pSeg->y1) { - if(pSeg->y1 < box.y1) box.y1 = pSeg->y1; - if(pSeg->y2 > box.y2) box.y2 = pSeg->y2; - } else { - if(pSeg->y2 < box.y1) box.y1 = pSeg->y2; - if(pSeg->y1 > box.y2) box.y2 = pSeg->y1; - } - } - - box.x2++; - box.y2++; - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("poly segment end\n"); -} - -/* changed area is box around each line (not entire rects) */ -static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC, - int nRects, xRectangle *pRects) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("poly rectangle start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyRectangle(dst, pGC, nRects, pRects); - - if (nRects > 0) { - BoxRec box; - int offset1, offset2, offset3; - - offset2 = pGC->lineWidth; - if(!offset2) offset2 = 1; - offset1 = offset2 >> 1; - offset3 = offset2 - offset1; - - while(nRects--) { - box.x1 = pRects->x - offset1; - box.y1 = pRects->y - offset1; - box.x2 = box.x1 + pRects->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - box.x1 = pRects->x - offset1; - box.y1 = pRects->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRects->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - box.x1 = pRects->x + pRects->width - offset1; - box.y1 = pRects->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRects->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - box.x1 = pRects->x - offset1; - box.y1 = pRects->y + pRects->height - offset1; - box.x2 = box.x1 + pRects->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - pRects++; - } - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("poly rectangle end\n"); -} - - -/* changed area is box around each arc (assumes all arcs are 360 degrees) */ -static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc *parcs) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("poly arc start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyArc(dst, pGC, narcs, parcs); - - if (narcs > 0) { - int extra = pGC->lineWidth >> 1; - BoxRec box; - - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while(--narcs) { - parcs++; - if(box.x1 > parcs->x) - box.x1 = parcs->x; - if(box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if(box.y1 > parcs->y) - box.y1 = parcs->y; - if(box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("poly arc end\n"); -} - - -/* changed area is box around each poly */ -static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC, - int shape, int mode, int count, - DDXPointPtr pptInit) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("fill poly start (win 0x%x, fillStyle 0x%x)", dst, - pGC->fillStyle); - - if (count <= 2) { - pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit); - } else { - DDXPointPtr ppt = pptInit; - int i = count; - BoxRec box; - - box.x2 = box.x1 = ppt->x; - box.y2 = box.y1 = ppt->y; - - if(mode != CoordModeOrigin) { - int x = box.x1; - int y = box.y1; - - while(--i) { - ppt++; - x += ppt->x; - y += ppt->y; - if(box.x1 > x) - box.x1 = x; - else if(box.x2 < x) - box.x2 = x; - if(box.y1 > y) - box.y1 = y; - else if(box.y2 < y) - box.y2 = y; - } - } else { - while(--i) { - ppt++; - if(box.x1 > ppt->x) - box.x1 = ppt->x; - else if(box.x2 < ppt->x) - box.x2 = ppt->x; - if(box.y1 > ppt->y) - box.y1 = ppt->y; - else if(box.y2 < ppt->y) - box.y2 = ppt->y; - } - } - - box.x2++; - box.y2++; - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit); - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("fill poly end\n"); -} - -/* changed area is the rects */ -static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC, - int nRectsInit, xRectangle *pRectsInit) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("fill rect start (win 0x%x, fillStyle 0x%x)", dst, - pGC->fillStyle); - - if (nRectsInit <= 0) { - pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit); - } else { - BoxRec box; - xRectangle *pRects = pRectsInit; - int nRects = nRectsInit; - - box.x1 = pRects->x; - box.x2 = box.x1 + pRects->width; - box.y1 = pRects->y; - box.y2 = box.y1 + pRects->height; - - while(--nRects) { - pRects++; - if(box.x1 > pRects->x) - box.x1 = pRects->x; - if(box.x2 < (pRects->x + pRects->width)) - box.x2 = pRects->x + pRects->width; - if(box.y1 > pRects->y) - box.y1 = pRects->y; - if(box.y2 < (pRects->y + pRects->height)) - box.y2 = pRects->y + pRects->height; - } - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit); - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("fill rect end\n"); -} - - -/* changed area is box around each arc (assuming arcs are all 360 degrees) */ -static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC, - int narcs, xArc *parcs) -{ - GCOP_UNWRAP(pGC); - - RL_DEBUG_MSG("fill arc start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyFillArc(dst, pGC, narcs, parcs); - - if (narcs > 0) { - BoxRec box; - - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while(--narcs) { - parcs++; - if(box.x1 > parcs->x) - box.x1 = parcs->x; - if(box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if(box.y1 > parcs->y) - box.y1 = parcs->y; - if(box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - TRIM_AND_TRANSLATE_BOX(box, dst, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("fill arc end\n"); -} - - -static void RootlessImageText8(DrawablePtr dst, GCPtr pGC, - int x, int y, int count, char *chars) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("imagetext8 start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->ImageText8(dst, pGC, x, y, count, chars); - - if (count > 0) { - int top, bot, Min, Max; - BoxRec box; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if(Min > 0) Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if(Max < 0) Max = 0; - - /* ugh */ - box.x1 = dst->x + x + Min + - FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = dst->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = dst->y + y - top; - box.y2 = dst->y + y + bot; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("imagetext8 end\n"); -} - -static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC, - int x, int y, int count, char *chars) -{ - int width; // the result, sorta - - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("polytext8 start "); - - RootlessStartDrawing((WindowPtr) dst); - width = pGC->ops->PolyText8(dst, pGC, x, y, count, chars); - width -= x; - - if(width > 0) { - BoxRec box; - - /* ugh */ - box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); - - if(count > 1) { - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("polytext8 end\n"); - return (width + x); -} - -static void RootlessImageText16(DrawablePtr dst, GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("imagetext16 start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->ImageText16(dst, pGC, x, y, count, chars); - - if (count > 0) { - int top, bot, Min, Max; - BoxRec box; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if(Min > 0) Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if(Max < 0) Max = 0; - - /* ugh */ - box.x1 = dst->x + x + Min + - FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = dst->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = dst->y + y - top; - box.y2 = dst->y + y + bot; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("imagetext16 end\n"); -} - -static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - int width; // the result, sorta - - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("polytext16 start "); - - RootlessStartDrawing((WindowPtr) dst); - width = pGC->ops->PolyText16(dst, pGC, x, y, count, chars); - width -= x; - - if (width > 0) { - BoxRec box; - - /* ugh */ - box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); - - if(count > 1) { - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("polytext16 end\n"); - return width + x; -} - -static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer unused) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("imageglyph start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyph, ppci, unused); - - if (nglyph > 0) { - int top, bot, width = 0; - BoxRec box; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - box.x1 = ppci[0]->metrics.leftSideBearing; - if(box.x1 > 0) box.x1 = 0; - box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing - - ppci[nglyph - 1]->metrics.characterWidth; - if(box.x2 < 0) box.x2 = 0; - - box.x2 += dst->x + x; - box.x1 += dst->x + x; - - while(nglyph--) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if(width > 0) - box.x2 += width; - else - box.x1 += width; - - box.y1 = dst->y + y - top; - box.y2 = dst->y + y + bot; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("imageglyph end\n"); -} - -static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) -{ - GCOP_UNWRAP(pGC); - RL_DEBUG_MSG("polyglyph start "); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PolyGlyphBlt(dst, pGC, x, y, nglyph, ppci, pglyphBase); - - if (nglyph > 0) { - BoxRec box; - - /* ugh */ - box.x1 = dst->x + x + ppci[0]->metrics.leftSideBearing; - box.x2 = dst->x + x + ppci[nglyph - 1]->metrics.rightSideBearing; - - if(nglyph > 1) { - int width = 0; - - while(--nglyph) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - } - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("polyglyph end\n"); -} - - -/* changed area is in dest */ -static void -RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst, - int dx, int dy, int xOrg, int yOrg) -{ - BoxRec box; - GCOP_UNWRAP(pGC); - - RootlessStartDrawing((WindowPtr) dst); - pGC->ops->PushPixels(pGC, pBitMap, dst, dx, dy, xOrg, yOrg); - - box.x1 = xOrg + dst->x; - box.x2 = box.x1 + dx; - box.y1 = yOrg + dst->y; - box.y2 = box.y1 + dy; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - RootlessDamageBox ((WindowPtr) dst, &box); - - GCOP_WRAP(pGC); - RL_DEBUG_MSG("push pixels end\n"); -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c:1.4 xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c:1.4 Sun Feb 23 16:48:23 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c Sat Feb 28 21:42:13 2004 @@ -1,455 +0,0 @@ -/* - * Screen routines for Mac OS X rootless X server - * - * Greg Parker gparker@cs.stanford.edu - * - * February 2001 Created - * March 3, 2001 Restructured as generic rootless mode - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessScreen.c,v 1.4 2003/02/23 21:48:23 torrey Exp $ */ - - -#include "mi.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "propertyst.h" -#include "mivalidate.h" -#include "picturestr.h" - -#include -#include -#include - -#include "rootlessCommon.h" -#include "rootlessWindow.h" - -extern int -RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind); -extern Bool -RootlessCreateGC(GCPtr pGC); - -// Initialize globals -int rootlessGCPrivateIndex = -1; -int rootlessScreenPrivateIndex = -1; -int rootlessWindowPrivateIndex = -1; - - -static Bool -RootlessCloseScreen(int i, ScreenPtr pScreen) -{ - RootlessScreenRec *s; - - s = SCREENREC(pScreen); - - // fixme unwrap everything that was wrapped? - pScreen->CloseScreen = s->CloseScreen; - - xfree(s); - return pScreen->CloseScreen(i, pScreen); -} - - -static void -RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, - unsigned int format, unsigned long planeMask, char *pdstLine) -{ - ScreenPtr pScreen = pDrawable->pScreen; - SCREEN_UNWRAP(pScreen, GetImage); - - if (pDrawable->type == DRAWABLE_WINDOW) { - int x0, y0, x1, y1; - RootlessWindowRec *winRec; - - // Many apps use GetImage to sync with the visible frame buffer - // FIXME: entire screen or just window or all screens? - RootlessRedisplayScreen(pScreen); - - // RedisplayScreen stops drawing, so we need to start it again - RootlessStartDrawing((WindowPtr)pDrawable); - - /* Check that we have some place to read from. */ - winRec = WINREC (TopLevelParent ((WindowPtr) pDrawable)); - if (winRec == NULL) - goto out; - - /* Clip to top-level window bounds. */ - /* FIXME: fbGetImage uses the width parameter to calculate the - stride of the destination pixmap. If w is clipped, the data - returned will be garbage, although we will not crash. */ - - x0 = pDrawable->x + sx; - y0 = pDrawable->y + sy; - x1 = x0 + w; - y1 = y0 + h; - - if (x0 < winRec->frame.x) - x0 = winRec->frame.x; - if (y0 < winRec->frame.y) - y0 = winRec->frame.y; - if (x1 > winRec->frame.x + winRec->frame.w) - x1 = winRec->frame.x + winRec->frame.w; - if (y1 > winRec->frame.y + winRec->frame.h) - y1 = winRec->frame.y + winRec->frame.h; - - sx = x0 - pDrawable->x; - sy = y0 - pDrawable->y; - w = x1 - x0; - h = y1 - y0; - - if (w <= 0 || h <= 0) - goto out; - } - - pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - -out: - SCREEN_WRAP(pScreen, GetImage); -} - - -/* - * RootlessSourceValidate - * CopyArea and CopyPlane use a GC tied to the destination drawable. - * StartDrawing/StopDrawing wrappers won't be called if source is - * a visible window but the destination isn't. So, we call StartDrawing - * here and leave StopDrawing for the block handler. - */ -static void -RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h) -{ - SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate); - if (pDrawable->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr)pDrawable; - RootlessStartDrawing(pWin); - } - if (pDrawable->pScreen->SourceValidate) { - pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h); - } - SCREEN_WRAP(pDrawable->pScreen, SourceValidate); -} - -#ifdef RENDER - -static void -RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - WindowPtr srcWin, dstWin, maskWin = NULL; - - if (pMask) { // pMask can be NULL - maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ? - (WindowPtr)pMask->pDrawable : NULL; - } - srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ? - (WindowPtr)pSrc->pDrawable : NULL; - dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? - (WindowPtr)pDst->pDrawable : NULL; - - // SCREEN_UNWRAP(ps, Composite); - ps->Composite = SCREENREC(pScreen)->Composite; - - if (srcWin && IsFramedWindow(srcWin)) RootlessStartDrawing(srcWin); - if (maskWin && IsFramedWindow(maskWin)) RootlessStartDrawing(maskWin); - if (dstWin && IsFramedWindow(dstWin)) RootlessStartDrawing(dstWin); - - ps->Composite(op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, - xDst, yDst, width, height); - - if (dstWin && IsFramedWindow(dstWin)) { - RootlessDamageRect(dstWin, xDst, yDst, width, height); - } - - ps->Composite = RootlessComposite; - // SCREEN_WRAP(ps, Composite); -} - - -static void -RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int nlist, GlyphListPtr list, GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - int x, y; - int n; - GlyphPtr glyph; - WindowPtr srcWin, dstWin; - - srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ? - (WindowPtr)pSrc->pDrawable : NULL; - dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? - (WindowPtr)pDst->pDrawable : NULL; - - if (srcWin && IsFramedWindow(srcWin)) RootlessStartDrawing(srcWin); - if (dstWin && IsFramedWindow(dstWin)) RootlessStartDrawing(dstWin); - - //SCREEN_UNWRAP(ps, Glyphs); - ps->Glyphs = SCREENREC(pScreen)->Glyphs; - ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - ps->Glyphs = RootlessGlyphs; - //SCREEN_WRAP(ps, Glyphs); - - if (dstWin && IsFramedWindow(dstWin)) { - x = xSrc; - y = ySrc; - while (nlist--) { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) { - glyph = *glyphs++; - RootlessDamageRect(dstWin, - x - glyph->info.x, y - glyph->info.y, - glyph->info.width, glyph->info.height); - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - } - } -} - -#endif // RENDER - - -// RootlessValidateTree -// ValidateTree is modified in two ways: -// * top-level windows don't clip each other -// * windows aren't clipped against root. -// These only matter when validating from the root. -static int -RootlessValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - int result; - RegionRec saveRoot; - ScreenPtr pScreen = pParent->drawable.pScreen; - - SCREEN_UNWRAP(pScreen, ValidateTree); - RL_DEBUG_MSG("VALIDATETREE start "); - - // Use our custom version to validate from root - if (IsRoot(pParent)) { - RL_DEBUG_MSG("custom "); - result = RootlessMiValidateTree(pParent, pChild, kind); - } else { - HUGE_ROOT(pParent); - result = pScreen->ValidateTree(pParent, pChild, kind); - NORMAL_ROOT(pParent); - } - - SCREEN_WRAP(pScreen, ValidateTree); - RL_DEBUG_MSG("VALIDATETREE end\n"); - - return result; -} - - -// RootlessMarkOverlappedWindows -// MarkOverlappedWindows is modified to ignore overlapping -// top-level windows. -static Bool -RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, - WindowPtr *ppLayerWin) -{ - RegionRec saveRoot; - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - SCREEN_UNWRAP(pScreen, MarkOverlappedWindows); - RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS start "); - - HUGE_ROOT(pWin); - if (IsRoot(pWin)) { - // root - mark nothing - RL_DEBUG_MSG("is root not marking "); - result = FALSE; - } - else if (! IsTopLevel(pWin)) { - // not top-level window - mark normally - result = pScreen->MarkOverlappedWindows(pWin, pFirst, ppLayerWin); - } - else { - //top-level window - mark children ONLY - NO overlaps with sibs (?) - // This code copied from miMarkOverlappedWindows() - - register WindowPtr pChild; - Bool anyMarked = FALSE; - void (* MarkWindow)() = pScreen->MarkWindow; - - RL_DEBUG_MSG("is top level! "); - /* single layered systems are easy */ - if (ppLayerWin) *ppLayerWin = pWin; - - if (pWin == pFirst) { - /* Blindly mark pWin and all of its inferiors. This is a slight - * overkill if there are mapped windows that outside pWin's border, - * but it's better than wasting time on RectIn checks. - */ - pChild = pWin; - while (1) { - if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - (* MarkWindow)(pChild); - if (pChild->firstChild) { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - anyMarked = TRUE; - pFirst = pFirst->nextSib; - } - if (anyMarked) - (* MarkWindow)(pWin->parent); - result = anyMarked; - } - NORMAL_ROOT(pWin); - SCREEN_WRAP(pScreen, MarkOverlappedWindows); - RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS end\n"); - return result; -} - - -// Flush drawing before blocking on select(). -static void -RootlessBlockHandler(pointer pbdata, OSTimePtr pTimeout, pointer pReadmask) -{ - RootlessRedisplayScreen((ScreenPtr) pbdata); -} - - -static void -RootlessWakeupHandler(pointer data, int i, pointer LastSelectMask) -{ - // nothing here -} - - -static Bool -RootlessAllocatePrivates(ScreenPtr pScreen) -{ - RootlessScreenRec *s; - static unsigned long rootlessGeneration = 0; - - if (rootlessGeneration != serverGeneration) { - rootlessScreenPrivateIndex = AllocateScreenPrivateIndex(); - if (rootlessScreenPrivateIndex == -1) return FALSE; - rootlessGCPrivateIndex = AllocateGCPrivateIndex(); - if (rootlessGCPrivateIndex == -1) return FALSE; - rootlessWindowPrivateIndex = AllocateWindowPrivateIndex(); - if (rootlessWindowPrivateIndex == -1) return FALSE; - rootlessGeneration = serverGeneration; - } - - // no allocation needed for screen privates - if (!AllocateGCPrivate(pScreen, rootlessGCPrivateIndex, - sizeof(RootlessGCRec))) - return FALSE; - if (!AllocateWindowPrivate(pScreen, rootlessWindowPrivateIndex, 0)) - return FALSE; - - s = xalloc(sizeof(RootlessScreenRec)); - if (! s) return FALSE; - SCREENREC(pScreen) = s; - - return TRUE; -} - - -static void -RootlessWrap(ScreenPtr pScreen) -{ - RootlessScreenRec *s = (RootlessScreenRec*) - pScreen->devPrivates[rootlessScreenPrivateIndex].ptr; - -#define WRAP(a) \ - if (pScreen->a) { \ - s->a = pScreen->a; \ - } else { \ - RL_DEBUG_MSG("null screen fn " #a "\n"); \ - s->a = NULL; \ - } \ - pScreen->a = Rootless##a - - WRAP(CloseScreen); - WRAP(CreateGC); - WRAP(PaintWindowBackground); - WRAP(PaintWindowBorder); - WRAP(CopyWindow); - WRAP(GetImage); - WRAP(SourceValidate); - WRAP(CreateWindow); - WRAP(DestroyWindow); - WRAP(RealizeWindow); - WRAP(UnrealizeWindow); - WRAP(MoveWindow); - WRAP(PositionWindow); - WRAP(ResizeWindow); - WRAP(RestackWindow); - WRAP(ChangeBorderWidth); - WRAP(MarkOverlappedWindows); - WRAP(ValidateTree); - WRAP(ChangeWindowAttributes); - -#ifdef SHAPE - WRAP(SetShape); -#endif - -#ifdef RENDER - { - // Composite and Glyphs don't use normal screen wrapping - PictureScreenPtr ps = GetPictureScreen(pScreen); - s->Composite = ps->Composite; - ps->Composite = RootlessComposite; - s->Glyphs = ps->Glyphs; - ps->Glyphs = RootlessGlyphs; - } -#endif - - // WRAP(ClearToBackground); fixme put this back? useful for shaped wins? - // WRAP(RestoreAreas); fixme put this back? - -#undef WRAP -} - - -/* - * RootlessInit - * Rootless wraps lots of stuff and needs a bunch of devPrivates. - */ -Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcs *procs) -{ - RootlessScreenRec *s; - - if (! RootlessAllocatePrivates(pScreen)) return FALSE; - s = (RootlessScreenRec*) - pScreen->devPrivates[rootlessScreenPrivateIndex].ptr; - - s->pScreen = pScreen; - s->frameProcs = *procs; - - RootlessWrap(pScreen); - - if (!RegisterBlockAndWakeupHandlers (RootlessBlockHandler, - RootlessWakeupHandler, - (pointer) pScreen)) - { - return FALSE; - } - - return TRUE; -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c:1.2 xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c:1.2 Tue Jun 18 15:43:04 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c Sat Feb 28 21:42:13 2004 @@ -1,640 +0,0 @@ -/* - * Calculate window clip lists for rootless mode - * - * This file is very closely based on mivaltree.c. - */ - /* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessValTree.c,v 1.2 2002/06/18 19:43:04 torrey Exp $ */ - -/* - * mivaltree.c -- - * Functions for recalculating window clip lists. Main function - * is miValidateTree. - * - -Copyright 1987, 1988, 1989, 1998 The Open Group - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - * - * Copyright 1987, 1988, 1989 by - * Digital Equipment Corporation, Maynard, Massachusetts, - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - ******************************************************************/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - - /* - * Aug '86: Susan Angebranndt -- original code - * July '87: Adam de Boor -- substantially modified and commented - * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible. - * In particular, much improved code for window mapping and - * circulating. - * Bob Scheifler -- avoid miComputeClips for unmapped windows, - * valdata changes - */ -#include "X.h" -#include "scrnintstr.h" -#include "validate.h" -#include "windowstr.h" -#include "mi.h" -#include "regionstr.h" -#include "mivalidate.h" - -#include "globals.h" - -#ifdef SHAPE -/* - * Compute the visibility of a shaped window - */ -int -RootlessShapedWindowIn (pScreen, universe, bounding, rect, x, y) - ScreenPtr pScreen; - RegionPtr universe, bounding; - BoxPtr rect; - register int x, y; -{ - BoxRec box; - register BoxPtr boundBox; - int nbox; - Bool someIn, someOut; - register int t, x1, y1, x2, y2; - - nbox = REGION_NUM_RECTS (bounding); - boundBox = REGION_RECTS (bounding); - someIn = someOut = FALSE; - x1 = rect->x1; - y1 = rect->y1; - x2 = rect->x2; - y2 = rect->y2; - while (nbox--) - { - if ((t = boundBox->x1 + x) < x1) - t = x1; - box.x1 = t; - if ((t = boundBox->y1 + y) < y1) - t = y1; - box.y1 = t; - if ((t = boundBox->x2 + x) > x2) - t = x2; - box.x2 = t; - if ((t = boundBox->y2 + y) > y2) - t = y2; - box.y2 = t; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - switch (RECT_IN_REGION(pScreen, universe, &box)) - { - case rgnIN: - if (someOut) - return rgnPART; - someIn = TRUE; - break; - case rgnOUT: - if (someIn) - return rgnPART; - someOut = TRUE; - break; - default: - return rgnPART; - } - boundBox++; - } - if (someIn) - return rgnIN; - return rgnOUT; -} -#endif - -#define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ - HasBorder(w) && \ - (w)->backgroundState == ParentRelative) - - -/* - *----------------------------------------------------------------------- - * RootlessComputeClips -- - * Recompute the clipList, borderClip, exposed and borderExposed - * regions for pParent and its children. Only viewable windows are - * taken into account. - * - * Results: - * None. - * - * Side Effects: - * clipList, borderClip, exposed and borderExposed are altered. - * A VisibilityNotify event may be generated on the parent window. - * - *----------------------------------------------------------------------- - */ -static void -RootlessComputeClips (pParent, pScreen, universe, kind, exposed) - register WindowPtr pParent; - register ScreenPtr pScreen; - register RegionPtr universe; - VTKind kind; - RegionPtr exposed; /* for intermediate calculations */ -{ - int dx, - dy; - RegionRec childUniverse; - register WindowPtr pChild; - int oldVis, newVis; - BoxRec borderSize; - RegionRec childUnion; - Bool overlap; - RegionPtr borderVisible; - Bool resized; - /* - * Figure out the new visibility of this window. - * The extent of the universe should be the same as the extent of - * the borderSize region. If the window is unobscured, this rectangle - * will be completely inside the universe (the universe will cover it - * completely). If the window is completely obscured, none of the - * universe will cover the rectangle. - */ - borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent); - borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent); - dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent); - if (dx > 32767) - dx = 32767; - borderSize.x2 = dx; - dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent); - if (dy > 32767) - dy = 32767; - borderSize.y2 = dy; - - oldVis = pParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) - { - case rgnIN: - newVis = VisibilityUnobscured; - break; - case rgnPART: - newVis = VisibilityPartiallyObscured; -#ifdef SHAPE - { - RegionPtr pBounding; - - if ((pBounding = wBoundingShape (pParent))) - { - switch (RootlessShapedWindowIn (pScreen, universe, - pBounding, &borderSize, - pParent->drawable.x, - pParent->drawable.y)) - { - case rgnIN: - newVis = VisibilityUnobscured; - break; - case rgnOUT: - newVis = VisibilityFullyObscured; - break; - } - } - } -#endif - break; - default: - newVis = VisibilityFullyObscured; - break; - } - - pParent->visibility = newVis; - if (oldVis != newVis && - ((pParent->eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) - SendVisibilityNotify(pParent); - - dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; - dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y; - - /* - * avoid computations when dealing with simple operations - */ - - switch (kind) { - case VTMap: - case VTStack: - case VTUnmap: - break; - case VTMove: - if ((oldVis == newVis) && - ((oldVis == VisibilityFullyObscured) || - (oldVis == VisibilityUnobscured))) - { - pChild = pParent; - while (1) - { - if (pChild->viewable) - { - if (pChild->visibility != VisibilityFullyObscured) - { - REGION_TRANSLATE( pScreen, &pChild->borderClip, - dx, dy); - REGION_TRANSLATE( pScreen, &pChild->clipList, - dx, dy); - pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (pScreen->ClipNotify) - (* pScreen->ClipNotify) (pChild, dx, dy); - - } - if (pChild->valdata) - { - REGION_INIT(pScreen, - &pChild->valdata->after.borderExposed, - NullBox, 0); - if (HasParentRelativeBorder(pChild)) - { - REGION_SUBTRACT(pScreen, - &pChild->valdata->after.borderExposed, - &pChild->borderClip, - &pChild->winSize); - } - REGION_INIT( pScreen, &pChild->valdata->after.exposed, - NullBox, 0); - } - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pParent)) - pChild = pChild->parent; - if (pChild == pParent) - break; - pChild = pChild->nextSib; - } - return; - } - /* fall through */ - default: - /* - * To calculate exposures correctly, we have to translate the old - * borderClip and clipList regions to the window's new location so there - * is a correspondence between pieces of the new and old clipping regions. - */ - if (dx || dy) - { - /* - * We translate the old clipList because that will be exposed or copied - * if gravity is right. - */ - REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy); - } - break; - case VTBroken: - REGION_EMPTY (pScreen, &pParent->borderClip); - REGION_EMPTY (pScreen, &pParent->clipList); - break; - } - - borderVisible = pParent->valdata->before.borderVisible; - resized = pParent->valdata->before.resized; - REGION_INIT( pScreen, &pParent->valdata->after.borderExposed, NullBox, 0); - REGION_INIT( pScreen, &pParent->valdata->after.exposed, NullBox, 0); - - /* - * Since the borderClip must not be clipped by the children, we do - * the border exposure first... - * - * 'universe' is the window's borderClip. To figure the exposures, remove - * the area that used to be exposed from the new. - * This leaves a region of pieces that weren't exposed before. - */ - - if (HasBorder (pParent)) - { - if (borderVisible) - { - /* - * when the border changes shape, the old visible portions - * of the border will be saved by DIX in borderVisible -- - * use that region and destroy it - */ - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); - } - else - { - REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip); - } - if (HasParentRelativeBorder(pParent) && (dx || dy)) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, - universe, - &pParent->winSize); - } else { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, - exposed, &pParent->winSize); - } - - REGION_COPY( pScreen, &pParent->borderClip, universe); - - /* - * To get the right clipList for the parent, and to make doubly sure - * that no child overlaps the parent's border, we remove the parent's - * border from the universe before proceeding. - */ - - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); - } - else - REGION_COPY( pScreen, &pParent->borderClip, universe); - - if ((pChild = pParent->firstChild) && pParent->mapped) - { - REGION_INIT(pScreen, &childUniverse, NullBox, 0); - REGION_INIT(pScreen, &childUnion, NullBox, 0); - if ((pChild->drawable.y < pParent->lastChild->drawable.y) || - ((pChild->drawable.y == pParent->lastChild->drawable.y) && - (pChild->drawable.x < pParent->lastChild->drawable.x))) - { - for (; pChild; pChild = pChild->nextSib) - { - if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); - } - } - else - { - for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) - { - if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); - } - } - REGION_VALIDATE( pScreen, &childUnion, &overlap); - - for (pChild = pParent->firstChild; - pChild; - pChild = pChild->nextSib) - { - if (pChild->viewable) { - /* - * If the child is viewable, we want to remove its extents - * from the current universe, but we only re-clip it if - * it's been marked. - */ - if (pChild->valdata) { - /* - * Figure out the new universe from the child's - * perspective and recurse. - */ - REGION_INTERSECT( pScreen, &childUniverse, - universe, - &pChild->borderSize); - RootlessComputeClips (pChild, pScreen, &childUniverse, - kind, exposed); - } - /* - * Once the child has been processed, we remove its extents - * from the current universe, thus denying its space to any - * other sibling. - */ - if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, - &pChild->borderSize); - } - } - if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); - } /* if any children */ - - /* - * 'universe' now contains the new clipList for the parent window. - * - * To figure the exposure of the window we subtract the old clip from the - * new, just as for the border. - */ - - if (oldVis == VisibilityFullyObscured || - oldVis == VisibilityNotViewable) - { - REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe); - } - else if (newVis != VisibilityFullyObscured && - newVis != VisibilityNotViewable) - { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, - universe, &pParent->clipList); - } - - /* - * One last thing: backing storage. We have to try to save what parts of - * the window are about to be obscured. We can just subtract the universe - * from the old clipList and get the areas that were in the old but aren't - * in the new and, hence, are about to be obscured. - */ - if (pParent->backStorage && !resized) - { - REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe); - (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy); - } - - /* HACK ALERT - copying contents of regions, instead of regions */ - { - RegionRec tmp; - - tmp = pParent->clipList; - pParent->clipList = *universe; - *universe = tmp; - } - -#ifdef NOTDEF - REGION_COPY( pScreen, &pParent->clipList, universe); -#endif - - pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - if (pScreen->ClipNotify) - (* pScreen->ClipNotify) (pParent, dx, dy); -} - -static void -RootlessTreeObscured(pParent) - register WindowPtr pParent; -{ - register WindowPtr pChild; - register int oldVis; - - pChild = pParent; - while (1) - { - if (pChild->viewable) - { - oldVis = pChild->visibility; - if (oldVis != (pChild->visibility = VisibilityFullyObscured) && - ((pChild->eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask)) - SendVisibilityNotify(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pParent)) - pChild = pChild->parent; - if (pChild == pParent) - break; - pChild = pChild->nextSib; - } -} - -/* - *----------------------------------------------------------------------- - * RootlessMiValidateTree -- - * Recomputes the clip list for pParent and all its inferiors. - * - * Results: - * Always returns 1. - * - * Side Effects: - * The clipList, borderClip, exposed, and borderExposed regions for - * each marked window are altered. - * - * Notes: - * This routine assumes that all affected windows have been marked - * (valdata created) and their winSize and borderSize regions - * adjusted to correspond to their new positions. The borderClip and - * clipList regions should not have been touched. - * - * The top-most level is treated differently from all lower levels - * because pParent is unchanged. For the top level, we merge the - * regions taken up by the marked children back into the clipList - * for pParent, thus forming a region from which the marked children - * can claim their areas. For lower levels, where the old clipList - * and borderClip are invalid, we can't do this and have to do the - * extra operations done in miComputeClips, but this is much faster - * e.g. when only one child has moved... - * - *----------------------------------------------------------------------- - */ -/* - Quartz version: used for validate from root in rootless mode. - We need to make sure top-level windows don't clip each other, - and that top-level windows aren't clipped to the root window. -*/ -/*ARGSUSED*/ -// fixme this is ugly -// Xprint/ValTree.c doesn't work, but maybe that method can? -int -RootlessMiValidateTree (pRoot, pChild, kind) - WindowPtr pRoot; /* Parent to validate */ - WindowPtr pChild; /* First child of pRoot that was - * affected */ - VTKind kind; /* What kind of configuration caused call */ -{ - RegionRec childClip; /* The new borderClip for the current - * child */ - RegionRec exposed; /* For intermediate calculations */ - register ScreenPtr pScreen; - register WindowPtr pWin; - - pScreen = pRoot->drawable.pScreen; - if (pChild == NullWindow) - pChild = pRoot->firstChild; - - REGION_INIT(pScreen, &childClip, NullBox, 0); - REGION_INIT(pScreen, &exposed, NullBox, 0); - - if (REGION_BROKEN (pScreen, &pRoot->clipList) && - !REGION_BROKEN (pScreen, &pRoot->borderClip)) - { - // fixme this might not work, but hopefully doesn't happen anyway. - kind = VTBroken; - REGION_EMPTY (pScreen, &pRoot->clipList); - ErrorF("ValidateTree: BUSTED!\n"); - } - - /* - * Recursively compute the clips for all children of the root. - * They don't clip against each other or the root itself, so - * childClip is always reset to that child's size. - */ - - for (pWin = pChild; - pWin != NullWindow; - pWin = pWin->nextSib) - { - if (pWin->viewable) { - if (pWin->valdata) { - REGION_COPY( pScreen, &childClip, &pWin->borderSize); - RootlessComputeClips (pWin, pScreen, &childClip, kind, &exposed); - } else if (pWin->visibility == VisibilityNotViewable) { - RootlessTreeObscured(pWin); - } - } else { - if (pWin->valdata) { - REGION_EMPTY( pScreen, &pWin->clipList); - if (pScreen->ClipNotify) - (* pScreen->ClipNotify) (pWin, 0, 0); - REGION_EMPTY( pScreen, &pWin->borderClip); - pWin->valdata = (ValidatePtr)NULL; - } - } - } - - REGION_UNINIT( pScreen, &childClip); - - /* The root is never clipped by its children, so nothing on the root - is ever exposed by moving or mapping its children. */ - REGION_INIT( pScreen, &pRoot->valdata->after.exposed, NullBox, 0); - REGION_INIT( pScreen, &pRoot->valdata->after.borderExposed, NullBox, 0); - - return 1; -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c:1.13 xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c:1.13 Tue Jan 28 20:11:05 2003 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c Sat Feb 28 21:42:13 2004 @@ -1,842 +0,0 @@ -/* - * Rootless window management - */ -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.c,v 1.13 2003/01/29 01:11:05 torrey Exp $ */ - -#include "rootlessCommon.h" -#include "rootlessWindow.h" - -#include "fb.h" - - -/* - * RootlessFrameForWindow - * Returns the rootless frame for the given window, or - * NULL if the the window is not inside a frame. - * Unrealized windows never have a frame. - */ -RootlessFramePtr -RootlessFrameForWindow(WindowPtr pWin) -{ - WindowPtr top = TopLevelParent(pWin); - RootlessWindowRec *winRec; - - if (!top) return NULL; - winRec = WINREC(top); - if (!winRec) return NULL; - return &winRec->frame; -} - - -// RootlessCreateWindow -// For now, don't create a frame until the window is realized. -// Do reset the window size so it's not clipped by the root window. -Bool -RootlessCreateWindow(WindowPtr pWin) -{ - Bool result; - RegionRec saveRoot; - - WINREC(pWin) = NULL; - SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow); - if (!IsRoot(pWin)) { - // win/border size set by DIX, not by wrapped CreateWindow, so - // correct it here. - // Don't HUGE_ROOT when pWin is the root! - HUGE_ROOT(pWin); - SetWinSize(pWin); - SetBorderSize(pWin); - } - result = pWin->drawable.pScreen->CreateWindow(pWin); - if (pWin->parent) { - NORMAL_ROOT(pWin); - } - SCREEN_WRAP(pWin->drawable.pScreen, CreateWindow); - return result; -} - - -// RootlessDestroyWindow -// For now, all window destruction takes place in UnrealizeWindow -Bool -RootlessDestroyWindow(WindowPtr pWin) -{ - Bool result; - - SCREEN_UNWRAP(pWin->drawable.pScreen, DestroyWindow); - result = pWin->drawable.pScreen->DestroyWindow(pWin); - SCREEN_WRAP(pWin->drawable.pScreen, DestroyWindow); - return result; -} - - -#ifdef SHAPE - -// RootlessSetShape -// Shape is usually set before the window is mapped, but (for now) we -// don't keep track of frames before they're mapped. So we just record -// that the shape needs to updated later. -void -RootlessSetShape(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - RootlessDamageShape(pWin); - SCREEN_UNWRAP(pScreen, SetShape); - pScreen->SetShape(pWin); - SCREEN_WRAP(pScreen, SetShape); -} - -#endif // SHAPE - - -// Disallow ParentRelative background on top-level windows -// because the root window doesn't really have the right background -// and fb will try to draw on the root instead of on the window. -// ParentRelative prevention is also in PaintWindowBackground/Border() -// so it is no longer really needed here. -Bool -RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask) -{ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - - RL_DEBUG_MSG("change window attributes start "); - - SCREEN_UNWRAP(pScreen, ChangeWindowAttributes); - result = pScreen->ChangeWindowAttributes(pWin, vmask); - SCREEN_WRAP(pScreen, ChangeWindowAttributes); - - if (WINREC(pWin)) { - // disallow ParentRelative background state - if (pWin->backgroundState == ParentRelative) { - XID pixel = 0; - ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); - } - } - - RL_DEBUG_MSG("change window attributes end\n"); - return result; -} - - -/* RootlessPositionWindow - * This is a hook for when DIX moves or resizes a window. - * Update the frame position now. (x, y) are *inside* position. - * After this, mi and fb are expecting the pixmap to be at the new location. - */ -Bool -RootlessPositionWindow(WindowPtr pWin, int x, int y) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - RootlessWindowRec *winRec = WINREC(pWin); - Bool result; - - RL_DEBUG_MSG("positionwindow start (win 0x%x)\n", pWin); - - if (winRec) { - if (winRec->drawing) { - // Reset frame's pixmap and move it to the new position. - int bw = wBorderWidth(pWin); - - winRec->pixmap->devPrivate.ptr = winRec->frame.pixelData; - SetPixmapBaseToScreen(winRec->pixmap, x - bw, y - bw); - - // Move damaged region to correspond to new window position - if (REGION_NOTEMPTY(pScreen, &winRec->damage)) { - REGION_TRANSLATE(pScreen, &winRec->damage, - x - bw - winRec->frame.x, - y - bw - winRec->frame.y); - } - } - } - - SCREEN_UNWRAP(pScreen, PositionWindow); - result = pScreen->PositionWindow(pWin, x, y); - SCREEN_WRAP(pScreen, PositionWindow); - - RL_DEBUG_MSG("positionwindow end\n"); - return result; -} - - -// RootlessRealizeWindow -// The frame is created here and not in CreateWindow so that windows do -// not eat memory until they are realized. -Bool -RootlessRealizeWindow(WindowPtr pWin) -{ - Bool result = FALSE; - RegionRec saveRoot; - ScreenPtr pScreen = pWin->drawable.pScreen; - - RL_DEBUG_MSG("realizewindow start (win 0x%x) ", pWin); - - if (IsTopLevel(pWin) || IsRoot(pWin)) { - DrawablePtr d = &pWin->drawable; - RootlessWindowRec *winRec = xalloc(sizeof(RootlessWindowRec)); - int bw = wBorderWidth(pWin); - - RL_DEBUG_MSG("Top level window "); - if (! winRec) goto windowcreatebad; - - winRec->frame.isRoot = (pWin == WindowTable[pScreen->myNum]); - winRec->frame.x = d->x - bw; - winRec->frame.y = d->y - bw; - winRec->frame.w = d->width + 2*bw; - winRec->frame.h = d->height + 2*bw; - winRec->frame.win = pWin; - winRec->frame.devPrivate = NULL; - - REGION_INIT(pScreen, &winRec->damage, NullBox, 0); - winRec->borderWidth = bw; - winRec->drawing = FALSE; - - winRec->pixmap = NULL; - - WINREC(pWin) = winRec; - - RL_DEBUG_MSG("creating frame "); - CallFrameProc(pScreen, CreateFrame, - (pScreen, &WINREC(pWin)->frame, - pWin->prevSib ? &WINREC(pWin->prevSib)->frame : NULL)); - if (!winRec->frame.devPrivate) goto windowcreatebad; - - // Disallow ParentRelative background state on top-level windows. - // This might have been set before the window was mapped. - if (pWin->backgroundState == ParentRelative) { - XID pixel = 0; - ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); - } - -#ifdef SHAPE - // Shape is usually set before the window is mapped, but - // (for now) we don't keep track of frames before they're mapped. - winRec->shapeDamage = TRUE; -#endif - } - - if (!IsRoot(pWin)) HUGE_ROOT(pWin); - SCREEN_UNWRAP(pScreen, RealizeWindow); - result = pScreen->RealizeWindow(pWin); - SCREEN_WRAP(pScreen, RealizeWindow); - if (!IsRoot(pWin)) NORMAL_ROOT(pWin); - - RL_DEBUG_MSG("realizewindow end\n"); - return result; - -windowcreatebad: - RL_DEBUG_MSG("window create bad! "); - RL_DEBUG_MSG("realizewindow end\n"); - return NULL; -} - - -Bool -RootlessUnrealizeWindow(WindowPtr pWin) -{ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - - RL_DEBUG_MSG("unrealizewindow start "); - - if (IsTopLevel(pWin) || IsRoot(pWin)) { - RootlessWindowRec *winRec = WINREC(pWin); - - RootlessRedisplay(pWin); - CallFrameProc(pScreen, DestroyFrame, (pScreen, &winRec->frame)); - - REGION_UNINIT(pScreen, &winRec->damage); - - xfree(winRec); - WINREC(pWin) = NULL; - } - - SCREEN_UNWRAP(pScreen, UnrealizeWindow); - result = pScreen->UnrealizeWindow(pWin); - SCREEN_WRAP(pScreen, UnrealizeWindow); - RL_DEBUG_MSG("unrealizewindow end\n"); - return result; -} - - -void -RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) -{ - RegionRec saveRoot; - RootlessWindowRec *winRec = WINREC(pWin); - ScreenPtr pScreen = pWin->drawable.pScreen; - - RL_DEBUG_MSG("restackwindow start "); - if (winRec) RL_DEBUG_MSG("restack top level \n"); - - HUGE_ROOT(pWin); - SCREEN_UNWRAP(pScreen, RestackWindow); - if (pScreen->RestackWindow) pScreen->RestackWindow(pWin, pOldNextSib); - SCREEN_WRAP(pScreen, RestackWindow); - NORMAL_ROOT(pWin); - - if (winRec) { - // fixme simplify the following - - WindowPtr oldNextW, newNextW, oldPrevW, newPrevW; - RootlessFramePtr oldNext, newNext, oldPrev, newPrev; - - oldNextW = pOldNextSib; - while (oldNextW && ! WINREC(oldNextW)) oldNextW = oldNextW->nextSib; - oldNext = oldNextW ? &WINREC(oldNextW)->frame : NULL; - - newNextW = pWin->nextSib; - while (newNextW && ! WINREC(newNextW)) newNextW = newNextW->nextSib; - newNext = newNextW ? &WINREC(newNextW)->frame : NULL; - - oldPrevW= pOldNextSib ? pOldNextSib->prevSib : pWin->parent->lastChild; - while (oldPrevW && ! WINREC(oldPrevW)) oldPrevW = oldPrevW->prevSib; - oldPrev = oldPrevW ? &WINREC(oldPrevW)->frame : NULL; - - newPrevW = pWin->prevSib; - while (newPrevW && ! WINREC(newPrevW)) newPrevW = newPrevW->prevSib; - newPrev = newPrevW ? &WINREC(newPrevW)->frame : NULL; - - if (pWin->prevSib) { - WindowPtr w = pWin->prevSib; - while (w) { - RL_DEBUG_MSG("w 0x%x\n", w); - w = w->parent; - } - } - - CallFrameProc(pScreen, RestackFrame, - (pScreen, &winRec->frame, oldPrev, newPrev)); - } - - RL_DEBUG_MSG("restackwindow end\n"); -} - - -/* - * Specialized window copy procedures - */ - -// Globals needed during window resize and move. -static PixmapPtr gResizeDeathPix = NULL; -static pointer gResizeDeathBits = NULL; -static PixmapPtr gResizeCopyWindowSource = NULL; -static CopyWindowProcPtr gResizeOldCopyWindowProc = NULL; - -// CopyWindow() that doesn't do anything. -// For MoveWindow() of top-level windows. -static void -RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - // some code expects the region to be translated - int dx = ptOldOrg.x - pWin->drawable.x; - int dy = ptOldOrg.y - pWin->drawable.y; - RL_DEBUG_MSG("ROOTLESSNOCOPYWINDOW "); - - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); -} - - -// CopyWindow used during ResizeWindow for gravity moves. -// Cloned from fbCopyWindow -// The original always draws on the root pixmap (which we don't have). -// Instead, draw on the parent window's pixmap. -// Resize version: the old location's pixels are in gResizeCopyWindowSource -static void -RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - // Don't unwrap pScreen->CopyWindow. - // The bogus rewrap with RootlessCopyWindow causes a crash if - // CopyWindow is called again during the same resize. - RL_DEBUG_MSG("resizecopywindowFB start (win 0x%x) ", pWin); - - { - RegionRec rgnDst; - int dx, dy; - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INIT(pScreen, &rgnDst, NullBox, 0); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - - RootlessStartDrawing(pWin); - fbCopyRegion (&gResizeCopyWindowSource->drawable, - &pScreen->GetWindowPixmap(pWin)->drawable, - 0, - &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); - - // don't update - resize will update everything - REGION_UNINIT(pScreen, &rgnDst); - fbValidateDrawable (&pWin->drawable); - } - - RL_DEBUG_MSG("resizecopywindowFB end\n"); -} - - -/* Update *new* location of window. Old location is redrawn with - * PaintWindowBackground/Border. - * Cloned from fbCopyWindow - * The original always draws on the root pixmap (which we don't have). - * Instead, draw on the parent window's pixmap. - */ -void -RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - SCREEN_UNWRAP(pScreen, CopyWindow); - RL_DEBUG_MSG("copywindowFB start (win 0x%x) ", pWin); - - { - RegionRec rgnDst; - int dx, dy; - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - - REGION_INIT(pScreen, &rgnDst, NullBox, 0); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - - RootlessStartDrawing(pWin); - fbCopyRegion ((DrawablePtr)pWin, (DrawablePtr)pWin, - 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); - - // prgnSrc has been translated to dst position - RootlessDamageRegion(pWin, prgnSrc); - REGION_UNINIT(pScreen, &rgnDst); - fbValidateDrawable (&pWin->drawable); - } - - SCREEN_WRAP(pScreen, CopyWindow); - RL_DEBUG_MSG("copywindowFB end\n"); -} - - -/* - * Window resize procedures - */ - -// Prepare to resize a top-level window. -// The old window's pixels are saved and the implementation is told -// to change the window size. -// (x,y,w,h) is outer frame of window (outside border) -static void -StartFrameResize(WindowPtr pWin, Bool gravity, - int oldX, int oldY, - unsigned int oldW, unsigned int oldH, unsigned int oldBW, - int newX, int newY, - unsigned int newW, unsigned int newH, unsigned int newBW) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - RootlessWindowRec *winRec = WINREC(pWin); - - RL_DEBUG_MSG("RESIZE TOPLEVEL WINDOW with gravity %i ", gravity); - RL_DEBUG_MSG("%d %d %d %d %d %d %d %d %d %d ", - oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - - RootlessRedisplay(pWin); - - // Make a copy of the current pixmap and all its data. - // The original will go away when we ask the frame manager to - // allocate the new pixmap. - RootlessStartDrawing(pWin); - gResizeDeathBits = xalloc(winRec->frame.bytesPerRow * winRec->frame.h); - memcpy(gResizeDeathBits, winRec->frame.pixelData, - winRec->frame.bytesPerRow * winRec->frame.h); - gResizeDeathPix = - GetScratchPixmapHeader(pScreen, winRec->frame.w, winRec->frame.h, - winRec->frame.depth, winRec->frame.bitsPerPixel, - winRec->frame.bytesPerRow, gResizeDeathBits); - SetPixmapBaseToScreen(gResizeDeathPix, oldX, oldY); - RootlessStopDrawing(pWin); - - // Update the window frame's size and location - winRec->frame.x = newX; - winRec->frame.y = newY; - winRec->frame.w = newW; - winRec->frame.h = newH; - winRec->borderWidth = newBW; - - // Move the window on screen and create a new pixmap for it - CallFrameProc(pScreen, StartResizeFrame, - (pScreen, &winRec->frame, oldX, oldY, oldW, oldH)); - RootlessStartDrawing(pWin); - - // Use custom CopyWindow when moving gravity bits around. - // ResizeWindow assumes the old window contents are in the same - // pixmap, but here they're in deathPix instead. - if (gravity) { - gResizeCopyWindowSource = gResizeDeathPix; - gResizeOldCopyWindowProc = pScreen->CopyWindow; - pScreen->CopyWindow = RootlessResizeCopyWindow; - } - - // Copy pixels in intersection from src to dst. - // ResizeWindow assumes these pixels are already present when making - // gravity adjustments. pWin currently has new-sized pixmap but its - // drawable is in the old position. - // fixme border width change! - { - BoxRec rect; - DrawablePtr src = &gResizeDeathPix->drawable; - DrawablePtr dst = &pScreen->GetWindowPixmap(pWin)->drawable; - // These vars are needed because implicit unsigned->signed fails - int oldX2 = (int)(oldX + oldW), newX2 = (int)(newX + newW); - int oldY2 = (int)(oldY + oldH), newY2 = (int)(newY + newH); - - rect.x1 = max(oldX, newX); - rect.y1 = max(oldY, newY); - rect.x2 = min(oldX2, newX2); - rect.y2 = min(oldY2, newY2); - - RL_DEBUG_MSG("Resize copy rect %d %d %d %d ", - rect.x1, rect.y1, rect.x2, rect.y2); - - // rect is the intersection of the old location and new location - if (BOX_NOT_EMPTY(rect)) { - /* The window drawable still has the old frame position, which - means that DST doesn't actually point at the origin of our - physical backing store when adjusted by the drawable.x,y - position. So sneakily adjust it temporarily while copying.. */ - - ((PixmapPtr) dst)->devPrivate.ptr = winRec->frame.pixelData; - SetPixmapBaseToScreen(dst, newX, newY); - - fbCopyWindowProc(src, dst, NULL, &rect, 1, 0, 0, - FALSE, FALSE, 0, 0); - - ((PixmapPtr) dst)->devPrivate.ptr = winRec->frame.pixelData; - SetPixmapBaseToScreen(dst, oldX, oldY); - } - } -} - - -static void -FinishFrameResize(WindowPtr pWin, Bool gravity, - int oldX, int oldY, - unsigned int oldW, unsigned int oldH, unsigned int oldBW, - int newX, int newY, - unsigned int newW, unsigned int newH, unsigned int newBW) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - RootlessWindowRec *winRec = WINREC(pWin); - - CallFrameProc(pScreen, FinishResizeFrame, - (pScreen, &winRec->frame, oldX, oldY, oldW, oldH)); - if (wBoundingShape(pWin)) { - RootlessDamageShape(pWin); - } - - // Destroy temp pixmap - FreeScratchPixmapHeader(gResizeDeathPix); - xfree(gResizeDeathBits); - gResizeDeathPix = gResizeDeathBits = NULL; - - if (gravity) { - pScreen->CopyWindow = gResizeOldCopyWindowProc; - gResizeCopyWindowSource = NULL; - } -} - - -// If kind==VTOther, window border is resizing (and borderWidth is -// already changed!!@#$) This case works like window resize, not move. -void -RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) -{ - CopyWindowProcPtr oldCopyWindowProc = NULL; - RegionRec saveRoot; - RootlessWindowRec *winRec = WINREC(pWin); - ScreenPtr pScreen = pWin->drawable.pScreen; - int oldX = 0, oldY = 0, newX = 0, newY = 0; - unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0; - - RL_DEBUG_MSG("movewindow start \n"); - - if (winRec) { - if (kind == VTMove) { - oldX = winRec->frame.x; - oldY = winRec->frame.y; - RootlessRedisplay(pWin); - RootlessStartDrawing(pWin); - } else { - RL_DEBUG_MSG("movewindow border resizing "); - oldBW = winRec->borderWidth; - oldX = winRec->frame.x; - oldY = winRec->frame.y; - oldW = winRec->frame.w; - oldH = winRec->frame.h; - newBW = wBorderWidth(pWin); - newX = x; - newY = y; - newW = pWin->drawable.width + 2*newBW; - newH = pWin->drawable.height + 2*newBW; - StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - } - - HUGE_ROOT(pWin); - SCREEN_UNWRAP(pScreen, MoveWindow); - if (winRec) { - oldCopyWindowProc = pScreen->CopyWindow; - pScreen->CopyWindow = RootlessNoCopyWindow; - } - pScreen->MoveWindow(pWin, x, y, pSib, kind); - if (winRec) { - pScreen->CopyWindow = oldCopyWindowProc; - } - NORMAL_ROOT(pWin); - SCREEN_WRAP(pScreen, MoveWindow); - - if (winRec) { - if (kind == VTMove) { - winRec->frame.x = x; - winRec->frame.y = y; - RootlessStopDrawing(pWin); - CallFrameProc(pScreen, MoveFrame, - (pScreen, &winRec->frame, oldX, oldY)); - } else { - FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - } - - RL_DEBUG_MSG("movewindow end\n"); -} - - -// Note: (x, y, w, h) as passed to this procedure don't match -// the frame definition. -// (x,y) is corner of very outer edge, *outside* border -// w,h is width and height *inside* border, *ignoring* border width -// The rect (x, y, w, h) doesn't mean anything. -// (x, y, w+2*bw, h+2*bw) is total rect -// (x+bw, y+bw, w, h) is inner rect - -void -RootlessResizeWindow(WindowPtr pWin, int x, int y, - unsigned int w, unsigned int h, WindowPtr pSib) -{ - RegionRec saveRoot; - RootlessWindowRec *winRec = WINREC(pWin); - ScreenPtr pScreen = pWin->drawable.pScreen; - int oldX = 0, oldY = 0, newX = 0, newY = 0; - unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0; - - RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin); - - if (winRec) { - oldBW = winRec->borderWidth; - oldX = winRec->frame.x; - oldY = winRec->frame.y; - oldW = winRec->frame.w; - oldH = winRec->frame.h; - - newBW = oldBW; - newX = x; - newY = y; - newW = w + 2*newBW; - newH = h + 2*newBW; - - StartFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - - HUGE_ROOT(pWin); - SCREEN_UNWRAP(pScreen, ResizeWindow); - pScreen->ResizeWindow(pWin, x, y, w, h, pSib); - SCREEN_WRAP(pScreen, ResizeWindow); - NORMAL_ROOT(pWin); - - if (winRec) { - FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - - RL_DEBUG_MSG("resizewindow end\n"); -} - - -/* - * SetPixmapOfAncestors - * Set the Pixmaps on all ParentRelative windows up the ancestor chain. - */ -static void -SetPixmapOfAncestors(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr topWin = TopLevelParent(pWin); - RootlessWindowRec *topWinRec = WINREC(topWin); - - while (pWin->backgroundState == ParentRelative) { - if (pWin == topWin) { - // disallow ParentRelative background state on top level - XID pixel = 0; - ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); - RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); - break; - } - - pWin = pWin->parent; - pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); - } -} - - -/* - * RootlessPaintWindowBackground - * Paint the window background while filling in the alpha channel with all on. - */ -void -RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - int oldBackgroundState = 0; - PixUnion oldBackground; - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_UNWRAP(pScreen, PaintWindowBackground); - RL_DEBUG_MSG("paintwindowbackground start (win 0x%x, framed %i) ", - pWin, IsFramedWindow(pWin)); - - if (IsFramedWindow(pWin)) { - if (IsRoot(pWin)) { - // set root background to magic transparent color - oldBackgroundState = pWin->backgroundState; - oldBackground = pWin->background; - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = 0x00fffffe; - } - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows, we have to make sure the window - // pixmap is set correctly all the way up the ancestor chain. - if (pWin->backgroundState == ParentRelative) { - SetPixmapOfAncestors(pWin); - } - } - - pScreen->PaintWindowBackground(pWin, pRegion, what); - - if (IsRoot(pWin)) { - pWin->backgroundState = oldBackgroundState; - pWin->background = oldBackground; - } - - SCREEN_WRAP(pScreen, PaintWindowBackground); - RL_DEBUG_MSG("paintwindowbackground end\n"); -} - - -/* - * RootlessPaintWindowBorder - * Paint the window border while filling in the alpha channel with all on. - */ -void -RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder); - RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin); - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows with tiled borders, we have to make - // sure the window pixmap is set correctly all the way up the - // ancestor chain. - if (!pWin->borderIsPixel && - pWin->backgroundState == ParentRelative) - { - SetPixmapOfAncestors(pWin); - } - } - - pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what); - - SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder); - RL_DEBUG_MSG("paintwindowborder end\n"); -} - - -// fixme untested! -// pWin inside corner stays the same -// pWin->drawable.[xy] stays the same -// frame moves and resizes -void -RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width) -{ - RegionRec saveRoot; - - RL_DEBUG_MSG("change border width "); - if (width != wBorderWidth(pWin)) { - RootlessWindowRec *winRec = WINREC(pWin); - int oldX = 0, oldY = 0, newX = 0, newY = 0; - unsigned int oldW = 0, oldH = 0, oldBW = 0; - unsigned int newW = 0, newH = 0, newBW = 0; - - if (winRec) { - oldBW = winRec->borderWidth; - oldX = winRec->frame.x; - oldY = winRec->frame.y; - oldW = winRec->frame.w; - oldH = winRec->frame.h; - - newBW = width; - newX = pWin->drawable.x - newBW; - newY = pWin->drawable.y - newBW; - newW = pWin->drawable.width + 2*newBW; - newH = pWin->drawable.height + 2*newBW; - - StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - - HUGE_ROOT(pWin); - SCREEN_UNWRAP(pWin->drawable.pScreen, ChangeBorderWidth); - pWin->drawable.pScreen->ChangeBorderWidth(pWin, width); - SCREEN_WRAP(pWin->drawable.pScreen, ChangeBorderWidth); - NORMAL_ROOT(pWin); - - if (winRec) { - FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, - newX, newY, newW, newH, newBW); - } - } - RL_DEBUG_MSG("change border width end\n"); -} Index: xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h diff -u xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h:1.2 xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h:removed --- xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h:1.2 Tue Apr 2 19:06:32 2002 +++ xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h Sat Feb 28 21:42:13 2004 @@ -1,36 +0,0 @@ -/* - * Rootless window management - * - * Greg Parker gparker@cs.stanford.edu - */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/rootlessWindow.h,v 1.2 2002/04/03 00:06:32 torrey Exp $ */ - -#ifndef _ROOTLESSWINDOW_H -#define _ROOTLESSWINDOW_H - -#include "rootlessCommon.h" - - -Bool RootlessCreateWindow(WindowPtr pWin); -Bool RootlessDestroyWindow(WindowPtr pWin); - -#ifdef SHAPE -void RootlessSetShape(WindowPtr pWin); -#endif // SHAPE - -Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask); -Bool RootlessPositionWindow(WindowPtr pWin, int x, int y); -Bool RootlessRealizeWindow(WindowPtr pWin); -Bool RootlessUnrealizeWindow(WindowPtr pWin); -void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib); -void RootlessCopyWindow(WindowPtr pWin,DDXPointRec ptOldOrg,RegionPtr prgnSrc); -void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind); -void RootlessResizeWindow(WindowPtr pWin, int x, int y, - unsigned int w, unsigned int h, WindowPtr pSib); -void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, - int what); -void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, - int what); -void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width); - -#endif Index: xc/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj diff -u xc/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj:1.11 xc/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj:1.23 --- xc/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj:1.11 Tue Jan 28 20:11:06 2003 +++ xc/programs/Xserver/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj Tue Dec 9 00:20:23 2003 @@ -23,48 +23,6 @@ path = XApplication.h; refType = 4; }; - 014C68ED00ED6A9D7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = XView.h; - refType = 4; - }; - 014C68EE00ED6A9D7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = XView.m; - refType = 4; - }; - 014C68F200ED7AD67F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = fakeBoxRec.h; - refType = 4; - }; - 014C68F300EE5AB97F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessCommon.c; - refType = 4; - }; - 014C68F400EE5AB97F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessCommon.h; - refType = 4; - }; - 014C68F700EE678F7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessWindow.c; - refType = 4; - }; - 014C68F800EE678F7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessWindow.h; - refType = 4; - }; 015698ED003DF345CE6F79C2 = { isa = PBXFileReference; path = XDarwin.icns; @@ -99,18 +57,6 @@ path = /System/Library/Frameworks/IOKit.framework; refType = 0; }; - 017D6F4400E861FB7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessGC.c; - refType = 4; - }; - 017D6F4500E861FB7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessScreen.c; - refType = 4; - }; 018F40F2003E1902CE6F79C2 = { children = ( 018F40F3003E1916CE6F79C2, @@ -118,6 +64,7 @@ 3E74E03600863F047F000001, F5A94EF10314BAC70100011B, 018F40F6003E1974CE6F79C2, + 6E5F5F0005537A1A008FEAD7, ); isa = PBXGroup; name = "X Server"; @@ -261,22 +208,6 @@ //042 //043 //044 -//060 -//061 -//062 -//063 -//064 - 06EB6C3B004099E7CE6F79C2 = { - fileEncoding = 30; - isa = PBXFileReference; - path = quartzShared.h; - refType = 4; - }; -//060 -//061 -//062 -//063 -//064 //080 //081 //082 @@ -290,8 +221,6 @@ 0127909800074B1A0A000002, 01279092000747AA0A000002, 1C4A3109004D8F24CE6F79C2, - 014C68EE00ED6A9D7F000001, - 014C68ED00ED6A9D7F000001, ); isa = PBXGroup; name = Classes; @@ -356,6 +285,8 @@ dependencies = ( 6EF065C903D4F0CA006877C2, 6EF065C703D4EE19006877C2, + 6E11A986048BDFFB006877C2, + 6E7904110500F33B00EEC080, ); isa = PBXApplicationTarget; name = XDarwin; @@ -368,10 +299,42 @@ CFBundleDevelopmentRegion English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + x11app + + CFBundleTypeName + X11 Application + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Viewer + + + CFBundleTypeExtensions + + tool + * + + CFBundleTypeName + UNIX Application + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Viewer + + CFBundleExecutable XDarwin CFBundleGetInfoString - XDarwin 1.2b4, ©2001-2003 XFree86 Project, Inc. + XDarwin 1.3.0, ©2001-2003 XFree86 Project, Inc. CFBundleIconFile XDarwin.icns CFBundleIdentifier @@ -383,7 +346,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - XDarwin 1.2b4 + XDarwin 1.3.0 CFBundleSignature ???? CFBundleVersion @@ -548,7 +511,7 @@ }; }; 1220774600712D75416877C2 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = Japanese; path = Japanese.lproj/Localizable.strings; @@ -579,7 +542,7 @@ ); isa = PBXGroup; name = IOKit; - path = ..; + path = ../iokit; refType = 4; }; //170 @@ -597,6 +560,8 @@ 0A79E19E004499A1CE6F79C2, 6EF7C58703D3BC6D00000104, 6EF065C603D4EE19006877C2, + 6E11A985048BDFEE006877C2, + 6E7904100500F05600EEC080, ); isa = PBXGroup; name = Products; @@ -770,7 +735,9 @@ targets = ( 0A79E19F004499A1CE6F79C2, 6EF7C58603D3BC6D00000104, + 6E11A984048BDFEE006877C2, 6EF065C503D4EE19006877C2, + 6E79040F0500F05600EEC080, ); }; 29B97314FDCFA39411CA2CEA = { @@ -780,7 +747,10 @@ 170DFB0000729C86416877C2, 43B962CE00617089416877C2, F5614B3D025112D901000114, + 6EC4A64C042A9597006877C2, 32FEE13C00E07C3E7F000001, + 6EE1214104968658006877C2, + 6EC4A66D042A97FC006877C2, 29B97315FDCFA39411CA2CEA, 29B97317FDCFA39411CA2CEA, 29B97323FDCFA39411CA2CEA, @@ -875,66 +845,14 @@ //324 32FEE13C00E07C3E7F000001 = { children = ( - F56CBD0D02EB84A801129B8A, - F56CBD0E02EB84A801129B8A, - F56CBD0F02EBDCFC01129B8A, - 014C68F200ED7AD67F000001, F5269C2D01D5BC3501000001, F5269C2E01D5BC3501000001, - 32FEE13E00E07CBE7F000001, - 32FEE13F00E07CBE7F000001, - 32FEE14000E07CBE7F000001, - 32FEE14100E07CBE7F000001, - 32FEE14200E07CBE7F000001, - 014C68F300EE5AB97F000001, - 014C68F400EE5AB97F000001, - 017D6F4400E861FB7F000001, - 017D6F4500E861FB7F000001, - 014C68F700EE678F7F000001, - 014C68F800EE678F7F000001, - 32FEE14900E07D317F000001, ); isa = PBXGroup; - name = Rootless; + name = "Old Cocoa Imp"; path = ""; refType = 4; }; - 32FEE13E00E07CBE7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootless.h; - refType = 4; - }; - 32FEE13F00E07CBE7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessAqua.h; - refType = 4; - }; - 32FEE14000E07CBE7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessAquaGlue.c; - refType = 4; - }; - 32FEE14100E07CBE7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessAquaImp.h; - refType = 4; - }; - 32FEE14200E07CBE7F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessAquaImp.m; - refType = 4; - }; - 32FEE14900E07D317F000001 = { - fileEncoding = 30; - isa = PBXFileReference; - path = rootlessValTree.c; - refType = 4; - }; //320 //321 //322 @@ -979,17 +897,19 @@ //434 43B962CE00617089416877C2 = { children = ( + 6EE9B21604E859C200CA7FEA, + 6E97A0F505079F9100B8294C, + 6E5F5F030553815A008FEAD7, + 6E5F5F040553815A008FEAD7, 018F40F8003E1979CE6F79C2, 018F40FA003E197ECE6F79C2, 237A34C10076E37E7F000001, 237A34C40076F4F07F000001, - 3576829A0077B8F17F000001, - 0338412F0083BFE57F000001, - 43B962D000617089416877C2, - 43B962D100617089416877C2, 43B962CF00617089416877C2, F5582948015DAD3B01000001, - 06EB6C3B004099E7CE6F79C2, + 6E5F5F0105537A5F008FEAD7, + 43B962D000617089416877C2, + 43B962D100617089416877C2, 02A1FEA8006D38F0416877C2, ); isa = PBXGroup; @@ -1051,6 +971,536 @@ //6E2 //6E3 //6E4 + 6E11A97F048BDFEE006877C2 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXHeadersBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E11A980048BDFEE006877C2 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXResourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E11A981048BDFEE006877C2 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXSourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E11A982048BDFEE006877C2 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXFrameworksBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E11A983048BDFEE006877C2 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXRezBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E11A984048BDFEE006877C2 = { + buildPhases = ( + 6E11A97F048BDFEE006877C2, + 6E11A980048BDFEE006877C2, + 6E11A981048BDFEE006877C2, + 6E11A982048BDFEE006877C2, + 6E11A983048BDFEE006877C2, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = glxCGL; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + WRAPPER_EXTENSION = bundle; + }; + dependencies = ( + ); + isa = PBXBundleTarget; + name = glxCGL; + productInstallPath = "$(USER_LIBRARY_DIR)/Bundles"; + productName = glxCGL; + productReference = 6E11A985048BDFEE006877C2; + productSettingsXML = " + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + glxCGL + CFBundleGetInfoString + + CFBundleIconFile + + CFBundleIdentifier + + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + GLX bundle using Apple's OpenGL + CFBundlePackageType + BNDL + CFBundleShortVersionString + 0.1 + CFBundleSignature + ???? + CFBundleVersion + 0.1 + + +"; + }; + 6E11A985048BDFEE006877C2 = { + isa = PBXBundleReference; + path = glxCGL.bundle; + refType = 3; + }; + 6E11A986048BDFFB006877C2 = { + isa = PBXTargetDependency; + target = 6E11A984048BDFEE006877C2; + }; + 6E5F5F0005537A1A008FEAD7 = { + fileEncoding = 30; + isa = PBXFileReference; + path = darwinKeyboard.h; + refType = 4; + }; + 6E5F5F0105537A5F008FEAD7 = { + fileEncoding = 30; + isa = PBXFileReference; + path = quartzKeyboard.c; + refType = 4; + }; + 6E5F5F030553815A008FEAD7 = { + fileEncoding = 30; + isa = PBXFileReference; + path = keysym2ucs.c; + refType = 4; + }; + 6E5F5F040553815A008FEAD7 = { + fileEncoding = 30; + isa = PBXFileReference; + path = keysym2ucs.h; + refType = 4; + }; + 6E6656EC048832CF006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-hook.c"; + refType = 4; + }; + 6E6656ED048832CF006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-hook.h"; + refType = 4; + }; + 6E6656F0048832EC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = dri.c; + refType = 4; + }; + 6E6656F1048832EC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = dri.h; + refType = 4; + }; + 6E6656F2048832EC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = dristruct.h; + refType = 4; + }; + 6E6656F3048832F9006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = appledri.c; + refType = 4; + }; + 6E79040104FD5ED900EEC080 = { + children = ( + 6E79040204FD5EDA00EEC080, + 6E79040304FD5EDA00EEC080, + 6E79040404FD5EDA00EEC080, + ); + isa = PBXGroup; + name = "Safe Alpha"; + path = safeAlpha; + refType = 4; + }; + 6E79040204FD5EDA00EEC080 = { + fileEncoding = 30; + isa = PBXFileReference; + path = safeAlpha.h; + refType = 4; + }; + 6E79040304FD5EDA00EEC080 = { + fileEncoding = 30; + isa = PBXFileReference; + path = safeAlphaPicture.c; + refType = 4; + }; + 6E79040404FD5EDA00EEC080 = { + fileEncoding = 30; + isa = PBXFileReference; + path = safeAlphaWindow.c; + refType = 4; + }; + 6E79040A0500F05600EEC080 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXHeadersBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E79040B0500F05600EEC080 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXResourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E79040C0500F05600EEC080 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXSourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E79040D0500F05600EEC080 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXFrameworksBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E79040E0500F05600EEC080 = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXRezBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 6E79040F0500F05600EEC080 = { + buildPhases = ( + 6E79040A0500F05600EEC080, + 6E79040B0500F05600EEC080, + 6E79040C0500F05600EEC080, + 6E79040D0500F05600EEC080, + 6E79040E0500F05600EEC080, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = xpr; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + WRAPPER_EXTENSION = bundle; + }; + dependencies = ( + ); + isa = PBXBundleTarget; + name = xpr; + productInstallPath = "$(USER_LIBRARY_DIR)/Bundles"; + productName = xpr; + productReference = 6E7904100500F05600EEC080; + productSettingsXML = " + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + xpr + CFBundleGetInfoString + + CFBundleIconFile + + CFBundleIdentifier + + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Xplugin rootless implementation + CFBundlePackageType + BNDL + CFBundleShortVersionString + 0.1 + CFBundleSignature + ???? + CFBundleVersion + 0.1 + + +"; + }; + 6E7904100500F05600EEC080 = { + isa = PBXBundleReference; + path = xpr.bundle; + refType = 3; + }; + 6E7904110500F33B00EEC080 = { + isa = PBXTargetDependency; + target = 6E79040F0500F05600EEC080; + }; + 6E97A0F2050798B100B8294C = { + fileEncoding = 4; + isa = PBXFileReference; + path = xprAppleWM.c; + refType = 4; + }; + 6E97A0F305079B6500B8294C = { + fileEncoding = 4; + isa = PBXFileReference; + path = crAppleWM.m; + refType = 4; + }; + 6E97A0F505079F9100B8294C = { + fileEncoding = 4; + isa = PBXFileReference; + path = applewmExt.h; + refType = 4; + }; + 6EA0B3AF0544A9CC006877C2 = { + children = ( + 6EA0B3B00544A9CC006877C2, + 6EA0B3B10544A9CC006877C2, + 6EA0B3B20544A9CC006877C2, + 6EA0B3B30544A9CC006877C2, + 6EA0B3B40544A9CC006877C2, + 6EA0B3B50544A9CC006877C2, + 6EA0B3B60544A9CC006877C2, + 6EA0B3B70544A9CC006877C2, + ); + isa = PBXGroup; + name = Acceleration; + path = accel; + refType = 4; + }; + 6EA0B3B00544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlAccel.h; + refType = 4; + }; + 6EA0B3B10544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlBlt.c; + refType = 4; + }; + 6EA0B3B20544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlCopy.c; + refType = 4; + }; + 6EA0B3B30544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlFill.c; + refType = 4; + }; + 6EA0B3B40544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlFillRect.c; + refType = 4; + }; + 6EA0B3B50544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlFillSpans.c; + refType = 4; + }; + 6EA0B3B60544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlGlyph.c; + refType = 4; + }; + 6EA0B3B70544A9CC006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rlSolid.c; + refType = 4; + }; + 6EA8EEC80445E25C006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessConfig.h; + refType = 4; + }; + 6EC4A64C042A9597006877C2 = { + children = ( + 6EC4A65D042A9654006877C2, + 6EC4A65E042A9654006877C2, + 6EC4A65F042A9654006877C2, + 6EA8EEC80445E25C006877C2, + 6EC4A661042A9654006877C2, + 6EC4A662042A9654006877C2, + 6EC4A660042A9654006877C2, + 6EC4A663042A9654006877C2, + 6EC4A664042A9654006877C2, + 6EA0B3AF0544A9CC006877C2, + 6E79040104FD5ED900EEC080, + ); + isa = PBXGroup; + name = Rootless; + path = ../../../miext/rootless; + refType = 2; + }; + 6EC4A65D042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootless.h; + refType = 4; + }; + 6EC4A65E042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessCommon.c; + refType = 4; + }; + 6EC4A65F042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessCommon.h; + refType = 4; + }; + 6EC4A660042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessWindow.h; + refType = 4; + }; + 6EC4A661042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessScreen.c; + refType = 4; + }; + 6EC4A662042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessWindow.c; + refType = 4; + }; + 6EC4A663042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessGC.c; + refType = 4; + }; + 6EC4A664042A9654006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = rootlessValTree.c; + refType = 4; + }; + 6EC4A66D042A97FC006877C2 = { + children = ( + 6EF471A004478DE0006877C2, + 6E6656F3048832F9006877C2, + 6E6656F0048832EC006877C2, + 6E6656F1048832EC006877C2, + 6E6656F2048832EC006877C2, + 6ECF218404589E4D006877C2, + 6E97A0F2050798B100B8294C, + 6ECF218604589F40006877C2, + 6EF4719E04478B08006877C2, + 6EDDB2DF04508B2C006877C2, + 6EF471A204479263006877C2, + 6EF471A404479263006877C2, + 6E6656EC048832CF006877C2, + 6E6656ED048832CF006877C2, + 6EF471A504479263006877C2, + 6EF471A304479263006877C2, + ); + isa = PBXGroup; + path = xpr; + refType = 4; + }; + 6ECF218404589E4D006877C2 = { + fileEncoding = 4; + isa = PBXFileReference; + path = xpr.h; + refType = 4; + }; + 6ECF218604589F40006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = xprCursor.c; + refType = 4; + }; + 6EDDB2DF04508B2C006877C2 = { + fileEncoding = 4; + isa = PBXFileReference; + path = xprScreen.c; + refType = 4; + }; + 6EE1214104968658006877C2 = { + children = ( + 6EE1214304968692006877C2, + 6EE1214404968692006877C2, + 6EE1214204968692006877C2, + 6E97A0F305079B6500B8294C, + 6EE1214504968692006877C2, + 6EE1214604968692006877C2, + ); + isa = PBXGroup; + path = cr; + refType = 4; + }; + 6EE1214204968692006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = cr.h; + refType = 4; + }; + 6EE1214304968692006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = XView.m; + refType = 4; + }; + 6EE1214404968692006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = XView.h; + refType = 4; + }; + 6EE1214504968692006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = crFrame.m; + refType = 4; + }; + 6EE1214604968692006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = crScreen.m; + refType = 4; + }; + 6EE9B21604E859C200CA7FEA = { + fileEncoding = 30; + isa = PBXFileReference; + path = applewm.c; + refType = 4; + }; 6EF065C003D4EE19006877C2 = { buildActionMask = 2147483647; files = ( @@ -1153,6 +1603,42 @@ isa = PBXTargetDependency; target = 6EF7C58603D3BC6D00000104; }; + 6EF4719E04478B08006877C2 = { + fileEncoding = 4; + isa = PBXFileReference; + path = xprFrame.c; + refType = 4; + }; + 6EF471A004478DE0006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = Xplugin.h; + refType = 4; + }; + 6EF471A204479263006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-hash.c"; + refType = 4; + }; + 6EF471A304479263006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-list.h"; + refType = 4; + }; + 6EF471A404479263006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-hash.h"; + refType = 4; + }; + 6EF471A504479263006877C2 = { + fileEncoding = 30; + isa = PBXFileReference; + path = "x-list.c"; + refType = 4; + }; 6EF7C58103D3BC6D00000104 = { buildActionMask = 2147483647; files = ( @@ -1209,7 +1695,7 @@ ); isa = PBXBundleTarget; name = glxAGL; - productName = glxAqua; + productName = glxAGL; productReference = 6EF7C58703D3BC6D00000104; productSettingsXML = " @@ -1228,7 +1714,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - GLX bundle with AGL + GLX bundle using AGL framework CFBundlePackageType BNDL CFBundleShortVersionString @@ -1277,7 +1763,7 @@ refType = 4; }; F51BF62D02026E1C01000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = Portuguese; path = Portuguese.lproj/Localizable.strings; @@ -1336,7 +1822,7 @@ refType = 4; }; F533213C0193CBC901000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = German; path = German.lproj/Localizable.strings; @@ -1395,7 +1881,7 @@ refType = 4; }; F533214501A4B42501000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = Dutch; path = Dutch.lproj/Localizable.strings; @@ -1450,38 +1936,14 @@ path = fullscreen.c; refType = 4; }; - F5614B3C0251124C01000114 = { - fileEncoding = 30; - isa = PBXFileReference; - path = fullscreen.h; - refType = 4; - }; F5614B3D025112D901000114 = { children = ( F5614B3B0251124C01000114, - F5614B3C0251124C01000114, + 3576829A0077B8F17F000001, + 0338412F0083BFE57F000001, ); isa = PBXGroup; - name = "Full Screen"; - path = ""; - refType = 4; - }; - F56CBD0D02EB84A801129B8A = { - fileEncoding = 30; - isa = PBXFileReference; - path = aqua.h; - refType = 4; - }; - F56CBD0E02EB84A801129B8A = { - fileEncoding = 30; - isa = PBXFileReference; - path = aquaPicture.c; - refType = 4; - }; - F56CBD0F02EBDCFC01129B8A = { - fileEncoding = 30; - isa = PBXFileReference; - path = aquaWindow.c; + path = fullscreen; refType = 4; }; F587E16001924C1D01000001 = { @@ -1505,7 +1967,7 @@ refType = 4; }; F587E16301924C5E01000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = Swedish; path = Swedish.lproj/Localizable.strings; @@ -1552,7 +2014,7 @@ refType = 4; }; F58D65DE018F79A001000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = French; path = French.lproj/Localizable.strings; @@ -1604,7 +2066,7 @@ refType = 4; }; F5ACD25FC5B5E9AA01000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = Spanish; path = Spanish.lproj/Localizable.strings; @@ -1651,7 +2113,7 @@ refType = 4; }; F5ACD266C5BE03C501000001 = { - fileEncoding = 30; + fileEncoding = 10; isa = PBXFileReference; name = ko; path = ko.lproj/Localizable.strings; Index: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile:1.2 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile Mon Sep 15 20:36:14 2003 @@ -0,0 +1,30 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v 1.2 2003/09/16 00:36:14 torrey Exp $ + +#include + +LinkSourceFile(quartzCursor.c,../fullscreen) +LinkSourceFile(quartzCursor.h,../fullscreen) + +SRCS = crAppleWM.m \ + crFrame.m \ + crScreen.m \ + quartzCursor.c \ + XView.m + +OBJS = crAppleWM.o \ + crFrame.o \ + crScreen.o \ + quartzCursor.o \ + XView.o + +INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/miext/rootless -I$(EXTINCSRC) -I.. -I../.. \ + -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ + -I$(APPLEWMLIBSRC) + +NormalLibraryObjectRule() +NormalLibraryTarget(cr,$(OBJS)) + +DependTarget() + Index: xc/programs/Xserver/hw/darwin/quartz/cr/XView.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/XView.h:1.1 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/XView.h Sat Jun 7 01:49:07 2003 @@ -0,0 +1,42 @@ +/* + * NSView subclass for Mac OS X rootless X server + * + * Copyright (c) 2001 Greg Parker. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.h,v 1.1 2003/06/07 05:49:07 torrey Exp $ */ + +#import + +@interface XView : NSQuickDrawView + +- (BOOL)isFlipped; +- (BOOL)isOpaque; +- (BOOL)acceptsFirstResponder; +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent; +- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent; + +- (void)mouseDown:(NSEvent *)anEvent; + +@end Index: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/XView.m:1.2 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/XView.m Thu Oct 16 19:50:16 2003 @@ -0,0 +1,74 @@ +/* + * NSView subclass for Mac OS X rootless X server + * + * Each rootless window contains an instance of this class. + * This class handles events while drawing is handled by Carbon + * code in the rootless Aqua implementation. + * + * Copyright (c) 2001 Greg Parker. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.2 2003/10/16 23:50:16 torrey Exp $ */ + +#import "XView.h" + + +@implementation XView + +- (BOOL)isFlipped +{ + return NO; +} + +- (BOOL)isOpaque +{ + return YES; +} + +- (BOOL)acceptsFirstResponder +{ + return YES; +} + +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent +{ + return YES; +} + +- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent +{ + return YES; +} + +- (void)mouseDown:(NSEvent *)anEvent +{ + // Only X is allowed to restack windows. + [NSApp preventWindowOrdering]; + if (! [NSApp isActive]) { + [NSApp activateIgnoringOtherApps:YES]; + } + [[self nextResponder] mouseDown:anEvent]; +} + +@end Index: xc/programs/Xserver/hw/darwin/quartz/cr/cr.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/cr.h:1.3 --- /dev/null Sat Feb 28 21:42:13 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/cr.h Mon Nov 3 00:36:31 2003 @@ -0,0 +1,62 @@ +/* + * Internal definitions of the Cocoa rootless implementation + */ +/* + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/cr.h,v 1.3 2003/11/03 05:36:31 tsi Exp $ */ + +#ifndef _CR_H +#define _CR_H + +#ifdef __OBJC__ +#import +#import "XView.h" +#else +typedef struct OpaqueNSWindow NSWindow; +typedef struct OpaqueXView XView; +#endif + +#undef BOOL +#define BOOL xBOOL +#include "screenint.h" +#include "window.h" +#undef BOOL + +// Predefined style for the window which is about to be framed +extern WindowPtr nextWindowToFrame; +extern unsigned int nextWindowStyle; + +typedef struct { + NSWindow *window; + XView *view; + GrafPtr port; + CGContextRef context; +} CRWindowRec, *CRWindowPtr; + +Bool CRInit(ScreenPtr pScreen); +void CRAppleWMInit(void); + +#endif /* _CR_H */ Index: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m Mon Sep 15 20:36:14 2003 @@ -0,0 +1,157 @@ +/* + * Cocoa rootless implementation functions for AppleWM extension + */ +/* + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m,v 1.1 2003/09/16 00:36:14 torrey Exp $ */ + +#include "quartzCommon.h" +#include "cr.h" + +#undef BOOL +#define BOOL xBOOL +#include "rootless.h" +#include "X.h" +#define _APPLEWM_SERVER_ +#include "applewm.h" +#include "applewmExt.h" +#undef BOOL + +#define StdDocumentStyleMask (NSTitledWindowMask | \ + NSClosableWindowMask | \ + NSMiniaturizableWindowMask | \ + NSResizableWindowMask) + +static int +CRDisableUpdate(void) +{ + return Success; +} + + +static int +CREnableUpdate(void) +{ + return Success; +} + + +static int CRSetWindowLevel( + WindowPtr pWin, + int level) +{ + CRWindowPtr crWinPtr; + + crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE); + if (crWinPtr == 0) + return BadWindow; + + RootlessStopDrawing(pWin, FALSE); + + [crWinPtr->window setLevel:level]; + + return Success; +} + + +static int CRFrameGetRect( + int type, + int class, + const BoxRec *outer, + const BoxRec *inner, + BoxRec *ret) +{ + return Success; +} + + +static int CRFrameHitTest( + int class, + int x, + int y, + const BoxRec *outer, + const BoxRec *inner, + int *ret) +{ + return 0; +} + + +static int CRFrameDraw( + WindowPtr pWin, + int class, + unsigned int attr, + const BoxRec *outer, + const BoxRec *inner, + unsigned int title_len, + const unsigned char *title_bytes) +{ + CRWindowPtr crWinPtr; + NSWindow *window; + Bool hasResizeIndicator; + + /* We assume the window has not yet been framed so + RootlessFrameForWindow() will cause it to be. Record the window + style so that the appropriate one will be used when it is framed. + If the window is already framed, we can't change the window + style and the following will have no effect. */ + + nextWindowToFrame = pWin; + if (class == AppleWMFrameClassDocument) + nextWindowStyle = StdDocumentStyleMask; + else + nextWindowStyle = NSBorderlessWindowMask; + + crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE); + if (crWinPtr == 0) + return BadWindow; + + window = crWinPtr->window; + + [window setTitle:[NSString stringWithCString:title_bytes + length:title_len]]; + + hasResizeIndicator = (attr & AppleWMFrameGrowBox) ? YES : NO; + [window setShowsResizeIndicator:hasResizeIndicator]; + + return Success; +} + + +static AppleWMProcsRec crAppleWMProcs = { + CRDisableUpdate, + CREnableUpdate, + CRSetWindowLevel, + CRFrameGetRect, + CRFrameHitTest, + CRFrameDraw +}; + + +void CRAppleWMInit(void) +{ + AppleWMExtensionInit(&crAppleWMProcs); +} Index: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m:1.8 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m Fri Dec 5 02:00:10 2003 @@ -0,0 +1,403 @@ +/* + * Cocoa rootless implementation frame functions + */ +/* + * Copyright (c) 2001 Greg Parker. All Rights Reserved. + * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.8 2003/12/05 07:00:10 torrey Exp $ */ + +#include "quartzCommon.h" +#include "cr.h" + +#undef BOOL +#define BOOL xBOOL +#include "rootless.h" +#undef BOOL + +WindowPtr nextWindowToFrame = NULL; +unsigned int nextWindowStyle = 0; + +static void CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape); + + +/* + * CRCreateFrame + * Create a new physical window. + * Rootless windows must not autodisplay! Autodisplay can cause a deadlock. + * Event thread - autodisplay: locks view hierarchy, then window + * X Server thread - window resize: locks window, then view hierarchy + * Deadlock occurs if each thread gets one lock and waits for the other. + */ +static Bool +CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, + int newX, int newY, RegionPtr pShape) +{ + CRWindowPtr crWinPtr; + NSRect bounds; + NSWindow *theWindow; + XView *theView; + unsigned int theStyleMask = NSBorderlessWindowMask; + + crWinPtr = (CRWindowPtr) xalloc(sizeof(CRWindowRec)); + + bounds = NSMakeRect(newX, + NSHeight([[NSScreen mainScreen] frame]) - + newY - pFrame->height, + pFrame->width, pFrame->height); + + // Check if AppleWM has specified a style for this window + if (pFrame->win == nextWindowToFrame) { + theStyleMask = nextWindowStyle; + } + nextWindowToFrame = NULL; + + // Create an NSWindow for the new X11 window + theWindow = [[NSWindow alloc] initWithContentRect:bounds + styleMask:theStyleMask + backing:NSBackingStoreBuffered + defer:NO]; + if (!theWindow) return FALSE; + + [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent + [theWindow setAlphaValue:1.0]; // draw opaque + [theWindow setOpaque:YES]; // changed when window is shaped + + [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views + [theWindow setAutodisplay:NO]; // See comment above + [theWindow disableFlushWindow]; // We do all the flushing manually + [theWindow setHasShadow:YES]; // All windows have shadows + [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure + + theView = [[XView alloc] initWithFrame:bounds]; + [theWindow setContentView:theView]; + [theWindow setInitialFirstResponder:theView]; + + [theWindow setAcceptsMouseMovedEvents:YES]; + + crWinPtr->window = theWindow; + crWinPtr->view = theView; + + [theView lockFocus]; + // Fill the window with white to make sure alpha channel is set + NSEraseRect(bounds); + crWinPtr->port = [theView qdPort]; + crWinPtr->context = [[NSGraphicsContext currentContext] graphicsPort]; + // CreateCGContextForPort(crWinPtr->port, &crWinPtr->context); + [theView unlockFocus]; + + // Store the implementation private frame ID + pFrame->wid = (RootlessFrameID) crWinPtr; + + // Reshape the frame if it was created shaped. + if (pShape != NULL) + CRReshapeFrame(pFrame->wid, pShape); + + return TRUE; +} + + +/* + * CRDestroyFrame + * Destroy a frame. + */ +static void +CRDestroyFrame(RootlessFrameID wid) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + + [crWinPtr->window orderOut:nil]; + [crWinPtr->window close]; + [crWinPtr->view release]; + free(crWinPtr); +} + + +/* + * CRMoveFrame + * Move a frame on screen. + */ +static void +CRMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + NSPoint topLeft; + + topLeft = NSMakePoint(newX, + NSHeight([[NSScreen mainScreen] frame]) - newY); + + [crWinPtr->window setFrameTopLeftPoint:topLeft]; +} + + +/* + * CRResizeFrame + * Move and resize a frame. + */ +static void +CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, + int newX, int newY, unsigned int newW, unsigned int newH, + unsigned int gravity) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) - + newY - newH, newW, newH); + + [crWinPtr->window setFrame:bounds display:NO]; +} + + +/* + * CRRestackFrame + * Change the frame order. Put the frame behind nextWid or on top if + * it is NULL. Unmapped frames are mapped by restacking them. + */ +static void +CRRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + CRWindowPtr crNextWinPtr = (CRWindowPtr) nextWid; + + if (crNextWinPtr) { + int upperNum = [crNextWinPtr->window windowNumber]; + + [crWinPtr->window orderWindow:NSWindowBelow relativeTo:upperNum]; + } else { + [crWinPtr->window makeKeyAndOrderFront:nil]; + } +} + + +/* + * CRReshapeFrame + * Set the shape of a frame. + */ +static void +CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + NSRect bounds = [crWinPtr->view frame]; + int winHeight = NSHeight(bounds); + BoxRec localBox = {0, 0, NSWidth(bounds), winHeight}; + + [crWinPtr->view lockFocus]; + + if (pShape != NULL) { + // Calculate the region outside the new shape. + miInverse(pShape, pShape, &localBox); + } + + // If window is currently shaped we need to undo the previous shape. + if (![crWinPtr->window isOpaque]) { + [[NSColor whiteColor] set]; + NSRectFillUsingOperation(bounds, NSCompositeDestinationAtop); + } + + if (pShape != NULL) { + int count = REGION_NUM_RECTS(pShape); + BoxRec *extRects = REGION_RECTS(pShape); + BoxRec *rects, *end; + + // Make transparent if window is now shaped. + [crWinPtr->window setOpaque:NO]; + + // Clear the areas outside the window shape + [[NSColor clearColor] set]; + for (rects = extRects, end = extRects+count; rects < end; rects++) { + int rectHeight = rects->y2 - rects->y1; + NSRectFill( NSMakeRect(rects->x1, + winHeight - rects->y1 - rectHeight, + rects->x2 - rects->x1, rectHeight) ); + } + [[NSGraphicsContext currentContext] flushGraphics]; + + // force update of window shadow + [crWinPtr->window setHasShadow:NO]; + [crWinPtr->window setHasShadow:YES]; + + } else { + [crWinPtr->window setOpaque:YES]; + [[NSGraphicsContext currentContext] flushGraphics]; + } + + [crWinPtr->view unlockFocus]; +} + + +/* + * CRUnmapFrame + * Unmap a frame. + */ +static void +CRUnmapFrame(RootlessFrameID wid) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + + [crWinPtr->window orderOut:nil]; +} + + +/* + * CRStartDrawing + * When a window's buffer is not being drawn to, the CoreGraphics + * window server may compress or move it. Call this routine + * to lock down the buffer during direct drawing. It returns + * a pointer to the backing buffer. + */ +static void +CRStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + PixMapHandle pix; + + [crWinPtr->view lockFocus]; + crWinPtr->port = [crWinPtr->view qdPort]; + LockPortBits(crWinPtr->port); + [crWinPtr->view unlockFocus]; + pix = GetPortPixMap(crWinPtr->port); + + *pixelData = GetPixBaseAddr(pix); + *bytesPerRow = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed? +} + + +/* + * CRStopDrawing + * When direct access to a window's buffer is no longer needed, this + * routine should be called to allow CoreGraphics to compress or + * move it. + */ +static void +CRStopDrawing(RootlessFrameID wid, Bool flush) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + + UnlockPortBits(crWinPtr->port); + + if (flush) { + QDFlushPortBuffer(crWinPtr->port, NULL); + } +} + + +/* + * CRUpdateRegion + * Flush a region from a window's backing buffer to the screen. + */ +static void +CRUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + +#ifdef ROOTLESS_TRACK_DAMAGE + int count = REGION_NUM_RECTS(pDamage); + BoxRec *rects = REGION_RECTS(pDamage); + BoxRec *end; + + static RgnHandle rgn = NULL; + static RgnHandle box = NULL; + + if (!rgn) rgn = NewRgn(); + if (!box) box = NewRgn(); + + for (end = rects+count; rects < end; rects++) { + Rect qdRect; + qdRect.left = rects->x1; + qdRect.top = rects->y1; + qdRect.right = rects->x2; + qdRect.bottom = rects->y2; + + RectRgn(box, &qdRect); + UnionRgn(rgn, box, rgn); + } + + QDFlushPortBuffer(crWinPtr->port, rgn); + + SetEmptyRgn(rgn); + SetEmptyRgn(box); + +#else /* !ROOTLESS_TRACK_DAMAGE */ + QDFlushPortBuffer(crWinPtr->port, NULL); +#endif +} + + +/* + * CRDamageRects + * Mark damaged rectangles as requiring redisplay to screen. + */ +static void +CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects, + int shift_x, int shift_y) +{ + CRWindowPtr crWinPtr = (CRWindowPtr) wid; + const BoxRec *end; + + for (end = rects + count; rects < end; rects++) { + Rect qdRect; + qdRect.left = rects->x1 + shift_x; + qdRect.top = rects->y1 + shift_y; + qdRect.right = rects->x2 + shift_x; + qdRect.bottom = rects->y2 + shift_y; + + QDAddRectToDirtyRegion(crWinPtr->port, &qdRect); + } +} + + +static RootlessFrameProcsRec CRRootlessProcs = { + CRCreateFrame, + CRDestroyFrame, + CRMoveFrame, + CRResizeFrame, + CRRestackFrame, + CRReshapeFrame, + CRUnmapFrame, + CRStartDrawing, + CRStopDrawing, + CRUpdateRegion, + CRDamageRects, + NULL, + NULL, + NULL, + NULL +}; + + +/* + * Initialize CR implementation + */ +Bool +CRInit(ScreenPtr pScreen) +{ + RootlessInit(pScreen, &CRRootlessProcs); + + rootless_CopyBytes_threshold = 0; + rootless_FillBytes_threshold = 0; + rootless_CompositePixels_threshold = 0; + rootless_CopyWindow_threshold = 0; + + return TRUE; +} Index: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m:1.6 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m Wed Nov 26 20:59:53 2003 @@ -0,0 +1,322 @@ +/* + * Cocoa rootless implementation initialization + */ +/* + * Copyright (c) 2001 Greg Parker. All Rights Reserved. + * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.6 2003/11/27 01:59:53 torrey Exp $ */ + +#include "quartzCommon.h" +#include "cr.h" + +#undef BOOL +#define BOOL xBOOL +#include "darwin.h" +#include "quartz.h" +#include "quartzCursor.h" +#include "rootless.h" +#include "safeAlpha.h" +#include "pseudoramiX.h" +#include "applewmExt.h" + +#include "regionstr.h" +#include "scrnintstr.h" +#include "picturestr.h" +#include "globals.h" +#undef BOOL + +// Name of GLX bundle using AGL framework +static const char *crOpenGLBundle = "glxAGL.bundle"; + +static Class classXView = nil; + + +/* + * CRDisplayInit + * Find all screens. + * + * Multihead note: When rootless mode uses PseudoramiX, the + * X server only sees one screen; only PseudoramiX itself knows + * about all of the screens. + */ +static void +CRDisplayInit(void) +{ + ErrorF("Display mode: Rootless Quartz -- Cocoa implementation\n"); + + if (noPseudoramiXExtension) { + darwinScreensFound = [[NSScreen screens] count]; + } else { + darwinScreensFound = 1; // only PseudoramiX knows about the rest + } + + CRAppleWMInit(); +} + + +/* + * CRScreenParams + * Set the basic screen parameters. + */ +static void +CRScreenParams(int index, DarwinFramebufferPtr dfb) +{ + dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay); + dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay); + dfb->colorBitsPerPixel = 3 * dfb->bitsPerComponent; + + if (noPseudoramiXExtension) { + NSScreen *screen = [[NSScreen screens] objectAtIndex:index]; + NSRect frame = [screen frame]; + + // set x, y so (0,0) is top left of main screen + dfb->x = NSMinX(frame); + dfb->y = NSHeight([[NSScreen mainScreen] frame]) - + NSHeight(frame) - NSMinY(frame); + + dfb->width = NSWidth(frame); + dfb->height = NSHeight(frame); + dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8; + + // Shift the usable part of main screen down to avoid the menu bar. + if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) { + dfb->y += aquaMenuBarHeight; + dfb->height -= aquaMenuBarHeight; + } + + } else { + int i; + NSRect unionRect = NSMakeRect(0, 0, 0, 0); + NSArray *screens = [NSScreen screens]; + + // Get the union of all screens (minus the menu bar on main screen) + for (i = 0; i < [screens count]; i++) { + NSScreen *screen = [screens objectAtIndex:i]; + NSRect frame = [screen frame]; + frame.origin.y = [[NSScreen mainScreen] frame].size.height - + frame.size.height - frame.origin.y; + if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { + frame.origin.y += aquaMenuBarHeight; + frame.size.height -= aquaMenuBarHeight; + } + unionRect = NSUnionRect(unionRect, frame); + } + + // Use unionRect as the screen size for the X server. + dfb->x = unionRect.origin.x; + dfb->y = unionRect.origin.y; + dfb->width = unionRect.size.width; + dfb->height = unionRect.size.height; + dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8; + + // Tell PseudoramiX about the real screens. + // InitOutput() will move the big screen to (0,0), + // so compensate for that here. + for (i = 0; i < [screens count]; i++) { + NSScreen *screen = [screens objectAtIndex:i]; + NSRect frame = [screen frame]; + int j; + + // Skip this screen if it's a mirrored copy of an earlier screen. + for (j = 0; j < i; j++) { + if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) { + ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n", + i, j); + break; + } + } + if (j < i) continue; // this screen is a mirrored copy + + frame.origin.y = [[NSScreen mainScreen] frame].size.height - + frame.size.height - frame.origin.y; + + if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) { + frame.origin.y += aquaMenuBarHeight; + frame.size.height -= aquaMenuBarHeight; + } + + ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, + (int)frame.size.width, (int)frame.size.height, + (int)frame.origin.x, (int)frame.origin.y); + + frame.origin.x -= unionRect.origin.x; + frame.origin.y -= unionRect.origin.y; + + ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", + i, (int)frame.origin.x, (int)frame.origin.y); + + PseudoramiXAddScreen(frame.origin.x, frame.origin.y, + frame.size.width, frame.size.height); + } + } +} + + +/* + * CRAddScreen + * Init the framebuffer and record pixmap parameters for the screen. + */ +static Bool +CRAddScreen(int index, ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); + CGRect cgRect; + CGDisplayCount numDisplays; + CGDisplayCount allocatedDisplays = 0; + CGDirectDisplayID *displays = NULL; + CGDisplayErr cgErr; + + CRScreenParams(index, dfb); + + dfb->colorType = TrueColor; + + // No frame buffer - it's all in window pixmaps. + dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height); + + // Get all CoreGraphics displays covered by this X11 display. + cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height); + do { + cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays); + if (cgErr) break; + allocatedDisplays = numDisplays; + displays = xrealloc(displays, + numDisplays * sizeof(CGDirectDisplayID)); + cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays, + &numDisplays); + if (cgErr != CGDisplayNoErr) break; + } while (numDisplays > allocatedDisplays); + + if (cgErr != CGDisplayNoErr || numDisplays == 0) { + ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n", + index, dfb->width, dfb->height, dfb->x, dfb->y); + return FALSE; + } + + // This X11 screen covers all CoreGraphics displays we just found. + // If there's more than one CG display, then video mirroring is on + // or PseudoramiX is on. + displayInfo->displayCount = allocatedDisplays; + displayInfo->displayIDs = displays; + + return TRUE; +} + + +/* + * CRSetupScreen + * Setup the screen for rootless access. + */ +static Bool +CRSetupScreen(int index, ScreenPtr pScreen) +{ + // Add alpha protecting replacements for fb screen functions + pScreen->PaintWindowBackground = SafeAlphaPaintWindow; + pScreen->PaintWindowBorder = SafeAlphaPaintWindow; + +#ifdef RENDER + { + PictureScreenPtr ps = GetPictureScreen(pScreen); + ps->Composite = SafeAlphaComposite; + } +#endif /* RENDER */ + + // Initialize generic rootless code + return CRInit(pScreen); +} + + +/* + * CRInitInput + * Finalize CR specific setup. + */ +static void +CRInitInput(int argc, char **argv) +{ + int i; + + rootlessGlobalOffsetX = darwinMainScreenX; + rootlessGlobalOffsetY = darwinMainScreenY; + + for (i = 0; i < screenInfo.numScreens; i++) + AppleWMSetScreenOrigin(WindowTable[i]); +} + + +/* + * CRIsX11Window + * Returns TRUE if cr is displaying this window. + */ +static Bool +CRIsX11Window(void *nsWindow, int windowNumber) +{ + NSWindow *theWindow = nsWindow; + + if (!theWindow) + return FALSE; + + if ([[theWindow contentView] isKindOfClass:classXView]) + return TRUE; + else + return FALSE; +} + + +/* + * Quartz display mode function list. + */ +static QuartzModeProcsRec crModeProcs = { + CRDisplayInit, + CRAddScreen, + CRSetupScreen, + CRInitInput, + QuartzInitCursor, + QuartzReallySetCursor, + QuartzSuspendXCursor, + QuartzResumeXCursor, + NULL, // No capture or release in rootless mode + NULL, + CRIsX11Window, + NULL, // Cocoa NSWindows hide themselves + RootlessFrameForWindow, + TopLevelParent, + NULL, // No support for DRI surfaces + NULL +}; + + +/* + * QuartzModeBundleInit + * Initialize the display mode bundle after loading. + */ +Bool +QuartzModeBundleInit(void) +{ + quartzProcs = &crModeProcs; + quartzOpenGLBundle = crOpenGLBundle; + classXView = [XView class]; + return TRUE; +} Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile Mon Sep 15 20:36:14 2003 @@ -0,0 +1,19 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile,v 1.1 2003/09/16 00:36:14 torrey Exp $ + +#include + +SRCS = fullscreen.c \ + quartzCursor.c + +OBJS = fullscreen.o \ + quartzCursor.o + +INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ + -I$(FONTINCSRC) -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/shadow \ + -I$(EXTINCSRC) -I.. -I../.. + +NormalLibraryObjectRule() +NormalLibraryTarget(fullscreen,$(OBJS)) + +DependTarget() + Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c:1.4 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c Mon Dec 8 23:41:27 2003 @@ -0,0 +1,565 @@ +/* + * Screen routines for full screen Quartz mode + * + * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.4 2003/12/09 04:41:27 torrey Exp $ */ + +#include "quartzCommon.h" +#include "darwin.h" +#include "quartz.h" +#include "quartzCursor.h" +#include "colormapst.h" +#include "scrnintstr.h" +#include "micmap.h" +#include "shadow.h" + +// Full screen specific per screen storage structure +typedef struct { + CGDirectDisplayID displayID; + CFDictionaryRef xDisplayMode; + CFDictionaryRef aquaDisplayMode; + CGDirectPaletteRef xPalette; + CGDirectPaletteRef aquaPalette; + unsigned char *framebuffer; + unsigned char *shadowPtr; +} FSScreenRec, *FSScreenPtr; + +#define FULLSCREEN_PRIV(pScreen) \ + ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr) + +static int fsScreenIndex; +static CGDirectDisplayID *quartzDisplayList = NULL; +static int quartzNumScreens = 0; +static FSScreenPtr quartzScreens[MAXSCREENS]; + +static int darwinCmapPrivateIndex = -1; +static unsigned long darwinCmapGeneration = 0; + +#define CMAP_PRIV(pCmap) \ + ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr) + +/* + ============================================================================= + + Colormap handling + + ============================================================================= +*/ + +/* + * FSInitCmapPrivates + * Colormap privates may be allocated after the default colormap has + * already been created for some screens. This initialization procedure + * is called for each default colormap that is found. + */ +static Bool +FSInitCmapPrivates( + ColormapPtr pCmap) +{ + return TRUE; +} + + +/* + * FSCreateColormap + * This is a callback from X after a new colormap is created. + * We allocate a new CoreGraphics pallete for each colormap. + */ +static Bool +FSCreateColormap( + ColormapPtr pCmap) +{ + CGDirectPaletteRef pallete; + + // Allocate private storage for the hardware dependent colormap info. + if (darwinCmapGeneration != serverGeneration) { + if ((darwinCmapPrivateIndex = + AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0) + { + return FALSE; + } + darwinCmapGeneration = serverGeneration; + } + + pallete = CGPaletteCreateDefaultColorPalette(); + if (!pallete) return FALSE; + + CMAP_PRIV(pCmap) = pallete; + return TRUE; +} + + +/* + * FSDestroyColormap + * This is called by DIX FreeColormap after it has uninstalled a colormap + * and notified all interested parties. We deallocated the corresponding + * CoreGraphics pallete. + */ +static void +FSDestroyColormap( + ColormapPtr pCmap) +{ + CGPaletteRelease( CMAP_PRIV(pCmap) ); +} + + +/* + * FSInstallColormap + * Set the current CoreGraphics pallete to the pallete corresponding + * to the provided colormap. + */ +static void +FSInstallColormap( + ColormapPtr pCmap) +{ + CGDirectPaletteRef palette = CMAP_PRIV(pCmap); + ScreenPtr pScreen = pCmap->pScreen; + FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); + + // Inform all interested parties that the map is being changed. + miInstallColormap(pCmap); + + if (quartzServerVisible) + CGDisplaySetPalette(fsDisplayInfo->displayID, palette); + + fsDisplayInfo->xPalette = palette; +} + + +/* + * FSStoreColors + * This is a callback from X to change the hardware colormap + * when using PsuedoColor in full screen mode. + */ +static void +FSStoreColors( + ColormapPtr pCmap, + int numEntries, + xColorItem *pdefs) +{ + CGDirectPaletteRef palette = CMAP_PRIV(pCmap); + ScreenPtr pScreen = pCmap->pScreen; + FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); + CGDeviceColor color; + int i; + + if (! palette) + return; + + for (i = 0; i < numEntries; i++) { + color.red = pdefs[i].red / 65535.0; + color.green = pdefs[i].green / 65535.0; + color.blue = pdefs[i].blue / 65535.0; + CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel); + } + + // Update hardware colormap + if (quartzServerVisible) + CGDisplaySetPalette(fsDisplayInfo->displayID, palette); +} + + +/* + ============================================================================= + + Switching between Aqua and X + + ============================================================================= +*/ + +/* + * FSCapture + * Capture the screen so we can draw. Called directly from the main thread + * to synchronize with hiding the menubar. + */ +static void FSCapture(void) +{ + int i; + + if (quartzRootless) return; + + for (i = 0; i < quartzNumScreens; i++) { + FSScreenPtr fsDisplayInfo = quartzScreens[i]; + CGDirectDisplayID cgID = fsDisplayInfo->displayID; + + if (!CGDisplayIsCaptured(cgID)) { + CGDisplayCapture(cgID); + fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); + if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) + CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); + if (fsDisplayInfo->xPalette) + CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette); + } + } +} + + +/* + * FSRelease + * Release the screen so others can draw. + */ +static void FSRelease(void) +{ + int i; + + if (quartzRootless) return; + + for (i = 0; i < quartzNumScreens; i++) { + FSScreenPtr fsDisplayInfo = quartzScreens[i]; + CGDirectDisplayID cgID = fsDisplayInfo->displayID; + + if (CGDisplayIsCaptured(cgID)) { + if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode) + CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode); + if (fsDisplayInfo->aquaPalette) + CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette); + CGDisplayRelease(cgID); + } + } +} + + +/* + * FSSuspendScreen + * Suspend X11 cursor and drawing to the screen. + */ +static void FSSuspendScreen( + ScreenPtr pScreen) +{ + QuartzSuspendXCursor(pScreen); + xf86SetRootClip(pScreen, FALSE); +} + + +/* + * FSResumeScreen + * Resume X11 cursor and drawing to the screen. + */ +static void FSResumeScreen( + ScreenPtr pScreen, + int x, // cursor location + int y ) +{ + QuartzResumeXCursor(pScreen, x, y); + xf86SetRootClip(pScreen, TRUE); +} + + +/* + ============================================================================= + + Screen initialization + + ============================================================================= +*/ + +/* + * FSDisplayInit + * Full screen specific initialization called from InitOutput. + */ +static void FSDisplayInit(void) +{ + static unsigned long generation = 0; + CGDisplayCount quartzDisplayCount = 0; + + ErrorF("Display mode: Full screen Quartz -- Direct Display\n"); + + // Allocate private storage for each screen's mode specific info + if (generation != serverGeneration) { + fsScreenIndex = AllocateScreenPrivateIndex(); + generation = serverGeneration; + } + + // Find all the CoreGraphics displays + CGGetActiveDisplayList(0, NULL, &quartzDisplayCount); + quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID)); + CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList, + &quartzDisplayCount); + + darwinScreensFound = quartzDisplayCount; + atexit(FSRelease); +} + + +/* + * FSFindDisplayMode + * Find the appropriate display mode to use in full screen mode. + * If display mode is not the same as the current Aqua mode, switch + * to the new mode. + */ +static Bool FSFindDisplayMode( + FSScreenPtr fsDisplayInfo) +{ + CGDirectDisplayID cgID = fsDisplayInfo->displayID; + size_t height, width, bpp; + boolean_t exactMatch; + + fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID); + + // If no user options, use current display mode + if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 && + darwinDesiredRefresh == -1) + { + fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; + return TRUE; + } + + // If the user has no choice for size, use current + if (darwinDesiredWidth == 0) { + width = CGDisplayPixelsWide(cgID); + height = CGDisplayPixelsHigh(cgID); + } else { + width = darwinDesiredWidth; + height = darwinDesiredHeight; + } + + switch (darwinDesiredDepth) { + case 0: + bpp = 8; + break; + case 1: + bpp = 16; + break; + case 2: + bpp = 32; + break; + default: + bpp = CGDisplayBitsPerPixel(cgID); + } + + if (darwinDesiredRefresh == -1) { + fsDisplayInfo->xDisplayMode = + CGDisplayBestModeForParameters(cgID, bpp, width, height, + &exactMatch); + } else { + fsDisplayInfo->xDisplayMode = + CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp, + width, height, darwinDesiredRefresh, &exactMatch); + } + if (!exactMatch) { + fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode; + return FALSE; + } + + // Switch to the new display mode + CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode); + return TRUE; +} + + +/* + * FSAddScreen + * Do initialization of each screen for Quartz in full screen mode. + */ +static Bool FSAddScreen( + int index, + ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen); + CGDirectDisplayID cgID = quartzDisplayList[index]; + CGRect bounds; + FSScreenPtr fsDisplayInfo; + + // Allocate space for private per screen fullscreen specific storage. + fsDisplayInfo = xalloc(sizeof(FSScreenRec)); + FULLSCREEN_PRIV(pScreen) = fsDisplayInfo; + + displayInfo->displayCount = 1; + displayInfo->displayIDs = xrealloc(displayInfo->displayIDs, + 1 * sizeof(CGDirectDisplayID)); + displayInfo->displayIDs[0] = cgID; + + fsDisplayInfo->displayID = cgID; + fsDisplayInfo->xDisplayMode = 0; + fsDisplayInfo->aquaDisplayMode = 0; + fsDisplayInfo->xPalette = 0; + fsDisplayInfo->aquaPalette = 0; + + // Capture full screen because X doesn't like read-only framebuffer. + // We need to do this before we (potentially) switch the display mode. + CGDisplayCapture(cgID); + + if (! FSFindDisplayMode(fsDisplayInfo)) { + ErrorF("Could not support specified display mode on screen %i.\n", + index); + xfree(fsDisplayInfo); + return FALSE; + } + + // Don't need to flip y-coordinate as CoreGraphics treats (0, 0) + // as the top left of main screen. + bounds = CGDisplayBounds(cgID); + dfb->x = bounds.origin.x; + dfb->y = bounds.origin.y; + dfb->width = bounds.size.width; + dfb->height = bounds.size.height; + dfb->pitch = CGDisplayBytesPerRow(cgID); + dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID); + + if (dfb->bitsPerPixel == 8) { + if (CGDisplayCanSetPalette(cgID)) { + dfb->colorType = PseudoColor; + } else { + dfb->colorType = StaticColor; + } + dfb->bitsPerComponent = 8; + dfb->colorBitsPerPixel = 8; + } else { + dfb->colorType = TrueColor; + dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID); + dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) * + dfb->bitsPerComponent; + } + + fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID); + + // allocate shadow framebuffer + fsDisplayInfo->shadowPtr = xalloc(dfb->pitch * dfb->height); + dfb->framebuffer = fsDisplayInfo->shadowPtr; + + return TRUE; +} + + +/* + * FSShadowUpdate + * Update the damaged regions of the shadow framebuffer on the display. + */ +static void FSShadowUpdate( + ScreenPtr pScreen, + shadowBufPtr pBuf) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); + RegionPtr damage = &pBuf->damage; + int numBox = REGION_NUM_RECTS(damage); + BoxPtr pBox = REGION_RECTS(damage); + int pitch = dfb->pitch; + int bpp = dfb->bitsPerPixel/8; + + // Don't update if the X server is not visible + if (!quartzServerVisible) + return; + + // Loop through all the damaged boxes + while (numBox--) { + int width, height, offset; + unsigned char *src, *dst; + + width = (pBox->x2 - pBox->x1) * bpp; + height = pBox->y2 - pBox->y1; + offset = (pBox->y1 * pitch) + (pBox->x1 * bpp); + src = fsDisplayInfo->shadowPtr + offset; + dst = fsDisplayInfo->framebuffer + offset; + + while (height--) { + memcpy(dst, src, width); + dst += pitch; + src += pitch; + } + + // Get the next box + pBox++; + } +} + + +/* + * FSSetupScreen + * Finalize full screen specific setup of each screen. + */ +static Bool FSSetupScreen( + int index, + ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen); + CGDirectDisplayID cgID = fsDisplayInfo->displayID; + + // Initialize shadow framebuffer support + if (! shadowInit(pScreen, FSShadowUpdate, NULL)) { + ErrorF("Failed to initalize shadow framebuffer for screen %i.\n", + index); + return FALSE; + } + + if (dfb->colorType == PseudoColor) { + // Initialize colormap handling + size_t aquaBpp; + + // If Aqua is using 8 bits we need to keep track of its pallete. + CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode, + kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp); + if (aquaBpp <= 8) + fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID); + + pScreen->CreateColormap = FSCreateColormap; + pScreen->DestroyColormap = FSDestroyColormap; + pScreen->InstallColormap = FSInstallColormap; + pScreen->StoreColors = FSStoreColors; + + } + + quartzScreens[quartzNumScreens++] = fsDisplayInfo; + return TRUE; +} + + +/* + * Quartz display mode function list. + */ +static QuartzModeProcsRec fsModeProcs = { + FSDisplayInit, + FSAddScreen, + FSSetupScreen, + NULL, // Not needed + QuartzInitCursor, + QuartzReallySetCursor, + FSSuspendScreen, + FSResumeScreen, + FSCapture, + FSRelease, + NULL, // No rootless code in fullscreen + NULL, + NULL, + NULL, + NULL, // No support for DRI surfaces + NULL +}; + + +/* + * QuartzModeBundleInit + * Initialize the display mode bundle after loading. + */ +Bool +QuartzModeBundleInit(void) +{ + quartzProcs = &fsModeProcs; + quartzOpenGLBundle = NULL; // Only Mesa support for now + return TRUE; +} Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c Mon Sep 15 20:36:15 2003 @@ -0,0 +1,653 @@ +/************************************************************** + * + * Support for using the Quartz Window Manager cursor + * + **************************************************************/ +/* + * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */ + +#include "quartzCommon.h" +#include "quartzCursor.h" +#include "darwin.h" + +#include + +#include "mi.h" +#include "scrnintstr.h" +#include "cursorstr.h" +#include "mipointrst.h" +#include "globals.h" + +// Size of the QuickDraw cursor +#define CURSORWIDTH 16 +#define CURSORHEIGHT 16 + +typedef struct { + int qdCursorMode; + int qdCursorVisible; + int useQDCursor; + QueryBestSizeProcPtr QueryBestSize; + miPointerSpriteFuncPtr spriteFuncs; +} QuartzCursorScreenRec, *QuartzCursorScreenPtr; + +static int darwinCursorScreenIndex = -1; +static unsigned long darwinCursorGeneration = 0; +static CursorPtr quartzLatentCursor = NULL; +static QD_Cursor gQDArrow; // QuickDraw arrow cursor + +// Cursor for the main thread to set (NULL = arrow cursor). +static CCrsrHandle currentCursor = NULL; +static pthread_mutex_t cursorMutex; +static pthread_cond_t cursorCondition; + +#define CURSOR_PRIV(pScreen) \ + ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) + +#define HIDE_QD_CURSOR(pScreen, visible) \ + if (visible) { \ + int ix; \ + for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ + CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ + } \ + visible = FALSE; \ + } ((void)0) + +#define SHOW_QD_CURSOR(pScreen, visible) \ + { \ + int ix; \ + for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ + CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ + } \ + visible = TRUE; \ + } ((void)0) + +#define CHANGE_QD_CURSOR(cursorH) \ + if (!quartzServerQuitting) { \ + /* Acquire lock and tell the main thread to change cursor */ \ + pthread_mutex_lock(&cursorMutex); \ + currentCursor = (CCrsrHandle) (cursorH); \ + QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \ + \ + /* Wait for the main thread to change the cursor */ \ + pthread_cond_wait(&cursorCondition, &cursorMutex); \ + pthread_mutex_unlock(&cursorMutex); \ + } ((void)0) + + +/* + * MakeQDCursor helpers: CTAB_ENTER, interleave + */ + +// Add a color entry to a ctab +#define CTAB_ENTER(ctab, index, r, g, b) \ + ctab->ctTable[index].value = index; \ + ctab->ctTable[index].rgb.red = r; \ + ctab->ctTable[index].rgb.green = g; \ + ctab->ctTable[index].rgb.blue = b + +// Make an unsigned short by interleaving the bits of bytes c1 and c2. +// High bit of c1 is first; low bit of c2 is last. +// Interleave is a built-in INTERCAL operator. +static unsigned short +interleave( + unsigned char c1, + unsigned char c2 ) +{ + return + ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) | + ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) | + ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) | + ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) | + ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) | + ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) | + ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) | + ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ; +} + +/* + * MakeQDCursor + * Make a QuickDraw color cursor from the given X11 cursor. + * Warning: This code is nasty. Color cursors were meant to be read + * from resources; constructing the structures programmatically is messy. + */ +/* + QuickDraw cursor representation: + Our color cursor is a 2 bit per pixel pixmap. + Each pixel's bits are (source<<1 | mask) from the original X cursor pixel. + The cursor's color table maps the colors like this: + (2-bit value | X result | colortable | Mac result) + 00 | transparent | white | transparent (white outside mask) + 01 | back color | back color | back color + 10 | undefined | black | invert background (just for fun) + 11 | fore color | fore color | fore color +*/ +static CCrsrHandle +MakeQDCursor( + CursorPtr pCursor ) +{ + CCrsrHandle result; + CCrsrPtr curs; + int i, w, h; + unsigned short rowMask; + PixMap *pix; + ColorTable *ctab; + unsigned short *image; + + result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr)); + if (!result) return NULL; + HLock((Handle)result); + curs = *result; + + // Initialize CCrsr + curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color + curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap)); + if (!curs->crsrMap) goto pixAllocFailed; + HLock((Handle)curs->crsrMap); + pix = *curs->crsrMap; + curs->crsrData = NULL; // raw cursor image data (set below) + curs->crsrXData = NULL; // QD's processed data + curs->crsrXValid = 0; // zero means QD must re-process cursor data + curs->crsrXHandle = NULL; // reserved + memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data + memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask + curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot + curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot + curs->crsrXTable = 0; // reserved + curs->crsrID = GetCTSeed(); // unique ID from Color Manager + + // Set the b&w data and mask + w = min(pCursor->bits->width, CURSORWIDTH); + h = min(pCursor->bits->height, CURSORHEIGHT); + rowMask = ~((1 << (CURSORWIDTH - w)) - 1); + for (i = 0; i < h; i++) { + curs->crsr1Data[i] = rowMask & + ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]); + curs->crsrMask[i] = rowMask & + ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]); + } + + // Set the color data and mask + // crsrMap: defines bit depth and size and colortable only + pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap + SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020 + pix->pixelSize = 2; + pix->cmpCount = 1; + pix->cmpSize = 2; + // pix->pmTable set below + + // crsrData is the pixel data. crsrMap's baseAddr is not used. + curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8); + if (!curs->crsrData) goto imageAllocFailed; + HLock((Handle)curs->crsrData); + image = (unsigned short *) *curs->crsrData; + // Pixel data is just 1-bit data and mask interleaved (see above) + for (i = 0; i < h; i++) { + unsigned char s, m; + s = pCursor->bits->source[i*4] & (rowMask >> 8); + m = pCursor->bits->mask[i*4] & (rowMask >> 8); + image[2*i] = interleave(s, m); + s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff); + m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff); + image[2*i+1] = interleave(s, m); + } + + // Build the color table (entries described above) + // NewPixMap allocates a color table handle. + pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3 + * sizeof(ColorSpec)); + if (!pix->pmTable) goto ctabAllocFailed; + HLock((Handle)pix->pmTable); + ctab = *pix->pmTable; + ctab->ctSeed = GetCTSeed(); + ctab->ctFlags = 0; + ctab->ctSize = 3; // color count - 1 + CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff); + CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen, + pCursor->backBlue); + CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000); + CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen, + pCursor->foreBlue); + + HUnlock((Handle)pix->pmTable); // ctab + HUnlock((Handle)curs->crsrData); // image data + HUnlock((Handle)curs->crsrMap); // pix + HUnlock((Handle)result); // cursor + + return result; + + // "What we have here is a failure to allocate" +ctabAllocFailed: + HUnlock((Handle)curs->crsrData); + DisposeHandle((Handle)curs->crsrData); +imageAllocFailed: + HUnlock((Handle)curs->crsrMap); + DisposeHandle((Handle)curs->crsrMap); +pixAllocFailed: + HUnlock((Handle)result); + DisposeHandle((Handle)result); + return NULL; +} + + +/* + * FreeQDCursor + * Destroy a QuickDraw color cursor created with MakeQDCursor(). + * The cursor must not currently be on screen. + */ +static void FreeQDCursor(CCrsrHandle cursHandle) +{ + CCrsrPtr curs; + PixMap *pix; + + HLock((Handle)cursHandle); + curs = *cursHandle; + HLock((Handle)curs->crsrMap); + pix = *curs->crsrMap; + DisposeHandle((Handle)pix->pmTable); + HUnlock((Handle)curs->crsrMap); + DisposeHandle((Handle)curs->crsrMap); + DisposeHandle((Handle)curs->crsrData); + HUnlock((Handle)cursHandle); + DisposeHandle((Handle)cursHandle); +} + + +/* +=========================================================================== + + Pointer sprite functions + +=========================================================================== +*/ + +/* + * QuartzRealizeCursor + * Convert the X cursor representation to QuickDraw format if possible. + */ +Bool +QuartzRealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor ) +{ + CCrsrHandle qdCursor; + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if(!pCursor || !pCursor->bits) + return FALSE; + + // if the cursor is too big we use a software cursor + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) + { + if (quartzRootless) { + // rootless can't use a software cursor + return TRUE; + } else { + return (*ScreenPriv->spriteFuncs->RealizeCursor) + (pScreen, pCursor); + } + } + + // make new cursor image + qdCursor = MakeQDCursor(pCursor); + if (!qdCursor) return FALSE; + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor; + + return TRUE; +} + + +/* + * QuartzUnrealizeCursor + * Free the storage space associated with a realized cursor. + */ +Bool +QuartzUnrealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor ) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) + { + if (quartzRootless) { + return TRUE; + } else { + return (*ScreenPriv->spriteFuncs->UnrealizeCursor) + (pScreen, pCursor); + } + } else { + CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum]; + + if (currentCursor != oldCursor) { + // This should only fail when quitting, in which case we just leak. + FreeQDCursor(oldCursor); + } + pCursor->devPriv[pScreen->myNum] = NULL; + return TRUE; + } +} + + +/* + * QuartzSetCursor + * Set the cursor sprite and position. + * Use QuickDraw cursor if possible. + */ +static void +QuartzSetCursor( + ScreenPtr pScreen, + CursorPtr pCursor, + int x, + int y) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + quartzLatentCursor = pCursor; + + // Don't touch Mac OS cursor if X is hidden! + if (!quartzServerVisible) + return; + + if (!pCursor) { + // Remove the cursor completely. + HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); + if (! ScreenPriv->qdCursorMode) + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + } + else if ((pCursor->bits->height <= CURSORHEIGHT) && + (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor) + { + // Cursor is small enough to use QuickDraw directly. + if (! ScreenPriv->qdCursorMode) // remove the X cursor + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + ScreenPriv->qdCursorMode = TRUE; + + CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]); + SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); + } + else if (quartzRootless) { + // Rootless can't use a software cursor, so we just use Mac OS arrow. + CHANGE_QD_CURSOR(NULL); + SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); + } + else { + // Cursor is too big for QuickDraw. Use X software cursor. + HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); + ScreenPriv->qdCursorMode = FALSE; + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); + } +} + + +/* + * QuartzReallySetCursor + * Set the QuickDraw cursor. Called from the main thread since changing the + * cursor with QuickDraw is not thread safe on dual processor machines. + */ +void +QuartzReallySetCursor() +{ + pthread_mutex_lock(&cursorMutex); + + if (currentCursor) { + SetCCursor(currentCursor); + } else { + SetCursor(&gQDArrow); + } + + pthread_cond_signal(&cursorCondition); + pthread_mutex_unlock(&cursorMutex); +} + + +/* + * QuartzMoveCursor + * Move the cursor. This is a noop for QuickDraw. + */ +static void +QuartzMoveCursor( + ScreenPtr pScreen, + int x, + int y) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + // only the X cursor needs to be explicitly moved + if (!ScreenPriv->qdCursorMode) + (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); +} + + +static miPointerSpriteFuncRec quartzSpriteFuncsRec = { + QuartzRealizeCursor, + QuartzUnrealizeCursor, + QuartzSetCursor, + QuartzMoveCursor +}; + + +/* +=========================================================================== + + Pointer screen functions + +=========================================================================== +*/ + +/* + * QuartzCursorOffScreen + */ +static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) +{ + return FALSE; +} + + +/* + * QuartzCrossScreen + */ +static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering) +{ + return; +} + + +/* + * QuartzWarpCursor + * Change the cursor position without generating an event or motion history. + * The input coordinates (x,y) are in pScreen-local X11 coordinates. + * + */ +static void +QuartzWarpCursor( + ScreenPtr pScreen, + int x, + int y) +{ + static int neverMoved = TRUE; + + if (neverMoved) { + // Don't move the cursor the first time. This is the jump-to-center + // initialization, and it's annoying because we may still be in MacOS. + neverMoved = FALSE; + return; + } + + if (quartzServerVisible) { + CGDisplayErr cgErr; + CGPoint cgPoint; + // Only need to do this for one display. Any display will do. + CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0]; + CGRect cgRect = CGDisplayBounds(cgID); + + // Convert (x,y) to CoreGraphics screen-local CG coordinates. + // This is necessary because the X11 screen and CG screen may not + // coincide. (e.g. X11 screen may be moved to dodge the menu bar) + + // Make point in X11 global coordinates + cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x, + y + dixScreenOrigins[pScreen->myNum].y); + // Shift to CoreGraphics global screen coordinates + cgPoint.x += darwinMainScreenX; + cgPoint.y += darwinMainScreenY; + // Shift to CoreGraphics screen-local coordinates + cgPoint.x -= cgRect.origin.x; + cgPoint.y -= cgRect.origin.y; + + cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint); + if (cgErr != CGDisplayNoErr) { + ErrorF("Could not set cursor position with error code 0x%x.\n", + cgErr); + } + } + + miPointerWarpCursor(pScreen, x, y); + miPointerUpdate(); +} + + +static miPointerScreenFuncRec quartzScreenFuncsRec = { + QuartzCursorOffScreen, + QuartzCrossScreen, + QuartzWarpCursor, + DarwinEQPointerPost, + DarwinEQSwitchScreen +}; + + +/* +=========================================================================== + + Other screen functions + +=========================================================================== +*/ + +/* + * QuartzCursorQueryBestSize + * Handle queries for best cursor size + */ +static void +QuartzCursorQueryBestSize( + int class, + unsigned short *width, + unsigned short *height, + ScreenPtr pScreen) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if (class == CursorShape) { + *width = CURSORWIDTH; + *height = CURSORHEIGHT; + } else { + (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); + } +} + + +/* + * QuartzInitCursor + * Initialize cursor support + */ +Bool +QuartzInitCursor( + ScreenPtr pScreen ) +{ + QuartzCursorScreenPtr ScreenPriv; + miPointerScreenPtr PointPriv; + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + + // initialize software cursor handling (always needed as backup) + if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) { + return FALSE; + } + + // allocate private storage for this screen's QuickDraw cursor info + if (darwinCursorGeneration != serverGeneration) { + if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + darwinCursorGeneration = serverGeneration; + } + + ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) ); + if (!ScreenPriv) return FALSE; + + CURSOR_PRIV(pScreen) = ScreenPriv; + + // override some screen procedures + ScreenPriv->QueryBestSize = pScreen->QueryBestSize; + pScreen->QueryBestSize = QuartzCursorQueryBestSize; + + // initialize QuickDraw cursor handling + GetQDGlobalsArrow(&gQDArrow); + PointPriv = (miPointerScreenPtr) + pScreen->devPrivates[miPointerScreenIndex].ptr; + + ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &quartzSpriteFuncsRec; + + if (!quartzRootless) + ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel); + else + ScreenPriv->useQDCursor = TRUE; + ScreenPriv->qdCursorMode = TRUE; + ScreenPriv->qdCursorVisible = TRUE; + + // initialize cursor mutex lock + pthread_mutex_init(&cursorMutex, NULL); + + // initialize condition for waiting + pthread_cond_init(&cursorCondition, NULL); + + return TRUE; +} + + +// X server is hiding. Restore the Aqua cursor. +void QuartzSuspendXCursor( + ScreenPtr pScreen ) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + CHANGE_QD_CURSOR(NULL); + SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); +} + + +// X server is showing. Restore the X cursor. +void QuartzResumeXCursor( + ScreenPtr pScreen, + int x, + int y ) +{ + QuartzSetCursor(pScreen, quartzLatentCursor, x, y); +} Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h Mon Sep 15 20:36:15 2003 @@ -0,0 +1,44 @@ +/* + * quartzCursor.h + * + * External interface for Quartz hardware cursor + */ +/* + * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h,v 1.1 2003/09/16 00:36:15 torrey Exp $ */ + +#ifndef QUARTZCURSOR_H +#define QUARTZCURSOR_H + +#include "screenint.h" + +Bool QuartzInitCursor(ScreenPtr pScreen); +void QuartzReallySetCursor(void); +void QuartzSuspendXCursor(ScreenPtr pScreen); +void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); + +#endif Index: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile:1.4 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile Mon Sep 15 20:36:15 2003 @@ -0,0 +1,34 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile,v 1.4 2003/09/16 00:36:15 torrey Exp $ + +#include + +SRCS = appledir.c \ + dri.c \ + xprAppleWM.c \ + xprCursor.c \ + xprFrame.c \ + xprScreen.c \ + x-hash.c \ + x-hook.c \ + x-list.c + +OBJS = appledri.o \ + dri.o \ + xprAppleWM.o \ + xprCursor.o \ + xprFrame.o \ + xprScreen.o \ + x-hash.o \ + x-hook.o \ + x-list.o + +INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/miext/rootless -I$(EXTINCSRC) -I.. -I../.. \ + -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ + -I$(LIBSRC)/GL/apple -I$(APPLEWMLIBSRC) + +NormalLibraryObjectRule() +NormalLibraryTarget(xpr,$(OBJS)) + +DependTarget() Index: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h:1.3 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h Fri Jun 27 16:21:42 2003 @@ -0,0 +1,591 @@ +/* Xplugin.h -- windowing API for rootless X11 server + $Id: Xplugin.h,v 1.4 2003/03/03 23:30:53 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. + + Note that these interfaces are provided solely for the use of the + X11 server. Any other uses are unsupported and strongly discouraged. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.3 2003/06/27 20:21:42 torrey Exp $ */ + +#ifndef XPLUGIN_H +#define XPLUGIN_H 1 + +#include + +/* By default we use the X server definition of BoxRec to define xp_box, + so that the compiler can silently convert between the two. But if + XP_NO_X_HEADERS is defined, we'll define it ourselves. */ + +#ifndef XP_NO_X_HEADERS +# include "miscstruct.h" + typedef BoxRec xp_box; +#else + struct xp_box_struct { + short x1, y1, x2, y2; + }; + typedef struct xp_box_struct xp_box; +#endif + +typedef unsigned int xp_resource_id; +typedef xp_resource_id xp_window_id; +typedef xp_resource_id xp_surface_id; +typedef unsigned int xp_client_id; +typedef unsigned int xp_request_type; +typedef int xp_error; +typedef int xp_bool; + + +/* Error codes that the functions declared here may return. They all + numerically match their X equivalents, i.e. the XP_ can be dropped + if has been included. */ + +enum xp_error_enum { + XP_Success = 0, + XP_BadRequest = 1, + XP_BadValue = 2, + XP_BadWindow = 3, + XP_BadMatch = 8, + XP_BadAccess = 10, + XP_BadImplementation = 17, +}; + + +/* Event types generated by the plugin. */ + +enum xp_event_type_enum { + /* The global display configuration changed somehow. */ + XP_EVENT_DISPLAY_CHANGED = 1 << 0, + + /* A window changed state. Argument is xp_window_state_event */ + XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1, + + /* An async request encountered an error. Argument is of type + xp_async_error_event */ + XP_EVENT_ASYNC_ERROR = 1 << 2, + + /* Sent when a surface is destroyed as a side effect of destroying + a window. Arg is of type xp_surface_id. */ + XP_EVENT_SURFACE_DESTROYED = 1 << 3, + + /* Sent when any GL contexts pointing at the given surface need to + call xp_update_gl_context () to refresh their state (because the + window moved or was resized. Arg is of type xp_surface_id. */ + XP_EVENT_SURFACE_CHANGED = 1 << 4, + + /* Sent when a window has been moved. Arg is of type xp_window_id. */ + XP_EVENT_WINDOW_MOVED = 1 << 5, +}; + +/* Function type used to receive events. */ + +typedef void (xp_event_fun) (unsigned int type, const void *arg, + unsigned int arg_size, void *user_data); + + +/* Operation types. Used when reporting errors asynchronously. */ + +enum xp_request_type_enum { + XP_REQUEST_NIL = 0, + XP_REQUEST_DESTROY_WINDOW = 1, + XP_REQUEST_CONFIGURE_WINDOW = 2, + XP_REQUEST_FLUSH_WINDOW = 3, + XP_REQUEST_COPY_WINDOW = 4, + XP_REQUEST_UNLOCK_WINDOW = 5, + XP_REQUEST_DISABLE_UPDATE = 6, + XP_REQUEST_REENABLE_UPDATE = 7, + XP_REQUEST_HIDE_CURSOR = 8, + XP_REQUEST_SHOW_CURSOR = 9, + XP_REQUEST_FRAME_DRAW = 10, +}; + +/* Structure used to report an error asynchronously. Passed as the "arg" + of an XP_EVENT_ASYNC_ERROR event. */ + +struct xp_async_error_event_struct { + xp_request_type request_type; + xp_resource_id id; + xp_error error; +}; + +typedef struct xp_async_error_event_struct xp_async_error_event; + + +/* Possible window states. */ + +enum xp_window_state_enum { + /* The window is not in the global list of possibly-visible windows. */ + XP_WINDOW_STATE_OFFSCREEN = 1 << 0, + + /* Parts of the window may be obscured by other windows. */ + XP_WINDOW_STATE_OBSCURED = 1 << 1, +}; + +/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */ + +struct xp_window_state_event_struct { + xp_window_id id; + unsigned int state; +}; + +typedef struct xp_window_state_event_struct xp_window_state_event; + + +/* Function type used to supply a colormap for indexed drawables. */ + +typedef xp_error (xp_colormap_fun) (void *data, int first_color, + int n_colors, uint32_t *colors); + + +/* Window attributes structure. Used when creating and configuring windows. + Also used when configuring surfaces attached to windows. Functions that + take one of these structures also take a bit mask defining which + fields are set to meaningful values. */ + +enum xp_window_changes_enum { + XP_ORIGIN = 1 << 0, + XP_SIZE = 1 << 1, + XP_BOUNDS = XP_ORIGIN | XP_SIZE, + XP_SHAPE = 1 << 2, + XP_STACKING = 1 << 3, + XP_DEPTH = 1 << 4, + XP_COLORMAP = 1 << 5, + XP_WINDOW_LEVEL = 1 << 6, +}; + +struct xp_window_changes_struct { + /* XP_ORIGIN */ + int x, y; + + /* XP_SIZE */ + unsigned int width, height; + int bit_gravity; /* how to resize the backing store */ + + /* XP_SHAPE */ + int shape_nrects; /* -1 = remove shape */ + xp_box *shape_rects; + int shape_tx, shape_ty; /* translation for shape */ + + /* XP_STACKING */ + int stack_mode; + xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes + it may specify a relative window */ + /* XP_DEPTH, window-only */ + unsigned int depth; + + /* XP_COLORMAP, window-only */ + xp_colormap_fun *colormap; + void *colormap_data; + + /* XP_WINDOW_LEVEL, window-only */ + int window_level; +}; + +typedef struct xp_window_changes_struct xp_window_changes; + +/* Values for bit_gravity field */ + +enum xp_bit_gravity_enum { + XP_GRAVITY_NONE = 0, /* no gravity, fill everything */ + XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */ + XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */ + XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */ + XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */ +}; + +/* Values for stack_mode field */ + +enum xp_window_stack_mode_enum { + XP_UNMAPPED = 0, /* remove the window */ + XP_MAPPED_ABOVE = 1, /* display the window on top */ + XP_MAPPED_BELOW = 2, /* display the window at bottom */ +}; + +/* Data formats for depth field and composite functions */ + +enum xp_depth_enum { + XP_DEPTH_NIL = 0, /* null source when compositing */ + XP_DEPTH_ARGB8888, + XP_DEPTH_RGB555, + XP_DEPTH_A8, /* for masks when compositing */ + XP_DEPTH_INDEX8, +}; + +/* Options that may be passed to the xp_init () function. */ + +enum xp_init_options_enum { + /* Don't mark that this process can be in the foreground. */ + XP_IN_BACKGROUND = 1 << 0, + + /* Deliver background pointer events to this process. */ + XP_BACKGROUND_EVENTS = 1 << 1, +}; + + + +/* Miscellaneous functions */ + +/* Initialize the plugin library. Only the copy/fill/composite functions + may be called without having previously called xp_init () */ + +extern xp_error xp_init (unsigned int options); + +/* Sets the current set of requested notifications to MASK. When any of + these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that + calling this function cancels any previously requested notifications + that aren't set in MASK. */ + +extern xp_error xp_select_events (unsigned int mask, + xp_event_fun *callback, + void *callback_data); + +/* Waits for all initiated operations to complete. */ + +extern xp_error xp_synchronize (void); + +/* Causes any display update initiated through the plugin libary to be + queued until update is reenabled. Note that calls to these functions + nest. */ + +extern xp_error xp_disable_update (void); +extern xp_error xp_reenable_update (void); + + + +/* Cursor functions. */ + +/* Installs the specified cursor. ARGB-DATA should point to 32-bit + premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters + specify the offset to the cursor's hot spot from its top-left + corner. */ + +extern xp_error xp_set_cursor (unsigned int width, unsigned int height, + unsigned int hot_x, unsigned int hot_y, + const uint32_t *argb_data, + unsigned int rowbytes); + +/* Hide and show the cursor if it's owned by the current process. Calls + to these functions nest. */ + +extern xp_error xp_hide_cursor (void); +extern xp_error xp_show_cursor (void); + + + +/* Window functions. */ + +/* Create a new window as defined by MASK and VALUES. MASK must contain + XP_BOUNDS or an error is raised. The id of the newly created window + is stored in *RET-ID if this function returns XP_Success. */ + +extern xp_error xp_create_window (unsigned int mask, + const xp_window_changes *values, + xp_window_id *ret_id); + +/* Destroys the window identified by ID. */ + +extern xp_error xp_destroy_window (xp_window_id id); + +/* Reconfigures the given window according to MASK and VALUES. */ + +extern xp_error xp_configure_window (xp_window_id id, unsigned int mask, + const xp_window_changes *values); + + +/* Returns true if NATIVE-ID is a window created by the plugin library. + If so and RET-ID is non-null, stores the id of the window in *RET-ID. */ + +extern xp_bool xp_lookup_native_window (unsigned int native_id, + xp_window_id *ret_id); + +/* If ID names a window created by the plugin library, stores it's native + window id in *RET-NATIVE-ID. */ + +extern xp_error xp_get_native_window (xp_window_id id, + unsigned int *ret_native_id); + + +/* Locks the rectangle IN-RECT (or, if null, the entire window) of the + given window's backing store. Any other non-null parameters are filled + in as follows: + + DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888 + or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is + always stored in native byte order. + + BITS[0] = pointer to top-left pixel of locked color data + BITS[1] = pointer to top-left of locked alpha data, or null if window + has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0]. + + ROWBYTES[0,1] = size in bytes of each row of color,alpha data + + OUT-RECT = rectangle specifying the current position and size of the + locked region relative to the window origin. + + Note that an error is raised when trying to lock an already locked + window. While the window is locked, the only operations that may + be performed on it are to modify, access or flush its marked region. */ + +extern xp_error xp_lock_window (xp_window_id id, + const xp_box *in_rect, + unsigned int *depth, + void *bits[2], + unsigned int rowbytes[2], + xp_box *out_rect); + +/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS, + SHAPE-TX, and SHAPE-TY in the specified window has been updated, and + will need to subsequently be redisplayed. */ + +extern xp_error xp_mark_window (xp_window_id id, int shape_nrects, + const xp_box *shape_rects, + int shape_tx, int shape_ty); + +/* Unlocks the specified window. If FLUSH is true, then any marked + regions are immediately redisplayed. Note that it's an error to + unlock an already unlocked window. */ + +extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush); + +/* If anything is marked in the given window for redisplay, do it now. */ + +extern xp_error xp_flush_window (xp_window_id id); + +/* Moves the contents of the region DX,DY pixels away from that specified + by DST_RECTS and DST_NRECTS in the window with SRC-ID to the + destination region in the window DST-ID. Note that currently source + and destination windows must be the same. */ + +extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id, + int dst_nrects, const xp_box *dst_rects, + int dx, int dy); + +/* Returns true if the given window has any regions marked for + redisplay. */ + +extern xp_bool xp_is_window_marked (xp_window_id id); + +/* If successful returns a superset of the region marked for update in + the given window. Use xp_free_region () to release the returned data. */ + +extern xp_error xp_get_marked_shape (xp_window_id id, + int *ret_nrects, xp_box **ret_rects); + +extern void xp_free_shape (int nrects, xp_box *rects); + +/* Searches for the first window below ABOVE-ID containing the point X,Y, + and returns it's window id in *RET-ID. If no window is found, *RET-ID + is set to zero. If ABOVE-ID is zero, finds the topmost window + containing the given point. */ + +extern xp_error xp_find_window (int x, int y, xp_window_id above_id, + xp_window_id *ret_id); + +/* Returns the current origin and size of the window ID in *BOUNDS-RET if + successful. */ +extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret); + + + +/* Window surface functions. */ + +/* Create a new VRAM surface on the specified window. If successful, + returns the identifier of the new surface in *RET-SID. */ + +extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid); + +/* Destroys the specified surface. */ + +extern xp_error xp_destroy_surface (xp_surface_id sid); + +/* Reconfigures the specified surface as defined by MASK and VALUES. + Note that specifying XP_DEPTH is an error. */ + +extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask, + const xp_window_changes *values); + +/* If successful, places the client identifier of the current process + in *RET-CLIENT. */ + +extern xp_error xp_get_client_id (xp_client_id *ret_client); + +/* Given a valid window,surface combination created by the current + process, attempts to allow the specified external client access + to that surface. If successful, returns two integers in RET-KEY + which the client can use to import the surface into their process. */ + +extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid, + xp_client_id client, + unsigned int ret_key[2]); + +/* Given a two integer key returned from xp_export_surface (), tries + to import the surface into the current process. If successful the + local surface identifier is stored in *SID-RET. */ + +extern xp_error xp_import_surface (const unsigned int key[2], + xp_surface_id *sid_ret); + +/* If successful, stores the number of surfaces attached to the + specified window in *RET. */ + +extern xp_error xp_get_window_surface_count (xp_window_id id, + unsigned int *ret); + +/* Attaches the CGLContextObj CGL-CTX to the specified surface. */ + +extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid); + +/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to + the surface it's attached to. */ + +extern xp_error xp_update_gl_context (void *cgl_ctx); + + + +/* Window frame functions. */ + +/* Possible arguments to xp_frame_get_rect (). */ + +enum xp_frame_rect_enum { + XP_FRAME_RECT_TITLEBAR = 1, + XP_FRAME_RECT_TRACKING = 2, + XP_FRAME_RECT_GROWBOX = 3, +}; + +/* Classes of window frame. */ + +enum xp_frame_class_enum { + XP_FRAME_CLASS_DOCUMENT = 1 << 0, + XP_FRAME_CLASS_DIALOG = 1 << 1, + XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2, + XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3, + XP_FRAME_CLASS_UTILITY = 1 << 4, + XP_FRAME_CLASS_TOOLBAR = 1 << 5, + XP_FRAME_CLASS_MENU = 1 << 6, + XP_FRAME_CLASS_SPLASH = 1 << 7, + XP_FRAME_CLASS_BORDERLESS = 1 << 8, +}; + +/* Attributes of window frames. */ + +enum xp_frame_attr_enum { + XP_FRAME_ACTIVE = 0x0001, + XP_FRAME_URGENT = 0x0002, + XP_FRAME_TITLE = 0x0004, + XP_FRAME_PRELIGHT = 0x0008, + XP_FRAME_SHADED = 0x0010, + XP_FRAME_CLOSE_BOX = 0x0100, + XP_FRAME_COLLAPSE = 0x0200, + XP_FRAME_ZOOM = 0x0400, + XP_FRAME_ANY_BUTTON = 0x0700, + XP_FRAME_CLOSE_BOX_CLICKED = 0x0800, + XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000, + XP_FRAME_ZOOM_BOX_CLICKED = 0x2000, + XP_FRAME_ANY_CLICKED = 0x3800, + XP_FRAME_GROW_BOX = 0x4000, +}; + +#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b)) +#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3)) +#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3)) +#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3)) + +#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \ + | XP_FRAME_ANY_BUTTON \ + | XP_FRAME_ANY_CLICKED) + +extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer, + const xp_box *inner, xp_box *ret); +extern xp_error xp_frame_hit_test (int class, int x, int y, + const xp_box *outer, + const xp_box *inner, int *ret); +extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr, + const xp_box *outer, const xp_box *inner, + unsigned int title_len, + const unsigned char *title_bytes); + + + +/* Memory manipulation functions. */ + +enum xp_composite_op_enum { + XP_COMPOSITE_SRC = 0, + XP_COMPOSITE_OVER, +}; + +#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \ + (((op) << 24) | ((src_depth) << 16) \ + | ((mask_depth) << 8) | ((dest_depth) << 0)) + +#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255) +#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255) +#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255) +#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255) + +/* Composite WIDTH by HEIGHT pixels from source and mask to destination + using a specified function (if source and destination overlap, + undefined behavior results). + + For SRC and DEST, the first element of the array is the color data. If + the second element is non-null it implies that there is alpha data + (which may be meshed or planar). Data without alpha is assumed to be + opaque. + + Passing a null SRC-ROWBYTES pointer implies that the data SRC points + to is a single element. + + Operations that are not supported will return XP_BadImplementation. */ + +extern xp_error xp_composite_pixels (unsigned int width, unsigned int height, + unsigned int function, + void *src[2], unsigned int src_rowbytes[2], + void *mask, unsigned int mask_rowbytes, + void *dest[2], unsigned int dest_rowbytes[2]); + +/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH + bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES + wide in total. */ + +extern void xp_fill_bytes (unsigned int width, + unsigned int height, uint32_t value, + void *dst, unsigned int dst_rowbytes); + +/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH + bytes copied. SRC and DST may overlap, and the right thing will happen. */ + +extern void xp_copy_bytes (unsigned int width, unsigned int height, + const void *src, unsigned int src_rowbytes, + void *dst, unsigned int dst_rowbytes); + +/* Suggestions for the minimum number of bytes or pixels for which it + makes sense to use some of the xp_ functions */ + +extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold, + xp_composite_area_threshold, xp_scroll_area_threshold; + + +#endif /* XPLUGIN_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c Sun Jun 29 21:45:13 2003 @@ -0,0 +1,350 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +#define NEED_REPLIES +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "misc.h" +#include "dixstruct.h" +#include "extnsionst.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "servermd.h" +#define _APPLEDRI_SERVER_ +#include "appledristr.h" +#include "swaprep.h" +#include "dri.h" +#include "dristruct.h" + +static int DRIErrorBase = 0; + +static DISPATCH_PROC(ProcAppleDRIDispatch); +static DISPATCH_PROC(SProcAppleDRIDispatch); + +static void AppleDRIResetProc(ExtensionEntry* extEntry); + +static unsigned char DRIReqCode = 0; +static int DRIEventBase = 0; + +static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to); + +typedef struct _DRIEvent *DRIEventPtr; +typedef struct _DRIEvent { + DRIEventPtr next; + ClientPtr client; + XID clientResource; + unsigned int mask; +} DRIEventRec; + + +void +AppleDRIExtensionInit(void) +{ + ExtensionEntry* extEntry; + + if (DRIExtensionInit() && + (extEntry = AddExtension(APPLEDRINAME, + AppleDRINumberEvents, + AppleDRINumberErrors, + ProcAppleDRIDispatch, + SProcAppleDRIDispatch, + AppleDRIResetProc, + StandardMinorOpcode))) { + DRIReqCode = (unsigned char)extEntry->base; + DRIErrorBase = extEntry->errorBase; + DRIEventBase = extEntry->eventBase; + EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent; + } +} + +/*ARGSUSED*/ +static void +AppleDRIResetProc ( + ExtensionEntry* extEntry +) +{ + DRIReset(); +} + +static int +ProcAppleDRIQueryVersion( + register ClientPtr client +) +{ + xAppleDRIQueryVersionReply rep; + register int n; + + REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = APPLE_DRI_MAJOR_VERSION; + rep.minorVersion = APPLE_DRI_MINOR_VERSION; + rep.patchVersion = APPLE_DRI_PATCH_VERSION; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + + +/* surfaces */ + +static int +ProcAppleDRIQueryDirectRenderingCapable( + register ClientPtr client +) +{ + xAppleDRIQueryDirectRenderingCapableReply rep; + Bool isCapable; + + REQUEST(xAppleDRIQueryDirectRenderingCapableReq); + REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen], + &isCapable)) { + return BadValue; + } + rep.isCapable = isCapable; + + if (!LocalClient(client)) + rep.isCapable = 0; + + WriteToClient(client, + sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcAppleDRIAuthConnection( + register ClientPtr client +) +{ + xAppleDRIAuthConnectionReply rep; + + REQUEST(xAppleDRIAuthConnectionReq); + REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq); + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.authenticated = 1; + + if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) { + ErrorF("Failed to authenticate %u\n", stuff->magic); + rep.authenticated = 0; + } + WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); + return (client->noClientException); +} + +static void surface_notify( + void *_arg, + void *data +) +{ + DRISurfaceNotifyArg *arg = _arg; + int client_index = (int) data; + ClientPtr client; + xAppleDRINotifyEvent se; + + if (client_index < 0 || client_index >= currentMaxClients) + return; + + client = clients[client_index]; + if (client == NULL || client == serverClient || client->clientGone) + return; + + se.type = DRIEventBase + AppleDRISurfaceNotify; + se.kind = arg->kind; + se.arg = arg->id; + se.sequenceNumber = client->sequence; + se.time = currentTime.milliseconds; + WriteEventsToClient (client, 1, (xEvent *) &se); +} + +static int +ProcAppleDRICreateSurface( + ClientPtr client +) +{ + xAppleDRICreateSurfaceReply rep; + DrawablePtr pDrawable; + xp_surface_id sid; + unsigned int key[2]; + + REQUEST(xAppleDRICreateSurfaceReq); + REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( + (Drawable)stuff->drawable, + client, + SecurityReadAccess))) { + return BadValue; + } + + rep.key_0 = rep.key_1 = rep.uid = 0; + + if (!DRICreateSurface( screenInfo.screens[stuff->screen], + (Drawable)stuff->drawable, pDrawable, + stuff->client_id, &sid, key, + surface_notify, (void *) client->index)) { + return BadValue; + } + + rep.key_0 = key[0]; + rep.key_1 = key[1]; + rep.uid = sid; + + WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcAppleDRIDestroySurface( + register ClientPtr client +) +{ + REQUEST(xAppleDRIDestroySurfaceReq); + DrawablePtr pDrawable; + REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq); + + if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( + (Drawable)stuff->drawable, + client, + SecurityReadAccess))) { + return BadValue; + } + + if (!DRIDestroySurface( screenInfo.screens[stuff->screen], + (Drawable)stuff->drawable, + pDrawable, NULL, NULL)) { + return BadValue; + } + + return (client->noClientException); +} + + +/* dispatch */ + +static int +ProcAppleDRIDispatch ( + register ClientPtr client +) +{ + REQUEST(xReq); + + switch (stuff->data) + { + case X_AppleDRIQueryVersion: + return ProcAppleDRIQueryVersion(client); + case X_AppleDRIQueryDirectRenderingCapable: + return ProcAppleDRIQueryDirectRenderingCapable(client); + } + + if (!LocalClient(client)) + return DRIErrorBase + AppleDRIClientNotLocal; + + switch (stuff->data) + { + case X_AppleDRIAuthConnection: + return ProcAppleDRIAuthConnection(client); + case X_AppleDRICreateSurface: + return ProcAppleDRICreateSurface(client); + case X_AppleDRIDestroySurface: + return ProcAppleDRIDestroySurface(client); + default: + return BadRequest; + } +} + +static void +SNotifyEvent( + xAppleDRINotifyEvent *from, + xAppleDRINotifyEvent *to +) +{ + to->type = from->type; + to->kind = from->kind; + cpswaps (from->sequenceNumber, to->sequenceNumber); + cpswapl (from->time, to->time); + cpswapl (from->arg, to->arg); +} + +static int +SProcAppleDRIQueryVersion( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRIQueryVersionReq); + swaps(&stuff->length, n); + return ProcAppleDRIQueryVersion(client); +} + +static int +SProcAppleDRIDispatch ( + register ClientPtr client +) +{ + REQUEST(xReq); + + /* It is bound to be non-local when there is byte swapping */ + if (!LocalClient(client)) + return DRIErrorBase + AppleDRIClientNotLocal; + + /* only local clients are allowed DRI access */ + switch (stuff->data) + { + case X_AppleDRIQueryVersion: + return SProcAppleDRIQueryVersion(client); + default: + return BadRequest; + } +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c Sun Jun 29 21:45:13 2003 @@ -0,0 +1,690 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +#ifdef XFree86LOADER +#include "xf86.h" +#include "xf86_ansic.h" +#else +#include +#include +#endif + +#define NEED_REPLIES +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "misc.h" +#include "dixstruct.h" +#include "extnsionst.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "servermd.h" +#define _APPLEDRI_SERVER_ +#include "appledristr.h" +#include "swaprep.h" +#include "dri.h" +#include "dristruct.h" +#include "mi.h" +#include "mipointer.h" +#include "rootless.h" +#include "x-hash.h" +#include "x-hook.h" + +static int DRIScreenPrivIndex = -1; +static int DRIWindowPrivIndex = -1; + +static RESTYPE DRIDrawablePrivResType; + +static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */ + +/* FIXME: don't hardcode this? */ +#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist" + +/* Corresponds to SU Jaguar Green */ +#define CG_REQUIRED_MAJOR 1 +#define CG_REQUIRED_MINOR 157 +#define CG_REQUIRED_MICRO 11 + +/* Returns version as major.minor.micro in 10.10.10 fixed form */ +static unsigned int +get_cg_version (void) +{ + static unsigned int version; + + FILE *fh; + char *ptr; + + if (version != 0) + return version; + + /* I tried CFBundleGetVersion, but it returns zero, so.. */ + + fh = fopen (CG_INFO_FILE, "r"); + if (fh != NULL) + { + char buf[256]; + + while (fgets (buf, sizeof (buf), fh) != NULL) + { + unsigned char c; + + if (!strstr (buf, "CFBundleShortVersionString") + || fgets (buf, sizeof (buf), fh) == NULL) + { + continue; + } + + ptr = strstr (buf, ""); + if (ptr == NULL) + continue; + + ptr += strlen (""); + + /* Now PTR points to "MAJOR.MINOR.MICRO". */ + + version = 0; + + again: + switch ((c = *ptr++)) + { + case '.': + version = version * 1024; + goto again; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + version = ((version & ~0x3ff) + + (version & 0x3ff) * 10 + (c - '0')); + goto again; + } + break; + } + + fclose (fh); + } + + return version; +} + +static Bool +test_cg_version (unsigned int major, unsigned int minor, unsigned int micro) +{ + unsigned int cg_ver = get_cg_version (); + + unsigned int cg_major = (cg_ver >> 20) & 0x3ff; + unsigned int cg_minor = (cg_ver >> 10) & 0x3ff; + unsigned int cg_micro = cg_ver & 0x3ff; + + if (cg_major > major) + return TRUE; + else if (cg_major < major) + return FALSE; + + /* cg_major == major */ + + if (cg_minor > minor) + return TRUE; + else if (cg_minor < minor) + return FALSE; + + /* cg_minor == minor */ + + if (cg_micro < micro) + return FALSE; + + return TRUE; +} + +Bool +DRIScreenInit(ScreenPtr pScreen) +{ + DRIScreenPrivPtr pDRIPriv; + int i; + + pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); + if (!pDRIPriv) { + pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; + return FALSE; + } + + pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; + pDRIPriv->directRenderingSupport = TRUE; + pDRIPriv->nrWindows = 0; + + /* Need recent cg for window access update */ + if (!test_cg_version (CG_REQUIRED_MAJOR, + CG_REQUIRED_MINOR, + CG_REQUIRED_MICRO)) + { + ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n", + CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO); + + pDRIPriv->directRenderingSupport = FALSE; + + /* Note we don't nuke the dri private, since we need it for + managing indirect surfaces. */ + } + + /* Initialize drawable tables */ + for (i = 0; i < DRI_MAX_DRAWABLES; i++) { + pDRIPriv->DRIDrawables[i] = NULL; + } + + return TRUE; +} + +Bool +DRIFinishScreenInit(ScreenPtr pScreen) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + /* Allocate zero sized private area for each window. Should a window + * become a DRI window, we'll hang a DRIWindowPrivateRec off of this + * private index. + */ + if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0)) + return FALSE; + + /* Wrap DRI support */ + pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; + pScreen->ValidateTree = DRIValidateTree; + + pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; + pScreen->PostValidateTree = DRIPostValidateTree; + + pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; + pScreen->WindowExposures = DRIWindowExposures; + + pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; + pScreen->CopyWindow = DRICopyWindow; + + pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; + pScreen->ClipNotify = DRIClipNotify; + + ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); + + return TRUE; +} + +void +DRICloseScreen(ScreenPtr pScreen) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + if (pDRIPriv && pDRIPriv->directRenderingSupport) { + xfree(pDRIPriv); + pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; + } +} + +Bool +DRIExtensionInit(void) +{ + static unsigned long DRIGeneration = 0; + + if (DRIGeneration != serverGeneration) { + if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + DRIGeneration = serverGeneration; + } + + /* Allocate a window private index with a zero sized private area for + * each window, then should a window become a DRI window, we'll hang + * a DRIWindowPrivateRec off of this private index. + */ + if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0) + return FALSE; + + DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); + + return TRUE; +} + +void +DRIReset(void) +{ + /* + * This stub routine is called when the X Server recycles, resources + * allocated by DRIExtensionInit need to be managed here. + * + * Currently this routine is a stub because all the interesting resources + * are managed via the screen init process. + */ +} + +Bool +DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + if (pDRIPriv) + *isCapable = pDRIPriv->directRenderingSupport; + else + *isCapable = FALSE; + + return TRUE; +} + +Bool +DRIAuthConnection(ScreenPtr pScreen, unsigned int magic) +{ +#if 0 + /* FIXME: something? */ + + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; +#endif + return TRUE; +} + +static void +DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, WindowPtr pWin) +{ + WindowPtr pTopWin; + xp_window_changes wc; + + if (pDRIDrawablePriv->sid == 0) + return; + + pTopWin = TopLevelParent(pWin); + + wc.x = pWin->drawable.x - (pTopWin->drawable.x - pTopWin->borderWidth); + wc.y = pWin->drawable.y - (pTopWin->drawable.y - pTopWin->borderWidth); + wc.width = pWin->drawable.width + 2 * pWin->borderWidth; + wc.height = pWin->drawable.height + 2 * pWin->borderWidth; + wc.bit_gravity = XP_GRAVITY_NONE; + + wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList); + wc.shape_rects = REGION_RECTS(&pWin->clipList); + wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth); + wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth); + + xp_configure_surface(pDRIDrawablePriv->sid, XP_BOUNDS | XP_SHAPE, &wc); +} + +Bool +DRICreateSurface (ScreenPtr pScreen, Drawable id, + DrawablePtr pDrawable, xp_client_id client_id, + xp_surface_id *surface_id, unsigned int ret_key[2], + void (*notify) (void *arg, void *data), void *notify_data) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + DRIDrawablePrivPtr pDRIDrawablePriv; + WindowPtr pWin; + + if (pDrawable->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr)pDrawable; + if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { + pDRIDrawablePriv->refCount++; + } + else { + xp_window_id wid; + xp_surface_id sid; + xp_error err; + unsigned int key[2]; + xp_window_changes wc; + + /* allocate a DRI Window Private record */ + if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { + return FALSE; + } + + /* find the physical window */ + wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE); + if (wid == 0) { + xfree (pDRIDrawablePriv); + return FALSE; + } + + /* allocate the physical surface */ + err = xp_create_surface (wid, &sid); + if (err != Success) { + xfree (pDRIDrawablePriv); + return FALSE; + } + + /* try to give the client access to the surface */ + if (client_id != 0) + { + err = xp_export_surface (wid, sid, client_id, key); + if (err != Success) { + xp_destroy_surface (sid); + xfree (pDRIDrawablePriv); + return FALSE; + } + } + + /* Make it visible */ + wc.stack_mode = XP_MAPPED_ABOVE; + wc.sibling = 0; + err = xp_configure_surface (sid, XP_STACKING, &wc); + if (err != Success) + { + xp_destroy_surface (sid); + xfree (pDRIDrawablePriv); + return FALSE; + } + + /* add it to the list of DRI drawables for this screen */ + pDRIDrawablePriv->sid = sid; + pDRIDrawablePriv->pDraw = pDrawable; + pDRIDrawablePriv->pScreen = pScreen; + pDRIDrawablePriv->refCount = 1; + pDRIDrawablePriv->drawableIndex = -1; + pDRIDrawablePriv->key[0] = key[0]; + pDRIDrawablePriv->key[1] = key[1]; + pDRIDrawablePriv->notifiers = NULL; + + /* save private off of preallocated index */ + pWin->devPrivates[DRIWindowPrivIndex].ptr = + (pointer)pDRIDrawablePriv; + + ++pDRIPriv->nrWindows; + + /* and stash it by surface id */ + if (surface_hash == NULL) + surface_hash = x_hash_table_new (NULL, NULL, NULL, NULL); + x_hash_table_insert (surface_hash, (void *) sid, pDRIDrawablePriv); + + /* track this in case this window is destroyed */ + AddResource(id, DRIDrawablePrivResType, (pointer)pWin); + + /* Initialize shape */ + DRIUpdateSurface (pDRIDrawablePriv, pWin); + } + + if (notify != NULL) { + pDRIDrawablePriv->notifiers + = x_hook_add (pDRIDrawablePriv->notifiers, + notify, notify_data); + } + + *surface_id = pDRIDrawablePriv->sid; + + if (ret_key != NULL) + { + ret_key[0] = pDRIDrawablePriv->key[0]; + ret_key[1] = pDRIDrawablePriv->key[1]; + } + } + else { /* pixmap (or for GLX 1.3, a PBuffer) */ + /* NOT_DONE */ + return FALSE; + } + + return TRUE; +} + +Bool +DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, + void (*notify) (void *, void *), void *notify_data) +{ + DRIDrawablePrivPtr pDRIDrawablePriv; + WindowPtr pWin; + + if (pDrawable->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr)pDrawable; + pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); + if (pDRIDrawablePriv != NULL) { + if (notify != NULL) + { + pDRIDrawablePriv->notifiers + = x_hook_remove (pDRIDrawablePriv->notifiers, + notify, notify_data); + } + if (--pDRIDrawablePriv->refCount <= 0) { + /* This calls back to DRIDrawablePrivDelete + which frees the private area */ + FreeResourceByType(id, DRIDrawablePrivResType, FALSE); + } + } + } + else { /* pixmap (or for GLX 1.3, a PBuffer) */ + /* NOT_DONE */ + return FALSE; + } + + return TRUE; +} + +Bool +DRIDrawablePrivDelete(pointer pResource, XID id) +{ + DrawablePtr pDrawable = (DrawablePtr)pResource; + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); + DRIDrawablePrivPtr pDRIDrawablePriv; + WindowPtr pWin; + + if (pDrawable->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr)pDrawable; + pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); + + if (pDRIDrawablePriv->drawableIndex != -1) { + /* release drawable table entry */ + pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; + } + + if (pDRIDrawablePriv->sid != 0) { + xp_destroy_surface (pDRIDrawablePriv->sid); + x_hash_table_remove (surface_hash, (void *) pDRIDrawablePriv->sid); + } + + if (pDRIDrawablePriv->notifiers != NULL) + x_hook_free (pDRIDrawablePriv->notifiers); + + xfree(pDRIDrawablePriv); + pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; + + --pDRIPriv->nrWindows; + } + else { /* pixmap (or for GLX 1.3, a PBuffer) */ + /* NOT_DONE */ + return FALSE; + } + + return TRUE; +} + +void +DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); + + if(pDRIDrawablePriv) { + /* FIXME: something? */ + } + + pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; + + (*pScreen->WindowExposures)(pWin, prgn, bsreg); + + pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; + pScreen->WindowExposures = DRIWindowExposures; + +} + +void +DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + DRIDrawablePrivPtr pDRIDrawablePriv; + + if (pDRIPriv->nrWindows > 0) { + pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW (pWin); + if (pDRIDrawablePriv != NULL) { + DRIUpdateSurface (pDRIDrawablePriv, pWin); + } + } + + /* unwrap */ + pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; + + /* call lower layers */ + (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc); + + /* rewrap */ + pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; + pScreen->CopyWindow = DRICopyWindow; +} + +int +DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) +{ + ScreenPtr pScreen = pParent->drawable.pScreen; + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + int returnValue; + + /* unwrap */ + pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; + + /* call lower layers */ + returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); + + /* rewrap */ + pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; + pScreen->ValidateTree = DRIValidateTree; + + return returnValue; +} + +void +DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) +{ + ScreenPtr pScreen; + DRIScreenPrivPtr pDRIPriv; + + if (pParent) { + pScreen = pParent->drawable.pScreen; + } else { + pScreen = pChild->drawable.pScreen; + } + pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + if (pDRIPriv->wrap.PostValidateTree) { + /* unwrap */ + pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; + + /* call lower layers */ + (*pScreen->PostValidateTree)(pParent, pChild, kind); + + /* rewrap */ + pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; + pScreen->PostValidateTree = DRIPostValidateTree; + } +} + +void +DRIClipNotify(WindowPtr pWin, int dx, int dy) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + DRIDrawablePrivPtr pDRIDrawablePriv; + + if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { + DRIUpdateSurface (pDRIDrawablePriv, pWin); + } + + if(pDRIPriv->wrap.ClipNotify) { + pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; + + (*pScreen->ClipNotify)(pWin, dx, dy); + + pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; + pScreen->ClipNotify = DRIClipNotify; + } +} + +/* This lets us get at the unwrapped functions so that they can correctly + * call the lower level functions, and choose whether they will be + * called at every level of recursion (eg in validatetree). + */ +DRIWrappedFuncsRec * +DRIGetWrappedFuncs(ScreenPtr pScreen) +{ + return &(DRI_SCREEN_PRIV(pScreen)->wrap); +} + +void +DRIQueryVersion(int *majorVersion, + int *minorVersion, + int *patchVersion) +{ + *majorVersion = APPLE_DRI_MAJOR_VERSION; + *minorVersion = APPLE_DRI_MINOR_VERSION; + *patchVersion = APPLE_DRI_PATCH_VERSION; +} + +void +DRISurfaceNotify (xp_surface_id id, int kind) +{ + DRIDrawablePrivPtr pDRIDrawablePriv = NULL; + DRISurfaceNotifyArg arg; + + arg.id = id; + arg.kind = kind; + + if (surface_hash != NULL) + { + pDRIDrawablePriv = x_hash_table_lookup (surface_hash, + (void *) id, NULL); + } + + if (pDRIDrawablePriv == NULL) + return; + + if (kind == AppleDRISurfaceNotifyDestroyed) + { + pDRIDrawablePriv->sid = 0; + x_hash_table_remove (surface_hash, (void *) id); + } + + x_hook_run (pDRIDrawablePriv->notifiers, &arg); + + if (kind == AppleDRISurfaceNotifyDestroyed) + { + /* Kill off the handle. */ + + FreeResourceByType (pDRIDrawablePriv->pDraw->id, + DRIDrawablePrivResType, FALSE); + } +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h Sun Jun 29 21:45:13 2003 @@ -0,0 +1,130 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Jens Owen + * + */ + +/* Prototypes for AppleDRI functions */ + +#ifndef _DRI_H_ + +#include "Xdefs.h" +#include "scrnintstr.h" +#define _APPLEDRI_SERVER_ +#include "appledri.h" +#include "Xplugin.h" + +typedef void (*ClipNotifyPtr)( WindowPtr, int, int ); + + +/* + * These functions can be wrapped by the DRI. Each of these have + * generic default funcs (initialized in DRICreateInfoRec) and can be + * overridden by the driver in its [driver]DRIScreenInit function. + */ +typedef struct { + WindowExposuresProcPtr WindowExposures; + CopyWindowProcPtr CopyWindow; + ValidateTreeProcPtr ValidateTree; + PostValidateTreeProcPtr PostValidateTree; + ClipNotifyProcPtr ClipNotify; +} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; + +typedef struct { + xp_surface_id id; + int kind; +} DRISurfaceNotifyArg; + +extern Bool DRIScreenInit(ScreenPtr pScreen); + +extern Bool DRIFinishScreenInit(ScreenPtr pScreen); + +extern void DRICloseScreen(ScreenPtr pScreen); + +extern Bool DRIExtensionInit(void); + +extern void DRIReset(void); + +extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, + Bool *isCapable); + +extern Bool DRIAuthConnection(ScreenPtr pScreen, unsigned int magic); + +extern Bool DRICreateSurface(ScreenPtr pScreen, + Drawable id, + DrawablePtr pDrawable, + xp_client_id client_id, + xp_surface_id *surface_id, + unsigned int key[2], + void (*notify) (void *arg, void *data), + void *notify_data); + +extern Bool DRIDestroySurface(ScreenPtr pScreen, + Drawable id, + DrawablePtr pDrawable, + void (*notify) (void *arg, void *data), + void *notify_data); + +extern Bool DRIDrawablePrivDelete(pointer pResource, + XID id); + +extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen); + +extern void DRICopyWindow(WindowPtr pWin, + DDXPointRec ptOldOrg, + RegionPtr prgnSrc); + +extern int DRIValidateTree(WindowPtr pParent, + WindowPtr pChild, + VTKind kind); + +extern void DRIPostValidateTree(WindowPtr pParent, + WindowPtr pChild, + VTKind kind); + +extern void DRIClipNotify(WindowPtr pWin, + int dx, + int dy); + +extern void DRIWindowExposures(WindowPtr pWin, + RegionPtr prgn, + RegionPtr bsreg); + +extern void DRISurfaceNotify (xp_surface_id id, int kind); + +extern void DRIQueryVersion(int *majorVersion, + int *minorVersion, + int *patchVersion); + +#define _DRI_H_ + +#endif Index: xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h Sun Jun 29 21:45:13 2003 @@ -0,0 +1,82 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Jens Owen + * + */ + +#ifndef DRI_STRUCT_H +#define DRI_STRUCT_H + +#include "dri.h" +#include "x-list.h" + +#define DRI_MAX_DRAWABLES 256 + +#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \ + ((DRIWindowPrivIndex < 0) ? \ + NULL : \ + ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr))) + +#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \ + ((DRIPixmapPrivIndex < 0) ? \ + NULL : \ + ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr))) + +typedef struct _DRIDrawablePrivRec +{ + xp_surface_id sid; + int drawableIndex; + DrawablePtr pDraw; + ScreenPtr pScreen; + int refCount; + unsigned int key[2]; + x_list *notifiers; /* list of (FUN . DATA) */ +} DRIDrawablePrivRec, *DRIDrawablePrivPtr; + +#define DRI_SCREEN_PRIV(pScreen) \ + ((DRIScreenPrivIndex < 0) ? \ + NULL : \ + ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr))) + +#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ + (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) + + +typedef struct _DRIScreenPrivRec +{ + Bool directRenderingSupport; + int nrWindows; + DRIWrappedFuncsRec wrap; + DrawablePtr DRIDrawables[DRI_MAX_DRAWABLES]; +} DRIScreenPrivRec, *DRIScreenPrivPtr; + +#endif /* DRI_STRUCT_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c:1.2 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c Sun Jun 29 21:45:13 2003 @@ -0,0 +1,341 @@ +/* x-hash.c - basic hash tables + $Id: x-hash.c,v 1.6 2003/04/16 00:42:14 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ + +#include "x-hash.h" +#include "x-list.h" +#include +#include + +struct x_hash_table_struct { + int bucket_index; + int total_keys; + x_list **buckets; + + x_hash_fun *hash_key; + x_compare_fun *compare_keys; + x_destroy_fun *destroy_key; + x_destroy_fun *destroy_value; +}; + +#define ITEM_NEW(k, v) X_PFX (list_prepend) ((x_list *) (k), v) +#define ITEM_FREE(i) X_PFX (list_free_1) (i) +#define ITEM_KEY(i) ((void *) (i)->next) +#define ITEM_VALUE(i) ((i)->data) + +#define SPLIT_THRESHOLD_FACTOR 2 + +/* http://planetmath.org/?op=getobj&from=objects&name=GoodHashTablePrimes */ +static const unsigned int bucket_sizes[] = { + 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, + 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, + 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, + 1610612741 +}; + +#define N_BUCKET_SIZES (sizeof (bucket_sizes) / sizeof (bucket_sizes[0])) + +static inline unsigned int +hash_table_total_buckets (x_hash_table *h) +{ + return bucket_sizes[h->bucket_index]; +} + +static inline void +hash_table_destroy_item (x_hash_table *h, void *k, void *v) +{ + if (h->destroy_key != 0) + (*h->destroy_key) (k); + + if (h->destroy_value != 0) + (*h->destroy_value) (v); +} + +static inline unsigned int +hash_table_hash_key (x_hash_table *h, void *k) +{ + if (h->hash_key != 0) + return (*h->hash_key) (k); + else + return (unsigned int) k; +} + +static inline int +hash_table_compare_keys (x_hash_table *h, void *k1, void *k2) +{ + if (h->compare_keys == 0) + return k1 == k2; + else + return (*h->compare_keys) (k1, k2) == 0; +} + +static void +hash_table_split (x_hash_table *h) +{ + x_list **new, **old; + x_list *node, *item, *next; + int new_size, old_size; + unsigned int b; + int i; + + if (h->bucket_index == N_BUCKET_SIZES - 1) + return; + + old_size = hash_table_total_buckets (h); + old = h->buckets; + + h->bucket_index++; + + new_size = hash_table_total_buckets (h); + new = calloc (new_size, sizeof (x_list *)); + + if (new == 0) + { + h->bucket_index--; + return; + } + + for (i = 0; i < old_size; i++) + { + for (node = old[i]; node != 0; node = next) + { + next = node->next; + item = node->data; + + b = hash_table_hash_key (h, ITEM_KEY (item)) % new_size; + + node->next = new[b]; + new[b] = node; + } + } + + h->buckets = new; + free (old); +} + +X_EXTERN x_hash_table * +X_PFX (hash_table_new) (x_hash_fun *hash, + x_compare_fun *compare, + x_destroy_fun *key_destroy, + x_destroy_fun *value_destroy) +{ + x_hash_table *h; + + h = calloc (1, sizeof (x_hash_table)); + if (h == 0) + return 0; + + h->bucket_index = 0; + h->buckets = calloc (hash_table_total_buckets (h), sizeof (x_list *)); + + if (h->buckets == 0) + { + free (h); + return 0; + } + + h->hash_key = hash; + h->compare_keys = compare; + h->destroy_key = key_destroy; + h->destroy_value = value_destroy; + + return h; +} + +X_EXTERN void +X_PFX (hash_table_free) (x_hash_table *h) +{ + int n, i; + x_list *node, *item; + + assert (h != NULL); + + n = hash_table_total_buckets (h); + + for (i = 0; i < n; i++) + { + for (node = h->buckets[i]; node != 0; node = node->next) + { + item = node->data; + hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item)); + ITEM_FREE (item); + } + X_PFX (list_free) (h->buckets[i]); + } + + free (h->buckets); + free (h); +} + +X_EXTERN unsigned int +X_PFX (hash_table_size) (x_hash_table *h) +{ + assert (h != NULL); + + return h->total_keys; +} + +static void +hash_table_modify (x_hash_table *h, void *k, void *v, int replace) +{ + unsigned int hash_value; + x_list *node, *item; + + assert (h != NULL); + + hash_value = hash_table_hash_key (h, k); + + for (node = h->buckets[hash_value % hash_table_total_buckets (h)]; + node != 0; node = node->next) + { + item = node->data; + + if (hash_table_compare_keys (h, ITEM_KEY (item), k)) + { + if (replace) + { + hash_table_destroy_item (h, ITEM_KEY (item), + ITEM_VALUE (item)); + ITEM_KEY (item) = k; + ITEM_VALUE (item) = v; + } + else + { + hash_table_destroy_item (h, k, ITEM_VALUE (item)); + ITEM_VALUE (item) = v; + } + return; + } + } + + /* Key isn't already in the table. Insert it. */ + + if (h->total_keys + 1 + > hash_table_total_buckets (h) * SPLIT_THRESHOLD_FACTOR) + { + hash_table_split (h); + } + + hash_value = hash_value % hash_table_total_buckets (h); + h->buckets[hash_value] = X_PFX (list_prepend) (h->buckets[hash_value], + ITEM_NEW (k, v)); + h->total_keys++; +} + +X_EXTERN void +X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v) +{ + hash_table_modify (h, k, v, 0); +} + +X_EXTERN void +X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v) +{ + hash_table_modify (h, k, v, 1); +} + +X_EXTERN void +X_PFX (hash_table_remove) (x_hash_table *h, void *k) +{ + unsigned int hash_value; + x_list **ptr, *item; + + assert (h != NULL); + + hash_value = hash_table_hash_key (h, k); + + for (ptr = &h->buckets[hash_value % hash_table_total_buckets (h)]; + *ptr != 0; ptr = &((*ptr)->next)) + { + item = (*ptr)->data; + + if (hash_table_compare_keys (h, ITEM_KEY (item), k)) + { + hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item)); + ITEM_FREE (item); + item = *ptr; + *ptr = item->next; + X_PFX (list_free_1) (item); + h->total_keys--; + return; + } + } +} + +X_EXTERN void * +X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret) +{ + unsigned int hash_value; + x_list *node, *item; + + assert (h != NULL); + + hash_value = hash_table_hash_key (h, k); + + for (node = h->buckets[hash_value % hash_table_total_buckets (h)]; + node != 0; node = node->next) + { + item = node->data; + + if (hash_table_compare_keys (h, ITEM_KEY (item), k)) + { + if (k_ret != 0) + *k_ret = ITEM_KEY (item); + + return ITEM_VALUE (item); + } + } + + if (k_ret != 0) + *k_ret = 0; + + return 0; +} + +X_EXTERN void +X_PFX (hash_table_foreach) (x_hash_table *h, + x_hash_foreach_fun *fun, void *data) +{ + int i, n; + x_list *node, *item; + + assert (h != NULL); + + n = hash_table_total_buckets (h); + + for (i = 0; i < n; i++) + { + for (node = h->buckets[i]; node != 0; node = node->next) + { + item = node->data; + (*fun) (ITEM_KEY (item), ITEM_VALUE (item), data); + } + } +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h:1.2 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h Sun Jun 29 21:45:13 2003 @@ -0,0 +1,62 @@ +/* x-hash.h -- basic hash table class + $Id: x-hash.h,v 1.4 2003/04/16 00:42:14 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ + +#ifndef X_HASH_H +#define X_HASH_H 1 + +typedef struct x_hash_table_struct x_hash_table; + +typedef int (x_compare_fun) (const void *a, const void *b); +typedef unsigned int (x_hash_fun) (const void *k); +typedef void (x_destroy_fun) (void *x); +typedef void (x_hash_foreach_fun) (void *k, void *v, void *data); + +/* for X_PFX and X_EXTERN */ +#include "x-list.h" + +X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash, + x_compare_fun *compare, + x_destroy_fun *key_destroy, + x_destroy_fun *value_destroy); +X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h); + +X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h); + +X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v); +X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v); +X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k); +X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h, + void *k, void **k_ret); +X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h, + x_hash_foreach_fun *fun, + void *data); + +#endif /* X_HASH_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c Sun Jun 29 21:45:13 2003 @@ -0,0 +1,106 @@ +/* x-hook.c + $Id: x-hook.c,v 1.2 2003/04/16 00:42:14 jharper Exp $ + + Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ + +#include "x-hook.h" +#include +#include + +#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d)) +#define CELL_FREE(c) X_PFX (list_free_1) (c) +#define CELL_FUN(c) ((x_hook_function *) ((c)->next)) +#define CELL_DATA(c) ((c)->data) + +X_EXTERN x_list * +X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data) +{ + return X_PFX (list_prepend) (lst, CELL_NEW (fun, data)); +} + +X_EXTERN x_list * +X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data) +{ + x_list *node, *cell; + x_list *to_delete = NULL; + + for (node = lst; node != NULL; node = node->next) + { + cell = node->data; + if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data) + to_delete = X_PFX (list_prepend) (to_delete, cell); + } + + for (node = to_delete; node != NULL; node = node->next) + { + cell = node->data; + lst = X_PFX (list_remove) (lst, cell); + CELL_FREE (cell); + } + + X_PFX (list_free) (to_delete); +} + +X_EXTERN void +X_PFX (hook_run) (x_list *lst, void *arg) +{ + x_list *node, *cell; + x_hook_function **fun; + void **data; + int length, i; + + length = X_PFX (list_length) (lst); + fun = alloca (sizeof (x_hook_function *) * length); + data = alloca (sizeof (void *) * length); + + for (i = 0, node = lst; node != NULL; node = node->next, i++) + { + cell = node->data; + fun[i] = CELL_FUN (cell); + data[i] = CELL_DATA (cell); + } + + for (i = 0; i < length; i++) + { + (*fun[i]) (arg, data[i]); + } +} + +X_EXTERN void +X_PFX (hook_free) (x_list *lst) +{ + x_list *node; + + for (node = lst; node != NULL; node = node->next) + { + CELL_FREE (node->data); + } + + X_PFX (list_free) (lst); +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h Sun Jun 29 21:45:13 2003 @@ -0,0 +1,44 @@ +/* x-hook.h -- lists of function,data pairs to call. + $Id: x-hook.h,v 1.2 2003/04/16 00:42:14 jharper Exp $ + + Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ + +#ifndef X_HOOK_H +#define X_HOOK_H 1 + +#include "x-list.h" + +typedef void x_hook_function (void *arg, void *data); + +X_EXTERN x_list *X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data); +X_EXTERN x_list *X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data); +X_EXTERN void X_PFX (hook_run) (x_list *lst, void *arg); +X_EXTERN void X_PFX (hook_free) (x_list *lst); + +#endif /* X_HOOK_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c:1.2 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c Sun Jun 29 21:45:13 2003 @@ -0,0 +1,316 @@ +/* x-list.c + $Id: x-list.c,v 1.14 2003/04/18 17:24:09 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ + +#include "x-list.h" +#include +#include +#include + +/* Allocate in ~4k blocks */ +#define NODES_PER_BLOCK 508 + +typedef struct x_list_block_struct x_list_block; + +struct x_list_block_struct { + x_list l[NODES_PER_BLOCK]; +}; + +static x_list *freelist; + +static pthread_mutex_t freelist_lock = PTHREAD_MUTEX_INITIALIZER; + +static inline void +list_free_1 (x_list *node) +{ + node->next = freelist; + freelist = node; +} + +X_EXTERN void +X_PFX (list_free_1) (x_list *node) +{ + assert (node != NULL); + + pthread_mutex_lock (&freelist_lock); + + list_free_1 (node); + + pthread_mutex_unlock (&freelist_lock); +} + +X_EXTERN void +X_PFX (list_free) (x_list *lst) +{ + x_list *next; + + pthread_mutex_lock (&freelist_lock); + + for (; lst != NULL; lst = next) + { + next = lst->next; + list_free_1 (lst); + } + + pthread_mutex_unlock (&freelist_lock); +} + +X_EXTERN x_list * +X_PFX (list_prepend) (x_list *lst, void *data) +{ + x_list *node; + + pthread_mutex_lock (&freelist_lock); + + if (freelist == NULL) + { + x_list_block *b; + int i; + + b = malloc (sizeof (x_list_block)); + + for (i = 0; i < NODES_PER_BLOCK - 1; i++) + b->l[i].next = &(b->l[i+1]); + b->l[i].next = NULL; + + freelist = b->l; + } + + node = freelist; + freelist = node->next; + + pthread_mutex_unlock (&freelist_lock); + + node->next = lst; + node->data = data; + + return node; +} + +X_EXTERN x_list * +X_PFX (list_append) (x_list *lst, void *data) +{ + x_list *head = lst; + + if (lst == NULL) + return X_PFX (list_prepend) (NULL, data); + + while (lst->next != NULL) + lst = lst->next; + + lst->next = X_PFX (list_prepend) (NULL, data); + + return head; +} + +X_EXTERN x_list * +X_PFX (list_reverse) (x_list *lst) +{ + x_list *head = NULL, *next; + + while (lst != NULL) + { + next = lst->next; + lst->next = head; + head = lst; + lst = next; + } + + return head; +} + +X_EXTERN x_list * +X_PFX (list_find) (x_list *lst, void *data) +{ + for (; lst != NULL; lst = lst->next) + { + if (lst->data == data) + return lst; + } + + return NULL; +} + +X_EXTERN x_list * +X_PFX (list_nth) (x_list *lst, int n) +{ + while (n-- > 0 && lst != NULL) + lst = lst->next; + + return lst; +} + +X_EXTERN x_list * +X_PFX (list_filter) (x_list *lst, + int (*pred) (void *item, void *data), void *data) +{ + x_list *ret = NULL, *node; + + for (node = lst; node != NULL; node = node->next) + { + if ((*pred) (node->data, data)) + ret = X_PFX (list_prepend) (ret, node->data); + } + + return X_PFX (list_reverse) (ret); +} + +X_EXTERN x_list * +X_PFX (list_map) (x_list *lst, + void *(*fun) (void *item, void *data), void *data) +{ + x_list *ret = NULL, *node; + + for (node = lst; node != NULL; node = node->next) + { + X_PFX (list_prepend) (ret, fun (node->data, data)); + } + + return X_PFX (list_reverse) (ret); +} + +X_EXTERN x_list * +X_PFX (list_copy) (x_list *lst) +{ + x_list *copy = NULL; + + for (; lst != NULL; lst = lst->next) + { + copy = X_PFX (list_prepend) (copy, lst->data); + } + + return X_PFX (list_reverse) (copy); +} + +X_EXTERN x_list * +X_PFX (list_remove) (x_list *lst, void *data) +{ + x_list **ptr, *node; + + for (ptr = &lst; *ptr != NULL;) + { + node = *ptr; + + if (node->data == data) + { + *ptr = node->next; + X_PFX (list_free_1) (node); + } + else + ptr = &((*ptr)->next); + } + + return lst; +} + +X_EXTERN unsigned int +X_PFX (list_length) (x_list *lst) +{ + unsigned int n; + + n = 0; + for (; lst != NULL; lst = lst->next) + n++; + + return n; +} + +X_EXTERN void +X_PFX (list_foreach) (x_list *lst, + void (*fun) (void *data, void *user_data), + void *user_data) +{ + for (; lst != NULL; lst = lst->next) + { + (*fun) (lst->data, user_data); + } +} + +static x_list * +list_sort_1 (x_list *lst, int length, + int (*less) (const void *, const void *)) +{ + x_list *mid, *ptr; + x_list *out_head, *out; + int mid_point, i; + + /* This is a standard (stable) list merge sort */ + + if (length < 2) + return lst; + + /* Calculate the halfway point. Split the list into two sub-lists. */ + + mid_point = length / 2; + ptr = lst; + for (i = mid_point - 1; i > 0; i--) + ptr = ptr->next; + mid = ptr->next; + ptr->next = NULL; + + /* Sort each sub-list. */ + + lst = list_sort_1 (lst, mid_point, less); + mid = list_sort_1 (mid, length - mid_point, less); + + /* Then merge them back together. */ + + assert (lst != NULL && mid != NULL); + + if ((*less) (mid->data, lst->data)) + out = out_head = mid, mid = mid->next; + else + out = out_head = lst, lst = lst->next; + + while (lst != NULL && mid != NULL) + { + if ((*less) (mid->data, lst->data)) + out = out->next = mid, mid = mid->next; + else + out = out->next = lst, lst = lst->next; + } + + if (lst != NULL) + out->next = lst; + else + out->next = mid; + + return out_head; +} + +X_EXTERN x_list * +X_PFX (list_sort) (x_list *lst, int (*less) (const void *, const void *)) +{ + int length; + + length = X_PFX (list_length) (lst); + + return list_sort_1 (lst, length, less); +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h:1.2 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h Sun Jun 29 21:45:13 2003 @@ -0,0 +1,78 @@ +/* x-list.h -- simple list type + $Id: x-list.h,v 1.8 2003/04/16 00:42:14 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ + +#ifndef X_LIST_H +#define X_LIST_H 1 + +/* This is just a cons. */ + +typedef struct x_list_struct x_list; + +struct x_list_struct { + void *data; + x_list *next; +}; + +#ifndef X_PFX +# define X_PFX(x) x_ ## x +#endif + +#ifndef X_EXTERN +# define X_EXTERN __private_extern__ +#endif + +X_EXTERN void X_PFX (list_free_1) (x_list *node); +X_EXTERN x_list *X_PFX (list_prepend) (x_list *lst, void *data); + +X_EXTERN x_list *X_PFX (list_append) (x_list *lst, void *data); +X_EXTERN x_list *X_PFX (list_remove) (x_list *lst, void *data); +X_EXTERN void X_PFX (list_free) (x_list *lst); + +X_EXTERN x_list *X_PFX (list_copy) (x_list *lst); +X_EXTERN x_list *X_PFX (list_reverse) (x_list *lst); +X_EXTERN x_list *X_PFX (list_find) (x_list *lst, void *data); +X_EXTERN x_list *X_PFX (list_nth) (x_list *lst, int n); +X_EXTERN x_list *X_PFX (list_filter) (x_list *src, + int (*pred) (void *item, void *data), + void *data); +X_EXTERN x_list *X_PFX (list_map) (x_list *src, + void *(*fun) (void *item, void *data), + void *data); + +X_EXTERN unsigned int X_PFX (list_length) (x_list *lst); +X_EXTERN void X_PFX (list_foreach) (x_list *lst, void (*fun) + (void *data, void *user_data), + void *user_data); + +X_EXTERN x_list *X_PFX (list_sort) (x_list *lst, int (*less) (const void *, + const void *)); + +#endif /* X_LIST_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h:1.5 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h Wed Nov 26 20:59:53 2003 @@ -0,0 +1,48 @@ +/* + * Xplugin rootless implementation + */ +/* + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.5 2003/11/27 01:59:53 torrey Exp $ */ + +#ifndef XPR_H +#define XPR_H + +#include "screenint.h" + +extern Bool QuartzModeBundleInit(void); + +void AppleDRIExtensionInit(void); +void xprAppleWMInit(void); +Bool xprInit(ScreenPtr pScreen); +Bool xprIsX11Window(void *nsWindow, int windowNumber); +void xprHideWindows(Bool hide); + +Bool QuartzInitCursor(ScreenPtr pScreen); +void QuartzSuspendXCursor(ScreenPtr pScreen); +void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); + +#endif /* XPR_H */ Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c:1.1 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c Mon Sep 15 20:36:15 2003 @@ -0,0 +1,99 @@ +/* + * Xplugin rootless implementation functions for AppleWM extension + */ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */ + +#include "xpr.h" +#include "applewmExt.h" +#include "rootless.h" +#include "Xplugin.h" +#include "X.h" + + +static int xprSetWindowLevel( + WindowPtr pWin, + int level) +{ + xp_window_id wid; + xp_window_changes wc; + + wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE); + if (wid == 0) + return BadWindow; + + RootlessStopDrawing (pWin, FALSE); + + wc.window_level = level; + if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) { + return BadValue; + } + + return Success; +} + + +static int xprFrameDraw( + WindowPtr pWin, + int class, + unsigned int attr, + const BoxRec *outer, + const BoxRec *inner, + unsigned int title_len, + const unsigned char *title_bytes) +{ + xp_window_id wid; + + wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE); + if (wid == 0) + return BadWindow; + + if (xp_frame_draw (wid, class, attr, outer, inner, + title_len, title_bytes) != Success) + { + return BadValue; + } + + return Success; +} + + +static AppleWMProcsRec xprAppleWMProcs = { + xp_disable_update, + xp_reenable_update, + xprSetWindowLevel, + xp_frame_get_rect, + xp_frame_hit_test, + xprFrameDraw +}; + + +void xprAppleWMInit(void) +{ + AppleWMExtensionInit(&xprAppleWMProcs); +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c:1.2 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c Mon Sep 15 20:36:15 2003 @@ -0,0 +1,420 @@ +/************************************************************** + * + * Xplugin cursor support + * + **************************************************************/ +/* + * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. + * Copyright (c) 2002 Apple Computer, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c,v 1.2 2003/09/16 00:36:15 torrey Exp $ */ + +#include "quartzCommon.h" +#include "xpr.h" +#include "darwin.h" +#include "Xplugin.h" + +#include "mi.h" +#include "scrnintstr.h" +#include "cursorstr.h" +#include "mipointrst.h" +#include "windowstr.h" +#include "globals.h" +#include "servermd.h" +#include "dixevents.h" + +typedef struct { + int cursorVisible; + QueryBestSizeProcPtr QueryBestSize; + miPointerSpriteFuncPtr spriteFuncs; +} QuartzCursorScreenRec, *QuartzCursorScreenPtr; + +static int darwinCursorScreenIndex = -1; +static unsigned long darwinCursorGeneration = 0; + +#define CURSOR_PRIV(pScreen) \ + ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr) + + +static Bool +load_cursor(CursorPtr src, int screen) +{ + uint32_t *data; + uint32_t rowbytes; + int width, height; + int hot_x, hot_y; + + uint32_t fg_color, bg_color; + uint8_t *srow, *sptr; + uint8_t *mrow, *mptr; + uint32_t *drow, *dptr; + unsigned xcount, ycount; + + xp_error err; + + width = src->bits->width; + height = src->bits->height; + hot_x = src->bits->xhot; + hot_y = src->bits->yhot; + +#ifdef ARGB_CURSOR + if (src->bits->argb != NULL) + { + rowbytes = src->bits->width * sizeof(CARD32); + data = (uint32_t *) src->bits->argb; + } + else +#endif + { + fg_color = 0xFF00 | (src->foreRed >> 8); + fg_color <<= 16; + fg_color |= src->foreGreen & 0xFF00; + fg_color |= src->foreBlue >> 8; + + bg_color = 0xFF00 | (src->backRed >> 8); + bg_color <<= 16; + bg_color |= src->backGreen & 0xFF00; + bg_color |= src->backBlue >> 8; + + fg_color = htonl(fg_color); + bg_color = htonl(bg_color); + + /* round up to 8 pixel boundary so we can convert whole bytes */ + rowbytes = ((src->bits->width * 4) + 31) & ~31; + data = alloca(rowbytes * src->bits->height); + + if (!src->bits->emptyMask) + { + ycount = src->bits->height; + srow = src->bits->source; mrow = src->bits->mask; + drow = data; + + while (ycount-- > 0) + { + xcount = (src->bits->width + 7) / 8; + sptr = srow; mptr = mrow; + dptr = drow; + + while (xcount-- > 0) + { + uint8_t s, m; + int i; + + s = *sptr++; m = *mptr++; + for (i = 0; i < 8; i++) + { +#if BITMAP_BIT_ORDER == MSBFirst + if (m & 128) + *dptr++ = (s & 128) ? fg_color : bg_color; + else + *dptr++ = 0; + s <<= 1; m <<= 1; +#else + if (m & 1) + *dptr++ = (s & 1) ? fg_color : bg_color; + else + *dptr++ = 0; + s >>= 1; m >>= 1; +#endif + } + } + + srow += BitmapBytePad(src->bits->width); + mrow += BitmapBytePad(src->bits->width); + drow = (uint32_t *) ((char *) drow + rowbytes); + } + } + else + { + memset(data, 0, src->bits->height * rowbytes); + } + } + + err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes); + return err == Success; +} + + +/* +=========================================================================== + + Pointer sprite functions + +=========================================================================== +*/ + +/* + * QuartzRealizeCursor + * Convert the X cursor representation to native format if possible. + */ +static Bool +QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +{ + if(pCursor == NULL || pCursor->bits == NULL) + return FALSE; + + /* FIXME: cache ARGB8888 representation? */ + + return TRUE; +} + + +/* + * QuartzUnrealizeCursor + * Free the storage space associated with a realized cursor. + */ +static Bool +QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +{ + return TRUE; +} + + +/* + * QuartzSetCursor + * Set the cursor sprite and position. + */ +static void +QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if (!quartzServerVisible) + return; + + if (pCursor == NULL) + { + if (ScreenPriv->cursorVisible) + { + xp_hide_cursor(); + ScreenPriv->cursorVisible = FALSE; + } + } + else + { + load_cursor(pCursor, pScreen->myNum); + + if (!ScreenPriv->cursorVisible) + { + xp_show_cursor(); + ScreenPriv->cursorVisible = TRUE; + } + } +} + + +/* + * QuartzMoveCursor + * Move the cursor. This is a noop for us. + */ +static void +QuartzMoveCursor(ScreenPtr pScreen, int x, int y) +{ +} + + +static miPointerSpriteFuncRec quartzSpriteFuncsRec = { + QuartzRealizeCursor, + QuartzUnrealizeCursor, + QuartzSetCursor, + QuartzMoveCursor +}; + + +/* +=========================================================================== + + Pointer screen functions + +=========================================================================== +*/ + +/* + * QuartzCursorOffScreen + */ +static Bool +QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) +{ + return FALSE; +} + + +/* + * QuartzCrossScreen + */ +static void +QuartzCrossScreen(ScreenPtr pScreen, Bool entering) +{ + return; +} + + +/* + * QuartzWarpCursor + * Change the cursor position without generating an event or motion history. + * The input coordinates (x,y) are in pScreen-local X11 coordinates. + * + */ +static void +QuartzWarpCursor(ScreenPtr pScreen, int x, int y) +{ + static Bool neverMoved = TRUE; + + if (neverMoved) + { + /* Don't move the cursor the first time. This is the + jump-to-center initialization, and it's annoying. */ + neverMoved = FALSE; + return; + } + + if (quartzServerVisible) + { + int sx, sy; + + sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; + sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; + + CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y)); + } + + miPointerWarpCursor(pScreen, x, y); + miPointerUpdate(); +} + + +static miPointerScreenFuncRec quartzScreenFuncsRec = { + QuartzCursorOffScreen, + QuartzCrossScreen, + QuartzWarpCursor, + DarwinEQPointerPost, + DarwinEQSwitchScreen +}; + + +/* +=========================================================================== + + Other screen functions + +=========================================================================== +*/ + +/* + * QuartzCursorQueryBestSize + * Handle queries for best cursor size + */ +static void +QuartzCursorQueryBestSize(int class, unsigned short *width, + unsigned short *height, ScreenPtr pScreen) +{ + QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); + + if (class == CursorShape) + { + /* FIXME: query window server? */ + *width = 32; + *height = 32; + } + else + { + (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); + } +} + +/* + * QuartzInitCursor + * Initialize cursor support + */ +Bool +QuartzInitCursor(ScreenPtr pScreen) +{ + QuartzCursorScreenPtr ScreenPriv; + miPointerScreenPtr PointPriv; + + /* initialize software cursor handling (always needed as backup) */ + if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) + return FALSE; + + /* allocate private storage for this screen's QuickDraw cursor info */ + if (darwinCursorGeneration != serverGeneration) + { + if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + + darwinCursorGeneration = serverGeneration; + } + + ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec)); + if (ScreenPriv == NULL) + return FALSE; + + CURSOR_PRIV(pScreen) = ScreenPriv; + + /* override some screen procedures */ + ScreenPriv->QueryBestSize = pScreen->QueryBestSize; + pScreen->QueryBestSize = QuartzCursorQueryBestSize; + + PointPriv = (miPointerScreenPtr) pScreen->devPrivates[miPointerScreenIndex].ptr; + + ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &quartzSpriteFuncsRec; + + ScreenPriv->cursorVisible = TRUE; + return TRUE; +} + + +/* + * QuartzSuspendXCursor + * X server is hiding. Restore the Aqua cursor. + */ +void +QuartzSuspendXCursor(ScreenPtr pScreen) +{ +} + + +/* + * QuartzResumeXCursor + * X server is showing. Restore the X cursor. + */ +void +QuartzResumeXCursor(ScreenPtr pScreen, int x, int y) +{ + WindowPtr pWin; + CursorPtr pCursor; + + pWin = GetSpriteWindow(); + if (pWin->drawable.pScreen != pScreen) + return; + + pCursor = GetSpriteCursor(); + if (pCursor == NULL) + return; + + QuartzSetCursor(pScreen, pCursor, x, y); +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c:1.5 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c Wed Nov 26 20:59:53 2003 @@ -0,0 +1,481 @@ +/* + * Xplugin rootless implementation frame functions + */ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.5 2003/11/27 01:59:53 torrey Exp $ */ + +#include "xpr.h" +#include "rootlessCommon.h" +#include "Xplugin.h" +#include "x-hash.h" +#include "x-list.h" + +#include "propertyst.h" +#include "dix.h" +#include "Xatom.h" +#include "windowstr.h" + +#include + +#define DEFINE_ATOM_HELPER(func,atom_name) \ +static Atom func (void) { \ + static int generation; \ + static Atom atom; \ + if (generation != serverGeneration) { \ + generation = serverGeneration; \ + atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ + } \ + return atom; \ +} + +DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID") + +/* Maps xp_window_id -> RootlessWindowRec */ +static x_hash_table *window_hash; +static pthread_mutex_t window_hash_mutex; + +static Bool no_configure_window; + + +static inline xp_error +xprConfigureWindow(xp_window_id id, unsigned int mask, + const xp_window_changes *values) +{ + if (!no_configure_window) + return xp_configure_window(id, mask, values); + else + return XP_Success; +} + + +static void +xprSetNativeProperty(RootlessWindowPtr pFrame) +{ + xp_error err; + unsigned int native_id; + long data; + + err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id); + if (err == Success) + { + /* FIXME: move this to AppleWM extension */ + + data = native_id; + ChangeWindowProperty(pFrame->win, xa_native_window_id(), + XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE); + } +} + + +/* + * Create and display a new frame. + */ +Bool +xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, + int newX, int newY, RegionPtr pShape) +{ + WindowPtr pWin = pFrame->win; + xp_window_changes wc; + unsigned int mask = 0; + xp_error err; + + wc.x = newX; + wc.y = newY; + wc.width = pFrame->width; + wc.height = pFrame->height; + wc.bit_gravity = XP_GRAVITY_NONE; + mask |= XP_BOUNDS; + + if (pWin->drawable.depth == 8) + { + wc.depth = XP_DEPTH_INDEX8; +#if 0 + wc.colormap = xprColormapCallback; + wc.colormap_data = pScreen; + mask |= XP_COLORMAP; +#endif + } + else if (pWin->drawable.depth == 15) + wc.depth = XP_DEPTH_RGB555; + else if (pWin->drawable.depth == 24) + wc.depth = XP_DEPTH_ARGB8888; + else + wc.depth = XP_DEPTH_NIL; + mask |= XP_DEPTH; + + if (pShape != NULL) + { + wc.shape_nrects = REGION_NUM_RECTS(pShape); + wc.shape_rects = REGION_RECTS(pShape); + wc.shape_tx = wc.shape_ty = 0; + mask |= XP_SHAPE; + } + + err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid); + + if (err != Success) + { + return FALSE; + } + + if (window_hash == NULL) + { + window_hash = x_hash_table_new(NULL, NULL, NULL, NULL); + pthread_mutex_init(&window_hash_mutex, NULL); + } + + pthread_mutex_lock(&window_hash_mutex); + x_hash_table_insert(window_hash, pFrame->wid, pFrame); + pthread_mutex_unlock(&window_hash_mutex); + + xprSetNativeProperty(pFrame); + + return TRUE; +} + + +/* + * Destroy a frame. + */ +void +xprDestroyFrame(RootlessFrameID wid) +{ + pthread_mutex_lock(&window_hash_mutex); + x_hash_table_remove(window_hash, wid); + pthread_mutex_unlock(&window_hash_mutex); + + xp_destroy_window((xp_window_id) wid); +} + + +/* + * Move a frame on screen. + */ +void +xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) +{ + xp_window_changes wc; + + wc.x = newX; + wc.y = newY; + + xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc); +} + + +/* + * Resize and move a frame. + */ +void +xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, + int newX, int newY, unsigned int newW, unsigned int newH, + unsigned int gravity) +{ + xp_window_changes wc; + + wc.x = newX; + wc.y = newY; + wc.width = newW; + wc.height = newH; + wc.bit_gravity = gravity; + + /* It's unlikely that being async will save us anything here. + But it can't hurt. */ + + xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc); +} + + +/* + * Change frame stacking. + */ +void +xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) +{ + xp_window_changes wc; + + /* Stack frame below nextWid it if it exists, or raise + frame above everything otherwise. */ + + if (nextWid == NULL) + { + wc.stack_mode = XP_MAPPED_ABOVE; + wc.sibling = 0; + } + else + { + wc.stack_mode = XP_MAPPED_BELOW; + wc.sibling = (xp_window_id) nextWid; + } + + xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); +} + + +/* + * Change the frame's shape. + */ +void +xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) +{ + xp_window_changes wc; + + if (pShape != NULL) + { + wc.shape_nrects = REGION_NUM_RECTS(pShape); + wc.shape_rects = REGION_RECTS(pShape); + } + else + { + wc.shape_nrects = -1; + wc.shape_rects = NULL; + } + + wc.shape_tx = wc.shape_ty = 0; + + xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc); +} + + +/* + * Unmap a frame. + */ +void +xprUnmapFrame(RootlessFrameID wid) +{ + xp_window_changes wc; + + wc.stack_mode = XP_UNMAPPED; + wc.sibling = 0; + + xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); +} + + +/* + * Start drawing to a frame. + * Prepare for direct access to its backing buffer. + */ +void +xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) +{ + void *data[2]; + unsigned int rowbytes[2]; + xp_error err; + + err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL); + if (err != Success) + FatalError("Could not lock window %i for drawing.", (int) wid); + + *pixelData = data[0]; + *bytesPerRow = rowbytes[0]; +} + + +/* + * Stop drawing to a frame. + */ +void +xprStopDrawing(RootlessFrameID wid, Bool flush) +{ + xp_unlock_window((xp_window_id) wid, flush); +} + + +/* + * Flush drawing updates to the screen. + */ +void +xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) +{ + xp_flush_window((xp_window_id) wid); +} + + +/* + * Mark damaged rectangles as requiring redisplay to screen. + */ +void +xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, + int shift_x, int shift_y) +{ + xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y); +} + + +/* + * Called after the window associated with a frame has been switched + * to a new top-level parent. + */ +void +xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) +{ + DeleteProperty(oldWin, xa_native_window_id()); + + xprSetNativeProperty(pFrame); +} + + +/* + * Copy area in frame to another part of frame. + * Used to accelerate scrolling. + */ +void +xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, + int dx, int dy) +{ + xp_copy_window((xp_window_id) wid, (xp_window_id) wid, + dstNrects, dstRects, dx, dy); +} + + +static RootlessFrameProcsRec xprRootlessProcs = { + xprCreateFrame, + xprDestroyFrame, + xprMoveFrame, + xprResizeFrame, + xprRestackFrame, + xprReshapeFrame, + xprUnmapFrame, + xprStartDrawing, + xprStopDrawing, + xprUpdateRegion, + xprDamageRects, + xprSwitchWindow, + xp_copy_bytes, + xp_fill_bytes, + xp_composite_pixels, + xprCopyWindow +}; + + +/* + * Initialize XPR implementation + */ +Bool +xprInit(ScreenPtr pScreen) +{ + RootlessInit(pScreen, &xprRootlessProcs); + + rootless_CopyBytes_threshold = xp_copy_bytes_threshold; + rootless_FillBytes_threshold = xp_fill_bytes_threshold; + rootless_CompositePixels_threshold = xp_composite_area_threshold; + rootless_CopyWindow_threshold = xp_scroll_area_threshold; + + no_configure_window = FALSE; + + return TRUE; +} + + +/* + * Given the id of a physical window, try to find the top-level (or root) + * X window that it represents. + */ +static WindowPtr +xprGetXWindow(xp_window_id wid) +{ + RootlessWindowRec *winRec; + + if (window_hash == NULL) + return NULL; + + winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL); + + return winRec != NULL ? winRec->win : NULL; +} + + +/* + * The windowNumber is an AppKit window number. Returns TRUE if xpr is + * displaying a window with that number. + */ +Bool +xprIsX11Window(void *nsWindow, int windowNumber) +{ + Bool ret; + xp_window_id wid; + + if (window_hash == NULL) + return FALSE; + + /* need to lock, since this function can be called by any thread */ + + pthread_mutex_lock(&window_hash_mutex); + + if (xp_lookup_native_window(windowNumber, &wid)) + ret = xprGetXWindow(wid) != NULL; + else + ret = FALSE; + + pthread_mutex_unlock(&window_hash_mutex); + + return ret; +} + + +/* + * xprHideWindows + * Hide or unhide all top level windows. This is called for application hide/ + * unhide events if the window manager is not Apple-WM aware. Xplugin windows + * do not hide or unhide themselves. + */ +void +xprHideWindows(Bool hide) +{ + int screen; + WindowPtr pRoot, pWin; + + for (screen = 0; screen < screenInfo.numScreens; screen++) { + pRoot = WindowTable[screenInfo.screens[screen]->myNum]; + RootlessFrameID prevWid = NULL; + + for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) { + RootlessWindowRec *winRec = WINREC(pWin); + + if (winRec != NULL) { + if (hide) { + xprUnmapFrame(winRec->wid); + } else { + BoxRec box; + + xprRestackFrame(winRec->wid, prevWid); + prevWid = winRec->wid; + + box.x1 = 0; + box.y1 = 0; + box.x2 = winRec->width; + box.y2 = winRec->height; + + xprDamageRects(winRec->wid, 1, &box, 0, 0); + RootlessQueueRedisplay(screenInfo.screens[screen]); + } + } + } + } +} Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c diff -u /dev/null xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c:1.9 --- /dev/null Sat Feb 28 21:42:14 2004 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c Wed Nov 26 20:59:53 2003 @@ -0,0 +1,379 @@ +/* + * Xplugin rootless implementation screen functions + */ +/* + * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. + * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.9 2003/11/27 01:59:53 torrey Exp $ */ + +#include "quartzCommon.h" +#include "quartz.h" +#include "xpr.h" +#include "pseudoramiX.h" +#include "darwin.h" +#include "rootless.h" +#include "safeAlpha.h" +#include "dri.h" +#include "globals.h" +#include "Xplugin.h" +#include "applewmExt.h" + +// Name of GLX bundle for native OpenGL +static const char *xprOpenGLBundle = "glxCGL.bundle"; + + +/* + * eventHandler + * Callback handler for Xplugin events. + */ +static void +eventHandler(unsigned int type, const void *arg, + unsigned int arg_size, void *data) +{ + switch (type) + { + case XP_EVENT_DISPLAY_CHANGED: + QuartzMessageServerThread(kXDarwinDisplayChanged, 0); + break; + + case XP_EVENT_WINDOW_STATE_CHANGED: + if (arg_size >= sizeof(xp_window_state_event)) + { + const xp_window_state_event *ws_arg = arg; + QuartzMessageServerThread(kXDarwinWindowState, 2, + ws_arg->id, ws_arg->state); + } + break; + + case XP_EVENT_WINDOW_MOVED: + if (arg_size == sizeof(xp_window_id)) + { + xp_window_id id = * (xp_window_id *) arg; + + QuartzMessageServerThread(kXDarwinWindowMoved, 1, id); + } + break; + + case XP_EVENT_SURFACE_DESTROYED: + case XP_EVENT_SURFACE_CHANGED: + if (arg_size == sizeof(xp_surface_id)) + { + int kind; + + if (type == XP_EVENT_SURFACE_DESTROYED) + kind = AppleDRISurfaceNotifyDestroyed; + else + kind = AppleDRISurfaceNotifyChanged; + + DRISurfaceNotify(*(xp_surface_id *) arg, kind); + } + break; + } +} + + +/* + * displayScreenBounds + * Return the display ID for a particular display index. + */ +static CGDirectDisplayID +displayAtIndex(int index) +{ + CGError err; + CGDisplayCount cnt; + CGDirectDisplayID dpy[index+1]; + + err = CGGetActiveDisplayList(index + 1, dpy, &cnt); + if (err == kCGErrorSuccess && cnt == index + 1) + return dpy[index]; + else + return kCGNullDirectDisplay; +} + + +/* + * displayScreenBounds + * Return the bounds of a particular display. + */ +static CGRect +displayScreenBounds(CGDirectDisplayID id) +{ + CGRect frame; + + frame = CGDisplayBounds(id); + + /* Remove menubar to help standard X11 window managers. */ + + if (frame.origin.x == 0 && frame.origin.y == 0) + { + frame.origin.y += aquaMenuBarHeight; + frame.size.height -= aquaMenuBarHeight; + } + + return frame; +} + + +/* + * addPseudoramiXScreens + * Add a physical screen with PseudoramiX. + */ +static void +addPseudoramiXScreens(int *x, int *y, int *width, int *height) +{ + CGDisplayCount i, displayCount; + CGDirectDisplayID *displayList = NULL; + CGRect unionRect = CGRectNull, frame; + + // Find all the CoreGraphics displays + CGGetActiveDisplayList(0, NULL, &displayCount); + displayList = xalloc(displayCount * sizeof(CGDirectDisplayID)); + CGGetActiveDisplayList(displayCount, displayList, &displayCount); + + /* Get the union of all screens */ + for (i = 0; i < displayCount; i++) + { + CGDirectDisplayID dpy = displayList[i]; + frame = displayScreenBounds(dpy); + unionRect = CGRectUnion(unionRect, frame); + } + + /* Use unionRect as the screen size for the X server. */ + *x = unionRect.origin.x; + *y = unionRect.origin.y; + *width = unionRect.size.width; + *height = unionRect.size.height; + + /* Tell PseudoramiX about the real screens. */ + for (i = 0; i < displayCount; i++) + { + CGDirectDisplayID dpy = displayList[i]; + + frame = displayScreenBounds(dpy); + + ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, + (int)frame.size.width, (int)frame.size.height, + (int)frame.origin.x, (int)frame.origin.y); + + frame.origin.x -= unionRect.origin.x; + frame.origin.y -= unionRect.origin.y; + + ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", + i, (int)frame.origin.x, (int)frame.origin.y); + + PseudoramiXAddScreen(frame.origin.x, frame.origin.y, + frame.size.width, frame.size.height); + } + + xfree(displayList); +} + + +/* + * xprDisplayInit + * Find number of CoreGraphics displays and initialize Xplugin. + */ +static void +xprDisplayInit(void) +{ + CGDisplayCount displayCount; + + ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n"); + + CGGetActiveDisplayList(0, NULL, &displayCount); + + /* With PseudoramiX, the X server only sees one screen; only PseudoramiX + itself knows about all of the screens. */ + + if (noPseudoramiXExtension) + darwinScreensFound = displayCount; + else + darwinScreensFound = 1; + + if (xp_init(XP_IN_BACKGROUND) != Success) + { + FatalError("Could not initialize the Xplugin library."); + } + + xp_select_events(XP_EVENT_DISPLAY_CHANGED + | XP_EVENT_WINDOW_STATE_CHANGED + | XP_EVENT_WINDOW_MOVED + | XP_EVENT_SURFACE_CHANGED + | XP_EVENT_SURFACE_DESTROYED, + eventHandler, NULL); + + AppleDRIExtensionInit(); + xprAppleWMInit(); +} + + +/* + * xprAddScreen + * Init the framebuffer and record pixmap parameters for the screen. + */ +static Bool +xprAddScreen(int index, ScreenPtr pScreen) +{ + DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); + + /* If no specific depth chosen, look for the depth of the main display. + Else if 16bpp specified, use that. Else use 32bpp. */ + + dfb->colorType = TrueColor; + dfb->bitsPerComponent = 8; + dfb->bitsPerPixel = 32; + dfb->colorBitsPerPixel = 24; + + if (darwinDesiredDepth == -1) + { + dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay); + dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay); + dfb->colorBitsPerPixel = + CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * + dfb->bitsPerComponent; + } + else if (darwinDesiredDepth == 15) + { + dfb->bitsPerComponent = 5; + dfb->bitsPerPixel = 16; + dfb->colorBitsPerPixel = 15; + } + else if (darwinDesiredDepth == 8) + { + dfb->colorType = PseudoColor; + dfb->bitsPerComponent = 8; + dfb->bitsPerPixel = 8; + dfb->colorBitsPerPixel = 8; + } + + if (noPseudoramiXExtension) + { + CGDirectDisplayID dpy; + CGRect frame; + + dpy = displayAtIndex(index); + + frame = displayScreenBounds(dpy); + + dfb->x = frame.origin.x; + dfb->y = frame.origin.y; + dfb->width = frame.size.width; + dfb->height = frame.size.height; + } + else + { + addPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height); + } + + /* Passing zero width (pitch) makes miCreateScreenResources set the + screen pixmap to the framebuffer pointer, i.e. NULL. The generic + rootless code takes care of making this work. */ + dfb->pitch = 0; + dfb->framebuffer = NULL; + + DRIScreenInit(pScreen); + + return TRUE; +} + + +/* + * xprSetupScreen + * Setup the screen for rootless access. + */ +static Bool +xprSetupScreen(int index, ScreenPtr pScreen) +{ + // Add alpha protecting replacements for fb screen functions + pScreen->PaintWindowBackground = SafeAlphaPaintWindow; + pScreen->PaintWindowBorder = SafeAlphaPaintWindow; + +#ifdef RENDER + { + PictureScreenPtr ps = GetPictureScreen(pScreen); + ps->Composite = SafeAlphaComposite; + } +#endif /* RENDER */ + + // Initialize generic rootless code + if (!xprInit(pScreen)) + return FALSE; + + return DRIFinishScreenInit(pScreen); +} + + +/* + * xprInitInput + * Finalize xpr specific setup. + */ +static void +xprInitInput(int argc, char **argv) +{ + int i; + + rootlessGlobalOffsetX = darwinMainScreenX; + rootlessGlobalOffsetY = darwinMainScreenY; + + for (i = 0; i < screenInfo.numScreens; i++) + AppleWMSetScreenOrigin(WindowTable[i]); +} + + +/* + * Quartz display mode function list. + */ +static QuartzModeProcsRec xprModeProcs = { + xprDisplayInit, + xprAddScreen, + xprSetupScreen, + xprInitInput, + QuartzInitCursor, + NULL, // No need to update cursor + QuartzSuspendXCursor, + QuartzResumeXCursor, + NULL, // No capture or release in rootless mode + NULL, + xprIsX11Window, + xprHideWindows, + RootlessFrameForWindow, + TopLevelParent, + DRICreateSurface, + DRIDestroySurface +}; + + +/* + * QuartzModeBundleInit + * Initialize the display mode bundle after loading. + */ +Bool +QuartzModeBundleInit(void) +{ + quartzProcs = &xprModeProcs; + quartzOpenGLBundle = xprOpenGLBundle; + return TRUE; +} Index: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c diff -u xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c:1.1 xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c:1.1 Wed Mar 27 21:21:20 2002 +++ xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c Mon Nov 10 13:21:47 2003 @@ -3,7 +3,7 @@ * * Greg Parker gparker@cs.stanford.edu */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c,v 1.1 2002/03/28 02:21:20 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessCommon.c,v 1.2 2003/11/10 18:21:47 tsi Exp $ */ #include "rootlessCommon.h" @@ -131,7 +131,7 @@ if (wBoundingShape(pWin)) { // wBoundingShape is relative to *inner* origin of window. // Translate by borderWidth to get the outside-relative position. - REGION_INIT(pScreen, &newShape, NullBox, 0); + REGION_NULL(pScreen, &newShape); REGION_COPY(pScreen, &newShape, wBoundingShape(pWin)); REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth, pWin->borderWidth); Index: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c diff -u xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c:1.1 xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c:1.1 Wed Mar 27 21:21:20 2002 +++ xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c Mon Nov 10 13:21:48 2003 @@ -3,7 +3,7 @@ * * This file is very closely based on mivaltree.c. */ - /* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c,v 1.1 2002/03/28 02:21:20 torrey Exp $ */ + /* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessValTree.c,v 1.2 2003/11/10 18:21:48 tsi Exp $ */ /* * mivaltree.c -- @@ -292,9 +292,8 @@ } if (pChild->valdata) { - REGION_INIT(pScreen, - &pChild->valdata->after.borderExposed, - NullBox, 0); + REGION_NULL(pScreen, + &pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { REGION_SUBTRACT(pScreen, @@ -302,8 +301,7 @@ &pChild->borderClip, &pChild->winSize); } - REGION_INIT( pScreen, &pChild->valdata->after.exposed, - NullBox, 0); + REGION_NULL(pScreen, &pChild->valdata->after.exposed); } if (pChild->firstChild) { @@ -344,8 +342,8 @@ borderVisible = pParent->valdata->before.borderVisible; resized = pParent->valdata->before.resized; - REGION_INIT( pScreen, &pParent->valdata->after.borderExposed, NullBox, 0); - REGION_INIT( pScreen, &pParent->valdata->after.exposed, NullBox, 0); + REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); + REGION_NULL(pScreen, &pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do @@ -396,8 +394,8 @@ if ((pChild = pParent->firstChild) && pParent->mapped) { - REGION_INIT(pScreen, &childUniverse, NullBox, 0); - REGION_INIT(pScreen, &childUnion, NullBox, 0); + REGION_NULL(pScreen, &childUniverse); + REGION_NULL(pScreen, &childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) @@ -598,8 +596,8 @@ if (pChild == NullWindow) pChild = pRoot->firstChild; - REGION_INIT(pScreen, &childClip, NullBox, 0); - REGION_INIT(pScreen, &exposed, NullBox, 0); + REGION_NULL(pScreen, &childClip); + REGION_NULL(pScreen, &exposed); /* * compute the area of the parent window occupied @@ -607,7 +605,7 @@ * is the area which can be divied up among the marked * children in their new configuration. */ - REGION_INIT(pScreen, &totalClip, NullBox, 0); + REGION_NULL(pScreen, &totalClip); viewvals = 0; if (REGION_BROKEN (pScreen, &pRoot->clipList) && !REGION_BROKEN (pScreen, &pRoot->borderClip)) @@ -672,7 +670,7 @@ // calculate childUnion so we can subtract it from totalClip later - REGION_INIT(pScreen, &childUnion, NullBox, 0); + REGION_NULL(pScreen, &childUnion); if (kind != VTStack) { if (forward) { @@ -732,8 +730,8 @@ // REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion); REGION_UNINIT(pScreen, &childUnion); - REGION_INIT( pScreen, &pRoot->valdata->after.exposed, NullBox, 0); - REGION_INIT( pScreen, &pRoot->valdata->after.borderExposed, NullBox, 0); + REGION_NULL(pScreen, &pRoot->valdata->after.exposed); + REGION_NULL(pScreen, &pRoot->valdata->after.borderExposed); REGION_UNINIT( pScreen, &totalClip); Index: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c diff -u xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c:1.1 xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c:1.1 Wed Mar 27 21:21:20 2002 +++ xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c Mon Nov 10 13:21:48 2003 @@ -3,7 +3,7 @@ * * Greg Parker gparker@cs.stanford.edu */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c,v 1.1 2002/03/28 02:21:20 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz_1.3/rootlessWindow.c,v 1.2 2003/11/10 18:21:48 tsi Exp $ */ #include "rootlessCommon.h" #include "rootlessWindow.h" @@ -157,7 +157,7 @@ winRec->frame.win = pWin; winRec->frame.devPrivate = NULL; - REGION_INIT(pScreen, &winRec->damage, NullBox, 0); + REGION_NULL(pScreen, &winRec->damage); winRec->borderWidth = pWin->borderWidth; winRec->pixmap = NULL; @@ -331,7 +331,7 @@ dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); fbCopyRegion (&gResizeCopyWindowSource->drawable, @@ -371,7 +371,7 @@ dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); fbCopyRegion ((DrawablePtr)pWin, (DrawablePtr)pWin, Index: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c diff -u xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c:1.3 xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c:1.4 --- xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c:1.3 Tue Dec 5 16:18:34 2000 +++ xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c Sun Apr 13 10:52:51 2003 @@ -1,4 +1,4 @@ -// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $ +// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.4 2003/04/13 14:52:51 herrb Exp $ //============================================================================= // // Copyright (C) 1999,2000 by Eric Sunshine @@ -141,6 +141,7 @@ #include #include #include +#include #include #if !defined(DUMPKEYMAP_FILE_ONLY) #include Index: xc/programs/Xserver/hw/kdrive/Imakefile diff -u xc/programs/Xserver/hw/kdrive/Imakefile:1.8 xc/programs/Xserver/hw/kdrive/Imakefile:1.9 --- xc/programs/Xserver/hw/kdrive/Imakefile:1.8 Tue May 29 00:54:10 2001 +++ xc/programs/Xserver/hw/kdrive/Imakefile Wed Nov 12 14:10:32 2003 @@ -1,5 +1,5 @@ XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $ -XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/Imakefile,v 1.8 2001/05/29 04:54:10 keithp Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/Imakefile,v 1.9 2003/11/12 19:10:32 dawes Exp $ KDRIVE=. #include "Kdrive.tmpl" @@ -31,4 +31,5 @@ SpecialCObjectRule(kdrive,,$(EXT_DEFINES)) InstallManPage(Xkdrive,$(MANDIR)) +InstallManPageAliases(Xkdrive,$(MANDIR),TinyX) DependTarget() Index: xc/programs/Xserver/hw/kdrive/kaa.c diff -u xc/programs/Xserver/hw/kdrive/kaa.c:1.5 xc/programs/Xserver/hw/kdrive/kaa.c:1.6 --- xc/programs/Xserver/hw/kdrive/kaa.c:1.5 Fri Jun 29 09:55:53 2001 +++ xc/programs/Xserver/hw/kdrive/kaa.c Mon Nov 10 13:21:48 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/kdrive/kaa.c,v 1.5 2001/06/29 13:55:53 keithp Exp $ + * $XFree86: xc/programs/Xserver/hw/kdrive/kaa.c,v 1.6 2003/11/10 18:21:48 tsi Exp $ * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * @@ -532,7 +532,7 @@ dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); Index: xc/programs/Xserver/hw/kdrive/knoop.c diff -u xc/programs/Xserver/hw/kdrive/knoop.c:1.2 xc/programs/Xserver/hw/kdrive/knoop.c:1.3 --- xc/programs/Xserver/hw/kdrive/knoop.c:1.2 Wed Feb 23 15:29:55 2000 +++ xc/programs/Xserver/hw/kdrive/knoop.c Mon Nov 17 17:20:36 2003 @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/knoop.c,v 1.2 2000/02/23 20:29:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/knoop.c,v 1.3 2003/11/17 22:20:36 dawes Exp $ */ /* * GC ops that don't do anything @@ -31,18 +31,15 @@ #include typedef void (* typeFillSpans)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ -#endif ); typedef void (* typeSetSpans)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, char * /*psrc*/, @@ -50,11 +47,9 @@ int * /*pwidth*/, int /*nspans*/, int /*fSorted*/ -#endif ); typedef void (* typePutImage)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*depth*/, @@ -65,11 +60,9 @@ int /*leftPad*/, int /*format*/, char * /*pBits*/ -#endif ); typedef RegionPtr (* typeCopyArea)( -#if NeedNestedPrototypes DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, GCPtr /*pGC*/, @@ -79,11 +72,9 @@ int /*h*/, int /*dstx*/, int /*dsty*/ -#endif ); typedef RegionPtr (* typeCopyPlane)( -#if NeedNestedPrototypes DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr /*pGC*/, @@ -94,130 +85,104 @@ int /*dstx*/, int /*dsty*/, unsigned long /*bitPlane*/ -#endif ); typedef void (* typePolyPoint)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, DDXPointPtr /*pptInit*/ -#endif ); typedef void (* typePolylines)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, DDXPointPtr /*pptInit*/ -#endif ); typedef void (* typePolySegment)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nseg*/, xSegment * /*pSegs*/ -#endif ); typedef void (* typePolyRectangle)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nrects*/, xRectangle * /*pRects*/ -#endif ); typedef void (* typePolyArc)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*narcs*/, xArc * /*parcs*/ -#endif ); typedef void (* typeFillPolygon)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*shape*/, int /*mode*/, int /*count*/, DDXPointPtr /*pPts*/ -#endif ); typedef void (* typePolyFillRect)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nrectFill*/, xRectangle * /*prectInit*/ -#endif ); typedef void (* typePolyFillArc)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*narcs*/, xArc * /*parcs*/ -#endif ); typedef int (* typePolyText8)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, int /*y*/, int /*count*/, char * /*chars*/ -#endif ); typedef int (* typePolyText16)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, int /*y*/, int /*count*/, unsigned short * /*chars*/ -#endif ); typedef void (* typeImageText8)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, int /*y*/, int /*count*/, char * /*chars*/ -#endif ); typedef void (* typeImageText16)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, int /*y*/, int /*count*/, unsigned short * /*chars*/ -#endif ); typedef void (* typeImageGlyphBlt)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, @@ -225,11 +190,9 @@ unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, pointer /*pglyphBase*/ -#endif ); typedef void (* typePolyGlyphBlt)( -#if NeedNestedPrototypes DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, @@ -237,11 +200,9 @@ unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, pointer /*pglyphBase*/ -#endif ); typedef void (* typePushPixels)( -#if NeedNestedPrototypes GCPtr /*pGC*/, PixmapPtr /*pBitMap*/, DrawablePtr /*pDst*/, @@ -249,7 +210,6 @@ int /*h*/, int /*x*/, int /*y*/ -#endif ); RegionPtr Index: xc/programs/Xserver/hw/kdrive/kxv.c diff -u xc/programs/Xserver/hw/kdrive/kxv.c:1.4 xc/programs/Xserver/hw/kdrive/kxv.c:1.5 --- xc/programs/Xserver/hw/kdrive/kxv.c:1.4 Fri Sep 21 17:58:34 2001 +++ xc/programs/Xserver/hw/kdrive/kxv.c Mon Nov 10 13:21:48 2003 @@ -35,7 +35,7 @@ */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/kxv.c,v 1.4 2001/09/21 21:58:34 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kxv.c,v 1.5 2003/11/10 18:21:48 tsi Exp $ */ #include "kdrive.h" @@ -680,7 +680,7 @@ /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); /* that's all if it's totally obscured */ @@ -744,7 +744,7 @@ /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ @@ -833,7 +833,7 @@ /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ @@ -1349,7 +1349,7 @@ WinBox.y2 = WinBox.y1 + drw_h; REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { @@ -1502,7 +1502,7 @@ WinBox.y2 = WinBox.y1 + drw_h; REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->pDraw) { @@ -1650,7 +1650,7 @@ WinBox.y2 = WinBox.y1 + drw_h; REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); + REGION_NULL(pScreen, &ClipRegion); REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { Index: xc/programs/Xserver/hw/kdrive/i810/i810_video.c diff -u xc/programs/Xserver/hw/kdrive/i810/i810_video.c:1.1 xc/programs/Xserver/hw/kdrive/i810/i810_video.c:1.3 --- xc/programs/Xserver/hw/kdrive/i810/i810_video.c:1.1 Thu Mar 29 21:18:41 2001 +++ xc/programs/Xserver/hw/kdrive/i810/i810_video.c Mon Nov 10 13:21:49 2003 @@ -58,7 +58,7 @@ **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/kdrive/i810/i810_video.c,v 1.1 2001/03/30 02:18:41 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/i810/i810_video.c,v 1.3 2003/11/10 18:21:49 tsi Exp $ */ /* * i810_video.c: i810 KDrive Xv driver. @@ -419,7 +419,7 @@ pPriv->currentBuf = 0; /* gotta uninit this someplace */ - REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); + REGION_NULL(pScreen, &pPriv->clip); i810c->adaptor = adapt; @@ -436,36 +436,6 @@ } -static Bool -RegionsEqual(RegionPtr A, RegionPtr B) -{ - int *dataA, *dataB; - int num; - - num = REGION_NUM_RECTS(A); - if(num != REGION_NUM_RECTS(B)) - return FALSE; - - if((A->extents.x1 != B->extents.x1) || - (A->extents.x2 != B->extents.x2) || - (A->extents.y1 != B->extents.y1) || - (A->extents.y2 != B->extents.y2)) - return FALSE; - - dataA = (int*)REGION_RECTS(A); - dataB = (int*)REGION_RECTS(B); - - while(num--) { - if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - return FALSE; - dataA += 2; - dataB += 2; - } - - return TRUE; -} - - /* I810ClipVideo - Takes the dst box in standard X BoxRec form (top and left @@ -1056,8 +1026,8 @@ } /* update cliplist */ - if(!RegionsEqual(&pPriv->clip, clipBoxes)) { - REGION_COPY(pScreen, &pPriv->clip, clipBoxes); + if(!REGION_EQUAL(screen->pScreen, &pPriv->clip, clipBoxes)) { + REGION_COPY(screen->pScreen, &pPriv->clip, clipBoxes); i810FillBoxSolid(screen, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes), pPriv->colorKey, GXcopy, ~0); Index: xc/programs/Xserver/hw/kdrive/igs/igsdraw.c diff -u xc/programs/Xserver/hw/kdrive/igs/igsdraw.c:1.3 xc/programs/Xserver/hw/kdrive/igs/igsdraw.c:1.4 --- xc/programs/Xserver/hw/kdrive/igs/igsdraw.c:1.3 Tue May 29 00:54:11 2001 +++ xc/programs/Xserver/hw/kdrive/igs/igsdraw.c Mon Nov 10 13:21:50 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/kdrive/igs/igsdraw.c,v 1.3 2001/05/29 04:54:11 keithp Exp $ + * $XFree86: xc/programs/Xserver/hw/kdrive/igs/igsdraw.c,v 1.4 2003/11/10 18:21:50 tsi Exp $ * * Copyright © 2000 Keith Packard * @@ -1358,7 +1358,7 @@ dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); Index: xc/programs/Xserver/hw/kdrive/mach64/mach64video.c diff -u xc/programs/Xserver/hw/kdrive/mach64/mach64video.c:1.9 xc/programs/Xserver/hw/kdrive/mach64/mach64video.c:1.11 --- xc/programs/Xserver/hw/kdrive/mach64/mach64video.c:1.9 Fri Oct 18 02:00:29 2002 +++ xc/programs/Xserver/hw/kdrive/mach64/mach64video.c Mon Nov 10 13:21:52 2003 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/mach64/mach64video.c,v 1.9 2002/10/18 06:00:29 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/mach64/mach64video.c,v 1.11 2003/11/10 18:21:52 tsi Exp $ */ #include "mach64.h" #include "Xv.h" @@ -330,36 +330,6 @@ } } -/* I really should stick this in miregion */ -static Bool -RegionsEqual(RegionPtr A, RegionPtr B) -{ - int *dataA, *dataB; - int num; - - num = REGION_NUM_RECTS(A); - if(num != REGION_NUM_RECTS(B)) - return FALSE; - - if((A->extents.x1 != B->extents.x1) || - (A->extents.x2 != B->extents.x2) || - (A->extents.y1 != B->extents.y1) || - (A->extents.y2 != B->extents.y2)) - return FALSE; - - dataA = (int*)REGION_RECTS(A); - dataB = (int*)REGION_RECTS(B); - - while(num--) { - if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - return FALSE; - dataA += 2; - dataB += 2; - } - - return TRUE; -} - static void mach64PaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg) { @@ -786,7 +756,7 @@ rot_src_w, rot_src_h, rot_drw_w, rot_drw_h); /* update cliplist */ - if (!RegionsEqual (&pPortPriv->clip, clipBoxes)) + if (!REGION_EQUAL (screen->pScreen, &pPortPriv->clip, clipBoxes)) { REGION_COPY (screen->pScreen, &pPortPriv->clip, clipBoxes); mach64PaintRegion (screen->pScreen, &pPortPriv->clip, pPortPriv->colorKey); @@ -919,7 +889,7 @@ pOldExtents->y2 == pNewExtents->y2) { /* update cliplist */ - if (!RegionsEqual (&pPortPriv->clip, clipBoxes)) + if (!REGION_EQUAL (screen->pScreen, &pPortPriv->clip, clipBoxes)) { REGION_COPY (screen->pScreen, &pPortPriv->clip, clipBoxes); mach64PaintRegion (screen->pScreen, &pPortPriv->clip, pPortPriv->colorKey); @@ -981,7 +951,7 @@ pPortPriv->currentBuf = 0; /* gotta uninit this someplace */ - REGION_INIT(pScreen, &pPortPriv->clip, NullBox, 0); + REGION_NULL(pScreen, &pPortPriv->clip); mach64s->pAdaptor = adapt; Index: xc/programs/Xserver/hw/kdrive/savage/s3.c diff -u xc/programs/Xserver/hw/kdrive/savage/s3.c:1.6 xc/programs/Xserver/hw/kdrive/savage/s3.c:1.7 --- xc/programs/Xserver/hw/kdrive/savage/s3.c:1.6 Sun Sep 3 01:11:18 2000 +++ xc/programs/Xserver/hw/kdrive/savage/s3.c Mon Nov 10 13:22:03 2003 @@ -22,7 +22,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/savage/s3.c,v 1.6 2000/09/03 05:11:18 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/savage/s3.c,v 1.7 2003/11/10 18:22:03 tsi Exp $ */ #include "s3.h" @@ -341,7 +341,7 @@ screen->fb[fb].frameBuffer = s3c->frameBuffer + screen_size; screen_size += screen->fb[fb].byteStride * screen->height; - REGION_INIT(pScreen, (&s3s->region[fb]), NullBox, 0); + REGION_NULL(pScreen, (&s3s->region[fb])); if (screen->fb[fb].bitsPerPixel == 8) s3s->fb[ma].chroma_key = 0xff; else Index: xc/programs/Xserver/hw/kdrive/savage/s3draw.c diff -u xc/programs/Xserver/hw/kdrive/savage/s3draw.c:1.7 xc/programs/Xserver/hw/kdrive/savage/s3draw.c:1.8 --- xc/programs/Xserver/hw/kdrive/savage/s3draw.c:1.7 Wed Oct 24 16:14:52 2001 +++ xc/programs/Xserver/hw/kdrive/savage/s3draw.c Mon Nov 10 13:22:07 2003 @@ -22,7 +22,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/savage/s3draw.c,v 1.7 2001/10/24 20:14:52 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/savage/s3draw.c,v 1.8 2003/11/10 18:22:07 tsi Exp $ */ #include "s3.h" #include "s3draw.h" @@ -2425,7 +2425,7 @@ REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); Index: xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c diff -u xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c:1.6 xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c:1.7 --- xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c:1.6 Tue May 29 00:54:12 2001 +++ xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c Mon Nov 10 13:22:08 2003 @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c,v 1.6 2001/05/29 04:54:12 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/sis530/sisdraw.c,v 1.7 2003/11/10 18:22:08 tsi Exp $ */ #include "sis.h" #include "sisdraw.h" @@ -1529,7 +1529,7 @@ dy = ptOldOrg.y - pWin->drawable.y; REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); Index: xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man diff -u xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man:1.6 xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man:1.7 --- xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man:1.6 Sat Jan 27 13:20:40 2001 +++ xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man Fri Oct 31 23:49:15 2003 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man,v 1.6 2001/01/27 18:20:40 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/kdrive/vesa/Xvesa.man,v 1.7 2003/11/01 04:49:15 dawes Exp $ .TH Xvesa 1 __vendorversion__ .SH NAME Xvesa \- VESA Bios Extensions tiny X server @@ -15,6 +15,7 @@ .B Xvesa can use both standard VGA BIOS modes and any modes advertised by a VESA BIOS if available. + .B Xvesa runs untrusted code with full privileges, and is therefore a fairly insecure X server. @@ -29,8 +30,8 @@ .I n is not supported by your BIOS and hardware, .B Xvesa -will fail, hang your system, or cause your monitor to explode; you are -on your own. This option overrides any +will fail, hang your system, damage your hardware, or cause a global +thermonuclear war; you are on your own. This option overrides any .B -screen options. .TP 8 @@ -60,10 +61,24 @@ pass RGB values in the order that works on broken BIOSes. Use this if the colours are wrong in PseudoColor and 16 colour modes. .TP 8 +.B -map-holes +use a contiguous (hole-less) memory map. This fixes a segmentation +violation with some rare BIOSes that violate the VESA specification, +but may cause slightly higher memory usage on systems that overcommit +memory. +.TP 8 .B -verbose emit diagnostic messages during BIOS initialization and teardown. .SH KEYBOARD -To be written. +Multiple key presses recognized directly by +.B Xvesa +are: +.TP 8 +.B Ctrl+Alt+Backspace +Immediately kill the server. +.TP 8 +.B Ctrl+Alt+F1...F12 +Switch to virtual console 1 through 12. .SH BUGS .B Xvesa opens all IO ports and runs your VESA BIOS, which may be assumed to be Index: xc/programs/Xserver/hw/kdrive/vesa/vesa.c diff -u xc/programs/Xserver/hw/kdrive/vesa/vesa.c:1.21 xc/programs/Xserver/hw/kdrive/vesa/vesa.c:1.22 --- xc/programs/Xserver/hw/kdrive/vesa/vesa.c:1.21 Mon Oct 14 14:01:42 2002 +++ xc/programs/Xserver/hw/kdrive/vesa/vesa.c Fri Oct 31 23:49:15 2003 @@ -19,7 +19,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesa.c,v 1.21 2002/10/14 18:01:42 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesa.c,v 1.22 2003/11/01 04:49:15 dawes Exp $ */ #include "vesa.h" #ifdef RANDR @@ -34,6 +34,7 @@ Bool vesa_restore = FALSE; Bool vesa_verbose = FALSE; Bool vesa_force_text = FALSE; +Bool vesa_map_holes = FALSE; #define VesaPriv(scr) ((VesaScreenPrivPtr) (scr)->driver) @@ -198,7 +199,7 @@ { int code; - priv->vi = Vm86Setup(); + priv->vi = Vm86Setup(vesa_map_holes); if(!priv->vi) goto fail; @@ -227,7 +228,7 @@ int nmode; int n; - vi = Vm86Setup (); + vi = Vm86Setup (vesa_map_holes); if (!vi) { ErrorF ("Can't setup vm86\n"); @@ -1786,6 +1787,9 @@ } else if(!strcmp(argv[i], "-force-text")) { vesa_force_text = TRUE; return 1; + } else if(!strcmp(argv[i], "-map-holes")) { + vesa_map_holes = TRUE; + return 1; } return 0; Index: xc/programs/Xserver/hw/kdrive/vesa/vm86.c diff -u xc/programs/Xserver/hw/kdrive/vesa/vm86.c:1.3 xc/programs/Xserver/hw/kdrive/vesa/vm86.c:1.4 --- xc/programs/Xserver/hw/kdrive/vesa/vm86.c:1.3 Tue Jun 4 18:19:58 2002 +++ xc/programs/Xserver/hw/kdrive/vesa/vm86.c Fri Oct 31 23:49:15 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vm86.c,v 1.3 2002/06/04 22:19:58 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vm86.c,v 1.4 2003/11/01 04:49:15 dawes Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -63,10 +63,11 @@ { 0xCD, 0xFF }; Vm86InfoPtr -Vm86Setup(void) +Vm86Setup(int mapHoles) { int devmem = -1, devzero = -1; void *magicMem, *loMem, *hiMem; + void *hole1, *hole2; U32 stack_base, ret_code; Vm86InfoPtr vi = NULL; @@ -82,6 +83,12 @@ goto fail; } + magicMem = MAP_FAILED; + loMem = MAP_FAILED; + hiMem = MAP_FAILED; + hole1 = MAP_FAILED; + hole2 = MAP_FAILED; + magicMem = mmap((void*)MAGICMEM_BASE, MAGICMEM_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, @@ -89,7 +96,18 @@ if(magicMem == MAP_FAILED) { ErrorF("Couldn't map magic memory\n"); - goto fail; + goto unmapfail; + } + + if(mapHoles) { + hole1 = mmap((void*)HOLE1_BASE, HOLE1_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_FIXED, devzero, HOLE1_BASE); + + if(hole1 == MAP_FAILED) { + ErrorF("Couldn't map first hole\n"); + goto unmapfail; + } } loMem = mmap((void*)LOMEM_BASE, LOMEM_SIZE, @@ -98,7 +116,18 @@ if(loMem == MAP_FAILED) { ErrorF("Couldn't map low memory\n"); munmap(magicMem, MAGICMEM_SIZE); - goto fail; + goto unmapfail; + } + + if(mapHoles) { + hole2 = mmap((void*)HOLE2_BASE, HOLE2_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_FIXED, devzero, HOLE2_BASE); + + if(hole2 == MAP_FAILED) { + ErrorF("Couldn't map first hole\n"); + goto unmapfail; + } } hiMem = mmap((void*)HIMEM_BASE, HIMEM_SIZE, @@ -107,9 +136,7 @@ devmem, HIMEM_BASE); if(hiMem == MAP_FAILED) { ErrorF("Couldn't map high memory\n"); - munmap(magicMem, MAGICMEM_SIZE); - munmap(loMem, LOMEM_SIZE); - goto fail; + goto unmapfail; } vi = xalloc(sizeof(Vm86InfoRec)); @@ -117,7 +144,9 @@ goto unmapfail; vi->magicMem = magicMem; + vi->hole1 = hole1; vi->loMem = loMem; + vi->hole2 = hole2; vi->hiMem = hiMem; vi->brk = LOMEM_BASE; @@ -147,9 +176,11 @@ return vi; unmapfail: - munmap(magicMem, MAGICMEM_SIZE); - munmap(loMem, LOMEM_SIZE); - munmap(hiMem, HIMEM_SIZE); + if(magicMem != MAP_FAILED) munmap(magicMem, MAGICMEM_SIZE); + if(hole1 != MAP_FAILED) munmap(magicMem, HOLE1_SIZE); + if(loMem != MAP_FAILED) munmap(loMem, LOMEM_SIZE); + if(hole2 != MAP_FAILED) munmap(magicMem, HOLE2_SIZE); + if(hiMem != MAP_FAILED) munmap(hiMem, HIMEM_SIZE); fail: if(devmem >= 0) close(devmem); @@ -163,9 +194,11 @@ void Vm86Cleanup(Vm86InfoPtr vi) { - munmap(vi->magicMem, MAGICMEM_SIZE); - munmap(vi->loMem, LOMEM_SIZE); - munmap(vi->hiMem, HIMEM_SIZE); + if(vi->magicMem != MAP_FAILED) munmap(vi->magicMem, MAGICMEM_SIZE); + if(vi->hole1 != MAP_FAILED) munmap(vi->magicMem, HOLE1_SIZE); + if(vi->loMem != MAP_FAILED) munmap(vi->loMem, LOMEM_SIZE); + if(vi->hole2 != MAP_FAILED) munmap(vi->magicMem, HOLE2_SIZE); + if(vi->hiMem != MAP_FAILED) munmap(vi->hiMem, HIMEM_SIZE); xfree(vi); } Index: xc/programs/Xserver/hw/kdrive/vesa/vm86.h diff -u xc/programs/Xserver/hw/kdrive/vesa/vm86.h:1.1 xc/programs/Xserver/hw/kdrive/vesa/vm86.h:1.2 --- xc/programs/Xserver/hw/kdrive/vesa/vm86.h:1.1 Thu Oct 19 20:19:51 2000 +++ xc/programs/Xserver/hw/kdrive/vesa/vm86.h Fri Oct 31 23:49:15 2003 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vm86.h,v 1.1 2000/10/20 00:19:51 keithp Exp $ + * $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vm86.h,v 1.2 2003/11/01 04:49:15 dawes Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -91,6 +91,12 @@ #define HIMEM_BASE 0xA0000 #define HIMEM_SIZE (SYSMEM_BASE + SYSMEM_SIZE - HIMEM_BASE) +#define HOLE1_BASE (MAGICMEM_BASE + MAGICMEM_SIZE) +#define HOLE1_SIZE (LOMEM_BASE - HOLE1_BASE) + +#define HOLE2_BASE (LOMEM_BASE + LOMEM_SIZE) +#define HOLE2_SIZE (HIMEM_BASE - HOLE2_BASE) + /* The BIOS ROM */ #define ROM_BASE 0xC0000 #define ROM_SIZE 0x30000 @@ -105,6 +111,7 @@ typedef struct _Vm86InfoRec { void *magicMem, *loMem, *hiMem; + void *hole1, *hole2; U32 brk; struct vm86_struct vms; U32 ret_code, stack_base; @@ -121,7 +128,7 @@ #define HML(vi,i) (*(U32*)(&MM(vi,i))) Vm86InfoPtr -Vm86Setup(void); +Vm86Setup(int); void Vm86Cleanup(Vm86InfoPtr vi); Index: xc/programs/Xserver/hw/sun/constype.c diff -u xc/programs/Xserver/hw/sun/constype.c:3.7 xc/programs/Xserver/hw/sun/constype.c:3.9 --- xc/programs/Xserver/hw/sun/constype.c:3.7 Sat Oct 27 23:33:10 2001 +++ xc/programs/Xserver/hw/sun/constype.c Fri Nov 21 00:17:01 2003 @@ -17,7 +17,7 @@ * * Author: Doug Moran, SRI */ -/* $XFree86: xc/programs/Xserver/hw/sun/constype.c,v 3.7 2001/10/28 03:33:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/constype.c,v 3.9 2003/11/21 05:17:01 dawes Exp $ */ /* SUN-SPOTS DIGEST Thursday, 17 March 1988 Volume 6 : Issue 31 @@ -39,10 +39,10 @@ style. */ #include -#if defined(SVR4) || defined(__bsdi__) +#if defined(SVR4) || defined(CSRG_BASED) #include #else -/* NetBSD seemingly still uses and naturally SunOS does */ +/* SunOS */ #include #endif #include @@ -80,6 +80,10 @@ #if defined(SVR4) || defined(__bsdi__) #include #include +#if defined(SVR4) && defined(sun) +/* VIS_GETIDENTIFIER ioctl added in Solaris 2.3 */ +#include +#endif #else #ifndef CSRG_BASED #include @@ -146,15 +150,35 @@ { struct fbgattr fbattr; int fd, ioctl_ret; +#ifdef VIS_GETIDENTIFIER + int vistype; + char *visname = NULL; + struct vis_identifier fbid; +#endif + if ( (fd = open(devname, O_RDWR, 0)) == -1 ) { *fbname = "unable to open fb"; return 2; } + +#ifdef VIS_GETIDENTIFIER + if ((vistype = ioctl(fd, VIS_GETIDENTIFIER, &fbid)) >= 0) { + visname = fbid.name; + } +#endif + /* FBIOGATTR fails for early frame buffer types */ - if ((ioctl_ret = ioctl(fd,FBIOGATTR,&fbattr))) /*success=>0(false)*/ + if ((ioctl_ret = ioctl(fd,FBIOGATTR,&fbattr))<0) /*success=>0(false)*/ ioctl_ret = ioctl(fd, FBIOGTYPE, &fbattr.fbtype); close(fd); if ( ioctl_ret == -1 ) { +#ifdef VIS_GETIDENTIFIER + if (visname != NULL) { + *fbname = visname; + *fbtype = vistype; + return 0; + } +#endif *fbname = "ioctl on fb failed"; return 2; } @@ -167,6 +191,13 @@ *fbname = "tcx"; return 0; } else { +#ifdef VIS_GETIDENTIFIER + if (visname != NULL) { + *fbname = visname; + *fbtype = vistype; + return 0; + } +#endif *fbname = "unk"; return 1; } @@ -175,6 +206,13 @@ * have entries for some of the values returned by the ioctl. * Compare to the entries in "decode_fb" */ if ( decode_fb[fbattr.fbtype.fb_type] == NULL ) { +#ifdef VIS_GETIDENTIFIER + if (visname != NULL) { + *fbname = visname; + *fbtype = vistype; + return 0; + } +#endif *fbname = "unk"; return 1; } Index: xc/programs/Xserver/hw/sun/kbd_mode.c diff -u xc/programs/Xserver/hw/sun/kbd_mode.c:3.11 xc/programs/Xserver/hw/sun/kbd_mode.c:3.12 --- xc/programs/Xserver/hw/sun/kbd_mode.c:3.11 Wed Oct 23 12:23:36 2002 +++ xc/programs/Xserver/hw/sun/kbd_mode.c Tue Oct 7 17:39:43 2003 @@ -27,7 +27,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.11 2002/10/23 16:23:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.12 2003/10/07 21:39:43 herrb Exp $ */ /* static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13"; @@ -65,7 +65,8 @@ #include #include -static void die(), usage(); +static void die(char*); +static void usage(void); static int kbd_fd; int @@ -125,15 +126,14 @@ } static void -die(msg) - char *msg; +die(char *msg) { fprintf(stderr, "%s\n", msg); exit(1); } static void -usage() +usage(void) { int translate; Index: xc/programs/Xserver/hw/sun/sun.h diff -u xc/programs/Xserver/hw/sun/sun.h:3.12 xc/programs/Xserver/hw/sun/sun.h:3.13 --- xc/programs/Xserver/hw/sun/sun.h:3.12 Wed Jul 25 11:05:01 2001 +++ xc/programs/Xserver/hw/sun/sun.h Mon Nov 17 17:20:36 2003 @@ -13,7 +13,7 @@ * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sun.h,v 3.12 2001/07/25 15:05:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sun.h,v 3.13 2003/11/17 22:20:36 dawes Exp $ */ #ifndef _SUN_H_ #define _SUN_H_ @@ -264,12 +264,10 @@ } fbFd; typedef Bool (*sunFbInitProc)( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); typedef struct { @@ -296,76 +294,55 @@ extern int* sunProtected; extern Bool sunCursorInitialize( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern void sunDisableCursor( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern int sunChangeKbdTranslation( -#if NeedFunctionPrototypes int /* fd */, Bool /* makeTranslated */ -#endif ); extern void sunNonBlockConsoleOff( -#if NeedFunctionPrototypes #if defined(SVR4) || defined(CSRG_BASED) void #else char* /* arg */ #endif -#endif ); extern void sunEnqueueEvents( -#if NeedFunctionPrototypes void -#endif ); extern int sunGXInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, fbFd* /* fb */ -#endif ); extern Bool sunSaveScreen( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, int /* on */ -#endif ); extern Bool sunScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern pointer sunMemoryMap( -#if NeedFunctionPrototypes size_t /* len */, off_t /* off */, int /* fd */ -#endif ); extern Bool sunScreenAllocate( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern Bool sunInitCommon( -#if NeedFunctionPrototypes int /* scrn */, ScreenPtr /* pScrn */, off_t /* offset */, @@ -374,59 +351,44 @@ Bool (* /* cr_cm */)(), Bool (* /* save */)(), int /* fb_off */ -#endif ); extern Firm_event* sunKbdGetEvents( -#if NeedFunctionPrototypes int /* fd */, Bool /* on */, int* /* pNumEvents */, Bool* /* pAgain */ -#endif ); extern Firm_event* sunMouseGetEvents( -#if NeedFunctionPrototypes int /* fd */, Bool /* on */, int* /* pNumEvents */, Bool* /* pAgain */ -#endif ); extern void sunKbdEnqueueEvent( -#if NeedFunctionPrototypes DeviceIntPtr /* device */, Firm_event* /* fe */ -#endif ); extern void sunMouseEnqueueEvent( -#if NeedFunctionPrototypes DeviceIntPtr /* device */, Firm_event* /* fe */ -#endif ); extern int sunKbdProc( -#if NeedFunctionPrototypes DeviceIntPtr /* pKeyboard */, int /* what */ -#endif ); extern int sunMouseProc( -#if NeedFunctionPrototypes DeviceIntPtr /* pMouse */, int /* what */ -#endif ); extern void sunKbdWait( -#if NeedFunctionPrototypes void -#endif ); /*- @@ -436,7 +398,6 @@ #define TVTOMILLI(tv) (((tv).tv_usec/1000)+((tv).tv_sec*1000)) extern Bool sunCfbSetupScreen( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -445,11 +406,9 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern Bool sunCfbFinishScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -458,11 +417,9 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern Bool sunCfbScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -471,26 +428,19 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern void sunInstallColormap( -#if NeedFunctionPrototypes ColormapPtr /* cmap */ -#endif ); extern void sunUninstallColormap( -#if NeedFunctionPrototypes ColormapPtr /* cmap */ -#endif ); extern int sunListInstalledColormaps( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, Colormap* /* pCmapList */ -#endif ); #endif Index: xc/programs/Xserver/hw/sun/sunCfb.c diff -u xc/programs/Xserver/hw/sun/sunCfb.c:3.14 xc/programs/Xserver/hw/sun/sunCfb.c:3.15 --- xc/programs/Xserver/hw/sun/sunCfb.c:3.14 Fri Dec 14 14:59:42 2001 +++ xc/programs/Xserver/hw/sun/sunCfb.c Tue Oct 7 17:43:09 2003 @@ -54,7 +54,7 @@ ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb.c,v 3.14 2001/12/14 19:59:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb.c,v 3.15 2003/10/07 21:43:09 herrb Exp $ */ /* * Copyright 1987 by the Regents of the University of California @@ -373,6 +373,7 @@ if (on != SCREEN_SAVER_FORCER) regp->video_enab = (on == SCREEN_SAVER_ON) ? 0 : 1; + return TRUE; } static void CG2ScreenInit (pScreen) @@ -390,7 +391,6 @@ int argc; /* The number of the Server's arguments. */ char** argv; /* The arguments themselves. Don't change! */ { - sunScreenPtr pPrivate; int i; Bool ret; Bool mono = FALSE; Index: xc/programs/Xserver/hw/sun/sunCursor.c diff -u xc/programs/Xserver/hw/sun/sunCursor.c:3.5 xc/programs/Xserver/hw/sun/sunCursor.c:3.6 --- xc/programs/Xserver/hw/sun/sunCursor.c:3.5 Fri Dec 14 14:59:43 2001 +++ xc/programs/Xserver/hw/sun/sunCursor.c Mon Nov 17 17:20:36 2003 @@ -27,7 +27,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunCursor.c,v 3.5 2001/12/14 19:59:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunCursor.c,v 3.6 2003/11/17 22:20:36 dawes Exp $ */ /*- * sunCursor.c -- @@ -235,13 +235,8 @@ #endif -#if NeedFunctionPrototypes Bool sunCursorInitialize ( ScreenPtr pScreen) -#else -Bool sunCursorInitialize (pScreen) - ScreenPtr pScreen; -#endif { #ifdef FBIOGCURMAX SetupCursor (pScreen); @@ -269,13 +264,8 @@ #endif } -#if NeedFunctionPrototypes void sunDisableCursor ( ScreenPtr pScreen) -#else -void sunDisableCursor (pScreen) - ScreenPtr pScreen; -#endif { #ifdef FBIOGCURMAX SetupCursor (pScreen); Index: xc/programs/Xserver/hw/sun/sunFbs.c diff -u xc/programs/Xserver/hw/sun/sunFbs.c:1.7 xc/programs/Xserver/hw/sun/sunFbs.c:1.8 --- xc/programs/Xserver/hw/sun/sunFbs.c:1.7 Thu Dec 5 19:28:50 2002 +++ xc/programs/Xserver/hw/sun/sunFbs.c Mon Nov 17 17:20:36 2003 @@ -67,7 +67,7 @@ * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunFbs.c,v 1.7 2002/12/06 00:28:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunFbs.c,v 1.8 2003/11/17 22:20:36 dawes Exp $ */ /****************************************************************/ /* Modified from sunCG4C.c for X11R3 by Tom Jarmolowski */ @@ -80,17 +80,10 @@ static unsigned long generation = 0; -#if NeedFunctionPrototypes pointer sunMemoryMap ( size_t len, off_t off, int fd) -#else -pointer sunMemoryMap (len, off, fd) - size_t len; - off_t off; - int fd; -#endif { int pagemask, mapsize; caddr_t addr; @@ -135,13 +128,8 @@ return mapaddr; } -#if NeedFunctionPrototypes Bool sunScreenAllocate ( ScreenPtr pScreen) -#else -Bool sunScreenAllocate (pScreen) - ScreenPtr pScreen; -#endif { sunScreenPtr pPrivate; extern int AllocateScreenPrivateIndex(); @@ -161,15 +149,9 @@ return TRUE; } -#if NeedFunctionPrototypes Bool sunSaveScreen ( ScreenPtr pScreen, int on) -#else -Bool sunSaveScreen (pScreen, on) - ScreenPtr pScreen; - int on; -#endif { int state; @@ -200,13 +182,8 @@ return ret; } -#if NeedFunctionPrototypes Bool sunScreenInit ( ScreenPtr pScreen) -#else -Bool sunScreenInit (pScreen) - ScreenPtr pScreen; -#endif { SetupScreen(pScreen); extern void sunBlockHandler(); @@ -241,7 +218,6 @@ return TRUE; } -#if NeedFunctionPrototypes Bool sunInitCommon ( int scrn, ScreenPtr pScrn, @@ -251,17 +227,6 @@ Bool (*cr_cm)(), Bool (*save)(), int fb_off) -#else -Bool sunInitCommon (scrn, pScrn, offset, init1, init2, cr_cm, save, fb_off) - int scrn; - ScreenPtr pScrn; - off_t offset; - Bool (*init1)(); - void (*init2)(); - Bool (*cr_cm)(); - Bool (*save)(); - int fb_off; -#endif { unsigned char* fb = sunFbs[scrn].fb; Index: xc/programs/Xserver/hw/sun/sunGX.c diff -u xc/programs/Xserver/hw/sun/sunGX.c:1.7 xc/programs/Xserver/hw/sun/sunGX.c:1.9 --- xc/programs/Xserver/hw/sun/sunGX.c:1.7 Fri Dec 14 14:59:43 2001 +++ xc/programs/Xserver/hw/sun/sunGX.c Mon Nov 17 17:20:36 2003 @@ -27,7 +27,7 @@ * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.c,v 1.7 2001/12/14 19:59:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.c,v 1.9 2003/11/17 22:20:36 dawes Exp $ */ #include "sun.h" @@ -576,7 +576,7 @@ pGC->alu = InverseAlu[pGC->alu]; else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel); - ret = cfbBitBlt (pSrcDrawable, pDstDrawable, + ret = cfbCopyPlaneReduce (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, cfbCopyPlane8to1, bitPlane); pGC->alu = oldalu; } @@ -602,7 +602,7 @@ */ ValidateGC ((DrawablePtr) pBitmap, pGC1); /* no exposures here, scratch GC's don't get graphics expose */ - (void) cfbBitBlt (pSrcDrawable, (DrawablePtr) pBitmap, + (void) cfbCopyPlaneReduce (pSrcDrawable, (DrawablePtr) pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); copyPlaneFG = pGC->fgPixel; copyPlaneBG = pGC->bgPixel; @@ -2845,15 +2845,9 @@ } Bool -#if NeedFunctionPrototypes sunGXInit ( ScreenPtr pScreen, fbFd *fb) -#else -sunGXInit (pScreen, fb) - ScreenPtr pScreen; - fbFd *fb; -#endif { sunGXPtr gx; Uint mode; Index: xc/programs/Xserver/hw/sun/sunInit.c diff -u xc/programs/Xserver/hw/sun/sunInit.c:3.12 xc/programs/Xserver/hw/sun/sunInit.c:3.13 --- xc/programs/Xserver/hw/sun/sunInit.c:3.12 Thu Dec 5 21:11:44 2002 +++ xc/programs/Xserver/hw/sun/sunInit.c Mon Nov 17 17:20:36 2003 @@ -15,7 +15,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunInit.c,v 3.12 2002/12/06 02:11:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunInit.c,v 3.13 2003/11/17 22:20:36 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -63,12 +63,10 @@ #define BW2I NULL #else /* }{ */ extern Bool sunBW2Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define BW2I sunBW2Init #endif /* } */ @@ -86,12 +84,10 @@ #define TCXI NULL #else /* }{ */ extern Bool sunCG3Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG3I sunCG3Init #if defined(i386) || defined(__bsdi__) /* { */ @@ -100,33 +96,27 @@ #else /* }{ */ #ifdef INCLUDE_CG2_HEADER extern Bool sunCG2Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG2I sunCG2Init #endif /* INCLUDE_CG2_HEADER */ extern Bool sunCG4Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG4I sunCG4Init #endif /* } */ #ifdef FBTYPE_SUNFAST_COLOR /* { */ extern Bool sunCG6Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG6I sunCG6Init #else /* }{ */ @@ -134,12 +124,10 @@ #endif /* } */ #ifdef XFBTYPE_TCX /* { */ extern Bool sunTCXInit( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define TCXI sunTCXInit #else /* }{ */ @@ -148,12 +136,10 @@ #if SUNMAXDEPTH > 8 /* { */ #ifdef FBTYPE_MEMCOLOR /* { */ extern Bool sunCG8Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG8I sunCG8Init #else /* }{ */ @@ -418,13 +404,11 @@ *----------------------------------------------------------------------- */ void sunNonBlockConsoleOff( -#if NeedFunctionPrototypes #if defined(SVR4) || defined(CSRG_BASED) void #else char* arg #endif -#endif ) { register int i; @@ -526,9 +510,7 @@ } void OsVendorInit( -#if NeedFunctionPrototypes void -#endif ) { static int inited; Index: xc/programs/Xserver/hw/sun/sunIo.c diff -u xc/programs/Xserver/hw/sun/sunIo.c:3.9 xc/programs/Xserver/hw/sun/sunIo.c:3.10 --- xc/programs/Xserver/hw/sun/sunIo.c:3.9 Wed Dec 19 16:28:45 2001 +++ xc/programs/Xserver/hw/sun/sunIo.c Mon Nov 17 17:20:36 2003 @@ -15,7 +15,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.9 2001/12/19 21:28:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.10 2003/11/17 22:20:36 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -80,9 +80,7 @@ */ void sunEnqueueEvents ( -#if NeedFunctionPrototypes void -#endif ) { Firm_event *ptrEvents, /* Current pointer event */ Index: xc/programs/Xserver/hw/sun/sunKbd.c diff -u xc/programs/Xserver/hw/sun/sunKbd.c:1.8 xc/programs/Xserver/hw/sun/sunKbd.c:1.9 --- xc/programs/Xserver/hw/sun/sunKbd.c:1.8 Sat Oct 27 23:33:11 2001 +++ xc/programs/Xserver/hw/sun/sunKbd.c Mon Nov 17 17:20:36 2003 @@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/sunKbd.c,v 1.8 2001/10/28 03:33:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunKbd.c,v 1.9 2003/11/17 22:20:36 dawes Exp $ */ #define NEED_EVENTS #include "sun.h" @@ -202,15 +202,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes static void bell ( int fd, int duration) -#else -static void bell (fd, duration) - int fd; - int duration; -#endif { int kbdCmd; /* Command to give keyboard */ @@ -225,19 +219,11 @@ Error ("Failed to deactivate bell"); } -#if NeedFunctionPrototypes static void sunBell ( int percent, DeviceIntPtr device, pointer ctrl, int unused) -#else -static void sunBell (percent, device, ctrl, unused) - int percent; /* Percentage of full volume */ - DeviceIntPtr device; /* Keyboard to ring */ - pointer ctrl; - int unused; -#endif { KeybdCtrl* kctrl = (KeybdCtrl*) ctrl; sunKbdPrivPtr pPriv = (sunKbdPrivPtr) device->public.devicePrivate; @@ -392,15 +378,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes static void sunKbdCtrl ( DeviceIntPtr device, KeybdCtrl* ctrl) -#else -static void sunKbdCtrl (device, ctrl) - DeviceIntPtr device; /* Keyboard to alter */ - KeybdCtrl* ctrl; -#endif { sunKbdPrivPtr pPriv = (sunKbdPrivPtr) device->public.devicePrivate; @@ -436,15 +416,9 @@ *----------------------------------------------------------------------- */ #ifdef XKB -#if NeedFunctionPrototypes static void sunInitKbdNames ( XkbComponentNamesRec* names, sunKbdPrivPtr pKbd) -#else -static void sunInitKbdNames (names, pKbd) - XkbComponentNamesRec* names; - sunKbdPrivPtr pKbd; -#endif { #ifndef XKBBUFSIZE #define XKBBUFSIZE 64 @@ -628,15 +602,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunKbdProc ( DeviceIntPtr device, int what) -#else -int sunKbdProc (device, what) - DeviceIntPtr device; /* Keyboard to manipulate */ - int what; /* What to do to it */ -#endif { int i; DevicePtr pKeyboard = (DevicePtr) device; @@ -758,19 +726,11 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes Firm_event* sunKbdGetEvents ( int fd, Bool on, int* pNumEvents, Bool* pAgain) -#else -Firm_event* sunKbdGetEvents (fd, on, pNumEvents, pAgain) - int fd; - Bool on; - int* pNumEvents; - Bool* pAgain; -#endif { int nBytes; /* number of bytes of events available. */ static Firm_event evBuf[MAXEVENTS]; /* Buffer for Firm_events */ @@ -877,15 +837,9 @@ return FALSE; } -#if NeedFunctionPrototypes void sunKbdEnqueueEvent ( DeviceIntPtr device, Firm_event *fe) -#else -void sunKbdEnqueueEvent (device, fe) - DeviceIntPtr device; - Firm_event *fe; -#endif { xEvent xE; BYTE keycode; @@ -983,16 +937,10 @@ * *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunChangeKbdTranslation( int fd, Bool makeTranslated) -#else -int sunChangeKbdTranslation(fd, makeTranslated) - int fd; - Bool makeTranslated; -#endif { int tmp; #ifndef i386 /* { */ Index: xc/programs/Xserver/hw/sun/sunMouse.c diff -u xc/programs/Xserver/hw/sun/sunMouse.c:1.3 xc/programs/Xserver/hw/sun/sunMouse.c:1.4 --- xc/programs/Xserver/hw/sun/sunMouse.c:1.3 Sat Oct 27 23:33:12 2001 +++ xc/programs/Xserver/hw/sun/sunMouse.c Mon Nov 17 17:20:36 2003 @@ -50,7 +50,7 @@ * any purpose. It is provided "as is" without express or * implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunMouse.c,v 1.3 2001/10/28 03:33:12 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunMouse.c,v 1.4 2003/11/17 22:20:36 dawes Exp $ */ #define NEED_EVENTS #include "sun.h" @@ -85,15 +85,9 @@ */ /*ARGSUSED*/ static -#if NeedFunctionPrototypes void sunMouseCtrl ( DeviceIntPtr device, PtrCtrl* ctrl) -#else -void sunMouseCtrl (device, ctrl) - DeviceIntPtr device; - PtrCtrl* ctrl; -#endif { } @@ -116,15 +110,9 @@ * *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunMouseProc ( DeviceIntPtr device, int what) -#else -int sunMouseProc (device, what) - DeviceIntPtr device; /* Mouse to play with */ - int what; /* What to do with it */ -#endif { DevicePtr pMouse = (DevicePtr) device; int format; @@ -193,19 +181,11 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes Firm_event* sunMouseGetEvents ( int fd, Bool on, int* pNumEvents, Bool* pAgain) -#else -Firm_event* sunMouseGetEvents (fd, on, pNumEvents, pAgain) - int fd; - Bool on; - int* pNumEvents; - Bool* pAgain; -#endif { int nBytes; /* number of bytes of events available. */ static Firm_event evBuf[MAXEVENTS]; /* Buffer for Firm_events */ @@ -281,15 +261,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes void sunMouseEnqueueEvent ( DeviceIntPtr device, Firm_event *fe) -#else -void sunMouseEnqueueEvent (device, fe) - DeviceIntPtr device; /* Mouse from which the event came */ - Firm_event *fe; /* Event to process */ -#endif { xEvent xE; sunPtrPrivPtr pPriv; /* Private data for pointer */ Index: xc/programs/Xserver/hw/sunLynx/sun.h diff -u xc/programs/Xserver/hw/sunLynx/sun.h:3.7 xc/programs/Xserver/hw/sunLynx/sun.h:3.8 --- xc/programs/Xserver/hw/sunLynx/sun.h:3.7 Wed Jul 25 11:05:02 2001 +++ xc/programs/Xserver/hw/sunLynx/sun.h Mon Nov 17 17:20:37 2003 @@ -13,7 +13,7 @@ * software for any purpose. It is provided "as is" without * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sun.h,v 3.7 2001/07/25 15:05:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sun.h,v 3.8 2003/11/17 22:20:37 dawes Exp $ */ #ifndef _SUN_H_ #define _SUN_H_ @@ -293,12 +293,10 @@ } fbFd; typedef Bool (*sunFbInitProc)( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); typedef struct { @@ -325,91 +323,66 @@ extern int* sunProtected; extern Bool sunCursorInitialize( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern void sunDisableCursor( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern int sunChangeKbdTranslation( -#if NeedFunctionPrototypes int /* fd */, Bool /* makeTranslated */ -#endif ); extern void sunNonBlockConsoleOff( -#if NeedFunctionPrototypes #if defined(SVR4) || defined(CSRG_BASED) || defined(Lynx) void #else char* /* arg */ #endif -#endif ); extern void sunEnqueueEvents( -#if NeedFunctionPrototypes void -#endif ); extern void sunEnqueueKbdEvents( -#if NeedFunctionPrototypes void -#endif ); extern void sunEnqueueMseEvents( -#if NeedFunctionPrototypes void -#endif ); extern int sunGXInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, fbFd* /* fb */ -#endif ); extern Bool sunSaveScreen( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, int /* on */ -#endif ); extern Bool sunScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern pointer sunMemoryMap( -#if NeedFunctionPrototypes size_t /* len */, off_t /* off */, int /* fd */ #ifdef Lynx , char * /* name */ #endif -#endif ); extern Bool sunScreenAllocate( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); extern Bool sunInitCommon( -#if NeedFunctionPrototypes int /* scrn */, ScreenPtr /* pScrn */, off_t /* offset */, @@ -418,59 +391,44 @@ Bool (* /* cr_cm */)(), Bool (* /* save */)(), int /* fb_off */ -#endif ); extern Firm_event* sunKbdGetEvents( -#if NeedFunctionPrototypes int /* fd */, Bool /* on */, int* /* pNumEvents */, Bool* /* pAgain */ -#endif ); extern Firm_event* sunMouseGetEvents( -#if NeedFunctionPrototypes int /* fd */, Bool /* on */, int* /* pNumEvents */, Bool* /* pAgain */ -#endif ); extern void sunKbdEnqueueEvent( -#if NeedFunctionPrototypes DeviceIntPtr /* device */, Firm_event* /* fe */ -#endif ); extern void sunMouseEnqueueEvent( -#if NeedFunctionPrototypes DeviceIntPtr /* device */, Firm_event* /* fe */ -#endif ); extern int sunKbdProc( -#if NeedFunctionPrototypes DeviceIntPtr /* pKeyboard */, int /* what */ -#endif ); extern int sunMouseProc( -#if NeedFunctionPrototypes DeviceIntPtr /* pMouse */, int /* what */ -#endif ); extern void sunKbdWait( -#if NeedFunctionPrototypes void -#endif ); /*- @@ -480,7 +438,6 @@ #define TVTOMILLI(tv) (((tv).tv_usec/1000)+((tv).tv_sec*1000)) extern Bool sunCfbSetupScreen( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -489,11 +446,9 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern Bool sunCfbFinishScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -502,11 +457,9 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern Bool sunCfbScreenInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, pointer /* pbits */, /* pointer to screen bitmap */ int /* xsize */, /* in pixels */ @@ -515,26 +468,19 @@ int /* dpiy */, /* dots per inch */ int /* width */, /* pixel width of frame buffer */ int /* bpp */ /* bits per pixel of root */ -#endif ); extern void sunInstallColormap( -#if NeedFunctionPrototypes ColormapPtr /* cmap */ -#endif ); extern void sunUninstallColormap( -#if NeedFunctionPrototypes ColormapPtr /* cmap */ -#endif ); extern int sunListInstalledColormaps( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, Colormap* /* pCmapList */ -#endif ); #endif Index: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.6 xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.7 --- xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.6 Fri Dec 14 14:59:44 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyFbs.c Mon Nov 17 17:20:37 2003 @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c,v 3.6 2001/12/14 19:59:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c,v 3.7 2003/11/17 22:20:37 dawes Exp $ */ /* Copyright 1990, 1993, 1998 The Open Group @@ -101,20 +101,12 @@ static unsigned long generation = 0; -#if NeedFunctionPrototypes pointer sunMemoryMap ( size_t len, off_t off, int fd, char *name ) -#else -pointer sunMemoryMap (len, off, fd, name) - size_t len; - off_t off; - int fd; - char *name; -#endif { int pagemask, mapsize; caddr_t addr; @@ -133,13 +125,8 @@ return mapaddr; } -#if NeedFunctionPrototypes Bool sunScreenAllocate ( ScreenPtr pScreen) -#else -Bool sunScreenAllocate (pScreen) - ScreenPtr pScreen; -#endif { sunScreenPtr pPrivate; extern int AllocateScreenPrivateIndex(); @@ -159,15 +146,9 @@ return TRUE; } -#if NeedFunctionPrototypes Bool sunSaveScreen ( ScreenPtr pScreen, int on) -#else -Bool sunSaveScreen (pScreen, on) - ScreenPtr pScreen; - int on; -#endif { int state; @@ -209,13 +190,8 @@ return ret; } -#if NeedFunctionPrototypes Bool sunScreenInit ( ScreenPtr pScreen) -#else -Bool sunScreenInit (pScreen) - ScreenPtr pScreen; -#endif { SetupScreen(pScreen); extern void sunBlockHandler(); @@ -261,7 +237,6 @@ return TRUE; } -#if NeedFunctionPrototypes Bool sunInitCommon ( int scrn, ScreenPtr pScrn, @@ -271,17 +246,6 @@ Bool (*cr_cm)(), Bool (*save)(), int fb_off) -#else -Bool sunInitCommon (scrn, pScrn, offset, init1, init2, cr_cm, save, fb_off) - int scrn; - ScreenPtr pScrn; - off_t offset; - Bool (*init1)(); - void (*init2)(); - Bool (*cr_cm)(); - Bool (*save)(); - int fb_off; -#endif { unsigned char* fb = sunFbs[scrn].fbuf; unsigned char* dac = sunFbs[scrn].ramdac; Index: xc/programs/Xserver/hw/sunLynx/sunLyInit.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.8 xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.9 --- xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.8 Wed Jan 17 17:36:53 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyInit.c Mon Nov 17 17:20:37 2003 @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyInit.c,v 3.8 2001/01/17 22:36:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyInit.c,v 3.9 2003/11/17 22:20:37 dawes Exp $ */ /* * Copyright 1987 by the Regents of the University of California @@ -81,12 +81,10 @@ #endif extern Bool sunBW2Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define BW2I sunBW2Init #if SUNMAXDEPTH == 1 /* { */ @@ -94,22 +92,18 @@ #define CG6I NULL #else /* }{ */ extern Bool sunCG3Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG3I sunCG3Init #ifdef FBTYPE_SUNFAST_COLOR /* { */ extern Bool sunCG6Init( -#if NeedFunctionPrototypes int /* screen */, ScreenPtr /* pScreen */, int /* argc */, char** /* argv */ -#endif ); #define CG6I sunCG6Init #else /* }{ */ @@ -322,9 +316,7 @@ *----------------------------------------------------------------------- */ void sunNonBlockConsoleOff( -#if NeedFunctionPrototypes void -#endif ) { int i; @@ -440,9 +432,7 @@ } void OsVendorInit( -#if NeedFunctionPrototypes void -#endif ) { static int inited; Index: xc/programs/Xserver/hw/sunLynx/sunLyIo.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.5 xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.6 --- xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.5 Fri May 25 14:40:59 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyIo.c Mon Nov 17 17:20:37 2003 @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.5 2001/05/25 18:40:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.6 2003/11/17 22:20:37 dawes Exp $ */ /* * @@ -102,9 +102,7 @@ */ void sunEnqueueEvents ( -#if NeedFunctionPrototypes void -#endif ) { Firm_event *ptrEvents, /* Current pointer event */ @@ -179,9 +177,7 @@ } void sunEnqueueKbdEvents ( -#if NeedFunctionPrototypes void -#endif ) { Firm_event *kbdEvents; /* Current keyboard event */ @@ -225,9 +221,7 @@ } void sunEnqueueMseEvents ( -#if NeedFunctionPrototypes void -#endif ) { Firm_event *ptrEvents; /* Current pointer event */ Index: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.6 xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.7 --- xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.6 Tue Jul 31 20:44:49 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyKbd.c Mon Nov 17 17:20:37 2003 @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c,v 3.6 2001/08/01 00:44:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c,v 3.7 2003/11/17 22:20:37 dawes Exp $ */ /*- * Copyright 1987 by the Regents of the University of California @@ -232,15 +232,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes static void bell ( int fd, int duration) -#else -static void bell (fd, duration) - int fd; - int duration; -#endif { #if defined(PATCHED_CONSOLE) int kbdCmd; /* Command to give keyboard */ @@ -257,19 +251,11 @@ #endif } -#if NeedFunctionPrototypes static void sunBell ( int percent, DeviceIntPtr device, pointer ctrl, int unused) -#else -static void sunBell (percent, device, ctrl, unused) - int percent; /* Percentage of full volume */ - DeviceIntPtr device; /* Keyboard to ring */ - pointer ctrl; - int unused; -#endif { KeybdCtrl* kctrl = (KeybdCtrl*) ctrl; sunKbdPrivPtr pPriv = (sunKbdPrivPtr) device->public.devicePrivate; @@ -412,15 +398,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes static void sunKbdCtrl ( DeviceIntPtr device, KeybdCtrl* ctrl) -#else -static void sunKbdCtrl (device, ctrl) - DeviceIntPtr device; /* Keyboard to alter */ - KeybdCtrl* ctrl; -#endif { sunKbdPrivPtr pPriv = (sunKbdPrivPtr) device->public.devicePrivate; @@ -458,15 +438,9 @@ *----------------------------------------------------------------------- */ #ifdef XKB -#if NeedFunctionPrototypes static void sunInitKbdNames ( XkbComponentNamesRec* names, sunKbdPrivPtr pKbd) -#else -static void sunInitKbdNames (names, pKbd) - XkbComponentNamesRec* names; - sunKbdPrivPtr pKbd; -#endif { #ifndef XKBBUFSIZE #define XKBBUFSIZE 64 @@ -598,15 +572,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunKbdProc ( DeviceIntPtr device, int what) -#else -int sunKbdProc (device, what) - DeviceIntPtr device; /* Keyboard to manipulate */ - int what; /* What to do to it */ -#endif { static int once; static struct termio kbdtty; @@ -752,19 +720,11 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes Firm_event* sunKbdGetEvents ( int fd, Bool on, int* pNumEvents, Bool* pAgain) -#else -Firm_event* sunKbdGetEvents (fd, on, pNumEvents, pAgain) - int fd; - Bool on; - int* pNumEvents; - Bool* pAgain; -#endif { int nBytes; /* number of bytes of events available. */ static Firm_event evBuf[MAXEVENTS]; /* Buffer for Firm_events */ @@ -887,15 +847,9 @@ return FALSE; } -#if NeedFunctionPrototypes void sunKbdEnqueueEvent ( DeviceIntPtr device, Firm_event *fe) -#else -void sunKbdEnqueueEvent (device, fe) - DeviceIntPtr device; - Firm_event *fe; -#endif { xEvent xE; BYTE keycode; @@ -993,16 +947,9 @@ * *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunChangeKbdTranslation( int fd, Bool makeTranslated) - -#else -int sunChangeKbdTranslation(fd, makeTranslated) - int fd; - Bool makeTranslated; -#endif { int tmp; sigset_t hold_mask, old_mask; Index: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.3 xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.4 --- xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.3 Wed Jan 17 17:36:53 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyMouse.c Mon Nov 17 17:20:37 2003 @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c,v 3.3 2001/01/17 22:36:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c,v 3.4 2003/11/17 22:20:37 dawes Exp $ */ /*- * Copyright 1987 by the Regents of the University of California @@ -108,15 +108,9 @@ */ /*ARGSUSED*/ static -#if NeedFunctionPrototypes void sunMouseCtrl ( DeviceIntPtr device, PtrCtrl* ctrl) -#else -void sunMouseCtrl (device, ctrl) - DeviceIntPtr device; - PtrCtrl* ctrl; -#endif { } @@ -139,15 +133,9 @@ * *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes int sunMouseProc ( DeviceIntPtr device, int what) -#else -int sunMouseProc (device, what) - DeviceIntPtr device; /* Mouse to play with */ - int what; /* What to do with it */ -#endif { struct termio tty; DevicePtr pMouse = (DevicePtr) device; @@ -443,19 +431,11 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes Firm_event* sunMouseGetEvents ( int fd, Bool on, int* pNumEvents, Bool* pAgain) -#else -Firm_event* sunMouseGetEvents (fd, on, pNumEvents, pAgain) - int fd; - Bool on; - int* pNumEvents; - Bool* pAgain; -#endif { static Firm_event evBuf[MAXEVENTS]; /* Buffer for Firm_events */ int nBytes; /* number of bytes available. */ @@ -543,15 +523,9 @@ *----------------------------------------------------------------------- */ -#if NeedFunctionPrototypes void sunMouseEnqueueEvent ( DeviceIntPtr device, Firm_event *fe) -#else -void sunMouseEnqueueEvent (device, fe) - DeviceIntPtr device; /* Mouse from which the event came */ - Firm_event *fe; /* Event to process */ -#endif { xEvent xE; sunPtrPrivPtr pPriv; /* Private data for pointer */ Index: xc/programs/Xserver/hw/vfb/Imakefile diff -u xc/programs/Xserver/hw/vfb/Imakefile:3.30 xc/programs/Xserver/hw/vfb/Imakefile:3.31 --- xc/programs/Xserver/hw/vfb/Imakefile:3.30 Thu May 31 12:11:10 2001 +++ xc/programs/Xserver/hw/vfb/Imakefile Tue Jul 15 23:24:36 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.30 2001/05/31 16:11:10 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.31 2003/07/16 03:24:36 dawes Exp $ #include @@ -32,8 +32,9 @@ OBJSA = InitInput.o InitOutput.o stubs.o $(OBJS1) miinitext.o $(OBJS2) INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I../../fb -I../../mfb -I../../mi -I../../include -I../../os \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/render + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I../../os \ + -I$(SERVERSRC)/Xext -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + -I$(SERVERSRC)/render DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) -UXFree86LOADER Index: xc/programs/Xserver/hw/vfb/InitInput.c diff -u xc/programs/Xserver/hw/vfb/InitInput.c:3.9 xc/programs/Xserver/hw/vfb/InitInput.c:3.10 --- xc/programs/Xserver/hw/vfb/InitInput.c:3.9 Fri Dec 14 14:59:45 2001 +++ xc/programs/Xserver/hw/vfb/InitInput.c Sat Nov 15 22:16:59 2003 @@ -26,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.9 2001/12/14 19:59:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.10 2003/11/16 03:16:59 dawes Exp $ */ #include "X11/X.h" #define NEED_EVENTS @@ -41,9 +41,7 @@ #include "keysym.h" Bool -LegalModifier(key, pDev) - unsigned int key; - DevicePtr pDev; +LegalModifier(unsigned int key, DevicePtr pDev) { return TRUE; } @@ -63,9 +61,7 @@ * easy to lift. */ static Bool -GetLK201Mappings(pKeySyms, pModMap) - KeySymsPtr pKeySyms; - CARD8 *pModMap; +GetLK201Mappings(KeySymsPtr pKeySyms, CARD8 *pModMap) { #define INDEX(in) ((in - VFB_MIN_KEY) * LK201_GLYPHS_PER_KEY) int i; @@ -257,9 +253,7 @@ } static int -vfbKeybdProc(pDevice, onoff) - DeviceIntPtr pDevice; - int onoff; +vfbKeybdProc(DeviceIntPtr pDevice, int onoff) { KeySymsRec keySyms; CARD8 modMap[MAP_LENGTH]; @@ -285,9 +279,7 @@ } static int -vfbMouseProc(pDevice, onoff) - DeviceIntPtr pDevice; - int onoff; +vfbMouseProc(DeviceIntPtr pDevice, int onoff) { BYTE map[4]; DevicePtr pDev = (DevicePtr)pDevice; @@ -317,9 +309,7 @@ } void -InitInput(argc, argv) - int argc; - char *argv[]; +InitInput(int argc, char *argv[]) { DeviceIntPtr p, k; p = AddInputDevice(vfbMouseProc, TRUE); @@ -332,26 +322,18 @@ #ifdef XTESTEXT1 void -XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey) - int dev_type; - int keycode; - int keystate; - int mousex; - int mousey; +XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex, + int mousey) { } void -XTestGetPointerPos(fmousex, fmousey) - short *fmousex, *fmousey; +XTestGetPointerPos(short *fmousex, short *fmousey) { } void -XTestJumpPointer(jx, jy, dev_type) - int jx; - int jy; - int dev_type; +XTestJumpPointer(int jx, int jy, int dev_type) { } #endif Index: xc/programs/Xserver/hw/vfb/InitOutput.c diff -u xc/programs/Xserver/hw/vfb/InitOutput.c:3.22 xc/programs/Xserver/hw/vfb/InitOutput.c:3.26 --- xc/programs/Xserver/hw/vfb/InitOutput.c:3.22 Tue Jan 14 21:34:07 2003 +++ xc/programs/Xserver/hw/vfb/InitOutput.c Sat Nov 15 22:16:59 2003 @@ -26,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.22 2003/01/15 02:34:07 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.26 2003/11/16 03:16:59 dawes Exp $ */ #if defined(WIN32) #include @@ -66,8 +66,6 @@ #include "miline.h" #include "mfb.h" -extern char *display; - #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 #define VFB_DEFAULT_DEPTH 8 @@ -80,6 +78,7 @@ { int scrnum; int width; + int paddedBytesWidth; int paddedWidth; int height; int depth; @@ -92,6 +91,7 @@ Pixel blackPixel; Pixel whitePixel; unsigned int lineBias; + CloseScreenProcPtr closeScreen; #ifdef HAS_MMAP int mmap_fd; @@ -125,7 +125,7 @@ static void -vfbInitializePixmapDepths() +vfbInitializePixmapDepths(void) { int i; vfbPixmapDepths[1] = TRUE; /* always need bitmaps */ @@ -134,7 +134,7 @@ } static void -vfbInitializeDefaultScreens() +vfbInitializeDefaultScreens(void) { int i; @@ -153,8 +153,7 @@ } static int -vfbBitsPerPixel(depth) - int depth; +vfbBitsPerPixel(int depth) { if (depth == 1) return 1; else if (depth <= 8) return 8; @@ -275,10 +274,7 @@ } int -ddxProcessArgument (argc, argv, i) - int argc; - char *argv[]; - int i; +ddxProcessArgument(int argc, char *argv[], int i) { static Bool firstTime = TRUE; @@ -438,8 +434,7 @@ static Bool -vfbMultiDepthCreateGC(pGC) - GCPtr pGC; +vfbMultiDepthCreateGC(GCPtr pGC) { switch (vfbBitsPerPixel(pGC->depth)) { @@ -452,13 +447,13 @@ } static void -vfbMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart) - DrawablePtr pDrawable; /* drawable from which to get bits */ - int wMax; /* largest value of all *pwidths */ - register DDXPointPtr ppt; /* points to start copying from */ - int *pwidth; /* list of number of bits to copy */ - int nspans; /* number of scanlines to copy */ - char *pdstStart; /* where to put the bits */ +vfbMultiDepthGetSpans( + DrawablePtr pDrawable, /* drawable from which to get bits */ + int wMax, /* largest value of all *pwidths */ + register DDXPointPtr ppt, /* points to start copying from */ + int *pwidth, /* list of number of bits to copy */ + int nspans, /* number of scanlines to copy */ + char *pdstStart) /* where to put the bits */ { switch (pDrawable->bitsPerPixel) { case 1: @@ -474,12 +469,9 @@ } static void -vfbMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) - DrawablePtr pDrawable; - int sx, sy, w, h; - unsigned int format; - unsigned long planeMask; - char *pdstLine; +vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, + unsigned int format, unsigned long planeMask, + char *pdstLine) { switch (pDrawable->bitsPerPixel) { @@ -497,9 +489,7 @@ static ColormapPtr InstalledMaps[MAXSCREENS]; static int -vfbListInstalledColormaps(pScreen, pmaps) - ScreenPtr pScreen; - Colormap *pmaps; +vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) { /* By the time we are processing requests, we can guarantee that there * is always a colormap installed */ @@ -509,8 +499,7 @@ static void -vfbInstallColormap(pmap) - ColormapPtr pmap; +vfbInstallColormap(ColormapPtr pmap) { int index = pmap->pScreen->myNum; ColormapPtr oldpmap = InstalledMaps[index]; @@ -568,8 +557,7 @@ } static void -vfbUninstallColormap(pmap) - ColormapPtr pmap; +vfbUninstallColormap(ColormapPtr pmap) { ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum]; @@ -585,10 +573,7 @@ } static void -vfbStoreColors(pmap, ndef, pdefs) - ColormapPtr pmap; - int ndef; - xColorItem *pdefs; +vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs) { XWDColor *pXWDCmap; int i; @@ -623,9 +608,7 @@ } static Bool -vfbSaveScreen(pScreen, on) - ScreenPtr pScreen; - int on; +vfbSaveScreen(ScreenPtr pScreen, int on) { return TRUE; } @@ -634,10 +617,7 @@ /* this flushes any changes to the screens out to the mmapped file */ static void -vfbBlockHandler(blockData, pTimeout, pReadmask) - pointer blockData; - OSTimePtr pTimeout; - pointer pReadmask; +vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) { int i; @@ -660,17 +640,13 @@ static void -vfbWakeupHandler(blockData, result, pReadmask) - pointer blockData; - int result; - pointer pReadmask; +vfbWakeupHandler(pointer blockData, int result, pointer pReadmask) { } static void -vfbAllocateMmappedFramebuffer(pvfb) - vfbScreenInfoPtr pvfb; +vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb) { #define DUMMY_BUFFER_SIZE 65536 char dummyBuffer[DUMMY_BUFFER_SIZE]; @@ -726,8 +702,7 @@ #ifdef HAS_SHM static void -vfbAllocateSharedMemoryFramebuffer(pvfb) - vfbScreenInfoPtr pvfb; +vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb) { /* create the shared memory segment */ @@ -755,16 +730,11 @@ #endif /* HAS_SHM */ static char * -vfbAllocateFramebufferMemory(pvfb) - vfbScreenInfoPtr pvfb; +vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) { if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */ - if (pvfb->bitsPerPixel == 1) - pvfb->sizeInBytes = (pvfb->paddedWidth * pvfb->height); - else - pvfb->sizeInBytes = pvfb->paddedWidth * pvfb->height * - (pvfb->bitsPerPixel/8); + pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height; /* Calculate how many entries in colormap. This is rather bogus, because * the visuals haven't even been set up yet, but we need to know because we @@ -822,8 +792,7 @@ static void -vfbWriteXWDFileHeader(pScreen) - ScreenPtr pScreen; +vfbWriteXWDFileHeader(ScreenPtr pScreen) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; XWDFileHeader *pXWDHeader = pvfb->pXWDHeader; @@ -852,7 +821,7 @@ pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO; #endif pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel; - pXWDHeader->bytes_per_line = pvfb->paddedWidth; + pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth; pXWDHeader->ncolors = pvfb->ncolors; /* visual related fields are written when colormap is installed */ @@ -891,17 +860,13 @@ static Bool -vfbCursorOffScreen (ppScreen, x, y) - ScreenPtr *ppScreen; - int *x, *y; +vfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y) { return FALSE; } static void -vfbCrossScreen (pScreen, entering) - ScreenPtr pScreen; - Bool entering; +vfbCrossScreen (ScreenPtr pScreen, Bool entering) { } @@ -913,19 +878,37 @@ }; static Bool -vfbScreenInit(index, pScreen, argc, argv) - int index; - ScreenPtr pScreen; - int argc; - char ** argv; +vfbCloseScreen(int index, ScreenPtr pScreen) +{ + vfbScreenInfoPtr pvfb = &vfbScreens[index]; + int i; + + pScreen->CloseScreen = pvfb->closeScreen; + + /* + * XXX probably lots of stuff to clean. For now, + * clear InstalledMaps[] so that server reset works correctly. + */ + for (i = 0; i < MAXSCREENS; i++) + InstalledMaps[i] = NULL; + + return pScreen->CloseScreen(index, pScreen); +} + +static Bool +vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) { vfbScreenInfoPtr pvfb = &vfbScreens[index]; int dpix = 100, dpiy = 100; int ret; char *pbits; - pvfb->paddedWidth = PixmapBytePad(pvfb->width, pvfb->depth); + pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth); pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth); + if (pvfb->bitsPerPixel >= 8 ) + pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8); + else + pvfb->paddedWidth = pvfb->paddedBytesWidth * 8; pbits = vfbAllocateFramebufferMemory(pvfb); if (!pbits) return FALSE; @@ -935,7 +918,7 @@ { case 1: ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, - dpix, dpiy, pvfb->paddedWidth * 8); + dpix, dpiy, pvfb->paddedWidth); break; case 8: case 16: @@ -988,16 +971,16 @@ miSetZeroLineBias(pScreen, pvfb->lineBias); + pvfb->closeScreen = pScreen->CloseScreen; + pScreen->CloseScreen = vfbCloseScreen; + return ret; } /* end vfbScreenInit */ void -InitOutput(screenInfo, argc, argv) - ScreenInfo *screenInfo; - int argc; - char **argv; +InitOutput(ScreenInfo *screenInfo, int argc, char **argv) { int i; int NumFormats = 0; @@ -1010,9 +993,16 @@ vfbPixmapDepths[vfbScreens[i].depth] = TRUE; } - /* for RENDER we need 32bpp */ - if (Render) + /* RENDER needs a good set of pixmaps. */ + if (Render) { + vfbPixmapDepths[1] = TRUE; + vfbPixmapDepths[4] = TRUE; + vfbPixmapDepths[8] = TRUE; + vfbPixmapDepths[15] = TRUE; + vfbPixmapDepths[16] = TRUE; + vfbPixmapDepths[24] = TRUE; vfbPixmapDepths[32] = TRUE; + } for (i = 1; i <= 32; i++) { Index: xc/programs/Xserver/hw/vfb/Xvfb.man diff -u xc/programs/Xserver/hw/vfb/Xvfb.man:1.9 xc/programs/Xserver/hw/vfb/Xvfb.man:1.10 --- xc/programs/Xserver/hw/vfb/Xvfb.man:1.9 Fri Dec 14 14:59:45 2001 +++ xc/programs/Xserver/hw/vfb/Xvfb.man Sun Nov 23 00:40:36 2003 @@ -23,7 +23,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.9 2001/12/14 19:59:45 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.10 2003/11/23 05:40:36 dawes Exp $ .\" .TH XVFB 1 __xorgversion__ .SH NAME @@ -49,7 +49,7 @@ .SH BUILDING To build \fIXvfb\fP, put the following in your host.def and remake. .PP -\&#define BuildServer YES /* if you aren't already building other servers */ +\&#define BuildServer YES /\(** if you aren't already building other servers */ .br \&#define XVirtualFramebufferServer YES Index: xc/programs/Xserver/hw/xfree86/Imakefile diff -u xc/programs/Xserver/hw/xfree86/Imakefile:3.82 xc/programs/Xserver/hw/xfree86/Imakefile:3.86 --- xc/programs/Xserver/hw/xfree86/Imakefile:3.82 Mon Feb 17 12:06:40 2003 +++ xc/programs/Xserver/hw/xfree86/Imakefile Wed Oct 8 10:58:25 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.82 2003/02/17 17:06:40 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.86 2003/10/08 14:58:25 dawes Exp $ #include #define IHaveSubdirs @@ -71,10 +71,6 @@ VBEDIR = vbe #endif -#if BuildXF86Setup -XF86SETUPDIR = XF86Setup -#endif - #if DoLoadableServer LOADERDIR = loader #endif @@ -95,8 +91,8 @@ $(XF8_32BPPDIR) $(XF8_16BPPDIR) $(XF24_32BPPDIR) $(SHADOWFBDIR) \ drivers $(LOADERDIR) $(VGAHWDIR) $(FBDEVHWDIR) $(RAMDACDIR) \ $(RACDIR) $(DDCDIR) $(INPUTDIR) $(INT10DIR) $(VBEDIR) parser \ - scanpci doc dummylib $(XF86CFGDIRS) $(XF86SETUPDIR) etc \ - $(DRIVERSDK) $(XF8_32WIDDIR) + scanpci doc dummylib $(XF86CFGDIRS) etc $(DRIVERSDK) \ + $(XF8_32WIDDIR) getconfig #if !defined(OS2Architecture) && !defined(cygwinArchitecture) XF86CONFIG = XF86Config @@ -105,7 +101,39 @@ XF86CONFIG = XF86Conf #endif -all:: $(XF86CONFIG) $(XF98CONFIG) +SAMPLE_CONFIG_FILES = $(XF86CONFIG) $(XF98CONFIG) + +all:: $(SAMPLE_CONFIG_FILES) xf86Build.h + +CHANGELOGFILE = CHANGELOG + +#if defined(BuildDate) + BUILD_DATE = BuildDate +#else + BUILD_DATE = 0 +#endif + +#if defined(ChangelogDate) + CLOG_DATE = ChangelogDate +#else + CLOG_DATE = 0 +#endif + +includes:: xf86Build.h + +clean:: + RemoveFile(xf86Build.h) + RemoveFile(build.new) + +xf86Build.h: FRC + RemoveFile(build.new) + echo "#define BUILD_DATE $(BUILD_DATE)" > build.new + echo "#define CLOG_DATE $(CLOG_DATE)" >> build.new + @if cmp -s build.new $@; then :; \ + else (set -x; RemoveFile($@); $(MV) build.new $@); fi + RemoveFile(build.new) + +FRC: #if defined(i386BsdArchitecture) && !defined(FreeBSDArchitecture) MANPAGE=Concat(FileManDir,/XF86Config.0) @@ -159,7 +187,7 @@ -DDPI100FONTPATH=$(DPI100FONTPATH) \ -DDPI75USFONTPATH=$(DPI75USFONTPATH) \ -DDPI100USFONTPATH=$(DPI100USFONTPATH) \ - -DMANPAGE=$(MANPAGE) -DMODULEPATH=\"$(MODULEDIR)\", \ + -DMANPAGE=$(MANPAGE) '-DMODULEPATH="$(MODULEDIR)"', \ $(ICONFIGFILES)) CppFileTarget($(XF98CONFIG), XF98Conf.cpp, \ -DRGBPATH=$(RGBPATH) -DMISCFONTPATH=$(MISCFONTPATH) \ @@ -175,8 +203,9 @@ -DNETBSDOLDMOUSEDEV=$(NETBSDOLDMOUSEDEV) \ -DNETBSDNEWMOUSEDEV=$(NETBSDNEWMOUSEDEV) \ -DLINUXMOUSEDEV=$(LINUXMOUSEDEV) \ - -DMANPAGE=$(MANPAGE) -DMODULEPATH=\"$(MODULEDIR)\", \ + -DMANPAGE=$(MANPAGE) '-DMODULEPATH="$(MODULEDIR)"', \ $(ICONFIGFILES)) + InstallDriverSDKNonExecFile($(XF86CONFIG),$(DRIVERSDKDIR)) InstallDriverSDKNonExecFile($(XF98CONFIG),$(DRIVERSDKDIR)) Index: xc/programs/Xserver/hw/xfree86/Options diff -u xc/programs/Xserver/hw/xfree86/Options:1.10 xc/programs/Xserver/hw/xfree86/Options:1.11 --- xc/programs/Xserver/hw/xfree86/Options:1.10 Sat Feb 15 01:46:30 2003 +++ xc/programs/Xserver/hw/xfree86/Options Fri Feb 13 18:58:33 2004 @@ -1,30 +1,50 @@ !! !! Copyright (c) 2001 by The XFree86 Project, Inc. +!! All rights reserved. !! -!! Permission is hereby granted, free of charge, to any person obtaining a -!! copy of this software and associated documentation files (the "Software"), -!! to deal in the Software without restriction, including without limitation -!! the rights to use, copy, modify, merge, publish, distribute, sublicense, -!! and/or sell copies of the Software, and to permit persons to whom the -!! Software is furnished to do so, subject to the following conditions: +!! 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. +!! 1. Redistributions of source code must retain the above copyright +!! notice, this list of conditions, and the following disclaimer. !! -!! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -!! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -!! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -!! THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -!! WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -!! OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -!! SOFTWARE. +!! 2. Redistributions in binary form must reproduce the above copyright +!! notice, this list of conditions and the following disclaimer +!! in the documentation and/or other materials provided with the +!! distribution, and in the same place and form as other copyright, +!! license and disclaimer information. !! -!! Except as contained in this notice, the name of the XFree86 Project shall -!! not be used in advertising or otherwise to promote the sale, use or other -!! dealings in this Software without prior written authorization from the -!! XFree86 Project. +!! 3. The end-user documentation included with the redistribution, +!! if any, must include the following acknowledgment: "This product +!! includes software developed by The XFree86 Project, Inc +!! (http://www.xfree86.org/) and its contributors", in the same +!! place and form as other third-party acknowledgments. Alternately, +!! this acknowledgment may appear in the software itself, in the +!! same form and location as other such third-party acknowledgments. !! -!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.10 2003/02/15 06:46:30 paulo Exp $ +!! 4. Except as contained in this notice, the name of The XFree86 +!! Project, Inc shall not be used in advertising or otherwise to +!! promote the sale, use or other dealings in this Software without +!! prior written authorization from The XFree86 Project, Inc. +!! +!! THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +!! WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +!! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +!! IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE +!! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +!! OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +!! OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +!! BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +!! WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +!! OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +!! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +!! +!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.11 2004/02/13 23:58:33 dawes Exp $ !! XAA options xaa.XaaNoCPUToScreenColorExpandFill:\ Index: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp diff -u xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.45 xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.47 --- xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.45 Wed Feb 19 23:05:12 2003 +++ xc/programs/Xserver/hw/xfree86/XF86Conf.cpp Fri Feb 13 18:58:33 2004 @@ -1,29 +1,49 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp,v 3.45 2003/02/20 04:05:12 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp,v 3.47 2004/02/13 23:58:33 dawes Exp $ XCOMM XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc. +XCOMM All rights reserved. XCOMM -XCOMM Permission is hereby granted, free of charge, to any person obtaining a -XCOMM copy of this software and associated documentation files (the "Software"), -XCOMM to deal in the Software without restriction, including without limitation -XCOMM the rights to use, copy, modify, merge, publish, distribute, sublicense, -XCOMM and/or sell copies of the Software, and to permit persons to whom the -XCOMM Software is furnished to do so, subject to the following conditions: -XCOMM -XCOMM The above copyright notice and this permission notice shall be included in -XCOMM all copies or substantial portions of the Software. -XCOMM -XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -XCOMM THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -XCOMM WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -XCOMM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -XCOMM SOFTWARE. -XCOMM -XCOMM Except as contained in this notice, the name of the XFree86 Project shall -XCOMM not be used in advertising or otherwise to promote the sale, use or other -XCOMM dealings in this Software without prior written authorization from the -XCOMM XFree86 Project. +XCOMM Permission is hereby granted, free of charge, to any person obtaining +XCOMM a copy of this software and associated documentation files (the +XCOMM "Software"), to deal in the Software without restriction, including +XCOMM without limitation the rights to use, copy, modify, merge, publish, +XCOMM distribute, sublicense, and/or sell copies of the Software, and to +XCOMM permit persons to whom the Software is furnished to do so, subject +XCOMM to the following conditions: +XCOMM +XCOMM 1. Redistributions of source code must retain the above copyright +XCOMM notice, this list of conditions, and the following disclaimer. +XCOMM +XCOMM 2. Redistributions in binary form must reproduce the above copyright +XCOMM notice, this list of conditions and the following disclaimer +XCOMM in the documentation and/or other materials provided with the +XCOMM distribution, and in the same place and form as other copyright, +XCOMM license and disclaimer information. +XCOMM +XCOMM 3. The end-user documentation included with the redistribution, +XCOMM if any, must include the following acknowledgment: "This product +XCOMM includes software developed by The XFree86 Project, Inc +XCOMM (http://www.xfree86.org/) and its contributors", in the same +XCOMM place and form as other third-party acknowledgments. Alternately, +XCOMM this acknowledgment may appear in the software itself, in the +XCOMM same form and location as other such third-party acknowledgments. +XCOMM +XCOMM 4. Except as contained in this notice, the name of The XFree86 +XCOMM Project, Inc shall not be used in advertising or otherwise to +XCOMM promote the sale, use or other dealings in this Software without +XCOMM prior written authorization from The XFree86 Project, Inc. +XCOMM +XCOMM THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +XCOMM WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +XCOMM MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +XCOMM IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE +XCOMM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +XCOMM OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +XCOMM OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +XCOMM BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +XCOMM WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +XCOMM OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +XCOMM EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. XCOMM XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ @@ -263,7 +283,7 @@ XCOMM Option "Protocol" "Auto" -XCOMM When using mouse connected to a PS/2 port (aka "MousePort), set the +XCOMM When using mouse connected to a PS/2 port (aka "MousePort"), set the XCOMM the protocol as follows. On some platforms some other settings may XCOMM be available. Index: xc/programs/Xserver/hw/xfree86/XF86Config.man diff -u xc/programs/Xserver/hw/xfree86/XF86Config.man:1.14 xc/programs/Xserver/hw/xfree86/XF86Config.man:1.24 --- xc/programs/Xserver/hw/xfree86/XF86Config.man:1.14 Wed Feb 26 13:59:49 2003 +++ xc/programs/Xserver/hw/xfree86/XF86Config.man Wed Nov 12 14:06:46 2003 @@ -1,11 +1,34 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.14 2003/02/26 18:59:49 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.24 2003/11/12 19:06:46 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH XF86Config __filemansuffix__ __vendorversion__ .SH NAME XF86Config - Configuration File for XFree86 +.SH INTRODUCTION +.B XFree86 +supports several mechanisms for supplying/obtaining configuration and +run-time parameters: command line options, environment variables, the +XF86Config configuration file, auto-detection, and fallback defaults. +When the same information is supplied in more than one way, the highest +precedence mechanism is used. The list of mechanisms is ordered from +highest precedence to lowest. Note that not all parameters can be +supplied via all methods. The available command line options and +environment variables (and some defaults) are described in the Xserver(1) +and XFree86(1) manual pages. Most configuration file parameters, with +their defaults, are described below. Driver and module specific +configuration parameters are described in the relevant driver or module +manual page. +.PP +Starting with version 4.4, +.B XFree86 +has support for generating a usable configuration at run-time when no +.B XF86Config +file is provided. The initial version of this automatic configuration +support is targeted at the most popular hardware and software platforms +supported by XFree86. Some details about how this works can be found +in the XFree86(1) and getconfig(1) manual pages. .SH DESCRIPTION -.I XFree86 +.B XFree86 uses a configuration file called .B XF86Config for its initial setup. This configuration file is searched for in the @@ -40,8 +63,8 @@ .I is the machine's hostname as reported by gethostname(3). .PP -When the X server is started by the "root" user, the config file search -locations are as follows: +When the XFree86 server is started by the "root" user, the config file +search locations are as follows: .PP .RS 4 .nf @@ -253,23 +276,23 @@ The .B Files section is used to specify some path names required by the server. -Some of these paths can also be set from the command line (see -.I Xserver(1) -and -.IR XFree86(1) ). -The command line settings override the values specified in the config -file. +Some of these paths can also be set from the command line (see Xserver(1) +and XFree86(1)). The command line settings override the values specified +in the config file. The +.B Files +section is optional, as are all of the entries that may appear in it. +.PP The entries that can appear in this section are: .TP 7 .BI "FontPath \*q" path \*q -sets the search path for fonts. This path is a comma separated -list of font path elements which the X server searches for font databases. +sets the search path for fonts. This path is a comma separated list of +font path elements which the XFree86 server searches for font databases. Multiple .B FontPath -entries may be specified, and they will be -concatenated to build up the fontpath used by the server. -Font path elements may be either absolute directory paths, or -a font server identifier. Font server identifiers have the form: +entries may be specified, and they will be concatenated to build up the +fontpath used by the server. Font path elements may be either absolute +directory paths, or a font server identifier. Font server identifiers +have the form: .PP .RS 11 .IR / : @@ -338,9 +361,9 @@ binary format RGB color databases. .TP 7 .BI "ModulePath \*q" path \*q -sets the search path for loadable X server modules. This path is a -comma separated list of directories which the X server searches for -loadable modules loading in the order specified. Multiple +sets the search path for loadable XFree86 server modules. This path is +a comma separated list of directories which the XFree86 server searches +for loadable modules loading in the order specified. Multiple .B ModulePath entries may be specified, and they will be concatenated to build the module search path used by the server. @@ -348,7 +371,8 @@ .ig .TP 7 .BI "LogFile \*q" path \*q -sets the name of the X server log file. The default log file name is +sets the name of the XFree86 server log file. The default log file name +is .PP .RS 11 .RI __logdir__/XFree86. .log @@ -357,17 +381,19 @@ .RS 7 where .I -is the display number for the X server. +is the display number for the XFree86 server. .. .SH SERVERFLAGS SECTION The .B ServerFlags section is used to specify some global -X server options. All of the entries in this section are +XFree86 server options. All of the entries in this section are .BR Options , although for compatibility purposes some of the old style entries are still recognised. Those old style entries are not documented here, and -using them is discouraged. +using them is discouraged. The +.B ServerFlags +section is optional, as are the entries that may be specified in it. .PP .B Options specified in this section (with the exception of the @@ -389,12 +415,12 @@ command line option. .TP 7 .BI "Option \*qNoTrapSignals\*q \*q" boolean \*q -This prevents the X server from trapping a range of unexpected -fatal signals and exiting cleanly. Instead, the X server will die +This prevents the XFree86 server from trapping a range of unexpected +fatal signals and exiting cleanly. Instead, the XFree86 server will die and drop core where the fault occurred. The default behaviour is -for the X server to exit cleanly, but still drop a core file. In +for the XFree86 server to exit cleanly, but still drop a core file. In general you never want to use this option unless you are debugging -an X server problem and know how to deal with the consequences. +an XFree86 server problem and know how to deal with the consequences. .TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the @@ -402,14 +428,14 @@ sequence (where .RI F n refers to one of the numbered function keys). That sequence is normally -used to switch to another \(oqvirtual terminal\)cq on operating systems +used to switch to another \*qvirtual terminal\*q on operating systems that have this feature. When this option is enabled, that key sequence has no special meaning and is passed to clients. Default: off. .TP 7 .BI "Option \*qDontZap\*q \*q" boolean \*q This disallows the use of the .B Ctrl+Alt+Backspace -sequence. That sequence is normally used to terminate the X server. +sequence. That sequence is normally used to terminate the XFree86 server. When this option is enabled, that key sequence has no special meaning and is passed to clients. Default: off. .TP 7 @@ -460,7 +486,7 @@ followed by a function key .RB ( Fn ). -This prevents the X server trapping the +This prevents the XFree86 server trapping the keys used for the default VT switch sequence, which means that clients can access them. Default: off. .TP 7 @@ -486,48 +512,46 @@ .BI "Option \*qBlankTime\*q \*q" time \*q sets the inactivity timeout for the blanking phase of the screensaver. .I time -is in minutes. This is equivalent to the Xserver's `-s' flag, and the -value can be changed at run-time with \fIxset(1)\fP. Default: 10 minutes. +is in minutes. This is equivalent to the XFree86 server's `-s' flag, +and the value can be changed at run-time with xset(1). Default: 10 +minutes. .TP 7 .BI "Option \*qStandbyTime\*q \*q" time \*q sets the inactivity timeout for the "standby" phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with \fIxset(1)\fP. -Default: 20 minutes. -This is only suitable for VESA DPMS compatible monitors, and may not be -supported by all video drivers. It is only enabled for screens that -have the +is in minutes, and the value can be changed at run-time with xset(1). +Default: 20 minutes. This is only suitable for VESA DPMS compatible +monitors, and may not be supported by all video drivers. It is only +enabled for screens that have the .B \*qDPMS\*q -option set (see the MONITOR section below). +option set (see the MONITOR section below). .TP 7 .BI "Option \*qSuspendTime\*q \*q" time \*q sets the inactivity timeout for the "suspend" phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with \fIxset(1)\fP. -Default: 30 minutes. -This is only suitable for VESA DPMS compatible monitors, and may not be -supported by all video drivers. It is only enabled for screens that -have the +is in minutes, and the value can be changed at run-time with xset(1). +Default: 30 minutes. This is only suitable for VESA DPMS compatible +monitors, and may not be supported by all video drivers. It is only +enabled for screens that have the .B \*qDPMS\*q -option set (see the MONITOR section below). +option set (see the MONITOR section below). .TP 7 .BI "Option \*qOffTime\*q \*q" time \*q sets the inactivity timeout for the "off" phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with \fIxset(1)\fP. -Default: 40 minutes. -This is only suitable for VESA DPMS compatible monitors, and may not be -supported by all video drivers. It is only enabled for screens that -have the +is in minutes, and the value can be changed at run-time with xset(1). +Default: 40 minutes. This is only suitable for VESA DPMS compatible +monitors, and may not be supported by all video drivers. It is only +enabled for screens that have the .B \*qDPMS\*q -option set (see the MONITOR section below). +option set (see the MONITOR section below). .TP 7 .BI "Option \*qPixmap\*q \*q" bpp \*q This sets the pixmap format to use for depth 24. Allowed values for .I bpp are 24 and 32. Default: 32 unless driver constraints don't allow this -(which is rare). Note: some clients don't behave well when -this value is set to 24. +(which is rare). Note: some clients don't behave well when this value +is set to 24. .TP 7 .BI "Option \*qPC98\*q \*q" boolean \*q Specify that the machine is a Japanese PC-98 machine. This should not @@ -537,65 +561,68 @@ .ig .TP 7 .BI "Option \*qEstimateSizesAggressively\*q \*q" value \*q -This option affects the way that bus resource sizes are estimated. Default: 0. +This option affects the way that bus resource sizes are estimated. +Default: 0. .. .TP 7 .BI "Option \*qNoPM\*q \*q" boolean \*q -Disables something to do with power management events. Default: PM enabled -on platforms that support it. +Disables something to do with power management events. Default: PM +enabled on platforms that support it. .TP 7 .BI "Option \*qXinerama\*q \*q" boolean \*q -enable or disable XINERAMA extension. Default is disabled. +enable or disable XINERAMA extension. Default is disabled. .TP 7 .BI "Option \*qAllowDeactivateGrabs\*q \*q" boolean \*q This option enables the use of the .B Ctrl+Alt+Keypad-Divide -key sequence to deactivate any active keyboard and mouse grabs. -Default: off. +key sequence to deactivate any active keyboard and mouse grabs. Default: +off. .TP 7 .BI "Option \*qAllowClosedownGrabs\*q \*q" boolean \*q This option enables the use of the .B Ctrl+Alt+Keypad-Multiply -key sequence to kill clients with an active keyboard or mouse grab as well -as killing any application that may have locked the server, -normally using the XGrabServer(__libmansuffix__) Xlib function. -Default: off. +key sequence to kill clients with an active keyboard or mouse grab as +well as killing any application that may have locked the server, normally +using the XGrabServer(__libmansuffix__) Xlib function. Default: off. .br Note that the options .BI AllowDeactivateGrabs and .BI AllowClosedownGrabs will allow users to remove the grab used by screen saver/locker programs. -An API was written to such cases. If you enable this option, make sure your -screen saver/locker is updated. +An API was written to such cases. If you enable this option, make sure +your screen saver/locker is updated. .TP 7 .BI "Option \*qHandleSpecialKeys\*q \*q" when \*q -This option controls when the server uses the builtin handler -to process special key combinations (such as +This option controls when the server uses the builtin handler to process +special key combinations (such as .BR Ctrl+Alt+Backspace ). -Normally the XKEYBOARD extension keymaps will provide mappings -for each of the special key combinations, so the builtin handler -is not needed unless the XKEYBOARD extension is disabled. -The value of +Normally the XKEYBOARD extension keymaps will provide mappings for each +of the special key combinations, so the builtin handler is not needed +unless the XKEYBOARD extension is disabled. The value of .I when can be .BR Always , .BR Never , or .BR WhenNeeded . -Default: Use the builtin handler only if needed. The server will -scan the keymap for a mapping to the +Default: Use the builtin handler only if needed. The server will scan +the keymap for a mapping to the .B Terminate action and, if found, use XKEYBOARD for processing actions, otherwise the builtin handler will be used. .SH MODULE SECTION The .B Module -section is used to specify which X server modules should be loaded. -This section is ignored when the X server is built in static form. -The types of modules normally loaded in this section are X server +section is used to specify which XFree86 server modules should be loaded. +This section is ignored when the XFree86 server is built in static form. +The types of modules normally loaded in this section are XFree86 server extension modules, and font rasteriser modules. Most other module types are loaded automatically when they are needed via other mechanisms. +The +.B Module +section is optional, as are all of the entries that may be specified in +it. .PP Entries in this section may be in two forms. The first and most commonly used form is an entry that uses the @@ -662,7 +689,9 @@ The config file may have multiple .B InputDevice sections. There will normally be at least two: one for the core (primary) -keyboard, and one of the core pointer. +keyboard, and one of the core pointer. If either of these two is missing, +a default configuration for the missing ones will be used. Currently the +default configuration may not work as expected on all platforms. .PP .B InputDevice sections have the following format: @@ -680,6 +709,14 @@ .PP The .B Identifier +and +.B Driver +entries are required in all +.B InputDevice +sections. All other entries are optional. +.PP +The +.B Identifier entry specifies the unique name for this input device. The .B Driver entry specifies the name of the driver to use for this input device. @@ -691,13 +728,25 @@ .B InputDevice section is considered active if it is referenced by an active .B ServerLayout -section, or if it is referenced by the +section, if it is referenced by the .B \-keyboard or .B \-pointer -command line options. +command line options, or if it is selected implicitly as the core pointer +or keyboard device in the absence of such explicit references. The most commonly used input drivers are "keyboard" and "mouse". .PP +In the absence of an explicitly specified core input device, the first +.B InputDevice +marked as +.B CorePointer +(or +.BR CoreKeyboard ) +is used. If there is no match there, the first +.B InputDevice +that uses the "mouse" (or "keyboard" or "kbd") driver is used. The final +fallback is to use built-in default configurations. +.PP .B InputDevice sections recognise some driver-independent .BR Options , @@ -764,6 +813,14 @@ .PP The .B Identifier +and +.B Driver +entries are required in all +.B Device +sections. All other entries are optional. +.PP +The +.B Identifier entry specifies the unique name for this graphics device. The .B Driver entry specifies the name of the driver to use for this graphics device. @@ -805,7 +862,7 @@ a secondary graphics card in a single-head configuration, this entry is mandatory. Its main purpose is to make an unambiguous connection between the device section and the hardware it is representing. This information -can usually be found by running the X server with the +can usually be found by running the XFree86 server with the .B \-scanpci command line option. .TP 7 @@ -862,22 +919,22 @@ the driver-specific documentation explicitly recommends that you do. .TP .BI "ClockChip \*q" clockchip-type \*q -This optional entry is used to specify the clock chip type on -graphics boards which have a programmable clock generator. Only -a few X servers support programmable clock chips. For details, -see the appropriate X server manual page. +This optional entry is used to specify the clock chip type on graphics +boards which have a programmable clock generator. Only a few XFree86 +drivers support programmable clock chips. For details, see the appropriate +driver manual page. .TP 7 .BI "VideoRam " "mem" This optional entry specifies the amount of video ram that is installed on the graphics board. This is measured in kBytes. In most cases this -is not required because the X server probes the graphics board to +is not required because the XFree86 server probes the graphics board to determine this quantity. The driver-specific documentation should indicate when it might be needed. .TP 7 .BI "BiosBase " "baseaddress" -This optional entry specifies the base address of the video BIOS -for the VGA board. This address is normally auto-detected, and should -only be specified if the driver-specific documentation recommends it. +This optional entry specifies the base address of the video BIOS for +the VGA board. This address is normally auto-detected, and should only +be specified if the driver-specific documentation recommends it. .TP 7 .BI "MemBase " "baseaddress" This optional entry specifies the memory base address of a graphics @@ -925,7 +982,8 @@ .SH MONITOR SECTION The config file may have multiple .B Monitor -sections. There must be at least one, for the monitor being used. +sections. There should normally be at least one, for the monitor being used, +but a default configuration will be created when one isn't specified. .PP .B Monitor sections have the following format: @@ -940,6 +998,12 @@ .fi .RE .PP +The only mandatory entry in a +.B Monitor +section is the +.B Identifier +entry. +.PP The .B Identifier entry specifies the unique name for this monitor. The @@ -979,10 +1043,11 @@ .B MHz or .B Hz -is added to the end of the line. The data given here is used by the X -server to determine if video modes are within the specifications of the -monitor. This information should be available in the monitor's handbook. -If this entry is omitted, a default range of 28\-33kHz is used. +is added to the end of the line. The data given here is used by the +XFree86 server to determine if video modes are within the specifications +of the monitor. This information should be available in the monitor's +handbook. If this entry is omitted, a default range of 28\-33kHz is +used. .TP 7 .BI "VertRefresh " "vertrefresh-range" gives the range(s) of vertical refresh frequencies supported by the @@ -994,10 +1059,10 @@ .B MHz or .B kHz -is added to the end of the line. The data given here is used by the X -server to determine if video modes are within the specifications of the -monitor. This information should be available in the monitor's handbook. -If this entry is omitted, a default range of 43-72Hz is used. +is added to the end of the line. The data given here is used by the +XFree86 server to determine if video modes are within the specifications +of the monitor. This information should be available in the monitor's +handbook. If this entry is omitted, a default range of 43-72Hz is used. .TP 7 .BI "DisplaySize " "width height" This optional entry gives the width and height, in millimetres, of the @@ -1007,21 +1072,21 @@ .BI "Gamma " "gamma-value" .TP 7 .BI "Gamma " "red-gamma green-gamma blue-gamma" -This is an optional entry that can be used to specify the gamma -correction for the monitor. It may be specified as either a single -value or as three separate RGB values. The values should be in the range -0.1 to 10.0, and the default is 1.0. Not all drivers are capable -of using this information. +This is an optional entry that can be used to specify the gamma correction +for the monitor. It may be specified as either a single value or as +three separate RGB values. The values should be in the range 0.1 to +10.0, and the default is 1.0. Not all drivers are capable of using this +information. .TP 7 .BI "UseModes \*q" modesection-id \*q Include the set of modes listed in the .B Modes section called .IR modesection-id. -This make all of the modes defined in that section available for use -by this monitor. +This make all of the modes defined in that section available for use by +this monitor. .TP 7 -.B Mode \fI"name"\fP +.BI "Mode \*q" name \*q This is an optional multi-line entry that can be used to provide definitions for video modes for the monitor. In most cases this isn't necessary because the built-in set of VESA standard modes will be @@ -1230,6 +1295,12 @@ .PP The .B Identifier +and +.B Device +entries are mandatory. All others are optional. +.PP +The +.B Identifier entry specifies the unique name for this screen. The .B Screen section provides information specific to the whole screen, including @@ -1242,7 +1313,7 @@ for this section are: .TP 7 .BI "Device \*q" device-id \*q -This specifies the +This mandatory entry specifies the .B Device section to be used for this screen. This is what ties a specific graphics card to a screen. The @@ -1255,6 +1326,10 @@ .TP 7 .BI "Monitor \*q" monitor-id \*q specifies which monitor description is to be used for this screen. +If a +.B Monitor +name is not specified, a default configuration is used. Currently the default +configuration may not function as expected on all platforms. .TP 7 .BI "VideoAdaptor \*q" xv-id \*q specifies an optional Xv video adaptor description to be used with this @@ -1287,12 +1362,28 @@ .TP 7 .BI "Option \*qAccel\*q" Enables XAA (X Acceleration Architecture), a mechanism that makes video -cards' 2D hardware acceleration available to the X server. This option is -on by default, but it may be necessary to turn it off if there are bugs in -the driver. There are many options to disable specific acclerated -operations, listed below. Note that disabling an operation will have no -effect if the operation is not accelerated (whether due to lack of support -in the hardware or in the driver). +cards' 2D hardware acceleration available to the XFree86 server. This +option is on by default, but it may be necessary to turn it off if there +are bugs in the driver. There are many options to disable specific +accelerated operations, listed below. Note that disabling an operation +will have no effect if the operation is not accelerated (whether due to +lack of support in the hardware or in the driver). +.TP 7 +.BI "Option \*qBiosLocation\*q \*q" address \*q +Set the location of the BIOS for the Int10 module. One may select a BIOS +of another card for posting or the legacy V_BIOS range located at 0xc0000 +or an alternative address (BUS_ISA). This is only useful under very +special circumstances and should be used with extreme care. +.TP 7 +.BI "Option \*qInitPrimary\*q \*q" boolean \*q +Use the Int10 module to initialize the primary graphics card. Normally, +only secondary cards are soft-booted using the Int10 module, as the +primary card has already been initialized by the BIOS at boot time. +Default: false. +.TP 7 +.BI "Option \*qNoInt10\*q \*q" boolean \*q +Disables the Int10 module, a module that uses the int10 call to the BIOS +of the graphics card to initialize it. Default: false. .TP 7 .BI "Option \*qNoMTRR\*q" Disables MTRR (Memory Type Range Register) support, a feature of modern @@ -1319,7 +1410,7 @@ Disables accelerated dashed line draws between two arbitrary points. .TP 7 .BI "Option \*qXaaNoImageWriteRect\*q" -Disables acclerated transfers of full-color rectangular patterns from +Disables accelerated transfers of full-color rectangular patterns from system memory to video memory (using a memory-mapped aperture). .TP 7 .BI "Option \*qXaaNoMono8x8PatternFillRect\*q" @@ -1341,7 +1432,7 @@ stored in system memory (one scan line at a time). .TP 7 .BI "Option \*qXaaNoScanlineImageWriteRect\*q" -Disables acclerated transfers of full-color rectangular patterns from +Disables accelerated transfers of full-color rectangular patterns from system memory to video memory (one scan line at a time). .TP 7 .BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q" @@ -1349,8 +1440,8 @@ stored in offscreen video memory. .TP 7 .BI "Option \*qXaaNoScreenToScreenCopy\*q" -Disables accelerated copies of rectangular regions from one part of video -memory to another part of video memory. +Disables accelerated copies of rectangular regions from one part of +video memory to another part of video memory. .TP 7 .BI "Option \*qXaaNoSolidBresenhamLine\*q" Disables accelerated solid Bresenham line draws. @@ -1369,7 +1460,7 @@ .PP Each .B Screen -section must contain one or more +section may optionally contain one or more .B Display subsections. Those subsections provide depth/fbbpp specific configuration information, and the one chosen depends on the depth and/or fbbpp that @@ -1382,11 +1473,16 @@ .B Screen section may have multiple .B Display -subsections. There must be at least one, which matches the depth -and/or fbbpp values that are being used for the screen. The "active" +subsections. +The "active" .B Display subsection is the first that matches the depth and/or fbbpp values being -used. +used, or failing that, the first that has neither a depth or fbbpp value +specified. The +.B Display +subsections are optional. When there isn't one that matches the depth +and/or fbbpp values being used, all the parameters that can be specified +here fall back to their defaults. .PP .B Display subsections have the following format: @@ -1405,10 +1501,12 @@ .BI "Depth " depth This entry specifies what colour depth the .B Display -subsection is to be used for. This entry is usually mandatory, -but it may be omitted in some cases providing an +subsection is to be used for. This entry is usually specified, +but it may be omitted to create a match-all +.B Display +subsection or when wishing to match only against the .B FbBpp -entry is present. The range of +parameter. The range of .I depth values that are allowed depends on the driver. Most driver support 8, 15, 16 and 24. Some also support 1 and/or 4, and some may support @@ -1434,8 +1532,7 @@ for a screen is being used at depth 16 for drivers that allow multiple formats. This may also be specified from the command line with the .B \-weight -option (see -.IR XFree86(1) ). +option (see XFree86(1)). .TP 7 .BI "Virtual " "xdim ydim" This optional entry specifies the virtual screen resolution to be used. @@ -1458,8 +1555,7 @@ area. .TP 7 .BI "Modes \*q" mode-name \*q " ..." -This entry is highly desirable for most drivers, and it specifies the list -of video modes to use. Each +This optional entry specifies the list of video modes to use. Each .I mode-name specified must be in double quotes. They must correspond to those specified or referenced in the appropriate @@ -1472,16 +1568,17 @@ .B Ctrl+Alt+Keypad-Plus and to the previous mode with .BR Ctrl+Alt+Keypad-Minus . -When this entry is omitted, the largest valid mode referenced by the -appropriate +When this entry is omitted, the valid modes referenced by the appropriate .B Monitor -section will be used. +section will be used. If the +.B Monitor +section contains no modes, then the selection will be taken from the +built-in VESA standard modes. .TP 7 .BI "Visual \*q" visual-name \*q This optional entry sets the default root visual type. This may also -be specified from the command line (see the -.I Xserver(1) -man page). The visual types available for depth 8 are (default is +be specified from the command line (see the Xserver(1) man page). The +visual types available for depth 8 are (default is .BR PseudoColor ): .PP .RS 11 @@ -1585,6 +1682,14 @@ .fi .RE .PP +Each +.B ServerLayout +section must have an +.B Identifier +entry and at least one +.B Screen +entry. +.PP The .B Identifier entry specifies the unique name for this server layout. The @@ -1628,7 +1733,7 @@ keyword is optional. Some older versions of XFree86 (4.2 and earlier) don't recognise the .B Absolute -keyword, so it's safest to just specificy the coorindates without it. +keyword, so it's safest to just specify the coordinates without it. .TP 4 .BI "RightOf \*q" screen-id \*q .TP 4 @@ -1650,9 +1755,13 @@ .RE .TP 7 .BI "InputDevice \*q" idev-id "\*q \*q" option \*q " ..." -One of these entries must be given for each input device being used in +One of these entries should be given for each input device being used in a session. Normally at least two are required, one each for the core -pointer and keyboard devices. The +pointer and keyboard devices. If either of those is missing, suitable +.B InputDevice +entries are searched for using the method described above in the +.B INPUTDEVICE +section. The .I idev-id field is mandatory, and specifies the name of the .B InputDevice @@ -1725,46 +1834,46 @@ __projectroot__/lib/X11/XF86Config.eg. .fi .SH "SEE ALSO" -.IR X(__miscmansuffix__), -.IR Xserver(1), -.IR XFree86(1), -.IR apm(__drivermansuffix__), +X(__miscmansuffix__), +Xserver(1), +XFree86(1), +apm(__drivermansuffix__), .\" .IR ati(__drivermansuffix__), -.IR chips(__drivermansuffix__), -.IR cirrus(__drivermansuffix__), -.IR cyrix(__drivermansuffix__), -.IR fbdev(__drivermansuffix__), -.IR glide(__drivermansuffix__), -.IR glint(__drivermansuffix__), -.IR i128(__drivermansuffix__), -.IR i740(__drivermansuffix__), -.IR i810(__drivermansuffix__), -.IR imstt(__drivermansuffix__), -.IR mga(__drivermansuffix__), -.IR neomagic(__drivermansuffix__), -.IR nv(__drivermansuffix__), -.IR r128(__drivermansuffix__), -.IR rendition(__drivermansuffix__), -.IR savage(__drivermansuffix__), -.IR s3virge(__drivermansuffix__), +chips(__drivermansuffix__), +cirrus(__drivermansuffix__), +cyrix(__drivermansuffix__), +fbdev(__drivermansuffix__), +glide(__drivermansuffix__), +glint(__drivermansuffix__), +i128(__drivermansuffix__), +i740(__drivermansuffix__), +i810(__drivermansuffix__), +imstt(__drivermansuffix__), +mga(__drivermansuffix__), +neomagic(__drivermansuffix__), +nv(__drivermansuffix__), +r128(__drivermansuffix__), +rendition(__drivermansuffix__), +savage(__drivermansuffix__), +s3virge(__drivermansuffix__), .\" .IR shadowfb(__drivermansuffix__), -.IR siliconmotion(__drivermansuffix__), -.IR sis(__drivermansuffix__), -.IR sunbw2(__drivermansuffix__), -.IR suncg14(__drivermansuffix__), -.IR suncg3(__drivermansuffix__), -.IR suncg6(__drivermansuffix__), -.IR sunffb(__drivermansuffix__), -.IR sunleo(__drivermansuffix__), -.IR suntcx(__drivermansuffix__), -.IR tdfx(__drivermansuffix__), -.IR tga(__drivermansuffix__), -.IR trident(__drivermansuffix__), -.IR tseng(__drivermansuffix__), -.IR v4l(__drivermansuffix__), -.IR vesa(__drivermansuffix__), -.IR vga(__drivermansuffix__), -.IR vmware(__drivermansuffix__), +siliconmotion(__drivermansuffix__), +sis(__drivermansuffix__), +sunbw2(__drivermansuffix__), +suncg14(__drivermansuffix__), +suncg3(__drivermansuffix__), +suncg6(__drivermansuffix__), +sunffb(__drivermansuffix__), +sunleo(__drivermansuffix__), +suntcx(__drivermansuffix__), +tdfx(__drivermansuffix__), +tga(__drivermansuffix__), +trident(__drivermansuffix__), +tseng(__drivermansuffix__), +v4l(__drivermansuffix__), +vesa(__drivermansuffix__), +vga(__drivermansuffix__), +vmware(__drivermansuffix__), .br README .IR , Index: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp diff -u xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.3 xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.4 --- xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.3 Mon Dec 17 15:52:30 2001 +++ xc/programs/Xserver/hw/xfree86/XF98Conf.cpp Fri Feb 13 18:58:34 2004 @@ -1,29 +1,49 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp,v 1.3 2001/12/17 20:52:30 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp,v 1.4 2004/02/13 23:58:34 dawes Exp $ XCOMM XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc. +XCOMM All rights reserved. XCOMM -XCOMM Permission is hereby granted, free of charge, to any person obtaining a -XCOMM copy of this software and associated documentation files (the "Software"), -XCOMM to deal in the Software without restriction, including without limitation -XCOMM the rights to use, copy, modify, merge, publish, distribute, sublicense, -XCOMM and/or sell copies of the Software, and to permit persons to whom the -XCOMM Software is furnished to do so, subject to the following conditions: -XCOMM -XCOMM The above copyright notice and this permission notice shall be included in -XCOMM all copies or substantial portions of the Software. -XCOMM -XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -XCOMM THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -XCOMM WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -XCOMM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -XCOMM SOFTWARE. -XCOMM -XCOMM Except as contained in this notice, the name of the XFree86 Project shall -XCOMM not be used in advertising or otherwise to promote the sale, use or other -XCOMM dealings in this Software without prior written authorization from the -XCOMM XFree86 Project. +XCOMM Permission is hereby granted, free of charge, to any person obtaining +XCOMM a copy of this software and associated documentation files (the +XCOMM "Software"), to deal in the Software without restriction, including +XCOMM without limitation the rights to use, copy, modify, merge, publish, +XCOMM distribute, sublicense, and/or sell copies of the Software, and to +XCOMM permit persons to whom the Software is furnished to do so, subject +XCOMM to the following conditions: +XCOMM +XCOMM 1. Redistributions of source code must retain the above copyright +XCOMM notice, this list of conditions, and the following disclaimer. +XCOMM +XCOMM 2. Redistributions in binary form must reproduce the above copyright +XCOMM notice, this list of conditions and the following disclaimer +XCOMM in the documentation and/or other materials provided with the +XCOMM distribution, and in the same place and form as other copyright, +XCOMM license and disclaimer information. +XCOMM +XCOMM 3. The end-user documentation included with the redistribution, +XCOMM if any, must include the following acknowledgment: "This product +XCOMM includes software developed by The XFree86 Project, Inc +XCOMM (http://www.xfree86.org/) and its contributors", in the same +XCOMM place and form as other third-party acknowledgments. Alternately, +XCOMM this acknowledgment may appear in the software itself, in the +XCOMM same form and location as other such third-party acknowledgments. +XCOMM +XCOMM 4. Except as contained in this notice, the name of The XFree86 +XCOMM Project, Inc shall not be used in advertising or otherwise to +XCOMM promote the sale, use or other dealings in this Software without +XCOMM prior written authorization from The XFree86 Project, Inc. +XCOMM +XCOMM THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +XCOMM WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +XCOMM MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +XCOMM IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE +XCOMM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +XCOMM OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +XCOMM OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +XCOMM BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +XCOMM WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +XCOMM OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +XCOMM EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. XCOMM XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ Index: xc/programs/Xserver/hw/xfree86/XFree86.man diff -u xc/programs/Xserver/hw/xfree86/XFree86.man:3.59 xc/programs/Xserver/hw/xfree86/XFree86.man:3.65 --- xc/programs/Xserver/hw/xfree86/XFree86.man:3.59 Wed Feb 26 13:59:49 2003 +++ xc/programs/Xserver/hw/xfree86/XFree86.man Wed Nov 12 14:06:46 2003 @@ -1,24 +1,30 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.man,v 3.59 2003/02/26 18:59:49 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.man,v 3.65 2003/11/12 19:06:46 dawes Exp $ .TH XFree86 1 __vendorversion__ .SH NAME XFree86 - X11R6 X server .SH SYNOPSIS .B XFree86 -[:display] [option ...] +.RI [\fB:\fP display ] +.RI [ option +.IR ... ] .SH DESCRIPTION -XFree86 is an X server that was originally designed for UNIX and UNIX-like -operating systems running on Intel x86 hardware. It now runs on a wider -range of hardware and OS platforms. +.B XFree86 +is a full featured X server that was originally designed for UNIX and +UNIX-like operating systems running on Intel x86 hardware. It now runs +on a wider range of hardware and OS platforms. .PP This work was originally derived from .I "X386\ 1.2" -which was contributed to X11R5 by Snitily Graphics Consulting Service. -The XFree86 X server architecture was redesigned for the 4.0 release, -and it includes among other things a loadable module system donated by -Metro Link, Inc. The current XFree86 release is compatible with X11R6.6. -.SH CONFIGURATIONS +by Thomas Roell which was contributed to X11R5 by Snitily Graphics +Consulting Service. The +.B XFree86 +server architecture was redesigned for the 4.0 release, and it includes +among many other things a loadable module system derived from code +donated by Metro Link, Inc. The current XFree86 release is compatible +with X11R6.6. +.SH PLATFORMS .PP -.I XFree86 +.B XFree86 operates under a wide range of operating systems and hardware platforms. The Intel x86 (IA32) architecture is the most widely supported hardware platform. Other hardware platforms include Compaq Alpha, Intel IA64, @@ -30,7 +36,8 @@ XDarwin(1) X server. Win32/Cygwin is supported with the XWin X server. .PP .SH "NETWORK CONNECTIONS" -\fIXFree86\fP supports connections made using the following reliable +.B XFree86 +supports connections made using the following reliable byte-streams: .TP 4 .I "Local" @@ -39,21 +46,32 @@ STREAMS pipes, named pipes, and some other mechanisms. .TP 4 .I TCP\/IP -\fIXFree86\fP listens on port 6000+\fIn\fP, where \fIn\fP is the display -number. This connection type can be disabled with the \fB\-nolisten\fP +.B XFree86 +listens on port +.RI 6000+ n , +where +.I n +is the display number. This connection type can be disabled with the +.B \-nolisten option (see the Xserver(1) man page for details). .SH "ENVIRONMENT VARIABLES" -For operating systems that support local connections other than Unix Domain -sockets (SVR3 and SVR4), there is a compiled-in list specifying the order -in which local connections should be attempted. This list can be overridden by -the \fIXLOCAL\fP environment variable described below. If the display name -indicates a best-choice connection should be made (e.g. \fI:0.0\fP), each -connection mechanism is tried until a connection succeeds or no more -mechanisms are available. Note: for these OSs, the Unix Domain socket -connection is treated differently from the other local connection types. -To use it the connection must be made to \fIunix:0.0\fP. -.PP -The \fIXLOCAL\fP environment variable should contain a list of one more +For operating systems that support local connections other than Unix +Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying +the order in which local connections should be attempted. This list +can be overridden by the +.I XLOCAL +environment variable described below. If the display name indicates a +best-choice connection should be made (e.g. +.BR :0.0 ), +each connection mechanism is tried until a connection succeeds or no +more mechanisms are available. Note: for these OSs, the Unix Domain +socket connection is treated differently from the other local connection +types. To use it the connection must be made to +.BR unix:0.0 . +.PP +The +.I XLOCAL +environment variable should contain a list of one more more of the following: .PP .RS 8 @@ -65,29 +83,68 @@ .fi .RE .PP -which represent SVR4 Named Streams pipe, Old-style USL -Streams pipe, SCO XSight Streams pipe, and ISC Streams pipe, respectively. -You can select a single mechanism (e.g. \fIXLOCAL=NAMED\fP), or an ordered -list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP). This variable overrides the -compiled-in defaults. For SVR4 it is recommended that \fINAMED\fP be -the first preference connection. The default setting is -\fIPTS:NAMED:ISC:SCO\fP. +which represent SVR4 Named Streams pipe, Old-style USL Streams pipe, +SCO XSight Streams pipe, and ISC Streams pipe, respectively. You can +select a single mechanism (e.g. +.IR XLOCAL=NAMED ), +or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP). +his variable overrides the compiled-in defaults. For SVR4 it is +recommended that +.I NAMED +be the first preference connection. The default setting is +.IR PTS:NAMED:ISC:SCO . .PP To globally override the compiled-in defaults, you should define (and -export if using \fIsh\fP or \fIksh\fP) \fIXLOCAL\fP globally. If you -use \fIstartx/xinit\fP, the definition should be at the top of -your \fI.xinitrc\fP file. If you use \fIxdm\fP, the definitions should be -early on in the \fI __projectroot__/lib/X11/xdm/Xsession\fP script. +export if using +.B sh +or +.BR ksh ) +.I XLOCAL +globally. If you use startx(1) or xinit(1), the definition should be +at the top of your +.I .xinitrc +file. If you use xdm(1), the definitions should be early on in the +.I __projectroot__/lib/X11/xdm/Xsession +script. .SH OPTIONS -In addition to the normal server options described in the \fIXserver(1)\fP -manual page, \fIXFree86\fP accepts the following command line switches: +.B XFree86 +supports several mechanisms for supplying/obtaining configuration and +run-time parameters: command line options, environment variables, the +XF86Config(__filemansuffix__) configuration file, auto-detection, and +fallback defaults. When the same information is supplied in more than +one way, the highest precedence mechanism is used. The list of mechanisms +is ordered from highest precedence to lowest. Note that not all parameters +can be supplied via all methods. The available command line options +and environment variables (and some defaults) are described here and in +the Xserver(1) manual page. Most configuration file parameters, with +their defaults, are described in the XF86Config(__filemansuffix__) manual +page. Driver and module specific configuration parameters are described +in the relevant driver or module manual page. +.PP +Starting with version 4.4, +.B XFree86 +has support for generating a usable configuration at run-time when no +XF86Config(__filemansuffix__) configuration file is provided. The +initial version of this automatic configuration support is targeted at +the most popular hardware and software platforms supported by XFree86. +Some details about how this works can be found in the +.B CONFIGURATION +section below and in the getconfig(1) manual page. +.PP +In addition to the normal server options described in the Xserver(1) +manual page, +.B XFree86 +accepts the following command line switches: .TP 8 -.B vt\fIXX\fP -\fIXX\fP specifies the Virtual Terminal device number which \fIXFree86\fP -will use. Without this option, \fIXFree86\fP will pick the first -available Virtual Terminal that it can locate. This option applies only -to platforms such as Linux, BSD, SVR3 and SVR4, that have virtual terminal -support. +.BI vt XX +.I XX +specifies the Virtual Terminal device number which +.B XFree86 +will use. Without this option, +.B XFree86 +will pick the first available Virtual Terminal that it can locate. This +option applies only to platforms such as Linux, BSD, SVR3 and SVR4, that +have virtual terminal support. .TP .B \-allowMouseOpenFail Allow the server to start up even if the mouse device can't be opened @@ -110,8 +167,10 @@ XF86Config(__filemansuffix__) file option. By default non-local connections are not allowed. .TP 8 -.B \-bgamma \fIvalue\fP -Set the blue gamma correction. \fIvalue\fP must be between 0.1 and 10. +.BI \-bgamma " value" +Set the blue gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. Not all drivers support this. See also the .BR \-gamma , .BR \-rgamma , @@ -119,25 +178,30 @@ .B \-ggamma options. .TP 8 -.B \-bpp \fIn\fP -No longer supported. Use \fB\-depth\fP to set the color depth, and use -\fB\-fbbpp\fP if you really need to force a non-default framebuffer -(hardware) pixel format. +.BI \-bpp " n" +No longer supported. Use +.B \-depth +to set the color depth, and use +.B \-fbbpp +if you really need to force a non-default framebuffer (hardware) pixel +format. .TP .B \-configure -When this option is specified, the X server loads all video driver -modules, probes for available hardware, and writes out an initial -XF86Config(__filemansuffix__) file based on what was detected. This -option currently has some problems on some platforms, but in most cases -it is a good way to bootstrap the configuration process. This option -is only available when the server is run as root (i.e, with real-uid -0). -.TP 8 -.B \-crt /dev/tty\fIXX\fP -SCO only. This is the same as the \fBvt\fP option, and is provided for -compatibility with the native SCO X server. +When this option is specified, the +.B XFree86 +server loads all video driver modules, probes for available hardware, +and writes out an initial XF86Config(__filemansuffix__) file based on +what was detected. This option currently has some problems on some +platforms, but in most cases it is a good way to bootstrap the +configuration process. This option is only available when the server +is run as root (i.e, with real-uid 0). +.TP 8 +.BI "\-crt /dev/tty" XX +SCO only. This is the same as the +.B vt +option, and is provided for compatibility with the native SCO X server. .TP 8 -.B \-depth \fIn\fP +.BI \-depth " n" Sets the default color depth. Legal values are 1, 4, 8, 15, 16, and 24. Not all drivers support all values. .TP 8 @@ -157,27 +221,33 @@ .B \-fbbpp \fIn\fP Sets the number of framebuffer bits per pixel. You should only set this if you're sure it's necessary; normally the server can deduce the correct -value from \fB\-depth\fP above. Useful if you want to run a depth 24 -configuration with a 24 bpp framebuffer rather than the (possibly default) -32 bpp framebuffer (or vice versa). Legal values are 1, 8, 16, 24, 32. -Not all drivers support all values. +value from +.B \-depth +above. Useful if you want to run a depth 24 configuration with a 24 +bpp framebuffer rather than the (possibly default) 32 bpp framebuffer +(or vice versa). Legal values are 1, 8, 16, 24, 32. Not all drivers +support all values. .TP 8 .B \-flipPixels Swap the default values for the black and white pixels. .TP 8 -.B \-gamma \fIvalue\fP -Set the gamma correction. \fIvalue\fP must be between 0.1 and 10. The -default is 1.0. This value is applied equally to the R, G and B values. -Those values can be set independently with the +.BI \-gamma " value" +Set the gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. This value is applied +equally to the R, G and B values. Those values can be set independently +with the .BR \-rgamma , .BR \-bgamma , and .B \-ggamma options. Not all drivers support this. .TP 8 -.B \-ggamma \fIvalue\fP -Set the green gamma correction. \fIvalue\fP must be between 0.1 and -10. The default is 1.0. Not all drivers support this. See also the +.BI \-ggamma " value" +Set the green gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. Not all drivers support +this. See also the .BR \-gamma , .BR \-rgamma , and @@ -185,32 +255,33 @@ options. .TP 8 .B \-ignoreABI -The X server checks the ABI revision levels of each module that it loads. -It will normally refuse to load modules with ABI revisions that are newer -than the server's. This is because such modules might use interfaces that -the server does not have. When this option is specified, mismatches like -this are downgraded from fatal errors to warnings. This option should -be used with care. +The +.B XFree86 +server checks the ABI revision levels of each module that it loads. It +will normally refuse to load modules with ABI revisions that are newer +than the server's. This is because such modules might use interfaces +that the server does not have. When this option is specified, mismatches +like this are downgraded from fatal errors to warnings. This option +should be used with care. .TP 8 .B \-keeptty Prevent the server from detaching its initial controlling terminal. This option is only useful when debugging the server. Not all platforms support (or can use) this option. .TP 8 -.B \-keyboard \fIkeyboard-name\fP +.BI \-keyboard " keyboard-name" Use the XF86Config(__filemansuffix__) file .B InputDevice section called .I keyboard-name as the core keyboard. This option is ignored when the .B Layout -section specifies a core keyboard. -In the absence of both a Layout section and this option, -the first relevant +section specifies a core keyboard. In the absence of both a Layout +section and this option, the first relevant .B InputDevice section is used for the core keyboard. .TP 8 -.B \-layout \fIlayout-name\fP +.BI \-layout " layout-name" Use the XF86Config(__filemansuffix__) file .B Layout section called @@ -219,34 +290,40 @@ .B Layout section is used. .TP 8 -.B \-logfile \fIfilename\fP +.BI \-logfile " filename" Use the file called .I filename -as the X server log file. The default log file is -.B __logdir__/XFree86.\fIn\fP.log +as the +.B XFree86 +server log file. The default log file is +.BI __logdir__/XFree86. n .log on most platforms, where .I n -is the display number of the X server. The default may be in a different -directory on some platforms. This option is only available when the -server is run as root (i.e, with real-uid 0). +is the display number of the +.B XFree86 +server. The default may be in a different directory on some platforms. +This option is only available when the server is run as root (i.e, with +real-uid 0). .TP 8 .BR \-logverbose " [\fIn\fP]" -Sets the verbosity level for information printed to the X server log -file. If the +Sets the verbosity level for information printed to the +.B XFree86 +server log file. If the .I n -value isn't supplied, each occurrance of this option increments the log +value isn't supplied, each occurrence of this option increments the log file verbosity level. When the .I n value is supplied, the log file verbosity level is set to that value. The default log file verbosity level is 3. .TP 8 -.B \-modulepath \fIsearchpath\fP +.BI \-modulepath " searchpath" Set the module search path to .IR searchpath . .I searchpath -is a comma separated list of directories to search for X server modules. -This option is only available when the server is run as root (i.e, with -real-uid 0). +is a comma separated list of directories to search for +.B XFree86 +server modules. This option is only available when the server is run +as root (i.e, with real-uid 0). .TP 8 .B \-nosilk Disable Silken Mouse support. @@ -255,43 +332,43 @@ Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel. The default is usually 32 bits per pixel. There is normally little reason to use this option. Some client applications don't like this -pixmap format, even though it is a perfectly legal format. -This is equvalent to the +pixmap format, even though it is a perfectly legal format. This is +equivalent to the .B Pixmap XF86Config(__filemansuffix__) file option. .TP 8 .B \-pixmap32 Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel. -This is usually the default. -This is equvalent to the +This is usually the default. This is equivalent to the .B Pixmap XF86Config(__filemansuffix__) file option. .TP 8 -.B \-pointer \fIpointer-name\fP +.BI \-pointer " pointer-name" Use the XF86Config(__filemansuffix__) file .B InputDevice section called .I pointer-name as the core pointer. This option is ignored when the .B Layout -section specifies a core pointer. -In the absence of both a Layout section and this option, -the first relevant +section specifies a core pointer. In the absence of both a Layout +section and this option, the first relevant .B InputDevice section is used for the core pointer. .TP 8 .B \-probeonly -Causes the server to exit after the device probing stage. The XF86Config -file is still used when this option is given, so information that can -be auto-detected should be commented out. +Causes the server to exit after the device probing stage. The +XF86Config(__filemansuffix__) file is still used when this option is +given, so information that can be auto-detected should be commented out. .TP 8 .B \-quiet Suppress most informational messages at startup. The verbosity level is set to zero. .TP 8 -.B \-rgamma \fIvalue\fP -Set the red gamma correction. \fIvalue\fP must be between 0.1 and 10. -The default is 1.0. Not all drivers support this. See also the +.BI \-rgamma " value" +Set the red gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. Not all drivers support +this. See also the .BR \-gamma , .BR \-bgamma , and @@ -299,11 +376,12 @@ options. .TP 8 .B \-scanpci -When this option is specified, the X server scans the PCI bus, and prints -out some information about each device that was detected. See also -scanpci(1) and pcitweak(1). +When this option is specified, the +.B XFree86 +server scans the PCI bus, and prints out some information about each +device that was detected. See also scanpci(1) and pcitweak(1). .TP 8 -.B \-screen \fIscreen-name\fP +.BI \-screen " screen-name" Use the XF86Config(__filemansuffix__) file .B Screen section called @@ -319,19 +397,19 @@ .B \-showconfig This is the same as the .B \-version -option, and is included for compatibility reasons. It may be removed in -a future release, so the +option, and is included for compatibility reasons. It may be removed +in a future release, so the .B \-version option should be used instead. .TP 8 -.B \-weight \fInnn\fP +.BI \-weight " nnn" Set RGB weighting at 16 bpp. The default is 565. This applies only to those drivers which support 16 bpp. .TP 8 .BR \-verbose " [\fIn\fP]" Sets the verbosity level for information printed on stderr. If the .I n -value isn't supplied, each occurrance of this option increments the +value isn't supplied, each occurrence of this option increments the verbosity level. When the .I n value is supplied, the verbosity level is set to that value. The default @@ -342,22 +420,24 @@ system/platform it was built on, and whether it includes module loader support. .TP 8 -.B \-xf86config \fIfile\fP -Read the server configuration from \fIfile\fP. This option will work -for any file when the server is run as root (i.e, with real-uid 0), or -for files relative to a directory in the config search path for all -other users. +.BI \-xf86config " file" +Read the server configuration from +.IR file . +This option will work for any file when the server is run as root (i.e, +with real-uid 0), or for files relative to a directory in the config +search path for all other users. .SH "KEYBOARD" .PP -The XFree86 server is normally configured to recognize various -special combinations of key presses that instruct the server to -perform some action, rather than just sending the keypress event -to a client application. -The default XKEYBOARD keymap defines the key combinations listed below. -The server also has these key combinations builtin to its event -handler for cases where the XKEYBOARD extension is not being used. -When using the XKEYBOARD extension, which key combinations -perform which actions is completely configurable. +The +.B XFree86 +server is normally configured to recognize various special combinations +of key presses that instruct the server to perform some action, rather +than just sending the key press event to a client application. The +default XKEYBOARD keymap defines the key combinations listed below. +The server also has these key combinations builtin to its event handler +for cases where the XKEYBOARD extension is not being used. When using +the XKEYBOARD extension, which key combinations perform which actions +is completely configurable. .PP For more information about when the builtin event handler is used to recognize the special key combinations, see @@ -366,7 +446,9 @@ option in the XF86Config(__filemansuffix__) man page. .PP The special combinations of key presses recognized directly -by \fIXFree86\fP are: +by +.B XFree86 +are: .TP 8 .B Ctrl+Alt+Backspace Immediately kills the server -- no questions asked. This can be disabled @@ -406,63 +488,98 @@ respectively. This can be disabled with the .B DontVTSwitch XF86Config(__filemansuffix__) file option. -.SH SETUP -.I XFree86 -uses a configuration file called \fBXF86Config\fP for its initial setup. -Refer to the -.I XF86Config(__filemansuffix__) -manual page for information about the -format of this file. +.SH CONFIGURATION +.B XFree86 +typically uses a configuration file called +.B XF86Config +for its initial setup. +Refer to the XF86Config(__filemansuffix__) manual page for information +about the format of this file. +.PP +Starting with version 4.4, +.B XFree86 +has a mechanism for automatically generating a built-in configuration +at run-time when no +.B XF86Config +file is present. The current version of this automatic configuration +mechanism works in three ways. +.PP +The first is via enhancements that have made many components of the +.B XF86Config +file optional. This means that information that can be probed or +reasonably deduced doesn't need to be specified explicitly, greatly +reducing the amount of built-in configuration information that needs to +be generated at run-time. +.PP +The second is to use an external utility called getconfig(1), when +available, to use meta-configuration information to generate a suitable +configuration for the primary video device. The meta-configuration +information can be updated to allow an existing installation to get the +best out of new hardware or to work around bugs that are found +post-release. +.PP +The third is to have "safe" fallbacks for most configuration information. +This maximises the likelihood that the +.B XFree86 +server will start up in some usable configuration even when information +about the specific hardware is not available. +.PP +The automatic configuration support for XFree86 is work in progress. +It is currently aimed at the most popular hardware and software platforms +supported by XFree86. Enhancements are planned for future releases. .SH FILES -The X server config file can be found in a range of locations. These -are documented fully in the -.I XF86Config(__filemansuffix__) -manual page. The most commonly used locations are shown here. +The +.B XFree86 +server config file can be found in a range of locations. These are +documented fully in the XF86Config(__filemansuffix__) manual page. The +most commonly used locations are shown here. .TP 30 -/etc/X11/XF86Config -Server configuration file +.B /etc/X11/XF86Config +Server configuration file. .TP 30 -/etc/X11/XF86Config-4 -Server configuration file +.B /etc/X11/XF86Config-4 +Server configuration file. .TP 30 -/etc/XF86Config -Server configuration file +.B /etc/XF86Config +Server configuration file. .TP 30 -__projectroot__/etc/XF86Config -Server configuration file +.B __projectroot__/etc/XF86Config +Server configuration file. .TP 30 -__projectroot__/lib/X11/XF86Config -Server configuration file +.B __projectroot__/lib/X11/XF86Config +Server configuration file. .TP 30 -__logdir__/XFree86.\fIn\fP.log -Server log file for display \fIn\fP. +.BI __logdir__/XFree86. n .log +Server log file for display +.IR n . .TP 30 -__projectroot__/bin/\(** -Client binaries +.B __projectroot__/bin/\(** +Client binaries. .TP 30 -__projectroot__/include/\(** -Header files +.B __projectroot__/include/\(** +Header files. .TP 30 -__projectroot__/lib/\(** -Libraries +.B __projectroot__/lib/\(** +Libraries. .TP 30 -__projectroot__/lib/X11/fonts/\(** -Fonts +.B __projectroot__/lib/X11/fonts/\(** +Fonts. .TP 30 -__projectroot__/lib/X11/rgb.txt -Color names to RGB mapping +.B __projectroot__/lib/X11/rgb.txt +Color names to RGB mapping. .TP 30 -__projectroot__/lib/X11/XErrorDB -Client error message database +.B __projectroot__/lib/X11/XErrorDB +Client error message database. .TP 30 -__projectroot__/lib/X11/app-defaults/\(** -Client resource specifications +.B __projectroot__/lib/X11/app-defaults/\(** +Client resource specifications. .TP 30 -__projectroot__/man/man?/\(** -Manual pages +.B __projectroot__/man/man?/\(** +Manual pages. .TP 30 -/etc/X\fIn\fP.hosts -Initial access control list for display \fIn\fP +.BI /etc/X n .hosts +Initial access control list for display +.IR n . .SH "SEE ALSO" X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XF86Config(__filemansuffix__), xf86config(1), xf86cfg(1), xvidtune(1), @@ -571,27 +688,37 @@ .PP .RS 4 .nf -Stuart Anderson \fIanderson@netsweng.com\fP -Robin Cutshaw \fIrobin@xfree86.org\fP David Dawes \fIdawes@xfree86.org\fP Egbert Eich \fIeich@xfree86.org\fP Marc Evans \fImarc@xfree86.org\fP -Dirk Hohndel \fIhohndel@xfree86.org\fP +Matthieu Herrb \fIherrb@xfree86.org\fP Alan Hourihane \fIalanh@xfree86.org\fP -Harald Koenig \fIkoenig@xfree86.org\fP Marc La France \fItsi@xfree86.org\fP Kevin Martin \fImartin@xfree86.org\fP Rich Murphey \fIrich@xfree86.org\fP -Takaaki Nomura \fIamadeus@yk.rim.or.jp\fP -Keith Packard \fIkeithp@xfree86.org\fP -Jon Tombs \fIjon@gtex02.us.es\fP Mark Vojkovich \fImarkv@xfree86.org\fP David Wexelblat \fIdwex@xfree86.org\fP .fi .RE .PP -\fIXFree86\fP source is available from the FTP server -\fI\fP, and from the XFree86 -CVS server \fI\fP. Documentation -and other information can be found from the XFree86 web site + +XFree86 source is available from the FTP server +\fI\fP, and from the XFree86 CVS +server \fI\fP. Documentation and other +information can be found from the XFree86 web site \fI\fP. + +.SH LEGAL +.PP +.B XFree86 +is copyright software, provided under licenses that permit modification +and redistribution in source and binary form without fee. Portions of +.B XFree86 +are copyright by The XFree86 Project, Inc. and numerous authors and +contributors from around the world. Licensing information can be found +at +.IR . +Refer to the source code for specific copyright notices. +.PP +.B XFree86(TM) +is a trademark of The XFree86 Project, Inc. Index: xc/programs/Xserver/hw/xfree86/xf86Date.h diff -u xc/programs/Xserver/hw/xfree86/xf86Date.h:1.3 xc/programs/Xserver/hw/xfree86/xf86Date.h:1.58 --- xc/programs/Xserver/hw/xfree86/xf86Date.h:1.3 Wed Feb 26 23:56:45 2003 +++ xc/programs/Xserver/hw/xfree86/xf86Date.h Sat Feb 28 19:09:26 2004 @@ -1,7 +1,53 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.3 2003/02/27 04:56:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.58 2004/02/29 00:09:26 dawes Exp $ */ +/* + * Copyright (c) 2004 by The XFree86 Project, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #ifndef XF86_DATE -#define XF86_DATE "27 February 2003" +#define XF86_DATE "29 February 2004" #endif Index: xc/programs/Xserver/hw/xfree86/xf86Version.h diff -u xc/programs/Xserver/hw/xfree86/xf86Version.h:3.543 xc/programs/Xserver/hw/xfree86/xf86Version.h:3.570 --- xc/programs/Xserver/hw/xfree86/xf86Version.h:3.543 Wed Feb 26 23:56:45 2003 +++ xc/programs/Xserver/hw/xfree86/xf86Version.h Sat Feb 28 19:09:26 2004 @@ -1,9 +1,56 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.543 2003/02/27 04:56:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.570 2004/02/29 00:09:26 dawes Exp $ */ + +/* + * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #ifndef XF86_VERSION_CURRENT #define XF86_VERSION_MAJOR 4 -#define XF86_VERSION_MINOR 3 +#define XF86_VERSION_MINOR 4 #define XF86_VERSION_PATCH 0 #define XF86_VERSION_SNAP 0 Index: xc/programs/Xserver/hw/xfree86/XF86Setup/CHANGELOG diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/CHANGELOG:3.11 xc/programs/Xserver/hw/xfree86/XF86Setup/CHANGELOG:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/CHANGELOG:3.11 Sun Sep 29 08:51:05 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/CHANGELOG Sat Feb 28 21:42:23 2004 @@ -1,452 +0,0 @@ - -0.1 14 Dec 1995 Proof of concept test version - just to - demonstrate how Tcl/Tk could be used without - a dependance on wish being installed and - how custom commands could be added for - communication with the server extensions - -0.2 8 Feb 1996 First serious development version. - Basic structure is complete as well as part of - mouse configuration. - Includes commands for connecting with both - the XFree86-Misc and VidMode extensions. - Uses Tcl 7.4p3 and Tk 4.0p3 and uses the VGA16 - server for initial graphics mode. - -0.3 3 Mar 1996 Mouse configuration updated to match latest - XFree86-Misc version (including ReOpen flag). - A few key bindings in Mouse configuration. - Some experimental Card configuration code. - Phase I now checks for Xqueue driver and asks - user if they want to use it. - Asks for name of symlink (e.g. /dev/mouse) to - real mouse device. - All XF86Config files include "XkbDisable" - Adds support of GlidePoint mouse protocol. - Frees memory allocated by VidMode library calls. - Added do/while loop command - -0.4 12 Mar 1996 Mouse configuration completed (includes adding - more keybindings, completing help text, and - finishing device symlink code). - Added comment to Imakefile about changing tcl - and tk library names to match those on the - system where it is being built - Added sleep, has_symlinks, link, and unlink - builtins - Removed some debugging code that was accidentally - left in 0.3 - Move the execution of the Phase I code to - after the processing of the command line - arguments - Corrected all incorrect references to ClearCTS - to be ClearRTS - Reset button up/down indicators when switching - to Mouse configuration - Display message "Applying changes..." while - waiting for call to XF86MiscSetMouseSettings - to complete - Set default mouse device name values depending - on selected protocol - Add check for OsMouse driver on SCO (and ask - user if it should be used) - Use new allowMouseOpenFail server option - Rewrite xf86cards_getentry and xf86vid_getmonitor - to be simpler and fix memory allocation probs. - Catch protocol errors when calling any of: - XF86MiscSetSaver, XF86VidModeLockModeSwitch, - XF86MiscSetKbdSettings, XF86VidModeSwitchMode, - XF86MiscSetMouseSettings - -0.5 23 Mar 1996 Added combobox widget - Card configuration added - Changed names of global variables to use a - (at least semi-)consistent coding standard - Change cursor to a watch while waiting for call - to XF86MiscSetMouseSettings to complete - Monitor configuration added - Added ability to display server specific - README files during Card configuration - Added option to the "message" procedure to - just display the message without waiting - for a key press. - Added the XFree86 logo to the intro screen - Improved the introductory text - -0.6 3 Jun 1996 Added ability to read in XF86Config file - Added binding to findConfigFile to return the - name of the config file that the server will use - Use $TMPDIR, $XWINHOME, and $XF86SETUPLIB, if set - Moved check for the Xwinhome directory from the - phase1.tcl file to the beginning of the main.c - file to better check for proper installation - of files - Added check for the existence of needed files - If the VGA16 server fails to start, try again - with chipset "generic" - Improved XF86Config generation - Listboxes no longer export the selection, - enabling the selection to remain set even - after a selection is made in another listbox - Support for multiple cards added - Support for multiple monitors added - Warn of missing README files - Added interface to XKBui library - Added some commands for communicating with - the XKB extension - Removed "Other" button and added "Keyboard" - Added checkbuttons for server flags - Added widgets for changing options, vram size, - and max ramdac speed, if defaults read from - XF86Config file - Final XF86Config is now copied into place - (after moving the original to XF86Config.bak) - Moved the standard modelines and sync ranges - into a separate file (mondata.tcl) - -0.7 22 Jun 1996 Added more XKB interface functions - Chosen geometry and symbol sets are now loaded - into the server - Prepared for integration into XFree86 tree - -0.8 30 Jun 1996 Various Imakefile changes (David Dawes) -(3.1.2Eb) Fix a few problems with mouse configuration - in the generated XF86Config file (e.g. don't - output a "SampleRate" line when not applicable - to the selected protocol) - When checking for a running server, don't close - the opened connection, thus preventing the - ugly server reset (David Dawes) - Fix mouse bindings in keyboard configuration - listboxes that weren't properly loading - the geometry and symbols - Modify the tkerror procedure to write a copy - of the stack trace to a file and tell the - user to submit a bug report - -0.9 7 Jul 1996 Change all "gets response" lines to "gets stdin -(3.1.2Ec) response" (Michael Rohleder) - Add a few prototypes and casts and some other - code cleanups - Add code in several places in tclxfconf.c - to prevent derefencing of NULL pointers - Plug some memory leaks - Don't output "SampleRate", if zero - -0.10 13 Jul 1996 Fix two more places where a NULL pointer could - be dereferenced (David Dawes) - Fix inconsistencies in handling of Display - subsections between C and Tcl code - Write out Display subsections for depths > 8 - Fix memory leak in XKB handling - Remove the parray proc from phase1.tcl (it was - used by some debugging code in an earlier - version and was accidentally left in when - that code was removed) - Check the found dialog executable to determine - if it's really the one that is wanted - Improved(?) handling of Modes and ModeLine - entries in generated XF86Config file - When writing the XF86Config file, the Visual - wasn't properly quoted - Decrease the wait between checks for the server - being ready to accept connections - for: - Put up a "Loading..." window asap after starting - the VGA16 server - Adjust size of widget borders and highlight - thicknesses in card.tcl to make things fit - better - Adjust border widths in keyboard.tcl and - monitor.tcl to be consistent w/ card.tcl - Start the VGA16 server with a larger stack size - limit (Matthieu Herrb reported overflows on - NetBSD) - Modify keyboard configuration code to use XKB - "rules" facilities - Catch attempt to backup existing config file - and display message indicating the backup - occurred only if successful (Michael Rohleder) - Make symlink from preferred server to 'X' - (based on patch by Michael Rohleder) - -0.11 20 Jul 1996 Fix bugs in "process_running" (Harald Koenig) - Fix ChipSet, RamDac, and ClockChip setting - for S3 server (Harald Koenig) - Modify main.c to enable shutdown of VGA16 - server before starting second server (there - are now five phases) - Added ability to specify on the command line - a script to be run - Added handling of standard wish arguments to - main.c (some are ignored unless a script is - specified) - Updated tclkbd.c and keyboard.tcl to match - latest XKB patches - Added separate mouse configuration program - Moved non-XF86Setup specific functions to - from setuplib.tcl to tcllib/misc.tcl - Moved some code that is used in more than one - phase to setuplib.tcl - If startup of second server fails, it is now - caught and the user is returned to phase2 - Moved the server flags to a separate "Other" - configuration screen - Improved "done" stuff - Make it compile with newer Tcl/Tk releases - -0.12 2 Aug 1996 Updated Imakefile -(3.1.2Ef) Full support for Tcl 7.5/Tk 4.1 added - More XKB updates (_XKB_RULES_NAMES property - support) - XKB functions no longer use a single static - xkb structure and now return a handle to the - allocated structure - Interface to xkbui library is now a full- - fledged Tk widget - Add function to write out all significant - variables to a state file - Add option to read in a state file - After shutting down a server, exec a new copy - of XF86Setup -- workaround Tk caching some - info about the server, which is no longer - true, because we start/stop servers behind - its back - Only put 640x480 modelines in the config file - used to start the VGA16 server - Renamed "message" to "mesg" to avoid conflict - with the Tk message widget - Handle XKB rules Options - add scrollbar, if - there are too many options to fit - Change writeXF86Config to take a filename, - instead of a file handle - In card configuration, update the message at - the bottom after clock probing is completed - Add -nodialog option to force plain text - output - Add some more comments to the C code - Add "flush stdout" statements to flush the - (Tcl 7.5) channel buffers - -0.13 15 Aug 1996 Process window path names to use as prefix -(3.1.2Eh) to other window paths - Add man pages for XF86Setup and xmseconfig - Imakefile updates (David Dawes) - Change exec of second XF86Setup to use execlp - instead of execl (David Dawes) - Modified config file reading routines to keep - all existing monitor and devices - this also - eliminated a bug in handling multiple - monitors/devices - Fixed typo in monitor sync rates (Harald Koenig) - Changed autorepeat timings for the scrollbar - associated with the card list - scrolling - takes too long with the VGA16 server - -0.14 16 Aug 1996 Added -notk option (when a script is specified) - When writing config file for VGA16 server, - don't write a Virtual size - Use -vgamode option when writing config file - used to start VGA16 server with - Chipset "generic" - Added "lrmdups" proc to eliminate duplicate - elements from a list - Fleshed out Chipset, RamDac, ClockChip, and - Options info in carddata.tcl - Output error message if exec-ing second copy - fails - Fixed bug w/ keyboard focus during monitor - configuration - Monitor sync range canvases now handle ranges - that exceed their limits - Fix bug in Card_clockprobe - cardDetail wasn't - declared global - The card list can now be accessed even when - the existing config file is read - Output "Aborted" message when abort is pressed - -0.15 17 Aug 1996 Added -script option to look for a file in -(3.1.2Ei) the scripts directory, otherwise the PATH - is searched - Fix typo in Mach64 RamDacs (David Dawes) - Fix typo in writing Virtual size (Harald Koenig) - Workaround bug in Tk 4.0 canvases that left - stray red lines in the monitor sync range - bars in certain cases - Use new -bestRefresh server option (David Dawes) - Add message line to keyboard config for - "Please wait..." type messages - Changed mouse device entry to a combobox w/ - list of devices from the /dev directory - Use list of devices to pick a default mouse - device - -0.16 19 Aug 1996 Improve patterns used to find available mouse - devices (David Dawes) - Sorted lists that are going to displayed in a - listbox - Fixed bug with mouse link not being read for - the real device when reading the exiting - config file - Real mouse device is converted to a full path - if the symlink was relative - Fixed bug where device wasn't reopened when a - new device name was specified - When reading the X link to find out what server - to use, strip off any directory name - Stack size limit is now changed in main.c on - OSes that support it - Write a 24bpp screen section to config file - Remove temp files when exiting normally - Check that the mouse link is in a directory - not writeable by non-root users - Update selection in listboxes when the value - of the entry changes - Change the mouse device combobox to a listbox - that is always showing - this is due to - problems with keybindings in comboboxes - (which are very important since the mouse - is probably not yet working when this list - is used) - -0.17 23 Aug 1996 Add new C&T README to list and use the -(3.1.2Em) Oak, WstDig, ati, etc. READMEs for the - Mono & VGA16 servers, as well as SVGA - Add ProjectRoot to the list of search directories - Start the VGA16 server just w/ Chipset "generic" - Add tcl commands for changing the umask and - for adding and removing directories - Add random function - Add "clock clicks" and "clock seconds" commands - to Tcl 7.4 interpreters - Move all temp files to a randomly named subdir - of a .XF86Setup* subdir - Place the mouse link with the rest of the - temp files and then write the actual mouse - device to the config file - Check the permissions of the temp subdirs - before any write to a file - When writing the config file, use the link - for the mouse device, except for the final - config file to which the actual device is - written (unless there was an existing - /dev/mouse link which already pointed to - the correct device - in that case write - /dev/mouse as the device name) - If the dacspeed "Probed" button is depressed, - and the user clicks on the slider, switch to - using the slider value - Add a pretty border to the popup help windows - Destroy existing help popups if the user - clicks on help, while one is already up - Don't show the mouse device entry box or - device list, if the user won't be able to - make any changes - Print messages to the text screen while in - graphics mode directing them to switch - to the correct VT - Let the user choose where to write the - config file (with the existing location, - as the default) - Reset list of clocks when a clock chip or a - different card or server is selected - Reset mouse button canvas when a new protocol - is selected - Change welcome screen to state that the - underlined letters indicate Ctrl or Alt - bindings - Add copyright and disclaimer notices - Add function to search along an axis for a - focus window - Add keybindings for the arrow keys - -0.18 25 Aug 1996 Added online help text -(3.1.2Eo) Some fixes for mouse device name handling - (David Dawes) - Add border to and fix the autorepeat timings for - the readme display box (David Dawes) - Improvements to mouse device name patterns - and searching (David Dawes) - Change default XF86Config file location to - /etc (David Dawes) - Fixed typo that caused the rmdir command to - call the MkDir function (David Dawes) - Fixed bug where prompt for config file name - wasn't being removed after saving to the - file - Changed "Applying" message in mouse setup to - use the same line as the "Press ? or Alt..." - message - Fixed mouse device name handling (completely?) - Removed clock probing from card.tcl and - now read clocks from startup messages of - the second server. - Added binding to in listboxes and - improve behavior of arrow keys within - listboxes - Set the BoardName to the name selected in the - Card list. - Fixed bug where the additional device lines - were appended to instead of replaced when - a new card was picked from the list - -1.00 26 Aug 1996 Updated XF86Setup & xmseconfig man pages -(3.1.2F) Fixed some security problems with mouse - device name handling - Fixed bug with device name handling for - Xqueue and OsMouse drivers - Updated xmseconfig to work with new mouse - device name changes - -1.01 30 Aug 1996 Fixed bug in setting default PS/2 device name - (Thomas Mueller) - Fixed bug in changing stack limit (the - sys/resource.h file wasn't being included) - Existing link to mouse device is read even if - not reading existing config file - Recursively read the X symlink - Prevent ServerNumLock from being selected - when writing a config file that uses XKB - Fixed dialog core dump due to too long of - line length in VGA16 server not found mesg - Set keyboard focus to "Okay" button when - user selects "Done" - Add xf86OsMouseOption() stub function to - tclxfconf.c (J. Kean Johnston) - Add gpmdata to list of mouse device patterns - Improved code that creates symlink to X server - -1.02 2 Sep 1996 Check for existence of chosen server -(3.1.2G) Remove some remaining probe code - Fix bug with writing device name to config - file when using Xqueue or OsMouse drivers - Add support for Alliance ProMotion driver - Add some partial support for the new - DefaultColorDepth option - -1.03 27 Sep 1996 Update mouse device patterns (Thomas Mueller) - Added chipset "newmmio" and clockchip "cirrus" - to carddata.tcl - Link w/ -ldl on appropriate OSes (James Hawtin, - Harald Koenig) - - needed when Tcl 7.5 or later is - configured to support dynamic loading - Restructured lists in carddata.tcl in prepa- - ration for restricting listboxes and the - README display to only the values appropriate - for the specified chipset - Added support for configuring "unsupported" - cards - Fixed messages about the chosen server not - being installed (they had an extra newline - embedded within them) - Added README.Mach32 to list - Added support for ViRGE and DECtga servers and - the Matrox SVGA driver - Add copyright and disclaimer to generated - config file - Make help and README displays readonly - When the mouse screen is first selected, the - help text pops up automagically - Changes to the mouse protocol cause an autoapply - - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile:3.31 xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile:3.31 Sat Sep 4 09:04:28 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile Sat Feb 28 21:42:23 2004 @@ -1,170 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/4 1996/10/24 10:16:33 kaleb $ - - - - - -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile,v 3.31 1999/09/04 13:04:28 dawes Exp $ -#include -#define IHaveSubdirs - -#if !BuildXKBlib || !BuildXF86MiscLibrary || !BuildXF86VidModeLibrary -all:: - @echo This program requires that you build with XKB, XF86Misc, and XF86VidMode - @exit 1 - -depend:: - @echo This program requires that you build with XKB, XF86Misc, and XF86VidMode - @exit 1 - -includes:: - @echo This program requires that you build with XKB, XF86Misc, and XF86VidMode - @exit 1 - -#else -#if !HasSnprintf - MISCSRCS = snprintf.c - MISCOBJS = snprintf.o - MISC_DEFINES = -DNEED_SNPRINTF -#endif - SRCS = main.c tclmisc.c tclvidmode.c tclcards.c tclother.c \ - tclkbd.c tclxfconf.c confread.c confwrite.c \ - cards.c tclxkbui.c tkother.c tclcurses.c $(MISCSRCS) - OBJS = main.o tclmisc.o tclvidmode.o tclcards.o tclother.o \ - tclkbd.o tclxfconf.o confread.o confwrite.o \ - cards.o tclxkbui.o tkother.o tclcurses.o $(MISCOBJS) - TCL_FILES = phase1.tcl phase2.tcl phase3.tcl phase4.tcl phase5.tcl \ - setuplib.tcl srvflags.tcl carddata.tcl \ - card.tcl done.tcl filelist.tcl keyboard.tcl \ - mseproto.tcl ph2notk.tcl kbddata.tcl vidmode.tcl \ - mondata.tcl monitor.tcl modeselect.tcl mouse.tcl LICENSE - TCLLIB_FILES = tcllib/button.tcl tcllib/combobox.tcl tcllib/misc.tcl \ - tcllib/downarrow.xbm tcllib/dialog.tcl tcllib/entry.tcl \ - tcllib/focus.tcl tcllib/init.tcl tcllib/listbox.tcl \ - tcllib/menu.tcl tcllib/optionMenu.tcl tcllib/palette.tcl \ - tcllib/scale.tcl tcllib/scrollbar.tcl tcllib/tclIndex \ - tcllib/tearoff.tcl tcllib/text.tcl tcllib/tk.tcl \ - tcllib/tkerror.tcl tcllib/uparrow.xbm tcllib/license.terms - PICS_FILES = pics/vidcard.xbm pics/vidcard.msk \ - pics/XFree86.xbm pics/XFree86.msk - SUBDIRS = scripts texts - -#if BuildServersOnly && !defined(UseInstalled) -/* Use installed X libraries and headers */ - USEINSTALLEDLIB = -L$(USRLIBDIR) - USEBUILTLIB = -L$(BUILDLIBDIR) - USEINSTALLEDINC = -I$(INCROOT) - LDPRELIB = -#undef XawClientDepLibs -#define XawClientDepLibs /**/ -#endif - - MODULEDEFINES = -DDEFAULT_MODULE_PATH=\"$(MODULEDIR)\" - -#ifdef DefaultFontPath -DEFAULTFONTPATH = DefaultFontPath -SITE_FONT_PATH = -DCOMPILEDDEFAULTFONTPATH=\"$(DEFAULTFONTPATH)\" -#endif - -#ifdef DefaultRGBDatabase -DEFAULTRGBDATABASE = DefaultRGBDatabase -SITE_RGB_DB = -DRGB_DB=\"$(DEFAULTRGBDATABASE)\" -#endif - -#if defined(SVR4Architecture) || (defined(LinuxArchitecture) && UseElfFormat) -/* Some OSs need this, and it should(?) be harmless when not needed */ -/* Not available for Linux x86/a.out and Linux AXP/ECOFF */ - EXTRASYSLIBS = -ldl -#endif - -#if XF86SetupUsesStaticTk - TKLIBRARY = StaticLibrary($(TKLIBDIR),$(TKLIBNAME)) -#endif -#if XF86SetupUsesStaticTcl - TCLLIBRARY = StaticLibrary($(TCLLIBDIR),$(TCLLIBNAME)) -#endif - - TCLTK_LIBRARIES = $(TKLIBRARY) $(TCLLIBRARY) - - XF86CONFLIB = $(XF86SRC)/parser/LibraryTargetName(xf86config) - -/* - * HasNCurses should be set to YES in the os.cf file if the include file - * is called ncurses.h instead of curses.h - */ -#if HasNCurses -# ifdef NCursesLibDir -CURSESLIB = -L$(NCURSESLIBDIR) NCursesLibName -# else -CURSESLIB = NCursesLibName -# endif -# ifdef NCursesIncDir -CURSES_DEFINES = -DCURSES -DNCURSES -I$(NCURSESINCDIR) -# else -CURSES_DEFINES = -DCURSES -DNCURSES -# endif -#else -CURSESLIB = -lcurses -CURSES_DEFINES = -DCURSES -#endif - - LOCAL_LIBRARIES = $(USEBUILTLIB) $(XKBUILIB) $(XKBFILELIB) \ - $(XF86CONFLIB) \ - $(TCLTK_LIBRARIES) $(XXF86VMLIB) $(XXF86MISCLIB) \ - $(USEINSTALLEDLIB) XawClientLibs $(CURSESLIB) MathLibrary - DEPLIBS = XawClientDepLibs $(DEPXXF86VMLIB) - CARDDBFILE = $(LIBDIR)/Cards - XCONFIGFILE = XF86Config - - XCONFIG_DEFINES = $(EXT_DEFINES) -DXF86SETUP \ - '-DPROJECTROOT="$(PROJECTROOT)"' \ - '-DSERVER_CONFIG_FILE="$(LIBDIR)/$(XCONFIGFILE)"' \ - $(SITE_FONT_PATH) $(SITE_RGB_DB) \ - -DNO_WRAPPERS - - XF86SETUPLIBDIR = $(LIBDIR)/XF86Setup - DEFINES = -DCARD_DATABASE_FILE='"$(CARDDBFILE)"' \ - $(XCONFIG_DEFINES) $(MODULEDEFINES) $(CURSES_DEFINES) \ - $(MISC_DEFINES) - INCLUDES = -I../os-support -I../common -I../vgahw \ - -I$(FONTLIBSRC)/include -I$(SERVERSRC)/mi -I../parser \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(INCLUDESRC) \ - -I$(EXTINCSRC) $(USEINSTALLEDINC) -I$(SERVERSRC)/Xext \ - -I$(TCLINCDIR) -I$(TKINCDIR) - - MSEPROTODEFS = $(STD_DEFINES) - -#if HasLdRunPath - CCENVSETUP = LD_RUN_PATH=$(USRLIBDIR):$(TCLLIBDIR) - CCLINK = $(CCENVSETUP) $(CC) -#endif - -AllTarget(ProgramTargetName(XF86Setup)) - -LinkSourceFile(Cards,../xf86config) -LinkSourceFile(cards.h,../xf86config) -LinkSourceFile(cards.c,../xf86config) - -#if !HasSnprintf -LinkSourceFile(snprintf.c,$(LIBSRC)/misc) -LinkSourceFile(snprintf.h,$(LIBSRC)/misc) -#endif - -LinkSourceFile(mouse.h,../input/mouse) - -CppFileTarget(mseproto.tcl, mseproto.cpp, $(MSEPROTODEFS), NullParameter) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -NormalProgramTarget(XF86Setup,$(OBJS),$(DEPLIBS),$(LOCAL_LIBRARIES) $(SYSTEM_LIBRARIES) $(EXTRASYSLIBS),NullParameter) -InstallProgram(XF86Setup,$(BINDIR)) -DependTarget() - -InstallMultiple($(TCL_FILES),$(XF86SETUPLIBDIR)) -InstallMultiple($(TCLLIB_FILES),$(XF86SETUPLIBDIR)/tcllib) -InstallMultiple($(PICS_FILES),$(XF86SETUPLIBDIR)/pics) -InstallManPage(XF86Setup,$(MANDIR)) - -#endif - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/LICENSE diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/LICENSE:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/LICENSE:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/LICENSE:3.0 Sat Aug 24 08:50:38 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/LICENSE Sat Feb 28 21:42:23 2004 @@ -1,23 +0,0 @@ - -The files in this directory are: -Copyright 1996 by Joseph V. Moss - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the name of Joseph Moss not be used in -advertising or publicity pertaining to distribution of the software without -specific, written prior permission. Joseph Moss makes no representations -about the suitability of this software for any purpose. It is provided -"as is" without express or implied warranty. - -JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/README diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/README:3.3 xc/programs/Xserver/hw/xfree86/XF86Setup/README:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/README:3.3 Tue Sep 3 03:28:20 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/README Sat Feb 28 21:42:23 2004 @@ -1,204 +0,0 @@ - - XF86SETUP README - ---------------- - -INTRODUCTION - - XF86Setup is a new program to aid in the configuration of the XFree86 - servers. It is unlike previous programs (such as ConfigXF86 and - xf86config) in that it is specifically designed to do as much as - possible while in graphics mode. - - However, xf86config is _not_ being replaced. XF86Setup's resource - requirements are considerably greater than those of xf86config. It also - is not usable for OS/2 configuration (at least not yet). - - XF86Setup requires that both the VGA16 and card-appropriate servers be - installed. Furthermore, the servers must include the XKEYBOARD, - XFree86-VidModeExtension, and XFree86-Misc extensions. If the dialog - program is installed, it will be used, but is not required. - - If you wish to run XF86Setup without installing it first, you need to - set the environment variable "XF86SETUPLIB" to point to the source - directory. - - The command line options are documented in the XF86Setup man page. For - instructions regarding the use of the program, see the Quick Start Guide - to XFree86 Configuration and the on-line help. - - The rest of this file contains information that is mainly of use to - someone interested in hacking on the code. - -MANIFEST - CHANGELOG List of changes in each version - Imakefile Imakefile to generate the program - LICENSE Redistribution license and disclaimer - README ASCII version of the README - README.html HTML version of the README - TODO Things to be done or at least considered - XF86Setup.man The man page - main.c Main prog that starts the Tcl interpreter - tclcards.c Routines to connect Tcl and the Cards database - reading functions - tclcards.h Prototypes for above - tclkbd.c Routines to connect to the XKB extension - tclmisc.c Routines to connect to the XFree86-Misc extension - tclmisc.h Prototypes for above - tclother.c Routines to implement misc Tcl commands - tclvidmode.c Routines to connect Tcl and - XFree86-VidModeExtension - tclvidmode.h Prototypes for above - tclxfconf.c Interface to xf86Config.c for reading an existing - XF86Config file - xfsconf.h Prototypes for above - tclxkbui.c Tk widget interface to the xkbui library - tkother.c Routines to implement misc commands requiring Tk - card.tcl Device configuration routines - carddata.tcl Information regarding supported chips and such - that is used by card.tcl - done.tcl Routines that are used once the user has finished - the various configuration steps - filelist.tcl Lists of files that should be checked for proper - installation - keyboard.tcl Routines for keyboard and other configuration - mondata.tcl Default monitor sync rates and modes - monitor.tcl Monitor configuration routines - mouse.tcl Mouse configuration routines - phase1.tcl Tcl commands to do Phase I - phase2.tcl Tcl commands for Phase II - phase3.tcl Tcl commands for Phase III - phase4.tcl Tcl commands for Phase IV - phase5.tcl Tcl commands for Phase V - setuplib.tcl Library of XF86Setup specific Tcl procs - srvflags.tcl Configuration routines for server flags - pics Directory containing bitmaps used by program - scripts Directory of other scripts that use XF86Setup as - an interpreter to implement other clients - tcllib Directory containing Tcl code to set the standard - widget bindings (from the Tcl & Tk 4.0p3 - distributions) and with misc tcl routines and the - combobox widget - -NEW TCL COMMANDS - - The program includes a Tcl interpreter which has been extended with - additional commands (in addition to those in the Tk toolkit). They are - explained below. - -Interfacing with the Cards database - - Two commands have been added to read data from the "Cards" database (as - used by "xf86config") - xf86cards_getlist Return the full list of card names - xf86cards_getentry Get complete info on a card - - A valid card name should be supplied as an argument to - "xf86cards_getentry" - -XFree86-VidModeExtension commands - - Several commands have been added which allow the program to communicate - with the XFree86-VidModeExtension server extension, namely: - xf86vid_getversion Query extension version - xf86vid_getbasevals - Get the ErrorBase and EventBase - xf86vid_getmodeline - Get the current video mode settings - xf86vid_getallmodelines - Get video settings for all modes - xf86vid_getmonitor Get monitor specs - xf86vid_lockmodeswitch - Turn on/off mode switching - xf86vid_switchmode Switch to next/previous mode - - Only the last two take an argument, which is either "lock" or "unlock" - in the case of "xf86vid_lockmodeswitch" and either "next" or "prev" in - the case of "xf86vid_switchmode". - - "xf86vid_getversion" returns the version as a floating point number - (e.g., 1.2), whereas "xf86vid_getbasevals" returns a Tcl list containing - two elements. - - The "xf86vid_getmodeline" command returns a string which contains the - standard mode line values including flags, if any, with each value - separated by a single space. - - "xf86vid_getallmodelines" returns a Tcl list. The number of elements - corresponds to the number of valid video modes. Each element is in the - format returned by "xf86vid_getmodeline". The first element contains the - mode info for the current mode. - - "xf86vid_getmonitor" also returns a Tcl list. The first element is the - vendor name. The second is the model name. The third element contains - all of the horizontal sync rates as comma separated ranges (so for - example if the sync rates were 31.5, 35-40, and 45-55 the return value - would be: "31.50-31.50,35.00-40.00,45.00-55.00"). The last element - contains the vertical sync rates in the same format. - -XFree86-Misc extension commands - - Communication with the XFree86-Misc extension is possible using these - new commands: - xf86misc_getversion - Query extension version - xf86misc_getbasevals - Get the ErrorBase and EventBase - xf86misc_getmouse Get the current mouse settings - xf86misc_setmouse Set the current mouse settings - xf86misc_getkeyboard - Get the current keyboard settings - xf86misc_setkeyboard - Set the current keyboard settings - xf86misc_getsaver Get the power saver settings - xf86misc_setsaver Set the power saver settings - -XKEYBOARD extension commands - - A few commands are available for communicating with the XKEYBOARD - extension: - xkb_components List the components that make up the given - keyboard - xkb_free Free a previously allocated keyboard description - structure - xkb_getrulesprop Read the _XKB_RULES_NAMES root property - xkb_list Returns a list of available components - xkb_listrules Returns a list of available rules defs and their - descriptions - xkb_load Change the keyboard setup for the specified - components - xkb_read Get keyboard information from the server - xkb_setrulesprop Set the _XKB_RULES_NAMES root property - xkb_resolvecomponents - Use the XKB rules to determine the components - necessay for an appropriate keymap (requires XKB - library support that might not yet be in the - XFree86 tree). - - The xkbview widget is also available as interface to the xkbui library. - -Miscellaneous - - Other commands added to the interpreter are: - getuid Returns the real uid of the user - server_running Returns true if a server is running on the - specified display - process_running Checks if the specified process is running - has_symlinks Returns true if running on an OS that supports - symbolic links - link Makes a (soft or hard) link from one file to - another - unlink Removes the specified file - mkdir Create the named directory - rmdir Remove the named directory - umask Set the file creation mode mask - sleep Sleeps for the specified number of seconds - findfocuswindow Search along an axis for a window which accepts - focus (added to the interpreter after Tk has been - initialized) - - "getuid" just returns the numeric result of getuid(). - - The "server_running" command simply tries to perform an "XOpenDisplay()" - on its argument. If the call fails, it returns false (0), otherwise it - calls "XCloseDisplay()" and returns true (1). - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/README.html diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/README.html:3.4 xc/programs/Xserver/hw/xfree86/XF86Setup/README.html:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/README.html:3.4 Fri Dec 27 01:53:58 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/README.html Sat Feb 28 21:42:23 2004 @@ -1,218 +0,0 @@ - - - - - - - - -README for XF86Setup - - -

XF86Setup README

- -

Introduction

- -

XF86Setup is a new program to aid in the configuration of the - XFree86 servers. It is unlike previous programs (such as ConfigXF86 - and xf86config) in that it is specifically designed to do as much - as possible while in graphics mode. -

However, xf86config is not being replaced. XF86Setup's - resource requirements are considerably greater than those of - xf86config. It also is not usable for OS/2 configuration - (at least not yet). -

XF86Setup requires that both the VGA16 and card-appropriate servers - be installed. Furthermore, the servers must include the XKEYBOARD, - XFree86-VidModeExtension, and XFree86-Misc extensions. If the - dialog program is installed, it will be used, but is not required. - -

If you wish to run XF86Setup without installing it first, - you need to set the environment variable - XF86SETUPLIB to point to the source directory. - -

The command line options are documented in the XF86Setup man - page. For instructions regarding the use of the program, see the - Quick Start Guide to XFree86 Configuration - and the on-line help. - -

The rest of this file contains information that is mainly of - use to someone interested in hacking on the code. - -

Manifest

-
-
CHANGELOG
List of changes in each version -
Imakefile
Imakefile to generate the program -
LICENSE
Redistribution license and disclaimer -
README
ASCII version of the README -
README.html
HTML version of the README -
TODO
Things to be done or at least considered -
XF86Setup.man
The man page -
main.c
Main prog that starts the Tcl interpreter -
tclcards.c
Routines to connect Tcl and the Cards - database reading functions -
tclcards.h
Prototypes for above -
tclkbd.c
Routines to connect to the XKB extension -
tclmisc.c
Routines to connect to the XFree86-Misc - extension -
tclmisc.h
Prototypes for above -
tclother.c
Routines to implement misc Tcl commands -
tclvidmode.c
Routines to connect Tcl and - XFree86-VidModeExtension -
tclvidmode.h
Prototypes for above -
tclxfconf.c
Interface to xf86Config.c for reading an - existing XF86Config file -
xfsconf.h
Prototypes for above -
tclxkbui.c
Tk widget interface to the xkbui library -
tkother.c
Routines to implement misc commands requiring Tk -
card.tcl
Device configuration routines -
carddata.tcl
Information regarding supported chips and - such that is used by card.tcl -
done.tcl
Routines that are used once the user has - finished the various configuration steps -
filelist.tcl
Lists of files that should be checked for - proper installation -
keyboard.tcl
Routines for keyboard and other configuration -
mondata.tcl
Default monitor sync rates and modes -
monitor.tcl
Monitor configuration routines -
mouse.tcl
Mouse configuration routines -
phase1.tcl
Tcl commands to do Phase I -
phase2.tcl
Tcl commands for Phase II -
phase3.tcl
Tcl commands for Phase III -
phase4.tcl
Tcl commands for Phase IV -
phase5.tcl
Tcl commands for Phase V -
setuplib.tcl
Library of XF86Setup specific Tcl procs -
srvflags.tcl
Configuration routines for server flags -
pics
Directory containing bitmaps used by program -
scripts
Directory of other scripts that use XF86Setup - as an interpreter to implement other clients -
tcllib
Directory containing Tcl code to set the - standard widget bindings (from the Tcl & - Tk 4.0p3 distributions) and with misc tcl - routines and the combobox widget -
- -

New Tcl commands

- -

The program includes a Tcl interpreter which has been extended - with additional commands (in addition to those in the Tk toolkit). - They are explained below. - -

Interfacing with the Cards database

- -

Two commands have been added to read data from the - Cards database (as used by xf86config) -

-
xf86cards_getlist
Return the full list of card names -
xf86cards_getentry
Get complete info on a card -
-

A valid card name should be supplied as an argument to - xf86cards_getentry - -

XFree86-VidModeExtension commands

- -

Several commands have been added which allow the program to - communicate with the XFree86-VidModeExtension server extension, - namely: -

-
xf86vid_getversion
Query extension version -
xf86vid_getbasevals
Get the ErrorBase and EventBase -
xf86vid_getmodeline
Get the current video mode settings -
xf86vid_getallmodelines
Get video settings for all modes -
xf86vid_getmonitor
Get monitor specs -
xf86vid_lockmodeswitch
Turn on/off mode switching -
xf86vid_switchmode
Switch to next/previous mode -
-

Only the last two take an argument, which is either lock - or unlock in the case of xf86vid_lockmodeswitch - and either next or prev in the case of - xf86vid_switchmode. -

xf86vid_getversion returns the version as a floating - point number (e.g., 1.2), whereas xf86vid_getbasevals - returns a Tcl list containing two elements. -

The xf86vid_getmodeline command returns a string - which contains the standard mode line values including flags, - if any, with each value separated by a single space. -

xf86vid_getallmodelines returns a Tcl list. The - number of elements corresponds to the number of valid video - modes. Each element is in the format returned by - xf86vid_getmodeline. The first element contains the - mode info for the current mode. -

xf86vid_getmonitor also returns a Tcl list. The - first element is the vendor name. The second is the model name. - The third element contains all of the horizontal sync rates - as comma separated ranges (so for example if the sync rates - were 31.5, 35-40, and 45-55 the return value would be: - 31.50-31.50,35.00-40.00,45.00-55.00). The last element - contains the vertical sync rates in the same format. - -

XFree86-Misc extension commands

- -

Communication with the XFree86-Misc extension is possible - using these new commands: -

-
xf86misc_getversion
Query extension version -
xf86misc_getbasevals
Get the ErrorBase and EventBase -
xf86misc_getmouse
Get the current mouse settings -
xf86misc_setmouse
Set the current mouse settings -
xf86misc_getkeyboard
Get the current keyboard settings -
xf86misc_setkeyboard
Set the current keyboard settings -
xf86misc_getsaver
Get the power saver settings -
xf86misc_setsaver
Set the power saver settings -
- -

XKEYBOARD extension commands

- -

A few commands are available for communicating with the XKEYBOARD - extension: -

-
xkb_components
List the components that make up the - given keyboard -
xkb_free
Free a previously allocated keyboard - description structure -
xkb_getrulesprop
Read the _XKB_RULES_NAMES root property -
xkb_list
Returns a list of available components -
xkb_listrules
Returns a list of available rules - defs and their descriptions -
xkb_load
Change the keyboard setup for the - specified components -
xkb_read
Get keyboard information from the - server -
xkb_setrulesprop
Set the _XKB_RULES_NAMES root property -
xkb_resolvecomponents
Use the XKB rules to determine the - components necessay for an - appropriate keymap (requires XKB - library support that might not yet - be in the XFree86 tree). -
-

The xkbview widget is also available as interface to the xkbui library. - -

Miscellaneous

- -

Other commands added to the interpreter are: -

-
getuid
Returns the real uid of the user -
server_running
Returns true if a server is - running on the specified display -
process_running
Checks if the specified process is running -
has_symlinks
Returns true if running on an OS - that supports symbolic links -
link
Makes a (soft or hard) link from - one file to another -
unlink
Removes the specified file -
mkdir
Create the named directory -
rmdir
Remove the named directory -
umask
Set the file creation mode mask -
sleep
Sleeps for the specified number - of seconds -
findfocuswindow
Search along an axis for a window which - accepts focus (added to the interpreter - after Tk has been initialized) -
-

getuid just returns the numeric result of getuid(). -

The server_running command simply tries to perform - an XOpenDisplay() on its argument. If the call fails, - it returns false (0), otherwise it calls XCloseDisplay() - and returns true (1). - - - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/TODO diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/TODO:3.9 xc/programs/Xserver/hw/xfree86/XF86Setup/TODO:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/TODO:3.9 Sun Sep 29 08:51:06 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/TODO Sat Feb 28 21:42:23 2004 @@ -1,125 +0,0 @@ - -RELATED CHANGES TO OTHER PARTS OF THE X SOURCE TREE: ----------------------------------------------------------------------- - - A) Add ability to dynamically add and remove video modes and to switch - directly to a specific mode to the XFree86-VidModeExtension - - B) Update vidmode extension to know about the Hskew parameter - - C) Add a GetViewPort function to the vidmode extension - - D) Update os-support/README.OS-lib with info regarding allowMouseOpenFail - - E) Modify the server mouse open functions to test that the file is of - the correct type before opening the device ??? - - F) In cards.c, allow $XWINHOME to override location of Cards file - - G) Write a README file which describes all the available options - - H) Add an option to SuperProbe to specify a parser-friendly output mode - - I) Add an option to SuperProbe to cause it to probe just enough to figure - out which server should be run - - -CHANGES IN XF86SETUP: ----------------------------------------------------------------------- - - 1) When using the SVGA server, further restrict the list of available - RAMDACs, clock chips, and READMEs once the chipset has been selected. - - 2) Improve keybindings for the arrow keys (e.g. scale widgets should - allow perpendicular movement to other widgets) - - 3) Add configuration of related things that can be set with xset such as - keyboard repeat rate, mouse acceleration, screen saver settings, - etc. ??? - - 4) Check for proper permissions of various files ??? - - 6) More fine-grained control of what is read from the existing XF86Config ??? - - 7) Add support for XInput - - 8) Add support for Modules - - 9) Add ability to select modes and their order (dependant on vidmode - extension changes) - -10) Internationalization of messages - -11) List all of the files that are found to be missing (not just the first) - -12) Make the X symlink while in graphics mode, instead of after switching - back to text mode - -13) Investigate reports of the hsync and vsync fields not allowing editing - -14) Update the xkbview widget to display glyphs on the keys (work is going - to start soon on adding the necessary functionality to libxkbui) - -15) The UI for the video RAM and RAMDAC max speed could probably improved - a bit still - -16) Preserve existing mode lines when reading existing config file - -17) Preserve existing comments in the config file (difficult) - -18) Make the list of available mouse devices show only the device names - that are appropriate for the selected protocol - -19) Add ability to map individual keys - -20) Move the server flags configuration to the second server? - -21) Check for invalid combinations of XKB settings - -22) Add a warning that the XF86Config file is used just to set defaults - (i.e. that comments and such will be lost) - -23) Some kind of better monitor identifier - -24) Display a warning message telling the user to use ctrl-alt-bkspc, if - things lock up - -25) Detect premature server shutdowns (e.g. if user presses ctrl-alt-bkspc) - and then do what? - -26) Move "Done" button to top row ??? - -27) Add user-friendly names for the possible mouse devices - -28) Set a specific width for the "Sample Rate" / "Lines/Inch" slider to avoid - the repacking of the widgets that currently occurs when changing to/from - the MMHitTab protocol - -29) Add a text area in which the keyboard can be tested - -30) If server fails to start because of an already running server, increment - and try again - -31) If server startup fails for some other reason, include the error in the - message to the user - -32) Set the initial Emulate3Buttons state to on, if not reading from an - existing config file - -34) Provide a way to go back from phase 4 to phase 2. - -35) Let the the user specify the existing config file to be read - -36) Show the horizontal sync rates in the list of monitors - -39) Limit card list to only those appropriate to what SuperProbe reports - -41) Add button for displaying the option description README or perhaps - add some kind of online help that describes a selected option (maybe - something like balloon help) - -44) Make the keyboard configuration screen also a seperate client - (a la xmseconfig). - -45) Do the same with the new mode selection screen - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man:3.6 xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man:3.6 Sat Oct 12 12:06:43 2002 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man Sat Feb 28 21:42:23 2004 @@ -1,107 +0,0 @@ -.\" $XConsortium: XF86Setup.man /main/3 1996/12/09 17:37:49 kaleb $ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/XF86Setup.man,v 3.6 2002/10/12 16:06:43 herrb Exp $ -.TH XF86Setup 1 __vendorversion__ -.SH NAME -XF86Setup - Graphical configuration utility for XFree86 -.SH SYNOPSIS -.B XF86Setup -[ -sync ] [ -name \fIappname\fP ] [ -nodialog ] [ -- \fIarg\fP ...] -.LP -.B XF86Setup -[ -sync ] [ -name \fIappname\fP ] [ -script ] -[ -display \fIdisplay\fP ] [ -geometry \fIgeometry\fP ] -\fIfilename\fP [ [ -- ] \fIarg\fP ... ] -.SH DESCRIPTION -.I XF86Setup -is normally used to either perform the initial setup of the XFree86 -X servers or to make adjustments to the existing configuration. -.PP -When used to initially configure the XFree86 servers, it will -start the VGA 16 server and then allow configuration settings to be -entered. Once that is completed the appropriate server for the -hardware will be started and the configuration settings will be -saved. -.PP -For a more complete description see the \fIQuick-Start Guide to -XFree86 Setup\fP. -.PP -When run from within an already running server environment (e.g. -from an xterm window), -.I XF86Setup -can be used to make adjustments to the current server configuration. -.PP -Note that when the existing XF86Config file is read, it is used to -set the default values for various settings, but the complete contents -of the existing file are not preserved. For example, when the new -XF86Config file is written, it will \fInot\fP contain any additional -comment lines from the original file. -.PP -When a filename is specified, it is interpreted as a script file -containing Tcl/Tk commands to run. If the filename contains a slash, -it is assumed that it specifies the path to the file to execute, -otherwise the file is searched for in the user's PATH, unless the -\fB-script\fP option is given, in which case, it is expected to -exist in the \fIscripts\fP subdirectory of the -\fIXF86Setup\fP library directory. -.PP -The result is entirely dependant on the contents of the file. - -.SH ARGUMENTS -.TP 14 -.B -sync -Turn on synchronization for all communication with an X server. -.TP 14 -.BI -name " appname" -Use \fIappname\fP as the window name. -.TP 14 -.BI -display " display" -Specify the display to talk to. -.TP 14 -.B -nodialog -Do not use the Dialog program for text mode user interaction. -Normally \fIXF86Setup\fP will use the Dialog program, if it is -found in the user's PATH, otherwise a simple text interface is used. -.TP 14 -.BI -geometry " geomspec" -Specify the initial geometry for the window. -.TP 14 -.BI -script -Look for the specified filename in the \fIscripts\fP directory, -instead of searching the user's PATH (if the filename doesn't -specify a path). -.SH ENVIRONMENT -.TP 14 -.B PATH -Used to search for the location of the Dialog program -.TP 14 -.B XWINHOME -If set, indicates the parent directory of X bin and lib directories. -.TP 14 -.B XF86SETUPLIB -If set, overrides the default location of the library directory -(normally __projectroot__/lib/X11/XF86Setup). -.TP 14 -.B TMPDIR -Directory in which to store temporary files (defaults to /tmp) -.SH FILES -.I __projectroot__/lib/X11/XF86Config -.br -or -.I /etc/XF86Config -.RS 14 -Can optionally be read to set default values -for configuration settings -.RE -.SH "SEE ALSO" -\fIQuick-Start Guide to XFree86 Setup\fP -.br -Xserver(1), XFree86(1), XF86Config(4/5), xvidtune(1), xdm(1), -xf86config(1), xinit(1), XF86Misc(3), XF86VidMode(3), -xmseconfig(1), dialog(1) -.SH AUTHOR -.PP -Joe Moss, \fIjoe@XFree86.org\fP -.SH BUGS -Does not support all possible configurations, for example, -graphics tablets must be configured by editing the XF86Config -file manually. Index: xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl:3.17 xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl:3.17 Mon Apr 5 03:12:58 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl Sat Feb 28 21:42:23 2004 @@ -1,587 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/card.tcl,v 3.17 1999/04/05 07:12:58 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: card.tcl /main/5 1996/10/28 04:55:06 kaleb $ - -# -# Card configuration routines -# - - -proc Card_create_widgets { win } { - global ServerList XF86Setup_library cardDevNum DeviceIDs - global cardDetail cardReadmeWasSeen UseConfigFile cardDriverReadme - global pc98_EGC messages - - set cardDriverReadme "NONE" - set w [winpathprefix $win] - set cardDevNum 0 - if !$pc98_EGC { - frame $w.card -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.card -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.card.top - pack $w.card.top -side top -fill x -padx 5m - if { [llength $DeviceIDs] > 1 } { - label $w.card.title -text $messages(card.1) -anchor w - pack $w.card.title -side left -fill x -padx 5m -in $w.card.top - combobox $w.card.cardselect -state disabled -bd 2 - pack $w.card.cardselect -side left -in $w.card.top - eval [list $w.card.cardselect linsert end] $DeviceIDs - Card_cbox_setentry $w.card.cardselect [lindex $DeviceIDs 0] - bind $w.card.cardselect.popup.list \ - "+[list Card_cardselect $win]" - bind $w.card.cardselect.popup.list \ - "+[list Card_cardselect $win]" - } else { - label $w.card.title -text $messages(card.2) -anchor w - pack $w.card.title -side left -fill x -padx 5m -in $w.card.top - } - - frame $w.card.list - scrollbar $w.card.list.sb -command [list $w.card.list.lb yview] \ - -repeatdelay 1200 -repeatinterval 800 - listbox $w.card.list.lb -yscroll [list $w.card.list.sb set] \ - -setgrid true -height 20 - bind $w.card.list.lb \ - [list Card_selected $win $w.card.list.lb] - bind $w.card.list.lb \ - [list Card_selected $win $w.card.list.lb] - eval $w.card.list.lb insert 0 [xf86cards_getlist] - pack $w.card.list.lb -side left -fill both -expand yes - pack $w.card.list.sb -side left -fill y - - image create bitmap cardpic -foreground yellow -background black \ - -file $XF86Setup_library/pics/vidcard.xbm \ - -maskfile $XF86Setup_library/pics/vidcard.msk - label $w.card.list.pic -image cardpic - pack $w.card.list.pic -side left -padx 3m -pady 3m - - - frame $w.card.bot -borderwidth 5 - pack $w.card.bot -side bottom -fill x - label $w.card.bot.message - pack $w.card.bot.message -side top -fill x - - frame $w.card.buttons - pack $w.card.buttons -side bottom -fill x - - button $w.card.readme -text $messages(card.3) \ - -command [list Card_display_readme $win] - pack $w.card.readme -side left -expand yes \ - -in $w.card.buttons - - button $w.card.modebutton -text $messages(card.4) \ - -command [list Card_switchdetail $win] - pack $w.card.modebutton -side left -expand yes \ - -in $w.card.buttons - - frame $w.card.detail -bd 2 -relief sunken - - frame $w.card.server - pack $w.card.server -side top -fill x -in $w.card.detail - label $w.card.server.title -text $messages(card.5) - pack $w.card.server.title -side left - foreach serv $ServerList { - set lcserv [string tolower $serv] - radiobutton $w.card.server.$lcserv -indicatoron no \ - -text $serv -variable cardServer -value $serv \ - -command [list Card_set_cboxlists $win] - pack $w.card.server.$lcserv -anchor w -side left \ - -expand yes -fill x - } - - frame $w.card.detail.cboxen - pack $w.card.detail.cboxen -side top - - frame $w.card.chipset - pack $w.card.chipset -side left -expand yes -fill x \ - -in $w.card.detail.cboxen -padx 5m - label $w.card.chipset.title -text $messages(card.7) - combobox $w.card.chipset.cbox -state disabled -bd 2 - pack $w.card.chipset.title $w.card.chipset.cbox - - frame $w.card.ramdac - pack $w.card.ramdac -side left -expand yes -fill x \ - -in $w.card.detail.cboxen -padx 5m - label $w.card.ramdac.title -text $messages(card.8) - combobox $w.card.ramdac.cbox -state disabled -bd 2 - pack $w.card.ramdac.title $w.card.ramdac.cbox - - frame $w.card.clockchip - pack $w.card.clockchip -side left -expand yes -fill x \ - -in $w.card.detail.cboxen -padx 5m - label $w.card.clockchip.title -text $messages(card.9) - combobox $w.card.clockchip.cbox -state disabled -bd 2 - pack $w.card.clockchip.title $w.card.clockchip.cbox - - set extr $w.card.extra - frame $extr - pack $extr -side bottom -padx 5m \ - -fill x -expand yes -in $w.card.detail - frame $extr.dacspeed - if { $UseConfigFile } { - pack $extr.dacspeed -side left -fill x -expand yes - } - label $extr.dacspeed.title -text $messages(card.10) - checkbutton $extr.dacspeed.probe -width 15 -text $messages(card.11) \ - -variable cardDacProbe -indicator off \ - -command [list Card_dacspeed $win] \ - -highlightthickness 0 - scale $extr.dacspeed.value -variable cardDacSpeed \ - -orient horizontal -from 60 -to 300 -resolution 5 - bind $extr.dacspeed.value \ - "set cardDacProbe 0; [list Card_dacspeed $win]" - pack $extr.dacspeed.title -side top -fill x -expand yes - pack $extr.dacspeed.probe -side top -expand yes - pack $extr.dacspeed.value -side top -fill x -expand yes - frame $extr.videoram - pack $extr.videoram -side left -fill x -expand yes - label $extr.videoram.title -text $messages(card.12) - pack $extr.videoram.title -side top -fill x -expand yes - radiobutton $extr.videoram.mprobed -indicator off -width 15 \ - -variable cardRamSize -value 0 -text $messages(card.13) \ - -highlightthickness 0 - pack $extr.videoram.mprobed -side top -expand yes - frame $extr.videoram.cols - pack $extr.videoram.cols -side top -fill x -expand yes - frame $extr.videoram.col1 - frame $extr.videoram.col2 - pack $extr.videoram.col1 $extr.videoram.col2 \ - -side left -fill x -expand yes \ - -in $extr.videoram.cols - radiobutton $extr.videoram.m256k \ - -variable cardRamSize -value 256 -text $messages(card.14) \ - -highlightthickness 0 - radiobutton $extr.videoram.m512k \ - -variable cardRamSize -value 512 -text $messages(card.15) \ - -highlightthickness 0 - radiobutton $extr.videoram.m1m \ - -variable cardRamSize -value 1024 -text $messages(card.16) \ - -highlightthickness 0 - radiobutton $extr.videoram.m2m \ - -variable cardRamSize -value 2048 -text $messages(card.17) \ - -highlightthickness 0 - radiobutton $extr.videoram.m3m \ - -variable cardRamSize -value 3072 -text $messages(card.18) \ - -highlightthickness 0 - radiobutton $extr.videoram.m4m \ - -variable cardRamSize -value 4096 -text $messages(card.19) \ - -highlightthickness 0 - radiobutton $extr.videoram.m6m \ - -variable cardRamSize -value 6144 -text $messages(card.20) \ - -highlightthickness 0 - radiobutton $extr.videoram.m8m \ - -variable cardRamSize -value 8192 -text $messages(card.21) \ - -highlightthickness 0 - pack $extr.videoram.m256k $extr.videoram.m512k \ - $extr.videoram.m1m $extr.videoram.m2m \ - -side top -fill x -expand yes \ - -in $extr.videoram.col1 - pack $extr.videoram.m3m $extr.videoram.m4m \ - $extr.videoram.m6m $extr.videoram.m8m \ - -side top -fill x -expand yes \ - -in $extr.videoram.col2 - - frame $w.card.options - pack $w.card.options -side bottom -fill x -in $w.card.detail \ - -pady 2m - - frame $w.card.options.list - pack $w.card.options.list -side top - combobox $w.card.options.list.cbox -state disabled -width 80 -bd 2 - label $w.card.options.list.title -text $messages(card.22) - $w.card.options.list.cbox.popup.list configure \ - -selectmode multiple - pack $w.card.options.list.title -side left - pack $w.card.options.list.cbox -fill x -expand yes -side left - - frame $w.card.options.text - pack $w.card.options.text -side top - text $w.card.options.text.text -yscroll [list $w.card.options.text.sb set] \ - -setgrid true -height 4 -background white - scrollbar $w.card.options.text.sb -command \ - [list $w.card.options.text.text yview] - label $w.card.options.text.title -text $messages(card.23) - pack $w.card.options.text.title -fill x -expand yes -side top - pack $w.card.options.text.text -fill x -expand yes -side left - pack $w.card.options.text.sb -side left -fill y - - $w.card.readme configure -state disabled - for {set idx 0} {$idx < [llength $DeviceIDs]} {incr idx} { - set cardReadmeWasSeen($idx) 0 - } - if { $UseConfigFile } { - set cardDetail std - Card_switchdetail $win - #$w.card.modebutton configure -state disabled - } else { - set cardDetail detail - Card_switchdetail $win - } -} - -proc Card_activate { win } { - set w [winpathprefix $win] - Card_get_configvars $win - pack $w.card -side top -fill both -expand yes -} - -proc Card_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.card - Card_set_configvars $win -} - -proc Card_dacspeed { win } { - global cardDacSpeed cardDacProbe messages - - set w [winpathprefix $win] - if { $cardDacProbe } { - #$w.card.extra.dacspeed.probe configure -text "Probed: Yes" - $w.card.extra.dacspeed.value configure \ - -foreground [option get $w.card background *] ;# -state disabled - } else { - #$w.card.extra.dacspeed.probe configure -text "Probed: No" - $w.card.extra.dacspeed.value configure \ - -foreground [option get $w.card foreground *] -state normal - } -} - -proc Card_switchdetail { win } { - global cardDetail cardDevNum messages - - set w [winpathprefix $win] - if { $cardDetail == "std" } { - set cardDetail detail - $w.card.modebutton configure -text $messages(card.26) - pack forget $w.card.list - pack $w.card.detail -expand yes -side top -fill both - $w.card.bot.message configure -text $messages(card.30) - } else { - set cardDetail std - $w.card.modebutton configure -text $messages(card.27) - pack forget $w.card.detail - pack $w.card.list -expand yes -side top -fill both - $w.card.bot.message configure -text $messages(card.31) - } -} - -proc Card_cbox_setentry { cb text } { - $cb econfig -state normal - $cb edelete 0 end - if [string length $text] { - $cb einsert 0 $text - } - $cb econfig -state disabled - set cblist [$cb lget 0 end] - if { [string match *.options.cbox $cb] } { - $cb lselection clear 0 end - foreach option [split $text ,] { - set idx [lsearch $cblist $option] - if { $idx != -1 } { - $cb see $idx - $cb lselection set $idx - $cb activate $idx - } - } - } else { - set idx [lsearch $cblist $text] - if { $idx != -1 } { - $cb see $idx - $cb lselection clear 0 end - $cb lselection set $idx - $cb activate $idx - } - } -} - -proc Card_selected { win lbox } { - global cardServer cardReadmeWasSeen cardDevNum cardDriverReadme - global pc98 Module messages - - set w [winpathprefix $win] - if { ![string length [$lbox curselection]] } return - set cardentry [$lbox get [$lbox curselection]] - set carddata [xf86cards_getentry $cardentry] - set cardDriverReadme "" - $w.card.title configure -text "$messages(card.28)$cardentry" - $w.card.options.text.text delete 0.0 end - if { [lsearch [lindex $carddata 7] UNSUPPORTED] == -1 } { - #Card_cbox_setentry $w.card.chipset.cbox [lindex $carddata 1] - set cardDriverReadmeRaw [lindex $carddata 1] - switch -glob $cardDriverReadmeRaw { - S3\ ViRGE { set cardDriverReadme "s3v" } - ET3* { set cardDriverReadme "et3000" } - ET4* { set cardDriverReadme "et4000" } - ET6* { set cardDriverReadme "et4000" } - CL* { set cardDriverReadme "cirrus" } - ARK* { set cardDriverReadme "ark" } - ct* { set cardDriverReadme "chips" } - mga* { set cardDriverReadme "mga" } - MGA* { set cardDriverReadme "mga" } - TVGA* { set cardDriverReadme "tvga8900" } - TGUI* { set cardDriverReadme "tvga8900" } - SIS* { set cardDriverReadme "sis" } - nv1* { set cardDriverReadme "nv" } - Oak* { set cardDriverReadme "oak" } - WD* { set cardDriverReadme "pvga1" } - ALG* { set cardDriverReadme "NONE" } - AP* { set cardDriverReadme "NONE" } - Avance* { set cardDriverReadme "NONE" } - Alliance* { set cardDriverReadme "NONE" } - } - set cardServer [lindex $carddata 2] - Card_cbox_setentry $w.card.ramdac.cbox [lindex $carddata 3] - Card_cbox_setentry $w.card.clockchip.cbox [lindex $carddata 4] - $w.card.options.text.text insert 0.0 [lindex $carddata 6] - if { $cardReadmeWasSeen($cardDevNum) } { - $w.card.bot.message configure -text $messages(card.32) - } else { - $w.card.bot.message configure -text $messages(card.33) - } - } else { - set cardServer VGA16 - Card_cbox_setentry $w.card.chipset.cbox generic - Card_cbox_setentry $w.card.ramdac.cbox "" - Card_cbox_setentry $w.card.clockchip.cbox "" - $w.card.bot.message configure -text $messages(card.34) - } - Card_set_cboxlists $win cardselected - if $pc98 { - switch $cardServer { - EGC { set Module(Load) egc } - PEGC { set Module(Load) pegc } - GANBWAP { set Module(Load) ganbwap } - NKVNEC { set Module(Load) nkvnec } - WABS { set Module(Load) wabs } - WABEP { set Module(Load) wabep } - WSNA { set Module(Load) wsna } - TGUI { set Module(Load) trident } - MGA { set Module(Load) mga } - NECS3 { set Module(Load) s3nec } - PWSKB { set Module(Load) s3pwskb } - PWLB { set Module(Load) s3pwlb } - GA968 { set Module(Load) s3ga968 } - } - } -} - -proc Card_set_cboxlists { win args } { - global CardChipSets CardRamDacs CardClockChips cardServer - global CardReadmes cardReadmeWasSeen CardOptions Xwinhome - global pc98 - - set w [winpathprefix $win] - $w.card.bot.message configure -text [make_message_card $args] - if { [llength $CardReadmes($cardServer)] > 0 } { - $w.card.readme configure -state normal - } else { - $w.card.readme configure -state disabled - } - $w.card.chipset.cbox ldelete 0 end - if [llength $CardChipSets($cardServer)] { - $w.card.chipset.cbox.button configure -state normal - $w.card.chipset.cbox linsert end "" - eval [list $w.card.chipset.cbox linsert end] \ - $CardChipSets($cardServer) - } else { - $w.card.chipset.cbox.button configure -state disabled - - } - set chipset [$w.card.chipset.cbox eget] - if { [string length $chipset] && [lsearch \ - $CardChipSets($cardServer) $chipset] < 0} { - Card_cbox_setentry $w.card.chipset.cbox "" - } - - $w.card.ramdac.cbox ldelete 0 end - if [llength $CardRamDacs($cardServer)] { - $w.card.ramdac.cbox.button configure -state normal - $w.card.ramdac.cbox linsert end "" - eval [list $w.card.ramdac.cbox linsert end] \ - $CardRamDacs($cardServer) - } else { - $w.card.ramdac.cbox.button configure -state disabled - } - set ramdac [$w.card.ramdac.cbox eget] - if { [string length $ramdac] && [lsearch \ - $CardRamDacs($cardServer) $ramdac] < 0} { - Card_cbox_setentry $w.card.ramdac.cbox "" - } - - - $w.card.clockchip.cbox ldelete 0 end - if [llength $CardClockChips($cardServer)] { - $w.card.clockchip.cbox.button configure -state normal - $w.card.clockchip.cbox linsert end "" - eval [list $w.card.clockchip.cbox linsert end] \ - $CardClockChips($cardServer) - } else { - $w.card.clockchip.cbox.button configure -state disabled - } - set clockchip [$w.card.clockchip.cbox eget] - if { [string length $clockchip] && [lsearch \ - $CardClockChips($cardServer) $clockchip] < 0} { - Card_cbox_setentry $w.card.clockchip.cbox "" - } - - $w.card.options.list.cbox ldelete 0 end - if [llength $CardOptions($cardServer)] { - $w.card.options.list.cbox.button configure -state normal - eval [list $w.card.options.list.cbox linsert end] \ - $CardOptions($cardServer) - } else { - $w.card.options.list.cbox.button configure -state disabled - } - set options "" - foreach option [split [$w.card.options.list.cbox eget] ,] { - if { [string length $option] && [lsearch \ - $CardOptions($cardServer) $option] != -1} { - lappend options $option - } - } - Card_cbox_setentry $w.card.options.list.cbox [join $options ,] -} - -proc Card_display_readme { win } { - global cardServer CardReadmes cardReadmeWasSeen cardDriverReadme - global cardDevNum Xwinhome messages pc98_EGC - - set w [winpathprefix $win] - catch {destroy .cardreadme} - toplevel .cardreadme -bd 5 -relief ridge - wm title .cardreadme "Chipset Specific README" - wm geometry .cardreadme +30+30 - frame .cardreadme.file - text .cardreadme.file.text -setgrid true \ - -xscroll ".cardreadme.horz.hsb set" \ - -yscroll ".cardreadme.file.vsb set" - if $pc98_EGC { - .cardreadme.file.text configure -height 20 - } - if { ![string compare $cardServer "SVGA"] && - [string length $cardDriverReadme] } { - set readmeindex $cardServer-$cardDriverReadme - } else { - set readmeindex $cardServer - } - foreach file $CardReadmes($readmeindex) { - set fd [open $Xwinhome/lib/X11/doc/$file r] - .cardreadme.file.text insert end [read $fd] - close $fd - } - .cardreadme.file.text configure -state disabled - frame .cardreadme.horz - scrollbar .cardreadme.horz.hsb -orient horizontal \ - -command ".cardreadme.file.text xview" \ - -repeatdelay 1200 -repeatinterval 800 - scrollbar .cardreadme.file.vsb \ - -command ".cardreadme.file.text yview" \ - -repeatdelay 1200 -repeatinterval 800 - button .cardreadme.ok -text $messages(card.29) \ - -command "destroy .cardreadme" - focus .cardreadme.ok - pack .cardreadme.file -side top -fill both - pack .cardreadme.file.text -side left - pack .cardreadme.file.vsb -side left -fill y - #update idletasks - #.cardreadme.horz configure -width [winfo width .cardreadme.file.text] \ - -height [winfo width .cardreadme.file.vsb] - #pack propagate .cardreadme.horz 0 - #pack .cardreadme.horz -side top -anchor w - #pack .cardreadme.horz.hsb -fill both - pack .cardreadme.ok -side bottom - set cardReadmeWasSeen($cardDevNum) 1 -} - -proc Card_cardselect { win } { - global cardDevNum - - set w [winpathprefix $win] - if { ![string length [$w.card.cardselect curselection]] } return - Card_set_configvars $win - set cardDevNum [$w.card.cardselect curselection] - Card_get_configvars $win -} - -proc Card_set_configvars { win } { - global DeviceIDs cardServer ServerList cardDevNum - global AccelServerList CardChipSets CardRamDacs CardClockChips - global cardDacSpeed cardDacProbe cardRamSize UseConfigFile - - set w [winpathprefix $win] - set devid [lindex $DeviceIDs $cardDevNum] - global Device_$devid messages - - set Device_${devid}(Server) $cardServer - set Device_${devid}(Chipset) [$w.card.chipset.cbox eget] - set Device_${devid}(Ramdac) [$w.card.ramdac.cbox eget] - set Device_${devid}(ClockChip) [$w.card.clockchip.cbox eget] - set Device_${devid}(ExtraLines) [$w.card.options.text.text get 0.0 end] - set Device_${devid}(Options) [split [$w.card.options.list.cbox eget] ,] - if {[llength $DeviceIDs] == 1} { - set Device_${devid}(BoardName) [string range \ - [$w.card.title cget -text] \ - [string length $messages(card.28)] end] - } - if { $cardRamSize } { - set Device_${devid}(VideoRam) $cardRamSize - } else { - set Device_${devid}(VideoRam) "" - } - if { $UseConfigFile } { - if { $cardDacProbe } { - set Device_${devid}(DacSpeed) "" - } else { - set Device_${devid}(DacSpeed) [expr $cardDacSpeed*1000] - } - } -} - -proc Card_get_configvars { win } { - global DeviceIDs cardServer ServerList cardDevNum - global AccelServerList CardChipSets CardRamDacs CardClockChips - global cardDacSpeed cardDacProbe cardRamSize UseConfigFile - - set w [winpathprefix $win] - set devid [lindex $DeviceIDs $cardDevNum] - global Device_$devid - - set cardServer [set Device_${devid}(Server)] - Card_cbox_setentry $w.card.chipset.cbox [set Device_${devid}(Chipset)] - Card_cbox_setentry $w.card.ramdac.cbox [set Device_${devid}(Ramdac)] - Card_cbox_setentry $w.card.clockchip.cbox [set Device_${devid}(ClockChip)] - $w.card.options.text.text delete 0.0 end - $w.card.options.text.text insert 0.0 [set Device_${devid}(ExtraLines)] - Card_cbox_setentry $w.card.options.list.cbox \ - [join [set Device_${devid}(Options)] ,] - Card_set_cboxlists $win - if { $UseConfigFile } { - set ram [set Device_${devid}(VideoRam)] - if { [string length $ram] > 0 } { - set cardRamSize $ram - } else { - set cardRamSize 0 - } - set speed [set Device_${devid}(DacSpeed)] - if { [string length $speed] > 0 } { - set cardDacSpeed [expr int($speed/1000)] - set cardDacProbe 0 - } else { - set cardDacSpeed 60 - set cardDacProbe 1 - } - Card_dacspeed $win - } else { - set cardRamSize 0 - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl:3.20 xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl:3.20 Fri Mar 20 16:05:21 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl Sat Feb 28 21:42:23 2004 @@ -1,520 +0,0 @@ -# $XConsortium: carddata.tcl /main/8 1996/10/28 05:42:15 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/carddata.tcl,v 3.20 1998/03/20 21:05:21 hohndel Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Data used by the card configuration routines -# - - -if !$pc98 { - set ServerList [list Mono VGA16 SVGA 8514 AGX I128 \ - Mach8 Mach32 Mach64 P9000 S3 S3V TGA ] - set AccelServerList [list 8514 AGX I128 Mach8 Mach32 Mach64 P9000 \ - S3 S3V TGA ] -} else { - set ServerList [list EGC PEGC GANBWAP NKVNEC TGUI MGA \ - WABS WABEP WSNA NECS3 PWSKB PWLB GA968 ] - set AccelServerList [list EGC PEGC GANBWAP NKVNEC TGUI MGA \ - WABS WABEP WSNA NECS3 PWSKB PWLB GA968 ] -} - -### - -# For each server, what chipsets can be chosen (for the Mono, VGA16, -# and SVGA servers, the list is broken out by driver)? -set CardChipSets(SVGA-al2101) al2101 -set CardChipSets(SVGA-ali) { ali2228 ali2301 ali2302 ali2308 ali2401 } -set CardChipSets(SVGA-apm) ap6422 -set CardChipSets(SVGA-ark) { ark1000vl ark1000pv ark2000pv } -set CardChipSets(SVGA-ati) ati -set CardChipSets(SVGA-cl64xx) { cl6410 cl6412 cl6420 cl6440 } -set CardChipSets(SVGA-cirrus) { clgd5420 clgd5422 clgd5424 clgd5426 \ - clgd5428 clgd5429 clgd5430 clgd5434 \ - clgd5436 clgd5446 clgd6215 clgd6225 \ - clgd6235 clgd7541 clgd7542 clgd7543 } -#set CardChipSets(SVGA-compaq) cpq_avga -set CardChipSets(SVGA-chips) { ct65520 ct65530 ct65540 ct65545 \ - ct65546 ct65548 ct65550 ct65554 \ - ct65555 ct68554 ct69000 \ - ct64200 ct64300 \ - ct451 ct452 ct453 ct455 ct456 ct457 } -set CardChipSets(SVGA-et3000) et3000 -set CardChipSets(SVGA-et4000) { et4000 et4000w32 et4000w32i et4000w32i_rev_b \ - et4000w32i_rev_c et4000w32p et4000w32p_rev_a \ - et4000w32p_rev_b et4000w32p_rev_c \ - et4000w32p_rev_d, et6000 } -set CardChipSets(SVGA-gvga) gvga -set CardChipSets(SVGA-mga) mga2064w -set CardChipSets(SVGA-mx) mx -set CardChipSets(SVGA-ncr77c22) { ncr77c22 ncr77c22e } -set CardChipSets(SVGA-nv) { nv1 stg2000 riva128 } -set CardChipSets(SVGA-oak) { oti067 oti077 oti087 oti037c } -set CardChipSets(SVGA-pvga1) { pvga1 \ - wd90c00 wd90c10 wd90c30 wd90c24 \ - wd90c31 wd90c31 wd90c33 wd90c20 } -set CardChipSets(SVGA-realtek) realtek -#set CardChipSets(SVGA-s3_svga) s3 -set CardChipSets(SVGA-sis) { sis86c201 sis86c202 sis86c205 } -set CardChipSets(SVGA-tvga8900) { tvga8200lx tvga8800cs tvga8900b tvga8900c \ - tvga8900cl tvga8900d tvga9000 tvga9000i \ - tvga9100b tvga9200cxr \ - tgui9320lcd tgui9400cxi tgui9420 \ - tgui9420dgi tgui9430dgi tgui9440agi \ - tgui9660xgi tgui9680 cyber938x } -set CardChipSets(SVGA-video7) video7 -set chiplist "" -foreach idx [array names CardChipSets SVGA-*] { - eval lappend chiplist $CardChipSets($idx) -} -set CardChipSets(SVGA) [concat generic [lrmdups $chiplist]] - -set CardChipSets(VGA16-ati) $CardChipSets(SVGA-ati) -set CardChipSets(VGA16-cl64xx) $CardChipSets(SVGA-cl64xx) -set CardChipSets(VGA16-et3000) $CardChipSets(SVGA-et3000) -set CardChipSets(VGA16-et4000) $CardChipSets(SVGA-et4000) -set CardChipSets(VGA16-ncr77c22) $CardChipSets(SVGA-ncr77c22) -set CardChipSets(VGA16-oak) $CardChipSets(SVGA-oak) -set CardChipSets(VGA16-sis) $CardChipSets(SVGA-sis) -set CardChipSets(VGA16-tvga8900) $CardChipSets(SVGA-tvga8900) -set chiplist "" -foreach idx [array names CardChipSets VGA16-*] { - eval lappend chiplist $CardChipSets($idx) -} -set CardChipSets(VGA16) [concat generic [lrmdups $chiplist]] - -set CardChipSets(Mono-ati) $CardChipSets(SVGA-ati) -set CardChipSets(Mono-cl64xx) $CardChipSets(SVGA-cl64xx) -set CardChipSets(Mono-cirrus) $CardChipSets(SVGA-cirrus) -set CardChipSets(Mono-et3000) $CardChipSets(SVGA-et3000) -set CardChipSets(Mono-et4000) $CardChipSets(SVGA-et4000) -set CardChipSets(Mono-gvga) $CardChipSets(SVGA-gvga) -set CardChipSets(Mono-ncr77c22) $CardChipSets(SVGA-ncr77c22) -set CardChipSets(Mono-oak) $CardChipSets(SVGA-oak) -set CardChipSets(Mono-pvga1) $CardChipSets(SVGA-pvga1) -set CardChipSets(Mono-sis) $CardChipSets(SVGA-sis) -set CardChipSets(Mono-tvga8900) $CardChipSets(SVGA-tvga8900) -set chiplist "" -foreach idx [array names CardChipSets Mono-*] { - eval lappend chiplist $CardChipSets($idx) -} -set CardChipSets(Mono) [concat generic [lrmdups $chiplist]] -unset chiplist idx - -set CardChipSets(8514) { ibm8514 } -set CardChipSets(AGX) { agx-010 agx-014 agx-015 agx-016 xga-1 xga-2 } -set CardChipSets(I128) { i128 } -set CardChipSets(Mach8) { mach8 } -set CardChipSets(Mach32) { mach32 } -set CardChipSets(Mach64) { mach64 } -set CardChipSets(P9000) { orchid_p9000 viperpci vipervlb } -set CardChipSets(S3) { mmio_928 newmmio s3_generic } -set CardChipSets(S3V) { s3_virge } -set CardChipSets(TGA) { tga } -set CardChipSets(EGC) { vga } -set CardChipSets(PEGC) { pegc } -set CardChipSets(GANBWAP) { clgd5426 clgd5428 clgd5429 clgd5430 \ - clgd5434 clgd5440 clgd5446 clgd7543 \ - clgd7548 clgd7555 } -set CardChipSets(NKVNEC) { clgd5426 clgd5428 clgd5429 clgd5430 \ - clgd5434 clgd5440 clgd5446 clgd7543 \ - clgd7548 clgd7555 } -set CardChipSets(WABS) { clgd5426 clgd5428 clgd5429 clgd5430 \ - clgd5434 clgd5440 clgd5446 clgd7543 \ - clgd7548 clgd7555 } -set CardChipSets(WABEP) { clgd5426 clgd5428 clgd5429 clgd5430 \ - clgd5434 clgd5440 clgd5446 clgd7543 \ - clgd7548 clgd7555 } -set CardChipSets(WSNA) { clgd5426 clgd5428 clgd5429 clgd5430 \ - clgd5434 clgd5440 clgd5446 clgd7543 \ - clgd7548 clgd7555 } -set CardChipSets(TGUI) { tgui9660xgi tgui9680 cyber938x } -set CardChipSets(MGA) { } -set CardChipSets(NECS3) { s3_generic mmio_928 } -set CardChipSets(PWSKB) { s3_generic mmio_928 } -set CardChipSets(PWLB) { mmio_928 s3_generic } -set CardChipSets(GA968) { newmmio mmio_928 s3_generic } - -### - -# For each server, what ramdacs can be chosen? -set CardRamDacs(8514) {} -set CardRamDacs(AGX) { normal att20c490 bt481 bt482 \ - herc_dual_dac herc_small_dac \ - sc15025 xga } -set CardRamDacs(I128) { ibm526 ibm528 ti3025 } -set CardRamDacs(Mach8) {} -set CardRamDacs(Mach32) { ati68830 ati68860 ati68875 \ - att20c490 att20c491 att21c498 \ - bt476 bt478 bt481 bt482 bt885 \ - ims_g173 ims_g174 \ - inmos176 inmos178 \ - mu9c1880 mu9c4870 mu9c4910 \ - sc11483 sc11486 sc11488 \ - sc15021 sc15025 sc15026 \ - stg1700 stg1702 \ - tlc34075 } -set CardRamDacs(Mach64) { internal \ - ati68860 ati68860b ati68860c ati68875 \ - att20c408 att20c491 att20c498 att21c498 \ - att498 \ - bt476 bt478 bt481 \ - ch8398 \ - ibm_rgb514 \ - ims_g174 \ - inmos176 inmos178 \ - mu9c1880 \ - sc15021 sc15026 \ - stg1700 stg1702 stg1703 \ - tlc34075 \ - tvp3026 \ - } -set CardRamDacs(P9000) {} -set CardRamDacs(S3) { normal \ - att20c409 att20c490 att20c491 att20c498 \ - att20c505 att21c498 att22c498 \ - bt485 bt9485 \ - ch8391 \ - ibm_rgb514 ibm_rgb524 ibm_rgb525 \ - ibm_rgb526 ibm_rgb528 \ - ics5300 ics5342 \ - s3gendac s3_sdac \ - s3_trio s3_trio32 s3_trio64 \ - sc11482 sc11483 sc11484 sc11485 \ - sc11487 sc11489 sc15025 \ - stg1700 stg1703 \ - ti3020 ti3025 ti3026 ti3030 \ - } -set CardRamDacs(S3V) {} ;# { normal s3_trio64 } -set CardRamDacs(TGA) { bt485 } - -set CardRamDacs(SVGA-ark) { ark1491a att20c490 att20c498 \ - ics5342 stg1700 \ - w30c491 w30c498 w30c516 \ - zoomdac } -set CardRamDacs(SVGA-ati) [lrmdups [concat \ - $CardRamDacs(Mach8) \ - $CardRamDacs(Mach32) \ - $CardRamDacs(Mach64)] ] -set CardRamDacs(SVGA-et4000) { normal \ - att20c47xa att20c490 att20c491 \ - att20c492 att20c493 att20c497 \ - ics5341 sc1502x stg1700 stg1702 \ - stg1703 ch8398 ics5301 et6000 } -set CardRamDacs(SVGA-mga) ti3026 -set daclist "" -foreach idx [array names CardRamDacs SVGA-*] { - eval lappend daclist $CardRamDacs($idx) -} -set CardRamDacs(SVGA) [lrmdups $daclist] - -set CardRamDacs(VGA16-ati) $CardRamDacs(SVGA-ati) -set CardRamDacs(VGA16-et4000) $CardRamDacs(SVGA-et4000) -set CardRamDacs(VGA16) [lrmdups [concat $CardRamDacs(SVGA-ati) \ - $CardRamDacs(SVGA-et4000)] ] -set CardRamDacs(Mono-ati) $CardRamDacs(SVGA-ati) -set CardRamDacs(Mono-et4000) $CardRamDacs(SVGA-et4000) -set CardRamDacs(Mono) $CardRamDacs(VGA16) - -set CardRamDacs(EGC) {} -set CardRamDacs(PEGC) {} -set CardRamDacs(GANBWAP) {} -set CardRamDacs(NKVNEC) {} -set CardRamDacs(WABS) {} -set CardRamDacs(WABEP) {} -set CardRamDacs(WSNA) {} -set CardRamDacs(TGUI) {} -set CardRamDacs(MGA) ti3026 -set CardRamDacs(NECS3) { sc15025 s3_sdac } -set CardRamDacs(PWSKB) { sc15025 bt478 bt485 s3_gendac att20c498 } -set CardRamDacs(PWLB) { att20c505 sc15025 ti3025 } -set CardRamDacs(GA968) ibm_rgb524 -unset daclist idx - -### - -# For each server, what clockchips can be chosen? -set CardClockChips(8514) {} -set CardClockChips(AGX) {} -set CardClockChips(I128) { ibm_rgb526 ibm_rgb528 ibm_rbg52x ibm_rgb5xx \ - ti3025 } -set CardClockChips(Mach8) {} -set CardClockChips(Mach32) {} -set CardClockChips(Mach64) { ati18818 att20c408 ch8398 ibm_rgb514 \ - ics2595 stg1703 } -set CardClockChips(P9000) { icd2061a } -set CardClockChips(S3) { att20c409 att20c499 att20c408 \ - ch8391 dcs2824 \ - ibm_rgb514 ibm_rgb51x ibm_rgb524 ibm_rgb525 \ - ibm_rgb528 ibm_rgb52x ibm_rgb5xx \ - icd2061a ics2595 ics5300 ics5342 ics9161a \ - s3_aurora64 s3_sdac s3_trio s3_trio32 \ - s3_trio64 s3_trio64v2 s3gendac \ - sc11412 stg1703 ti3025 ti3026 ti3030 \ - } -set CardClockChips(S3V) {} ;# { s3_trio64 } -set CardClockChips(TGA) ics1562 - -set CardClockChips(SVGA-ark) ics5342 -set CardClockChips(SVGA-cirrus) cirrus -set CardClockChips(SVGA-et4000) { dcs2824 et6000 icd2061a ics5341 ics5301 stg1703 } -set CardClockChips(SVGA-mga) ti3026 -set CardClockChips(SVGA-pvga1) icd2061A -set CardClockChips(SVGA-tvga8900) tgui -set clklist "" -foreach idx [array names CardClockChips SVGA-*] { - eval lappend clklist $CardClockChips($idx) -} -set CardClockChips(SVGA) [lrmdups $clklist] - -set CardClockChips(VGA16-et4000) $CardClockChips(SVGA-et4000) -set CardClockChips(VGA16-tvga8900) $CardClockChips(SVGA-tvga8900) -set CardClockChips(VGA16) [lrmdups [concat $CardClockChips(SVGA-et4000) \ - $CardClockChips(SVGA-tvga8900)] ] - -set CardClockChips(Mono-cirrus) $CardClockChips(SVGA-cirrus) -set CardClockChips(Mono-et4000) $CardClockChips(SVGA-et4000) -set CardClockChips(Mono-tvga8900) $CardClockChips(SVGA-tvga8900) -set CardClockChips(Mono) [lrmdups [concat $CardClockChips(Mono-cirrus) \ - $CardClockChips(Mono-et4000) \ - $CardClockChips(Mono-tvga8900)] ] - -set CardClockChips(EGC) {} -set CardClockChips(PEGC) {} -set CardClockChips(GANBWAP) cirrus -set CardClockChips(NKVNEC) cirrus -set CardClockChips(WABS) cirrus -set CardClockChips(WABEP) cirrus -set CardClockChips(WSNA) cirrus -set CardClockChips(TGUI) tgui -set CardClockChips(MGA) ti3026 -set CardClockChips(NECS3) s3_sdac -set CardClockChips(PWSKB) { icd2061a s3_gendac } -set CardClockChips(PWLB) { icd2061a ti3025 } -set CardClockChips(GA968) {} -unset clklist idx - -# For each server, what options can be chosen? -set CardOptions(Mono) { 16clocks 8clocks all_wait clgd6225_lcd \ - clkdiv2 clock_50 clock_66 composite \ - enable_bitblt epsonmemwin extern_disp \ - fast_dram favour_bitblt favor_bitblt \ - fb_debug fifo_aggressive fifo_conservative \ - first_wwait ga98nb1 ga98nb2 ga98nb4 \ - hibit_high hibit_low hw_clocks hw_cursor \ - intern_disp lcd_center lcd_stretch \ - legend linear med_dram mmio nec_cirrus \ - noaccel nolinear no_2mb_banksel no_bitblt \ - no_imageblt no_pci_probe no_pixmap_cache \ - no_program_clocks \ - no_wait one_wait pc98_tgui pci_burst_off \ - pci_burst_on pci_retry power_saver probe_clocks \ - read_wait secondary \ - slow_dram swap_hibit sw_cursor tgui_mclk_66 \ - tgui_pci_read_off tgui_pci_read_on \ - tgui_pci_write_off tgui_pci_write_on \ - w32_interleave_off w32_interleave_on \ - wap write_wait xaa_no_col_exp\ - } -set CardOptions(VGA16) { 16clocks all_wait clgd6225_lcd clkdiv2 \ - clock_50 clock_66 composite enable_bitblt \ - fast_dram fb_debug fifo_aggressive \ - fifo_conservative first_wwait hibit_high \ - hibit_low hw_clocks hw_cursor \ - lcd_center lcd_stretch legend \ - linear med_dram \ - mmio noaccel nolinear no_pci_probe \ - no_program_clocks no_wait one_wait \ - pc98_tgui pci_burst_off pci_burst_on pci_retry \ - power_saver probe_clocks read_wait \ - secondary \ - slow_dram tgui_mclk_66 \ - tgui_pci_read_off tgui_pci_read_on \ - tgui_pci_write_off tgui_pci_write_on \ - w32_interleave_off w32_interleave_on \ - write_wait xaa_no_col_exp\ - } -set CardOptions(SVGA) { 16clocks 8clocks all_wait clgd6225_lcd \ - clkdiv2 clock_50 clock_66 composite \ - dac_6_bit dac_8_bit early_ras_precharge \ - enable_bitblt \ - epsonmemwin extern_disp \ - ext_fram_buf fast_dram favour_bitblt \ - favor_bitblt fb_debug fifo_aggressive \ - fifo_conservative fifo_moderate \ - first_wwait fix_panel_size \ - fpm_vram ga98nb1 \ - ga98nb2 ga98nb4 hibit_high hibit_low \ - hw_clocks hw_cursor intern_disp \ - late_ras_precharge lcd_center \ - lcd_centre legend linear \ - med_dram mmio nec_cirrus noaccel nolinear \ - no_2mb_banksel no_bitblt no_imageblt \ - no_pci_probe no_pixmap_cache \ - no_program_clocks no_stretch no_wait \ - one_wait pc98_tgui pci_burst_off\ - pci_burst_on pci_retry power_saver probe_clocks \ - read_wait slow_edoram slow_dram stn suspend_hack \ - swap_hibit sw_cursor sync_on_green \ - tgui_mclk_66 tgui_pci_read_off \ - tgui_pci_read_on tgui_pci_write_off \ - tgui_pci_write_on use_18bit_bus use_modeline \ - use_vclk1 \ - w32_interleave_off w32_interleave_on wap \ - write_wait pci_retry no_pixmap_cache \ - xaa_benchmark xaa_no_col_exp \ - } -set CardOptions(8514) {} -set CardOptions(AGX) { 8_bit_bus bt482_curs bt485_curs clkdiv2 \ - crtc_delay dac_6_bit dac_8_bit engine_delay \ - fast_dram fast_vram s3_fast_vram \ - fifo_aggressive fifo_conservative \ - fifo_moderate med_dram noaccel nolinear \ - no_wait_state refresh_20 refresh_25 \ - slow_dram slow_vram s3_slow_vram \ - sprite_refresh screen_refresh sw_cursor \ - sync_on_green vlb_a vlb_b vram_128 \ - vram_256 vram_delay_latch vram_delay_ras \ - vram_extend_ras wait_state \ - } -set CardOptions(I128) { dac_8_bit noaccel power_saver showcache \ - sync_on_green } -set CardOptions(Mach8) composite -set CardOptions(Mach32) { clkdiv2 composite dac_8_bit intel_gx \ - nolinear sw_cursor } -set CardOptions(Mach64) { block_write clkdiv2 composite dac_6_bit \ - dac_8_bit hw_cursor no_bios_clocks \ - no_block_write no_font_cache no_pixmap_cache \ - no_program_clocks override_bios power_saver \ - sw_cursor \ - } -set CardOptions(P9000) { noaccel sw_cursor sync_on_green vram_128 vram_256 } -set CardOptions(S3) { bt485_curs clkdiv2 dac_6_bit dac_8_bit \ - diamond early_ras_precharge elsa_w1000pro \ - elsa_w1000isa elsa_w2000pro elsa_w2000pro/x8 \ - epsonmemwin fast_vram \ - s3_fast_vram fb_debug genoa hercules \ - ibmrgb_curs late_ras_precharge legend \ - miro_80sv miro_magic_s4 \ - necwab noinit nolinear no_font_cache \ - nomemaccess no_pci_disconnect no_pixmap_cache \ - no_ti3020_curs \ - number_nine pchkb pci_hack pcskb pcskb4 \ - power_saver pw805i pw968 pw_localbus \ - pw_mux s3_964_bt485_vclk s3_968_dash_bug \ - showcache slow_dram slow_dram_refresh \ - s3_slow_dram_refresh slow_edodram slow_vram \ - s3_slow_vram spea_mercury stb stb_pegasus \ - sw_cursor sync_on_green ti3020_curs \ - ti3026_curs trio32_fc_bug trio64v+_bug1 \ - trio64v+_bug2 trio64v+_bug3 \ - } -set CardOptions(S3V) { sw_cursor dac_6_bit dac_8_bit power_saver \ - slow_dram_refresh slow_edodram slow_vram } -set CardOptions(TGA) { bt485_cursor dac_6_bit dac_8_bit hw_cursor \ - power_saver sw_cursor \ - } - -set CardOptions(EGC) {} -set CardOptions(PEGC) {} -set CardOptions(GANBWAP) { ga98nb1 ga98nb2 ga98nb4 wap epsonmemwin \ - sw_cursor } -set CardOptions(NKVNEC) { nec_cirrus } -set CardOptions(WABS) {} -set CardOptions(WABEP) { med_dram } -set CardOptions(WSNA) { epsonmemwin sw_cursor med_dram } -set CardOptions(TGUI) { noaccel } -set CardOptions(MGA) { noaccel } -set CardOptions(NECS3) { necwab nomemaccess dac_8_bit bt485_curs } -set CardOptions(PWSKB) { pcskb pcskb4 pchkb pw805i pw_mux \ - nomemaccess epsonmemwin dac_8_bit \ - bt485_curs } -set CardOptions(PWLB) { pw_localbus dac_8_bit bt485_curs numbernine } -set CardOptions(GA968) {} - -# For each server, what readme files are applicable? -set CardReadmes(SVGA-ark) README.ark -set CardReadmes(SVGA-ati) README.ati -set CardReadmes(SVGA-cl64xx) README.cirrus -set CardReadmes(SVGA-cirrus) README.cirrus -set CardReadmes(SVGA-chips) README.chips -set CardReadmes(SVGA-et3000) README.tseng -set CardReadmes(SVGA-et4000) README.tseng -set CardReadmes(SVGA-mga) README.MGA -set CardReadmes(SVGA-nv) README.NV1 -set CardReadmes(SVGA-oak) README.Oak -set CardReadmes(SVGA-pvga1) README.WstDig -set CardReadmes(SVGA-s3v) README.S3V -set CardReadmes(SVGA-sis) README.SiS -set CardReadmes(SVGA-tvga8900) README.trident -set CardReadmes(SVGA-video7) README.Video7 -set CardReadmes(SVGA-NONE) README -set rdmelist "" -foreach idx [array names CardReadmes SVGA-*] { - eval lappend rdmelist $CardReadmes($idx) -} -set CardReadmes(SVGA) [concat [lrmdups $rdmelist]] - -set CardReadmes(VGA16-ati) $CardReadmes(SVGA-ati) -set CardReadmes(VGA16-cl64xx) $CardReadmes(SVGA-cl64xx) -set CardReadmes(VGA16-et3000) $CardReadmes(SVGA-et3000) -set CardReadmes(VGA16-et4000) $CardReadmes(SVGA-et4000) -set CardReadmes(VGA16-oak) $CardReadmes(SVGA-oak) -set CardReadmes(VGA16-tvga8900) $CardReadmes(SVGA-tvga8900) -set rdmelist "" -foreach idx [array names CardReadmes VGA16-*] { - eval lappend rdmelist $CardReadmes($idx) -} -set CardReadmes(VGA16) [concat [lrmdups $rdmelist]] - - -set CardReadmes(Mono-ati) $CardReadmes(SVGA-ati) -set CardReadmes(Mono-cl64xx) $CardReadmes(SVGA-cl64xx) -set CardReadmes(Mono-cirrus) $CardReadmes(SVGA-cirrus) -set CardReadmes(Mono-et3000) $CardReadmes(SVGA-et3000) -set CardReadmes(Mono-et4000) $CardReadmes(SVGA-et4000) -set CardReadmes(Mono-oak) $CardReadmes(SVGA-oak) -set CardReadmes(Mono-pvga1) $CardReadmes(SVGA-pvga1) -set CardReadmes(Mono-tvga8900) $CardReadmes(SVGA-tvga8900) -set CardReadmes(Mono) $CardReadmes(SVGA) -set rdmelist "" -foreach idx [array names CardReadmes Mono-*] { - eval lappend rdmelist $CardReadmes($idx) -} -set CardReadmes(Mono) [concat [lrmdups $rdmelist]] - - -set CardReadmes(8514) {} -set CardReadmes(AGX) README.agx -set CardReadmes(I128) {} -set CardReadmes(Mach8) {} -set CardReadmes(Mach32) README.Mach32 -set CardReadmes(Mach64) README.Mach64 -set CardReadmes(P9000) README.P9000 -set CardReadmes(S3) README.S3 -set CardReadmes(S3V) README.S3V -set CardReadmes(TGA) README.DECtga -set CardReadmes(W32) README.W32 - -set CardReadmes(EGC) {} -set CardReadmes(PEGC) {} -set CardReadmes(GANBWAP) README.cirrus -set CardReadmes(NKVNEC) README.cirrus -set CardReadmes(WABS) README.cirrus -set CardReadmes(WABEP) README.cirrus -set CardReadmes(WSNA) README.cirrus -set CardReadmes(TGUI) README.trident -set CardReadmes(MGA) README.MGA -set CardReadmes(NECS3) README.S3 -set CardReadmes(PWSKB) README.S3 -set CardReadmes(PWLB) README.S3 -set CardReadmes(GA968) README.S3 Index: xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c:1.10 xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c:1.10 Wed Jul 25 11:05:05 2001 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c Sat Feb 28 21:42:23 2004 @@ -1,703 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/confread.c,v 1.10 2001/07/25 15:05:05 dawes Exp $ */ -/* - * Copyright 1999 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - Functions for converting a XF86ConfigRec to Tcl variables - - */ - -#include "X.h" -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Parser.h" -#include "xf86tokens.h" - -#include "tcl.h" -#include "xfsconf.h" - -char *defaultFontPath = COMPILEDDEFAULTFONTPATH; -char *rgbPath = RGB_DB; - -#include -#include -#include -#ifdef NEED_SNPRINTF -#include "snprintf.h" -#endif - -static int getsection_files (Tcl_Interp *interp, char *varpfx); -static int getsection_module (Tcl_Interp *interp, char *varpfx); -static int getsection_flags (Tcl_Interp *interp, char *varpfx); -#if 0 -static int getsection_input (Tcl_Interp *interp, char *varpfx); -static int getsection_dri (Tcl_Interp *interp, char *varpfx); -#endif -static int getsection_vidadptr(Tcl_Interp *interp, char *varpfx); -static int getsection_modes (Tcl_Interp *interp, char *varpfx); -static int getsection_monitor (Tcl_Interp *interp, char *varpfx); -static int getsection_device (Tcl_Interp *interp, char *varpfx); -static int getsection_screen (Tcl_Interp *interp, char *varpfx); -static int getsection_layout (Tcl_Interp *interp, char *varpfx); -static int getsection_vendor (Tcl_Interp *interp, char *varpfx); - -static void read_options( - Tcl_Interp *interp, - char *arrname, - char *idxname, - XF86OptionPtr opts -); - -static void read_modes( - Tcl_Interp *interp, - char *arrname, - char *idxname, - XF86ConfModeLinePtr modes -); - -#define APPEND_ELEMENT (TCL_APPEND_VALUE|TCL_LIST_ELEMENT) - -#define CONFPATH "%A,%R,/etc/X11/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \ - "%P/etc/X11/%F,%D/%X,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \ - "%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X" - -/* - Implements the xf86config_readfile command which locates and reads - in the XF86Config file and set the values from it -*/ - -int -TCL_XF86ReadXF86Config(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int pfxarg = 1; - char *filename, *cmdline = NULL; - - if (argc > 3) { - Tcl_SetResult(interp, - "Usage: xf86config_readfile [cmdline] ", - TCL_STATIC); - return TCL_ERROR; - } - - if (argc == 3) { - cmdline = argv[1]; - pfxarg = 2; - } - - if ((filename = xf86OpenConfigFile(CONFPATH, cmdline, NULL)) == NULL) { - Tcl_SetResult(interp, - "Unable to open file" , TCL_STATIC); - return TCL_ERROR; - } - Tcl_SetResult(interp, filename, TCL_VOLATILE); - if ((config_list = xf86ReadConfigFile()) == NULL) { - Tcl_SetResult(interp, - "Error parsing config file" , TCL_STATIC); - return TCL_ERROR; - } - xf86CloseConfigFile(); - getsection_files (interp, argv[pfxarg]); - getsection_module (interp, argv[pfxarg]); - getsection_flags (interp, argv[pfxarg]); -#if 0 - getsection_input (interp, argv[pfxarg]); - getsection_dri (interp, argv[pfxarg]); -#endif - getsection_vidadptr(interp, argv[pfxarg]); - getsection_modes (interp, argv[pfxarg]); - getsection_monitor (interp, argv[pfxarg]); - getsection_device (interp, argv[pfxarg]); - getsection_screen (interp, argv[pfxarg]); - getsection_layout (interp, argv[pfxarg]); - getsection_vendor (interp, argv[pfxarg]); - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Files section -*/ - -static int -getsection_files(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char *f, section[128]; - - SECTION_NAME("Files"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - - Tcl_SetVar2(interp, section, "LogFile", - StrOrNull(config_list->conf_files->file_logfile), 0); - if (config_list->conf_files->file_fontpath) { - f = validate_font_path(config_list->conf_files->file_fontpath); - Tcl_SetVar2(interp, section, "FontPath", StrOrNull(f), 0); - } else { - Tcl_SetVar2(interp, section, "FontPath", defaultFontPath, 0); - } - if (config_list->conf_files->file_rgbpath) - Tcl_SetVar2(interp, section, "RGBPath", - config_list->conf_files->file_rgbpath, 0); - else - Tcl_SetVar2(interp, section, "RGBPath", rgbPath, 0); - Tcl_SetVar2(interp, section, "ModulePath", - StrOrNull(config_list->conf_files->file_modulepath), 0); - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the ServerFlags section -*/ - -static int -getsection_flags(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - - SECTION_NAME("Server"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - - if (!config_list->conf_flags) - return TRUE; - - read_options(interp, section, NULL, - config_list->conf_flags->flg_option_lst); - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Monitor sections -*/ - -static int -getsection_monitor(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - int i; - char *namebuf, tmpbuf[32]; - XF86ConfMonitorPtr mptr; - XF86ConfModesLinkPtr lptr; - - SECTION_NAME("Monitor"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (mptr = config_list->conf_monitor_lst; mptr; mptr = mptr->list.next) { - namebuf = (char *)XtMalloc(strlen(section) - + strlen(mptr->mon_identifier) + 2); - sprintf(namebuf, "%s_%s", section, mptr->mon_identifier); - - Tcl_SetVar2(interp, section, "Identifiers", mptr->mon_identifier, - APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, "VendorName", - StrOrNull(mptr->mon_vendor), 0); - Tcl_SetVar2(interp, namebuf, "ModelName", - StrOrNull(mptr->mon_modelname), 0); - sprintf(tmpbuf, "%d", mptr->mon_width); - Tcl_SetVar2(interp, namebuf, "Width", tmpbuf, 0); - sprintf(tmpbuf, "%d", mptr->mon_height); - Tcl_SetVar2(interp, namebuf, "Height", tmpbuf, 0); - - Tcl_SetVar2(interp, namebuf, "HorizSync", "", 0); - tmpbuf[0] = '\0'; - for (i = 0; i < mptr->mon_n_hsync; i++) { - sprintf(tmpbuf, "%.5g-%.5g", - mptr->mon_hsync[i].lo, mptr->mon_hsync[i].hi); - Tcl_SetVar2(interp, namebuf, "HorizSync", tmpbuf, - APPEND_ELEMENT); - } - - Tcl_SetVar2(interp, namebuf, "VertRefresh", "", 0); - tmpbuf[0] = '\0'; - for (i = 0; i < mptr->mon_n_vrefresh; i++) { - sprintf(tmpbuf, "%.5g-%.5g", - mptr->mon_vrefresh[i].lo, mptr->mon_vrefresh[i].hi); - Tcl_SetVar2(interp, namebuf, "VertRefresh", tmpbuf, - APPEND_ELEMENT); - } - - sprintf(tmpbuf, "%.3g %.3g %.3g", - mptr->mon_gamma_red, - mptr->mon_gamma_green, - mptr->mon_gamma_blue); - Tcl_SetVar2(interp, namebuf, "Gamma", tmpbuf, 0); - - read_modes (interp, namebuf, NULL, mptr->mon_modeline_lst); - read_options(interp, namebuf, NULL, mptr->mon_option_lst); - Tcl_SetVar2 (interp, namebuf, "ModeLinks", "", 0); - for (lptr = mptr->mon_modes_sect_lst; lptr; lptr = lptr->list.next) { - Tcl_SetVar2 (interp, namebuf, "ModeLinks", - lptr->ml_modes_str, APPEND_ELEMENT); - } - - XtFree(namebuf); - } - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Device sections -*/ - -static int -getsection_device(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - int i; - char *namebuf, tmpbuf[128]; - XF86ConfDevicePtr dptr; - - SECTION_NAME("Device"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (dptr = config_list->conf_device_lst; dptr; dptr = dptr->list.next) { - namebuf = XtMalloc(strlen(section) - + strlen(dptr->dev_identifier) + 10); - sprintf(namebuf, "%s_%s", section, dptr->dev_identifier); - Tcl_SetVar2(interp, section, "Identifiers", dptr->dev_identifier, - APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, "VendorName", - StrOrNull(dptr->dev_vendor), 0); - Tcl_SetVar2(interp, namebuf, "BoardName", - StrOrNull(dptr->dev_board), 0); - Tcl_SetVar2(interp, namebuf, "Chipset", - StrOrNull(dptr->dev_chipset), 0); - Tcl_SetVar2(interp, namebuf, "BusID", - StrOrNull(dptr->dev_busid), 0); - Tcl_SetVar2(interp, namebuf, "Card", - StrOrNull(dptr->dev_card), 0); - Tcl_SetVar2(interp, namebuf, "Driver", - StrOrNull(dptr->dev_driver), 0); - Tcl_SetVar2(interp, namebuf, "Ramdac", - StrOrNull(dptr->dev_ramdac), 0); - Tcl_SetVar2(interp, namebuf, "DacSpeed", - NonZeroStr(dptr->dev_dacSpeeds[0]/1000,10), 0); - if (dptr->dev_dacSpeeds[0]/1000 > 0) - for (i = 1; i < MAXDACSPEEDS; i++) { - if (dptr->dev_dacSpeeds[i]/1000 <= 0) - break; - sprintf(tmpbuf, "%d", dptr->dev_dacSpeeds[i]/1000); - Tcl_SetVar2(interp, namebuf, "DacSpeed", - tmpbuf, APPEND_ELEMENT); - } - Tcl_SetVar2(interp, namebuf, "VideoRam", - NonZeroStr(dptr->dev_videoram,10), 0); - sprintf(tmpbuf, "%.5g", dptr->dev_textclockfreq/1000.0); - Tcl_SetVar2(interp, namebuf, "TextClockFreq", tmpbuf, 0); - Tcl_SetVar2(interp, namebuf, "BIOSBase", - NonZeroStr(dptr->dev_bios_base,16), 0); - Tcl_SetVar2(interp, namebuf, "MemBase", - NonZeroStr(dptr->dev_mem_base,16), 0); - Tcl_SetVar2(interp, namebuf, "IOBase", - NonZeroStr(dptr->dev_io_base,16), 0); - Tcl_SetVar2(interp, namebuf, "ClockChip", - StrOrNull(dptr->dev_clockchip), 0); - Tcl_SetVar2(interp, namebuf, "Clocks", "", 0); - for (i = 0; i < dptr->dev_clocks; i++) { - sprintf(tmpbuf, "%.5g ", dptr->dev_clock[i]/1000.0); - Tcl_SetVar2(interp, namebuf, "Clocks", - tmpbuf, APPEND_ELEMENT); - } - Tcl_SetVar2(interp, namebuf, "ChipID", (dptr->dev_chipid <1) ? - "-1": NonZeroStr(dptr->dev_chipid,16), 0); - Tcl_SetVar2(interp, namebuf, "ChipRev", (dptr->dev_chiprev <1) ? - "-1": NonZeroStr(dptr->dev_chiprev,16), 0); - - read_options(interp, namebuf, NULL, dptr->dev_option_lst); - XtFree(namebuf); - } - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Screen sections -*/ - -static int -getsection_screen(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - XF86ConfScreenPtr screen; - XF86ConfDisplayPtr disp; - XF86ModePtr mode; - char *namebuf, tmpbuf[128], tmpbuf2[32]; - int depth; - - SECTION_NAME("Screen"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (screen = config_list->conf_screen_lst; screen; screen = screen->list.next) { - namebuf = (char *) XtMalloc(strlen(section) - + strlen(screen->scrn_identifier) + 2); - sprintf(namebuf, "%s_%s", section, screen->scrn_identifier); - Tcl_SetVar2(interp, section, "Identifiers", screen->scrn_identifier, - APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, "Identifier", - StrOrNull(screen->scrn_identifier), 0); - Tcl_SetVar2(interp, namebuf, "Driver", - StrOrNull(screen->scrn_obso_driver), 0); - sprintf(tmpbuf, "%d", screen->scrn_defaultdepth); - Tcl_SetVar2(interp, namebuf, "DefaultDepth", tmpbuf, 0); - sprintf(tmpbuf, "%d", screen->scrn_defaultbpp); - Tcl_SetVar2(interp, namebuf, "DefaultBPP", tmpbuf, 0); - sprintf(tmpbuf, "%d", screen->scrn_defaultfbbpp); - Tcl_SetVar2(interp, namebuf, "DefaultFbBPP", tmpbuf, 0); - Tcl_SetVar2(interp, namebuf, "Monitor", - StrOrNull(screen->scrn_monitor_str), 0); - Tcl_SetVar2(interp, namebuf, "Device", - StrOrNull(screen->scrn_device_str), 0); - - Tcl_SetVar2(interp, namebuf, "Depths", "", 0); - for (disp = screen->scrn_display_lst; disp; disp = disp->list.next) { - depth = disp->disp_depth; - sprintf(tmpbuf, "%d", depth); - Tcl_SetVar2(interp, namebuf, "Depths", tmpbuf, APPEND_ELEMENT); - sprintf(tmpbuf2, "Depth,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, tmpbuf, 0); - sprintf(tmpbuf, "%d", disp->disp_bpp); - sprintf(tmpbuf2, "BPP,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, tmpbuf, 0); - - if (disp->disp_frameX0 > 0 || disp->disp_frameX0 > 0) { - sprintf(tmpbuf, "%d %d", - disp->disp_frameX0, disp->disp_frameY0); - sprintf(tmpbuf2, "ViewPort,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, tmpbuf, 0); - } - - if (disp->disp_virtualX > 0 || disp->disp_virtualY > 0) { - sprintf(tmpbuf, "%d %d", - disp->disp_virtualX, disp->disp_virtualY); - sprintf(tmpbuf2, "Virtual,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, tmpbuf, 0); - } - - if (disp->disp_depth == 16 && disp->disp_weight.red > 0) { - sprintf(tmpbuf, "%d%d%d", - disp->disp_weight.red, - disp->disp_weight.green, - disp->disp_weight.blue); - sprintf(tmpbuf2, "Weight,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, tmpbuf, 0); - } - - if (disp->disp_visual) { - if (!NameCompare(disp->disp_visual, "StaticGray") || - !NameCompare(disp->disp_visual, "GrayScale") || - !NameCompare(disp->disp_visual, "StaticColor") || - !NameCompare(disp->disp_visual, "PseudoColor") || - !NameCompare(disp->disp_visual, "TrueColor") || - !NameCompare(disp->disp_visual, "DirectColor")) { - sprintf(tmpbuf2, "Visual,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, disp->disp_visual, 0); - } - } - - sprintf(tmpbuf2, "Modes,%d", depth); - Tcl_SetVar2(interp, namebuf, tmpbuf2, "", 0); - for (mode = disp->disp_mode_lst; mode; mode = mode->list.next) { - Tcl_SetVar2(interp, namebuf, tmpbuf2, mode->mode_name, - APPEND_ELEMENT); - } - sprintf(tmpbuf, "%d", depth); - read_options(interp, namebuf, tmpbuf, disp->disp_option_lst); - - } - - /* XXX: scrn_adaptor_lst */ - read_options(interp, namebuf, NULL, screen->scrn_option_lst); - - XtFree(namebuf); - } - - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Module section -*/ - -static int -getsection_module(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - XF86LoadPtr lptr; - - SECTION_NAME("Module"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - for (lptr = config_list->conf_modules->mod_load_lst; lptr; lptr = lptr->list.next) { - Tcl_SetVar2(interp, section, lptr->load_name, - lptr->load_type? "driver": "module", 0); - read_options(interp, section, lptr->load_name, lptr->load_opt); - } - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Layout section -*/ - -static int -getsection_layout(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], tmpbuf[16], *namebuf; - XF86ConfLayoutPtr lptr; - XF86ConfAdjacencyPtr aptr; - XF86ConfInactivePtr iptr; - - SECTION_NAME("Layout"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (lptr = config_list->conf_layout_lst; lptr; lptr = lptr->list.next) { - namebuf = (char *)XtMalloc(strlen(section) - + strlen(lptr->lay_identifier) + 2); - sprintf(namebuf, "%s_%s", section, lptr->lay_identifier); - Tcl_SetVar2(interp, section, "Identifiers", lptr->lay_identifier, - APPEND_ELEMENT); - - Tcl_SetVar2(interp, namebuf, "Screens", "", 0); - for (aptr = lptr->lay_adjacency_lst; aptr; aptr = aptr->list.next) { - Tcl_SetVar2(interp, namebuf, "Screens", - aptr->adj_screen_str, APPEND_ELEMENT); - sprintf(tmpbuf, "%d", aptr->adj_scrnum); - Tcl_SetVar2(interp, namebuf, aptr->adj_screen_str, - tmpbuf, TCL_LIST_ELEMENT); - Tcl_SetVar2(interp, namebuf, aptr->adj_screen_str, - StrOrNull(aptr->adj_top_str), APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, aptr->adj_screen_str, - StrOrNull(aptr->adj_bottom_str), APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, aptr->adj_screen_str, - StrOrNull(aptr->adj_left_str), APPEND_ELEMENT); - Tcl_SetVar2(interp, namebuf, aptr->adj_screen_str, - StrOrNull(aptr->adj_right_str), APPEND_ELEMENT); - } - - Tcl_SetVar2(interp, namebuf, "InactiveDevices", "", 0); - for (iptr = lptr->lay_inactive_lst; iptr; iptr = iptr->list.next) { - Tcl_SetVar2(interp, namebuf, "InactiveDevices", - StrOrNull(iptr->inactive_device_str), APPEND_ELEMENT); - } - read_options(interp, namebuf, NULL, lptr->lay_option_lst); - XtFree(namebuf); - } - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the VideoAdaptor section -*/ - -static int -getsection_vidadptr(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - char *namebuf; - XF86ConfVideoAdaptorPtr aptr; - XF86ConfVideoPortPtr pptr; - - SECTION_NAME("VidAdaptr"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (aptr= config_list->conf_videoadaptor_lst; aptr; aptr= aptr->list.next) { - namebuf = (char *)XtMalloc(strlen(section) - + strlen(aptr->va_identifier) + 2); - sprintf(namebuf, "%s_%s", section, aptr->va_identifier); - Tcl_SetVar2(interp, section, "Identifiers", aptr->va_identifier, - APPEND_ELEMENT); - - Tcl_SetVar2(interp, namebuf, "VendorName", - StrOrNull(aptr->va_vendor), 0); - Tcl_SetVar2(interp, namebuf, "BoardName", - StrOrNull(aptr->va_board), 0); - Tcl_SetVar2(interp, namebuf, "BusID", - StrOrNull(aptr->va_busid), 0); - Tcl_SetVar2(interp, namebuf, "Driver", - StrOrNull(aptr->va_driver), 0); - Tcl_SetVar2(interp, namebuf, "VideoPorts", "", 0); - for (pptr = aptr->va_port_lst; pptr; pptr = pptr->list.next) { - Tcl_SetVar2(interp, namebuf, "VideoPorts", - StrOrNull(pptr->vp_identifier), APPEND_ELEMENT); - read_options(interp, namebuf, pptr->vp_identifier, pptr->vp_option_lst); - } - read_options(interp, namebuf, NULL, aptr->va_option_lst); - /* XXX what about pptr->va_fwdref??? */ - } - return TCL_OK; -} - -/* - Set the Tcl variables for the config from the Modes section -*/ - -static int -getsection_modes(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - char *namebuf; - XF86ConfModesPtr mptr; - - SECTION_NAME("Modes"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (mptr = config_list->conf_modes_lst; mptr; mptr = mptr->list.next) { - namebuf = (char *)XtMalloc(strlen(section) - + strlen(mptr->modes_identifier) + 2); - sprintf(namebuf, "%s_%s", section, mptr->modes_identifier); - Tcl_SetVar2(interp, section, "Identifiers", mptr->modes_identifier, - APPEND_ELEMENT); - read_modes(interp, namebuf, NULL, mptr->mon_modeline_lst); - } - return TCL_OK; -} - -static int -getsection_vendor(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - char *namebuf; - XF86ConfVendorPtr vptr; - - SECTION_NAME("Vendor"); - fprintf(stderr, "getsection_%s(%p, %p(%s))\n", section, interp, varpfx, varpfx); - Tcl_SetVar2(interp, section, "Identifiers", "", 0); - for (vptr = config_list->conf_vendor_lst; vptr; vptr = vptr->list.next) { - namebuf = (char *)XtMalloc(strlen(section) - + strlen(vptr->vnd_identifier) + 2); - sprintf(namebuf, "%s_%s", section, vptr->vnd_identifier); - Tcl_SetVar2(interp, section, "Identifiers", vptr->vnd_identifier, - APPEND_ELEMENT); - read_options(interp, namebuf, NULL, vptr->vnd_option_lst); - } - return TCL_OK; -} - -static void -read_options(interp, arrname, idxname, opts) - Tcl_Interp *interp; - char *arrname, *idxname; - XF86OptionPtr opts; -{ - char idxbuf[128]; - char optbuf[128]; - - if (idxname) { - snprintf(idxbuf, 128, "%s:Options", idxname); - } else { - strcpy(idxbuf, "Options"); - } - Tcl_SetVar2(interp, arrname, idxbuf, "", 0); - for ( ; opts; opts = opts->list.next) { - snprintf(optbuf, 128, "%s%sOpt:%s", StrOrNull(idxname), - (idxname? "_": ""), opts->opt_name); - Tcl_SetVar2(interp, arrname, optbuf, opts->opt_val, 0); - Tcl_SetVar2(interp, arrname, idxbuf, opts->opt_name, APPEND_ELEMENT); - } -} - -#define APPENDVAL(dfmt,var) { sprintf(tmpbuf2,dfmt,(var)); \ - Tcl_SetVar2(interp,arrname,modebuf,tmpbuf2,APPEND_ELEMENT); } - -static void -read_modes(interp, arrname, idxname, modes) - Tcl_Interp *interp; - char *arrname, *idxname; - XF86ConfModeLinePtr modes; -{ - char idxbuf[128], modebuf[128]; - char tmpbuf2[16]; - static seqnum = 0; - - if (idxname) { - snprintf(idxbuf, 128, "%s:Modes", idxname); - } else { - strcpy(idxbuf, "Modes"); - } - Tcl_SetVar2(interp, arrname, idxbuf, "", 0); - for ( ; modes; modes = modes->list.next) { - snprintf(modebuf, 128, "%.110s%sMode:%d", StrOrNull(idxname), - (idxname? "_": ""), ++seqnum); - sprintf(tmpbuf2, "%d", seqnum); - Tcl_SetVar2(interp, arrname, idxbuf, tmpbuf2, APPEND_ELEMENT); - Tcl_SetVar2(interp, arrname, modebuf, modes->ml_identifier, 0); - - APPENDVAL("%.4g", modes->ml_clock/1000.0); - APPENDVAL("%d", modes->ml_hdisplay); - APPENDVAL("%d", modes->ml_hsyncstart); - APPENDVAL("%d", modes->ml_hsyncend); - APPENDVAL("%d", modes->ml_htotal); - APPENDVAL("%d", modes->ml_vdisplay); - APPENDVAL("%d", modes->ml_vsyncstart); - APPENDVAL("%d", modes->ml_vsyncend); - APPENDVAL("%d", modes->ml_vtotal); - if (modes->ml_flags & XF86CONF_INTERLACE) - Tcl_SetVar2(interp, arrname, modebuf, "Interlace", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_PHSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "+HSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_NHSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "-HSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_PVSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "+VSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_NVSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "-VSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_CSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "Composite", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_PCSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "+CSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_NCSYNC) - Tcl_SetVar2(interp, arrname, modebuf, "-CSync", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_DBLSCAN) - Tcl_SetVar2(interp, arrname, modebuf, "DoubleScan", APPEND_ELEMENT); - if (modes->ml_flags & XF86CONF_HSKEW) { - APPENDVAL("HSkew %d", modes->ml_hskew); - } - if (modes->ml_vscan) { - APPENDVAL("VScan %d", modes->ml_vscan); - } - } -} - -#undef APPENDVAL - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c:1.10 xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c:1.10 Wed Jul 25 11:05:05 2001 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c Sat Feb 28 21:42:23 2004 @@ -1,804 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/confwrite.c,v 1.10 2001/07/25 15:05:05 dawes Exp $ */ -/* - * Copyright 1999 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains Tcl bindings to the XF86Config file read/write routines - - */ - -#include "X.h" -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Parser.h" -#include "xf86tokens.h" - -#include "tcl.h" -#include "xfsconf.h" - -#include -#include -#include -#ifdef NEED_SNPRINTF -#include "snprintf.h" -#endif - -static int putsection_files (Tcl_Interp *interp, char *varpfx); -static int putsection_module (Tcl_Interp *interp, char *varpfx); -static int putsection_flags (Tcl_Interp *interp, char *varpfx); -#if 0 -static int putsection_input (Tcl_Interp *interp, char *varpfx); -static int putsection_dri (Tcl_Interp *interp, char *varpfx); -#endif -static int putsection_vidadptr(Tcl_Interp *interp, char *varpfx); -static int putsection_modes (Tcl_Interp *interp, char *varpfx); -static int putsection_monitor (Tcl_Interp *interp, char *varpfx); -static int putsection_device (Tcl_Interp *interp, char *varpfx); -static int putsection_screen (Tcl_Interp *interp, char *varpfx); -static int putsection_layout (Tcl_Interp *interp, char *varpfx); -static int putsection_vendor (Tcl_Interp *interp, char *varpfx); - -static int write_options( - Tcl_Interp *interp, - char *section, - char *idxname, - XF86OptionPtr *ptr2optptr -); - -static int write_modes( - Tcl_Interp *interp, - char *section, - char *idxname, - XF86ConfModeLinePtr *ptr2modeptr -); - - -/* - Implements the xf86config_writefile command which writes - values to the XF86Config file -*/ - -int -TCL_XF86WriteXF86Config(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 3) { - Tcl_SetResult(interp, - "Usage: xf86config_writefile filename varprefix" , TCL_STATIC); - return TCL_ERROR; - } - - config_list = (XF86ConfigPtr) XtMalloc(sizeof(XF86ConfigRec)); - memset(config_list, 0, sizeof(XF86ConfigRec)); - - putsection_files (interp, argv[2]); - putsection_module (interp, argv[2]); - putsection_flags (interp, argv[2]); -#if 0 - putsection_input (interp, argv[2]); - putsection_dri (interp, argv[2]); -#endif - putsection_vidadptr(interp, argv[2]); - putsection_modes (interp, argv[2]); - putsection_monitor (interp, argv[2]); - putsection_device (interp, argv[2]); - putsection_screen (interp, argv[2]); - putsection_layout (interp, argv[2]); - putsection_vendor (interp, argv[2]); - - if (xf86WriteConfigFile(argv[1], config_list) == 0) { - Tcl_SetResult(interp, - "Unable to write file" , TCL_STATIC); - return TCL_ERROR; - } - return TCL_OK; -} - -#define SETSTR(ptr, idx) \ - { char *p=Tcl_GetVar2(interp,section,idx,0); \ - if (p && strlen(p)) { \ - ptr=XtRealloc(ptr,strlen(p)+1); strcpy(ptr, p); \ - } else ptr=NULL; } -#define SETINT(var, idx) \ - { char *p=Tcl_GetVar2(interp,section,idx,0); \ - if (p && strlen(p)) Tcl_GetInt(interp, p, &(var)); } -#define SETBOOL(var, idx) \ - { char *p=Tcl_GetVar2(interp,section,idx,0); \ - var = 0; if (p && strlen(p)) var = 1; } - -#define SETnSTR(ptr, idx) \ - { char *p=Tcl_GetVar2(interp,namebuf,idx,0); \ - if (p && strlen(p)) { \ - ptr=XtRealloc(ptr,strlen(p)+1); strcpy(ptr, p); \ - } else ptr=NULL; } -#define SETnINT(var, idx) \ - { char *p=Tcl_GetVar2(interp,namebuf,idx,0); \ - if (p && strlen(p)) Tcl_GetInt(interp, p, &(var)); } -#define SETnBOOL(var, idx) \ - { char *p=Tcl_GetVar2(interp,namebuf,idx,0); \ - var = 0; if (p && strlen(p)) var = 1; } - -static int -putsection_files(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - XF86ConfFilesPtr fptr; - - fprintf(stderr, "putsection_files(%p, %s)\n", interp, varpfx); - SECTION_NAME("Files"); - - fptr = (XF86ConfFilesPtr) XtMalloc(sizeof(XF86ConfFilesRec)); - config_list->conf_files = fptr; - memset(fptr, 0, sizeof(XF86ConfFilesRec)); - SETSTR(fptr->file_logfile, "LogFile"); - SETSTR(fptr->file_fontpath, "FontPath"); - SETSTR(fptr->file_rgbpath, "RGBPath"); - SETSTR(fptr->file_modulepath, "ModulePath"); - return TCL_OK; -} - -static int -putsection_module(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], buf[160], *tmpbuf, *tmpptr, **idxv; - int i, idxc; - XF86LoadPtr lptr, prev; - - fprintf(stderr, "putsection_module(%p, %s)\n", interp, varpfx); - SECTION_NAME("Module"); - - config_list->conf_modules = - (XF86ConfModulePtr) XtMalloc(sizeof(XF86ConfModuleRec)); - memset(config_list->conf_modules, 0, sizeof(XF86ConfModuleRec)); - lptr = config_list->conf_modules->mod_load_lst = NULL; - - strcpy(buf, "array names "); strcat(buf, section); - if (Tcl_Eval(interp, buf) != TCL_OK) - return TCL_ERROR; - - tmpbuf = XtMalloc(strlen(interp->result)+1); - strcpy(tmpbuf, interp->result); - if (Tcl_SplitList(interp, tmpbuf, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86LoadPtr) 0; - for (i = 0; i < idxc; i++) { - if (strstr(idxv[i], "_Opt:") || strstr(idxv[i], ":Options")) - continue; - lptr = (XF86LoadPtr) XtMalloc(sizeof(XF86LoadRec)); - memset(lptr, 0, sizeof(XF86LoadRec)); - if (prev == (XF86LoadPtr) 0) { - config_list->conf_modules->mod_load_lst = lptr; - } else { - prev->list.next = lptr; - } - lptr->load_name = idxv[i]; - tmpptr = Tcl_GetVar2(interp, section, idxv[i], 0); - if (!NameCompare(tmpptr, "driver")) { - lptr->load_type = 1; - } else { - lptr->load_type = 0; - } - write_options(interp, section, idxv[i], &(lptr->load_opt)); - prev = lptr; - } - XtFree(tmpbuf); - return TCL_OK; -} - -static int -putsection_flags(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128]; - - fprintf(stderr, "putsection_flags(%p, %s)\n", interp, varpfx); - SECTION_NAME("Server"); - - if (Tcl_GetVar2(interp, section, "Options", 0) != NULL) { - config_list->conf_flags = - (XF86ConfFlagsPtr) XtMalloc(sizeof(XF86ConfFlagsRec)); - memset(config_list->conf_flags, 0, sizeof(XF86ConfFlagsRec)); - write_options(interp, section, NULL, - &(config_list->conf_flags->flg_option_lst)); - } - return TCL_OK; -} - -static int -putsection_monitor(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv, **tmpv; - int i, j, idxc, tmpc; - XF86ConfMonitorPtr mptr, prev; - XF86ConfModesLinkPtr lptr, lprev; - - fprintf(stderr, "putsection_monitor(%p, %s)\n", interp, varpfx); - SECTION_NAME("Monitor"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86ConfMonitorPtr) 0; - for (i = 0; i < idxc; i++) { - mptr = (XF86ConfMonitorPtr) XtMalloc(sizeof(XF86ConfMonitorRec)); - memset(mptr, 0, sizeof(XF86ConfMonitorRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfMonitorPtr) 0) { - config_list->conf_monitor_lst = mptr; - } else { - prev->list.next = mptr; - } - mptr->mon_identifier = idxv[i]; - SETnSTR(mptr->mon_vendor, "VendorName"); - SETnSTR(mptr->mon_modelname, "ModelName"); - SETnINT(mptr->mon_width, "Width"); - SETnINT(mptr->mon_height, "Height"); - ptr = Tcl_GetVar2(interp, namebuf, "HorizSync", 0); - tmpc=0; - if (Tcl_SplitList(interp, ptr, &tmpc, &tmpv) != TCL_OK) - return TCL_ERROR; - fprintf(stderr, "HorizSync = '%s' tmpc=%d\n", ptr, tmpc); - mptr->mon_n_hsync = tmpc; - for (j = 0; j < tmpc; j++) { - fprintf(stderr, "Scanning '%s'\n", tmpv[j]); - sscanf(tmpv[j], "%g-%g", - &(mptr->mon_hsync[j].lo), - &(mptr->mon_hsync[j].hi)); - } - ptr = Tcl_GetVar2(interp, namebuf, "VertRefresh", 0); - if (Tcl_SplitList(interp, ptr, &tmpc, &tmpv) != TCL_OK) - return TCL_ERROR; - mptr->mon_n_vrefresh = tmpc; - for (j = 0; j < tmpc; j++) { - sscanf(tmpv[j], "%g-%g", - &(mptr->mon_vrefresh[j].lo), - &(mptr->mon_vrefresh[j].hi)); - } - ptr = Tcl_GetVar2(interp, namebuf, "Gamma", 0); - sscanf(ptr, "%g %g %g", &(mptr->mon_gamma_red), - &(mptr->mon_gamma_green), &(mptr->mon_gamma_blue)); - write_modes (interp, namebuf, NULL, &(mptr->mon_modeline_lst)); - write_options(interp, namebuf, NULL, &(mptr->mon_option_lst)); - ptr = Tcl_GetVar2(interp, namebuf, "ModeLinks", 0); - if (Tcl_SplitList(interp, ptr, &tmpc, &tmpv) != TCL_OK) - return TCL_ERROR; - lprev = (XF86ConfModesLinkPtr) 0; - for (j = 0; j < tmpc; j++) { - lptr = (XF86ConfModesLinkPtr) XtMalloc(sizeof(XF86ConfModesLinkRec)); - memset(mptr, 0, sizeof(XF86ConfModesLinkRec)); - if (lprev == (XF86ConfModesLinkPtr) 0) { - mptr->mon_modes_sect_lst = lptr; - } else { - lprev->list.next = lptr; - } - lptr->ml_modes_str = tmpv[j]; - lprev = lptr; - } - prev = mptr; - } - return TCL_OK; -} - -static int -putsection_device(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv, **av; - int i, j, idxc, ac, n; - XF86ConfDevicePtr dptr, prev; - double tmpdbl; - - fprintf(stderr, "putsection_device(%p, %s)\n", interp, varpfx); - SECTION_NAME("Device"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86ConfDevicePtr) 0; - for (i = 0; i < idxc; i++) { - dptr = (XF86ConfDevicePtr) XtMalloc(sizeof(XF86ConfDeviceRec)); - memset(dptr, 0, sizeof(XF86ConfDeviceRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfDevicePtr) 0) { - config_list->conf_device_lst = dptr; - } else { - prev->list.next = dptr; - } - dptr->dev_identifier = idxv[i]; - fprintf(stderr, "identifier = %s\n", idxv[i]); - SETnSTR(dptr->dev_vendor, "VendorName"); - SETnSTR(dptr->dev_board, "BoardName"); - SETnSTR(dptr->dev_chipset, "Chipset"); - SETnSTR(dptr->dev_busid, "BusID"); - SETnSTR(dptr->dev_card, "Card"); - SETnSTR(dptr->dev_driver, "Driver"); - SETnSTR(dptr->dev_ramdac, "Ramdac"); - ptr = Tcl_GetVar2(interp, namebuf, "DacSpeed", 0); - if (strlen(ptr)) { - if (Tcl_SplitList(interp, ptr, &ac, &av) != TCL_OK) - return TCL_ERROR; - for (j = 0; j < ac; j++) { - Tcl_GetInt(interp, av[j], &n); - dptr->dev_dacSpeeds[j] = n * 1000; - } - } - SETnINT(dptr->dev_videoram, "VideoRam"); - ptr = Tcl_GetVar2(interp, namebuf, "TextClockFreq", 0); - if (ptr && strlen(ptr)) { - Tcl_GetDouble(interp, ptr, &tmpdbl); - dptr->dev_textclockfreq = tmpdbl*1000.0 + 0.5; - } - ptr = Tcl_GetVar2(interp, namebuf, "BIOSBase", 0); - dptr->dev_bios_base = strtoul(ptr, NULL, 16); - fprintf(stderr, "BIOSBase = %s\n", ptr); - ptr = Tcl_GetVar2(interp, namebuf, "MemBase", 0); - dptr->dev_mem_base = strtoul(ptr, NULL, 16); - ptr = Tcl_GetVar2(interp, namebuf, "IOBase", 0); - dptr->dev_io_base = strtoul(ptr, NULL, 16); - SETnSTR(dptr->dev_clockchip, "ClockChip"); - ptr = Tcl_GetVar2(interp, namebuf, "Clocks", 0); - if (strlen(ptr)) { - if (Tcl_SplitList(interp, ptr, &ac, &av) != TCL_OK) - return TCL_ERROR; - dptr->dev_clocks = ac; - for (j = 0; j < ac; j++) { - Tcl_GetInt(interp, av[j], &n); - dptr->dev_clock[j] = n * 1000; - } - } - ptr = Tcl_GetVar2(interp, namebuf, "ChipID", 0); - dptr->dev_chipid = strtoul(ptr, NULL, 16); - ptr = Tcl_GetVar2(interp, namebuf, "ChipRev", 0); - dptr->dev_chiprev = strtoul(ptr, NULL, 16); - write_options(interp, namebuf, NULL, &(dptr->dev_option_lst)); - prev = dptr; - } - return TCL_OK; -} - -static int -putsection_screen(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], tmpbuf2[128], *ptr, **idxv, **dv, **mv; - int i, j, k, idxc, dc, depth, mc; - XF86ConfScreenPtr sptr, sprev; - XF86ConfDisplayPtr dptr, dprev; - XF86ModePtr mptr, mprev; - - fprintf(stderr, "putsection_screen(%p, %s)\n", interp, varpfx); - SECTION_NAME("Screen"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - sprev = (XF86ConfScreenPtr) 0; - for (i = 0; i < idxc; i++) { - sptr = (XF86ConfScreenPtr) XtMalloc(sizeof(XF86ConfScreenRec)); - memset(sptr, 0, sizeof(XF86ConfScreenRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - fprintf(stderr, "namebuf = %s\n", namebuf); - if (sprev == (XF86ConfScreenPtr) 0) { - config_list->conf_screen_lst = sptr; - } else { - sprev->list.next = sptr; - } - sptr->scrn_identifier = idxv[i]; - SETnSTR(sptr->scrn_obso_driver, "Driver"); - SETnINT(sptr->scrn_defaultdepth, "DefaultDepth"); - SETnINT(sptr->scrn_defaultbpp, "DefaultBPP"); - SETnINT(sptr->scrn_defaultfbbpp, "DefaultFbBPP"); - SETnSTR(sptr->scrn_monitor_str, "Monitor"); - fprintf(stderr, "dev = %p (%s)\n", sptr->scrn_device_str, sptr->scrn_device_str); - SETnSTR(sptr->scrn_device_str, "Device"); - fprintf(stderr, "dev' = %p (%s)\n", sptr->scrn_device_str, sptr->scrn_device_str); - - dprev = (XF86ConfDisplayPtr) 0; - ptr = Tcl_GetVar2(interp, namebuf, "Depths", 0); - if (Tcl_SplitList(interp, ptr, &dc, &dv) != TCL_OK) - return TCL_ERROR; - fprintf(stderr, "Depths: %s\n", ptr); - for (j = 0; j < dc; j++) { - dptr = (XF86ConfDisplayPtr) XtMalloc(sizeof(XF86ConfDisplayRec)); - memset(dptr, 0, sizeof(XF86ConfDisplayRec)); - Tcl_GetInt(interp, dv[j], &depth); - fprintf(stderr, "depth = %d\n", depth); - if (dprev == (XF86ConfDisplayPtr) 0) { - sptr->scrn_display_lst = dptr; - } else { - dprev->list.next = dptr; - } - dptr->disp_depth = depth; - fprintf(stderr, ">>> BPP\n"); - sprintf(tmpbuf2, "BPP,%d", depth); - ptr = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - if (ptr) - Tcl_GetInt(interp, ptr, &(dptr->disp_bpp)); - fprintf(stderr, ">>> ViewPort\n"); - sprintf(tmpbuf2, "ViewPort,%d", depth); - ptr = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - if (ptr) - sscanf(ptr, "%d %d", - &(dptr->disp_frameX0), &(dptr->disp_frameY0)); - fprintf(stderr, ">>> Virtual\n"); - sprintf(tmpbuf2, "Virtual,%d", depth); - ptr = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - if (ptr) - sscanf(ptr, "%d %d", - &(dptr->disp_virtualX), &(dptr->disp_virtualY)); - fprintf(stderr, ">>> Weight\n"); - sprintf(tmpbuf2, "Weight,%d", depth); - ptr = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - if (ptr) - sscanf(ptr, "%1d%1d%1d", &(dptr->disp_weight.red), - &(dptr->disp_weight.green), &(dptr->disp_weight.blue)); - fprintf(stderr, ">>> Visual\n"); - sprintf(tmpbuf2, "Visual,%d", depth); - dptr->disp_visual = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - sprintf(tmpbuf2, "Modes,%d", depth); - ptr = Tcl_GetVar2(interp, namebuf, tmpbuf2, 0); - if (Tcl_SplitList(interp, ptr, &mc, &mv) != TCL_OK) - return TCL_ERROR; - fprintf(stderr, "%s '%s'\n", tmpbuf2, ptr); - mprev = (XF86ModePtr) 0; - for (k = 0; k < mc; k++) { - mptr = (XF86ModePtr) XtMalloc(sizeof(XF86ModeRec)); - memset(mptr, 0, sizeof(XF86ModeRec)); - if (mprev == (XF86ModePtr) 0) { - dptr->disp_mode_lst = mptr; - } else { - mprev->list.next = mptr; - } - fprintf(stderr, "Mode ID = '%s' mptr=%p dptr=%p\n", mv[k], mptr, dptr); - mptr->mode_name = ConfigStrdup(mv[k]); - mprev = mptr; - } - fprintf(stderr, ">>> Options\n"); - write_options(interp, namebuf, dv[j], &(dptr->disp_option_lst)); - dprev = dptr; - } - write_options(interp, namebuf, NULL, &(sptr->scrn_option_lst)); - sprev = sptr; - } - return TCL_OK; -} - -static int -putsection_layout(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv, **av, **sv; - int i, j, idxc, ac, sc; - XF86ConfLayoutPtr lptr, prev; - XF86ConfAdjacencyPtr aptr, aprev; - - fprintf(stderr, "putsection_layout(%p, %s)\n", interp, varpfx); - SECTION_NAME("Layout"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - fprintf(stderr, "Identifiers: %s\n", ptr); - prev = (XF86ConfLayoutPtr) 0; - for (i = 0; i < idxc; i++) { - lptr = (XF86ConfLayoutPtr) XtMalloc(sizeof(XF86ConfLayoutRec)); - memset(lptr, 0, sizeof(XF86ConfLayoutRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfLayoutPtr) 0) { - config_list->conf_layout_lst = lptr; - } else { - prev->list.next = lptr; - } - lptr->lay_identifier = ConfigStrdup(idxv[i]); - aprev = (XF86ConfAdjacencyPtr) 0; - ptr = Tcl_GetVar2(interp, namebuf, "Screens", 0); - if (Tcl_SplitList(interp, ptr, &sc, &sv) != TCL_OK) - return TCL_ERROR; - fprintf(stderr, "Screens: %s\n", ptr); - for (j = 0; j < sc; j++) { - aptr = (XF86ConfAdjacencyPtr) XtMalloc(sizeof(XF86ConfAdjacencyRec)); - memset(aptr, 0, sizeof(XF86ConfAdjacencyRec)); - fprintf(stderr, "screen = %s\n", sv[j]); - if (aprev == (XF86ConfAdjacencyPtr) 0) { - lptr->lay_adjacency_lst = aptr; - } else { - aprev->list.next = aptr; - } - aptr->adj_screen_str = ConfigStrdup(sv[j]); - ptr = Tcl_GetVar2(interp, namebuf, sv[j], 0); - if (Tcl_SplitList(interp, ptr, &ac, &av) != TCL_OK) - return TCL_ERROR; - Tcl_GetInt(interp, av[0], &(aptr->adj_scrnum)); - aptr->adj_top_str = ConfigStrdup(av[1]); - aptr->adj_bottom_str = ConfigStrdup(av[2]); - aptr->adj_left_str = ConfigStrdup(av[3]); - aptr->adj_right_str = ConfigStrdup(av[4]); - aprev = aptr; - } - write_options(interp, namebuf, NULL, &(lptr->lay_option_lst)); - prev = lptr; - } - return TCL_OK; -} - -static int -putsection_vidadptr(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv; - int i, idxc; - XF86ConfVideoAdaptorPtr aptr, prev; - XF86ConfVideoPortPtr pptr; - - fprintf(stderr, "putsection_vidadptr(%p, %s)\n", interp, varpfx); - SECTION_NAME("VidAdaptr"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86ConfVideoAdaptorPtr) 0; - for (i = 0; i < idxc; i++) { - aptr = (XF86ConfVideoAdaptorPtr) XtMalloc(sizeof(XF86ConfVideoAdaptorRec)); - memset(aptr, 0, sizeof(XF86ConfVideoAdaptorRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfVideoAdaptorPtr) 0) { - config_list->conf_videoadaptor_lst = aptr; - } else { - prev->list.next = aptr; - } - aptr->va_identifier = idxv[i]; - SETnSTR(aptr->va_vendor, "VendorName"); - SETnSTR(aptr->va_board, "BoardName"); - SETnSTR(aptr->va_busid, "BusID"); - SETnSTR(aptr->va_driver, "Driver"); - /* XXX aptr->vp_port_lst */ - write_options(interp, namebuf, NULL, &(aptr->va_option_lst)); - /* XXX aptr->va_fwdref */ - prev = aptr; - } - return TCL_OK; -} - -static int -putsection_modes(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv; - int i, idxc; - XF86ConfModesPtr mptr, prev; - - fprintf(stderr, "putsection_modes(%p, %s)\n", interp, varpfx); - SECTION_NAME("Modes"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86ConfModesPtr) 0; - for (i = 0; i < idxc; i++) { - mptr = (XF86ConfModesPtr) XtMalloc(sizeof(XF86ConfModesRec)); - memset(mptr, 0, sizeof(XF86ConfModesRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfModesPtr) 0) { - config_list->conf_modes_lst = mptr; - } else { - prev->list.next = mptr; - } - mptr->modes_identifier = idxv[i]; - write_modes(interp, namebuf, NULL, &(mptr->mon_modeline_lst)); - prev = mptr; - } - return TCL_OK; -} - -static int -putsection_vendor(interp, varpfx) - Tcl_Interp *interp; - char *varpfx; -{ - char section[128], namebuf[128], *ptr, **idxv; - int i, idxc; - XF86ConfVendorPtr vptr, prev; - - fprintf(stderr, "putsection_vendor(%p, %s)\n", interp, varpfx); - SECTION_NAME("Vendor"); - ptr = Tcl_GetVar2(interp, section, "Identifiers", 0); - if (Tcl_SplitList(interp, ptr, &idxc, &idxv) != TCL_OK) - return TCL_ERROR; - - prev = (XF86ConfVendorPtr) 0; - for (i = 0; i < idxc; i++) { - vptr = (XF86ConfVendorPtr) XtMalloc(sizeof(XF86ConfVendorRec)); - memset(vptr, 0, sizeof(XF86ConfVendorRec)); - snprintf(namebuf, 128, "%s_%s", section, idxv[i]); - if (prev == (XF86ConfVendorPtr) 0) { - config_list->conf_vendor_lst = vptr; - } else { - prev->list.next = vptr; - } - vptr->vnd_identifier = idxv[i]; - write_options(interp, namebuf, NULL, &(vptr->vnd_option_lst)); - prev = vptr; - } - return TCL_OK; -} - - -static int -write_options(interp, section, idxname, ptr2optptr) - Tcl_Interp *interp; - char *section, *idxname; - XF86OptionPtr *ptr2optptr; -{ - XF86OptionPtr optr, prev; - char **optv, *tmpbuf, *optlist, *ptr, *ptr2; - int i, optc, idxlen; - - fprintf(stderr, "write_options(%p, %s, %s, %p)\n", interp, section, idxname, ptr2optptr); - if (idxname) { - idxlen = strlen(idxname); - tmpbuf = XtMalloc(idxlen+9); - sprintf(tmpbuf, "%s:Options", idxname); - } else { - idxlen = 0; - tmpbuf = XtMalloc(8); - strcpy(tmpbuf, "Options"); - } - fprintf(stderr, "tmpbuf = '%s'\n", tmpbuf); - optlist = Tcl_GetVar2(interp, section, tmpbuf, 0); - fprintf(stderr, "options = %p\n", optlist); - Tcl_SplitList(interp, optlist, &optc, &optv); - fprintf(stderr, "options: %s\n", optlist); - - prev = (XF86OptionPtr) 0; - for (i = 0; i < optc; i++) { - ptr = XtMalloc(idxlen+strlen(optv[i])+6); - sprintf(ptr, "%s%sOpt:%s", StrOrNull(idxname), - (idxname? "_": ""), optv[i]); - optr = (XF86OptionPtr) XtMalloc(sizeof(XF86OptionRec)); - memset(optr, 0, sizeof(XF86OptionRec)); - fprintf(stderr, "optidx = %s\n", ptr); - if (prev == (XF86OptionPtr) 0) { - *ptr2optptr = optr; - } else { - prev->list.next = optr; - } - optr->opt_name= ConfigStrdup(optv[i]); - ptr2 = Tcl_GetVar2(interp, section, ptr, 0); - if (strlen(ptr2)) { - optr->opt_val = ConfigStrdup(ptr2); - } - optr->opt_used = 0; - prev = optr; - XtFree(ptr); - } - XtFree(tmpbuf); - return TCL_OK; -} - -static int -write_modes(interp, section, idxname, ptr2modeptr) - Tcl_Interp *interp; - char *section, *idxname; - XF86ConfModeLinePtr *ptr2modeptr; -{ - XF86ConfModeLinePtr mptr, prev; - char **modev, **mlv, *tmpbuf, *modelist, *ptr, *ptr2; - int i, j, modec, mlc, idxlen; - double tmpclk; - - fprintf(stderr, "write_modes(%p, %s, %s, %p)\n", interp, section, idxname, ptr2modeptr); - if (idxname) { - idxlen = strlen(idxname); - tmpbuf = XtMalloc(idxlen+9); - sprintf(tmpbuf, "%s:Modes", idxname); - } else { - idxlen = 0; - tmpbuf = XtMalloc(8); - strcpy(tmpbuf, "Modes"); - } - modelist = Tcl_GetVar2(interp, section, tmpbuf, 0); - Tcl_SplitList(interp, modelist, &modec, &modev); - - prev = (XF86ConfModeLinePtr) 0; - for (i = 0; i < modec; i++) { - ptr = XtMalloc(idxlen+strlen(modev[i])+6); - sprintf(ptr, "%s%sMode:%s", StrOrNull(idxname), - (idxname? "_": ""), modev[i]); - mptr = (XF86ConfModeLinePtr) XtMalloc(sizeof(XF86ConfModeLineRec)); - memset(mptr, 0, sizeof(XF86ConfModeLineRec)); - if (prev == (XF86ConfModeLinePtr) 0) { - *ptr2modeptr = mptr; - } else { - prev->list.next = mptr; - } - ptr2 = Tcl_GetVar2(interp, section, ptr, 0); - Tcl_SplitList(interp, ptr2, &mlc, &mlv); - if (mlc < 10) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "Invalid modeline: ", ptr2, NULL); - return TCL_ERROR; - } - mptr->ml_identifier = ConfigStrdup(mlv[0]); - Tcl_GetDouble(interp, mlv[1], &(tmpclk)); - mptr->ml_clock = (int) (tmpclk * 1000.0 + 0.5); - Tcl_GetInt(interp, mlv[2], &(mptr->ml_hdisplay)); - Tcl_GetInt(interp, mlv[3], &(mptr->ml_hsyncstart)); - Tcl_GetInt(interp, mlv[4], &(mptr->ml_hsyncend)); - Tcl_GetInt(interp, mlv[5], &(mptr->ml_htotal)); - Tcl_GetInt(interp, mlv[6], &(mptr->ml_vdisplay)); - Tcl_GetInt(interp, mlv[7], &(mptr->ml_vsyncstart)); - Tcl_GetInt(interp, mlv[8], &(mptr->ml_vsyncend)); - Tcl_GetInt(interp, mlv[9], &(mptr->ml_vtotal)); - -#define CHKFLAG(str,bit) if (!NameCompare(mlv[j], (str))) { \ - mptr->ml_flags |= (bit); continue; } - - for (j = 10; j < mlc; j++) { - CHKFLAG("Interlace", XF86CONF_INTERLACE); - CHKFLAG("+HSync", XF86CONF_PHSYNC); - CHKFLAG("-HSync", XF86CONF_NHSYNC); - CHKFLAG("+VSync", XF86CONF_PVSYNC); - CHKFLAG("-VSync", XF86CONF_NVSYNC); - CHKFLAG("Composite", XF86CONF_CSYNC); - CHKFLAG("+CSync", XF86CONF_PCSYNC); - CHKFLAG("-CSync", XF86CONF_NCSYNC); - CHKFLAG("DoubleScan", XF86CONF_DBLSCAN); - if (strlen(mlv[j]) > 6 && mlv[j][5] == ' ') { - mlv[j][5] = '\0'; - if (!NameCompare(mlv[j], "HSkew")) { - mptr->ml_flags |= XF86CONF_HSKEW; - Tcl_GetInt(interp, &(mlv[j][6]), &(mptr->ml_hskew)); - } - if (!NameCompare(mlv[j], "VScan")) { - Tcl_GetInt(interp, &(mlv[j][6]), &(mptr->ml_vscan)); - } - mlv[j][5] = ' '; - } - /* Ignore unknown flags */ - } -#undef CHKFLAG - prev = mptr; - XtFree(ptr); - } - XtFree(tmpbuf); - return TCL_OK; -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl:3.9 xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl:3.9 Sun Apr 5 12:15:49 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl Sat Feb 28 21:42:23 2004 @@ -1,72 +0,0 @@ -# $XConsortium: done.tcl /main/4 1996/10/25 10:21:11 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/done.tcl,v 3.9 1998/04/05 16:15:49 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Routines run to end the main configuration phase (phase 2) -# - -proc Done_create_widgets { win } { - global pc98_EGC messages - set w [winpathprefix $win] - if !$pc98_EGC { - frame $w.done -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.done -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.done.pad -relief raised -bd 3 - pack $w.done.pad -padx 20 -pady 15 -expand yes - label $w.done.pad.text - $w.done.pad.text configure -text $messages(done.1) - pack $w.done.pad.text -fill both -expand yes - button $w.done.pad.okay -text $messages(done.2) \ - -command [list Done_nextphase $w] - pack $w.done.pad.okay -side bottom -pady 10m - focus $w.done.pad.okay -} - -proc Done_activate { win } { - set w [winpathprefix $win] - pack $w.done -side top -fill both -expand yes - focus $w.done.pad.okay -} - -proc Done_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.done -} - -proc Done_execute { win } { - global CfgSelection - - set w [winpathprefix $win] - set CfgSelection Done - config_select $w -} - -proc Done_nextphase { win } { - global StartServer XF86Setup_library env messages - - set w [winpathprefix $win] - if $StartServer { - mesg $messages(done.3) info - catch {destroy .} - catch {server_running -close $env(DISPLAY)} - save_state - } else { - destroy $w.menu $w.done $w.buttons - uplevel #0 source $XF86Setup_library/phase4.tcl - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl:3.5 xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl:3.5 Fri Dec 5 17:01:27 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl Sat Feb 28 21:42:23 2004 @@ -1,105 +0,0 @@ -# $XConsortium: filelist.tcl /main/2 1996/10/19 18:52:58 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/filelist.tcl,v 3.5 1997/12/05 22:01:27 hohndel Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# List of files that are needed by this program or programs spawned by it. -# These lists are not meant to be exhaustive, but they should be -# complete enough to ensure that all the needed .tgz files have been -# installed - -array set FilePermsDescriptions { - Libs "X11 libraries" - Cfg "configuration and application default files" - Fonts "standard font files" - DB "device, keysym, error, locale, and color databases" - Bin "standard X client programs" - VidTune "xvidtune configuration files and/or the xvidtune program" - XKB "X keyboard extension programs and configuration files" -} - -array set FilePermsLibs { - lib/libX11* 644 - lib/libXaw* 644 - lib/libXext* 644 - lib/libXi* 644 - lib/libXmu* 644 - lib/libXtst* 644 - lib/libSM* 644 - lib/libICE* 644 -} - -array set FilePermsCfg { - lib/X11/xinit/xinitrc 444 - lib/X11/app-defaults/Bitmap 444 - lib/X11/app-defaults/XLogo 444 - lib/X11/app-defaults/XTerm 444 -} - -array set FilePermsFonts { - lib/X11/fonts/misc/fonts.dir 444 - lib/X11/fonts/misc/fonts.alias 444 - lib/X11/fonts/misc/6x13.pc* 444 - lib/X11/fonts/75dpi/fonts.dir 444 - lib/X11/fonts/75dpi/symb10.pc* 444 -} - -array set FilePermsDB { - lib/X11/XErrorDB 444 - lib/X11/XKeysymDB 444 - lib/X11/rgb.txt 444 - lib/X11/Cards 444 - lib/X11/locale/locale.dir 444 - lib/X11/locale/C/XLC_LOCALE 444 -} - -array set FilePermsBin { - bin/SuperProbe 755 - bin/bitmap 755 - bin/mkfontdir 755 - bin/twm 755 - bin/xdpyinfo 755 - bin/xinit 755 - bin/xset 755 - bin/xterm 755 -} - -array set FilePermsVidTune { - bin/xvidtune 755 - lib/X11/app-defaults/Xvidtune 444 -} - -array set FilePermsXKB { - bin/xkbcomp 755 - lib/X11/xkb/xkbcomp 755 - lib/X11/xkb/compat/default 444 - lib/X11/xkb/compiled/README 444 - lib/X11/xkb/geometry/pc 444 - lib/X11/xkb/keycodes/xfree86 444 - lib/X11/xkb/keymap/xfree86 444 - lib/X11/xkb/semantics/default 444 - lib/X11/xkb/symbols/us 444 - lib/X11/xkb/types/default 444 - lib/X11/xkb/rules/xfree86 444 - lib/X11/xkb/rules/xfree86.lst 444 -} - -array set FilePermsReadMe { - lib/X11/doc/README.Oak 444 - lib/X11/doc/README.ati 444 - lib/X11/doc/README.trident 444 - lib/X11/doc/README.agx 444 - lib/X11/doc/README.Mach64 444 - lib/X11/doc/README.P9000 444 - lib/X11/doc/README.S3 444 - lib/X11/doc/README.tseng 444 -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl:1.1 Sun Jul 11 06:47:13 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl Sat Feb 28 21:42:23 2004 @@ -1,99 +0,0 @@ -# $XConsortium: filelist.tcl /main/2 1996/10/19 18:52:58 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/filelist98.tcl,v 1.1 1999/07/11 10:47:13 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# List of files that are needed by this program or programs spawned by it. -# These lists are not meant to be exhaustive, but they should be -# complete enough to ensure that all the needed .tgz files have been -# installed - -array set FilePermsDescriptions { - Libs "X11 libraries" - Cfg "configuration and application default files" - Fonts "standard font files" - DB "device, keysym, error, locale, and color databases" - Bin "standard X client programs" - VidTune "xvidtune configuration files and/or the xvidtune program" - XKB "X keyboard extension programs and configuration files" -} - -array set FilePermsLibs { - lib/libX11* 644 - lib/libXaw* 644 - lib/libXext* 644 - lib/libXi* 644 - lib/libXmu* 644 - lib/libXtst* 644 - lib/libSM* 644 - lib/libICE* 644 -} - -array set FilePermsCfg { - lib/X11/xinit/xinitrc 444 - lib/X11/app-defaults/Bitmap 444 - lib/X11/app-defaults/XLogo 444 - lib/X11/app-defaults/XTerm 444 -} - -array set FilePermsFonts { - lib/X11/fonts/misc/fonts.dir 444 - lib/X11/fonts/misc/fonts.alias 444 - lib/X11/fonts/misc/6x13.pc* 444 - lib/X11/fonts/75dpi/fonts.dir 444 - lib/X11/fonts/75dpi/symb10.pc* 444 -} - -array set FilePermsDB { - lib/X11/XErrorDB 444 - lib/X11/XKeysymDB 444 - lib/X11/rgb.txt 444 - lib/X11/Cards98 444 - lib/X11/locale/locale.dir 444 - lib/X11/locale/C/XLC_LOCALE 444 -} - -array set FilePermsBin { - bin/bitmap 755 - bin/mkfontdir 755 - bin/twm 755 - bin/xdpyinfo 755 - bin/xinit 755 - bin/xset 755 - bin/xterm 755 -} - -array set FilePermsVidTune { - bin/xvidtune 755 - lib/X11/app-defaults/Xvidtune 444 -} - -array set FilePermsXKB { - bin/xkbcomp 755 - lib/X11/xkb/xkbcomp 755 - lib/X11/xkb/compat/default 444 - lib/X11/xkb/compiled/README 444 - lib/X11/xkb/geometry/pc 444 - lib/X11/xkb/keycodes/xfree98 444 - lib/X11/xkb/keymap/xfree98 444 - lib/X11/xkb/semantics/default 444 - lib/X11/xkb/symbols/us 444 - lib/X11/xkb/types/default 444 - lib/X11/xkb/rules/xfree86 444 - lib/X11/xkb/rules/xfree86.lst 444 -} - -array set FilePermsReadMe { - lib/X11/doc/README.MGA 444 - lib/X11/doc/README.S3 444 - lib/X11/doc/README.cirrus 444 - lib/X11/doc/README.trident 444 -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl:1.1 Mon Apr 5 03:12:59 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl Sat Feb 28 21:42:23 2004 @@ -1,79 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/kbddata.tcl,v 1.1 1999/04/05 07:12:59 dawes Exp $ -# -# Copyright 1998 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Data used by the keyboard configuration routines -# - -set XKBrules $Xwinhome/lib/X11/xkb/rules/xfree86 - -# procedure for determining available XKB settings, when the XKB extension -# is not available -# -proc Kbd_setxkbcomponents {} { - global Xwinhome locale XKBrules XKBComponents - - set XKBComponents(models,names) "" - set XKBComponents(models,descriptions) "" - set XKBComponents(layouts,names) "" - set XKBComponents(layouts,descriptions) "" - set XKBComponents(variants,names) "" - set XKBComponents(variants,descriptions) "" - set XKBComponents(options,names) "" - set XKBComponents(options,descriptions) "" - - if [file readable ${XKBrules}-$locale.lst] { - set fd [open $XKBrules-$locale.lst r] - } else { - set fd [open $XKBrules.lst r] - } - set type none - set ws "\[ \t]" - while { [gets $fd line] >= 0 } { - switch -regexp -- $line { - "^$ws*$" - - "^$ws*//" continue - "^! [a-z]+" { - set type [string range $line 2 end] - set type [string trim $type] - } - default { - switch -- $type { - model - - layout - - variant - - option { - if ![regexp "^$ws+(\[^ \t]+)$ws+(.+)$" \ - $line dummy name desc] \ - continue - if { "X$type" == "Xoption" && \ - [string first : $name] == -1 } \ - continue - lappend XKBComponents(${type}s,names) \ - $name - lappend XKBComponents(${type}s,descriptions) \ - $desc - } - } - } - } - } - if [string length $XKBComponents(models,names)] \ - return - # Set some defaults, if we couldn't read the rules list - set XKBComponents(models,names) "pc101 pc102 pc104 microsoft" - set XKBComponents(models,descriptions) [list \ - "Generic 101-key PC" "Generic 102-key PC" \ - "Generic 104-key PC" "Microsoft Natural"] - set XKBComponents(layouts,names) "us de es fr gb it jp" - set XKBComponents(layouts,descriptions) [list \ - "U.S. English" German Spanish French \ - "U.K. English" Italian Japanese] -} - - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl:3.12 xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl:3.12 Mon Apr 5 03:12:59 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl Sat Feb 28 21:42:23 2004 @@ -1,292 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/keyboard.tcl,v 3.12 1999/04/05 07:12:59 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: keyboard.tcl /main/2 1996/10/25 10:21:16 kaleb $ - -# -# Keyboard configuration routines -# - -proc Keyboard_create_widgets { win } { - global XKBComponents XKBavailable XKBhandle - global pc98 messages - - set w [winpathprefix $win] - if !$pc98 { - frame $w.keyboard -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.keyboard -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - - frame $w.keyboard.xkb - label $w.keyboard.xkb.text -text $messages(keyboard.4) - frame $w.keyboard.xkb.geom - label $w.keyboard.xkb.geom.title -text $messages(keyboard.1) - combobox $w.keyboard.xkb.geom.cbox -bd 2 -width 30 - eval [list $w.keyboard.xkb.geom.cbox linsert end] \ - $XKBComponents(models,descriptions) - pack $w.keyboard.xkb.geom.title $w.keyboard.xkb.geom.cbox -side top - frame $w.keyboard.xkb.lang - label $w.keyboard.xkb.lang.title -text $messages(keyboard.2) - combobox $w.keyboard.xkb.lang.cbox -bd 2 -width 30 - eval [list $w.keyboard.xkb.lang.cbox linsert end] \ - $XKBComponents(layouts,descriptions) - pack $w.keyboard.xkb.lang.title $w.keyboard.xkb.lang.cbox -side top - frame $w.keyboard.xkb.vari - label $w.keyboard.xkb.vari.title -text $messages(keyboard.6) - combobox $w.keyboard.xkb.vari.cbox -bd 2 -width 30 - $w.keyboard.xkb.vari.cbox linsert end "" - eval [list $w.keyboard.xkb.vari.cbox linsert end] \ - $XKBComponents(variants,descriptions) - pack $w.keyboard.xkb.vari.title $w.keyboard.xkb.vari.cbox -side top - pack $w.keyboard.xkb.text -side top -expand yes -fill both -padx 6m - pack $w.keyboard.xkb.geom -side top -expand yes -fill both -padx 6m - pack $w.keyboard.xkb.lang -side top -expand yes -fill both -padx 6m - pack $w.keyboard.xkb.vari -side top -expand yes -fill both -padx 6m - if { $XKBavailable } { - bind $w.keyboard.xkb.geom.cbox.popup.list \ - "+Keyboard_loadsettings $win noload" - bind $w.keyboard.xkb.geom.cbox.popup \ - "+Keyboard_loadsettings $win noload" - bind $w.keyboard.xkb.lang.cbox.popup.list \ - "+Keyboard_loadsettings $win noload" - bind $w.keyboard.xkb.lang.cbox.popup \ - "+Keyboard_loadsettings $win noload" - xkbview $w.keyboard.xkb.graphic -height 100 -kbd $XKBhandle \ - -dbl 1 -bd 6 -relief ridge - } else { - frame $w.keyboard.xkb.graphic - } - pack $w.keyboard.xkb.graphic -side top -expand yes -fill x - if { $XKBavailable } { - button $w.keyboard.xkb.apply -text $messages(keyboard.3) \ - -command "Keyboard_loadsettings $win load" - pack $w.keyboard.xkb.apply -side top -expand yes -fill both - } - label $w.keyboard.xkb.message -text "" -foreground black - pack $w.keyboard.xkb.message -side top -expand yes -fill x - - frame $w.keyboard.options -relief groove -bd 4 - Keyboard_create_options_widgets $win - pack $w.keyboard.xkb -side left -fill both -expand yes -pady 10m - pack $w.keyboard.options -side left -fill both -expand no - Keyboard_initsettings $win -} - -proc Keyboard_create_options_widgets { win } { - global XKBComponents keyboardXkbOpts messages - - set w [winpathprefix $win] - set numopts [llength $XKBComponents(options,names)] - if { $numopts == 0 } { - set keyboardXkbOpts(noopts) -1 - return - } - - label $w.keyboard.options.title -text $messages(keyboard.5) - pack $w.keyboard.options.title -fill x \ - -expand no -pady 3m -side top - frame $w.keyboard.options.line -relief sunken -height 2 -bd 3 - pack $w.keyboard.options.line -fill x \ - -expand no -pady 3m -side top - - set canv $w.keyboard.options.canvas - canvas $canv - frame $canv.list - set id [$canv create window 0 0 -window $canv.list -anchor nw] - for {set idx 0} { $idx < $numopts } {incr idx} { - set name [lindex $XKBComponents(options,names) $idx] - set desc [lindex $XKBComponents(options,descriptions) $idx] - set tmp [split $name :] - set value $idx - if { [llength $tmp] != 2 } { - set next "" - if { [expr $idx+1] < $numopts } { - set next [lindex $XKBComponents(options,names) \ - [expr $idx+1] ] - } - if { [string match $name:* $next] } { - label $canv.list.$name -text $desc \ - -relief ridge -bd 3 - pack $canv.list.$name -fill both -expand no - set tmp [list $name default] - set value -1 - set desc $messages(keyboard.7) - set keyboardXkbOpts($name) -1 - } else { - checkbutton $canv.list.$name \ - -variable keyboardXkbOpts($name) \ - -text $desc -highlightthickness 1 \ - -offvalue -1 -onvalue $idx -anchor w \ - -relief sunken -bd 1 - pack $canv.list.$name -fill both -expand no - set keyboardXkbOpts($name) -1 - continue - } - } - set group [lindex $tmp 0] - set option [lindex $tmp 1] - radiobutton $canv.list.$group-$option \ - -variable keyboardXkbOpts($group) -value $value \ - -text $desc -highlightthickness 1 -anchor w - pack $canv.list.$group-$option -fill both -expand no -padx 3 - } - update idletasks - pack $canv -fill y -expand no -side left - scrollbar $w.keyboard.options.sb -command "$canv yview" -relief sunken - set bbox [$canv bbox $id] - $canv configure -yscrollcommand "$w.keyboard.options.sb set" \ - -scrollregion $bbox -width [lindex $bbox 2] - if { [winfo reqheight $canv.list] > [winfo height $w]*.7 } { - pack $w.keyboard.options.sb -side left -fill y -expand yes - } -} - -proc Keyboard_initsettings { win } { - global Keyboard XKBComponents keyboardXkbOpts - - set w [winpathprefix $win] - set model $Keyboard(XkbModel) - set layout $Keyboard(XkbLayout) - set variant $Keyboard(XkbVariant) - set options $Keyboard(XkbOptions) - - set tmp [xkb_getrulesprop] - if { [llength $tmp] == 5 } { - set model [lindex $tmp 1] - set layout [lindex $tmp 2] - set variant [lindex $tmp 3] - set options [lindex $tmp 4] - } - set geomidx [lsearch -exact $XKBComponents(models,names) $model] - if { $geomidx == -1 } {set geomidx 0} - set langidx [lsearch -exact $XKBComponents(layouts,names) $layout] - if { $langidx == -1 } {set langidx 0} - set variidx [lsearch -exact $XKBComponents(variants,names) $variant] - incr variidx - - $w.keyboard.xkb.geom.cbox einsert 0 \ - [lindex $XKBComponents(models,descriptions) $geomidx] - $w.keyboard.xkb.lang.cbox einsert 0 \ - [lindex $XKBComponents(layouts,descriptions) $langidx] - if { $variidx } { - $w.keyboard.xkb.vari.cbox einsert 0 \ - [lindex $XKBComponents(variants,descriptions) $variidx] - } - $w.keyboard.xkb.geom.cbox econfig -state disabled - $w.keyboard.xkb.lang.cbox econfig -state disabled - $w.keyboard.xkb.vari.cbox econfig -state disabled - $w.keyboard.xkb.geom.cbox lselection set $geomidx - $w.keyboard.xkb.lang.cbox lselection set $langidx - $w.keyboard.xkb.vari.cbox lselection set $variidx - $w.keyboard.xkb.geom.cbox activate $geomidx - $w.keyboard.xkb.lang.cbox activate $langidx - $w.keyboard.xkb.vari.cbox activate $variidx - $w.keyboard.xkb.geom.cbox see $geomidx - $w.keyboard.xkb.lang.cbox see $langidx - $w.keyboard.xkb.vari.cbox see $variidx - - set optlist [split $options ,] - set namelist $XKBComponents(options,names) - set cl $w.keyboard.options.canvas.list - foreach opt $optlist { - set tmp [split $opt :] - set idx [lsearch -exact $namelist $opt] - if { [llength $tmp] != 2 } { - if { [winfo exists $cl.$opt-default] } { - set keyboardXkbOpts($opt) -1 - } else { - set keyboardXkbOpts($opt) $idx - } - } else { - set keyboardXkbOpts([lindex $tmp 0]) $idx - } - } -} - -proc Keyboard_activate { win } { - set w [winpathprefix $win] - pack $w.keyboard -side top -fill both -expand yes -} - -proc Keyboard_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.keyboard - Keyboard_loadsettings $win setvars -} - -proc Keyboard_loadsettings { win loadflag } { - global XKBComponents XKBrules Keyboard XKBhandle keyboardXkbOpts - global messages - - set w [winpathprefix $win] - if { $loadflag == "load" } { - $w.keyboard.xkb.message configure \ - -text $messages(keyboard.9) - } - if { $loadflag == "noload" } { - $w.keyboard.xkb.message configure \ - -text $messages(keyboard.10) - } - update - set geom_idx [$w.keyboard.xkb.geom.cbox curselection] - set lang_idx [$w.keyboard.xkb.lang.cbox curselection] - set vari_idx [$w.keyboard.xkb.vari.cbox curselection] - incr vari_idx -1 - set geom [lindex $XKBComponents(models,names) $geom_idx] - set lang [lindex $XKBComponents(layouts,names) $lang_idx] - if { $vari_idx == -1 } { - set vari "" - } else { - set vari [lindex $XKBComponents(variants,names) $vari_idx] - } - set opts "" - foreach key [array names keyboardXkbOpts] { - if { $keyboardXkbOpts($key) == -1 } continue - set opt [lindex $XKBComponents(options,names) \ - $keyboardXkbOpts($key)] - if { ![string length $opts] } { - set opts $opt - } else { - append opts ",$opt" - } - } - - if { $loadflag != "setvars" } { - set comp [xkb_resolvecomponents \ - $XKBrules $geom $lang $vari $opts] - set notloaded [catch {eval xkb_load $comp $loadflag} kbd] - if { $notloaded } { - $w.keyboard.xkb.message configure \ - -text $messages(keyboard.8) - bell - after 1000 - } else { - xkb_free $XKBhandle - set XKBhandle $kbd - $w.keyboard.xkb.graphic configure -kbd $kbd - if { $loadflag != "noload" } { - xkb_setrulesprop $XKBrules \ - $geom $lang $vari $opts - set Keyboard(XkbModel) $geom - set Keyboard(XkbLayout) $lang - set Keyboard(XkbVariant) $vari - set Keyboard(XkbOptions) $opts - } - } - } else { - set Keyboard(XkbModel) $geom - set Keyboard(XkbLayout) $lang - set Keyboard(XkbVariant) $vari - set Keyboard(XkbOptions) $opts - } - focus $w - $w.keyboard.xkb.message configure -text "" -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/main.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/main.c:3.16 xc/programs/Xserver/hw/xfree86/XF86Setup/main.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/main.c:3.16 Sun Apr 25 06:01:57 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/main.c Sat Feb 28 21:42:23 2004 @@ -1,659 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/main.c,v 3.16 1999/04/25 10:01:57 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ -/* $XConsortium: main.c /main/2 1996/10/23 13:12:09 kaleb $ */ - - -/* - * Main procedure for XF86Setup, by Joe Moss - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) -#include -#endif - -#if TK_MAJOR_VERSION < 4 || (TK_MAJOR_VERSION == 4 && TK_MINOR_VERSION < 1) -#error You must use Tk 4.1 or newer -#endif - -static Tcl_Interp *interp; - -static char *name = NULL; /* name of application */ -static char *display = NULL; /* display to connect to */ -static char *geometry = NULL; /* initial geometry spec */ -static char *statefile = NULL; /* file containing state vars */ -static char *LibDir; /* where the tcl src files are */ -static int rest = 0; /* arg after options */ -static int synchronize = 0; /* sync X connection */ -static int nocurses = 0; /* Don't use curses */ -static int notk = 0; /* Don't add Tk to interp */ -static int usescriptdir = 0; /* Use script dir, not PATH */ -static Boolean pc98 = FALSE; /* machine architecure */ -static int pc98_EGC = 0; /* default server */ -#define PHASE1 "phase1.tcl" -#define PHASE2 "phase2.tcl" -#define PHASE3 "phase3.tcl" -#define PHASE4 "phase4.tcl" -#define PHASE5 "phase5.tcl" - -#define PHASE2NOTK "ph2notk.tcl" - -/* - Initialization code - sets the Xwinhome, XF86Setup_library, - tcl_library, and tk_library variables and checks for the - the existence of the startup file (phase1) -*/ - -#ifndef PROJECTROOT -#define PROJECTROOT "" -#endif - -static char Set_InitVars[] = - "if [info exists env(XWINHOME)] {\n" - " set Xwinhome $env(XWINHOME)\n" - "} else {\n" - " set xdirs [list " PROJECTROOT " /usr/X11R6 /usr/X11 " - "/usr/X /var/X11R6 /var/X11 /var/X /usr/X11R6.3 " - "/usr/local/X11R6 /usr/local/X11 /usr/local/X]\n" - " foreach dir $xdirs {\n" - " if {[llength [glob -nocomplain $dir/bin/XF86_* $dir/bin/XF98_*]] } {\n" - " set Xwinhome $dir\n" - " break\n" - " }\n" - " }\n" - " if ![info exists Xwinhome] {\n" - " error \"Couldn't determine where you have XFree86 installed.\\n" - "If you have XFree86 properly installed, set the " - "XWINHOME environment\\n variable to point to the " - "parent directory of the XFree86 bin directory.\\n\"\n" - " }\n" - " unset xdirs dir\n" - "}\n" - "if [info exists env(XF86SETUPLIB)] {\n" - " set XF86Setup_library $env(XF86SETUPLIB)\n" - "} else {\n" - " set XF86Setup_library $Xwinhome/lib/X11/XF86Setup\n" - "}\n" - "set tk_library [set tcl_library $XF86Setup_library/tcllib]\n" - "set XF86Setup_startup $XF86Setup_library/" PHASE1 "\n" - "if ![file exists $XF86Setup_startup] {\n" - " error \"The startup file for this program ($XF86Setup_startup)\\n" - "is missing. You need to install it before running " - "this program.\\n\"\n" - "} else {\n" - " if ![file readable $XF86Setup_startup] {\n" - " error \"The startup file for this program " - "($XF86Setup_startup)\\ncan't be accessed. " - "Perhaps a permission problem?\\n\"\n" - " }\n" - "}\n" - ; - -static char usage_msg[] = - "Usage: %s [options] [filename] [--] [arg ...]\n" - "Options always available:\n" - " -sync Use synchronous mode for display server\n" - " -name Name to use for application\n" - " -notk Don't open a connection to the X server\n" -#ifdef PC98 - " -egc Use EGC server\n" - " -pegc Use PEGC server\n" -#endif - "\n" - "Options available only when a filename is specified:\n" - " -display Display to use\n" - " -geometry Initial geometry for window\n" - " -script Look for filename in script directory\n" - "\n" - "Options available only when a filename is not specified:\n" - " -nocurses Don't use curses for user interaction\n" - "Any args after the double dashes (--) are passed to the script\n" - ; - -static Tk_ArgvInfo argTable[] = { - {"-display", TK_ARGV_STRING, (char *) NULL, (char *) &display, - "Display to use"}, - {"-geometry", TK_ARGV_STRING, (char *) NULL, (char *) &geometry, - "Initial geometry for window"}, - {"-name", TK_ARGV_STRING, (char *) NULL, (char *) &name, - "Name to use for application"}, - {"-sync", TK_ARGV_CONSTANT, (char *) 1, (char *) &synchronize, - "Use synchronous mode for display server"}, - {"-nocurses", TK_ARGV_CONSTANT, (char *) 1, (char *) &nocurses, - "Don't use curses for interaction with user"}, - {"-notk", TK_ARGV_CONSTANT, (char *) 1, (char *) ¬k, - "Don't open a connection to the X server or load Tk widgets"}, - {"-script", TK_ARGV_CONSTANT, (char *) 1, (char *) &usescriptdir, - "Look for filename in the scripts directory"}, - {"-egc", TK_ARGV_CONSTANT, (char *) 1, (char *) &pc98_EGC, - "Use egc"}, - {"-pegc", TK_ARGV_CONSTANT, (char *) 0, (char *) &pc98_EGC, - "Use pegc"}, - {"--", TK_ARGV_REST, (char *) 1, (char *) &rest, - "Pass all remaining arguments through to script"}, - /* This one is undocumented - it's used when execing a 2nd copy */ - {"-statefile", TK_ARGV_STRING, (char *) NULL, (char *) &statefile, ""}, - {(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL, - (char *) NULL} -}; - -extern int Curses_Init(Tcl_Interp *interp); -extern int XF86Other_Init(Tcl_Interp *interp); -extern int XF86TkOther_Init(Tcl_Interp *interp); -extern int Cards_Init(Tcl_Interp *interp); -extern int XF86Config_Init(Tcl_Interp *interp); -extern int XF86vid_Init(Tcl_Interp *interp); -extern int XF86Misc_Init(Tcl_Interp *interp); -extern int XF86Kbd_Init(Tcl_Interp *interp); -static void XF86Setup_TclEvalFile(Tcl_Interp *interp, char *filename); -static void XF86Setup_TclRunScript(Tcl_Interp *interp, char *filename); -static void XF86Setup_TkInit( - Tcl_Interp *interp, - char *display, - char *appname -); -static void kill_server(Tcl_Interp *interp); - -/* - Runs the commands in the specified file in the lib directory - - If an error occurs while processing, the error message is printed - and the program exits -*/ -static void -XF86Setup_TclEvalFile(interp, filename) - Tcl_Interp *interp; - char *filename; -{ - int retval; - char *msg; - - retval = Tcl_VarEval(interp, "source ", - LibDir, "/", filename, (char *) NULL); - if (retval != TCL_OK) { - msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (msg == NULL) { - msg = interp->result; - } - fprintf(stderr, "%s\n", msg); - Tcl_Eval(interp, "exit 1"); - } - fflush(stdout); - Tcl_ResetResult(interp); -} - -/* - Runs the commands in the specified file - search PATH, if needed - - If an error occurs while processing, the error message is printed - and the program exits -*/ -static void -XF86Setup_TclRunScript(interp, filename) - Tcl_Interp *interp; - char *filename; -{ - int retval; - char *msg; - - if (!usescriptdir) { - retval = Tcl_VarEval(interp, - "if {[string first ", filename, " /] != -1} {", - "source ", filename, - "} else {", - "foreach dir [split $env(PATH) :] {", - "if [file executable $dir/", filename, "] {", - "source $dir/", filename, "; return 0", - "}", - "}\n", - "error {File not found: ", filename, "}\n", - "}", - (char *) NULL); - } else { - retval = Tcl_VarEval(interp, - "if {[string first ", filename, " /] != -1} {", - "source ", filename, - "} else {", - "source $XF86Setup_library/scripts/", filename, - "}", - (char *) NULL); - } - - if (retval != TCL_OK) { - msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (msg == NULL) { - msg = interp->result; - } - fprintf(stderr, "%s\n", msg); - Tcl_Eval(interp, "exit 1"); - } - fflush(stdout); - Tcl_ResetResult(interp); -} - -#define print_result_and_exit {fprintf(stderr,"%s\n",interp->result); exit(1);} - -/* - - Main function for XF86Setup. - - Creates a Tcl interpreter and adds various extensions to it. - Then if a filename is not given on the command line, it executes - the commands in either phase1.tcl or phase3.tcl - Tk is then added to the interpreter, as well as various X related - extensions - If a filename was given, it is then executed, otherwise either - phase2.tcl or phase4.tcl is run - If phase2.tcl was run, the server is shutdown and then a new - invocation of XF86Setup is exec-ed - If phase4.tcl was run, the server is shutdown and phase5.tcl run - -*/ - -void -main(int argc, char **argv) -{ - char *tmpptr, *filename, *argv0, tmpbuf[20], buf[128]; - int Phase2FallBack = 0; - -#ifdef RLIMIT_STACK -#define STACK_SIZE (2048*1024) - - struct rlimit rlim; - - if (!getrlimit(RLIMIT_STACK, &rlim)) - { - if (STACK_SIZE < rlim.rlim_max) - rlim.rlim_cur = STACK_SIZE; - else - rlim.rlim_cur = rlim.rlim_max; - (void)setrlimit(RLIMIT_STACK, &rlim); - } -#undef STACK_SIZE -#endif - - /**** Create the Tcl interpreter ****/ - interp = Tcl_CreateInterp(); - - /**** Parse the command line args ****/ - if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv, argTable, 0) - != TCL_OK) { - fprintf(stderr, usage_msg, argv[0]); - exit(1); - } - - if (argc == 1) - filename = NULL; - else if (argc == 2) - filename = argv[1]; - else { - if (rest == 0 || rest == 2) - filename = argv[1]; - else { - fprintf(stderr, usage_msg, argv[0]); - exit(1); - } - } - - /**** Add the commands to the Tcl interpreter for the - convenience functions ****/ - - if (XF86Other_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Add the commands to the Tcl interpreter that interface - with the Cards database ****/ - - if (Cards_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Add the commands to the Tcl interpreter that interface - with the XF86Config reading routines ****/ - - if (XF86Config_Init(interp) == TCL_ERROR) - print_result_and_exit; - - if (Curses_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Find where things are installed ****/ - if (Tcl_Eval(interp, Set_InitVars) != TCL_OK) - print_result_and_exit; - - LibDir = Tcl_GetVar(interp, "XF86Setup_library", TCL_GLOBAL_ONLY); - - /**** This program will not be used interactively as a shell ****/ - Tcl_SetVar(interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY); - - /**** Make command-line arguments available to scripts ****/ - - argv0 = argv[0]; - if (filename != NULL) { - tmpptr = Tcl_Merge(argc-2, argv+2); - sprintf(tmpbuf, "%d", argc-2); - } else { - tmpptr = Tcl_Merge(argc-1, argv+1); - sprintf(tmpbuf, "%d", argc-1); - } - Tcl_SetVar(interp, "argv", tmpptr, TCL_GLOBAL_ONLY); - XtFree(tmpptr); - Tcl_SetVar(interp, "argc", tmpbuf, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "argv0", argv0, TCL_GLOBAL_ONLY); -#ifdef PC98 - nocurses = 1; - Tcl_SetVar(interp, "pc98", "1", TCL_GLOBAL_ONLY); - if (pc98_EGC) { -#if defined(linux) || defined(SVR4) - fprintf(stderr, "Sorry, EGC server doesn't work on this OS.\n"); - fprintf(stderr, "-egc option can't be used.\n"); - exit(1); -#endif - Tcl_SetVar(interp, "pc98_EGC", "1", TCL_GLOBAL_ONLY); - } else { - Tcl_SetVar(interp, "pc98_EGC", "0", TCL_GLOBAL_ONLY); - } -#if defined(linux) - printf("\033[98;0]"); /* set euc mode */ - fflush(stdout); -#endif -#else - Tcl_SetVar(interp, "pc98", "0", TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "pc98_EGC", "0", TCL_GLOBAL_ONLY); -#endif - - Tcl_LinkVar(interp, "NoCurses", (char *) &nocurses, TCL_LINK_BOOLEAN); - Tcl_LinkVar(interp, "NoTk", (char *) ¬k, TCL_LINK_BOOLEAN); - - if (filename == NULL) { - Tcl_LinkVar(interp, "Phase2FallBack", - (char *)&Phase2FallBack, TCL_LINK_BOOLEAN); - if (statefile == NULL) { - /**** Execute the Phase I Tcl code ****/ - XF86Setup_TclEvalFile(interp, PHASE1); - } else { - Tcl_SetVar(interp, "StateFileName", - statefile, TCL_GLOBAL_ONLY); - /**** Execute the Phase III Tcl code ****/ - XF86Setup_TclEvalFile(interp, PHASE3); - } - tmpptr = Tcl_GetVar(interp, "ExitStatus", TCL_GLOBAL_ONLY); - if (tmpptr) { - Tcl_VarEval(interp, "exit ", tmpptr, (char *)0); - exit(1); - } - } else { - if (notk) { - /**** Load the default bindings ****/ - strcpy(buf, "source $tk_library/init.tcl"); - if (Tcl_Eval(interp, buf) != TCL_OK) - print_result_and_exit; - XF86Setup_TclRunScript(interp, filename); - Tcl_Eval(interp, "exit 0"); - exit(1); - } - } - - /* If the app name wasn't given, use the filename or argv[0] */ - if (name == NULL) { - if (filename == NULL) { - name = strrchr(argv0, '/'); - if (name != NULL) - name++; - else - name = argv0; - } else - name = filename; - } - - if (filename == NULL) - display = NULL; - - if (!notk) { - /**** Here is the first routine that needs to have an X - server running. It tries to create a window and will, - of course, fail if the server isn't running ****/ - - XF86Setup_TkInit(interp, display, name); - - if (filename != NULL) { - /* - * Set the geometry of the main window, if requested. Put the - * requested geometry into the "geometry" variable. - */ - - if (geometry != NULL) { - Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY); - if (Tcl_VarEval(interp, "wm geometry . ", geometry, (char *) NULL) - != TCL_OK) { - fprintf(stderr, "%s\n", interp->result); - } - } - - /**** set the DISPLAY environment variable ****/ - if (display != NULL) - Tcl_SetVar2(interp, "env", "DISPLAY", display, TCL_GLOBAL_ONLY); - } - - /**** Add the commands to the Tcl interpreter that interface - with the XFree86-VidModeExtension ****/ - - if (XF86vid_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Add the commands to the Tcl interpreter that interface - with the XFree86-Misc extension ****/ - - if (XF86Misc_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Add the commands to the Tcl interpreter that interface - with the XKEYBOARD extension and library ****/ - - if (XF86Kbd_Init(interp) == TCL_ERROR) - print_result_and_exit; - - /**** Add the commands to the Tcl interpreter for the - Tk convenience functions ****/ - - if (XF86TkOther_Init(interp) == TCL_ERROR) - print_result_and_exit; - } /* !notk */ - - if (filename != NULL) { - /**** Load the default bindings ****/ - strcpy(buf, "source $tk_library/init.tcl"); - if (Tcl_Eval(interp, buf) != TCL_OK) - print_result_and_exit; - strcpy(buf, "source $tk_library/tk.tcl"); - if (Tcl_Eval(interp, buf) != TCL_OK) - print_result_and_exit; - XF86Setup_TclRunScript(interp, filename); - Tk_MainLoop(); - } else { - if (statefile == NULL || Phase2FallBack) { - /**** Now execute the Phase II commands ****/ - XF86Setup_TclEvalFile(interp, (notk? PHASE2NOTK: PHASE2)); - } else { - /**** Now execute the Phase IV commands ****/ - XF86Setup_TclEvalFile(interp, PHASE4); - } - /**** Enter the event loop until Phase II/IV is completed (last - window destroyed) ****/ - - if (!notk) { - Tk_MainLoop(); - - kill_server(interp); - } - - tmpptr = Tcl_GetVar(interp, "ExitStatus", TCL_GLOBAL_ONLY); - if (tmpptr) { - Tcl_VarEval(interp, "exit ", tmpptr, (char *)0); - exit(1); - } - if (statefile == NULL || Phase2FallBack) { - statefile = Tcl_GetVar(interp, "StateFileName", TCL_GLOBAL_ONLY); -#ifdef DEBUG - fprintf(stderr, - "Executing second copy of XF86Setup (%s -statefile %s)...\n", - argv[0], statefile); -#endif - if (statefile) { - execlp(argv[0], argv[0], "-statefile", statefile, (char *)0); - fprintf(stderr, - "Exec of 2nd XF86Setup failed! Returned error #%d\n", - errno); - Tcl_Eval(interp, "exit 1"); - exit(1); - } -#ifdef DEBUG - else - fprintf(stderr, "The StateFileName variable isn't set!\n"); -#endif - } else { - /**** Lastly, execute the Phase V commands ****/ - XF86Setup_TclEvalFile(interp, PHASE5); - } - } - - Tcl_Eval(interp, "exit 0"); - exit(1); -} - -void keypress(void) { -/* - * The parse_database routine (in cards.c) calls keypress() when it - * finds a problem with the database (after printing an error message) - * - * We just ignore the error - */ -} - -/* - Kill the process whose id is in the ServerPID variable, if any - - This is used to kill the X server and switch back to text mode -*/ -void kill_server(interp) - Tcl_Interp *interp; -{ - int pid; - char *pidstr; - - pidstr = Tcl_GetVar(interp, "ServerPID", TCL_GLOBAL_ONLY); - if (pidstr == NULL) - return; - pid = atoi(pidstr); - if (!pid) - return; - kill(pid,SIGTERM); - sleep(2); - return; -} - -extern int TkCreateFrame ( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv, - int toplevel, - char *appName -); - -#if TK_MAJOR_VERSION == 4 -extern int TkPlatformInit ( -#else -extern int TkpInit ( -#endif - Tcl_Interp *interp -); - -extern int XkbUIWinCmd ( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -); - -/* - Open a connection to the X server and create the main Tk window -*/ -static void -XF86Setup_TkInit(interp, display, appName) - Tcl_Interp *interp; - char *display; - char *appName; -{ - Tk_Window mainWindow; - char *class; - char *av[10]; - int ac; - - if (appName == NULL) - appName = "XF86Setup"; - if (display == NULL) - display = Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY); - class = (char *) XtMalloc((unsigned) (strlen(appName) + 1)); - strcpy(class, appName); - if (islower(class[0])) - class[0] = toupper((unsigned char) class[0]); - - av[0] = "toplevel"; - av[1] = "."; - av[2] = "-class"; - av[3] = class; - ac = 4; - if (display != NULL) { - av[4] = "-screen"; - av[5] = display; - ac = 6; - } - av[ac] = NULL; - if (TkCreateFrame((ClientData) NULL, interp, ac, av, 1, appName) != TCL_OK) - print_result_and_exit; - - Tcl_ResetResult(interp); - mainWindow = Tk_MainWindow(interp); -#if TK_MAJOR_VERSION == 4 - TkPlatformInit(interp); -#else - TkpInit(interp); -#endif - XtFree(class); - - if (synchronize) - XSynchronize(Tk_Display(mainWindow), True); - - /**** Add the xkbview widget command to the interpreter ****/ - Tcl_CreateCommand(interp, "xkbview", XkbUIWinCmd, - (ClientData) mainWindow, (void (*)()) NULL); -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl:3.2 Sun Apr 5 12:15:50 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl Sat Feb 28 21:42:23 2004 @@ -1,203 +0,0 @@ -# -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/modeselect.tcl,v 3.2 1998/04/05 16:15:50 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# 1997 by Dirk H Hohndel -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# routines to select the modes that the user actually wants to use -# - -proc Modeselect_create_widgets { win } { - global MonitorIDs monDevNum monCanvas MonitorDescriptions - global pc98_EGC messages - - set w [winpathprefix $win] - - if !$pc98_EGC { - frame $w.modesel -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.modesel -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.modesel.top - frame $w.modesel.mid -relief sunken -borderwidth 3 - frame $w.modesel.bot - pack $w.modesel.top -side top - pack $w.modesel.mid -side top -expand yes - pack $w.modesel.bot -side top - - label $w.modesel.top.title -text "Select the modes you want to use" - frame $w.modesel.type - pack $w.modesel.top.title $w.modesel.type -in $w.modesel.top -side top - set canv [canvas $w.modesel.buttons] - - checkbutton $w.modesel.buttons.m640x480 \ - -text $messages(modeselect.2) \ - -indicatoron no -variable m640x480 \ - -command [list modesel_enable $win " 640x480*"] - lappend lbuttons $w.modesel.buttons.m640x480 - checkbutton $w.modesel.buttons.m800x600 \ - -text $messages(modeselect.3) \ - -indicatoron no -variable m800x600 \ - -command [list modesel_enable $win " 800x600*"] - lappend lbuttons $w.modesel.buttons.m800x600 - checkbutton $w.modesel.buttons.m1024x768 \ - -text $messages(modeselect.4) \ - -indicatoron no -variable m1024x768 \ - -command [list modesel_enable $win "1024x768*"] - lappend lbuttons $w.modesel.buttons.m1024x768 - checkbutton $w.modesel.buttons.m1152x864 \ - -text $messages(modeselect.5) \ - -indicatoron no -variable m1152x864 \ - -command [list modesel_enable $win "1152x864*"] - lappend lbuttons $w.modesel.buttons.m1152x864 - checkbutton $w.modesel.buttons.m1280x1024 \ - -text $messages(modeselect.6) \ - -indicatoron no -variable m1280x1024 \ - -command [list modesel_enable $win "1280x1024*"] - lappend lbuttons $w.modesel.buttons.m1280x1024 - checkbutton $w.modesel.buttons.m1600x1200 \ - -text $messages(modeselect.7) \ - -indicatoron no -variable m1600x1200 \ - -command [list modesel_enable $win "1600x1200*"] - lappend lbuttons $w.modesel.buttons.m1600x1200 - checkbutton $w.modesel.buttons.m640x400 \ - -text $messages(modeselect.8) \ - -indicatoron no -variable m640x400 \ - -command [list modesel_enable $win " 640x400*"] - lappend lbuttons $w.modesel.buttons.m640x400 - checkbutton $w.modesel.buttons.m320x200 \ - -text $messages(modeselect.9) \ - -indicatoron no -variable m320x200 \ - -command [list modesel_enable $win " 320x200*"] - lappend lbuttons $w.modesel.buttons.m320x200 - checkbutton $w.modesel.buttons.m320x240 \ - -text $messages(modeselect.10) \ - -indicatoron no -variable m320x240 \ - -command [list modesel_enable $win " 320x240*"] - lappend lbuttons $w.modesel.buttons.m320x240 - checkbutton $w.modesel.buttons.m400x300 \ - -text $messages(modeselect.11) \ - -indicatoron no -variable m400x300 \ - -command [list modesel_enable $win " 400x300*"] - lappend lbuttons $w.modesel.buttons.m400x300 - checkbutton $w.modesel.buttons.m480x300 \ - -text $messages(modeselect.12) \ - -indicatoron no -variable m480x300 \ - -command [list modesel_enable $win " 480x300*"] - lappend lbuttons $w.modesel.buttons.m480x300 - checkbutton $w.modesel.buttons.m512x384 \ - -text $messages(modeselect.13) \ - -indicatoron no -variable m512x384 \ - -command [list modesel_enable $win " 512x384*"] - lappend lbuttons $w.modesel.buttons.m512x384 - set ht 0 - set wd 0 - foreach wb $lbuttons { - set bwd [winfo reqwidth $wb] - if {$wd < $bwd} {set wd $bwd} - } - foreach wb $lbuttons { - $canv create window \ - [expr ($wd-[winfo reqwidth $wb])/2] $ht \ - -anchor nw -window $wb - set ht [expr $ht + [winfo reqheight $wb]] - } - $canv configure -yscrollcommand [list $w.modesel.sb set] \ - -scrollregion [list 0 0 $wd $ht] \ - -width $wd - scrollbar $w.modesel.sb \ - -command [list $canv yview] - pack $canv -in $w.modesel.mid \ - -side left -fill both -expand yes -pady 2m - pack $w.modesel.sb -in $w.modesel.mid -side right \ - -fill y -expand yes - frame $w.modesel.dcd - label $w.modesel.dcd.title -text $messages(modeselect.14) - radiobutton $w.modesel.8bpp -text $messages(modeselect.15) \ - -indicatoron false -variable ColorDepth \ - -value "depth8" -underline 19 \ - -command [list modesel_color_select $w 8] - radiobutton $w.modesel.16bpp -text $messages(modeselect.16) \ - -indicatoron false -variable ColorDepth \ - -value "depth16" -underline 19 \ - -command [list modesel_color_select $w 16] - radiobutton $w.modesel.24bpp -text $messages(modeselect.17) \ - -indicatoron false -variable ColorDepth \ - -value "depth24" -underline 19 \ - -command [list modesel_color_select $w 24] - radiobutton $w.modesel.32bpp -text $messages(modeselect.18) \ - -indicatoron false -variable ColorDepth \ - -value "depth32" -underline 19 \ - -command [list modesel_color_select $w 32] - pack $w.modesel.8bpp $w.modesel.16bpp $w.modesel.24bpp \ - $w.modesel.32bpp -side left -fill x -expand yes \ - -in $w.modesel.dcd - pack $w.modesel.dcd.title $w.modesel.dcd -side left -fill y -expand yes -} - -proc Modeselection_activate { win } { - set w [winpathprefix $win] - pack $w.modesel -side top -fill both -expand yes -} - -proc Modeselection_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.modesel - -} - -proc modesel_color_select { win val } { - global DefaultColorDepth - - set w [winpathprefix $win] - - set DefaultColorDepth $val -} - -proc modesel_enable { win val } { - global MonitorStdModes SelectedMonitorModes haveSelectedModes - - set w [winpathprefix $win] - - set haveSelectedModes 1 - - # we need to handle the fact that these are toggle buttons, so every - # other time this is selected, the user actually wants to deselect - # the entries - # this would be much easier if I have a way to remove pairs from an array... - if { [array get SelectedMonitorModes $val] != "" } { -# puts stderr "$val already existed" - # - foreach desc [array names SelectedMonitorModes $val] { - if [string match \#removed $SelectedMonitorModes($desc)] { - # ok, we're enabling again - set SelectedMonitorModes($desc) $MonitorStdModes($desc) - } else { -# puts stderr "invalidating for $desc" - set SelectedMonitorModes($desc) "#removed" - } - } - } else { -# puts stderr "add $val to selected modes" - foreach desc [array names MonitorStdModes $val] { - set modeline $MonitorStdModes($desc) -# puts stderr "$desc :: $modeline" - set SelectedMonitorModes($desc) $modeline - } - } -# foreach desc [array names SelectedMonitorModes] { -# puts stderr "$desc -> $SelectedMonitorModes($desc)" -# } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl:3.12 xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl:3.12 Sun Dec 14 05:03:55 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl Sat Feb 28 21:42:23 2004 @@ -1,167 +0,0 @@ -# $XConsortium: mondata.tcl /main/4 1996/10/28 05:42:19 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/mondata.tcl,v 3.12 1997/12/14 10:03:55 hohndel Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Data used by the monitor configuration routines -# - -array set MonitorVsyncRanges { - 0 60 - 1 55-60 - 2 60,70,87 - 3 55-90 - 4 55-90 - 5 55-90 - 6 50-90 - 7 50-90 - 8 50-100 - 9 40-100 -} - -array set MonitorHsyncRanges { - 0 31.5 - 1 31.5-35.1 - 2 31.5,35.5 - 3 31.5,35.15,35.5 - 4 31.5-37.9 - 5 31.5-48.5 - 6 31.5-57.0 - 7 31.5-64.3 - 8 31.5-79.0 - 9 31.5-82.0 -} - -set MonitorDescriptions [list \ - "Standard VGA, 640x480 @ 60 Hz" \ - "Super VGA, 800x600 @ 56 Hz" \ - "8514 Compatible, 1024x768@87 Hz interlaced (no 800x600)" \ - "Super VGA, 1024x768 @ 87 Hz interlaced, 800x600 @ 56 Hz" \ - "Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz" \ - "Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz" \ - "High Frequency SVGA, 1024x768 @ 70 Hz" \ - "Multi-frequency that can do 1280x1024 @ 60 Hz" \ - "Multi-frequency that can do 1280x1024 @ 74 Hz" \ - "Multi-frequency that can do 1280x1024 @ 76 Hz" \ -] - -set haveSelectedModes 0 - -set DefaultColorDepth 8 - -array set SelectedMonitorModes { } - -array set MonitorStdModes { - " 640x400 @ pc98 EGC mode : 60 Hz, 24 kHz hsync" - "16.442 640 649 656 663 400 407 415 440" - " 640x400 @ 70 Hz, 31.5 kHz hsync" - "25.175 640 664 760 800 400 409 411 450" - " 640x480 @ 60 Hz, 31.5 kHz hsync" - "25.175 640 664 760 800 480 491 493 525" - " 800x600 @ 56 Hz, 35.15 kHz hsync" - "36 800 824 896 1024 600 601 603 625" - "1024x768 @ 87 Hz interlaced, 35.5 kHz hsync" - "44.9 1024 1048 1208 1264 768 776 784 817 Interlace" - " 640x480 @ 67 Hz, 35.0 kHz hsync" - "28 640 664 760 800 480 491 493 525" - " 640x400 @ 85 Hz, 37.86 kHz hsync" - "31.5 640 672 736 832 400 401 404 445 -HSync +VSync" - " 640x480 @ 70 Hz, 36.5 kHz hsync" - "31.5 640 680 720 864 480 488 491 521" - " 640x480 @ 75 Hz, 37.50 kHz hsync" - "31.5 640 656 720 840 480 481 484 500 -HSync -VSync" - " 800x600 @ 60 Hz, 37.8 kHz hsync" - "40 800 840 968 1056 600 601 605 628 +hsync +vsync" - " 640x480 @ 85 Hz, 43.27 kHz hsync" - "36 640 696 752 832 480 481 484 509 -HSync -VSync" - "1152x864 @ 89 Hz interlaced, 44 kHz hsync" - "65 1152 1168 1384 1480 864 865 875 985 Interlace" - " 800x600 @ 72 Hz, 48.0 kHz hsync" - "50 800 856 976 1040 600 637 643 666 +hsync +vsync" - "1024x768 @ 60 Hz, 48.4 kHz hsync" - "65 1024 1032 1176 1344 768 771 777 806 -hsync -vsync" - " 640x480 @ 100 Hz, 53.01 kHz hsync" - "45.8 640 672 768 864 480 488 494 530 -HSync -VSync" - "1152x864 @ 60 Hz, 53.5 kHz hsync" - "89.9 1152 1216 1472 1680 864 868 876 892 -HSync -VSync" - " 800x600 @ 85 Hz, 55.84 kHz hsync" - "60.75 800 864 928 1088 600 616 621 657 -HSync -VSync" - "1024x768 @ 70 Hz, 56.5 kHz hsync" - "75 1024 1048 1184 1328 768 771 777 806 -hsync -vsync" - "1280x1024 @ 87 Hz interlaced, 51 kHz hsync" - "80 1280 1296 1512 1568 1024 1025 1037 1165 Interlace" - "1024x768 @ 76 Hz, 62.5 kHz hsync" - "85 1024 1032 1152 1360 768 784 787 823" - "1152x864 @ 70 Hz, 62.4 kHz hsync" - "92 1152 1208 1368 1474 864 865 875 895" - " 800x600 @ 100 Hz, 64.02 kHz hsync" - "69.650 800 864 928 1088 600 604 610 640 -HSync -VSync" - "1024x768 @ 85 Hz, 70.24 kHz hsync" - "98.9 1024 1056 1216 1408 768 782 788 822 -HSync -VSync" - "1152x864 @ 78 Hz, 70.8 kHz hsync" - "110 1152 1240 1324 1552 864 864 876 908" - "1152x864 @ 84 Hz, 76.0 kHz hsync" - "135 1152 1464 1592 1776 864 864 876 908" - "1280x1024 @ 61 Hz, 64.2 kHz hsync" - "110 1280 1328 1512 1712 1024 1025 1028 1054" - "1280x1024 @ 70 Hz, 74.59 kHz hsync" - "126.5 1280 1312 1472 1696 1024 1032 1040 1068 -HSync -VSync" - "1600x1200 @ 60Hz, 75.00 kHz hsync" - "162 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync" - "1280x1024 @ 74 Hz, 78.85 kHz hsync" - "135 1280 1312 1456 1712 1024 1027 1030 1064" - "1024x768 @ 100Hz, 80.21 kHz hsync" - "115.5 1024 1056 1248 1440 768 771 781 802 -HSync -VSync" - "1280x1024 @ 76 Hz, 81.13 kHz hsync" - "135 1280 1312 1416 1664 1024 1027 1030 1064" - "1600x1200 @ 70 Hz, 87.50 kHz hsync" - "189 1600 1664 1856 2160 1200 1201 1204 1250 -HSync -VSync" - "1152x864 @ 100 Hz, 89.62 kHz hsync" - "137.65 1152 1184 1312 1536 864 866 885 902 -HSync -VSync" - "1280x1024 @ 85 Hz, 91.15 kHz hsync" - "157.5 1280 1344 1504 1728 1024 1025 1028 1072 +HSync +VSync" - "1600x1200 @ 75 Hz, 93.75 kHz hsync" - "202.5 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync" - "1600x1200 @ 85 Hz, 105.77 kHz hsync" - "220 1600 1616 1808 2080 1200 1204 1207 1244 +HSync +VSync" - "1280x1024 @ 100 Hz, 107.16 kHz hsync" - "181.75 1280 1312 1440 1696 1024 1031 1046 1072 -HSync -VSync" - "1800x1440 @ 64Hz, 96.15 kHz hsync" - "230 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync" - "1800x1440 @ 70Hz, 104.52 kHz hsync" - "250 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync" - " 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio" - "12.588 320 336 384 400 200 204 205 225 Doublescan" - " 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio" - "12.588 320 336 384 400 240 245 246 262 Doublescan" - " 320x240 @ 72 Hz, 36.5 kHz hsync" - "15.750 320 336 384 400 240 244 246 262 Doublescan" - " 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio" - "18 400 416 448 512 300 301 302 312 Doublescan" - " 400x300 @ 60 Hz, 37.8 kHz hsync" - "20 400 416 480 528 300 301 303 314 Doublescan" - " 400x300 @ 72 Hz, 48.0 kHz hsync" - "25 400 424 488 520 300 319 322 333 Doublescan" - " 480x300 @ 56 Hz, 35.2 kHz hsync, 8:5 aspect ratio" - "21.656 480 496 536 616 300 301 302 312 Doublescan" - " 480x300 @ 60 Hz, 37.8 kHz hsync" - "23.890 480 496 576 632 300 301 303 314 Doublescan" - " 480x300 @ 63 Hz, 39.6 kHz hsync" - "25 480 496 576 632 300 301 303 314 Doublescan" - " 480x300 @ 72 Hz, 48.0 kHz hsync" - "29.952 480 504 584 624 300 319 322 333 Doublescan" - " 512x384 @ 78 Hz, 31.50 kHz hsync" - "20.160 512 528 592 640 384 385 388 404 -HSync -VSync" - " 512x384 @ 85 Hz, 34.38 kHz hsync" - "22 512 528 592 640 384 385 388 404 -HSync -VSync" -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl:3.13 xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl:3.13 Mon Apr 5 03:13:00 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl Sat Feb 28 21:42:23 2004 @@ -1,330 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/monitor.tcl,v 3.13 1999/04/05 07:13:00 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: monitor.tcl /main/2 1996/10/25 10:21:20 kaleb $ - -# -# Monitor configuration routines -# - -proc Monitor_create_widgets { win } { - global MonitorIDs monDevNum monCanvas MonitorDescriptions - global pc98_EGC messages - - set w [winpathprefix $win] - set monDevNum 0 - if !$pc98_EGC { - frame $w.monitor -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.monitor -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.monitor.sync - pack $w.monitor.sync -side top -pady 1m - - frame $w.monitor.sync.line1 - pack $w.monitor.sync.line1 -side top -fill x -expand yes - label $w.monitor.sync.title -text $messages(monitor.1) - pack $w.monitor.sync.title -side left -fill x \ - -in $w.monitor.sync.line1 -expand yes - if { [llength $MonitorIDs] > 1 } { - label $w.monitor.sync.monsel \ - -text $messages(monitor.2) -anchor w - pack $w.monitor.sync.monsel -side left \ - -in $w.monitor.sync.line1 - combobox $w.monitor.sync.monselect -state disabled -bd 2 - pack $w.monitor.sync.monselect -side left \ - -in $w.monitor.sync.line1 - eval [list $w.monitor.sync.monselect linsert end] $MonitorIDs - Monitor_cbox_setentry $w.monitor.sync.monselect [lindex $MonitorIDs 0] - bind $w.monitor.sync.monselect.popup.list \ - "+Monitor_monselect $win" - bind $w.monitor.sync.monselect.popup.list \ - "+Monitor_monselect $win" - } - frame $w.monitor.sync.horz - pack $w.monitor.sync.horz -side left -padx 10m - label $w.monitor.sync.horz.title -text $messages(monitor.3) - entry $w.monitor.sync.horz.entry -width 35 -bd 2 - pack $w.monitor.sync.horz.title -side left - pack $w.monitor.sync.horz.entry -side left - - frame $w.monitor.sync.vert - pack $w.monitor.sync.vert -side left -padx 10m - label $w.monitor.sync.vert.title -text $messages(monitor.4) - entry $w.monitor.sync.vert.entry -width 35 -bd 2 - pack $w.monitor.sync.vert.title -side left - pack $w.monitor.sync.vert.entry -side left - - set canv $w.monitor.canvas - set monCanvas $canv - if !$pc98_EGC { - canvas $canv -width 600 -height 330 -highlightthickness 0 \ - -takefocus 0 -relief sunken -borderwidth 2 - } else { - canvas $canv -width 600 -height 250 -highlightthickness 0 \ - -takefocus 0 -relief sunken -borderwidth 2 - } - pack $canv -side top -fill x - - frame $canv.list - listbox $canv.list.lb -height 10 -width 55 -setgrid true \ - -yscroll [list $canv.list.sb set] - scrollbar $canv.list.sb -command [list $canv.list.lb yview] - if !$pc98_EGC { - pack $canv.list.lb -side left -fill y - # pack $canv.list.sb -side left -fill y - } else { - $canv.list.lb configure -height 5 - pack $canv.list.lb -side left -fill y - pack $canv.list.sb -side left -fill y - } - eval [list $canv.list.lb insert end] $MonitorDescriptions - bind $canv.list.lb \ - [list Monitor_setstandard $win $canv] - bind $canv.list.lb \ - [list Monitor_setstandard $win $canv] - - if !$pc98_EGC { - $canv create rectangle 150 55 550 305 -fill cyan - $canv create rectangle 160 70 540 280 -fill grey - $canv create rectangle 170 80 530 270 -fill blue - $canv create arc 170 76 530 84 -fill blue \ - -start 0 -extent 180 -style chord -outline blue - $canv create arc 170 266 530 274 -fill blue \ - -start 0 -extent -180 -style chord -outline blue - $canv create arc 166 80 174 270 -fill blue \ - -start 90 -extent 180 -style chord -outline blue - $canv create arc 526 80 534 270 -fill blue \ - -start 90 -extent -180 -style chord -outline blue - $canv create line 160 70 170 80 - $canv create line 540 70 530 80 - $canv create line 540 280 530 270 - $canv create line 160 280 170 270 - $canv create rectangle 320 305 380 315 -fill cyan - $canv create rectangle 285 315 415 320 -fill cyan - - $canv create window 350 175 -window $canv.list - - $canv create rectangle 120 30 570 45 -fill white -tag hsync - for {set i 20} {$i<=110} {incr i 10} { - $canv create text [expr $i*5+20] 22 -text $i - } - - $canv create rectangle 50 30 65 305 -fill white -tag vsync - for {set i 40} {$i<=150} {incr i 10} { - $canv create text 35 [expr $i*2.5-70] -text $i -anchor e - } - } else { - $canv create rectangle 150 55 550 225 -fill cyan - $canv create rectangle 160 70 540 200 -fill grey - $canv create rectangle 170 80 530 190 -fill blue - $canv create arc 170 76 530 84 -fill blue \ - -start 0 -extent 180 -style chord -outline blue - $canv create arc 170 186 530 194 -fill blue \ - -start 0 -extent -180 -style chord -outline blue - $canv create arc 166 80 174 190 -fill blue \ - -start 90 -extent 180 -style chord -outline blue - $canv create arc 526 80 534 190 -fill blue \ - -start 90 -extent -180 -style chord -outline blue - $canv create line 160 70 170 80 - $canv create line 540 70 530 80 - $canv create line 540 200 530 190 - $canv create line 160 200 170 190 - $canv create rectangle 320 225 380 235 -fill cyan - $canv create rectangle 285 235 415 240 -fill cyan - - $canv create window 350 135 -window $canv.list - - $canv create rectangle 120 30 570 45 -fill white -tag hsync - for {set i 20} {$i<=110} {incr i 10} { - $canv create text [expr $i*5+20] 22 -text $i - } - - $canv create rectangle 50 30 65 225 -fill white -tag vsync - for {set i 40} {$i<=150} {incr i 10} { - $canv create text 35 [expr $i*1.7-38] -text $i -anchor e - } - } - - frame $w.monitor.bot - label $w.monitor.bot.message -text $messages(monitor.5) - pack $w.monitor.bot -side top - pack $w.monitor.bot.message - - $canv bind hsync [list Monitor_sync_sel $canv hsync %x %y] - $canv bind hsync [list Monitor_sync_chg $canv hsync %x %y] - $canv bind hsync [list Monitor_sync_rel $canv hsync %x %y] - $canv bind hsync [list Monitor_sync_del $canv hsync %x %y] - $canv bind vsync [list Monitor_sync_sel $canv vsync %x %y] - $canv bind vsync [list Monitor_sync_chg $canv vsync %x %y] - $canv bind vsync [list Monitor_sync_rel $canv vsync %x %y] - $canv bind vsync [list Monitor_sync_del $canv vsync %x %y] - bind $w.monitor.sync.horz.entry , \ - [list Monitor_sync_ent $w.monitor.sync.horz.entry $canv horz] - bind $w.monitor.sync.horz.entry \ - [list Monitor_sync_ent $w.monitor.sync.horz.entry $canv horz] - bind $w.monitor.sync.horz.entry \ - [list Monitor_sync_ent $w.monitor.sync.horz.entry $canv horz] - bind $w.monitor.sync.vert.entry , \ - [list Monitor_sync_ent $w.monitor.sync.vert.entry $canv vert] - bind $w.monitor.sync.vert.entry \ - [list Monitor_sync_ent $w.monitor.sync.vert.entry $canv vert] - bind $w.monitor.sync.vert.entry \ - [list Monitor_sync_ent $w.monitor.sync.vert.entry $canv vert] -} - -proc Monitor_activate { win } { - set w [winpathprefix $win] - pack $w.monitor -side top -fill both -expand yes - - Monitor_get_configvars $win -} - -proc Monitor_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.monitor - - Monitor_set_configvars $win -} - -proc Monitor_monselect { win } { - global monDevNum - - set w [winpathprefix $win] - if { ![string length [$w.monitor.sync.monselect curselection]] } \ - return - Monitor_set_configvars $win - set monDevNum [$w.monitor.sync.monselect curselection] - Monitor_get_configvars $win -} - -proc Monitor_set_configvars { win } { - global monDevNum MonitorIDs - - set w [winpathprefix $win] - set devid [lindex $MonitorIDs $monDevNum] - set varname Monitor_$devid - global $varname - set ${varname}(HorizSync) [$w.monitor.sync.horz.entry get] - set ${varname}(VertRefresh) [$w.monitor.sync.vert.entry get] -} - -proc Monitor_get_configvars { win } { - global monDevNum MonitorIDs monCanvas - - set w [winpathprefix $win] - set devid [lindex $MonitorIDs $monDevNum] - set varname Monitor_$devid - global $varname - $w.monitor.sync.horz.entry delete 0 end - $w.monitor.sync.horz.entry insert 0 [set ${varname}(HorizSync)] - $w.monitor.sync.vert.entry delete 0 end - $w.monitor.sync.vert.entry insert 0 [set ${varname}(VertRefresh)] - Monitor_sync_ent $w.monitor.sync.horz.entry $monCanvas horz - Monitor_sync_ent $w.monitor.sync.vert.entry $monCanvas vert -} - -proc Monitor_cbox_setentry { cb text } { - $cb econfig -state normal - $cb edelete 0 end - if [string length $text] { - $cb einsert 0 $text - } - $cb econfig -state disabled - set cblist [$cb lget 0 end] - set idx [lsearch $cblist $text] - if { $idx != -1 } { - $cb see $idx - $cb lselection clear 0 end - $cb lselection set $idx - $cb activate $idx - } -} - -proc Monitor_setstandard { win c } { - global MonitorHsyncRanges MonitorVsyncRanges - - set w [winpathprefix $win] - set monidx [$c.list.lb curselection] - if ![string length $monidx] return - $w.monitor.sync.horz.entry delete 0 end - $w.monitor.sync.horz.entry insert end $MonitorHsyncRanges($monidx) - Monitor_sync_ent $w.monitor.sync.horz.entry $c horz - $w.monitor.sync.vert.entry delete 0 end - $w.monitor.sync.vert.entry insert end $MonitorVsyncRanges($monidx) - Monitor_sync_ent $w.monitor.sync.vert.entry $c vert -} - -proc Monitor_sync_ent { win c dir } { - global pc98_EGC - - set w [winpathprefix $win] - if { [string compare $dir horz] == 0 } { - set min 20.0 - set max 110.0 - set x1 {$beg*5.0+20} - set y1 30 - set x2 {$end*5.0+20} - set y2 45 - } else { - set min 40.0 - set max 150.0 - set x1 50 - set x2 65 - if !$pc98_EGC { - set y1 {$beg*2.5-70} - set y2 {$end*2.5-70} - } else { - set y1 {$beg*1.7-38} - set y2 {$end*1.7-38} - } - } - set rng [zap_white [$w get]] - set rnglist [split $rng ,] - set count 0 - catch {$c delete ${dir}rng} - foreach elem $rnglist { - set beg [set end 0] - set elem [zap_white $elem] - if { [string first - $elem] == -1 } { - scan $elem %f beg - set end $beg - } else { - scan $elem %f-%f beg end - } - if { $beg > $end } { - set end $beg - } - if { $beg < $min } { - if { $end < $min } continue - set beg $min - } - if { $end > $max } { - if { $beg > $max } continue - set end $max - } - incr count - $c create rectangle \ - [expr $x1] [expr $y1] [expr $x2] [expr $y2] \ - -fill red -tag "${dir}$count ${dir}rng" - } -} - -proc Monitor_sync_chg { c t x y } { -} - -proc Monitor_sync_del { c t x y } { -} - -proc Monitor_sync_rel { c t x y } { -} - -proc Monitor_sync_sel { c t x y } { -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl:3.25 xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl:3.25 Sun Apr 26 12:04:34 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl Sat Feb 28 21:42:23 2004 @@ -1,684 +0,0 @@ -# $XConsortium: mouse.tcl /main/6 1996/10/28 05:42:22 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/mouse.tcl,v 3.25 1998/04/26 16:04:34 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Mouse configuration routines -# - -set mseTypeList [concat $SupportedMouseTypes { Xqueue OSMouse } ] - -set msePatterns [list {tty[0-9A-Za-o]*} cua* *bm *mse* *mouse* \ - ps*x psm* m320 pms* com* gpmdata lms* kdmouse logi msm] -set mseDevices "" -foreach pat $msePatterns { - if ![catch {glob /dev/$pat}] { - eval lappend mseDevices [glob /dev/$pat] - } -} -if [info exists Pointer(RealDev)] { - lappend mseDevices $Pointer(RealDev) -} -set mseDevices [lrmdups $mseDevices] - -proc Mouse_proto_select { win } { - global mseType baudRate chordMiddle clearDTR clearRTS sampleRate - global mseRes mseButtons mseDeviceSelected messages - - set w [winpathprefix $win] - set canv $w.mouse.mid.right.canvas - $canv itemconfigure mbut -fill white - $canv itemconfigure coord -fill black - if {[lsearch -exact {BusMouse Xqueue OSMouse PS/2 IMPS/2 - ThinkingMousePS/2 MouseManPlusPS/2 GlidePointPS/2 - NetMousePS/2 NetScrollPS/2 SysMouse} \ - $mseType] == -1} { - foreach rate {1200 2400 4800 9600} { - $w.mouse.brate.$rate configure -state normal - } - if { ![string compare MouseMan $mseType] } { - $w.mouse.brate.2400 configure -state disabled - $w.mouse.brate.4800 configure -state disabled - if { $baudRate == 2400 || $baudRate == 4800 } { - set baudRate 1200 - } - } - } else { - foreach rate {1200 2400 4800 9600} { - $w.mouse.brate.$rate configure -state disabled - } - } - if { ![string compare MMHitTab $mseType] } { - $w.mouse.srate.title configure -text $messages(mouse.1) - $w.mouse.srate.scale configure -to 1200 -tickinterval 200 \ - -resolution 20 - $w.mouse.srate.scale configure -state normal - } else { - $w.mouse.srate.title configure -text $messages(mouse.2) - $w.mouse.srate.scale configure -to 150 -tickinterval 25 \ - -resolution 1 - if {[lsearch -exact \ - {MouseMan BusMouse Xqueue OSMouse} \ - $mseType] == -1} { - $w.mouse.srate.scale configure -state normal - } else { - $w.mouse.srate.scale configure -state disabled - set sampleRate 0 - } - } - if { ![string compare MouseSystems $mseType] } { - $w.mouse.flags.dtr configure -state normal - $w.mouse.flags.rts configure -state normal - } else { - $w.mouse.flags.dtr configure -state disabled - $w.mouse.flags.rts configure -state disabled - set clearDTR [set clearRTS 0] - } - if {[lsearch -exact {Microsoft MouseMan} $mseType] == -1} { - $w.mouse.chdmid configure -state disabled - set chordMiddle 0 - } else { - $w.mouse.chdmid configure -state normal - } - if { !$mseDeviceSelected } { - $w.mouse.device.entry delete 0 end - $w.mouse.device.entry insert 0 \ - [Mouse_defaultdevice $mseType] - Mouse_setlistbox $w $w.mouse.device.list.lb - } -# Mouse_setsettings $win -} - -proc Mouse_create_widgets { win } { - global mseType mseDevices baudRate sampleRate mseTypeList clearDTR - global emulate3Buttons emulate3Timeout chordMiddle clearRTS - global pc98_EGC mseRes mseButtons messages - - set w [winpathprefix $win] - if !$pc98_EGC { - frame $w.mouse -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.mouse -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.mouse.top - frame $w.mouse.mid -relief sunken -borderwidth 3 - frame $w.mouse.bot - pack $w.mouse.top -side top - pack $w.mouse.mid -side top -fill x -expand yes - pack $w.mouse.bot -side top - - label $w.mouse.top.title -text $messages(mouse.3) - frame $w.mouse.type - pack $w.mouse.top.title $w.mouse.type -in $w.mouse.top -side top - set i 0 - foreach Type $mseTypeList { - set type [string tolower $Type] - radiobutton $w.mouse.type.$type -text $Type \ - -width 16 \ - -indicatoron false \ - -variable mseType -value $Type \ - -highlightthickness 1 \ - -command [list Mouse_proto_select $win] - grid $w.mouse.type.$type -column [expr $i % 6] \ - -row [expr $i / 6] - incr i - } - - frame $w.mouse.mid.left - pack $w.mouse.mid.left -side left -fill x -fill y - frame $w.mouse.device - pack $w.mouse.device -in $w.mouse.mid.left -side top \ - -pady 3m -padx 3m - label $w.mouse.device.title -text $messages(mouse.5) - entry $w.mouse.device.entry -bd 2 - bind $w.mouse.device.entry \ - "[list Mouse_setlistbox $win $w.mouse.device.list.lb]; \ - focus $w.mouse.em3but" - frame $w.mouse.device.list - if !$pc98_EGC { - listbox $w.mouse.device.list.lb -height 6 \ - -yscroll [list $w.mouse.device.list.sb set] - } else { - listbox $w.mouse.device.list.lb -height 4 \ - -yscroll [list $w.mouse.device.list.sb set] - } - eval [list $w.mouse.device.list.lb insert end] $mseDevices - bind $w.mouse.device.list.lb \ - "[list Mouse_setentry $win $w.mouse.device.list.lb]; \ - focus $w.mouse.em3but" - bind $w.mouse.device.list.lb \ - [list Mouse_setentry $win $w.mouse.device.list.lb] - scrollbar $w.mouse.device.list.sb \ - -command [list $w.mouse.device.list.lb yview] - - pack $w.mouse.device.list.lb -side left -expand yes -fill both - pack $w.mouse.device.list.sb -side left -expand yes -fill y - - pack $w.mouse.device.title $w.mouse.device.entry \ - $w.mouse.device.list -side top -fill x - - frame $w.mouse.mid.left.buttons - pack $w.mouse.mid.left.buttons -in $w.mouse.mid.left \ - -side top -fill x -pady 2m - checkbutton $w.mouse.em3but -text $messages(mouse.6) \ - -indicatoron no -variable emulate3Buttons \ - -command [list Mouse_set_em3but $win] - checkbutton $w.mouse.chdmid -text $messages(mouse.7) \ - -indicatoron no -variable chordMiddle \ - -command [list Mouse_set_chdmid $win] - pack $w.mouse.em3but $w.mouse.chdmid -in $w.mouse.mid.left.buttons \ - -side top -fill x -padx 3m -anchor w - - frame $w.mouse.resolution - pack $w.mouse.resolution -in $w.mouse.mid.left -side top -pady 2m - label $w.mouse.resolution.title -text $messages(mouse.19) - pack $w.mouse.resolution.title -side top - frame $w.mouse.resolution.left - frame $w.mouse.resolution.mid - frame $w.mouse.resolution.right - pack $w.mouse.resolution.left $w.mouse.resolution.mid \ - $w.mouse.resolution.right -side left -expand yes -fill x - radiobutton $w.mouse.resolution.200 -text $messages(mouse.20) \ - -variable mseRes -value 200 - pack $w.mouse.resolution.200 -side top -fill x -anchor w \ - -in $w.mouse.resolution.left - radiobutton $w.mouse.resolution.100 -text $messages(mouse.21) \ - -variable mseRes -value 100 - pack $w.mouse.resolution.100 -side top -fill x -anchor w \ - -in $w.mouse.resolution.mid - radiobutton $w.mouse.resolution.50 -text $messages(mouse.22) \ - -variable mseRes -value 50 - pack $w.mouse.resolution.50 -side top -fill x -anchor w \ - -in $w.mouse.resolution.right - - frame $w.mouse.mid.mid - pack $w.mouse.mid.mid -side left -fill x -fill y - - frame $w.mouse.brate -# pack $w.mouse.brate -in $w.mouse.mid.left -side top -pady 2m - pack $w.mouse.brate -in $w.mouse.mid.mid -side top -pady 2m - label $w.mouse.brate.title -text $messages(mouse.8) - pack $w.mouse.brate.title -side top - frame $w.mouse.brate.left - frame $w.mouse.brate.right - pack $w.mouse.brate.left $w.mouse.brate.right -side left \ - -expand yes -fill x - foreach rate { 1200 2400 4800 9600 } { - radiobutton $w.mouse.brate.$rate -text $rate \ - -variable baudRate -value $rate - pack $w.mouse.brate.$rate -side top -anchor w \ - -in $w.mouse.brate.[expr $rate<4800?"left":"right"] - } - - frame $w.mouse.flags - pack $w.mouse.flags -in $w.mouse.mid.mid -side top \ - -fill x -pady 3m - label $w.mouse.flags.title -text $messages(mouse.10) - checkbutton $w.mouse.flags.dtr -text $messages(mouse.11) \ - -width 14 -indicatoron no -variable clearDTR - checkbutton $w.mouse.flags.rts -text $messages(mouse.12) \ - -width 14 -indicatoron no -variable clearRTS - pack $w.mouse.flags.title $w.mouse.flags.dtr $w.mouse.flags.rts \ - -side top -fill x -padx 3m -anchor w - - frame $w.mouse.buttons - pack $w.mouse.buttons -in $w.mouse.mid.mid -side top \ - -pady 3m - label $w.mouse.buttons.title -text $messages(mouse.23) - pack $w.mouse.buttons.title -side top - frame $w.mouse.buttons.left - frame $w.mouse.buttons.mid - frame $w.mouse.buttons.right - pack $w.mouse.buttons.left $w.mouse.buttons.mid \ - $w.mouse.buttons.right -side left -expand yes -fill x - radiobutton $w.mouse.buttons.3 -text 3 \ - -variable mseButtons -value 3 - pack $w.mouse.buttons.3 -side top -fill x -anchor w \ - -in $w.mouse.buttons.left - radiobutton $w.mouse.buttons.4 -text 4 \ - -variable mseButtons -value 4 - pack $w.mouse.buttons.4 -side top -fill x -anchor w \ - -in $w.mouse.buttons.mid - radiobutton $w.mouse.buttons.5 -text 5 \ - -variable mseButtons -value 5 - pack $w.mouse.buttons.5 -side top -fill x -anchor w \ - -in $w.mouse.buttons.right - - frame $w.mouse.srate - pack $w.mouse.srate -in $w.mouse.mid -side left -fill y -expand yes - label $w.mouse.srate.title -text $messages(mouse.13) - scale $w.mouse.srate.scale -orient vertical -from 0 -to 150 \ - -tickinterval 25 -variable sampleRate -state disabled - pack $w.mouse.srate.title -side top - pack $w.mouse.srate.scale -side top -fill y -expand yes - - frame $w.mouse.em3tm - pack $w.mouse.em3tm -in $w.mouse.mid -side left -fill y -expand yes - label $w.mouse.em3tm.title -text $messages(mouse.14) - scale $w.mouse.em3tm.scale -orient vertical -from 0 -to 1000 \ - -tickinterval 250 -variable emulate3Timeout -resolution 5 - pack $w.mouse.em3tm.title -side top - pack $w.mouse.em3tm.scale -side top -fill y -expand yes - - frame $w.mouse.mid.right - pack $w.mouse.mid.right -side left - set canv $w.mouse.mid.right.canvas - if !$pc98_EGC { - set canvHeight 4i - set canvRect4Height 3.75i - set canvTextHeight 2.25i - } else { - set canvHeight 2i - set canvRect4Height 1.75i - set canvTextHeight 1.50i - } - canvas $canv -width 1.5i -height 3i -highlightthickness 0 \ - -takefocus 0 - $canv create rectangle 0.1i 1i 1.3i 2.5i -fill white \ - -tag {mbut mbut4} - $canv create rectangle 0.1i 0.25i 0.5i 1i -fill white \ - -tag {mbut mbut1} - $canv create rectangle 0.5i 0.25i 0.9i 1i -fill white \ - -tag {mbut mbut2} - $canv create rectangle 0.9i 0.25i 1.3i 1i -fill white \ - -tag {mbut mbut3} - $canv create text 0.7i 2.20i -tag coord - - button $w.mouse.mid.right.apply -text $messages(mouse.15) \ - -command [list Mouse_setsettings $win] - pack $canv $w.mouse.mid.right.apply -side top - if $pc98_EGC { - pack forget $w.mouse.flag - pack $w.mouse.flags -in $w.mouse.mid.right -side top \ - -fill x -pady 3m - } - - label $w.mouse.bot.mesg -text $messages(mouse.16) \ - -foreground [$w.mouse.top.title cget -foreground] - pack $w.mouse.bot.mesg - - Mouse_getsettings $w -} - -proc Mouse_activate { win } { - global mseHelpShown - - set w [winpathprefix $win] - pack $w.mouse -side top -fill both -expand yes - - set canv $w.mouse.mid.right.canvas - bind $win [list $canv itemconfigure mbut%b -fill black] - bind $win [list $canv itemconfigure mbut%b -fill white] - bind $win [list $canv itemconfigure mbut4 -fill black; - $canv itemconfigure coord -fill white] - bind $win [list $canv itemconfigure mbut4 -fill white; - $canv itemconfigure coord -fill black] - bind $win [list $canv itemconfigure coord -text (%X,%Y)] - - $canv itemconfigure mbut -fill white - $canv itemconfigure coord -fill black - - set ifcmd {if { [string compare [focus] %s.mouse.device.entry] - != 0 } { %s %s } } - - bind $win a [format $ifcmd $w Mouse_setsettings $win ] - bind $win b [format $ifcmd $w Mouse_nextbaudrate $win ] - bind $win c [format $ifcmd $w $w.mouse.chdmid invoke ] - bind $win d [format $ifcmd $w $w.mouse.flags.dtr invoke ] - bind $win e [format $ifcmd $w $w.mouse.em3but invoke ] - bind $win l [format $ifcmd $w Mouse_nextresolution $win ] - bind $win n [format $ifcmd $w Mouse_selectentry $win ] - bind $win p [format $ifcmd $w Mouse_nextprotocol $win ] - bind $win r [format $ifcmd $w $w.mouse.flags.rts invoke ] - bind $win s [format $ifcmd $w Mouse_incrsamplerate $win ] - bind $win t [format $ifcmd $w Mouse_increm3timeout $win ] - bind $win 3 [format $ifcmd $w $w.mouse.buttons.3 invoke ] - bind $win 4 [format $ifcmd $w $w.mouse.buttons.4 invoke ] - bind $win 5 [format $ifcmd $w $w.mouse.buttons.5 invoke ] - if ![info exists mseHelpShown] { - Mouse_popup_help $win - set mseHelpShown yes - } -} - -proc Mouse_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.mouse - - bind $win "" - bind $win "" - bind $win "" - bind $win "" - bind $win "" - - bind $win a "" - bind $win b "" - bind $win c "" - bind $win d "" - bind $win e "" - bind $win n "" - bind $win p "" - bind $win r "" - bind $win s "" - bind $win t "" -} - -proc Mouse_selectentry { win } { - set w [winpathprefix $win] - if { [ $w.mouse.device.entry cget -state] != "disabled" } { - focus $w.mouse.device.entry - } -} - -proc Mouse_nextprotocol { win } { - global mseType mseTypeList - - set w [winpathprefix $win] - set idx [lsearch -exact $mseTypeList $mseType] - do { - incr idx - if { $idx >= [llength $mseTypeList] } { - set idx 0 - } - set mseType [lindex $mseTypeList $idx] - set mtype [string tolower $mseType] - } while { [$w.mouse.type.$mtype cget -state] == "disabled" } - Mouse_proto_select $w -} - -proc Mouse_nextbaudrate { win } { - global baudRate - - set w [winpathprefix $win] - if { [$w.mouse.brate.$baudRate cget -state] == "disabled" } { - return - } - do { - set baudRate [expr $baudRate*2] - if { $baudRate > 9600 } { - set baudRate 1200 - } - } while { [$w.mouse.brate.$baudRate cget -state] == "disabled" } -} - -proc Mouse_nextresolution { win } { - global mseRes - - set w [winpathprefix $win] - set mseRes [expr $mseRes/2] - if { $mseRes < 50 } { - set mseRes 200 - } - $w.mouse.resolution.$mseRes invoke -} - -proc Mouse_incrsamplerate { win } { - global sampleRate - - set w [winpathprefix $win] - if { [$w.mouse.srate.scale cget -state] == "disabled" } { - return - } - - set max [$w.mouse.srate.scale cget -to] - set interval [expr [$w.mouse.srate.scale cget -tickinterval]/2.0] - if { $sampleRate+$interval > $max } { - set sampleRate 0 - } else { - set sampleRate [expr $sampleRate+$interval] - } -} - -proc Mouse_increm3timeout { win } { - global emulate3Timeout - - set w [winpathprefix $win] - if { [$w.mouse.em3tm.scale cget -state] == "disabled" } { - return - } - set max [$w.mouse.em3tm.scale cget -to] - set interval [expr [$w.mouse.em3tm.scale cget -tickinterval]/2.0] - if { $emulate3Timeout+$interval > $max } { - set emulate3Timeout 0 - } else { - set emulate3Timeout [expr $emulate3Timeout+$interval] - } -} - -proc Mouse_set_em3but { win } { - global emulate3Buttons chordMiddle - - set w [winpathprefix $win] - if { $emulate3Buttons } { - $w.mouse.em3tm.scale configure -state normal - } else { - $w.mouse.em3tm.scale configure -state disabled - } - if { $chordMiddle && $emulate3Buttons } { - $w.mouse.chdmid invoke - } -} - -proc Mouse_set_chdmid { win } { - global emulate3Buttons chordMiddle - - set w [winpathprefix $win] - if { $chordMiddle && $emulate3Buttons } { - $w.mouse.em3but invoke - } -} - -proc Mouse_setsettings { win } { - global mseType baudRate sampleRate clearDTR Pointer - global emulate3Buttons emulate3Timeout chordMiddle clearRTS - global mseRes mseButtons mseDeviceSelected messages - - set w [winpathprefix $win] - $w.mouse.bot.mesg configure -foreground black \ - -text $messages(mouse.4) - $win configure -cursor watch - update idletasks - set mseDeviceSelected 1 - set msedev [$w.mouse.device.entry get] - set em3but off - set chdmid off - if $emulate3Buttons {set em3but on} - if $chordMiddle {set chdmid on} - set flags "" - if $clearDTR {lappend flags ClearDTR} - if $clearRTS {lappend flags ClearRTS} - if { "$mseType" == "MouseSystems" } {lappend flags ReOpen} - if [string length $msedev] { - set Pointer(RealDev) $msedev - check_tmpdirs - unlink $Pointer(Device) - if [link $Pointer(RealDev) $Pointer(Device)] { - lappend flags ReOpen - } - } - check_tmpdirs - set result [catch { eval [list xf86misc_setmouse \ - $msedev $mseType $baudRate $sampleRate $mseRes $mseButtons \ - $em3but $emulate3Timeout $chdmid] $flags } ] - if { $result } { - bell -displayof $w - } else { - set Pointer(Protocol) $mseType - if { [$w.mouse.brate.1200 cget -state] == "disabled" } { - set Pointer(BaudRate) "" - } else { - set Pointer(BaudRate) $baudRate - } - if { [$w.mouse.srate.scale cget -state] == "disabled" - || $sampleRate == 0 } { - set Pointer(SampleRate) "" - } else { - set Pointer(SampleRate) $sampleRate - } - set Pointer(Resolution) $mseRes - set Pointer(Buttons) $mseButtons - set Pointer(Emulate3Buttons) [expr $emulate3Buttons?"ON":""] - set Pointer(Emulate3Timeout) \ - [expr $emulate3Buttons?$emulate3Timeout:""] - set Pointer(ChordMiddle) [expr $chordMiddle?"ON":""] - set Pointer(ClearDTR) [expr $clearDTR?"ON":""] - set Pointer(ClearRTS) [expr $clearRTS?"ON":""] - } - $w.mouse.bot.mesg configure \ - -text $messages(mouse.9) \ - -foreground [$w.mouse.top.title cget -foreground] - $win configure -cursor top_left_arrow -} - -proc Mouse_getsettings { win } { - global mseType mseTypeList baudRate sampleRate clearDTR Pointer - global emulate3Buttons emulate3Timeout chordMiddle clearRTS - global mseRes mseButtons mseDeviceSelected SupportedMouseTypes - - set w [winpathprefix $win] - set initlist [xf86misc_getmouse] - set initdev [lindex $initlist 0] - set inittype [lindex $initlist 1] - set initbrate [lindex $initlist 2] - set initsrate [lindex $initlist 3] - set initres [lindex $initlist 4] - set initbtn [lindex $initlist 5] - set initem3btn [lindex $initlist 6] - set initem3tm [lindex $initlist 7] - set initchdmid [lindex $initlist 8] - set initflags [lrange $initlist 9 end] - - set mseDeviceSelected 1 - if [getuid] { - pack forget $w.mouse.device.title - pack forget $w.mouse.device.entry - pack forget $w.mouse.device.list - } else { - if { [info exists Pointer(RealDev)] } { - $w.mouse.device.entry insert 0 $Pointer(RealDev) - } else { - set default [Mouse_defaultdevice $inittype] - if { [string length $default] } { - $w.mouse.device.entry insert 0 $default - set mseDeviceSelected 0 - } else { - pack forget $w.mouse.device.title - pack forget $w.mouse.device.entry - pack forget $w.mouse.device.list - } - } - } - Mouse_setlistbox $w $w.mouse.device.list.lb - $w.mouse.brate.$initbrate invoke - - set chordMiddle [expr [string compare $initchdmid on] == 0] - set emulate3Buttons [expr [string compare $initem3btn on] == 0] - set emulate3Timeout $initem3tm - set sampleRate $initsrate - set mseRes $initres - if { $mseRes <= 0 } { - set mseRes 100 - } - $w.mouse.resolution.$mseRes invoke - set mseButtons $initbtn - if { $mseButtons < 3 } { - set mseButtons 3 - } elseif { $mseButtons > 5 } { - set mseButtons 5 - } - $w.mouse.buttons.$mseButtons invoke - set clearDTR [expr [string first $initflags ClearDTR] >= 0] - set clearRTS [expr [string first $initflags ClearRTS] >= 0] - - foreach mse $mseTypeList { - $w.mouse.type.[string tolower $mse] \ - configure -state disabled - } - set mtype [string tolower $inittype] - if { $mtype == "osmouse" || $mtype == "xqueue" } { - $w.mouse.type.$mtype configure -state normal - } else { - foreach mse $SupportedMouseTypes { - $w.mouse.type.[string tolower $mse] \ - configure -state normal - } - } - $w.mouse.type.$mtype invoke -} - -proc Mouse_setentry { win lbox } { - global Pointer mseDeviceSelected - - set w [winpathprefix $win] - set idx [$lbox curselection] - if ![string length $idx] { - return - } - $w.mouse.device.entry delete 0 end - set devname [$lbox get $idx] - $w.mouse.device.entry insert end $devname - set Pointer(RealDev) $devname - set mseDeviceSelected 1 -} - -proc Mouse_setlistbox { win lbox } { - global Pointer mseDevices - - set w [winpathprefix $win] - set devname [$w.mouse.device.entry get] - if ![string length $devname] { - return - } - set Pointer(RealDev) $devname - if { [set idx [lsearch $mseDevices $devname]] != -1 } { - $lbox selection clear 0 end - $lbox selection set $idx - $lbox activate $idx - $lbox see $idx - } -} - -proc Mouse_defaultdevice { mousetype } { - global mseDevices - - switch $mousetype { - PS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - IMPS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - ThikingMousePS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - MouseManPlusPS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - GlidePointPS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - NetMousePS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - NetScrollPS/2 { set idx [lsearch -regexp $mseDevices \ - {/dev/p[ms].*} ] } - BusMouse { set idx [lsearch -regexp $mseDevices \ - /dev/.*bm|/dev/mse.* ] } - SysMouse { set idx [lsearch -regexp $mseDevices \ - /dev/sysmouse.* ] } - OsMouse - - Xqueue { return "" } - default { set idx [lsearch -regexp $mseDevices \ - /dev/cua*|/dev/tty* ] } - } - if { $idx == -1 } { - set idx 0 - } - return [lindex $mseDevices $idx] -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp:3.2 Sun Dec 13 02:37:42 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp Sat Feb 28 21:42:23 2004 @@ -1,78 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/mseproto.cpp,v 3.2 1998/12/13 07:37:42 dawes Exp $ */ - -#if defined(PC98) -set SerialMouseTypes [list \ - "Microsoft" \ - "Logitech" \ - "MouseMan" \ - "IntelliMouse" \ -] -#else -set SerialMouseTypes [list \ - "Microsoft" \ - "MouseSystems" \ - "MMSeries" \ - "Logitech" \ - "MouseMan" \ - "MMHitTab" \ - "GlidePoint" \ - "IntelliMouse" \ - "ThinkingMouse" \ -] -#endif - -set BusMouseTypes [list \ - "BusMouse" \ -] - -#if defined(PC98) -set StandardPS2Types [] -set ExtendedPS2Types [] -#else -set StandardPS2Types [list \ - "PS/2" \ -] - -set ExtendedPS2Types [list \ - "IMPS/2" \ - "ThinkingMousePS/2" \ - "MouseManPlusPS/2" \ - "GlidePointPS/2" \ - "NetMousePS/2" \ - "NetScrollPS/2" \ -] -#endif - -set PnpMouseTypes [list \ - "Auto" \ -] - - -#if defined(__FreeBSD__) -set ExtraMouseTypes [list \ - "SysMouse" \ -] -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \ - $PnpMouseTypes $ExtraMouseTypes -#elif defined(__NetBSD__) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $PnpMouseTypes -#elif defined(__OpenBSD__) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \ - $PnpMouseTypes -#elif defined(Lynx) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types -#elif defined(ISC) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types -#elif defined(sun) && defined(i386) && defined(SVR4) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types -#elif defined(DGUX) -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \ - $PnpMouseTypes $ExtendedPS2Types -#elif defined (SVR4) || defined(SYSV) -#define MOUSE_TYPES $SerialMouseTypes $PnpMouseTypes -#else -#define MOUSE_TYPES $SerialMouseTypes $BusMouseTypes $StandardPS2Types \ - $PnpMouseTypes $ExtendedPS2Types -#endif - -set SupportedMouseTypes [concat MOUSE_TYPES] Index: xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl:1.1 Mon Apr 5 03:13:00 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl Sat Feb 28 21:42:23 2004 @@ -1,67 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/ph2notk.tcl,v 1.1 1999/04/05 07:13:00 dawes Exp $ -# -# Copyright 1997 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Phase II - Curses/Text server configuration -# - -set XKBavailable 0 -Kbd_setxkbcomponents -puts $XKBComponents(models,names) -puts $XKBComponents(models,descriptions) -puts $XKBComponents(options,names) -puts $XKBComponents(options,descriptions) -sleep 100 - -mesg "\n\ - There are five areas of configuration that need to\ - be completed:\n\ - Mouse - Use this to set the protocol, baud rate, etc.\ - used by your mouse\n\ - Keyboard - Set the nationality and layout of\ - your keyboard\n\ - Card - Used to select the chipset, RAMDAC, etc.\ - of your card\n\ - Monitor - Use this to enter your\ - monitor's capabilities\n\ - Other - Configure some miscellaneous settings\n\n\ - You'll probably want to start with configuring your\ - mouse (you can just press \[Enter\] to do so)\n\ - and when you've finished configuring all five of these,\ - select the Done button.\n\n\ - You can also press ? or click on the Help button at\ - any time for additional instructions\n\n" \ - okay "Introduction to Configuration with XF86Setup" - -proc Intro_popup_help { win } { - .introhelp.text insert 0.0 "\n\ - You need to fill in the requested information on each\ - of the five\n\ - configuration screens. The buttons along the top allow\ - you to choose which\n\ - screen you are going to work on. You can do them in\ - any order or go back\n\ - to each of them as many times as you like, however,\ - it will be very\n\ - difficult to use some of them if your mouse is not\ - working, so you\n\ - should configure your mouse first.\n\n\ - Until you get your mouse working, here are some keys you\ - can use:\n\n\ - \ \ Tab, Ctrl-Tab Move to the \"next\" widget\n\ - \ \ Shift-Tab Move to the \"previous\" widget\n\ - \ \ Move in the appropriate direction\n\ - \ \ Return Activate the selected widget\n\n\ - Also, you can press Alt and one of the underlined letters\ - to activate the\n\ - corresponding button." - .introhelp.text configure -state disabled - button .introhelp.ok -text "Dismiss" -command "destroy .introhelp" -} - - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl:3.21 xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl:3.21 Mon Jul 12 04:14:26 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl Sat Feb 28 21:42:23 2004 @@ -1,401 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase1.tcl,v 3.21 1999/07/12 08:14:26 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: phase1.tcl /main/3 1996/10/28 05:42:26 kaleb $ - -# -# Phase I - Initial text mode interaction w/user and starting of SVGA server -# -set clicks1 [clock clicks] - -# load the autoload stuff -source $tcl_library/init.tcl -# load language specific library -source $XF86Setup_library/texts/local_text.tcl -# load in our library -source $XF86Setup_library/setuplib.tcl -source $XF86Setup_library/filelist.tcl -source $XF86Setup_library/carddata.tcl -source $XF86Setup_library/kbddata.tcl -source $XF86Setup_library/mondata.tcl - -proc check_for_files { xwinhome } { - global FilePermsDescriptions FilePermsReadMe messages - - foreach var [array names FilePermsDescriptions] { - global FilePerms$var - foreach tmp [array names FilePerms$var] { - set pattern [lindex $tmp 0] - set perms [lindex $tmp 1] ;# ignored (for now at least) - if ![llength [glob -nocomplain -- $xwinhome/$pattern]] { - set msg [format "$messages(phase1.1) %s %s %s %s" \ - $FilePermsDescriptions($var) \ - $messages(phase1.2) \ - $xwinhome/$pattern $messages(phase1.3)] - mesg [parafmt 65 $msg] okay - exit 1 - } - } - } - foreach readme [array names FilePermsReadMe] { - set pattern [lindex $readme 0] - set perms [lindex $readme 1] ;# ignored (for now at least) - if ![llength [glob -nocomplain -- $xwinhome/$pattern]] { - mesg [parafmt 65 $messages(phase1.4)] okay - break - } - } -} - -proc set_xf86config_defaults {} { - global Xwinhome ConfigFile messages - global Files Server Keyboard Pointer MonitorIDs DeviceIDs - - if {![catch {xf86config_readfile $Xwinhome files server \ - keyboard mouse monitor device screen} tmp]} { - array set Files [array get files] - array set Server [array get Server] - array set Keyboard [array get keyboard] - array set Pointer [array get mouse] - foreach drvr { Mono VGA2 VGA16 SVGA Accel } { - global Scrn_$drvr - if [info exists screen_$drvr] { - array set Scrn_$drvr [array get screen_$drvr] - } else { - set Scrn_${drvr}(Driver) "" - } - } - set MonitorIDs [set DeviceIDs ""] - set primon 0 - set priname "Primary Monitor" - global Monitor_$priname - foreach mon [info vars monitor_*] { - set id [string range $mon 8 end] - global Monitor_$id - if { "$id" == "$priname" } { - set primon 1 - } else { - array set Monitor_$id [array get Monitor_$priname] - } - lappend MonitorIDs $id - array set Monitor_$id [array get monitor_$id] - } - if !$primon { global Monitor_$priname; unset Monitor_$priname } - set pridev 0 - set priname "Primary Card" - global Device_$priname - foreach dev [info vars device_*] { - set id [string range $dev 7 end] - global Device_$id - if { "$id" == "$priname" } { - set pridev 1 - } else { - array set Device_$id [array get Device_$priname] - } - lappend DeviceIDs $id - array set Device_$id [array get device_$id] - set Device_${id}(Options) [set Device_${id}(Option)] - set Device_${id}(Server) NoMatch - } - if !$pridev { global Device_$priname; unset Device_$priname } - set fd [open $ConfigFile r] - set ws "\[ \t\]" - set nqt {[^"]} - set alnum {[A-Z0-9]} - set idpat "^$ws+\[Ii]\[Dd]$nqt+\"($nqt*)\"" - set servpat "\"$nqt*\"$ws+##.*SERVER:$ws*($alnum+)" - while { [gets $fd line] >= 0 } { - set tmp [string toupper [zap_white $line] ] - if { [string compare $tmp {SECTION"DEVICE"}] == 0 } { - while { [gets $fd nextline] >= 0 } { - set upper [string toupper $nextline] - if { [regexp $idpat $nextline dummy id] } { - set found [regexp $servpat $upper dummy serv] - if $found { - if { [string match XF86_* $serv] } { - set serv [string range $serv 5 end] - } - set Device_${id}(Server) $serv - } - break - } - if ![string compare [string trim $upper] "ENDSECTION"] { - break - } - } - } - } - close $fd - global ServerList - foreach devid $DeviceIDs { - set varname Device_${devid}(Server) - if { ![info exists $varname] || - [lsearch -exact $ServerList [set $varname]] < 0} { - set filename $Xwinhome/bin/X - for {set nlinks 0} \ - {[file exists $filename] && \ - [file type $filename]=="link" && $nlinks<20} \ - {incr nlinks} { - set filename [readlink $filename] - } - set $varname [string range [file tail $filename] 5 end] - if { [lsearch -exact $ServerList [set $varname]] < 0 - || $nlinks == 20} { - set $varname SVGA - } - } - } - } else { - mesg $messages(phase1.5) okay - puts $tmp - exit 0 - } -} - -proc parray {a {pattern *}} { - upvar 1 $a array - if ![array exists array] { - error "\"$a\" isn't an array" - } - set maxl 0 - foreach name [lsort [array names array $pattern]] { - if {[string length $name] > $maxl} { - set maxl [string length $name] - } - } - set maxl [expr {$maxl + [string length $a] + 2}] - foreach name [lsort [array names array $pattern]] { - set nameString [format %s(%s) $a $name] - puts stdout [format "%-*s = %s" $maxl $nameString $array($name)] - } -} - -######### -puts "XF86Setup is not yet functional. Please use xf86config for now." -exit 0 - -set vlist [xf86config_readfile Cfg] -foreach arr [lsort [info vars Cfg*]] { - #parray $arr -} -xf86config_writefile test.cfg Cfg -#exit 0 - -if { !$NoCurses } { - if [info exists env(TERM)] { - if {[catch {curses init} retval]} { - puts [format $messages(phase1.27) $env(TERM)] - sleep 2 - set NoCurses 1 - } - } else { - puts $messages(phase1.28) - sleep 2 - set NoCurses 1 - } -} - -check_for_files $Xwinhome - -#set ConfigFile [xf86config_findfile] -set ConfigFile XF86Config -set StartServer 1 -set ReConfig 0 -set UseConfigFile 0 -set UseLoader 1 -if !$pc98 { - if { ![file exists $Xwinhome/bin/XF86_LOADER] } { - set UseLoader 0 - } -} else { - if { ![file exists $Xwinhome/bin/XF98_LOADER] } { - set UseLoader 0 - } -} -if { [string length $ConfigFile] > 0 } { - if [info exists env(DISPLAY)] { - set msg [format "%s\n \n%s\n \n%s" \ - [parafmt 65 $messages(phase1.6)] \ - [parafmt 65 $messages(phase1.7)] \ - $messages(phase1.8) ] - set ReConfig [mesg $msg yesno] - } - if { $ReConfig } { - set UseConfigFile 1 - set StartServer 0 - if { [getuid] != 0 } { - if { [mesg $messages(phase1.9) yesno] == 0 } { - exit 1 - } - } - } else { - if { [getuid] != 0 } { - mesg $messages(phase1.10) okay - exit 1 - } - if !$pc98 { - if { !$UseLoader && ![file exists $Xwinhome/bin/XF86_SVGA] } { - if !$NoTk { - mesg $messages(phase1.11) okay - set NoTk 1 - } - } - } else { - if { !$UseLoader && ![file exists $Xwinhome/bin/XF98_EGC] \ - && ![file exists $Xwinhome/bin/XF98_PEGC]} { - mesg $messages(phase1.12) okay - exit 1 - } - } - set UseConfigFile [mesg $messages(phase1.13) yesno] - } - # initialize the configuration variables - initconfig $Xwinhome - - set UseConfigFile 0 - if { $UseConfigFile } { - set_xf86config_defaults - } -} else { - set ConfigFile /etc/XF86Config - if { [getuid] != 0 } { - mesg $messages(phase1.14) okay - exit 1 - } - if !$pc98 { - if { !$ReConfig && !$UseLoader - && ![file exists $Xwinhome/bin/XF86_SVGA] } { - if !$NoTk { - mesg $messages(phase1.15) okay - set NoTk 1 - } - } - } else { - if { !$ReConfig && !$UseLoader - && ![file exists $Xwinhome/bin/XF98_EGC] - && ![file exists $Xwinhome/bin/XF98_PEGC] } { - mesg $messages(phase1.16) okay - exit 1 - } - } - # initialize the configuration variables - initconfig $Xwinhome -} - -set clicks2 [clock clicks] - -if { ![getuid] } { - if { !$UseConfigFile } { - # Check for the SysV Xqueue mouse driver - if { [file exists /etc/conf/pack.d/xque] - && [file exists /usr/lib/mousemgr] } { - set xque [mesg $messages(phase1.17) yesno] - if $xque { - set Keyboard(Protocol) Xqueue - set Pointer(Protocol) Xqueue - set Pointer(Device) "" - } - } - - # Check for the SCO OsMouse - if { [file exists /etc/conf/pack.d/cn/class.h] - && [file exists /etc/conf/pack.d/ev] } { - set osmse [mesg $messages(phase1.18) yesno] - if $osmse { - set Pointer(Protocol) OsMouse - set Pointer(Device) "" - } - } - } -} - -set PID [pid] -if { [info exists env(TMPDIR)] } { - set XF86SetupDir $env(TMPDIR)/.XF86Setup$PID -} else { - set XF86SetupDir /tmp/.XF86Setup$PID -} - - -if ![mkdir $XF86SetupDir 0700] { - mesg "$messages(phase1.19)$XF86SetupDir$messages(phase1.20)" okay - exit 1 -} - -set rand1 [random 1073741823] -random seed [expr $clicks2-$clicks1] -set rand2 [random 1073741823] - -set TmpDir $XF86SetupDir/[format "%x-%x" $rand1 $rand2] -if ![mkdir $TmpDir 0700] { - mesg "$messages(phase1.19)$TmpDir$messages(phase1.20)" okay - exit 1 -} -check_tmpdirs - -if { ![getuid] } { - if [string length $Pointer(Device)] { - if {[file exists $Pointer(Device)] - && [file type $Pointer(Device)] == "link" } { - set Pointer(RealDev) [readlink $Pointer(Device)] - set Pointer(OldLink) $Pointer(Device) - if ![string compare $Pointer(RealDev) "/dev/psaux"] { - set Pointer(Protocol) "PS/2" - } - } else { - set Pointer(RealDev) $Pointer(Device) - } - set Pointer(Device) $TmpDir/mouse - } - if [info exists Pointer(RealDev)] { - link $Pointer(RealDev) $Pointer(Device) - } -} - -set Confname $TmpDir/Config - -if $NoTk { set StartServer 0 } - -if $StartServer { - # write out a temp XF86Config file - if !$pc98 { - writeXF86Config $Confname-1 -vgamode -generic - } else { - writeXF86Config $Confname-1 -vgamode - } - - mesg $messages(phase1.23) okay - - if !$pc98 { - set ServerPID [start_server SVGA $Confname-1 ServerOut-1] - } else { - if !$pc98_EGC { - set ServerPID [start_server PEGC $Confname-1 ServerOut-1] -# if {$ServerPID == 0 || $ServerPID == -1} { -# puts "Unable to start PEGC server!\n\ -# try to start EGC server.\n"; -# set pc98_EGC 1; -# } - } else { - set ServerPID [start_server EGC $Confname-1 ServerOut-1] - } - } - - if { $ServerPID == 0 } { - mesg $messages(phase1.24) info - set NoTk 1 - } - if { $ServerPID == -1 } { - mesg $messages(phase1.25) info - exit 1 - } -} else { - if !$NoTk { - mesg $messages(phase1.26) info - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl:3.16 xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl:3.16 Mon Apr 5 03:13:00 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl Sat Feb 28 21:42:23 2004 @@ -1,219 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl,v 3.16 1999/04/05 07:13:00 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: phase2.tcl /main/2 1996/10/25 10:21:29 kaleb $ - -# -# Phase II - Commands run after connection is made to VGA16 server -# - -set_resource_defaults - -wm withdraw . - -create_main_window [set w .xf86setup] - -# put up a message ASAP so the user knows we're still alive -label $w.waitmsg -text $messages(phase2.1) -pack $w.waitmsg -expand yes -fill both -update idletasks - -if $StartServer { - mesg $messages(phase2.14) info -} - -if { [catch {set XKBhandle [xkb_read from_server]} res] } { - $w.waitmsg configure -text $messages(phase2.2) - update idletasks - after 10000 - set XKBavailable 0 - set retval "" -} else { - set XKBavailable 1 - set retval [xkb_listrules $XKBrules] -} - -if { [llength $retval] < 4 } { - Kbd_setxkbcomponents -} else { - set XKBComponents(models,names) [lindex $retval 0] - set XKBComponents(models,descriptions) [lindex $retval 1] - set XKBComponents(layouts,names) [lindex $retval 2] - set XKBComponents(layouts,descriptions) [lindex $retval 3] - set XKBComponents(variants,names) [lindex $retval 4] - set XKBComponents(variants,descriptions) [lindex $retval 5] - set XKBComponents(options,names) [lindex $retval 6] - set XKBComponents(options,descriptions) [lindex $retval 7] -} - -# Setup the default bindings for the various widgets -source $tcl_library/tk.tcl - -source $XF86Setup_library/mseproto.tcl -source $XF86Setup_library/mouse.tcl -source $XF86Setup_library/keyboard.tcl -source $XF86Setup_library/card.tcl -source $XF86Setup_library/monitor.tcl -source $XF86Setup_library/srvflags.tcl -source $XF86Setup_library/done.tcl -source $XF86Setup_library/modeselect.tcl - -proc Intro_create_widgets { win } { - global XF86Setup_library - global pc98_EGC pc98 messages - - set w [winpathprefix $win] - if !$pc98_EGC { - frame $w.intro -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.intro -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - image create bitmap XFree86-logo \ - -foreground black -background cyan \ - -file $XF86Setup_library/pics/XFree86.xbm \ - -maskfile $XF86Setup_library/pics/XFree86.msk - label $w.intro.logo -image XFree86-logo - pack $w.intro.logo - - frame $w.intro.textframe - text $w.intro.textframe.text - $w.intro.textframe.text tag configure heading \ - -justify center -foreground yellow \ - -font -adobe-times-bold-i-normal--24-240-*-*-p-*-iso8859-1 - make_intro_headline $w.intro.textframe.text - $w.intro.textframe.text insert end $messages(phase2.12) - if !$pc98_EGC { - pack $w.intro.textframe.text -fill both -expand yes - pack $w.intro.textframe -fill both -expand yes -padx 10 -pady 10 - } else { - scrollbar $w.intro.textframe.scroll \ - -command "$w.intro.textframe.text yview" - bind $w.intro \ - "$w.intro.textframe.text yview scroll -1 unit;break;" - bind $w.intro \ - "$w.intro.textframe.text yview scroll 1 unit;break;" - - $w.intro.textframe.text configure \ - -yscrollcommand "$w.intro.textframe.scroll set" - pack $w.intro.textframe.scroll -side right -fill y - pack $w.intro.textframe.text -fill both -expand yes -side right - pack $w.intro.textframe -fill both -expand yes -padx 10 -pady 10 - } - $w.intro.textframe.text configure -state disabled -} - -proc Intro_activate { win } { - set w [winpathprefix $win] - pack $w.intro -side top -fill both -expand yes -} - -proc Intro_deactivate { win } { - set w [winpathprefix $win] - pack forget $w.intro -} - -proc config_select { win } { - global CfgSelection prevSelection - - set w [winpathprefix $win] - $win configure -cursor watch - ${prevSelection}_deactivate $win - set prevSelection $CfgSelection - ${CfgSelection}_activate $w - $win configure -cursor top_left_arrow -} - -proc config_help { win } { - global CfgSelection - - set w [winpathprefix $win] - ${CfgSelection}_popup_help $win -} - -frame $w.menu -width 640 - -radiobutton $w.menu.mouse -text $messages(phase2.3) -indicatoron false \ - -variable CfgSelection -value Mouse -underline 0 \ - -command [list config_select $w] -radiobutton $w.menu.keyboard -text $messages(phase2.4) -indicatoron false \ - -variable CfgSelection -value Keyboard -underline 0 \ - -command [list config_select $w] -radiobutton $w.menu.card -text $messages(phase2.5) -indicatoron false \ - -variable CfgSelection -value Card -underline 0 \ - -command [list config_select $w] -radiobutton $w.menu.monitor -text $messages(phase2.6) -indicatoron false \ - -variable CfgSelection -value Monitor -underline 2 \ - -command [list config_select $w] -radiobutton $w.menu.modeselect -text $messages(phase2.7) -indicatoron false \ - -variable CfgSelection -value Modeselection -underline 4 \ - -command [list config_select $w] -radiobutton $w.menu.other -text $messages(phase2.8) -indicatoron false \ - -variable CfgSelection -value Other -underline 0 \ - -command [list config_select $w] -if !$pc98 { - pack $w.menu.mouse $w.menu.keyboard $w.menu.card \ - $w.menu.monitor $w.menu.modeselect $w.menu.other \ - -side left -fill both -expand yes -} else { - pack $w.menu.mouse $w.menu.card $w.menu.monitor \ - $w.menu.modeselect $w.menu.other \ - -side left -fill both -expand yes -} - -frame $w.buttons -#label $w.buttons.xlogo -bitmap @/usr/X11R6/include/X11/bitmaps/xlogo16 -anchor w -#label $w.buttons.xlogo -bitmap @/usr/tmp/xfset1.xbm -anchor w \ - -foreground black -#pack $w.buttons.xlogo -side left -anchor w -expand no -padx 0 -fill x -button $w.buttons.abort -text $messages(phase2.9) -underline 0 \ - -command "clear_scrn;puts stderr Aborted;shutdown 1" -button $w.buttons.done -text $messages(phase2.10) -underline 0 \ - -command [list Done_execute $w] -button $w.buttons.help -text $messages(phase2.11) -underline 0 \ - -command [list config_help $w] -pack $w.buttons.abort $w.buttons.done $w.buttons.help \ - -expand no -side left -padx 50 - -Intro_create_widgets $w -if !$pc98 { - Keyboard_create_widgets $w -} -Mouse_create_widgets $w -Card_create_widgets $w -Monitor_create_widgets $w -Modeselect_create_widgets $w -Other_create_widgets $w -Done_create_widgets $w - -proc ac_bind { win letter command } { - bind $win $command - bind $win $command -} - -bind $w [list I'm an error] -ac_bind $w a [list $w.buttons.abort invoke] -ac_bind $w d [list $w.buttons.done invoke] -ac_bind $w h [list config_help $w] -bind $w ? [list config_help $w] -ac_bind $w m [list $w.menu.mouse invoke] -ac_bind $w c [list $w.menu.card invoke] -ac_bind $w k [list $w.menu.keyboard invoke] -ac_bind $w n [list $w.menu.monitor invoke] -ac_bind $w s [list $w.menu.modeselect invoke] -ac_bind $w o [list $w.menu.other invoke] -set_default_arrow_bindings - -set CfgSelection Intro -set prevSelection Intro -destroy $w.waitmsg -pack $w.menu -side top -fill x -pack $w.buttons -side bottom -expand no -config_select $w -focus $w.menu.mouse - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl:3.5 xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl:3.5 Sun Apr 5 12:15:51 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl Sat Feb 28 21:42:23 2004 @@ -1,75 +0,0 @@ -# $XConsortium: phase3.tcl /main/1 1996/09/21 14:17:37 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl,v 3.5 1998/04/05 16:15:51 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Phase III - Commands run after switching back to text mode -# - responsible for starting second server -# - -source $tcl_library/init.tcl -source $XF86Setup_library/texts/local_text.tcl -source $XF86Setup_library/setuplib.tcl -source $XF86Setup_library/carddata.tcl -source $XF86Setup_library/mondata.tcl -source $StateFileName - -mesg $messages(phase3.1) info -sleep 2 -writeXF86Config $Confname-2 -defaultmodes - -set devid [lindex $DeviceIDs 0] -global Device_$devid -set server [set Device_${devid}(Server)] - -set ServerPID [start_server $server $Confname-2 ServerOut-2 ] - -if { $ServerPID == -1 } { - set msg $messages(phase3.2) -} - -if { $ServerPID == 0 } { - set msg $messages(phase3.3) -} - -if { $ServerPID < 1 } { - mesg "$msg$messages(phase3.4)" okey - set Phase2FallBack 1 - set ServerPID [start_server $server $Confname-1 ServerOut-1Bis] - if { $ServerPID < 1 } { - mesg $messages(phase3.5) info - exit 1 - } -} - -if { ![string length [set Device_${devid}(ClockChip)]] } { - set fd [open $TmpDir/ServerOut-2 r] - set clockrates "" - set zerocount 0 - while {[gets $fd line] >= 0} { - if {[regexp {\(.*: clocks: (.*)$} $line dummy clocks]} { - set clocks [string trim [squash_white $clocks]] - foreach clock [split $clocks] { - lappend clockrates $clock - if { $clock < 0.1 } { - incr zerocount - } - } - } - } - close $fd - set clockcount [llength $clockrates] - if { $clockcount != 0 && 1.0*$zerocount/$clockcount < 0.25 } { - set Device_${devid}(Clocks) $clockrates - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl:3.11 xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl:3.11 Mon Apr 5 03:13:01 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl Sat Feb 28 21:42:23 2004 @@ -1,111 +0,0 @@ -# $XConsortium: phase4.tcl /main/1 1996/09/21 14:17:41 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase4.tcl,v 3.11 1999/04/05 07:13:01 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Phase IV - Commands run after second server is started -# - -source $XF86Setup_library/texts/local_text.tcl -source $XF86Setup_library/vidmode.tcl - -if $StartServer { - set_resource_defaults - - wm withdraw . - - create_main_window [set w .xf86setup] - - # put up a message ASAP so the user knows we're still alive - label $w.waitmsg -text $messages(phase4.1) - pack $w.waitmsg -expand yes -fill both - update idletasks - - mesg "The program is running on a different virtual terminal\n\n\ - Please switch to the correct virtual terminal" info - - source $tk_library/tk.tcl - set_default_arrow_bindings - set msg $messages(phase4.13) -} else { - set msg "" -} - -proc Phase4_adj_modes { win } { - global Xwinhome - - VidMode_activate $win -} - -proc Phase4_nextphase { win } { - global Confname StartServer messages - - set w [winpathprefix $win] - set saveto [$w.saveto.entry get] - check_tmpdirs - writeXF86Config $Confname-3 -displayof $w -realdevice - set backupmsg "" - make_message_phase4 $saveto - if [file exists $saveto] { - if {[catch {exec mv $saveto $saveto.bak} ret] != 0} { - bell - $w.mesg configure -text $messages(phase4.2) - return - } - set backupmsg $messages(phase4.3) - } - if {[catch {exec cp $Confname-3 $saveto} ret] != 0} { - bell - $w.mesg configure -text $messages(phase4.4) - return - } - $w.text configure -text $messages(phase4.5) - pack forget $w.buttons $w.mesg $w.saveto - if $StartServer { - set cmd {mesg $messages(phase4.14) info; shutdown} - } else { - set cmd {shutdown;source $XF86Setup_library/phase5.tcl} - } - button $w.okay -text $messages(phase4.6) -command $cmd - pack $w.text $w.okay -side top - focus $w.okay -} - -label $w.text -text " $msg$messages(phase4.7)" -frame $w.saveto -label $w.saveto.title -text $messages(phase4.8) -entry $w.saveto.entry -bd 2 -width 40 -pack $w.saveto.title $w.saveto.entry -side left -if [getuid] { - if [info exists env(HOME)] { - $w.saveto.entry insert end $env(HOME)/XF86Config - } else { - $w.saveto.entry insert end /tmp/XF86Config.$PID - } -} else { - $w.saveto.entry insert end $ConfigFile -} -label $w.mesg -text "" -frame $w.buttons -button $w.buttons.xvidtune -text $messages(phase4.9) \ - -command [list Phase4_adj_modes $w] -button $w.buttons.save -text $messages(phase4.10) \ - -command [list Phase4_nextphase $w] -button $w.buttons.abort -text $messages(phase4.11) \ - -command "clear_scrn;puts stderr $messages(phase4.12);shutdown 1" -pack $w.buttons.xvidtune $w.buttons.save $w.buttons.abort -side top \ - -pady 5m -fill x - -catch {destroy $w.waitmsg} -pack $w.text $w.saveto $w.buttons $w.mesg -side top -pady 8m -focus $w.buttons.save - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl:3.11 xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl:3.11 Sun Apr 5 12:15:52 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl Sat Feb 28 21:42:23 2004 @@ -1,91 +0,0 @@ -# $XConsortium: phase5.tcl /main/4 1996/10/28 05:42:32 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl,v 3.11 1998/04/05 16:15:52 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Phase V - Final commands after return to text mode -# - -check_tmpdirs -clear_scrn -foreach fname [glob -nocomplain $TmpDir/*] { - unlink $fname -} -rmdir $TmpDir -rmdir $XF86SetupDir - -if { ![getuid] } { - set idx -1 - if { [llength $DeviceIDs] == 1 } { - set idx 0 - } else { - if [string length $Scrn_Accel(Device)] { - set idx [lsearch $DeviceIDs $Scrn_Accel(Device)] - } else { - set idx [lsearch $DeviceIDs $Scrn_SVGA(Device)] - } - } - if { $idx >= 0 } { - set devid [lindex $DeviceIDs $idx] - global Device_$devid - set server [set Device_${devid}(Server)] - set linkname $Xwinhome/bin/X - set lastlink $linkname - for {set nlinks 0} \ - {[file exists $linkname] && [file type $linkname]=="link" \ - && $nlinks<20} \ - {incr nlinks} { - set lastlink $linkname - set linkname [readlink $linkname] - } - catch { - if { [file type $linkname]=="link" && ![file exists $linkname] } { - set lastlink [readlink $linkname] - } - } - if { [file type $linkname]=="link" && ![file exists $linkname] } { - set lastlink [readlink $linkname] - } - - if { $nlinks < 20 } { - set servname [string range [file tail $linkname] 5 end] - if ![string compare $servname $server] { - unset linkname - } - } else { - set linkname $Xwinhome/bin/X - } - } - if [info exists linkname] { - set linkdir [file dirname $lastlink] - set mklink [mesg \ - "$messages(phase5.1)$server$messages(phase5.2)\ - $linkdir$messages(phase5.3)" yesno] - if $mklink { - set CWD [pwd] - cd $linkdir - catch "unlink X" ret - if [catch "link $Xwinhome/bin/XF86_$server X" ret] { - mesg $messages(phase5.4) okay - } else { - mesg $messages(phase5.5) okay - } - cd $CWD - } - } -} - -clear_scrn -puts $messages(phase5.6) - -exit 0 - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl:3.23 xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl:3.23 Mon Apr 5 03:13:01 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl Sat Feb 28 21:42:23 2004 @@ -1,805 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/setuplib.tcl,v 3.23 1999/04/05 07:13:01 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# -# $XConsortium: setuplib.tcl /main/3 1996/10/25 10:21:33 kaleb $ - -# -# Library of routines used by XF86Setup -# - -# Initialize all the variables that hold configuration info - -proc initconfig {xwinhome} { - global Files ServerFlags Module Keyboard Pointer - global "Monitor_Primary Monitor" "Device_Primary Card" - global DeviceIDs MonitorIDs - global Scrn_Accel Scrn_Mono Scrn_VGA2 Scrn_VGA16 Scrn_SVGA - global pc98 pc98_EGC - - set fontdir "$xwinhome/lib/X11/fonts" - set Files(FontPath) [list $fontdir/misc:unscaled \ - $fontdir/75dpi:unscaled $fontdir/100dpi:unscaled \ - $fontdir/Type1 $fontdir/Speedo \ - $fontdir/misc $fontdir/75dpi $fontdir/100dpi ] - set Files(RGBPath) $xwinhome/lib/X11/rgb - set Files(ModulePath) "" - set Files(LogFile) "" - - - if !$pc98 { - set Module(Load) vga - } else { - if !$pc98_EGC { - set Module(Load) pegc - } else { - set Module(Load) egc - } - } - - set ServerFlags(NoTrapSignals) "" - set ServerFlags(DontZap) "" - set ServerFlags(DontZoom) "" - set ServerFlags(DisableVidModeExtension) "" - set ServerFlags(AllowNonLocalXvidtune) "" - set ServerFlags(DisableModInDev) "" - set ServerFlags(AllowNonLocalModInDev) "" - - set Keyboard(Protocol) Standard - set Keyboard(ServerNumLock) "" - foreach key { AutoRepeat LeftAlt RightAlt ScrollLock - RightCtl XLeds VTSysReq VTInit - XkbKeycodes XkbTypes XkbCompat - XkbSymbols XkbGeometry XkbKeymap - Panix106 } { - set Keyboard($key) "" - } - if !$pc98 { - set Keyboard(XkbDisable) "" - set Keyboard(XkbRules) xfree86 - set Keyboard(XkbModel) pc101 - set Keyboard(XkbLayout) us - set Keyboard(XkbVariant) "" - set Keyboard(XkbOptions) "" - set Pointer(Protocol) Microsoft - set Pointer(Emulate3Buttons) "" - } else { - set Keyboard(XkbDisable) "" - set Keyboard(XkbRules) xfree98 - set Keyboard(XkbModel) pc98 - set Keyboard(XkbLayout) nec/jp - set Keyboard(XkbVariant) "" - set Keyboard(XkbOptions) "" - set Pointer(Protocol) BusMouse - set Pointer(Emulate3Buttons) 1 - } - -# set Pointer(Device) /dev/mouse - set Pointer(Device) "" - set Pointer(BaudRate) "" - set Pointer(Emulate3Timeout) "" - set Pointer(ChordMiddle) "" - set Pointer(SampleRate) "" - set Pointer(Resolution) "" - set Pointer(Buttons) "" - set Pointer(ClearDTR) "" - set Pointer(ClearRTS) "" - set Pointer(AlwaysCore) "" - - if !$pc98_EGC { - set id "Primary Monitor" - set Monitor_${id}(VendorName) Unknown - set Monitor_${id}(ModelName) Unknown - set Monitor_${id}(HorizSync) 31.5 - set Monitor_${id}(VertRefresh) 60 - set Monitor_${id}(Gamma) "" - set MonitorIDs [list $id] - } else { - set id "Primary Monitor" - set Monitor_${id}(VendorName) Unknown - set Monitor_${id}(ModelName) Unknown - set Monitor_${id}(HorizSync) 24.8 - set Monitor_${id}(VertRefresh) 56.4 - set Monitor_${id}(Gamma) "" - set MonitorIDs [list $id] - } - set id "Primary Card" - set Device_${id}(VendorName) Unknown - set Device_${id}(BoardName) Unknown - if !$pc98 { - set Device_${id}(Server) SVGA - } else { - if !$pc98_EGC { - set Device_${id}(Server) PEGC - } else { - set Device_${id}(Server) EGC - } - set uname [exec uname] - if {$uname == {FreeBSD}} { - set Pointer(Device) /dev/mse0 - } elseif {$uname == {NetBSD}} { - set Pointer(Device) /dev/lms0 - } - } - foreach key {Chipset Ramdac DacSpeed Clocks ClockChip - ClockProg Options VideoRam BIOSBase Membase - IOBase DACBase POSBase COPBase VGABase - Instance Speedup S3MNAdjust S3MClk S3RefClock - ExtraLines} { - set Device_${id}($key) "" - } - set DeviceIDs [list $id] - - set Scrn_Accel(Driver) "Accel" - set Scrn_Accel(Device) "Primary Card" - set Scrn_Accel(Monitor) "Primary Monitor" - set Scrn_Accel(ScreenNo) "" - set Scrn_Accel(BlankTime) "" - set Scrn_Accel(StandbyTime) "" - set Scrn_Accel(SuspendTime) "" - set Scrn_Accel(OffTime) "" - set Scrn_Accel(DefaultColorDepth) "" - - if !$pc98 { - array set Scrn_Mono [array get Scrn_Accel] - array set Scrn_VGA2 [array get Scrn_Accel] - } - array set Scrn_VGA16 [array get Scrn_Accel] - array set Scrn_SVGA [array get Scrn_Accel] - - if !$pc98 { - set Scrn_Mono(Driver) "Mono" - set Scrn_VGA2(Driver) "VGA2" - } - set Scrn_SVGA(Driver) "SVGA" - set Scrn_VGA16(Driver) "VGA16" - - if !$pc98 { - set Scrn_Mono(Depth,1) 1 - set Scrn_VGA2(Depth,1) 1 - } - set Scrn_VGA16(Depth,4) 4 - - foreach depth {4 8 15 16 24 32} { - set Scrn_SVGA(Depth,$depth) $depth - set Scrn_Accel(Depth,$depth) $depth - } -} - - -# Write a XF86Config file to the given fd - -proc writeXF86Config {filename args} { - global Files Module ServerFlags Keyboard Pointer UseLoader - global MonitorIDs DeviceIDs MonitorStdModes SelectedMonitorModes - global Scrn_Accel Scrn_Mono Scrn_VGA2 Scrn_VGA16 Scrn_SVGA - global pc98 pc98_EGC haveSelectedModes DefaultColorDepth - - set generic_vga [ expr {[lsearch -exact $args -generic] >= 0} ] - #puts stderr "generic_vga = $generic_vga" - check_tmpdirs - set fd [open $filename w] - puts $fd "# XF86Config auto-generated by XF86Setup" - puts $fd "#" - puts $fd "# Copyright (c) 1996 by The XFree86 Project, Inc.\n" - puts $fd "#" - puts $fd "# Permission is hereby granted, free of charge, to any person obtaining a" - puts $fd {# copy of this software and associated documentation files (the "Software"),} - puts $fd "# to deal in the Software without restriction, including without limitation" - puts $fd "# the rights to use, copy, modify, merge, publish, distribute, sublicense," - puts $fd "# and/or sell copies of the Software, and to permit persons to whom the" - puts $fd "# Software is furnished to do so, subject to the following conditions:" - puts $fd "#" - puts $fd "# The above copyright notice and this permission notice shall be included in" - puts $fd "# all copies or substantial portions of the Software." - puts $fd "#" - puts $fd {# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR} - puts $fd "# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," - puts $fd "# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL" - puts $fd "# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY," - puts $fd "# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF" - puts $fd "# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" - puts $fd "# SOFTWARE." - puts $fd "#" - puts $fd "# Except as contained in this notice, the name of the XFree86 Project shall" - puts $fd "# not be used in advertising or otherwise to promote the sale, use or other" - puts $fd "# dealings in this Software without prior written authorization from the" - puts $fd "# XFree86 Project." - puts $fd "#" - puts $fd "" - puts $fd "# See 'man XF86Config' for info on the format of this file" - - puts $fd "" - puts $fd {Section "Files"} - puts $fd " RgbPath \"$Files(RGBPath)\"" - foreach path $Files(FontPath) { - puts $fd " FontPath \"$path\"" - } - puts $fd "EndSection" - - if { $UseLoader && ($generic_vga || [llength $Module(Load)]) } { - puts $fd "" - puts $fd {Section "Module"} - if $generic_vga { - if !$pc98 { - puts $fd { Load "vga"} - } else { - if !$pc98_EGC { - puts $fd { Load "pegc"} - } else { - puts $fd { Load "egc"} - } - } - } else { - foreach module $Module(Load) { - puts $fd " Load \"$module\"" - } - } - puts $fd { Load "extmod"} - puts $fd "EndSection" - } - - puts $fd "" - puts $fd {Section "ServerFlags"} - foreach key {NoTrapSignals DontZap DontZoom} { - if { [string length $ServerFlags($key)] } { - puts " $ServerFlags($key)" - } - } - puts $fd "EndSection" - - puts $fd "" - puts $fd {Section "Keyboard"} - puts $fd " Protocol \"$Keyboard(Protocol)\"" - set xkbvars "" - foreach key [array names Keyboard {Xkb[ABCE-Z]*}] { - append xkbvars $Keyboard($key) - } - if { ![string length $xkbvars] - && [string length $Keyboard(ServerNumLock)] } { - puts $fd " ServerNumLock" - } - foreach key { AutoRepeat LeftAlt RightAlt ScrollLock RightCtl XLeds } { - if { [string length $Keyboard($key)] } { - puts $fd [format " %-15s %s" $key $Keyboard($key)] - } - } - foreach key { XkbKeycodes XkbTypes XkbCompat - XkbSymbols XkbGeometry XkbKeymap - XkbRules XkbModel XkbLayout XkbVariant XkbOptions} { - if { [string length $Keyboard($key)] } { - puts $fd [format " %-15s \"%s\"" \ - $key $Keyboard($key)] - } - } - #if { [string length $Keyboard(XkbDisable)] } { - # puts $fd " XkbDisable" - #} - if { [string length $Keyboard(VTInit)] } { - puts $fd " VTInit \"$Keyboard(VTInit)\"" - } - if { [string length $Keyboard(VTSysReq)] } { - puts $fd " VTSysReq" - } - puts $fd "EndSection" - - puts $fd "" - puts $fd {Section "Pointer"} - puts $fd " Protocol \"$Pointer(Protocol)\"" - if { [lsearch -exact $args -realdevice] >= 0 - && [info exists Pointer(RealDev)] } { - set realdev $Pointer(RealDev) - } else { - set realdev "" - } - if { [string length $realdev] } { - if {[info exists Pointer(OldLink)] - && ![string compare [readlink $Pointer(OldLink)] $realdev]} { - puts $fd " Device \"$Pointer(OldLink)\"" - } else { - puts $fd " Device \"$realdev\"" - } - } elseif { [string length $Pointer(Device)] } { - puts $fd " Device \"$Pointer(Device)\"" - } - foreach key {BaudRate Emulate3Timeout SampleRate Resolution Buttons} { - if { [string length $Pointer($key)] && $Pointer($key) } { - puts $fd [format " %-15s %s" $key $Pointer($key)] - } - } - foreach key {Emulate3Buttons ChordMiddle ClearDTR ClearRTS} { - if { [string length $Pointer($key)] } { - puts $fd " $key" - } - } - puts $fd "EndSection" - - set modeNames "" - foreach id $MonitorIDs { - global Monitor_$id - puts $fd "" - puts $fd {Section "Monitor"} - puts $fd " Identifier \"$id\"" - if { [string length [set Monitor_${id}(VendorName)]] } { - puts $fd " VendorName \"[set Monitor_${id}(VendorName)]\"" - } - if { [string length [set Monitor_${id}(ModelName)]] } { - puts $fd " ModelName \"[set Monitor_${id}(ModelName)]\"" - } - puts $fd " HorizSync [set Monitor_${id}(HorizSync)]" - puts $fd " VertRefresh [set Monitor_${id}(VertRefresh)]" - if { [string length [set Monitor_${id}(Gamma)]] } { - puts $fd " Gamma [set Monitor_${id}(Gamma)]" - } - set modepattern "None" - if { [lsearch -exact $args -vgamode] >= 0 } { - if !$pc98_EGC { - set modepattern " 640x480*" - } else { - set modepattern " 640x400*" - } - } - if { [lsearch -exact $args -defaultmodes] >= 0 } { - set modepattern "*" - } - if { [string compare None $modepattern] != 0} { - if { $haveSelectedModes <= 0 } { -# puts stderr "No selected modes" - foreach desc [lsort -decreasing \ - [array names MonitorStdModes $modepattern]] { - set modeline $MonitorStdModes($desc) - puts $fd "# $desc" - set id [format "%dx%d" \ - [lindex $modeline 1] [lindex $modeline 5]] - puts $fd [format " Modeline %-11s %s" \ - "\"$id\"" $modeline] - lappend modeNames $id - } - } else { - foreach desc [lsort -decreasing \ - [array names SelectedMonitorModes $modepattern]] { - set modeline $SelectedMonitorModes($desc) - if ![string match \#removed $modeline] { - puts $fd "# $desc" - set id [format "%dx%d" \ - [lindex $modeline 1] [lindex $modeline 5]] - puts $fd [format " Modeline %-11s %s" \ - "\"$id\"" $modeline] - lappend modeNames $id - } - } - } - } else { - set dispof [lsearch -exact $args -displayof] - if { $dispof >= 0 } { - set dispwin [lindex $args [expr $dispof+1]] - set modelist [xf86vid_getallmodelines \ - -displayof $dispwin] - - } else { - set modelist [xf86vid_getallmodelines] - } - foreach modeline $modelist { - set id [format "%dx%d" \ - [lindex $modeline 1] [lindex $modeline 5]] - puts $fd [format " Modeline %-11s %s" \ - "\"$id\"" $modeline] - lappend modeNames $id - } - } - puts $fd "EndSection" - } - - set modesList [lrmdups -decreasing -command mode_compare $modeNames] - - foreach id $DeviceIDs { - global Device_$id - puts $fd "" - puts $fd {Section "Device"} - puts $fd " Identifier \"$id\"" - foreach key {VendorName BoardName Ramdac Speedup} { - if { [string length [set Device_${id}($key)]] } { - puts $fd [format " %-15s \"%s\"" \ - $key [set Device_${id}($key)] ] - } - } - if { !$generic_vga } { - set chipset [set Device_${id}(Chipset)] - if { [string length $chipset] } { - puts $fd " Chipset \"$chipset\"" - } - } else { - puts $fd " Chipset \"generic\"" - } - foreach opt [set Device_${id}(Options)] { - puts $fd " Option \"$opt\"" - } - if { [lsearch -exact $args -noclocks] < 0 } { - set clockchip [set Device_${id}(ClockChip)] - if { [string length $clockchip] } { - puts $fd " ClockChip \"$clockchip\"" - } - set clocks [set Device_${id}(Clocks)] - if { [string length $clocks] } { - puts $fd " Clocks $clocks" - } - set clockprog [set Device_${id}(ClockProg)] - if { [string length $clockprog] } { - puts $fd " ClockProg $clockprog" - } - } - foreach key {DacSpeed VideoRam BIOSBase Membase IOBase - DACBase POSBase COPBase VGABase Instance - S3MNAdjust S3MClk S3RefClock} { - if { [string length [set Device_${id}($key)]] } { - puts $fd [format " %-15s %s" \ - $key [set Device_${id}($key)] ] - } - } - if { [string length [set Device_${id}(ExtraLines)]] } { - puts $fd [set Device_${id}(ExtraLines)] - } - puts $fd "EndSection" - } - - foreach drvr {Accel SVGA VGA16 VGA2 Mono} { - - if $pc98 { - if {![string compare $drvr "Mono"] || \ - ![string compare $drvr "VGA2"]} \ - continue - } - if { [string compare $drvr [set Scrn_${drvr}(Driver)]] } \ - continue - puts $fd "" - puts $fd {Section "Screen"} - puts $fd " Driver \"$drvr\"" - puts $fd " Device \"[set Scrn_${drvr}(Device)]\"" - puts $fd " Monitor \"[set Scrn_${drvr}(Monitor)]\"" - if { ![string compare $drvr "Accel"] || - ![string compare $drvr "SVGA"] } { - puts $fd " DefaultColorDepth $DefaultColorDepth" - } - foreach key {ScreenNo BlankTime StandbyTime SuspendTime - OffTime } { - if { [string length [set Scrn_${drvr}($key)]] } { - puts $fd [format " %-15s %s" \ - $key [set Scrn_${drvr}($key)] ] - } - } - foreach depth {1 4 8 15 16 24 32} { - if [info exists Scrn_${drvr}(Depth,$depth)] { - puts $fd { SubSection "Display"} - puts $fd " Depth $depth" - puts -nonewline $fd " Modes " - foreach mode $modesList { - puts -nonewline $fd " \"$mode\"" - } - puts $fd "" - if [info exists Scrn_${drvr}(Visual,$depth)] { - puts $fd [format " Visual \"%s\"" \ - [set Scrn_${drvr}(Visual,$depth)] ] - } - if { [lsearch -exact $args -vgamode] < 0 } { - if [info exists Scrn_${drvr}(Virtual,$depth)] { - puts $fd [format " Virtual %s" \ - [set Scrn_${drvr}(Virtual,$depth)] ] - } - } - foreach key {ViewPort White Black Weight - InvertVCLK EarlySC BlankDelay} { - if [info exists Scrn_${drvr}($key,$depth)] { - puts $fd [format " %-12s %s" \ - $key [set Scrn_${drvr}($key,$depth)] ] - } - } - puts $fd " EndSubSection" - } - } - puts $fd "EndSection" - } - close $fd -} - - -# compare two mode names of the form 0000x000 -# horizontal width is compared first, then height -proc mode_compare { itemA itemB } { - set Alist [split $itemA x] - set Blist [split $itemB x] - if { [lindex $Alist 0] == [lindex $Blist 0] } { - return [expr [lindex $Alist 1] - [lindex $Blist 1]] - } - return [expr [lindex $Alist 0] - [lindex $Blist 0]] -} - -proc set_resource_defaults {} { - # Colors chosen to work with the VGA16 server - option add *background grey - option add *foreground blue - option add *selectColor cyan - option add *selectForeground black - option add *disabledForeground "" ;# stippled - option add *highlightBackground grey - option add *font fixed - option add *Frame.highlightThickness 0 - option add *Listbox.exportSelection no -} - -proc create_main_window { w } { - toplevel $w - global pc98_EGC - - if !$pc98_EGC { - $w configure -height 480 -width 640 -highlightthickness 0 - } else { - $w configure -height 400 -width 640 -highlightthickness 0 - } - pack propagate $w no - wm geometry $w +0+0 - if !$pc98_EGC { - #wm minsize $w 640 480 - } else { - #wm minsize $w 640 400 - } -} - -proc set_default_arrow_bindings { } { - foreach class {Button Checkbutton Radiobutton Entry} { - bind $class {focus [findfocuswindow %W y 15]} - bind $class {focus [findfocuswindow %W x 15]} - bind $class {focus [findfocuswindow %W y -15]} - bind $class {focus [findfocuswindow %W x -15]} - } -} - -proc start_server { server configfile outfile } { - global env TmpDir Xwinhome serverNumber UseLoader pc98 - - if { ![info exists serverNumber] } { - set serverNumber 7 - } else { - incr serverNumber - } - set env(DISPLAY) [set disp :$serverNumber] - - if !$pc98 { - if { $UseLoader } { - if { ![string compare $server VGA16] } { - set pid [exec $Xwinhome/bin/XF86_LOADER $disp -bpp 4 \ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } else { - set pid [exec $Xwinhome/bin/XF86_LOADER $disp \ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } - } else { - set pid [exec $Xwinhome/bin/XF86_$server $disp \ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } - } else { - if { $UseLoader } { - if { ![string compare $server EGC] } { - set pid [exec $Xwinhome/bin/XF98_LOADER $disp -bpp 4\ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } else { - set pid [exec $Xwinhome/bin/XF98_LOADER $disp\ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } - } else { - if { ![string compare $server EGC] } { - set pid [exec $Xwinhome/bin/XF98_$server $disp -bpp 4 \ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } else { - set pid [exec $Xwinhome/bin/XF98_$server $disp \ - -allowMouseOpenFail -xf86config $configfile \ - -bestRefresh >& $TmpDir/$outfile & ] - } - } - } - - sleep 9 - set trycount 0 - while { [incr trycount] < 10 } { - if ![process_running $pid] { - return 0 - } - sleep 2 - if [server_running $disp] { - return $pid - } - } - return -1 -} - -proc clear_scrn {} { - global NoCurses - - if { $NoCurses } { - set blank \n\n\n\n\n - puts $blank$blank$blank$blank$blank - flush stdout - } else { - #catch {exec $Dialog --clear >&@stdout} ret - } -} - -proc mesg { text {buttontype okay} {title ""} } { - global NoCurses message messages - - if { $NoCurses } { - puts -nonewline $text - flush stdout - if { [string compare $buttontype yesno] == 0 } { - puts -nonewline " " - flush stdout - gets stdin response - return [string match {[yY]} [string index $response 0]] - } - if { [string compare $buttontype okay] == 0 } { - puts -nonewline $messages(setuplib.1) - flush stdout - gets stdin response - } - return - } - # else - set textlist [split $text \n] - set height [expr [llength $textlist]+2] - if { [string compare $buttontype info] != 0 } { - incr height 2 - } - set width 0 - foreach line $textlist { - if { [string length $line] > $width } { - set width [string length $line] - } - } - incr width 6 - set minwidth 12 - set scrninfo [stdscr info] - set scrnht [lindex $scrninfo 1] - set scrnwid [lindex $scrninfo 0] - switch -- $buttontype { - yesno { - set buttons "Yes No" - if [info exists message] { - append buttons " Help" - } - incr width 2 - set minwidth 25 - } - okay { - set buttons "Okay Cancel" - if [info exists message] { - append buttons " help" - } - } - okayonly { set buttons "Okay" } - default { set buttons "" } - } - if { $width < $minwidth } { - set width $minwidth - } - if { $width > [expr $scrnwid - 2] } { - set width [expr $scrnwid - 2] - } - if { $height > [expr $scrnht] } { - set height $scrnht - } - set begx [expr ($scrnwid - $width)/2] - set begy [expr ($scrnht - $height)/2] - set mesgwin mesgwin[info level] - curses newwin $mesgwin $height $width $begy $begx - stdscr update - $mesgwin configure -border line - if [string length $title] { - $mesgwin configure -title $title - } - - if [string length $buttons] { - $mesgwin text $text - eval $mesgwin buttons $buttons - do { - $mesgwin update - set sel [$mesgwin activate] - if ![string compare $sel Help] { - mesg $message okayonly - } - } while { ![string compare $sel Help] } - if ![string compare $buttontype okayonly] { - return 1 - } - if { [string compare $sel [lindex $buttons 0]] == 0 } { - return 1 - } else { - return 0 - } - } else { - $mesgwin text $text - $mesgwin update - } - return 1 -} - -proc save_state {} { - global env XF86SetupDir TmpDir StateFileName PID - set StateFileName "$TmpDir/state" - check_tmpdirs - set fd [open $StateFileName w] - - global NoCurses Confname ConfigFile UseConfigFile UseLoader StartServer - global pc98 - - puts $fd [list set NoCurses $NoCurses] - puts $fd [list set Confname $Confname] - puts $fd [list set ConfigFile $ConfigFile] - puts $fd [list set UseConfigFile $UseConfigFile] - puts $fd [list set UseLoader $UseLoader] - puts $fd [list set StartServer $StartServer] - puts $fd [list set XF86SetupDir $XF86SetupDir] - puts $fd [list set TmpDir $TmpDir] - puts $fd [list set PID $PID] - global DeviceIDs MonitorIDs haveSelectedModes DefaultColorDepth - puts $fd [list set DeviceIDs $DeviceIDs] - puts $fd [list set MonitorIDs $MonitorIDs] - puts $fd [list set DefaultColorDepth $DefaultColorDepth] - puts $fd [list set haveSelectedModes $haveSelectedModes] - if !$pc98 { - set arrlist [list Files Module ServerFlags Keyboard Pointer \ - SelectedMonitorModes MonitorStdModes \ - Scrn_Accel Scrn_Mono Scrn_VGA2 Scrn_VGA16 Scrn_SVGA] - } else { - set arrlist [list Files Module ServerFlags Keyboard Pointer \ - SelectedMonitorModes MonitorStdModes \ - Scrn_Accel Scrn_VGA16 Scrn_SVGA] - } - foreach devid $DeviceIDs { - lappend arrlist Device_$devid - } - foreach monid $MonitorIDs { - lappend arrlist Monitor_$monid - } - foreach arrname $arrlist { - global $arrname - puts $fd [list array set $arrname [array get $arrname]] - } - close $fd -} - -proc shutdown {args} { - global env ExitStatus - - catch {destroy .} - catch {server_running -close $env(DISPLAY)} - if { [string length $args] } { - set ExitStatus $args - } -} - -proc check_tmpdirs {} { - global TmpDir XF86SetupDir messages - - file lstat $XF86SetupDir xfsdir - file lstat $TmpDir tmpdir - if { [string compare $xfsdir(type) directory] - || [string compare $tmpdir(type) directory] - || $xfsdir(uid) != [getuid] - || $tmpdir(uid) != [getuid] - || $xfsdir(mode)&0077 - || $tmpdir(mode)&0077 } \ - { - mesg "$messages(setuplib.2)$TmpDir$messages(setuplib.3)" - shutdown 1 - exit 1 - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl:3.6 xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl:3.6 Sun Apr 5 12:15:53 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl Sat Feb 28 21:42:23 2004 @@ -1,108 +0,0 @@ -# $XConsortium: srvflags.tcl /main/2 1996/10/25 10:21:38 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/srvflags.tcl,v 3.6 1998/04/05 16:15:53 robin Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Configuration of misc server flags -# - -proc Other_create_widgets { win } { - global ServerFlags otherZap otherZoom otherTrapSignals - global otherXvidtune otherInpDevMods - global pc98_EGC messages - - set w [winpathprefix $win] - if !$pc98_EGC { - frame $w.other -width 640 -height 420 \ - -relief ridge -borderwidth 5 - } else { - frame $w.other -width 640 -height 400 \ - -relief ridge -borderwidth 5 - } - frame $w.srvflags -bd 2 -relief sunken - pack $w.srvflags -in $w.other \ - -fill both -expand yes -padx 20m -pady 20m - label $w.srvflags.title -text $messages(srvflags.1) - pack $w.srvflags.title -side top -fill both -expand yes - frame $w.srvflags.line -height 2 -bd 2 -relief sunken - pack $w.srvflags.line -side top -fill x -pady 2m - checkbutton $w.srvflags.zap -indicatoron true \ - -text $messages(srvflags.2) \ - -variable otherZap -anchor w - checkbutton $w.srvflags.zoom -indicatoron true \ - -text $messages(srvflags.3) \ - -variable otherZoom -anchor w - checkbutton $w.srvflags.trapsignals -indicatoron true \ - -text $messages(srvflags.4) \ - -variable otherTrapSignals -anchor w - checkbutton $w.srvflags.nonlocalxvidtune -indicatoron true \ - -text $messages(srvflags.5) \ - -variable otherXvidtune -anchor w - checkbutton $w.srvflags.nonlocalmodindev -indicatoron true \ - -text $messages(srvflags.6) \ - -variable otherInpDevMods -anchor w - pack $w.srvflags.zap $w.srvflags.zoom $w.srvflags.trapsignals \ - -anchor w -expand yes -fill x -padx 15m - pack $w.srvflags.nonlocalxvidtune $w.srvflags.nonlocalmodindev \ - -anchor w -expand yes -fill x -padx 15m - set otherZap [expr [string length $ServerFlags(DontZap)] == 0] - set otherZoom [expr [string length $ServerFlags(DontZoom)] == 0] - set otherTrapSignals [expr [string length \ - $ServerFlags(NoTrapSignals)] > 0] - set otherXvidtune [expr [string length \ - $ServerFlags(AllowNonLocalXvidtune)] > 0] - set otherInpDevMods [expr [string length \ - $ServerFlags(AllowNonLocalModInDev)] > 0] - -} - -proc Other_activate { win } { - set w [winpathprefix $win] - pack $w.other -side top -fill both -expand yes -} - -proc Other_deactivate { win } { - global ServerFlags otherZap otherZoom otherTrapSignals - global otherXvidtune otherInpDevMods - - set w [winpathprefix $win] - pack forget $w.other - set ServerFlags(DontZap) [expr $otherZap?"":"DontZap"] - set ServerFlags(DontZoom) [expr $otherZoom?"":"DontZoom"] - set ServerFlags(NoTrapSignals) \ - [expr $otherTrapSignals?"NoTrapSignals":""] - set ServerFlags(AllowNonLocalXvidtune) \ - [expr $otherXvidtune?"AllowNonLocalXvidtune":""] - set ServerFlags(AllowNonLocalModInDev) \ - [expr $otherInpDevMods?"AllowNonLocalModInDev":""] -} - -proc Other_popup_help { win } { - catch {destroy .otherhelp} - toplevel .otherhelp -bd 5 -relief ridge - wm title .otherhelp "Help" - wm geometry .otherhelp +30+30 - text .otherhelp.text - .otherhelp.text insert 0.0 "\n\n\ - On this screen you can select the settings of various\ - server options.\n\ - These should already be set to the values most often used\n\ - and generally you don't need to make any changes.\n\n\ - If you would like more information regarding what each\ - of these do,\n\ - read the XF86Config man page." - .otherhelp.text configure -state disabled - button .otherhelp.ok -text "Dismiss" -command "destroy .otherhelp" - focus .otherhelp.ok - pack .otherhelp.text .otherhelp.ok -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c:3.4 xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c:3.4 Fri Dec 27 01:54:15 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c Sat Feb 28 21:42:23 2004 @@ -1,176 +0,0 @@ -/* $XConsortium: tclcards.c /main/1 1996/09/21 14:17:56 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcards.c,v 3.4 1996/12/27 06:54:15 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains Tcl bindings to the Cards database routines - - */ - -#include -#include -#include -#include - -#include "cards.h" - -#include -#include -#include - -int TCL_XF86GetCardList( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86GetCardEntry( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int lookupcard( -#if NeedNestedPrototypes - char *name -#endif -); - -/* - Adds all the Cards database specific commands to the Tcl interpreter -*/ - -int -Cards_Init(interp) - Tcl_Interp *interp; -{ - if (parse_database()) { - Tcl_AppendResult(interp, "Couldn't read card database file ", - CARD_DATABASE_FILE, (char *) NULL); - return TCL_ERROR; - } - - Tcl_CreateCommand(interp, "xf86cards_getlist", - TCL_XF86GetCardList, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86cards_getentry", - TCL_XF86GetCardEntry, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* - Implements the xf86cards_getlist command which returns - a list of the cards in the database -*/ - -int -TCL_XF86GetCardList(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int i; - char **av; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86cards_getlist", TCL_STATIC); - return TCL_ERROR; - } - - av = (char **) XtMalloc(sizeof(char *) * (lastcard+2)); - - for (i = 0; i <= lastcard; i++) { - av[i] = card[i].name; - } - av[i] = (char *) NULL; - Tcl_SetResult(interp, Tcl_Merge(i, av), TCL_DYNAMIC); - XtFree((char *) av); - return TCL_OK; -} - -/* - Implements the xf86cards_getentry command which returns - the full info on the given card -*/ - -int -TCL_XF86GetCardEntry(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int idx; - char tmpbuf[64]; - char *av[9]; - - if (argc != 2) { - Tcl_SetResult(interp, "Usage: xf86cards_getentry cardname", - TCL_STATIC); - return TCL_ERROR; - } - - if ((idx = lookupcard(argv[1])) == -1) { - Tcl_SetResult(interp, "Cannot find card", TCL_STATIC); - return TCL_ERROR; - } - - av[0] = card[idx].name; - av[1] = card[idx].chipset; - av[2] = card[idx].server; - av[3] = card[idx].ramdac; - av[4] = card[idx].clockchip; - av[5] = card[idx].dacspeed; - av[6] = card[idx].lines; - - tmpbuf[0] = '\0'; - if (card[idx].flags & NOCLOCKPROBE) - strcat(tmpbuf, "NOCLOCKPROBE "); - if (card[idx].flags & UNSUPPORTED) - strcat(tmpbuf, "UNSUPPORTED "); - if (tmpbuf[0] != '\0') - tmpbuf[strlen(tmpbuf)-1] = '\0'; - av[7] = tmpbuf; - av[8] = (char *) NULL; - - Tcl_SetResult(interp, Tcl_Merge(8, av), TCL_DYNAMIC); - return TCL_OK; -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c:1.2 xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c:1.2 Mon Apr 5 04:28:23 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c Sat Feb 28 21:42:23 2004 @@ -1,887 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.c,v 1.2 1999/04/05 08:28:23 dawes Exp $ */ -/* - * Copyright 1997 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - This file contains Tcl bindings to the curses library - */ - -#include -#ifdef CURSES -#ifdef NCURSES -#include -#else -#include -#endif -#include -#include "tclcurses.h" -#endif /* CURSES */ - -static int curs_debug = 0; - -/* - Adds the curses command to the Tcl interpreter -*/ - -int -Curses_Init(interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "curses", TCL_Curses, NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -#ifndef CURSES - -/* Stub version */ -int -TCL_Curses(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tcl_AppendResult(interp, - "Curses not compiled in to this version of XF86SETUP", NULL); - return TCL_ERROR; -} - -#else - -/* -*/ - -int -TCL_Curses(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - struct windata *winPtr; - WINDOW *tmpwin; - - if (argc < 2) { - Tcl_SetResult(interp, "Usage: curses ", TCL_STATIC); - return TCL_ERROR; - } - - if (!strcmp(argv[1], "init")) { - if (stdscr) { - Tcl_AppendResult(interp, "Already initialized", NULL); - return TCL_ERROR; - } - if (initscr() == NULL) { - Tcl_AppendResult(interp, "Unable to initialize curses", NULL); - return TCL_ERROR; - } - cbreak(); - noecho(); - nonl(); - intrflush(stdscr, FALSE); - keypad(stdscr, TRUE); - if (has_colors()) { - start_color(); - } - init_pair(PAIR_SCREEN); - init_pair(PAIR_ULBORD); - init_pair(PAIR_LRBORD); - init_pair(PAIR_TEXT); - init_pair(PAIR_TITLE); - init_pair(PAIR_SELECT); - winPtr = initwinPtr(stdscr); - bkgd(ATTR_SCREEN); - attrset(ATTR_SCREEN); - Tcl_CreateCommand(interp,"stdscr",TCL_WinProc,winPtr,NULL); - } else if (argc == 3 && !strcmp(argv[1], "debug")) { - curs_debug = atoi(argv[2]); - } else if (!strcmp(argv[1], "end")) { - if (endwin() != OK) { - Tcl_AppendResult(interp, "curses end failed", NULL); - return TCL_ERROR; - } - } else if (!strcmp(argv[1], "menubar")) { - /* TBD */ - Tcl_AppendResult(interp, "Not yet implemented", NULL); - return TCL_OK; - } else if (!strcmp(argv[1], "newwin")) { - if (argc != 7) { - Tcl_AppendResult(interp, - "Usage: curses newwin " - " ", - NULL); - return TCL_ERROR; - } - if ((tmpwin = newwin(atoi(argv[3]),atoi(argv[4]), - atoi(argv[5]),atoi(argv[6]))) == NULL) { - Tcl_AppendResult(interp, "Unable to create window", NULL); - ckfree(tmpwin); - return TCL_ERROR; - } - keypad(tmpwin, TRUE); - winPtr = initwinPtr(tmpwin); - wbkgd(winPtr->win,ATTR_TEXT); - Tcl_CreateCommand(interp,argv[2],TCL_WinProc,winPtr,NULL); - } else if (!strcmp(argv[1], "delwin")) { - if (argc != 3) { - Tcl_AppendResult(interp, - "Usage: curses delwin ", NULL); - return TCL_ERROR; - } - if (Tcl_DeleteCommand(interp, argv[2]) == TCL_ERROR) - return TCL_ERROR; - } else { - Tcl_AppendResult(interp, "Invalid option: ", - argv[2], NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -void TCL_WinDelete(clientData) - ClientData clientData; -{ - struct windata *winPtr; - int i; - - winPtr = (struct windata *) clientData; - delwin(winPtr->win); - ckfree(winPtr->title); - ckfree(winPtr->menu.chkd); - ckfree(winPtr->menu.win); - ckfree(winPtr->menu.data); - ckfree(winPtr->text.buffer); - ckfree(winPtr->text.data); - for (i = 0; i < MAXBUTTONS; i++) - ckfree(winPtr->button[i]); - ckfree(winPtr); -} - -/* -*/ - -int -TCL_WinProc(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - struct windata *winPtr = (struct windata *) clientData; - char tmpbuf[64]; - - if (argc == 4 && !strcmp(argv[1], "move")) { - wmove(winPtr->win,atoi(argv[2]),atoi(argv[3])); - } else if (argc == 3 && !strcmp(argv[1], "addstr")) { - waddstr(winPtr->win,argv[2]); - } else if (argc == 3 && !strcmp(argv[1], "text")) { - return settext(winPtr, interp, argv[2]); - } else if (argc == 2 && !strcmp(argv[1], "activate")) { - return processinput(winPtr, interp); - } else if (argc == 2 && !strcmp(argv[1], "clear")) { - wclear(winPtr->win); - } else if (argc == 2 && !strcmp(argv[1], "update")) { - wrefresh(winPtr->win); - } else if (argc == 2 && !strcmp(argv[1], "info")) { - sprintf(tmpbuf, "%d %d %d %d", winPtr->width, winPtr->height, - winPtr->border, winPtr->shadow); - Tcl_AppendResult(interp, tmpbuf, NULL); - Tcl_AppendElement(interp, winPtr->title); - } else if (argc > 2 && !strcmp(argv[1], "menu")) { - winPtr->menu.type=TYPE_MENU; - return setmenu(winPtr, interp, argc, argv); - } else if (argc > 2 && !strcmp(argv[1], "checklist")) { - winPtr->menu.type=TYPE_CHECK; - return setmenu(winPtr, interp, argc, argv); - } else if (argc > 2 && !strcmp(argv[1], "radiolist")) { - winPtr->menu.type=TYPE_RADIO; - return setmenu(winPtr, interp, argc, argv); - } else if (argc > 2 && !strcmp(argv[1], "buttons")) { - return setbuttons(winPtr, interp, argc, argv); - } else if (argc > 2 && !strcmp(argv[1], "configure")) { - return winconfig(winPtr, interp, argc, argv); - } else { - Tcl_AppendResult(interp, "Invalid option: ", - argv[1], NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static int -settext(winPtr, interp, text) - struct windata *winPtr; - Tcl_Interp *interp; - char *text; -{ - int i, numcols; - char savechar, *ptr, *nlptr, *spcptr, *endchar; - - DEBUG4("settext(%p, %p, %s)\n", winPtr, interp, text); - - numcols = winPtr->width - (winPtr->border==BORDER_NONE? 0: 2); - if (winPtr->text.data) { - ckfree(winPtr->text.data); - ckfree(winPtr->text.buffer); - } - winPtr->text.items = winPtr->text.topline = 0; - if (strlen(text)) { - winPtr->text.buffer = strdup(text); - ptr = nlptr = winPtr->text.buffer; - endchar = winPtr->text.buffer + strlen(text); - while (nlptr < endchar) { - if ((nlptr = strchr(ptr, '\n')) == NULL) - nlptr = endchar; - if (nlptr - ptr > numcols) { - *nlptr = '\0'; - while (strlen(ptr) > numcols) { - savechar = ptr[numcols]; - ptr[numcols] = '\0'; - spcptr = strrchr(ptr, ' '); - ptr[numcols] = savechar; - if (spcptr == NULL) { - ptr[numcols-1] = '\n'; - ptr += numcols - 1; - } else { - *spcptr = '\n'; - ptr = spcptr + 1; - } - } - if (nlptr != endchar) - *nlptr = '\n'; - } - ptr = nlptr + 1; - } - } else { - winPtr->text.data = (char **) 0; - winPtr->text.buffer = endchar = NULL; - } - - for (ptr= nlptr= winPtr->text.buffer; ptrtext.items++; - } - winPtr->text.data = (char **) ckalloc(winPtr->text.items * sizeof(char *)); - - for (i=0, ptr= nlptr= winPtr->text.buffer; ptrtext.data[i++] = ptr; - } - DEBUG3("(text='%s' items=%d)\n", winPtr->text.buffer, winPtr->text.items); - - updatetext(winPtr, interp); - DEBUG1("settext() returning okay\n"); - return TCL_OK; -} - -static int -updatetext(winPtr, interp) - struct windata *winPtr; - Tcl_Interp *interp; -{ - int i, j, row, col, numrows, numcols; - - DEBUG3("updatetext(%p, %p)\n", winPtr, interp); - wattrset(winPtr->win, ATTR_TEXT); - if (winPtr->border == BORDER_NONE) { - row = col = 0; - numcols = winPtr->width; - } else { - row = col = 1; - numcols = winPtr->width-2; - } - numrows = textlines(winPtr); - - for (i = row; i < row+numrows; i++) { - wmove(winPtr->win, i, col); - for (j = col; j < col+numcols; j++) - waddch(winPtr->win, ATTR_TEXT | ' '); - } - if (!winPtr->text.items) - return TCL_OK; - - for (i= 0, j= winPtr->text.topline; itext.items; i++, j++) { - wmove(winPtr->win, i+row, col); - waddstr(winPtr->win, winPtr->text.data[j]); - } - DEBUG1("updatetext() returning okay\n"); - return TCL_OK; -} - -static int -textlines(winPtr) - struct windata *winPtr; -{ - int rows; - - if (winPtr->border == BORDER_NONE) { - rows = winPtr->height; - if (winPtr->button[0]) rows--; - } else { - rows = winPtr->height-2; - if (winPtr->button[0]) rows-=2; - } - if (winPtr->menu.items) rows -= winPtr->menu.items+2; - - return rows; -} - -static int -processinput(winPtr, interp) - struct windata *winPtr; - Tcl_Interp *interp; -{ - int key=0, i, lastbutton; - -#define mybeep() beep(); wrefresh(winPtr->win) - - for (lastbutton=0; lastbuttonbutton[lastbutton]) - break; - } - while (1) { - switch (key = wgetch(winPtr->win)) { - case KEY_RIGHT: - if (!winPtr->button[0] || winPtr->butsel == lastbutton-1) { - mybeep(); - } else { - winPtr->butsel++; - updatebuttons(winPtr); - } - when KEY_LEFT: - if (!winPtr->button[0] || winPtr->butsel == 0) { - mybeep(); - } else { - winPtr->butsel--; - updatebuttons(winPtr); - } - when KEY_UP: - case KEY_SR: - if (updatepos(winPtr, interp, KEY_UP, SCROLL_LINE) == TCL_ERROR) - return TCL_ERROR; - when KEY_DOWN: - case KEY_SF: - if (updatepos(winPtr, interp, KEY_DOWN, SCROLL_LINE) == TCL_ERROR) - return TCL_ERROR; - when KEY_HOME: - case KEY_BEG: - if (updatepos(winPtr, interp, KEY_UP, SCROLL_ALL) == TCL_ERROR) - return TCL_ERROR; - when KEY_LL: - case KEY_END: - if (updatepos(winPtr, interp, KEY_DOWN, SCROLL_ALL) == TCL_ERROR) - return TCL_ERROR; - when KEY_PPAGE: - if (updatepos(winPtr, interp, KEY_UP, SCROLL_PAGE) == TCL_ERROR) - return TCL_ERROR; - when KEY_NPAGE: - if (updatepos(winPtr, interp, KEY_DOWN, SCROLL_PAGE) == TCL_ERROR) - return TCL_ERROR; - when KEY_ENTER: - case '\r': - case '\n': - Tcl_AppendElement(interp, winPtr->button[0]? - winPtr->button[winPtr->butsel]: ""); - if (winPtr->menu.items) { - if (winPtr->menu.type == TYPE_RADIO) { - Tcl_AppendElement(interp, - winPtr->menu.data[winPtr->menu.rsel]); - } else if (winPtr->menu.type == TYPE_CHECK) { - for (i = 0; i < winPtr->menu.items; i++) { - if (winPtr->menu.chkd[i]) - Tcl_AppendElement(interp, - winPtr->menu.data[i]); - } - } else - Tcl_AppendElement(interp, - winPtr->menu.data[winPtr->menu.current]); - } - return TCL_OK; - when KEY_SELECT: - case ' ': - if (winPtr->menu.items == 0 - || winPtr->menu.type == TYPE_NONE - || winPtr->menu.type == TYPE_MENU) { - mybeep(); - } else { - if (winPtr->menu.type == TYPE_RADIO) - winPtr->menu.rsel = winPtr->menu.current; - else - winPtr->menu.chkd[winPtr->menu.current] = - (winPtr->menu.chkd[winPtr->menu.current]+1)%2; - if (updatemenu(winPtr) == TCL_ERROR) - return TCL_ERROR; - wrefresh(winPtr->menu.win); - } - when KEY_REFRESH: - case 0x0c: /* ^L */ - wrefresh(curscr); - when KEY_ESC: - Tcl_AppendResult(interp, "Escape", NULL); - return TCL_OK; - /* break */ - default: - mybeep(); - } - } -} - -static int -updatepos(winPtr, interp, dir, amt) - struct windata *winPtr; - Tcl_Interp *interp; - int dir, amt; -{ - int scroll; - - if ((winPtr->menu.type == TYPE_NONE && winPtr->text.data == NULL) - || (winPtr->menu.type != TYPE_NONE && winPtr->menu.lines == 0) ) { - mybeep(); - return TCL_OK; - } - switch (amt) { - case SCROLL_LINE: - scroll = 1; - when SCROLL_PAGE: - if (winPtr->menu.type == TYPE_NONE) { - scroll = textlines(winPtr); - } else { - scroll = winPtr->menu.lines; - } - when SCROLL_ALL: - scroll = 0; - break; - default: - Tcl_AppendResult(interp, - "internal error: updatepos() called with invalid scroll amount (%d)", - amt, NULL); - return TCL_ERROR; - } - if (winPtr->menu.type == TYPE_NONE) { - int rows = textlines(winPtr); - switch (dir) { - case KEY_UP: - if (winPtr->text.topline == 0) { - mybeep(); - return TCL_OK; - } - winPtr->text.topline -= scroll; - if (!scroll || winPtr->text.topline < 0) - winPtr->text.topline = 0; - if (updatetext(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - wrefresh(winPtr->win); - when KEY_DOWN: - if (winPtr->text.topline >= winPtr->text.items-rows) { - mybeep(); - return TCL_OK; - } - winPtr->text.topline += scroll; - if (!scroll || winPtr->text.topline > winPtr->text.items-rows) { - winPtr->text.topline = winPtr->text.items-rows; - if (winPtr->text.topline < 0) - winPtr->text.topline = 0; - } - if (updatetext(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - wrefresh(winPtr->win); - break; - default: - Tcl_AppendResult(interp, - "internal error: updatepos() called with invalid dir (%d)", - dir, NULL); - return TCL_ERROR; - } - } else { - switch (dir) { - case KEY_UP: - if (winPtr->menu.current == 0) { - mybeep(); - return TCL_OK; - } - winPtr->menu.current -= scroll; - if (!scroll || winPtr->menu.current < 0) - winPtr->menu.current = 0; - if (scroll != 1) { - winPtr->menu.topline -= scroll; - if (!scroll || winPtr->menu.topline < 0) - winPtr->menu.topline = 0; - } - if (updatemenu(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - wrefresh(winPtr->menu.win); - when KEY_DOWN: - if (winPtr->menu.current == winPtr->menu.items-1) { - mybeep(); - return TCL_OK; - } - winPtr->menu.current += scroll; - if (!scroll || winPtr->menu.current > winPtr->menu.items-1) - winPtr->menu.current = winPtr->menu.items-1; - if (scroll != 1) { - winPtr->menu.topline += scroll; - if (!scroll || winPtr->menu.topline > winPtr->menu.items-winPtr->menu.lines) - winPtr->menu.topline = winPtr->menu.items-winPtr->menu.lines; - } - if (updatemenu(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - wrefresh(winPtr->menu.win); - break; - default: - Tcl_AppendResult(interp, - "internal error: updatepos() called with invalid dir (%d)", - dir, NULL); - return TCL_ERROR; - } - } - return TCL_OK; -} - -static struct windata * -initwinPtr(win) - WINDOW *win; -{ - struct windata *winPtr; - int i; - - if ((winPtr= (struct windata *) ckalloc(sizeof(struct windata))) == NULL) - return NULL; - winPtr->win = win; - getmaxyx(win, winPtr->height, winPtr->width); - winPtr->title = (char *) 0; - winPtr->border = BORDER_NONE; - winPtr->shadow = 0; - - winPtr->menu.type = TYPE_NONE; - winPtr->menu.lines = 0; - winPtr->menu.items = 0; - winPtr->menu.topline = 0; - winPtr->menu.current = 0; - winPtr->menu.rsel = 0; - winPtr->menu.chkd = (int *) 0; - winPtr->menu.win = (WINDOW *) 0; - winPtr->menu.data = (char **) 0; - winPtr->text.items = 0; - winPtr->text.topline = 0; - winPtr->text.buffer = (char *) 0; - winPtr->text.data = (char **) 0; - winPtr->butsel = 0; - for (i = 0; i < MAXBUTTONS; i++) - winPtr->button[i] = (char *) 0; - return winPtr; -} - -static int -winconfig(winPtr, interp, argc, argv) - struct windata *winPtr; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int i; - - DEBUG5("winconfig(%p, %p, %d, %p)\n", winPtr, interp, argc, argv); - for (i = 2; i < argc-1; i += 2) { - if (!strcmp(argv[i],"-shadow")) { - /* TBD */ - Tcl_AppendResult(interp, "Not yet implemented", NULL); - return TCL_OK; - } else if (!strcmp(argv[i],"-title")) { - if (winPtr->border == BORDER_NONE) { - Tcl_AppendResult(interp, - "Only bordered windows can have titles", - NULL); - return TCL_ERROR; - } - if (strlen(argv[i+1]) > winPtr->width-2) { - Tcl_AppendResult(interp, - "Title too long", NULL); - return TCL_ERROR; - } - if (winPtr->title) { - ckfree(winPtr->title); - drawbox(winPtr, 0, 0, winPtr->height, - winPtr->width, winPtr->border-1, - ATTR_ULBORD, ATTR_LRBORD); - } - wmove(winPtr->win, 0, (winPtr->width-strlen(argv[i+1]))/2); - wattrset(winPtr->win, ATTR_TITLE); - waddstr(winPtr->win, argv[i+1]); - } else if (!strcmp(argv[i],"-border")) { - if (!strcmp(argv[i+1], "none")) { - winPtr->border=BORDER_NONE; - } else if (!strcmp(argv[i+1], "blank")) { - winPtr->border=BORDER_BLANK; - drawbox(winPtr, 0, 0, winPtr->height, - winPtr->width, 0, ATTR_ULBORD, ATTR_LRBORD); - } else if (!strcmp(argv[i+1], "line")) { - winPtr->border=BORDER_LINE; - drawbox(winPtr, 0, 0, winPtr->height, - winPtr->width, 1, ATTR_ULBORD, ATTR_LRBORD); - } else { - Tcl_AppendResult(interp, "Invalid border type: ", - argv[i+1], NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Invalid option: ", - argv[i], NULL); - return TCL_ERROR; - } - } - DEBUG1("winconfig() returning okay\n"); - return TCL_OK; -} - -static int -setmenu(winPtr, interp, argc, argv) - struct windata *winPtr; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int i, subx, suby, subwid, subht, winy, winx; - static char *defaultbuttons[] = {"menu", "buttons", "Okay", "Cancel"}; - - DEBUG5("setmenu(%p, %p, %d, %p)\n", winPtr, interp, argc, argv); - if (winPtr->menu.data) - ckfree(winPtr->menu.data); - if (winPtr->menu.win) - delwin(winPtr->menu.win); - if (!(winPtr->menu.items = argc-3)) { - winPtr->menu.lines = 0; - winPtr->menu.topline = 0; - winPtr->menu.current = 0; - return TCL_OK; - } - subht = winPtr->menu.lines = atoi(argv[2]); - i = winPtr->height - 3 - (winPtr->border? 3: 0); - if (subht > i) { - Tcl_AppendResult(interp, "Not enough room for menu window", - NULL); - return TCL_ERROR; - } - winPtr->menu.data = (char **) ckalloc(sizeof(char *) * (argc-2)); - for (i = 0; imenu.data[i] = strdup(argv[i+3]); - } - if (winPtr->menu.type == TYPE_CHECK) { - winPtr->menu.chkd = (int *) ckalloc(sizeof(int) * (argc-3)); - for (i = 0; imenu.chkd[i] = 0; - } - } - winPtr->menu.data[i] = NULL; - if (!winPtr->button[0]) { - if (setbuttons(winPtr, interp, 4, defaultbuttons) == TCL_ERROR) - return TCL_ERROR; - } - getbegyx(winPtr->win, winy, winx); - subx = (winPtr->border? 3: 2); - suby = winPtr->height - 2 - (winPtr->border? 2: 0) - subht; - subwid = winPtr->width - (winPtr->border? 6: 4); - if ((winPtr->menu.win = subwin(winPtr->win, subht, subwid, - suby+winy, subx+winx)) == NULL) { - Tcl_AppendResult(interp, "Unable to create menu subwindow", - NULL); - return TCL_ERROR; - } - drawbox(winPtr, suby-1, subx-1, subht+2, subwid+2, 1, - ATTR_LRBORD, ATTR_ULBORD); - - if (updatemenu(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - if (updatetext(winPtr, interp) == TCL_ERROR) - return TCL_ERROR; - DEBUG1("setmenu() returning okay\n"); - return TCL_OK; -} - -static int -updatemenu(winPtr, interp) - struct windata *winPtr; - Tcl_Interp *interp; -{ - int i, j, tmp, bottom, wid, ht; - DEBUG3("updatemenu(%p, %p)\n", winPtr, interp); - bottom = winPtr->menu.topline + winPtr->menu.lines - 1; - DEBUG2("bottom = %d\n", bottom); - if (winPtr->menu.current < winPtr->menu.topline) { - winPtr->menu.topline = winPtr->menu.current; - } - if (winPtr->menu.current > bottom) { - winPtr->menu.topline = winPtr->menu.current - winPtr->menu.lines + 1; - } - DEBUG5("menu.current=%d, menu.topline=%d, menu.lines=%d, bottom=%d\n", - winPtr->menu.current, winPtr->menu.topline, (int) winPtr->menu.lines, bottom); - getmaxyx(winPtr->menu.win, ht, wid); - for (i = 0; i < winPtr->menu.lines; i++) { - tmp = i+winPtr->menu.topline; - if (tmp == winPtr->menu.current) - wattrset(winPtr->menu.win, ATTR_SELECT); - else - wattrset(winPtr->menu.win, ATTR_TEXT); - wmove(winPtr->menu.win, i, 0); - for (j = 0; j < wid; j++) - waddch(winPtr->menu.win, ' '); - if (tmp < winPtr->menu.items && winPtr->menu.data[tmp]) { - wmove(winPtr->menu.win, i, 0); - if (winPtr->menu.type == TYPE_RADIO) { - if (winPtr->menu.rsel == tmp) - waddstr(winPtr->menu.win, "(X) "); - else - waddstr(winPtr->menu.win, "( ) "); - } - if (winPtr->menu.type == TYPE_CHECK) { - if (winPtr->menu.chkd[tmp]) - waddstr(winPtr->menu.win, "[X] "); - else - waddstr(winPtr->menu.win, "[ ] "); - } - waddstr(winPtr->menu.win, winPtr->menu.data[tmp]); - } - } - return TCL_OK; -} - -static int -setbuttons(winPtr, interp, argc, argv) - struct windata *winPtr; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int i, needlines=1, needcols=0; - - DEBUG5("setbuttons(%p, %p, %d, %p)\n", winPtr, interp, argc, argv); - if (winPtr->text.items) needlines++; - if (winPtr->border) { - needlines+= winPtr->text.items? 3:2; - needcols+=2; - } - for (i = 2; i < argc; i++) { - needcols += strlen(argv[i]) + 3; - } - if (winPtr->height < needlines || winPtr->width < needcols) { - Tcl_AppendResult(interp, "Window too small", NULL); - return TCL_ERROR; - } - if (winPtr->border && winPtr->text.items) { - wattrset(winPtr->win, ATTR_ULBORD); - wmove(winPtr->win, winPtr->height-3, 0); - waddch(winPtr->win, ACS_LTEE); - for (i = 0; i < winPtr->width-2; i++) - waddch(winPtr->win, ACS_HLINE); - wattrset(winPtr->win, ATTR_LRBORD); - waddch(winPtr->win, ACS_RTEE); - } - for (i = 0; i < MAXBUTTONS; i++) { - if (winPtr->button[i]) - ckfree(winPtr->button); - } - for (i = 0; argv[i+2]; i++) - winPtr->button[i] = strdup(argv[i+2]); - updatebuttons(winPtr); - DEBUG1("setbuttons() returning okay\n"); - return TCL_OK; -} - -static void -updatebuttons(winPtr) - struct windata *winPtr; -{ - int i, j, numbuttons, needcols=0, x, y; - - DEBUG1("updatebuttons(winPtr)\n"); - - getyx(winPtr->win, y, x); - for (i = numbuttons = 0; i < MAXBUTTONS; i++) { - if (winPtr->button[i]) - numbuttons++; - else - break; - } - if (winPtr->border) - needcols+=2; - for (i = 0; i < numbuttons; i++) { - needcols += strlen(winPtr->button[i]) + 3; - } - wmove(winPtr->win, winPtr->height-2, 1); - for (i = 0; i < winPtr->width-2; i++) { - waddch(winPtr->win, ' '); - } - wmove(winPtr->win, winPtr->height-2, 1); - wattrset(winPtr->win, ATTR_TEXT); - for (i = 0; i < numbuttons; i++) { - for (j = 0; j < (winPtr->width-needcols)/(numbuttons+1); j++) - waddch(winPtr->win, ' '); - if (winPtr->butsel == i) { - wattrset(winPtr->win, ATTR_SELECT); - getyx(winPtr->win, y, x); - } - waddch(winPtr->win, '<'); - waddstr(winPtr->win, winPtr->button[i]); - waddch(winPtr->win, '>'); - wattrset(winPtr->win, ATTR_TEXT); - } - wmove(winPtr->win, y, x+1); -} - -static void -drawbox(winPtr, begrow, begcol, rows, cols, lchar, ulattr, lrattr) - struct windata *winPtr; - int begrow, begcol, rows, cols, lchar; - chtype ulattr, lrattr; -{ - int i; - -#define bchar(ch) (lchar? (ch): ' ') - - DEBUG9("drawbox(%p, %d, %d, %d, %d, %d, %lx, %lx)\n", - winPtr, begrow, begcol, rows, cols, lchar, ulattr, lrattr); - wattrset(winPtr->win, ulattr); - wmove(winPtr->win, begrow, begcol); - waddch(winPtr->win, bchar(ACS_ULCORNER)); - for (i=0; iwin, bchar(ACS_HLINE)); - wattrset(winPtr->win, lrattr); - waddch(winPtr->win, bchar(ACS_URCORNER)); - for (i=begrow+1; iwin, ulattr); - mvwaddch(winPtr->win,i,begcol,bchar(ACS_VLINE)); - wattrset(winPtr->win, lrattr); - mvwaddch(winPtr->win,i,begcol+cols-1,bchar(ACS_VLINE)); - } - wmove(winPtr->win, begrow+rows-1, begcol); - wattrset(winPtr->win, ulattr); - waddch(winPtr->win, bchar(ACS_LLCORNER)); - wattrset(winPtr->win, lrattr); - for (i=0; iwin, bchar(ACS_HLINE)); - waddch(winPtr->win, bchar(ACS_LRCORNER)); -} - -#endif /* CURSES */ Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h:1.1 Mon Apr 5 03:13:02 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h Sat Feb 28 21:42:23 2004 @@ -1,204 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclcurses.h,v 1.1 1999/04/05 07:13:02 dawes Exp $ */ - -#include -#ifdef NCURSES -#include -#else -#include -#endif - -#define MAXBUTTONS 8 - -#define BORDER_NONE 0 -#define BORDER_BLANK 1 -#define BORDER_LINE 2 - -#define TYPE_NONE 0 -#define TYPE_MENU 1 -#define TYPE_RADIO 2 -#define TYPE_CHECK 3 - -#define PAIR_SCREEN 1, COLOR_CYAN, COLOR_BLUE -#define PAIR_ULBORD 2, COLOR_WHITE, COLOR_WHITE -#define PAIR_LRBORD 3, COLOR_BLACK, COLOR_WHITE -#define PAIR_TEXT 4, COLOR_WHITE, COLOR_WHITE -#define PAIR_TITLE 5, COLOR_BLUE, COLOR_WHITE -#define PAIR_SELECT 6, COLOR_BLUE, COLOR_WHITE - -#define ATTR_SCREEN COLOR_PAIR(1) -#define ATTR_ULBORD (COLOR_PAIR(2)|A_BOLD) -#define ATTR_LRBORD COLOR_PAIR(3) -#define ATTR_TEXT ATTR_LRBORD -#define ATTR_TITLE (COLOR_PAIR(5)|A_BOLD) -#define ATTR_SELECT (COLOR_PAIR(6)|A_REVERSE) - -#define KEY_ESC 27 - -#define SCROLL_LINE 0 -#define SCROLL_PAGE 1 -#define SCROLL_ALL 2 - -struct windata { - WINDOW *win; - short width; - short height; - char *title; - short border; /* border type */ - short shadow; /* Add shadow? */ - - struct { - short type; - short lines; - int items; - int topline; - int current; - int rsel; - int *chkd; - WINDOW *win; - char **data; - } menu; - - struct { - int items; /* lines of text */ - int topline; /* top text line */ - char *buffer; /* text area contents */ - char **data; /* text lines */ - } text; - - short butsel; /* which button is selected */ - char *button[MAXBUTTONS]; /* button text labels */ -}; - -#define DEBUG1(s) if (curs_debug) fprintf(stderr, s) -#define DEBUG2(s,a) if (curs_debug) fprintf(stderr, s,a) -#define DEBUG3(s,a,b) if (curs_debug) fprintf(stderr, s,a,b) -#define DEBUG4(s,a,b,c) if (curs_debug) fprintf(stderr, s,a,b,c) -#define DEBUG5(s,a,b,c,d) if (curs_debug) fprintf(stderr, s,a,b,c,d) -#define DEBUG6(s,a,b,c,d,e) if (curs_debug) fprintf(stderr, s,a,b,c,d,e) -#define DEBUG7(s,a,b,c,d,e,f) if (curs_debug) fprintf(stderr, s,a,b,c,d,e,f) -#define DEBUG8(s,a,b,c,d,e,f,g) if (curs_debug) fprintf(stderr, s,a,b,c,d,e,f,g) -#define DEBUG9(s,a,b,c,d,e,f,g,h) if (curs_debug) fprintf(stderr, s,a,b,c,d,e,f,g,h) - -#define when break; case - -int TCL_Curses( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -void TCL_WinDelete( -#if NeedNestedPrototypes - ClientData clientData -#endif -); - -int TCL_WinProc( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -static int settext( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - char *text -#endif -); - -static int updatetext( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - char *text -#endif -); - -static int textlines( -#if NeedNestedPrototypes - struct windata winPtr -#endif -); - -static int setbuttons( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -static int setmenu( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -static int winconfig( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -static int processinput( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp -#endif -); - -static int updatemenu( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp -#endif -); - -static void updatebuttons( -#if NeedNestedPrototypes - struct windata winPtr -#endif -); - -static int updatepos( -#if NeedNestedPrototypes - struct windata winPtr, - Tcl_Interp *interp, - int dir; - int amt; -#endif -); - -static struct windata * initwinPtr( -#if NeedNestedPrototypes - WINDOW *win -#endif -); - -static void drawbox( -#if NeedNestedPrototypes - struct windata winPtr, - int begrow, - int begcol, - int rows, - int cols, - int lchar, - chtype ulattr, - chtype lrattr -#endif -); - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c:3.5 xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c:3.5 Fri Dec 27 01:54:16 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c Sat Feb 28 21:42:23 2004 @@ -1,877 +0,0 @@ -/* $XConsortium: tclkbd.c /main/2 1996/10/19 19:06:13 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclkbd.c,v 3.5 1996/12/27 06:54:16 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains routines to add commands to the Tcl interpreter - that interface with the XKEYBOARD server extension - - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -static int TCL_XF86GetKBD( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86GetKBDComponents( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86FreeKBD( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86ListKBDComponents( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86LoadKBD( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86ResolveKBDComponents( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86ListKBDRules( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86GetKBDProp( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86SetKBDProp( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int init_xkb( -#if NeedNestedProtoTypes - Tcl_Interp *interp, - Display *dpy -#endif -); - -extern XkbDescPtr GetXkbDescPtr( -#if NeedNestedProtoTypes - Tcl_Interp *interp, - char *handle -#endif -); - -extern void GetXkbHandle( -#if NeedNestedProtoTypes - char *buf -#endif -); - -static Tcl_HashTable XkbDescTable; /* Table of ptrs to XkbDescRecs */ - -/* - Adds all the new commands to the Tcl interpreter -*/ - -int -XF86Kbd_Init(interp) - Tcl_Interp *interp; -{ - Tcl_InitHashTable(&XkbDescTable, TCL_STRING_KEYS); - - Tcl_CreateCommand(interp, "xkb_read", - TCL_XF86GetKBD, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_load", - TCL_XF86LoadKBD, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_free", - TCL_XF86FreeKBD, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_components", - TCL_XF86GetKBDComponents, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_listcomponents", - TCL_XF86ListKBDComponents, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_resolvecomponents", - TCL_XF86ResolveKBDComponents, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_listrules", - TCL_XF86ListKBDRules, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_getrulesprop", - TCL_XF86GetKBDProp, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xkb_setrulesprop", - TCL_XF86SetKBDProp, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* - Check that the server supports the XKB extension -*/ - -static int -init_xkb(interp, dpy) - Tcl_Interp *interp; - Display *dpy; -{ - static Bool been_here = False; - int major, minor, op, event, error; - - if (been_here == True) - return TCL_OK; - - major = XkbMajorVersion; - minor = XkbMinorVersion; - if (!XkbQueryExtension(dpy, &op, &event, &error, &major, &minor)) { - Tcl_SetResult(interp, - "Unable to initialize XKEYBOARD extension", - TCL_STATIC); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - Read an XKB description from the X server or from a .xkm file -*/ - -int -TCL_XF86GetKBD(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - XkbDescPtr xkb; - Tcl_HashEntry *entry; - - if (argc != 2) { - Tcl_SetResult(interp, - "Usage: xkb_read from_server|", TCL_STATIC); - return TCL_ERROR; - } - - if (strcmp(argv[1], "from_server") == 0) { - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - if (init_xkb(interp, disp) != TCL_OK) - return TCL_ERROR; - xkb=XkbGetKeyboard(disp, - XkbGBN_AllComponentsMask,XkbUseCoreKbd); - } else { -#if 0 - unsigned tmp; - FILE *fd; - int major, minor; - XkbFileInfo result; - - XkbInitAtoms(NULL); - major = XkbMajorVersion; - minor = XkbMinorVersion; - XkbLibraryVersion(&major, &minor); - bzero((char *) &result, sizeof(result)); - if ((result.xkb=xkb=XkbAllocKeyboard()) == NULL) { - Tcl_SetResult(interp, - "Couldn't allocate keyboard", TCL_STATIC); - return TCL_ERROR; - } - fd = fopen(argv[1], "r"); - tmp = XkmReadFile(fd,XkmGeometryMask,XkmKeymapLegal,&result); - fclose(fd); -#else - Tcl_SetResult(interp, - "Reading from a file is not currently supported", - TCL_STATIC); - return TCL_ERROR; -#endif - } - - - if ((xkb==NULL)||(xkb->geom==NULL)) { - Tcl_SetResult(interp, "Couldn't get keyboard", TCL_STATIC); - return TCL_ERROR; - } - if (xkb->names->geometry == 0) - xkb->names->geometry = xkb->geom->name; - GetXkbHandle(interp->result); - entry = Tcl_FindHashEntry(&XkbDescTable, interp->result); - Tcl_SetHashValue(entry, xkb); - return TCL_OK; -} - -/* - Return a Tcl list of the names of the components which make up - the specified keyboard description -*/ - -int -TCL_XF86GetKBDComponents(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - XkbDescPtr xkb; - - if (argc != 2) { - Tcl_SetResult(interp, "Usage: xkb_components ", - TCL_STATIC); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - - xkb = GetXkbDescPtr(interp, argv[1]); - if (xkb == NULL) { - return TCL_ERROR; - } - Tcl_AppendElement(interp, - XkbAtomText(disp, xkb->names->keycodes, XkbMessage)); - Tcl_AppendElement(interp, - XkbAtomText(disp, xkb->names->types, XkbMessage)); - Tcl_AppendElement(interp, - XkbAtomText(disp, xkb->names->compat, XkbMessage)); - Tcl_AppendElement(interp, - XkbAtomText(disp, xkb->names->symbols, XkbMessage)); - Tcl_AppendElement(interp, - XkbAtomText(disp, xkb->geom->name, XkbMessage)); - - return TCL_OK; -} - - -/* - Return a list of the components in the server's database - - Each component is prefixed by a character: - # - Default - + - Partial - * - Partial & Default - - None of the above - -*/ - -#define MAX_COMPONENTS 400 /* Max # components of one type */ -#define MAX_TTL_COMPONENTS 1000 /* Max # components of all types */ -#define flag2char(flag) ((flag & XkbLC_Default)? \ - ((flag & XkbLC_Partial)? '*': '#'): \ - ((flag & XkbLC_Partial)? '+': ' ')) - -int -TCL_XF86ListKBDComponents(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - XkbComponentNamesRec getcomps; - XkbComponentListPtr comps; - char *av[MAX_COMPONENTS], *names; - char bufs[MAX_COMPONENTS][32]; - int max, i, ncomps; - - if (argc != 7) { - Tcl_SetResult(interp, - "Usage: xkb_listcomponents " - " " - " ", TCL_STATIC); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - max = MAX_TTL_COMPONENTS; - getcomps.keymap = argv[1]; - getcomps.keycodes = argv[2]; - getcomps.compat = argv[3]; - getcomps.types = argv[4]; - getcomps.symbols = argv[5]; - getcomps.geometry = argv[6]; - comps = XkbListComponents(disp, XkbUseCoreKbd, &getcomps, &max); - - for (i = 0; i < MAX_COMPONENTS; i++) - av[i] = bufs[i]; - - for (i = 0, ncomps = 0; i < comps->num_keymaps; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->keymaps[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->keymaps[i].flags); - strncpy(&(bufs[ncomps][1]), comps->keymaps[i].name, 30); - bufs[ncomps++][31] = '\0'; - } - names = Tcl_Merge(ncomps, av); - Tcl_AppendElement(interp, names); - XtFree(names); - - for (i = 0, ncomps = 0; i < comps->num_keycodes; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->keycodes[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->keycodes[i].flags); - strncpy(&(bufs[ncomps][1]), comps->keycodes[i].name, 30); - bufs[ncomps++][31] = '\0'; - } - names = Tcl_Merge(ncomps,av); - Tcl_AppendElement(interp, names); - XtFree(names); - - for (i = 0, ncomps = 0; i < comps->num_compat; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->compat[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->compat[i].flags); - strncpy(&(bufs[ncomps][1]), comps->compat[i].name, 30); - bufs[ncomps++][31] = '\0'; - } - names = Tcl_Merge(ncomps,av); - Tcl_AppendElement(interp, names); - XtFree(names); - - for (i = 0, ncomps = 0; i < comps->num_types; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->types[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->types[i].flags); - strncpy(&(bufs[ncomps][1]), comps->types[i].name, 30); - bufs[ncomps++][31] = '\0'; - } - names = Tcl_Merge(ncomps,av); - Tcl_AppendElement(interp, names); - XtFree(names); - - for (i = 0, ncomps = 0; i < comps->num_symbols; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->symbols[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->symbols[i].flags); - strncpy(&(bufs[ncomps][1]), comps->symbols[i].name, 30); - bufs[ncomps][31] = '\0'; - ncomps++; - } - names = Tcl_Merge(ncomps,av); - Tcl_AppendElement(interp, names); - XtFree(names); - - for (i = 0, ncomps = 0; i < comps->num_geometry; i++) { - if (ncomps == MAX_COMPONENTS) - break; - if (comps->geometry[i].flags & XkbLC_Hidden) - continue; - bufs[ncomps][0] = flag2char(comps->geometry[i].flags); - strncpy(&(bufs[ncomps][1]), comps->geometry[i].name, 30); - bufs[ncomps++][31] = '\0'; - } - names = Tcl_Merge(ncomps,av); - Tcl_AppendElement(interp, names); - XtFree(names); - - XkbFreeComponentList(comps); - return TCL_OK; -} - -/* - Return a keyboard description, given the component names - optionally load it into the server as the new keyboard -*/ - -static char *usage_LoadKBD = "Usage: xkb_load " - " " - " [load|noload]"; - -int -TCL_XF86LoadKBD(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - XkbComponentNamesRec getcomps; - XkbDescPtr xkb; - Bool loadit = True; - Tcl_HashEntry *entry; - - if (argc < 7 || argc > 8) { - Tcl_SetResult(interp, usage_LoadKBD, TCL_STATIC); - return TCL_ERROR; - } - - if (argc == 8) { - if (!strcmp(argv[7], "load")) - loadit = True; - else if (!strcmp(argv[7], "noload")) - loadit = False; - else { - Tcl_SetResult(interp, usage_LoadKBD, TCL_STATIC); - return TCL_ERROR; - } - } - - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - - getcomps.keymap = argv[1]; - getcomps.keycodes = argv[2]; - getcomps.compat = argv[3]; - getcomps.types = argv[4]; - getcomps.symbols = argv[5]; - getcomps.geometry = argv[6]; - xkb = XkbGetKeyboardByName(disp, XkbUseCoreKbd, &getcomps, - XkbGBN_AllComponentsMask, 0, loadit); - if (!xkb) { - Tcl_SetResult(interp, "Load failed", TCL_STATIC); - return TCL_ERROR; - } - if (xkb->names->geometry == 0) - xkb->names->geometry = xkb->geom->name; - - GetXkbHandle(interp->result); - entry = Tcl_FindHashEntry(&XkbDescTable, interp->result); - Tcl_SetHashValue(entry, xkb); - - return TCL_OK; -} - -/* - Free the memory occupied by a keyboard description -*/ - -int -TCL_XF86FreeKBD(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XkbDescPtr xkb; - - if (argc != 2) { - Tcl_SetResult(interp, "Usage: xkb_free ", - TCL_STATIC); - return TCL_ERROR; - } - - xkb = GetXkbDescPtr(interp, argv[1]); - XkbFreeKeyboard(xkb,0,True); - return TCL_OK; -} - -/* - Use rules to determine the appropriate components for the given defs -*/ - -int -TCL_XF86ResolveKBDComponents(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XkbRF_RulesPtr rules; - XkbRF_VarDefsRec defs; - XkbComponentNamesRec comps; - FILE *fp; - Bool complete; - - if (argc != 6) { - Tcl_SetResult(interp, - "Usage: xkb_resolvecomponents " - " ", - TCL_STATIC); - return TCL_ERROR; - } - - if ((fp = fopen(argv[1], "r")) == NULL) { - Tcl_SetResult(interp, "Can't open rules file" , TCL_STATIC); - return TCL_ERROR; - } - - if ((rules= XkbRF_Create(0,0))==NULL) { - fclose(fp); - Tcl_SetResult(interp, "Can't create rules structure" , TCL_STATIC); - return TCL_ERROR; - } - if (!XkbRF_LoadRules(fp,rules)) { - fclose(fp); - XkbRF_Free(rules,True); - Tcl_SetResult(interp, "Can't load rules" , TCL_STATIC); - return TCL_ERROR; - } - defs.model = strlen(argv[2])? argv[2]: NULL; - defs.layout = strlen(argv[3])? argv[3]: NULL; - defs.variant = strlen(argv[4])? argv[4]: NULL; - defs.options = strlen(argv[5])? argv[5]: NULL; - bzero((char *)&comps, sizeof(XkbComponentNamesRec)); - complete= XkbRF_GetComponents(rules, &defs, &comps); - - Tcl_AppendElement(interp,(comps.keymap? comps.keymap: "")); - Tcl_AppendElement(interp,(comps.keycodes?comps.keycodes:"")); - Tcl_AppendElement(interp,(comps.compat? comps.compat: "")); - Tcl_AppendElement(interp,(comps.types? comps.types: "")); - Tcl_AppendElement(interp,(comps.symbols? comps.symbols: "")); - Tcl_AppendElement(interp,(comps.geometry?comps.geometry:"")); - - XtFree(comps.keymap); - XtFree(comps.keycodes); - XtFree(comps.compat); - XtFree(comps.types); - XtFree(comps.symbols); - XtFree(comps.geometry); - XkbRF_Free(rules,True); - fclose(fp); - - return TCL_OK; -} - -/* - Return a list of rules defs and their descriptions -*/ - -#ifdef min -#undef min -#endif -#define min(a,b) ((a", - TCL_STATIC); - return TCL_ERROR; - } - - if ((list= XkbRF_Create(0,0))==NULL) { - Tcl_SetResult(interp, "Can't create rules structure" , TCL_STATIC); - return TCL_ERROR; - } - - result = XkbRF_LoadDescriptionsByName(argv[1],NULL,list); - - if (result == False) { - Tcl_SetResult(interp, "", TCL_STATIC); - return TCL_OK; - } - - maxcnt = min(list->models.num_desc,MAX_COMPONENTS); - for (i=0; imodels.desc[i].name; - av_descs[i] = list->models.desc[i].desc; - } - - if ((tmp = Tcl_Merge(maxcnt, av_names)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - if ((tmp = Tcl_Merge(maxcnt, av_descs)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - maxcnt = min(list->layouts.num_desc,MAX_COMPONENTS); - for (i=0; ilayouts.desc[i].name; - av_descs[i] = list->layouts.desc[i].desc; - } - - if ((tmp = Tcl_Merge(maxcnt, av_names)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - if ((tmp = Tcl_Merge(maxcnt, av_descs)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - maxcnt = min(list->variants.num_desc,MAX_COMPONENTS); - for (i=0; ivariants.desc[i].name; - av_descs[i] = list->variants.desc[i].desc; - } - - if ((tmp = Tcl_Merge(maxcnt, av_names)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - if ((tmp = Tcl_Merge(maxcnt, av_descs)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - maxcnt = min(list->options.num_desc,MAX_COMPONENTS); - for (i=0; ioptions.desc[i].name; - av_descs[i] = list->options.desc[i].desc; - } - - if ((tmp = Tcl_Merge(maxcnt, av_names)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - if ((tmp = Tcl_Merge(maxcnt, av_descs)) == NULL) - return TCL_ERROR; - Tcl_AppendElement(interp, tmp); - XtFree(tmp); - - XkbRF_Free(list,True); - - return TCL_OK; -} - -/* - Find out what rules defs were used to generate the keyboard currently - used by the server -*/ - -int -TCL_XF86GetKBDProp(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - char *rulesfile; - XkbRF_VarDefsRec defs; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xkb_getrulesprop", TCL_STATIC); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - if (XkbRF_GetNamesProp(disp, &rulesfile, &defs) == False) - return TCL_OK; - Tcl_AppendElement(interp, rulesfile? rulesfile:""); - Tcl_AppendElement(interp, defs.model? defs.model:""); - Tcl_AppendElement(interp, defs.layout? defs.layout:""); - Tcl_AppendElement(interp, defs.variant? defs.variant:""); - Tcl_AppendElement(interp, defs.options? defs.options:""); - XtFree(rulesfile); - XtFree(defs.model); - XtFree(defs.layout); - XtFree(defs.variant); - XtFree(defs.options); - - return TCL_OK; -} - -/* - Set the _XKB_RULES_NAMES property to indicate what defs are - being used for the keyboard -*/ - -int -TCL_XF86SetKBDProp(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin; - Display *disp; - XkbRF_VarDefsRec defs; - char *rulesfile; - - if (argc != 6) { - Tcl_SetResult(interp, - "Usage: xkb_setrulesprop " - " ", - TCL_STATIC); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - disp = Tk_Display(topwin); - - defs.model = strlen(argv[2])? argv[2]: NULL; - defs.layout = strlen(argv[3])? argv[3]: NULL; - defs.variant = strlen(argv[4])? argv[4]: NULL; - defs.options = strlen(argv[5])? argv[5]: NULL; - rulesfile = strrchr(argv[1], '/'); - if (rulesfile == NULL) - rulesfile = argv[1]; - else - rulesfile++; - - if (!XkbRF_SetNamesProp(disp, rulesfile, &defs)) { - Tcl_SetResult(interp, "Unable to set rules property", - TCL_STATIC); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - Given a string handle, return the corresponding pointer to a - keyboard description -*/ - -XkbDescPtr -GetXkbDescPtr(interp, handle) - Tcl_Interp *interp; - char *handle; -{ - Tcl_HashEntry *entry; - entry = Tcl_FindHashEntry(&XkbDescTable, handle); - if (entry == NULL) { - Tcl_AppendResult(interp, "No keyboard named \"", - handle, "\"", (char *) NULL); - return NULL; - } - return (XkbDescPtr) Tcl_GetHashValue(entry); -} - -/* - Get the next available handle -*/ - -void -GetXkbHandle(buf) - char *buf; -{ - static unsigned int id = 1; - int new; - - do { - sprintf(buf, "xkb%d", id++); - Tcl_CreateHashEntry(&XkbDescTable, buf, &new); - } while (!new); -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c:3.14 xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c:3.14 Wed Jul 25 11:05:05 2001 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c Sat Feb 28 21:42:23 2004 @@ -1,556 +0,0 @@ -/* $Xconsortium: $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.c,v 3.14 2001/07/25 15:05:05 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains Tcl bindings to the XFree86-Misc extension - - */ - -#include -#include -#include -#include -#include -#include -#include -#include "tclmisc.h" - -static int (*savErrorFunc)(); -static int errorOccurred; -static char errMsgBuf[512]; - -int XF86Misc_Init(Tcl_Interp *interp); - -static int miscError(Display *dis, XErrorEvent *err) -{ - XGetErrorText(dis, err->error_code, errMsgBuf, 512); - errorOccurred = TRUE; - return 0; -} - -/* - Adds all the xf86misc specific commands to the Tcl interpreter -*/ - -int -XF86Misc_Init(interp) -Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "xf86misc_getversion", - TCL_XF86MiscQueryVersion, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_getbasevals", - TCL_XF86MiscQueryExtension, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_getsaver", - TCL_XF86MiscGetSaver, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_setsaver", - TCL_XF86MiscSetSaver, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_getkeyboard", - TCL_XF86MiscGetKbdSettings, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_setkeyboard", - TCL_XF86MiscSetKbdSettings, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_getmouse", - TCL_XF86MiscGetMouseSettings, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86misc_setmouse", - TCL_XF86MiscSetMouseSettings, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* Note, the characters '_', ' ', and '\t' are ignored in the comparison */ -int -StrCaseCmp(s1, s2) -char *s1, *s2; -{ - char c1, c2; - - if (*s1 == 0) - if (*s2 == 0) - return(0); - else - return(1); - while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') - s1++; - while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') - s2++; - c1 = (isupper(*s1) ? tolower(*s1) : *s1); - c2 = (isupper(*s2) ? tolower(*s2) : *s2); - while (c1 == c2) - { - if (c1 == '\0') - return(0); - s1++; s2++; - while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') - s1++; - while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') - s2++; - c1 = (isupper(*s1) ? tolower(*s1) : *s1); - c2 = (isupper(*s2) ? tolower(*s2) : *s2); - } - return(c1 - c2); -} - -/* - Implements the xf86misc_getversion command which - returns (in interp->result) the version of the - XFree86-MiscExtension that is built into the X server - The version is returned simple floating point number (e.g. 0.4) -*/ - -int -TCL_XF86MiscQueryVersion(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int MajorVersion, MinorVersion; - Tk_Window tkwin; - char tmpbuf[16]; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86misc_getversion", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - if (!XF86MiscQueryVersion(Tk_Display(tkwin), &MajorVersion, &MinorVersion)) - { - Tcl_AppendResult(interp, - "Could not query XF86Misc extension version", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(tmpbuf, "%d.%d", MajorVersion, MinorVersion); - Tcl_AppendResult(interp, tmpbuf, (char *) NULL); - return TCL_OK; - } -} - - -/* - Implements the xf86misc_getbasevals command which - returns (in interp->result) a list containing two elements. - The first element is the EventBase and the second is the ErrorBase -*/ - -int -TCL_XF86MiscQueryExtension(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - int eventBase, errorBase; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86misc_getbasevals", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - if (!XF86MiscQueryExtension(Tk_Display(tkwin), - &eventBase, &errorBase)) { - Tcl_AppendResult(interp, - "Unable to query XF86Misc extension information", - (char *) NULL); - return TCL_ERROR; - } - - sprintf(interp->result, "%d %d", eventBase, errorBase); - return TCL_OK; -} - -/* - Implements the xf86misc_getsaver command which - returns (in interp->result) a list containing the - powersaver timeouts -*/ - -int -TCL_XF86MiscGetSaver(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86misc_getsaver", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; -#if 0 - if (!XF86MiscGetSaver(Tk_Display(tkwin), Tk_ScreenNumber(tkwin), - &suspendtime, &offtime)) { - Tcl_AppendResult(interp, - "Unable to get screen saver timeouts", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(interp->result, "%d %d", suspendtime, offtime); - return TCL_OK; - } -#else - return TCL_OK; -#endif -} - -/* - Implements the xf86misc_setsaver command which - sets the powersaver timeouts -*/ - -int -TCL_XF86MiscSetSaver(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int suspendtime, offtime; - Tk_Window tkwin; - - if (argc != 3) { - Tcl_SetResult(interp, - "Usage: xf86misc_setsaver ", - TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - suspendtime = atoi(argv[1]); - offtime = atoi(argv[2]); - -#if 0 - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(miscError); - errorOccurred = 0; - XF86MiscSetSaver(Tk_Display(tkwin), Tk_ScreenNumber(tkwin), - suspendtime, offtime); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, - "Unable to set screen saver timeouts: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } -#endif - return TCL_OK; -} - -static char *kbdtable[] = { "None", "84Key", "101Key", "Other", "Xqueue" }; -/* - Implements the xf86misc_getkeyboard command which - returns (in interp->result) a list containing the - keyboard settings -*/ - -int -TCL_XF86MiscGetKbdSettings(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XF86MiscKbdSettings kbdinfo; - Tk_Window tkwin; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86misc_getkeyboard", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - if (!XF86MiscGetKbdSettings(Tk_Display(tkwin), &kbdinfo)) { - Tcl_AppendResult(interp, - "Unable to get keyboard settings", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(interp->result, "%s %d %d %s", - kbdtable[kbdinfo.type], kbdinfo.delay, kbdinfo.rate, - kbdinfo.servnumlock? "on": "off"); - return TCL_OK; - } -} - -/* - Implements the xf86misc_setkeyboard command which - sets the keyboard settings -*/ - -int -TCL_XF86MiscSetKbdSettings(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XF86MiscKbdSettings kbdinfo; - Tk_Window tkwin; - int i; - char *usage = "Usage: xf86misc_setkeyboard 84Key|101Key|Other|Xqueue" - " on|off"; - - if (argc != 5) { - Tcl_SetResult(interp, usage, TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - kbdinfo.type = -1; - for (i = 1; i < sizeof(kbdtable)/sizeof(char *); i++) { - if (!StrCaseCmp(kbdtable[i], argv[1])) { - kbdinfo.type = i; - } - } - if (kbdinfo.type == -1) { - Tcl_AppendResult(interp, "Invalid keyboard type\n", - usage, (char *) NULL); - return TCL_ERROR; - } - kbdinfo.delay = atoi(argv[2]); - kbdinfo.rate = atoi(argv[3]); - if (!StrCaseCmp(argv[4], "on")) - kbdinfo.servnumlock = 1; - else if (!StrCaseCmp(argv[4], "off")) - kbdinfo.servnumlock = 0; - else { - Tcl_AppendResult(interp, "Option must be either on or off\n", - usage, (char *) NULL); - return TCL_ERROR; - } - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(miscError); - errorOccurred = 0; - XF86MiscSetKbdSettings(Tk_Display(tkwin), &kbdinfo); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, - "Unable to set keyboard settings: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static char *msetable[] = { "None", "Microsoft", "MouseSystems", "MMSeries", - "Logitech", "BusMouse", "Mouseman", "PS/2", - "MMHitTab", "GlidePoint", "IntelliMouse", - "ThinkingMouse", "IMPS/2", "ThinkingMousePS/2", - "MouseManPlusPS/2", "GlidePointPS/2", - "NetMousePS/2", "NetScrollPS/2", "SysMouse", - "Auto", "Xqueue", "OSMouse" }; -#define MSETABLESIZE (sizeof(msetable)/sizeof(char *)) - -/* - Implements the xf86misc_getmouse command which - returns (in interp->result) a list containing the - mouse settings -*/ - -int -TCL_XF86MiscGetMouseSettings(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XF86MiscMouseSettings mseinfo; - Tk_Window tkwin; - char tmpbuf[200]; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86misc_getmouse", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - if (!XF86MiscGetMouseSettings(Tk_Display(tkwin), &mseinfo)) { - Tcl_AppendResult(interp, - "Unable to get mouse settings", - (char *) NULL); - return TCL_ERROR; - } else { - char *name; - if (mseinfo.type == MTYPE_XQUEUE) - name = "Xqueue"; - else if (mseinfo.type == MTYPE_OSMOUSE) - name = "OSMouse"; - else if (mseinfo.type < 0 || (mseinfo.type >= MSETABLESIZE)) - name = "Unknown"; - else - name = msetable[mseinfo.type+1]; - sprintf(tmpbuf, "%s %s %d %d %d %d %s %d %s", - mseinfo.device==NULL? "{}": mseinfo.device, - name, - mseinfo.baudrate, mseinfo.samplerate, - mseinfo.resolution, mseinfo.buttons, - mseinfo.emulate3buttons? "on": "off", - mseinfo.emulate3timeout, - mseinfo.chordmiddle? "on": "off"); - if (mseinfo.flags & MF_CLEAR_DTR) - strcat(tmpbuf, " ClearDTR"); - if (mseinfo.flags & MF_CLEAR_RTS) - strcat(tmpbuf, " ClearRTS"); - Tcl_SetResult(interp, tmpbuf, TCL_VOLATILE); - if (mseinfo.device) { - XtFree(mseinfo.device); - } - return TCL_OK; - } -} - -/* - Implements the xf86misc_setmouse command which - sets the mouse settings -*/ - -static char *setmouseusage = - "Usage: xf86misc_setmouse " - " " - " on|off on|off [ClearDTR] [ClearRTS] [ReOpen]"; - -int -TCL_XF86MiscSetMouseSettings(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - XF86MiscMouseSettings mseinfo; - int i; - Tk_Window tkwin; - - if (argc < 9 || argc > 12) { - Tcl_SetResult(interp, setmouseusage, TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == (Tk_Window) NULL) - return TCL_ERROR; - mseinfo.device = argv[1]; - mseinfo.type = -1; - for (i = 1; i < sizeof(msetable)/sizeof(char *); i++) { - if (!StrCaseCmp(msetable[i], argv[2])) { - mseinfo.type = i - 1; - } - } - if (!StrCaseCmp("Xqueue", argv[2])) - mseinfo.type = MTYPE_XQUEUE; - else if (!StrCaseCmp("OSMouse", argv[2])) - mseinfo.type = MTYPE_OSMOUSE; - if (mseinfo.type == -1) { - Tcl_AppendResult(interp, "Invalid mouse type\n", - setmouseusage, (char *) NULL); - return TCL_ERROR; - } - mseinfo.baudrate = atoi(argv[3]); - mseinfo.samplerate = atoi(argv[4]); - mseinfo.resolution = atoi(argv[5]); - mseinfo.buttons = atoi(argv[6]); - if (!StrCaseCmp(argv[7], "on")) - mseinfo.emulate3buttons = 1; - else if (!StrCaseCmp(argv[7], "off")) - mseinfo.emulate3buttons = 0; - else { - Tcl_AppendResult(interp, "Option must be either on or off\n", - setmouseusage, (char *) NULL); - return TCL_ERROR; - } - mseinfo.emulate3timeout = atoi(argv[8]); - if (!StrCaseCmp(argv[9], "on")) - mseinfo.chordmiddle = 1; - else if (!StrCaseCmp(argv[9], "off")) - mseinfo.chordmiddle = 0; - else { - Tcl_AppendResult(interp, "Option must be either on or off\n", - setmouseusage, (char *) NULL); - return TCL_ERROR; - } - mseinfo.flags = 0; - for (i = 10; i < argc; i++) { - if (!StrCaseCmp(argv[i], "cleardtr")) - mseinfo.flags |= MF_CLEAR_DTR; - else if (!StrCaseCmp(argv[i], "clearrts")) - mseinfo.flags |= MF_CLEAR_RTS; - else if (!StrCaseCmp(argv[i], "reopen")) - mseinfo.flags |= MF_REOPEN; - else { - Tcl_AppendResult(interp, - "Flag must be one of ClearDTR," - "ClearRTS, or ReOpen\n", - setmouseusage, (char *) NULL); - return TCL_ERROR; - } - } - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(miscError); - errorOccurred = 0; - XF86MiscSetMouseSettings(Tk_Display(tkwin), &mseinfo); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, - "Unable to set mouse settings: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h:3.2 Fri Dec 27 01:54:18 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h Sat Feb 28 21:42:23 2004 @@ -1,93 +0,0 @@ -/* $Xconsortium: $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclmisc.h,v 3.2 1996/12/27 06:54:18 dawes Exp $ */ - -#include -#include -#include -#include -#include - -int TCL_XF86MiscQueryVersion( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscQueryExtension( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscGetSaver( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscSetSaver( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscGetKbdSettings( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscSetKbdSettings( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscGetMouseSettings( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86MiscSetMouseSettings( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int StrCaseCmp( -#if NeedNestedPrototypes - char *string1, - char *string2 -#endif -); - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c:3.10 xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c:3.10 Wed Jul 25 11:05:05 2001 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c Sat Feb 28 21:42:23 2004 @@ -1,554 +0,0 @@ -/* $XConsortium: tclother.c /main/3 1996/10/28 04:46:43 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclother.c,v 3.10 2001/07/25 15:05:05 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains routines to add a few misc commands to Tcl - - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int TCL_XF86GetUID( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86ServerRunning( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86ProcessRunning( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86HasSymlinks( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86Link( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86UnLink( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86Umask( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86MkDir( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86RmDir( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -static int TCL_XF86Sleep( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 4 -static int TCL_XF86Clock( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); -#endif - -/* - Adds all the new commands to the Tcl interpreter -*/ - -int -XF86Other_Init(interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "getuid", - TCL_XF86GetUID, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "server_running", - TCL_XF86ServerRunning, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "process_running", - TCL_XF86ProcessRunning, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "has_symlinks", - TCL_XF86HasSymlinks, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "link", - TCL_XF86Link, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "unlink", - TCL_XF86UnLink, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "umask", - TCL_XF86Umask, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "mkdir", - TCL_XF86MkDir, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "rmdir", - TCL_XF86RmDir, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "sleep", - TCL_XF86Sleep, (ClientData) NULL, - (void (*)()) NULL); - -#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 4 - Tcl_CreateCommand(interp, "clock", - TCL_XF86Clock, (ClientData) NULL, - (void (*)()) NULL); -#endif - - return TCL_OK; -} - -/* - Returns the users numeric id -*/ - -int -TCL_XF86GetUID(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 1) { - Tcl_SetResult(interp, "Usage: getuid", TCL_STATIC); - return TCL_ERROR; - } - - /* This is short, so we can write directly into the - pre-allocated buffer */ - sprintf(interp->result, "%d", (int) getuid()); - return TCL_OK; -} - -/* - Trivial error handler used to ignore failed attempts to connect - to the server -*/ - -static int ignoreErrors(disp, error) - Display *disp; - XErrorEvent *error; -{ - return 0; -} - -/* - Attempt to connect to an Xserver. - Also used to close the connection opened in a previous call. -*/ - -int -TCL_XF86ServerRunning(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - static Tcl_HashTable connectTable; - static Bool initted = False; - Tcl_HashEntry *entry; - int new, (*old)(); - Display *display; - - if (!initted) { - initted = True; - Tcl_InitHashTable(&connectTable, TCL_STRING_KEYS); - } - if (argc < 2 || argc > 3 - || (argc == 3 && strcmp(argv[1],"-close")) ) { - Tcl_SetResult(interp, - "Usage: server_running [-close] ", - TCL_STATIC); - return TCL_ERROR; - } - - if (argc == 3) { - entry = Tcl_FindHashEntry(&connectTable, argv[2]); - if (entry == NULL) { - Tcl_SetResult(interp, "No connection to display", - TCL_STATIC); - return TCL_ERROR; - } - display = (Display *) Tcl_GetHashValue(entry); - XCloseDisplay(display); - Tcl_DeleteHashEntry(entry); - } else { - entry = Tcl_FindHashEntry(&connectTable, argv[1]); - if (entry != NULL) { - Tcl_SetResult(interp, - "Connection to display already open", - TCL_STATIC); - return TCL_ERROR; - } - old = XSetErrorHandler(ignoreErrors); - display = XOpenDisplay(argv[1]); - if (display == (Display *) NULL) { - Tcl_SetResult(interp, "0", TCL_STATIC); - } else { - entry = Tcl_CreateHashEntry(&connectTable, argv[1], &new); - Tcl_SetHashValue(entry, display); - Tcl_SetResult(interp, "1", TCL_STATIC); - XSync(display, False); - } - (void) XSetErrorHandler(old); - } - return TCL_OK; -} - -/* - Check if the specified process is running -*/ - -int -TCL_XF86ProcessRunning(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 2) { - Tcl_SetResult(interp, "Usage: process_running ", - TCL_STATIC); - return TCL_ERROR; - } - - if (kill(atoi(argv[1]), 0) == 0) { - Tcl_SetResult(interp, "1", TCL_STATIC); - } else { - Tcl_SetResult(interp, "0", TCL_STATIC); - } - return TCL_OK; -} - -/* - Return 1 if the system supports symbolic links, zero otherwise -*/ - -int -TCL_XF86HasSymlinks(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 1) { - Tcl_SetResult(interp, "Usage: has_symlinks", TCL_STATIC); - return TCL_ERROR; - } - -#ifdef S_IFLNK - Tcl_SetResult(interp, "1", TCL_STATIC); -#else - Tcl_SetResult(interp, "0", TCL_STATIC); -#endif - return TCL_OK; -} - -/* - Make a link from one file to another (use symlinks, if available) -*/ - -int -TCL_XF86Link(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 3) { - Tcl_SetResult(interp, "Usage: link ", TCL_STATIC); - return TCL_ERROR; - } - -#ifdef S_IFLNK - if (symlink(argv[1], argv[2]) == -1) -#else - if (link(argv[1], argv[2]) == -1) -#endif - Tcl_SetResult(interp, "0", TCL_STATIC); - else - Tcl_SetResult(interp, "1", TCL_STATIC); - return TCL_OK; -} - -/* - Delete the specified file -*/ - -int -TCL_XF86UnLink(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 2) { - Tcl_SetResult(interp, "Usage: unlink ", TCL_STATIC); - return TCL_ERROR; - } - - if (unlink(argv[1]) == -1) - Tcl_SetResult(interp, "0", TCL_STATIC); - else - Tcl_SetResult(interp, "1", TCL_STATIC); - return TCL_OK; -} - -/* - Set the umask -*/ - -int -TCL_XF86Umask(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int mode; - - if (argc != 2) { - Tcl_SetResult(interp, "Usage: umask ", TCL_STATIC); - return TCL_ERROR; - } - - if (Tcl_GetInt(interp, argv[1], &mode) != TCL_OK) - return TCL_ERROR; - if (umask((mode_t) mode) == (mode_t)-1) - Tcl_SetResult(interp, "0", TCL_STATIC); - else - Tcl_SetResult(interp, "1", TCL_STATIC); - return TCL_OK; -} - -/* - Create the named directory -*/ - -int -TCL_XF86MkDir(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int mode = 0777; - - if (argc < 2 || argc > 3) { - Tcl_SetResult(interp, "Usage: mkdir []", TCL_STATIC); - return TCL_ERROR; - } - - if (argc == 3) { - if (Tcl_GetInt(interp, argv[2], &mode) != TCL_OK) - return TCL_ERROR; - } - - if (mkdir(argv[1], mode) == -1) - Tcl_SetResult(interp, "0", TCL_STATIC); - else - Tcl_SetResult(interp, "1", TCL_STATIC); - return TCL_OK; -} - -/* - Remove the specified directory -*/ - -int -TCL_XF86RmDir(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 2) { - Tcl_SetResult(interp, "Usage: rmdir ", TCL_STATIC); - return TCL_ERROR; - } - - if (rmdir(argv[1]) == -1) - Tcl_SetResult(interp, "0", TCL_STATIC); - else - Tcl_SetResult(interp, "1", TCL_STATIC); - return TCL_OK; -} - -/* - Pause for the specified number of seconds -*/ - -int -TCL_XF86Sleep(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc != 2) { - Tcl_SetResult(interp, "Usage: sleep ", TCL_STATIC); - return TCL_ERROR; - } - - sleep(atoi(argv[1])); - return TCL_OK; -} - -#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 4 -/* - Emulate a subset of the Tcl 7.5 clock command -*/ - -#include - -int -TCL_XF86Clock(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option ?arg ...?\"", (char *) NULL); - return TCL_ERROR; - } - - if (!strcmp(argv[1], "clicks")) { - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: must be \"", - argv[0], " clicks\"", (char *) NULL); - return TCL_ERROR; - } -#ifndef AMOEBA - { - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - sprintf(interp->result, "%lu", - tp.tv_sec*1000000 + tp.tv_usec); - } -#else - sprintf(interp->result, "%lu", sys_milli()); -#endif - return TCL_OK; - } else if (!strcmp(argv[1], "seconds")) { - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: must be \"", - argv[0], " seconds\"", (char *) NULL); - return TCL_ERROR; - } - sprintf(interp->result, "%ld", (long) time(0)); - } else { - Tcl_AppendResult(interp, "unknown option \"", argv[1], - "\": must be clicks, format, scan, or seconds", - (char *) NULL); - return TCL_ERROR; - } -} -#endif - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c:3.9 xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c:3.9 Thu Jul 10 04:17:20 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c Sat Feb 28 21:42:23 2004 @@ -1,834 +0,0 @@ -/* $XConsortium: tclvidmode.c /main/2 1996/10/19 19:06:29 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.c,v 3.9 1997/07/10 08:17:20 hohndel Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains Tcl bindings to the XFree86-VidModeExtension - - */ - -#define NOT_YET_IMPLEMENTED 0 - -#include -#include -#include -#include -#include -#include "tclvidmode.h" - -/* Mode flags -- ignore flags not in V_FLAG_MASK */ -#define V_FLAG_MASK 0x1FF; -#define V_PHSYNC 0x001 -#define V_NHSYNC 0x002 -#define V_PVSYNC 0x004 -#define V_NVSYNC 0x008 -#define V_INTERLACE 0x010 -#define V_DBLSCAN 0x020 -#define V_CSYNC 0x040 -#define V_PCSYNC 0x080 -#define V_NCSYNC 0x100 -#define V_HSKEW 0x200 - -static int (*savErrorFunc)(); -static int errorOccurred; -static char errMsgBuf[512]; - -/* - Simple error handler -*/ -static int vidError(dis, err) -Display *dis; -XErrorEvent *err; -{ - XGetErrorText(dis, err->error_code, errMsgBuf, 512); - errorOccurred = TRUE; - return 0; -} - -static int modeline2list(interp, mode_line) - Tcl_Interp *interp; - XF86VidModeModeInfo *mode_line; -{ - sprintf(interp->result, "%6.2f %d %d %d %d %d %d %d %d", - mode_line->dotclock/1000.0, - mode_line->hdisplay, mode_line->hsyncstart, - mode_line->hsyncend, mode_line->htotal, - mode_line->vdisplay, mode_line->vsyncstart, - mode_line->vsyncend, mode_line->vtotal); -#define chkflag(flg,string) if (mode_line->flags & flg) \ - Tcl_AppendResult(interp, string, (char *) NULL) - chkflag(V_PHSYNC," +hsync"); - chkflag(V_NHSYNC," -hsync"); - chkflag(V_PVSYNC," +vsync"); - chkflag(V_NVSYNC," -vsync"); - chkflag(V_INTERLACE," interlace"); - chkflag(V_CSYNC," composite"); - chkflag(V_PCSYNC," +csync"); - chkflag(V_NCSYNC," -csync"); - chkflag(V_DBLSCAN," doublescan"); - if (mode_line->flags & V_HSKEW) { - char tmpbuf[16]; - sprintf(tmpbuf, "%d", mode_line->hskew); - Tcl_AppendResult(interp, " doublescan ", tmpbuf, (char *) NULL); - } -#undef chkflag - return TCL_OK; -} - -#define TclOkay(expr) if ((expr) != TCL_OK) return TCL_ERROR - -static int list2modeline(interp, buf, mode_line) - Tcl_Interp *interp; - char *buf; - XF86VidModeModeInfo *mode_line; -{ - char **av; - int ac, i, tmpint; - double tmpdbl; - - TclOkay(Tcl_SplitList(interp, buf, &ac, &av)); - if (ac < 9) return TCL_ERROR; - - mode_line->hskew = 0; - - TclOkay(Tcl_GetDouble(interp, av[0], &tmpdbl)); - mode_line->dotclock = (int) (tmpdbl * 1000.0); - - TclOkay(Tcl_GetInt(interp, av[1], &tmpint)); - mode_line->hdisplay = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[2], &tmpint)); - mode_line->hsyncstart = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[3], &tmpint)); - mode_line->hsyncend = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[4], &tmpint)); - mode_line->htotal = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[5], &tmpint)); - mode_line->vdisplay = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[6], &tmpint)); - mode_line->vsyncstart = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[7], &tmpint)); - mode_line->vsyncend = (unsigned short) tmpint; - TclOkay(Tcl_GetInt(interp, av[8], &tmpint)); - mode_line->vtotal = (unsigned short) tmpint; - - mode_line->flags = 0; - for (i = 9; i < ac; i++) { - if (!strcmp(av[i], "+hsync")) mode_line->flags |= V_PHSYNC; - else if (!strcmp(av[i], "-hsync")) mode_line->flags |= V_NHSYNC; - else if (!strcmp(av[i], "+vsync")) mode_line->flags |= V_PVSYNC; - else if (!strcmp(av[i], "-vsync")) mode_line->flags |= V_NVSYNC; - else if (!strcmp(av[i], "interlace")) mode_line->flags |= V_INTERLACE; - else if (!strcmp(av[i], "composite")) mode_line->flags |= V_CSYNC; - else if (!strcmp(av[i], "+csync")) mode_line->flags |= V_PCSYNC; - else if (!strcmp(av[i], "-csync")) mode_line->flags |= V_NCSYNC; - else if (!strcmp(av[i], "doublescan")) mode_line->flags |= V_DBLSCAN; - else if (!strcmp(av[i], "hskew") && i < ac-1) { - mode_line->flags |= V_HSKEW; - TclOkay(Tcl_GetInt(interp, av[++i], &tmpint)); - mode_line->hskew = (unsigned short) tmpint; - } else { - Tcl_AppendResult(interp, "Invalid mode flag: ", av[i], (char *)0); - return TCL_ERROR; - } - } - mode_line->privsize = 0; - mode_line->private = NULL; - return TCL_OK; -} - -/* - Adds all the vidmode specific commands to the Tcl interpreter -*/ - -int -XF86vid_Init(interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "xf86vid_getversion", - TCL_XF86VidModeQueryVersion, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_getbasevals", - TCL_XF86VidModeQueryExtension, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_addmodeline", - TCL_XF86VidModeAddModeLine, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_modifymodeline", - TCL_XF86VidModeModModeLine, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_checkmodeline", - TCL_XF86VidModeValidateModeLine, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_deletemodeline", - TCL_XF86VidModeDeleteModeLine, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_getmodeline", - TCL_XF86VidModeGetModeLine, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_getallmodelines", - TCL_XF86VidModeGetAllModeLines, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_lockmodeswitch", - TCL_XF86VidModeLockModeSwitch, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_switchmode", - TCL_XF86VidModeSwitchMode, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_switchtomode", - TCL_XF86VidModeSwitchToMode, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_getmonitor", - TCL_XF86VidModeGetMonitor, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86vid_getclocks", - TCL_XF86VidModeGetDotClocks, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* - Implements the xf86vid_getversion command which - returns (in interp->result) the version of the - XFree86-VidModeExtension that is built into the X server - The version is returned simple floating point number (e.g. 0.4) -*/ - -int -TCL_XF86VidModeQueryVersion(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int MajorVersion, MinorVersion; - Tk_Window tkwin; - char tmpbuf[16]; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86vid_getversion", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if (!XF86VidModeQueryVersion(Tk_Display(tkwin), &MajorVersion, &MinorVersion)) - { - Tcl_AppendResult(interp, - "Could not query vidmode extension version", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(tmpbuf, "%d.%d", MajorVersion, MinorVersion); - Tcl_AppendResult(interp, tmpbuf, (char *) NULL); - return TCL_OK; - } -} - - -/* - Implements the xf86vid_getbasevals command which - returns (in interp->result) a list containing two elements. - The first element is the EventBase and the second is the ErrorBase -*/ - -int -TCL_XF86VidModeQueryExtension(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int EventBase, ErrorBase; - Tk_Window tkwin; - char tmpbuf[16]; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86vid_getbasevals", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if (!XF86VidModeQueryExtension(Tk_Display(tkwin), &EventBase, &ErrorBase)) { - Tcl_AppendResult(interp, - "Unable to query video extension information", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(tmpbuf, "%d %d", EventBase, ErrorBase); - Tcl_AppendResult(interp, tmpbuf, (char *) NULL); - return TCL_OK; - } -} - - -/* - Implements the xf86vid_addmodeline command which - adds a new mode to the list of video modes. -*/ - -int -TCL_XF86VidModeAddModeLine(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - XF86VidModeModeInfo newmode, aftermode; - - if (argc < 2 || argc > 3) { - Tcl_SetResult(interp, - "Usage: xf86vid_addmodeline []", - TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - TclOkay(list2modeline(interp, argv[1], &newmode)); - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(vidError); - errorOccurred = 0; - XF86VidModeAddModeLine(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &newmode, - (argc==2)? NULL: &aftermode); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, "Unable to add modeline: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - Implements the xf86vid_modifymodeline command which - changes the current mode is to match the specified parameters. -*/ - -int -TCL_XF86VidModeModModeLine(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - XF86VidModeModeInfo mode_info; - XF86VidModeModeLine mode_line; - - if (argc != 2) { - Tcl_SetResult(interp, - "Usage: xf86vid_modifymodeline ", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - TclOkay(list2modeline(interp, argv[1], &mode_info)); - mode_line.hdisplay = mode_info.hdisplay; - mode_line.hsyncstart = mode_info.hsyncstart; - mode_line.hsyncend = mode_info.hsyncend; - mode_line.htotal = mode_info.htotal; - mode_line.hskew = mode_info.hskew; - mode_line.vdisplay = mode_info.vdisplay; - mode_line.vsyncstart = mode_info.vsyncstart; - mode_line.vsyncend = mode_info.vsyncend; - mode_line.vtotal = mode_info.vtotal; - mode_line.flags = mode_info.flags; - mode_line.privsize = mode_info.privsize; - mode_line.private = mode_info.private; - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(vidError); - errorOccurred = 0; - XF86VidModeModModeLine(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &mode_line); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, "Unable to modify modeline: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - Implements the xf86vid_checkmodeline command which - checks that the specified mode is usable with the - video driver and monitor. -*/ - -int -TCL_XF86VidModeValidateModeLine(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - XF86VidModeModeInfo mode_line; - - if (argc != 2) { - Tcl_SetResult(interp, - "Usage: xf86vid_checkmodeline ", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - TclOkay(list2modeline(interp, argv[1], &mode_line)); - sprintf(interp->result, "%d", - XF86VidModeValidateModeLine(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &mode_line)); - return TCL_OK; -} - -/* - Implements the xf86vid_deletemodeline command which - removes the specified mode from the list of valid modes -*/ - -int -TCL_XF86VidModeDeleteModeLine(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - XF86VidModeModeInfo mode_line; - - if (argc != 2) { - Tcl_SetResult(interp, - "Usage: xf86vid_deletemodeline ", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - TclOkay(list2modeline(interp, argv[1], &mode_line)); - - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(vidError); - errorOccurred = 0; - XF86VidModeDeleteModeLine(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &mode_line); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, "Unable to delete modeline: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - Implements the xf86vid_getmodeline command which - returns (in interp->result) a list containing the - various video mode parameters (including any flags) - of the current mode -*/ - -int -TCL_XF86VidModeGetModeLine(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int dot_clock; - Tk_Window tkwin; - XF86VidModeModeLine mode_line; - XF86VidModeModeInfo mode_info; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86vid_getmodeline", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if (!XF86VidModeGetModeLine(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), - &dot_clock, &mode_line)) { - Tcl_AppendResult(interp, - "Unable to get mode line information", - (char *) NULL); - return TCL_ERROR; - } - XtFree((char *) mode_line.private); - mode_info.dotclock = dot_clock; - mode_info.hdisplay = mode_line.hdisplay; - mode_info.hsyncstart = mode_line.hsyncstart; - mode_info.hsyncend = mode_line.hsyncend; - mode_info.htotal = mode_line.htotal; - mode_info.hskew = mode_line.hskew; - mode_info.vdisplay = mode_line.vdisplay; - mode_info.vsyncstart = mode_line.vsyncstart; - mode_info.vsyncend = mode_line.vsyncend; - mode_info.vtotal = mode_line.vtotal; - mode_info.flags = mode_line.flags; - return modeline2list(interp, &mode_info); -} - -/* - Implements the xf86vid_getallmodelines command which - returns (in interp->result) a list containing lists of the - various video mode parameters (including any flags) -*/ - -int -TCL_XF86VidModeGetAllModeLines(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int i, modecount, mode_flags; - Tk_Window topwin, tkwin; - XF86VidModeModeInfo **modelines; - char tmpbuf[200], tmpbuf2[16]; - - if (argc != 1 && !(argc==3 && !strcmp(argv[1],"-displayof"))) { - Tcl_SetResult(interp, - "Usage: xf86vid_getallmodelines [-displayof ]", - TCL_STATIC); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if (argc == 3) { - tkwin = Tk_NameToWindow(interp, argv[2], topwin); - } else - tkwin = topwin; - if (!XF86VidModeGetAllModeLines(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), - &modecount, &modelines)) { - Tcl_AppendResult(interp, - "Unable to get mode line information", - (char *) NULL); - return TCL_ERROR; - } else { - for (i = 0; i < modecount; i++) { - sprintf(tmpbuf, "%6.2f %d %d %d %d %d %d %d %d", - (float) modelines[i]->dotclock/1000.0, - modelines[i]->hdisplay, modelines[i]->hsyncstart, - modelines[i]->hsyncend, modelines[i]->htotal, - modelines[i]->vdisplay, modelines[i]->vsyncstart, - modelines[i]->vsyncend, modelines[i]->vtotal); - mode_flags = modelines[i]->flags; - if (mode_flags & V_PHSYNC) strcat(tmpbuf, " +hsync"); - if (mode_flags & V_NHSYNC) strcat(tmpbuf, " -hsync"); - if (mode_flags & V_PVSYNC) strcat(tmpbuf, " +vsync"); - if (mode_flags & V_NVSYNC) strcat(tmpbuf, " -vsync"); - if (mode_flags & V_INTERLACE) strcat(tmpbuf, " interlace"); - if (mode_flags & V_CSYNC) strcat(tmpbuf, " composite"); - if (mode_flags & V_PCSYNC) strcat(tmpbuf, " +csync"); - if (mode_flags & V_NCSYNC) strcat(tmpbuf, " -csync"); - if (mode_flags & V_DBLSCAN) strcat(tmpbuf, " doublescan"); - if (mode_flags & V_HSKEW) { - strcat(tmpbuf, " hskew "); - sprintf(tmpbuf2, "%d", modelines[i]->hskew); - strcat(tmpbuf, tmpbuf2); - } - Tcl_AppendElement(interp, tmpbuf); - } - XtFree((char *) modelines); - return TCL_OK; - } -} - -/* - Returns the monitor's manufacturer and model names and its - horiz and vert sync rates, -*/ - -int -TCL_XF86VidModeGetMonitor(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ -#define MNHSync ((int) monitor.nhsync) -#define MNVSync ((int) monitor.nvsync) - - XF86VidModeMonitor monitor; - Tk_Window tkwin; - char *Hsyncbuf, *Vsyncbuf, *tmpptr, *av[5]; - int i; - - if (argc != 1) { - Tcl_SetResult(interp, "Usage: xf86vid_getmonitor", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if (!XF86VidModeGetMonitor(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &monitor)) - { - Tcl_AppendResult(interp, - "Could not get monitor information", - (char *) NULL); - return TCL_ERROR; - } else { - av[0] = monitor.vendor; - av[1] = monitor.model; - - tmpptr = Hsyncbuf = XtMalloc(MNHSync*14); - for (i = 0; i < MNHSync; i++) { - sprintf(tmpptr, "%s%.5g-%.5g", (i? ",": ""), - monitor.hsync[i].lo, monitor.hsync[i].hi); - tmpptr += strlen(tmpptr); - } - av[2] = Hsyncbuf; - - tmpptr = Vsyncbuf = XtMalloc(MNVSync*14); - for (i = 0; i < MNVSync; i++) { - sprintf(tmpptr, "%s%.5g-%.5g", (i? ",": ""), - monitor.vsync[i].lo, monitor.vsync[i].hi); - tmpptr += strlen(tmpptr); - } - av[3] = Vsyncbuf; - av[4] = NULL; - - Tcl_SetResult(interp, Tcl_Merge(4, av), TCL_DYNAMIC); - XtFree(Hsyncbuf); - XtFree(Vsyncbuf); - XtFree(monitor.vendor); - XtFree(monitor.model); - XtFree((char *) monitor.hsync); - XtFree((char *) monitor.vsync); - return TCL_OK; - } -#undef MNHSync -#undef MNVSync -} - -/* - Turn on/off video mode switching -*/ - -int -TCL_XF86VidModeLockModeSwitch(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - int lock; - Tk_Window tkwin; - static char usagemsg[] = "Usage: xf86vid_lockmodeswitch lock|unlock"; - - if (argc != 2) { - Tcl_SetResult(interp, usagemsg, TCL_STATIC); - return TCL_ERROR; - } - - if (!strcmp(argv[1], "lock")) { - lock = TRUE; - } else if (!strcmp(argv[1], "unlock")) { - lock = FALSE; - } else { - Tcl_SetResult(interp, usagemsg, TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(vidError); - errorOccurred = 0; - XF86VidModeLockModeSwitch(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), lock); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, "Unable to ", - (lock? "":"un"), "lock mode switching: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - Change to the previous/next video mode -*/ - -int -TCL_XF86VidModeSwitchMode(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ -#define PREV -1 -#define NEXT 1 - int direction; - Tk_Window tkwin; - static char usagemsg[] = "Usage: xf86vid_switchmode previous|next"; - - if (argc != 2) { - Tcl_SetResult(interp, usagemsg, TCL_STATIC); - return TCL_ERROR; - } - - if (!strncmp(argv[1], "prev", 4)) { - direction = PREV; - } else if (!strcmp(argv[1], "next")) { - direction = NEXT; - } else { - Tcl_SetResult(interp, usagemsg, TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - - XSync(Tk_Display(tkwin), False); - savErrorFunc = XSetErrorHandler(vidError); - errorOccurred = 0; - XF86VidModeSwitchMode(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), direction); - XSync(Tk_Display(tkwin), False); - XSetErrorHandler(savErrorFunc); - if (errorOccurred) { - Tcl_AppendResult(interp, - "Unable to switch modes: ", - errMsgBuf, (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -#undef PREV -#undef NEXT -} - -/* - Implements the xf86vid_switchtomode command which - attempts to make the specified video mode, the current display mode -*/ - -int -TCL_XF86VidModeSwitchToMode(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - XF86VidModeModeInfo mode_line; - - if (argc != 2) { - Tcl_SetResult(interp, - "Usage: xf86vid_switchtomode ", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - TclOkay(list2modeline(interp, argv[1], &mode_line)); - - sprintf(interp->result, "%d", - XF86VidModeSwitchToMode(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), &mode_line)); - return TCL_OK; -} - -/* - Implements the xf86vid_getclocks command which - returns a list of available dot clocks -*/ - -int -TCL_XF86VidModeGetDotClocks(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window tkwin; - int flags, numclocks, maxclocks, *clocks, i; - char tmpbuf[200]; - - if (argc != 1) { - Tcl_SetResult(interp, - "Usage: xf86vid_getclocks", TCL_STATIC); - return TCL_ERROR; - } - - if ((tkwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - - if (!XF86VidModeGetDotClocks(Tk_Display(tkwin), - Tk_ScreenNumber(tkwin), - &flags, &numclocks, &maxclocks, &clocks)) - { - Tcl_AppendResult(interp, - "Unable to get dot clock information", - (char *) NULL); - return TCL_ERROR; - } else { - sprintf(tmpbuf, "%d", - maxclocks * ((flags&CLKFLAG_PROGRAMABLE)? -1: 1)); - Tcl_SetResult(interp, tmpbuf, TCL_VOLATILE); - - for (i = 0; i < numclocks; i++) { - sprintf(tmpbuf, "%d", clocks[i]); - Tcl_AppendElement(interp, tmpbuf); - } - } - - return TCL_OK; -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h:3.5 xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h:3.5 Thu Jul 10 04:17:20 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h Sat Feb 28 21:42:23 2004 @@ -1,131 +0,0 @@ -/* $XConsortium: tclvidmode.h /main/2 1996/10/19 19:06:34 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclvidmode.h,v 3.5 1997/07/10 08:17:20 hohndel Exp $ */ - -#include -#include -#include -#include -#include - -int TCL_XF86VidModeQueryVersion( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeQueryExtension( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeAddModeLine( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeModModeLine( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeValidateModeLine( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeDeleteModeLine( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeGetModeLine( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeGetAllModeLines( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeGetMonitor( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeLockModeSwitch( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeSwitchMode( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeSwitchToMode( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - -int TCL_XF86VidModeGetDotClocks( -#if NeedNestedPrototypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -#endif -); - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c:3.31 xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c:3.31 Fri May 31 14:45:57 2002 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c Sat Feb 28 21:42:23 2004 @@ -1,273 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclxfconf.c,v 3.31 2002/05/31 18:45:57 dawes Exp $ */ -/* - * Copyright 1996,1999 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ -/* $XConsortium: tclxfconf.c /main/3 1996/10/23 11:44:07 kaleb $ */ - - -/* - - This file contains Tcl bindings to the XF86Config file read/write routines - - */ - -#include "X.h" -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Parser.h" -#include "xf86tokens.h" - -#include "xf86Xinput.h" -#include "mouse.h" - -#include "tcl.h" - -#include "xfsconf.h" - -#include -#include -#include - -XF86ConfigPtr config_list; - -Tcl_Interp *errinterp; - -Bool Must_have_memory = FALSE; - -/* Error handling functions */ - -void -VErrorF(f, args) - const char *f; - va_list args; -{ - char tmpbuf[1024]; - vsprintf(tmpbuf, f, args); - Tcl_AppendResult(errinterp, tmpbuf, (char *) NULL); -} - -void -ErrorF(const char * f, ...) -{ - va_list args; - va_start(args, f); - VErrorF(f, args); - va_end(args); -} - -void -FatalError(const char *f, ...) -{ - va_list args; - ErrorF("\nFatal server error:\n"); - va_start(args, f); - VErrorF(f, args); - va_end(args); - ErrorF("\n"); -} - -/* - Adds the config file R/W commands to the Tcl interpreter -*/ - -int -XF86Config_Init(interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "xf86config_readfile", - TCL_XF86ReadXF86Config, (ClientData) NULL, - (void (*)()) NULL); - - Tcl_CreateCommand(interp, "xf86config_writefile", - TCL_XF86WriteXF86Config, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* - Convert the given value to a string representation in the specified - base. If the value is zero, return an empty string -*/ - -char *NonZeroStr(val, base) - unsigned long val; - int base; -{ - static char tmpbuf[16]; - - if (val) { - if (base == 16) - sprintf(tmpbuf, "%#lx", val); - else - sprintf(tmpbuf, "%ld", val); - return tmpbuf; - } else - return ""; -} - -/* other subroutines */ - -#define DIR_FILE "/fonts.dir" - -/* - * xf86GetPathElem -- - * Extract a single element from the font path string starting at - * pnt. The font path element will be returned, and pnt will be - * updated to point to the start of the next element, or set to - * NULL if there are no more. - * - * Taken from xf86Config.c. - */ -char * -get_path_elem(pnt) - char **pnt; -{ - char *p1; - - p1 = *pnt; - *pnt = strchr(*pnt, ','); - if (*pnt != NULL) { - **pnt = '\0'; - *pnt += 1; - } - return(p1); -} - -/* - * xf86ValidateFontPath -- - * Validates the user-specified font path. Each element that - * begins with a '/' is checked to make sure the directory exists. - * If the directory exists, the existence of a file named 'fonts.dir' - * is checked. If either check fails, an error is printed and the - * element is removed from the font path. - * - * Taken from xf86Config.c. - */ -#define CHECK_TYPE(mode, type) ((S_IFMT & (mode)) == (type)) -char * -validate_font_path(path) - char *path; -{ - char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem; - struct stat stat_buf; - int flag; - int dirlen; - - tmp_path = (char *)XtCalloc(1,strlen(path)+1); - out_pnt = tmp_path; - path_elem = NULL; - next = path; - while (next != NULL) { - path_elem = get_path_elem(&next); -#ifndef __UNIXOS2__ - if (*path_elem == '/') { - dir_elem = (char *)XtCalloc(1, strlen(path_elem) + 1); - if ((p1 = strchr(path_elem, ':')) != 0) -#else - /* OS/2 must prepend X11ROOT */ - if (*path_elem == '/') { - path_elem = (char*)__XOS2RedirRoot(path_elem); - dir_elem = (char*)XtCalloc(1, strlen(path_elem) + 1); - if (p1 = strchr(path_elem+2, ':')) -#endif - dirlen = p1 - path_elem; - else - dirlen = strlen(path_elem); - strncpy(dir_elem, path_elem, dirlen); - dir_elem[dirlen] = '\0'; - flag = stat(dir_elem, &stat_buf); - if (flag == 0) - if (!CHECK_TYPE(stat_buf.st_mode, S_IFDIR)) - flag = -1; - if (flag != 0) { - ErrorF("Warning: The directory \"%s\" does not exist.\n", dir_elem); - ErrorF(" Entry deleted from font path.\n"); - continue; - } - else { - p1 = (char *)XtMalloc(strlen(dir_elem)+strlen(DIR_FILE)+1); - strcpy(p1, dir_elem); - strcat(p1, DIR_FILE); - flag = stat(p1, &stat_buf); - if (flag == 0) - if (!CHECK_TYPE(stat_buf.st_mode, S_IFREG)) - flag = -1; -#ifndef __UNIXOS2__ - XtFree(p1); -#endif - if (flag != 0) { - ErrorF("Warning: 'fonts.dir' not found (or not valid) in \"%s\".\n", - dir_elem); - ErrorF(" Entry deleted from font path.\n"); - ErrorF(" (Run 'mkfontdir' on \"%s\").\n", dir_elem); - continue; - } - } - XtFree(dir_elem); - } - - /* - * Either an OK directory, or a font server name. So add it to - * the path. - */ - if (out_pnt != tmp_path) - *out_pnt++ = ','; - strcat(out_pnt, path_elem); - out_pnt += strlen(path_elem); - } - return(tmp_path); -} - -/* - * xf86TokenToString -- - * returns the string corresponding to token - */ -char * -token_to_string(SymTabPtr table, int token) -{ - int i; - - for (i = 0; table[i].token >= 0 && table[i].token != token; i++) - ; - if (table[i].token < 0) - return("unknown"); - else - return((char *) table[i].name); -} - -/* - * xf86StringToToken -- - * returns the string corresponding to token - */ -int -string_to_token(table, string) - SymTabPtr table; - char *string; -{ - int i; - - for (i = 0; table[i].token >= 0 && NameCompare(string, table[i].name); i++) - ; - return(table[i].token); -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c:3.2 Fri Dec 27 01:54:25 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c Sat Feb 28 21:42:23 2004 @@ -1,557 +0,0 @@ -/* $XConsortium: tclxkbui.c /main/2 1996/10/19 19:06:46 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tclxkbui.c,v 3.2 1996/12/27 06:54:25 dawes Exp $ */ -/* - * tkXkbUIWin.c -- - * - * This module implements "xkbview" widgets. - * A "xkbview" is a widget that uses the xkbui library to - * display a representation of the keyboard as described by - * the XKB geometry. - * - * Copyright 1996 Joseph Moss - * - * The file is derived from the sample widget code tkSquare.c, which is - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 1994-1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#include -#include -#include -#include -#include -#include - -#define DEF_XKBUI_HEIGHT "100" -#define DEF_XKBUI_WIDTH "300" - -extern char * TkInitXkbUIWin _ANSI_ARGS_((Tcl_Interp *interp, - Tk_Window tkwin, int toplevel, int argc, - char *argv[])); - -extern XkbDescPtr GetXkbDescPtr _ANSI_ARGS_((Tcl_Interp *interp, - char *handle)); - -/* - * A data structure of the following type is kept for each xkbview - * widget managed by this file: - */ - -typedef struct { - Tk_Window tkwin; /* Window that embodies the xkbview. NULL - * means window has been deleted but - * widget record hasn't been cleaned up yet. */ - Display *display; /* X's token for the window's display. */ - Tcl_Interp *interp; /* Interpreter associated with widget. */ - Tcl_Command widgetCmd; /* Token for xkbview's widget command. */ - int width, height; /* Window height & width */ - - /* - * Information used when displaying widget: - */ - - int borderWidth; /* Width of 3-D border around whole widget. */ - Tk_3DBorder bgBorder; /* Used for drawing background. */ - int relief; /* Indicates whether window as a whole is - * raised, sunken, or flat. */ - GC gc; /* Graphics context for copying from - * off-screen pixmap onto screen. */ - int doubleBuffer; /* Non-zero means double-buffer redisplay - * with pixmap; zero means draw straight - * onto the display. */ - int updatePending; /* Non-zero means a call to XkbUIWinDisplay - * has already been scheduled. */ - char *xkbHandle; /* Handle of XkbDescRec */ - XkbUI_ViewPtr view; /* XkbUI view structure */ - -} XkbUIWin; - -/* - * Information used for argv parsing. - */ - -static Tk_ConfigSpec configSpecs[] = { - {TK_CONFIG_BORDER, "-background", "background", "Background", - "#cdb79e", Tk_Offset(XkbUIWin, bgBorder), TK_CONFIG_COLOR_ONLY}, - {TK_CONFIG_BORDER, "-background", "background", "Background", - "white", Tk_Offset(XkbUIWin, bgBorder), TK_CONFIG_MONO_ONLY}, - {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL, - (char *) NULL, 0, 0}, - {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL, - (char *) NULL, 0, 0}, - {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - "2", Tk_Offset(XkbUIWin, borderWidth), 0}, - {TK_CONFIG_INT, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", Tk_Offset(XkbUIWin, doubleBuffer), 0}, - {TK_CONFIG_PIXELS, "-height", "height", "Height", - DEF_XKBUI_HEIGHT, Tk_Offset(XkbUIWin, height), 0}, - {TK_CONFIG_STRING, "-keyboard", "keyboard", (char *) NULL, - "xkb1", Tk_Offset(XkbUIWin, xkbHandle), 0}, - {TK_CONFIG_SYNONYM, "-kbd", "keyboard", (char *) NULL, - (char *) NULL, 0, 0}, - {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", - "raised", Tk_Offset(XkbUIWin, relief), 0}, - {TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_XKBUI_WIDTH, Tk_Offset(XkbUIWin, width), 0}, - {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL, - (char *) NULL, 0, 0} -}; - -/* - * Forward declarations for procedures defined later in this file: - */ - -static void XkbUIWinCmdDeletedProc _ANSI_ARGS_(( - ClientData clientData)); -static int XkbUIWinConfigure _ANSI_ARGS_((Tcl_Interp *interp, - XkbUIWin *xkbui, int argc, char **argv, - int flags)); -static void XkbUIWinDestroy _ANSI_ARGS_((ClientData clientData)); -static void XkbUIWinDisplay _ANSI_ARGS_((ClientData clientData)); -static void XkbUIWinEventProc _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -static int XkbUIWinWidgetCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *, int argc, char **argv)); - -/* - *-------------------------------------------------------------- - * - * XkbUIWinCmd -- - * - * This procedure is invoked to process the "xkbview" Tcl - * command. It creates a new "xkbview" widget. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * A new widget is created and configured. - * - *-------------------------------------------------------------- - */ - -int -XkbUIWinCmd(clientData, interp, argc, argv) - ClientData clientData; /* Main window associated with - * interpreter. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tk_Window main = (Tk_Window) clientData; - XkbUIWin *xkbuiPtr; - Tk_Window tkwin; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " pathName ?options?\"", (char *) NULL); - return TCL_ERROR; - } - - tkwin = Tk_CreateWindowFromPath(interp, main, argv[1], (char *) NULL); - if (tkwin == NULL) { - return TCL_ERROR; - } - Tk_SetClass(tkwin, "Xkbui"); - - /* - * Allocate and initialize the widget record. - */ - - xkbuiPtr = (XkbUIWin *) ckalloc(sizeof(XkbUIWin)); - xkbuiPtr->tkwin = tkwin; - xkbuiPtr->display = Tk_Display(tkwin); - xkbuiPtr->interp = interp; - xkbuiPtr->widgetCmd = Tcl_CreateCommand(interp, - Tk_PathName(xkbuiPtr->tkwin), XkbUIWinWidgetCmd, - (ClientData) xkbuiPtr, XkbUIWinCmdDeletedProc); - xkbuiPtr->height = -1; - xkbuiPtr->width = -1; - xkbuiPtr->borderWidth = 0; - xkbuiPtr->bgBorder = NULL; - xkbuiPtr->relief = TK_RELIEF_FLAT; - xkbuiPtr->gc = None; - xkbuiPtr->doubleBuffer = 1; - xkbuiPtr->updatePending = 0; - xkbuiPtr->xkbHandle = NULL; - xkbuiPtr->view = NULL; - - Tk_CreateEventHandler(xkbuiPtr->tkwin, ExposureMask|StructureNotifyMask, - XkbUIWinEventProc, (ClientData) xkbuiPtr); - if (XkbUIWinConfigure(interp, xkbuiPtr, argc-2, argv+2, 0) != TCL_OK) { - Tk_DestroyWindow(xkbuiPtr->tkwin); - return TCL_ERROR; - } - - interp->result = Tk_PathName(xkbuiPtr->tkwin); - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * XkbUIWinWidgetCmd -- - * - * This procedure is invoked to process the Tcl command - * that corresponds to a widget managed by this module. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *-------------------------------------------------------------- - */ - -static int -XkbUIWinWidgetCmd(clientData, interp, argc, argv) - ClientData clientData; /* Information about xkbview widget. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - XkbUIWin *xkbuiPtr = (XkbUIWin *) clientData; - int result = TCL_OK; - size_t length; - char c; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option ?arg arg ...?\"", (char *) NULL); - return TCL_ERROR; - } - Tk_Preserve((ClientData) xkbuiPtr); - c = argv[1][0]; - length = strlen(argv[1]); - if ((c == 'c') && (strncmp(argv[1], "cget", length) == 0) - && (length >= 2)) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " cget option\"", - (char *) NULL); - goto error; - } - result = Tk_ConfigureValue(interp, xkbuiPtr->tkwin, configSpecs, - (char *) xkbuiPtr, argv[2], 0); - } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0) - && (length >= 2)) { - if (argc == 2) { - result = Tk_ConfigureInfo(interp, xkbuiPtr->tkwin, configSpecs, - (char *) xkbuiPtr, (char *) NULL, 0); - } else if (argc == 3) { - result = Tk_ConfigureInfo(interp, xkbuiPtr->tkwin, configSpecs, - (char *) xkbuiPtr, argv[2], 0); - } else { - result = XkbUIWinConfigure(interp, xkbuiPtr, argc-2, argv+2, - TK_CONFIG_ARGV_ONLY); - } - } else if ((c == 'r') && (strncmp(argv[1], "refresh", length) == 0) - && (length >= 2)) { - /* Nothing - The call to Tk_DoWhenIdle below takes care of this */ - ; - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be cget, configure, or refresh", - (char *) NULL); - goto error; - } - if (!xkbuiPtr->updatePending) { - Tk_DoWhenIdle(XkbUIWinDisplay, (ClientData) xkbuiPtr); - xkbuiPtr->updatePending = 1; - } - Tk_Release((ClientData) xkbuiPtr); - return result; - - error: - Tk_Release((ClientData) xkbuiPtr); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * XkbUIWinConfigure -- - * - * This procedure is called to process an argv/argc list in - * conjunction with the Tk option database to configure (or - * reconfigure) a xkbview widget. - * - * Results: - * The return value is a standard Tcl result. If TCL_ERROR is - * returned, then interp->result contains an error message. - * - * Side effects: - * Configuration information, such as colors, border width, - * etc. get set for xkbuiPtr; old resources get freed, - * if there were any. - * - *---------------------------------------------------------------------- - */ - -static int -XkbUIWinConfigure(interp, xkbuiPtr, argc, argv, flags) - Tcl_Interp *interp; /* Used for error reporting. */ - XkbUIWin *xkbuiPtr; /* Information about widget. */ - int argc; /* Number of valid entries in argv. */ - char **argv; /* Arguments. */ - int flags; /* Flags to pass to - * Tk_ConfigureWidget. */ -{ - if (Tk_ConfigureWidget(interp, xkbuiPtr->tkwin, configSpecs, - argc, argv, (char *) xkbuiPtr, flags) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Set the background for the window and create a graphics context - * for use during redisplay. - */ - - Tk_SetWindowBackground(xkbuiPtr->tkwin, - Tk_3DBorderColor(xkbuiPtr->bgBorder)->pixel); - if ((xkbuiPtr->gc == None) && (xkbuiPtr->doubleBuffer)) { - XGCValues gcValues; - gcValues.function = GXcopy; - gcValues.graphics_exposures = False; - xkbuiPtr->gc = Tk_GetGC(xkbuiPtr->tkwin, - GCFunction|GCGraphicsExposures, &gcValues); - } - - /* - * Register the desired geometry for the window. Then arrange for - * the window to be redisplayed. - */ - - Tk_GeometryRequest(xkbuiPtr->tkwin, 200, 150); - Tk_SetInternalBorder(xkbuiPtr->tkwin, xkbuiPtr->borderWidth); - if (!xkbuiPtr->updatePending) { - Tk_DoWhenIdle(XkbUIWinDisplay, (ClientData) xkbuiPtr); - xkbuiPtr->updatePending = 1; - } - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * XkbUIWinEventProc -- - * - * This procedure is invoked by the Tk dispatcher for various - * events on xkbviews. - * - * Results: - * None. - * - * Side effects: - * When the window gets deleted, internal structures get - * cleaned up. When it gets exposed, it is redisplayed. - * - *-------------------------------------------------------------- - */ - -static void -XkbUIWinEventProc(clientData, eventPtr) - ClientData clientData; /* Information about window. */ - XEvent *eventPtr; /* Information about event. */ -{ - XkbUIWin *xkbuiPtr = (XkbUIWin *) clientData; - - if (eventPtr->type == Expose) { - if (!xkbuiPtr->updatePending) { - Tk_DoWhenIdle(XkbUIWinDisplay, (ClientData) xkbuiPtr); - xkbuiPtr->updatePending = 1; - } - } else if (eventPtr->type == ConfigureNotify) { - if (!xkbuiPtr->updatePending) { - Tk_DoWhenIdle(XkbUIWinDisplay, (ClientData) xkbuiPtr); - xkbuiPtr->updatePending = 1; - } - } else if (eventPtr->type == DestroyNotify) { - if (xkbuiPtr->tkwin != NULL) { - xkbuiPtr->tkwin = NULL; - Tcl_DeleteCommand(xkbuiPtr->interp, - Tcl_GetCommandName(xkbuiPtr->interp, - xkbuiPtr->widgetCmd)); - } - if (xkbuiPtr->updatePending) { - Tk_CancelIdleCall(XkbUIWinDisplay, (ClientData) xkbuiPtr); - } - Tk_EventuallyFree((ClientData) xkbuiPtr, - (Tcl_FreeProc *)XkbUIWinDestroy); - } -} - -/* - *---------------------------------------------------------------------- - * - * XkbUIWinCmdDeletedProc -- - * - * This procedure is invoked when a widget command is deleted. If - * the widget isn't already in the process of being destroyed, - * this command destroys it. - * - * Results: - * None. - * - * Side effects: - * The widget is destroyed. - * - *---------------------------------------------------------------------- - */ - -static void -XkbUIWinCmdDeletedProc(clientData) - ClientData clientData; /* Pointer to widget record for widget. */ -{ - XkbUIWin *xkbuiPtr = (XkbUIWin *) clientData; - Tk_Window tkwin = xkbuiPtr->tkwin; - - /* - * This procedure could be invoked either because the window was - * destroyed and the command was then deleted (in which case tkwin - * is NULL) or because the command was deleted, and then this procedure - * destroys the widget. - */ - - if (tkwin != NULL) { - xkbuiPtr->tkwin = NULL; - Tk_DestroyWindow(tkwin); - } -} - -/* - *-------------------------------------------------------------- - * - * XkbUIWinDisplay -- - * - * This procedure redraws the contents of a xkbview window. - * It is invoked as a do-when-idle handler, so it only runs - * when there's nothing else for the application to do. - * - * Results: - * None. - * - * Side effects: - * Information appears on the screen. - * - *-------------------------------------------------------------- - */ - -static void -XkbUIWinDisplay(clientData) - ClientData clientData; /* Information about window. */ -{ - XkbUIWin *xkbuiPtr = (XkbUIWin *) clientData; - Tk_Window tkwin = xkbuiPtr->tkwin; - Pixmap pm = None; - Drawable d; - XkbDescPtr xkb; - XkbUI_ViewOptsRec opts; - int width, height, bd; - - xkbuiPtr->updatePending = 0; - if (!Tk_IsMapped(tkwin)) { - return; - } - - /* - * Create a pixmap for double-buffering, if necessary. - */ - - if (xkbuiPtr->doubleBuffer) { - pm = XCreatePixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), - (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), - (unsigned) DefaultDepthOfScreen(Tk_Screen(tkwin))); - d = pm; - } else { - d = Tk_WindowId(tkwin); - } - - /* - * Redraw the widget's background and border. - */ - - Tk_Fill3DRectangle(tkwin, d, xkbuiPtr->bgBorder, 0, 0, Tk_Width(tkwin), - Tk_Height(tkwin), xkbuiPtr->borderWidth, xkbuiPtr->relief); - - /* - * Display the keyboard. - */ - - bzero((char *)&opts, sizeof(opts)); - bd = 0; - if (xkbuiPtr->relief != TK_RELIEF_FLAT) - bd = xkbuiPtr->borderWidth; - opts.present = XkbUI_SizeMask|XkbUI_ColormapMask - |XkbUI_MarginMask|XkbUI_OffsetMask; - opts.margin_width = opts.margin_height = 0; - opts.viewport.x = opts.viewport.y = bd; - width = opts.viewport.width = Tk_Width(tkwin) - 2*bd; - height = opts.viewport.height = Tk_Height(tkwin) - 2*bd; - opts.cmap = Tk_Colormap(tkwin); - xkb = GetXkbDescPtr(xkbuiPtr->interp, xkbuiPtr->xkbHandle); - if (xkb != NULL) { - if (xkbuiPtr->view) - ckfree(xkbuiPtr->view); - xkbuiPtr->view= XkbUI_Init(xkbuiPtr->display, d, - width, height, xkb, &opts); - if (xkbuiPtr->view) - XkbUI_DrawRegion(xkbuiPtr->view,NULL); - } - - /* - * If double-buffered, copy to the screen and release the pixmap. - */ - - if (xkbuiPtr->doubleBuffer) { - XCopyArea(Tk_Display(tkwin), pm, Tk_WindowId(tkwin), xkbuiPtr->gc, - 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), - 0, 0); - XFreePixmap(Tk_Display(tkwin), pm); - } -} - -/* - *---------------------------------------------------------------------- - * - * XkbUIWinDestroy -- - * - * This procedure is invoked by Tk_EventuallyFree or Tk_Release - * to clean up the internal structure of a xkbview at a safe time - * (when no-one is using it anymore). - * - * Results: - * None. - * - * Side effects: - * Everything associated with the xkbview is freed up. - * - *---------------------------------------------------------------------- - */ - -static void -XkbUIWinDestroy(clientData) - ClientData clientData; /* Info about xkbview widget. */ -{ - XkbUIWin *xkbuiPtr = (XkbUIWin *) clientData; - - Tk_FreeOptions(configSpecs, (char *) xkbuiPtr, xkbuiPtr->display, 0); - if (xkbuiPtr->gc != None) { - Tk_FreeGC(xkbuiPtr->display, xkbuiPtr->gc); - } - if (xkbuiPtr->view != NULL) { - ckfree(xkbuiPtr->view); - } - ckfree((char *) xkbuiPtr); -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c:3.1 Fri Dec 27 01:54:26 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c Sat Feb 28 21:42:24 2004 @@ -1,185 +0,0 @@ -/* $XConsortium: tkother.c /main/2 1996/10/19 19:06:55 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tkother.c,v 3.1 1996/12/27 06:54:26 dawes Exp $ */ -/* - * Copyright 1996 by Joseph V. Moss - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Joseph Moss not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Joseph Moss makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * JOSEPH MOSS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL JOSEPH MOSS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -/* - - This file contains routines to add a few misc commands to Tcl - which require the Tk toolkit - - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int TK_XF86FindWindow( -#if NeedNestedProtoTypes - ClientData clientData, - Tcl_Interp *interp, - int argc, - char *argv[] -#endif -); - -/* - Adds all the new commands to the Tcl interpreter -*/ - -int -XF86TkOther_Init(interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand(interp, "findfocuswindow", - TK_XF86FindWindow, (ClientData) NULL, - (void (*)()) NULL); - - return TCL_OK; -} - -/* - Search (starting from the given win) along the specified axis for a - window which accepts focus, move the specified number pixels at a time - when searching. For each increment it looks first from the center - of the starting window, then midway between the center and one side, - then midway between the center and the other side, then from each - side. For example: - - A +---------------+ - | | - +---------------+ B - 4 2 1 3 5 - - if searching down from the window (which stretches from point A to - point B), the search will start 1*increment pixels down from one, - it then looks 1*increment pixels down from two, etc,, then 2*increment - pixels down from one, 2*increment down from two, and so on until - a widow is found which will accept the keyboard focus. - - If no suitable window is found the original window is returned. -*/ - -static char fwusage[] = "Usage: findfocuswindow x|y "; - -int -TK_XF86FindWindow(clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char *argv[]; -{ - Tk_Window topwin, oldwin, tkwin; - int ulx, uly, wid, ht, limit, increment; - int x, y, idx, pos[5]; - - if (argc != 4) { - sprintf(interp->result, fwusage); - return TCL_ERROR; - } - - if ((topwin = Tk_MainWindow(interp)) == NULL) - return TCL_ERROR; - if ((oldwin = Tk_NameToWindow(interp, argv[1], topwin)) == NULL) - return TCL_ERROR; - - if (Tcl_GetInt(interp, argv[3], &increment) != TCL_OK) - return TCL_ERROR; - - Tk_GetRootCoords(oldwin, &ulx, &uly); - wid = Tk_Width(oldwin); - ht = Tk_Height(oldwin); - - if (!strcmp(argv[2], "x")) { - limit = WidthOfScreen(Tk_Screen(oldwin)); - if (increment < 0) - x = ulx; - else - x = ulx+wid; - pos[0] = (2*uly+ht)/2; - pos[1] = (uly+pos[0])/2; - pos[2] = (uly+ht+pos[0])/2; - pos[3] = uly; - pos[4] = uly+ht; - while (0 < x && x < limit) { - x += increment; - for (idx=0; idx < 5; idx++) { - tkwin = Tk_CoordsToWindow(x, pos[idx], topwin); - if ( tkwin ) { - if (Tcl_VarEval(interp, "tkFocusOK ", - Tk_PathName(tkwin), NULL) != TCL_OK) - return TCL_ERROR; - if (!strcmp(interp->result, "1")) { - Tcl_SetResult(interp, Tk_PathName(tkwin), - TCL_STATIC); - return TCL_OK; - } - } - } - } - } else if (!strcmp(argv[2], "y")) { - limit = HeightOfScreen(Tk_Screen(oldwin)); - if (increment < 0) - y = uly; - else - y = uly+ht; - pos[0] = (2*ulx+wid)/2; - pos[1] = (ulx+pos[0])/2; - pos[2] = (ulx+wid+pos[0])/2; - pos[3] = ulx; - pos[4] = ulx+wid; - while (0 < y && y < limit) { - y += increment; - for (idx=0; idx < 5; idx++) { - tkwin = Tk_CoordsToWindow(pos[idx], y, topwin); - if ( tkwin ) { - if (Tcl_VarEval(interp, "tkFocusOK ", - Tk_PathName(tkwin), NULL) != TCL_OK) - return TCL_ERROR; - if (!strcmp(interp->result, "1")) { - Tcl_SetResult(interp, Tk_PathName(tkwin), - TCL_STATIC); - return TCL_OK; - } - } - } - } - } else { - sprintf(interp->result, fwusage); - return TCL_ERROR; - } - Tcl_SetResult(interp, Tk_PathName(oldwin), TCL_STATIC); - return TCL_OK; -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl:1.1 Mon Apr 5 03:13:02 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl Sat Feb 28 21:42:24 2004 @@ -1,470 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/vidmode.tcl,v 1.1 1999/04/05 07:13:02 dawes Exp $ - -proc VidMode_describe { mode } { - set clock [lindex $mode 0] - set hdisp [lindex $mode 1] - set htotal [lindex $mode 4] - set vdisp [lindex $mode 5] - set vtotal [lindex $mode 8] - set desc [format "%4dx%-4d Clock: %6.2f (%6.2f Hz vert, %6.2f kHz horiz)" \ - $hdisp $vdisp $clock \ - [expr $clock*1000000.0/($htotal*$vtotal)] \ - [expr $clock*1000.0/$htotal] ] - set flags [string tolower [lrange $mode 9 end]] - if {[lsearch $flags "interlace"] != -1} { - append desc " Interlaced" - } - if {[lsearch $flags "doublescan"] != -1} { - append desc " DoubleScan" - } - return $desc -} - -proc VidMode_create_widgets { win } { - global vidmListFlag - - VidMode_create_modelist_widgets $win - VidMode_create_modeadjust_widgets $win - - set vidmListFlag 1 - bind $win n [list VidMode_next $win] - bind $win p [list VidMode_prev $win] - #bind $win [list VidMode_next $win] - #bind $win [list VidMode_prev $win] -} - -proc VidMode_create_modelist_widgets { win } { - global vidmMode vidmCurrentModes vidmValidModes MonitorStdModes - global tcl_library - - set w [winpathprefix $win] - set vidmCurrentModes [xf86vid_getallmodelines] - frame $w.curr - label $w.curr.title -anchor w \ - -text "Currently selected/available modes:" - pack $w.curr.title -side top -fill x -expand yes - frame $w.curr.modes - listbox $w.curr.modes.lb -height 8 -width 70 - foreach mode $vidmCurrentModes { - $w.curr.modes.lb insert end [VidMode_describe $mode] - } - pack $w.curr.modes.lb -side left -fill x -expand yes - $w.curr.modes.lb configure -yscroll [list $w.curr.modes.sb set] - scrollbar $w.curr.modes.sb -command [list $w.curr.modes.lb yview] - pack $w.curr.modes.sb -side left -fill y - frame $w.curr.buttons - #frame $w.curr.buttons.row1 - #frame $w.curr.buttons.row2 - button $w.curr.buttons.next -text "Next" \ - -command [list VidMode_next $win] - button $w.curr.buttons.prev -text "Prev" \ - -command [list VidMode_prev $win] - button $w.curr.buttons.move2top -text "Move to Top" \ - -command [list VidMode_move2top $win] - button $w.curr.buttons.delete -text "Delete" \ - -command [list VidMode_delete $win] - #pack $w.curr.buttons.next $w.curr.buttons.prev \ - -in $w.curr.buttons.row1 -side left -fill x -expand yes - #pack $w.curr.buttons.move2top $w.curr.buttons.delete \ - -in $w.curr.buttons.row2 -side left -fill x -expand yes - #pack $w.curr.buttons.row1 $w.curr.buttons.row2 -side top - pack $w.curr.buttons.next $w.curr.buttons.prev \ - $w.curr.buttons.move2top $w.curr.buttons.delete \ - -side top -fill x -expand yes - - frame $w.known - label $w.known.title -anchor w \ - -text "Known modes likely to work with this card/monitor:" - pack $w.known.title -side top -fill x -expand yes - frame $w.known.modes - listbox $w.known.modes.lb -height 8 -width 70 - set vidmValidModes "" - foreach mode [lsort [array names MonitorStdModes]] { - set modeline [string tolower $MonitorStdModes($mode)] - set retv [xf86vid_checkmodeline $modeline] - puts "Retv = $retv Modeline = $modeline" - if {!$retv} { - lappend vidmValidModes $modeline - $w.known.modes.lb insert end [VidMode_describe $modeline] - } else { - puts "Rejected: $modeline" - } - } - pack $w.known.modes.lb -side left -fill x -expand yes - $w.known.modes.lb configure -yscroll [list $w.known.modes.sb set] - scrollbar $w.known.modes.sb -command [list $w.known.modes.lb yview] - pack $w.known.modes.sb -side left -fill y - #frame $w.known.buttons -width 8c -height 4c - frame $w.known.buttons - button $w.known.buttons.add -text "Add" \ - -command [list VidMode_add $win] - button $w.known.buttons.new -text "New" \ - -command [list VidMode_new $win] - button $w.known.buttons.help -text "Help" - button $w.known.buttons.tune -text "Tune" \ - -command "set vidmListFlag 0;[list VidMode_list_or_adjust $win]" - pack $w.known.buttons.add $w.known.buttons.new -side top - pack $w.known.buttons.help $w.known.buttons.tune -side top - #pack propagate $w.curr.buttons no - pack $w.curr.modes $w.curr.buttons -side left -fill x -expand yes - pack $w.known.modes $w.known.buttons -side left -fill x -expand yes - frame $w.move - frame $w.move.but - button $w.move.but.left -text "Left" \ - -command "VidMode_adjust $win left" - button $w.move.but.right -text "Right" \ - -command "VidMode_adjust $win right" - button $w.move.but.up -text "Up" \ - -command "VidMode_adjust $win up" - button $w.move.but.down -text "Down" \ - -command "VidMode_adjust $win down" - pack $w.move.but.left $w.move.but.right \ - $w.move.but.up $w.move.but.down -side left - frame $w.size - frame $w.size.but - button $w.size.but.wider -bitmap @$tcl_library/wider.xbm \ - -command "VidMode_adjust $win wider" - button $w.size.but.narrow -bitmap @$tcl_library/narrower.xbm \ - -command "VidMode_adjust $win narrow" - button $w.size.but.taller -bitmap @$tcl_library/taller.xbm \ - -command "VidMode_adjust $win taller" - button $w.size.but.shorter -bitmap @$tcl_library/shorter.xbm \ - -command "VidMode_adjust $win short" - pack $w.size.but.wider $w.size.but.narrow \ - $w.size.but.taller $w.size.but.shorter -side left - pack $w.move.but - pack $w.size.but - #pack $w.move $w.size -side left - pack $w.move $w.size -} - -proc VidMode_create_modeadjust_widgets { win } { - global vidmMode vidmCurrentModes vidmValidModes MonitorStdModes - set w [winpathprefix $win] - - frame $w.modeline - label $w.modeline.header -text "Adjusting mode:" - frame $w.horz - frame $w.horz.beg - label $w.horz.beg.text -text "HSyncStart:" -width 12 - scale $w.horz.beg.sc -variable vidmMode(HBegin) -orient horizontal \ - -resolution 4 - pack $w.horz.beg.text -side left - pack $w.horz.beg.sc -side left -fill x -expand yes - frame $w.horz.end - label $w.horz.end.text -text "HSyncEnd:" -width 12 - scale $w.horz.end.sc -variable vidmMode(HEnd) -orient horizontal \ - -resolution 4 - pack $w.horz.end.text -side left - pack $w.horz.end.sc -side left -fill x -expand yes - frame $w.horz.ttl - label $w.horz.ttl.text -text "HorizTotal:" -width 12 - scale $w.horz.ttl.sc -variable vidmMode(HTotal) -orient horizontal \ - -resolution 8 - pack $w.horz.ttl.text -side left - pack $w.horz.ttl.sc -side left -fill x -expand yes - frame $w.horz.but - button $w.horz.but.left -text "Left" \ - -command "VidMode_adjust $win left" - button $w.horz.but.right -text "Right" \ - -command "VidMode_adjust $win right" - button $w.horz.but.wider -text "Wider" \ - -command "VidMode_adjust $win wider" - button $w.horz.but.narrow -text "Narrower" \ - -command "VidMode_adjust $win narrow" - pack $w.horz.but.left $w.horz.but.right $w.horz.but.wider \ - $w.horz.but.narrow -side left - pack $w.horz.beg $w.horz.end $w.horz.ttl $w.horz.but \ - -side top -fill x -expand yes - frame $w.vert - frame $w.vert.beg - label $w.vert.beg.text -text "VSyncStart:" -width 12 - scale $w.vert.beg.sc -variable vidmMode(VBegin) -orient horizontal \ - -resolution 2 - pack $w.vert.beg.text -side left - pack $w.vert.beg.sc -side left -fill x -expand yes - frame $w.vert.end - label $w.vert.end.text -text "VSyncEnd:" -width 12 - scale $w.vert.end.sc -variable vidmMode(VEnd) -orient horizontal \ - -resolution 2 - pack $w.vert.end.text -side left - pack $w.vert.end.sc -side left -fill x -expand yes - frame $w.vert.ttl - label $w.vert.ttl.text -text "VertTotal:" -width 12 - scale $w.vert.ttl.sc -variable vidmMode(VTotal) -orient horizontal \ - -resolution 4 - pack $w.vert.ttl.text -side left - pack $w.vert.ttl.sc -side left -fill x -expand yes - frame $w.vert.but - button $w.vert.but.up -text "Up" \ - -command "VidMode_adjust $win up" - button $w.vert.but.down -text "Down" \ - -command "VidMode_adjust $win down" - button $w.vert.but.shorter -text "Shorter" \ - -command "VidMode_adjust $win short" - button $w.vert.but.taller -text "Taller" \ - -command "VidMode_adjust $win tall" - pack $w.vert.but.up $w.vert.but.down $w.vert.but.shorter \ - $w.vert.but.taller -side left - pack $w.vert.beg $w.vert.end $w.vert.ttl $w.vert.but \ - -side top -fill x -expand yes - frame $w.other - frame $w.flags - checkbutton $w.flags.interlace -text "Interlace" -variable vidmMode(Intlc) \ - -onvalue "interlace" -offvalue "" -indicatoron false - checkbutton $w.flags.dblscan -text "DoubleScan" -variable vidmMode(DblScn) \ - -onvalue "doublescan" -offvalue "" -indicatoron false - checkbutton $w.flags.csync -text "CSync" -variable vidmMode(CSync) \ - -onvalue "composite" -offvalue "" -indicatoron false - checkbutton $w.flags.pcsync -text "+CSync" -variable vidmMode(CSync) \ - -onvalue "+csync" -offvalue "" -indicatoron false - checkbutton $w.flags.ncsync -text "-CSync" -variable vidmMode(CSync) \ - -onvalue "-csync" -offvalue "" -indicatoron false - checkbutton $w.flags.phsync -text "+HSync" -variable vidmMode(HSync) \ - -onvalue "+hsync" -offvalue "" -indicatoron false - checkbutton $w.flags.nhsync -text "-HSync" -variable vidmMode(HSync) \ - -onvalue "-hsync" -offvalue "" -indicatoron false - checkbutton $w.flags.pvsync -text "+VSync" -variable vidmMode(VSync) \ - -onvalue "+vsync" -offvalue "" -indicatoron false - checkbutton $w.flags.nvsync -text "-VSync" -variable vidmMode(VSync) \ - -onvalue "-vsync" -offvalue "" -indicatoron false - pack $w.flags.interlace $w.flags.dblscan -side left - pack $w.flags.csync $w.flags.pcsync $w.flags.ncsync -side left - pack $w.flags.phsync $w.flags.nhsync -side left - pack $w.flags.pvsync $w.flags.nvsync -side left - #button $w.b -text "Okay" -command [list VidMode_deactivate $win];exit - #catch {destroy $w.waitmsg} - frame $w.buttons - button $w.buttons.abort -text "Abort" \ - -command "set vidmListFlag 1;[list VidMode_list_or_adjust $win]" - button $w.buttons.save -text "Save" \ - -command "set vidmListFlag 1;[list VidMode_list_or_adjust $win]" - button $w.buttons.help -text "Help" - pack $w.buttons.abort $w.buttons.save $w.buttons.help -side left - pack $w.modeline.header -side top - pack $w.horz $w.vert -side left -in $w.modeline -fill x -expand yes -} - -proc VidMode_activate { win } { - global vidmCurrentModes - - set w [winpathprefix $win] - xf86vid_lockmodeswitch lock - VidMode_list_or_adjust $win - $w.curr.modes.lb selection clear 0 end - $w.curr.modes.lb selection set 0 - VidMode_tune $w [lindex $vidmCurrentModes 0] -} - -proc VidMode_deactivate { win } { - xf86vid_lockmodeswitch unlock -} - -proc VidMode_list_or_adjust { win } { - global vidmListFlag - - set w [winpathprefix $win] - - pack forget $w.curr $w.known $w.modeline $w.flags $w.buttons - if $vidmListFlag { - pack $w.curr -side top -fill x -expand yes - pack $w.known -side top -fill x -expand yes - } else { - pack $w.modeline -side top -fill x -expand yes - #pack $w.flags $w.b -side top - pack $w.flags -side top - pack $w.buttons -side top - } -} - -proc VidMode_add { win } { - global vidmCurrentModes vidmValidModes - - set w [winpathprefix $win] - set newmode [$w.known.modes.lb curselection] - if { [llength $newmode] != 1 } return - set curmode [$w.curr.modes.lb curselection] - if { [llength $curmode] != 1 } return - incr curmode - if { $curmode >= [llength $vidmCurrentModes] } { - set curmode end - } - puts stderr "Adding [lindex $vidmValidModes $newmode]" - set retval [catch {xf86vid_addmodeline [lindex $vidmValidModes $newmode]} retmsg] - puts stderr "Added - $retval - $retmsg" - if !$retval { - set vidmCurrentModes [linsert $vidmCurrentModes \ - $curmode [lindex $vidmValidModes $newmode]] - $w.curr.modes.lb insert $curmode [$w.known.modes.lb get $newmode] - } -} - -proc VidMode_new { win } { -} - -proc VidMode_next { win } { - global vidmCurrentModes - - set w [winpathprefix $win] - set curmode [$w.curr.modes.lb curselection] - incr curmode - if { $curmode >= [llength $vidmCurrentModes] } { - set curmode 0 - } - $w.curr.modes.lb selection clear 0 end - $w.curr.modes.lb selection set $curmode - xf86vid_lockmodeswitch unlock - xf86vid_switchmode next - xf86vid_lockmodeswitch lock - VidMode_tune $w [lindex $vidmCurrentModes $curmode] -} - -proc VidMode_prev { win } { - global vidmCurrentModes - - set w [winpathprefix $win] - set curmode [$w.curr.modes.lb curselection] - incr curmode -1 - if { $curmode < 0 } { - set curmode [expr [llength $vidmCurrentModes]-1] - } - $w.curr.modes.lb selection clear 0 end - $w.curr.modes.lb selection set $curmode - xf86vid_lockmodeswitch unlock - xf86vid_switchmode prev - xf86vid_lockmodeswitch lock - VidMode_tune $w [lindex $vidmCurrentModes $curmode] -} - -proc VidMode_move2top { win } { - global vidmCurrentModes vidmValidModes - - set w [winpathprefix $win] -} - -proc VidMode_delete { win } { - global vidmCurrentModes vidmValidModes - - set w [winpathprefix $win] - set curmode [$w.curr.modes.lb curselection] - if { [llength $curmode] != 1 } return - puts stderr "Deleting [lindex $vidmCurrentModes $curmode]" - set retval [catch {xf86vid_deletemodeline [lindex $vidmCurrentModes $curmode]} retmsg] - puts stderr "deleted - $retval - $retmsg" - set vidmCurrentModes [lreplace $vidmCurrentModes $curmode $curmode] - $w.curr.modes.lb delete $curmode -} - -proc VidMode_adjust { win dir } { - global vidmMode - - array set savemode [array get vidmMode] - set w [winpathprefix $win] - switch $dir { - up { - incr vidmMode(VBegin) 4 - incr vidmMode(VEnd) 4 - } - down { - incr vidmMode(VBegin) -4 - incr vidmMode(VEnd) -4 - } - short { - incr vidmMode(VTotal) 4 - incr vidmMode(VBegin) 2 - incr vidmMode(VEnd) 2 - # Update Sync rates - } - tall { - incr vidmMode(VTotal) -4 - incr vidmMode(VBegin) -2 - incr vidmMode(VEnd) -2 - # Update Sync rates - } - right { - incr vidmMode(HBegin) -8 - incr vidmMode(HEnd) -8 - } - left { - incr vidmMode(HBegin) 8 - incr vidmMode(HEnd) 8 - } - narrow { - incr vidmMode(HTotal) 8 - incr vidmMode(HBegin) 4 - incr vidmMode(HEnd) 4 - # Update Sync rates - } - wider { - incr vidmMode(HTotal) -8 - incr vidmMode(HBegin) -4 - incr vidmMode(HEnd) -4 - # Update Sync rates - } - } - set flags "$vidmMode(Intlc) $vidmMode(DblScn) $vidmMode(CSync) \ - $vidmMode(HSync) $vidmMode(VSync)" - if { ![string length [string trim $flags]] } { - set retval [catch {xf86vid_modifymodeline [list $vidmMode(Clock) \ - $vidmMode(HDisp) $vidmMode(HBegin) $vidmMode(HEnd) $vidmMode(HTotal) \ - $vidmMode(VDisp) $vidmMode(VBegin) $vidmMode(VEnd) $vidmMode(VTotal) \ - ] } out ] - } else { - puts "Flags:$flags:" - set retval [catch {xf86vid_modifymodeline [concat \ - [list $vidmMode(Clock) \ - $vidmMode(HDisp) $vidmMode(HBegin) $vidmMode(HEnd) $vidmMode(HTotal) \ - $vidmMode(VDisp) $vidmMode(VBegin) $vidmMode(VEnd) $vidmMode(VTotal) ] \ - $flags] } out ] - } - puts "$retval:$out" - if $retval { - array set vidmMode [array get savemode] - } -} - -proc VidMode_tune { win modeline } { - global vidmMode - - set w [winpathprefix $win] - $w.modeline.header configure -text "Adjusting mode:\ - [VidMode_describe $modeline]" - puts stderr "modeline='$modeline'" - set vidmMode(Clock) [lindex $modeline 0] - set vidmMode(HDisp) [lindex $modeline 1] - set max [expr int($vidmMode(HDisp)*1.5+0.5)] - foreach scale [list beg end ttl] { - $w.horz.$scale.sc configure -from $vidmMode(HDisp) -to $max - } - set vidmMode(HBegin) [lindex $modeline 2] - set vidmMode(HEnd) [lindex $modeline 3] - set vidmMode(HTotal) [lindex $modeline 4] - - set vidmMode(VDisp) [lindex $modeline 5] - set max [expr int($vidmMode(VDisp)*1.5+0.5)] - foreach scale [list beg end ttl] { - $w.vert.$scale.sc configure -from $vidmMode(VDisp) -to $max - } - set vidmMode(VBegin) [lindex $modeline 6] - set vidmMode(VEnd) [lindex $modeline 7] - set vidmMode(VTotal) [lindex $modeline 8] - - set vidmMode(CSync) [set vidmMode(HSync) [set vidmMode(VSync) ""]] - set vidmMode(Intlc) [set vidmMode(DblScn) ""] - - foreach flag [lrange $modeline 9 end] { - set lflag [string tolower $flag] - switch -- $lflag { - interlace { set vidmMode(Intlc) interlace } - doublescan { set vidmMode(DblScn) doublescan } - composite - - -csync - - +csync { set vidmMode(CSync) $lflag } - -hsync - - +hsync { set vidmMode(HSync) $lflag } - -vsync - - +vsync { set vidmMode(VSync) $lflag } - } - } -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h:3.4 xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h:3.4 Mon Apr 5 03:13:03 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h Sat Feb 28 21:42:24 2004 @@ -1,86 +0,0 @@ -/* $XConsortium: xfsconf.h /main/2 1996/10/19 19:06:59 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/xfsconf.h,v 3.4 1999/04/05 07:13:03 dawes Exp $ */ - -extern char *XtMalloc( - unsigned int /* size */ -); - -extern char *XtCalloc( - unsigned int /* num */, - unsigned int /* size */ -); - -extern char *XtRealloc( - char* /* ptr */, - unsigned int /* num */ -); - -extern void XtFree( - char* /* ptr */ -); - -int XF86Config_Init( - Tcl_Interp *interp -); - -int TCL_XF86ReadXF86Config( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -); - -int TCL_XF86WriteXF86Config( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv -); - -char *NonZeroStr( - unsigned long val, - int base -); - -char *get_path_elem( - char **pnt -); - -char *validate_font_path( - char *path -); - -char *token_to_string( - SymTabPtr table, - int token -); - -int string_to_token( - SymTabPtr table, - char *string -); - -extern char *rgbPath, *defaultFontPath; - -extern XF86ConfigPtr config_list; - -extern Tcl_Interp *errinterp; - -extern Bool Must_have_memory; - -extern SymTabRec xfsMouseTab[]; - -#define StrOrNull(xx) ((xx)==NULL? "": (xx)) - -#define SECTION_NAME(name) { int len = sizeof(section)-sizeof(name)-1; \ - strncpy(section, varpfx, len); \ - varpfx[len] = '\0'; strcat(section, name); \ - Tcl_AppendElement(interp, name); } - -#define DIR_FILE "/fonts.dir" - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.msk diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.msk:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.msk:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.msk:3.0 Thu Jun 13 03:59:24 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.msk Sat Feb 28 21:42:24 2004 @@ -1,388 +0,0 @@ -#define XFlogo_width 242 -#define XFlogo_height 149 -static unsigned char XFlogo_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, - 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, - 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xe0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x03, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, - 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xf8, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xfc, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x7f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfe, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x7f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, - 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x80, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, - 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x1f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x07, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, - 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, - 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x03, 0xfc, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x24, 0x6d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x3f, 0x00, 0x24, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, - 0x20, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x20, 0x54, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, - 0x00, 0x00, 0x20, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x20, 0x44, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, - 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.xbm:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.xbm:3.0 Thu Jun 13 03:59:25 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/pics/XFree86.xbm Sat Feb 28 21:42:24 2004 @@ -1,388 +0,0 @@ -#define XFlogo_width 242 -#define XFlogo_height 149 -static unsigned char XFlogo_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, - 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0xfe, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0xf3, 0x71, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0x61, - 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0x60, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0xf0, 0x60, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xf8, 0x60, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0xf8, 0x60, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xbe, - 0x0f, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xde, 0x1f, 0x78, 0x1c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, - 0x00, 0x7e, 0x1e, 0x3c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x00, 0x1f, 0x0e, 0x1e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x0f, 0x0f, - 0xdf, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x0f, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x80, - 0x07, 0x4f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xff, 0xff, 0x1f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0x00, 0x1e, 0x80, 0x87, 0x67, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x00, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, - 0x1f, 0x80, 0x87, 0x37, 0x0f, 0x0c, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, - 0xfe, 0x01, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0xff, 0xff, 0x1f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x1f, 0xc0, 0x83, 0x1f, 0xfe, - 0x07, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x80, 0xff, 0x0f, 0x80, 0x03, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0xf8, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x07, 0xfc, - 0x0f, 0xe0, 0xff, 0xc0, 0x03, 0x0f, 0xfc, 0x01, 0x00, 0xf8, 0xff, 0x03, - 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0xe0, - 0xff, 0x00, 0xf0, 0x8f, 0xff, 0x03, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0xf0, 0x0f, 0x00, 0xf0, 0x87, 0x3f, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0xe0, 0xff, 0x00, 0xf0, 0x87, 0xff, - 0x01, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0xc0, 0x0f, 0x00, 0xf8, 0x83, 0x3f, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x03, - 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x83, 0xff, 0x01, 0xc0, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x80, 0x1f, 0x00, 0xfc, 0x81, - 0x7f, 0x00, 0x1c, 0x00, 0x00, 0x80, 0x03, 0x00, 0xc0, 0xff, 0x01, 0xf8, - 0x81, 0xff, 0x01, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x0f, 0x80, 0x1f, 0x00, 0xfe, 0xc0, 0x7f, 0x00, 0x3c, 0x00, 0x00, - 0x80, 0x01, 0x00, 0x80, 0xff, 0x01, 0xfc, 0x80, 0xff, 0x00, 0x80, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x3f, 0x00, - 0xff, 0xc0, 0x7f, 0x00, 0x78, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, - 0x03, 0x3e, 0xc0, 0xff, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x07, 0x00, 0x3f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0xf8, - 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xff, 0x03, 0x1f, 0xc0, 0xff, 0x00, - 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, - 0x3f, 0x80, 0x3f, 0xc0, 0x7f, 0x00, 0xb0, 0x01, 0x00, 0xe0, 0x00, 0x00, - 0x00, 0xff, 0x83, 0x0f, 0xc0, 0x7f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x3f, 0xc0, 0x3f, 0x80, 0x3f, - 0x00, 0xf0, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00, 0xfe, 0xc7, 0x07, 0xc0, - 0x7f, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, - 0x07, 0x00, 0x3f, 0xe0, 0x3f, 0x00, 0x1f, 0x00, 0xe0, 0x03, 0x00, 0x70, - 0x00, 0x00, 0x00, 0xfe, 0xc7, 0x03, 0xe0, 0x7f, 0x00, 0x07, 0x07, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x80, 0x1f, 0xe0, 0x1f, - 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x30, 0x00, 0x00, 0x00, 0xfe, 0xef, - 0x01, 0xe0, 0x7f, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe0, 0x1f, 0x80, 0x1f, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x06, - 0x00, 0x38, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0xe0, 0x3f, 0xc0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0xc0, 0x0f, - 0xf0, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0x0d, 0x00, 0x18, 0x00, 0x00, 0x00, - 0xfc, 0x7f, 0x00, 0xe0, 0x3f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xff, 0xe0, 0x07, 0xf8, 0x0f, 0x00, 0x00, 0x00, - 0x80, 0x0f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0xf0, 0x3f, - 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, - 0xf3, 0x03, 0xf8, 0xcf, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x0c, 0x00, - 0x00, 0x00, 0xf8, 0x1f, 0x00, 0xf0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x1b, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, - 0xf0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00, 0x37, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xf0, 0xff, 0xff, 0xf9, 0x1f, - 0x3c, 0x00, 0x7e, 0x00, 0x80, 0x1f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0xfc, - 0x1f, 0xfe, 0x03, 0x00, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xe0, - 0x7f, 0x00, 0xf8, 0x1f, 0xff, 0xf9, 0x1f, 0x7f, 0x80, 0xff, 0x01, 0xe0, - 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0xfc, 0x0f, 0xfc, 0x07, 0x00, 0x00, - 0x77, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0x0f, 0xfc, - 0xf0, 0x8f, 0xff, 0xe0, 0xe7, 0x03, 0xf8, 0xf9, 0x00, 0x00, 0xff, 0xff, - 0x00, 0xfc, 0x07, 0xf8, 0x07, 0x00, 0x00, 0x6e, 0x00, 0x06, 0x00, 0x00, - 0x00, 0xf8, 0xff, 0x00, 0xf8, 0x0f, 0xf8, 0xc0, 0xcf, 0xfc, 0xf0, 0xc1, - 0x03, 0x7c, 0xf0, 0x00, 0xc0, 0xff, 0xff, 0x01, 0xfe, 0x07, 0xf8, 0x07, - 0x00, 0x00, 0x76, 0x00, 0x06, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0xfc, - 0x0f, 0xf8, 0xc0, 0x6f, 0xfc, 0xf8, 0xc1, 0x07, 0x7e, 0xf0, 0x01, 0xf0, - 0xf3, 0xff, 0x03, 0xfe, 0x03, 0xf8, 0x0f, 0x00, 0x00, 0xee, 0x00, 0x06, - 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0xfc, 0x0f, 0xf8, 0xc0, 0x3f, 0xfc, - 0xfc, 0xc0, 0x07, 0x3f, 0xf0, 0x01, 0xf8, 0xc1, 0xff, 0x03, 0xfe, 0x03, - 0xf8, 0x0f, 0x00, 0x00, 0xde, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9f, 0xff, - 0x01, 0xfc, 0x07, 0x78, 0xc0, 0x1f, 0x78, 0x7e, 0xc0, 0x87, 0x1f, 0xf0, - 0x01, 0xfc, 0x00, 0xff, 0x07, 0xfe, 0x03, 0xf8, 0x0f, 0x00, 0x00, 0xfe, - 0x00, 0x06, 0x00, 0x00, 0x80, 0x8f, 0xff, 0x01, 0xfc, 0x07, 0x70, 0xe0, - 0x1f, 0x00, 0x7e, 0xe0, 0x87, 0x1f, 0xf8, 0x01, 0x7e, 0x00, 0xfc, 0x07, - 0xfe, 0x03, 0xf8, 0x0f, 0x00, 0x00, 0xde, 0x00, 0x03, 0x00, 0x00, 0xc0, - 0x07, 0xff, 0x03, 0xfe, 0x07, 0x78, 0xe0, 0x0f, 0x00, 0x7f, 0xe0, 0xc3, - 0x1f, 0xf8, 0x00, 0x7f, 0x00, 0xf8, 0x07, 0xfe, 0x01, 0xf8, 0x0f, 0x00, - 0x00, 0xfc, 0x00, 0x03, 0x00, 0x00, 0xe0, 0x03, 0xff, 0x03, 0xfe, 0x07, - 0x78, 0xe0, 0x0f, 0x00, 0x3f, 0xf8, 0xc1, 0x0f, 0x7e, 0x00, 0x3f, 0x00, - 0xf8, 0x07, 0xfe, 0x01, 0xf8, 0x0f, 0x00, 0x00, 0xdc, 0x00, 0x03, 0x00, - 0x00, 0xf0, 0x01, 0xff, 0x07, 0xfe, 0x03, 0x38, 0xf0, 0x07, 0x80, 0x3f, - 0xfe, 0xe0, 0x8f, 0x3f, 0x80, 0x3f, 0x00, 0xf0, 0x07, 0xfe, 0x01, 0xf8, - 0x0f, 0x00, 0x00, 0xbc, 0x01, 0x03, 0x00, 0x00, 0xf8, 0x00, 0xfe, 0x07, - 0xfe, 0x03, 0x00, 0xf0, 0x07, 0x80, 0xff, 0x3f, 0xe0, 0xff, 0x0f, 0x80, - 0x3f, 0x00, 0xf0, 0x07, 0xfe, 0x01, 0xfc, 0x07, 0x00, 0x00, 0xfc, 0x01, - 0x03, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x0f, 0xff, 0x03, 0x00, 0xf0, 0x03, - 0x80, 0xff, 0x03, 0xe0, 0xff, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0x07, 0xfe, - 0x01, 0xfc, 0x07, 0x00, 0x00, 0xac, 0x01, 0x03, 0x00, 0x00, 0x3e, 0x00, - 0xfc, 0x0f, 0xff, 0x03, 0x00, 0xf0, 0x03, 0x80, 0x3f, 0x00, 0xe0, 0x0f, - 0x00, 0x80, 0x3f, 0x00, 0xf0, 0x03, 0xfc, 0x01, 0xfc, 0x03, 0x00, 0x00, - 0xdc, 0x01, 0x03, 0x00, 0x00, 0x1f, 0x00, 0xfc, 0x0f, 0xff, 0x01, 0x00, - 0xf8, 0x03, 0x80, 0x3f, 0x00, 0xe0, 0x0f, 0x00, 0x80, 0x3f, 0x00, 0xf0, - 0x03, 0xfc, 0x01, 0xfc, 0x03, 0x00, 0x00, 0xec, 0x01, 0x06, 0x00, 0x80, - 0x1f, 0x00, 0xf8, 0x1f, 0xff, 0x01, 0x00, 0xf8, 0x01, 0x80, 0x3f, 0x00, - 0xe0, 0x0f, 0x00, 0x80, 0x7f, 0x00, 0xf8, 0x01, 0xfc, 0x01, 0xfe, 0x01, - 0x00, 0x00, 0xde, 0x01, 0x06, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x9f, 0xff, - 0x01, 0x00, 0xf8, 0x01, 0x80, 0x3f, 0x80, 0xe0, 0x0f, 0x20, 0x00, 0x7f, - 0x00, 0xf8, 0x00, 0xf8, 0x01, 0xfe, 0x00, 0x00, 0x00, 0xbe, 0x03, 0x06, - 0x00, 0xf8, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x01, 0x00, - 0x3f, 0xc0, 0xc1, 0x0f, 0x70, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xf0, 0x03, - 0x7f, 0x00, 0x00, 0x00, 0x76, 0x03, 0x06, 0x00, 0xff, 0xff, 0xc3, 0xff, - 0xff, 0xff, 0x7f, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0xe0, 0xc0, 0x1f, 0x38, - 0x00, 0xfe, 0x83, 0x7f, 0x00, 0xf0, 0x03, 0x3f, 0x00, 0x00, 0x00, 0xae, - 0x03, 0x06, 0x00, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc, - 0x00, 0x00, 0xfe, 0x38, 0x80, 0x3f, 0x0e, 0x00, 0xf8, 0xff, 0x1f, 0x00, - 0xe0, 0xc7, 0x1f, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x06, 0x00, 0xff, 0xff, - 0xe1, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfe, 0x00, 0x00, 0xfc, 0x1f, 0x00, - 0xff, 0x07, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, - 0x00, 0xbe, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xff, - 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x01, 0x0c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xbb, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, - 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0x00, 0x1c, 0x00, 0x00, 0x00, 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, 0xef, 0x00, 0x18, 0x00, 0x00, - 0x00, 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, 0xd7, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbe, 0x00, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xdd, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xee, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf1, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x75, 0x00, 0xe0, 0x00, 0x00, 0x00, - 0x00, 0xf0, 0xe0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, - 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0x6f, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x03, 0x00, - 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xe0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x75, 0x00, 0x80, 0x01, - 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xb8, 0x3a, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0xe0, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x35, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0xf0, 0x03, 0x70, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xec, 0x1a, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x7c, 0xf0, 0xf9, 0xff, 0xf0, 0x0f, 0xfe, 0xc1, 0x0f, 0xf8, 0x87, 0xff, - 0x00, 0x00, 0xf0, 0xe1, 0xef, 0x03, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x7c, - 0x1f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7c, 0xf8, 0xe8, 0xfd, 0x7c, - 0x38, 0xf6, 0xf1, 0x38, 0x7c, 0xce, 0xff, 0x00, 0x00, 0xf0, 0xe1, 0xf7, - 0x07, 0x3e, 0x07, 0x00, 0x00, 0x00, 0xae, 0x0f, 0x00, 0x00, 0x0e, 0x00, - 0x00, 0x00, 0xfc, 0x3f, 0xe0, 0xf7, 0x3c, 0x78, 0xf8, 0x78, 0x3c, 0x1e, - 0x0f, 0x0f, 0x00, 0x00, 0xf0, 0x80, 0x9f, 0x07, 0x8f, 0x07, 0x00, 0x00, - 0x00, 0x5f, 0x07, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3e, 0x07, 0xe0, - 0x63, 0x3e, 0x78, 0xf8, 0x3c, 0x3c, 0x1f, 0x0f, 0x0f, 0x00, 0x00, 0xf8, - 0x80, 0x8f, 0x87, 0x8f, 0x07, 0x00, 0x00, 0x00, 0xaf, 0x06, 0x00, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0, 0x01, 0x1f, 0x7c, 0xf8, 0x3c, - 0x1e, 0x0f, 0x06, 0x0f, 0x00, 0x00, 0xf8, 0xc0, 0x87, 0x87, 0x07, 0x03, - 0x00, 0x00, 0x80, 0x57, 0x03, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1e, - 0x00, 0xf0, 0x00, 0x1f, 0x7c, 0x78, 0xbe, 0x8f, 0x0f, 0x80, 0x07, 0x00, - 0x00, 0xf8, 0xc0, 0xc3, 0xc3, 0x07, 0x00, 0x00, 0x00, 0xc0, 0xbb, 0x03, - 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1e, 0x00, 0xf0, 0x00, 0x0f, 0x7c, - 0x7c, 0xfe, 0x81, 0x07, 0x80, 0x07, 0x00, 0x00, 0x7c, 0xc0, 0xc3, 0xc3, - 0x03, 0x00, 0x00, 0x00, 0xe0, 0xd5, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0x00, 0x1f, 0x00, 0xf0, 0x00, 0x0f, 0x3e, 0x7c, 0x1e, 0x80, 0x07, 0x80, - 0x27, 0x0e, 0x00, 0x7c, 0xc0, 0xc3, 0xd3, 0x03, 0xe0, 0x00, 0x00, 0xb0, - 0xea, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x1f, 0x00, 0x78, 0x00, - 0x0f, 0x3e, 0x7c, 0x1e, 0x80, 0x07, 0xc2, 0x33, 0x1f, 0x00, 0x7c, 0xe0, - 0xe1, 0xd9, 0x03, 0xf1, 0x01, 0x00, 0x78, 0xf5, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x0f, 0x00, 0x78, 0x00, 0x0e, 0x1e, 0x3c, 0x1e, 0x98, - 0x0f, 0xc3, 0x1b, 0x1f, 0x00, 0x7c, 0xe0, 0xe1, 0xc9, 0x87, 0xf1, 0x01, - 0x00, 0xac, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x80, 0x1f, 0x00, - 0x78, 0x00, 0x1e, 0x07, 0x3e, 0xfc, 0x0f, 0xff, 0xc1, 0x0f, 0x1f, 0x00, - 0xfe, 0xe0, 0xe1, 0x87, 0xff, 0xf0, 0x01, 0x00, 0x76, 0x35, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0xe0, 0x7f, 0x00, 0x7c, 0x00, 0xf8, 0x01, 0x3e, - 0xf8, 0x03, 0x7c, 0x80, 0x07, 0x1e, 0x80, 0xff, 0xf1, 0xc0, 0x03, 0x3e, - 0xe0, 0x00, 0x00, 0xbb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0x0d, - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfb, 0x06, 0x00, 0x00, 0x00, 0x00, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0x55, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x9c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xae, 0x03, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x5c, 0xd7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xfa, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x57, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbb, 0x3b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x75, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, - 0xaa, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xdd, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xaf, 0xee, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf0, 0xba, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x55, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf7, - 0xd7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xae, 0xea, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0xd5, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xee, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xaa, 0x3e, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0xd7, 0xd5, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xae, 0xee, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7f, 0x5d, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xeb, 0xbb, - 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x78, 0xf7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0x55, 0xd7, 0x0f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xab, 0x3f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xaf, - 0xbe, 0xea, 0x03, 0xfc, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xdf, 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd5, 0x55, 0xfd, 0x00, 0x24, 0x6d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, - 0xaa, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, - 0xff, 0xae, 0xfa, 0x3f, 0x00, 0x24, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x77, 0xff, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5f, 0x57, 0xf7, 0x07, 0x00, - 0x20, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xbf, 0xeb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf8, 0xbf, 0xaa, 0xbe, 0xff, 0x00, 0x00, 0x20, 0x54, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf5, 0xfd, - 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x55, 0x57, 0xd5, 0x1f, - 0x00, 0x00, 0x20, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbf, 0xef, 0xff, 0xff, 0x3f, 0x00, 0xc0, - 0xff, 0xff, 0xef, 0xfa, 0xfa, 0xfb, 0x01, 0x00, 0x00, 0x20, 0x44, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x75, 0x5d, 0xd5, - 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xbf, 0xba, 0xea, 0xaa, - 0xea, 0xbf, 0xaa, 0xae, 0xaa, 0xab, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xd7, 0x57, 0x7d, 0x5d, 0xd5, 0xd7, 0x55, 0xd7, - 0xf5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xea, 0xea, 0xaf, 0xab, 0xaa, 0xeb, 0xea, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x55, 0x57, 0x55, 0xf5, - 0xd5, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xbf, 0xfa, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, - 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.msk diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.msk:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.msk:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.msk:3.0 Thu Jun 13 03:59:27 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.msk Sat Feb 28 21:42:24 2004 @@ -1,133 +0,0 @@ -#define vidx_width 144 -#define vidx_height 86 -static unsigned char vidx_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0xa0, 0xaa, 0x54, 0x15, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x60, 0xf5, 0xbf, 0x1a, 0x70, 0xc4, 0x19, 0xe3, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0xe0, 0xff, 0xff, 0x1f, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0xe0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0x05, 0x00, 0xfe, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x00, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0xf0, 0x0f, 0xfc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0x10, 0x0f, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0xc0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, - 0xe0, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0xc0, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0x0f, 0x20, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0xc0, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0x07, 0x20, - 0xf0, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, - 0xf1, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, 0xf1, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, - 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, 0xfc, 0x9f, 0xff, 0xe3, 0xff, 0x20, - 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, - 0xfc, 0x9f, 0xff, 0xe7, 0xff, 0x21, 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, - 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, 0xfc, 0x1f, 0xff, 0xc7, 0xff, 0x21, - 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, - 0xfc, 0x9f, 0xff, 0xe7, 0xff, 0x21, 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, - 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, 0xfc, 0x9f, 0xff, 0xe7, 0xff, 0x21, - 0x10, 0x0f, 0x80, 0xfe, 0xff, 0xff, 0xf1, 0xff, 0xff, 0x7f, 0xf0, 0x7f, - 0xfc, 0x9f, 0xff, 0xe7, 0xff, 0x21, 0x10, 0x0f, 0x80, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x10, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x0f, 0x80, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x10, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xf0, 0x0f, 0x80, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe0, 0x0f, 0xfc, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x10, 0x0f, 0xe0, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, - 0xf0, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x00, 0x85, 0xaa, 0x54, 0xa5, 0x0a, - 0xf1, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, - 0x00, 0x85, 0xaa, 0x54, 0xa5, 0x0a, 0xf1, 0xff, 0xff, 0x7f, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x00, 0xe5, 0xff, 0xff, 0xff, 0xcf, - 0xf3, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, - 0x00, 0xe5, 0xff, 0xff, 0xff, 0xcf, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x73, 0xce, 0x98, 0x01, 0x20, - 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0x01, 0x20, 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x20, - 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xe5, 0xff, 0xff, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x85, 0xaa, 0x54, 0xa5, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x85, 0xaa, 0x54, 0xa5, 0x0a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xfd, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0x00, 0x05, 0x80, 0x00, 0x00, 0x80, 0xf6, 0xfb, 0xbe, 0xb7, 0xdd, 0xdf, - 0x76, 0xdb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x80, - 0xf6, 0xfb, 0xbe, 0xb7, 0xdd, 0xdf, 0x76, 0xdb, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x80, 0x00, 0x00, 0x80, 0xf6, 0xfb, 0xbe, 0xb7, 0xdd, 0xdf, - 0x76, 0xdb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x80, - 0xf6, 0xfb, 0xbe, 0xb7, 0xdd, 0xdf, 0x76, 0xdb, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x80, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0xd9, 0x76, 0x00, 0x00, 0x00, 0xf6, 0xfb, 0xb6, 0xb7, 0xdd, 0xdf, - 0x60, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.xbm:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.xbm:3.0 Thu Jun 13 03:59:28 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/pics/vidcard.xbm Sat Feb 28 21:42:24 2004 @@ -1,133 +0,0 @@ -#define vidx_width 144 -#define vidx_height 86 -static unsigned char vidx_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbb, 0xb6, 0x96, 0xd9, 0xdf, - 0x62, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf6, 0xbb, 0xb6, 0x96, 0xd9, 0xdf, 0x62, 0xda, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbb, 0xb6, 0x96, 0xd9, 0xdf, - 0x62, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf6, 0xbb, 0xb6, 0x96, 0xd9, 0xdf, 0x62, 0xda, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile:3.2 Fri Dec 27 01:54:47 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile Sat Feb 28 21:42:24 2004 @@ -1,19 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/1 1996/09/21 14:14:32 kaleb $ - - - - -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/Imakefile,v 3.2 1996/12/27 06:54:47 dawes Exp $ - - XF86SETUPLIBDIR = $(LIBDIR)/XF86Setup - SCRIPTSDIR = $(XF86SETUPLIBDIR)/scripts - - SCRIPTFILES = mseconfig.tcl - -all:: - -InstallNamedProg(xmseconfig,xmseconfig,$(BINDIR)) -InstallMultiple($(SCRIPTFILES),$(SCRIPTSDIR)) - -InstallManPage(xmseconfig,$(MANDIR)) - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts:3.2 Sat Dec 6 03:53:03 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts Sat Feb 28 21:42:24 2004 @@ -1,80 +0,0 @@ -#! /bin/sh -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/findopts,v 3.2 1997/12/06 08:53:03 hohndel Exp $ -# -# This script should be run by XF86Setup \ -exec XF86Setup -notk `basename $0` -- ${1+"$@"} - -# This is just for my own use in generating a list of valid options -# to each server as needed by carddata.tcl - -set xf86dir $Xwinhome/xc/programs/Xserver/hw/xfree86 - -set dirlist [list accel/ibm8514 accel/agx accel/i128 accel/mach8\ - accel/mach32 accel/mach64 accel/p9000 accel/s3 \ - vga256 vga16 vga2] -set srvlist {8514 AGX I128 Mach8 Mach32 Mach64 P9000 S3 SVGA VGA16 Mono} - -set fd [open $xf86dir/common/xf86_Option.h r] -set table none -while {[gets $fd line] >= 0} { - if { $table == "none" } { - if {[regexp {^OptFlagRec xf86_(.+)Tab.+ =} $line dummy tab]} { - if { $tab == "Option" } { - set table Options - } elseif { $tab == "ClockOption" } { - set table Clocks - } - } - continue - } - if {[string match {*"",*} $line]} { - set table none - continue - } - if {![regexp {"([^"]+)",[ ]*([A-Z_]+TION_[^ \}]+)} $line dummy nam val]} { - continue - } - if ![info exists ${table}($val)] { - set ${table}($val) "" - } - lappend ${table}($val) $nam -} -close $fd -set Clocks(CLOCK_OPTION_PROGRAMABLE) "" - -for {set idx 0} {$idx < [llength $srvlist]} {incr idx} { - set srv [lindex $srvlist $idx] - cd $xf86dir/[lindex $dirlist $idx] - set optlist "" - set clklist "" - set lines [exec find . -name {*.[hc]} -print | xargs grep OPTION_] - foreach line [split $lines \n] { - if [regexp {[^_](OPTION_[0-9A-Z_]+)} $line dummy opt] { - lappend optlist $opt - } - if [regexp {(CLOCK_OPTION_[0-9A-Z_]+)} $line dummy opt] { - lappend clklist $opt - } - } - set optnamlist "" - foreach opt [lrmdups $optlist] { - if [info exists Options($opt)] { - eval lappend optnamlist $Options($opt) - } else { - puts "Unknown option: $opt" - } - } - puts "CardOptions($srv) = $optnamlist" - set clknamlist "" - foreach opt [lrmdups $clklist] { - if [info exists Clocks($opt)] { - eval lappend clknamlist $Clocks($opt) - } else { - puts "Unknown clock option: $opt" - } - } - puts "CardClockChips($srv) = $clknamlist" - puts "" -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl:3.4 xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl:3.4 Fri Mar 27 18:23:07 1998 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl Sat Feb 28 21:42:24 2004 @@ -1,104 +0,0 @@ -# $XConsortium: mseconfig.tcl /main/1 1996/09/21 14:14:40 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/mseconfig.tcl,v 3.4 1998/03/27 23:23:07 hohndel Exp $ - -set clicks1 [clock clicks] - -array set Pointer { - Device "" - Protocol "" - BaudRate "" - SampleRate "" - Resolution "" - Buttons "" - Emulate3Buttons "" - Emulate3Timeout "" - ChordMiddle "" - ClearDTR "" - ClearRTS "" -} - -set ConfigFile [xf86config_findfile] -if ![getuid] { - if {![catch {xf86config_readfile $Xwinhome files server \ - keyboard mouse monitor device screen} tmp]} { - if [info exists mouse] { - set Pointer(Device) $mouse(Device) - if [string length $mouse(Device)] { - if {[file exists $mouse(Device)] - && [file type $mouse(Device)] == "link" } { - set Pointer(RealDev) [readlink $mouse(Device)] - set Pointer(OldLink) $mouse(Device) - } else { - set Pointer(RealDev) $mouse(Device) - } - } - } - foreach var {files server keyboard mouse} { - catch {unset $var} - } - foreach var [info vars monitor_*] { - catch {unset $var} - } - foreach var [info vars device_*] { - catch {unset $var} - } - foreach var [info vars screen_*] { - catch {unset $var} - } - } - set clicks2 [clock clicks] -} - -if { [info exists env(TMPDIR)] } { - set XF86SetupDir $env(TMPDIR)/.XF86Setup[pid] -} else { - set XF86SetupDir /tmp/.XF86Setup[pid] -} - - -if ![mkdir $XF86SetupDir 0700] { - mesg "Unable to make directory $XF86SetupDir\n\ - for storing temporary files" okay - exit 1 -} - -source $XF86Setup_library/texts/local_text.tcl -source $XF86Setup_library/setuplib.tcl -if ![getuid] { - set rand1 [random 1073741823] - random seed [expr $clicks2-$clicks1] - set rand2 [random 1073741823] - - set TmpDir $XF86SetupDir/[format "%x-%x" $rand1 $rand2] - if ![mkdir $TmpDir 0700] { - mesg "Unable to make directory $TmpDir\n\ - for storing temporary files" okay - exit 1 - } -} else { - set TmpDir $XF86SetupDir -} - -check_tmpdirs - -if ![getuid] { - set Pointer(Device) $TmpDir/mouse - if [info exists Pointer(RealDev)] { - link $Pointer(RealDev) $Pointer(Device) - } -} - -set_resource_defaults -source $XF86Setup_library/mseproto.tcl -source $XF86Setup_library/mouse.tcl -Mouse_create_widgets . -Mouse_activate . -button .mouse.exit -text $messages(mouse.17) \ - -command "exit 0" -underline $messages(mouse.18) -pack .mouse.exit -side bottom -expand yes -fill x -bind . "exit 0" -bind . "exit 0" Index: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig:3.2 xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig:3.2 Fri Dec 27 01:54:49 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig Sat Feb 28 21:42:24 2004 @@ -1,10 +0,0 @@ -#! /bin/sh -# $XConsortium: xmseconfig /main/1 1996/09/21 14:14:44 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig,v 3.2 1996/12/27 06:54:49 dawes Exp $ -# - -exec XF86Setup -script mseconfig.tcl "$@" Index: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man:3.6 xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man:3.6 Sat Oct 12 12:06:43 2002 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man Sat Feb 28 21:42:24 2004 @@ -1,56 +0,0 @@ -.\" $XConsortium: xmseconfig.man /main/3 1996/12/09 17:42:35 kaleb $ -.\" -.\" -.\" -.\" -.\" -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/scripts/xmseconfig.man,v 3.6 2002/10/12 16:06:43 herrb Exp $ -.TH xmseconfig 1 __vendorversion__ -.SH NAME -xmseconfig - Graphical mouse configuration utility -.SH SYNOPSIS -.B xmseconfig -[ -sync ] [ -display \fIdisplay\fP ] [ -geometry \fIgeometry\fP ] -.SH DESCRIPTION -.I xmseconfig -enables the user to make changes to the server's mouse configuration. -Changes apply only to the currently running server and are not saved -to a configuration file as they are with \fBXF86Setup\fP. -.SH ARGUMENTS -.TP 14 -.B -sync -Turn on synchronization for all communication with an X server. -.TP 14 -.BI -display " display" -Specify the display to talk to. -.TP 14 -.BI -geometry " geomspec" -Specify the initial geometry for the window. -.SH ENVIRONMENT -.TP 14 -.B XWINHOME -If set, indicates the parent directory of X bin and lib directories. -.TP 14 -.B XF86SETUPLIB -If set, overrides the default location of the library directory -(normally __projectroot__/lib/X11/XF86Setup). -.SH FILES -.I __projectroot__/lib/X11/XF86Config -.br -or -.I /etc/XF86Config -.RS 14 -Used to determine the link to the mouse device -.RE -.SH "SEE ALSO" -\fIQuick-Start Guide to XFree86 Setup\fP -.br -XF86Setup(1), XFree86(1), XF86Config(4/5), -xf86config(1), XF86Misc(3) -.SH AUTHOR -.PP -Joe Moss, \fIjoe@XFree86.org\fP -.SH NOTES -If the program is unable to read the mouse configuration from -the existing XF86Config file or if the user is not the superuser, -changes to the mouse device are disallowed. Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/README diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/README:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/README:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/README:3.1 Tue Aug 13 07:28:51 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/README Sat Feb 28 21:42:24 2004 @@ -1,9 +0,0 @@ -This directory contains the same files as the library directory of the -Tk4.0p3 distribution, with the following changes: - -init.tcl has been added (it is from the Tcl4.0p3 sources) -prolog.ps and obsolete.tcl have been removed -combobox.tcl, downarrow.xbm, and uparrow.xbm added -misc.tcl added - -tclIndex has been updated to reflect the above changes Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/button.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/button.tcl:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/button.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/button.tcl:3.0 Thu Jun 13 03:59:44 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/button.tcl Sat Feb 28 21:42:24 2004 @@ -1,190 +0,0 @@ -# button.tcl -- -# -# This file defines the default bindings for Tk label, button, -# checkbutton, and radiobutton widgets and provides procedures -# that help in implementing those bindings. -# -# @(#) button.tcl 1.17 95/05/05 16:56:01 -# -# Copyright (c) 1992-1994 The Regents of the University of California. -# Copyright (c) 1994 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for buttons. -#------------------------------------------------------------------------- - -bind Button {} -bind Button { - tkButtonEnter %W -} -bind Button { - tkButtonLeave %W -} -bind Button <1> { - tkButtonDown %W -} -bind Button { - tkButtonUp %W -} -bind Button { - tkButtonInvoke %W -} -bind Button { - if !$tk_strictMotif { - tkButtonInvoke %W - } -} - -bind Checkbutton {} -bind Checkbutton { - tkButtonEnter %W -} -bind Checkbutton { - tkButtonLeave %W -} -bind Checkbutton <1> { - tkCheckRadioInvoke %W -} -bind Checkbutton { - tkCheckRadioInvoke %W -} -bind Checkbutton { - if !$tk_strictMotif { - tkCheckRadioInvoke %W - } -} - -bind Radiobutton {} -bind Radiobutton { - tkButtonEnter %W -} -bind Radiobutton { - tkButtonLeave %W -} -bind Radiobutton <1> { - tkCheckRadioInvoke %W -} -bind Radiobutton { - tkCheckRadioInvoke %W -} -bind Radiobutton { - if !$tk_strictMotif { - tkCheckRadioInvoke %W - } -} - -# tkButtonEnter -- -# The procedure below is invoked when the mouse pointer enters a -# button widget. It records the button we're in and changes the -# state of the button to active unless the button is disabled. -# -# Arguments: -# w - The name of the widget. - -proc tkButtonEnter {w} { - global tkPriv - if {[$w cget -state] != "disabled"} { - $w config -state active - if {$tkPriv(buttonWindow) == $w} { - $w configure -state active -relief sunken - } - } - set tkPriv(window) $w -} - -# tkButtonLeave -- -# The procedure below is invoked when the mouse pointer leaves a -# button widget. It changes the state of the button back to -# inactive. If we're leaving the button window with a mouse button -# pressed (tkPriv(buttonWindow) == $w), restore the relief of the -# button too. -# -# Arguments: -# w - The name of the widget. - -proc tkButtonLeave w { - global tkPriv - if {[$w cget -state] != "disabled"} { - $w config -state normal - } - if {$w == $tkPriv(buttonWindow)} { - $w configure -relief $tkPriv(relief) - } - set tkPriv(window) "" -} - -# tkButtonDown -- -# The procedure below is invoked when the mouse button is pressed in -# a button widget. It records the fact that the mouse is in the button, -# saves the button's relief so it can be restored later, and changes -# the relief to sunken. -# -# Arguments: -# w - The name of the widget. - -proc tkButtonDown w { - global tkPriv - set tkPriv(relief) [lindex [$w config -relief] 4] - if {[$w cget -state] != "disabled"} { - set tkPriv(buttonWindow) $w - $w config -relief sunken - } -} - -# tkButtonUp -- -# The procedure below is invoked when the mouse button is released -# in a button widget. It restores the button's relief and invokes -# the command as long as the mouse hasn't left the button. -# -# Arguments: -# w - The name of the widget. - -proc tkButtonUp w { - global tkPriv - if {$w == $tkPriv(buttonWindow)} { - set tkPriv(buttonWindow) "" - $w config -relief $tkPriv(relief) - if {($w == $tkPriv(window)) - && ([$w cget -state] != "disabled")} { - uplevel #0 [list $w invoke] - } - } -} - -# tkButtonInvoke -- -# The procedure below is called when a button is invoked through -# the keyboard. It simulate a press of the button via the mouse. -# -# Arguments: -# w - The name of the widget. - -proc tkButtonInvoke w { - if {[$w cget -state] != "disabled"} { - set oldRelief [$w cget -relief] - set oldState [$w cget -state] - $w configure -state active -relief sunken - update idletasks - after 100 - $w configure -state $oldState -relief $oldRelief - uplevel #0 [list $w invoke] - } -} - -# tkCheckRadioInvoke -- -# The procedure below is invoked when the mouse button is pressed in -# a checkbutton or radiobutton widget, or when the widget is invoked -# through the keyboard. It invokes the widget if it -# isn't disabled. -# -# Arguments: -# w - The name of the widget. - -proc tkCheckRadioInvoke w { - if {[$w cget -state] != "disabled"} { - uplevel #0 [list $w invoke] - } -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl:3.6 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl:3.6 Fri Dec 27 01:54:54 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl Sat Feb 28 21:42:24 2004 @@ -1,179 +0,0 @@ -# $XConsortium: combobox.tcl /main/1 1996/09/21 14:15:02 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/combobox.tcl,v 3.6 1996/12/27 06:54:54 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# Implements a simple combobox widget - -proc combobox {w args} { - global tcl_library - - frame $w - # putting the # in front does a pretty good job of hiding things - rename $w #$w.frame - proc $w {args} "eval [list \\#combobox_proc $w] \$args" - - entry $w.entry -relief sunken -bd 1m - button $w.button -command "\\#combobox_popup [list $w]" \ - -bitmap @$tcl_library/downarrow.xbm - pack $w.entry $w.button -side left - - toplevel $w.popup -cursor top_left_arrow - - listbox $w.popup.list -yscroll "$w.popup.sb set" \ - -selectmode browse -relief sunken -bd 1m - scrollbar $w.popup.sb -command "$w.popup.list yview" - - set topwin [winfo toplevel $w] - wm withdraw $w.popup - wm transient $w.popup $topwin - wm overrideredirect $w.popup 1 - - bind $w.popup.list "\\#combobox_buttonrel [list $w]" - - if [llength $args] { - eval "\\#combobox_proc [list $w] econfig $args" - } -} - -proc #combobox_proc {w op args} { - - set p $w.popup - switch -- $op { - activate {return [eval [list $p.list activate] $args]} - bbox {return [eval [list $p.list bbox] $args]} - ecget {return [eval [list $w.entry cget] $args]} - lcget {return [eval [list $p.list cget] $args]} - econfig {return [eval [list $w.entry configure] $args]} - lconfig {return [eval [list $p.list configure] $args]} - curselection {return [eval \ - [list $p.list curselection] $args]} - edelete {return [eval [list $w.entry delete] $args]} - ldelete {return [eval [list $p.list delete] $args]} - eget {return [eval [list $w.entry get] $args]} - lget {return [eval [list $p.list get] $args]} - icursor {return [eval [list $w.entry icursor] $args]} - eindex {return [eval [list $w.entry index] $args]} - lindex {return [eval [list $p.list index] $args]} - einsert {return [eval [list $w.entry insert] $args]} - linsert {return [eval [list $p.list insert] $args]} - nearest {return [eval [list $p.list nearest] $args]} - escan {return [eval [list $w.entry scan] $args]} - lscan {return [eval [list $p.list scan] $args]} - see {return [eval [list $p.list see] $args]} - eselection {return [eval [list $w.entry selection] $args]} - lselection {return [eval [list $p.list selection] $args]} - size {return [eval [list $p.list size] $args]} - exview {return [eval [list $w.entry xview] $args]} - lxview {return [eval [list $p.list xview] $args]} - yview {return [eval [list $p.list yview] $args]} - default {error "Unknown option" } - } -} - -proc #combobox_popup { w } { - global tcl_library #combobox_vars - - set count [$w.popup.list size] - if { $count == 0 } return - pack forget $w.popup.sb $w.popup.list - set #combobox_vars(focus) [focus] - if { $count > 10 } { - set wid [winfo width $w.entry] - $w.popup.list configure -height 10 -width [$w.entry cget -width] - #$w.popup.list configure -height 10 - incr wid [expr [winfo width $w.button] +1 ] - pack $w.popup.list -side left -fill x -expand yes - pack $w.popup.sb -side left -fill y -expand yes - } else { - set wid [winfo width $w.entry] - #$w.popup.list configure -height $count -width $wid - $w.popup.list configure -height $count -width [$w.entry cget -width] - pack $w.popup.list -side left -fill x -expand yes - } - update idletasks - set ht [winfo reqheight $w.popup] - set xpos [winfo rootx $w] - set ypos [expr [winfo rooty $w]+[winfo reqheight $w]] - wm geometry $w.popup ${wid}x${ht}+${xpos}+${ypos} - #$w.popup.list configure -width [winfo width $w.entry] - #pack $w.popup.sb -side left -fill y -expand yes - wm deiconify $w.popup - raise $w.popup - #$w.button configure -state disabled - #grab -global $w.popup - grab $w.popup - bind $w.popup "\\#combobox_checkmsepos [list $w] %X %Y" - bind $w.popup.list "\\#combobox_popdown [list $w]" - #bind $w.popup.list "\\#combobox_popdown [list $w]" - $w.button configure -command "\\#combobox_popdown [list $w]" \ - -bitmap @$tcl_library/uparrow.xbm - set #combobox_vars($w,x) [winfo rootx $w] - set #combobox_vars($w,y) [winfo rooty $w] - bind [winfo toplevel $w] "\\#combobox_follow [list $w]" - if [string length [focus]] { - focus $w.popup.list - } -} - -proc #combobox_follow { w } { - global #combobox_vars - - regexp {([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)} \ - [wm geometry $w.popup] dummy pw ph px py - set oldx [set #combobox_vars($w,x)] - set oldy [set #combobox_vars($w,y)] - set newx [expr $px+[winfo rootx $w]-$oldx] - set newy [expr $py+[winfo rooty $w]-$oldy] - wm geometry $w.popup ${pw}x${ph}+${newx}+${newy} - set #combobox_vars($w,x) [winfo rootx $w] - set #combobox_vars($w,y) [winfo rooty $w] -} - -proc #combobox_popdown { w } { - global tcl_library #combobox_vars - - wm withdraw $w.popup - #$w.button configure -state normal - grab release $w.popup - if { [info exists #combobox_vars(focus)] - && [string length [set #combobox_vars(focus)]] } { - focus [set #combobox_vars(focus)] - } - set entry "" - foreach selection [$w.popup.list curselection] { - set text [$w.popup.list get $selection] - if { [string compare $text "" ] != 0 && - [string compare $text ""] != 0 } { - append entry ",$text" - } - } - set oldstate [$w.entry cget -state] - $w.entry configure -state normal - $w.entry delete 0 end - $w.entry insert end [string range $entry 1 end] - $w.entry configure -state $oldstate - $w.button configure -command "\\#combobox_popup [list $w]" \ - -bitmap @$tcl_library/downarrow.xbm -} - -proc #combobox_buttonrel { w } { - set mode [$w.popup.list cget -selectmode] - if { "$mode" == "multiple" || "$mode" == "extended" } return - \#combobox_popdown $w -} - -proc #combobox_checkmsepos { w xpos ypos } { - set curwin [winfo containing $xpos $ypos] - if { "[winfo toplevel $curwin]" == "$w.popup" } return - \#combobox_popdown $w -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl:3.1 Fri Dec 27 01:54:55 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl Sat Feb 28 21:42:24 2004 @@ -1,130 +0,0 @@ -# $XConsortium: dialog.tcl /main/1 1996/09/21 14:15:10 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/dialog.tcl,v 3.1 1996/12/27 06:54:55 dawes Exp $ -# -# dialog.tcl -- -# -# This file defines the procedure tk_dialog, which creates a dialog -# box containing a bitmap, a message, and one or more buttons. -# -# @(#) dialog.tcl 1.18 95/11/24 15:03:04 -# -# Copyright (c) 1992-1993 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# tk_dialog: -# -# This procedure displays a dialog box, waits for a button in the dialog -# to be invoked, then returns the index of the selected button. -# -# Arguments: -# w - Window to use for dialog top-level. -# title - Title to display in dialog's decorative frame. -# text - Message to display in dialog. -# bitmap - Bitmap to display in dialog (empty string means none). -# default - Index of button that is to display the default ring -# (-1 means none). -# args - One or more strings to display in buttons across the -# bottom of the dialog box. - -proc tk_dialog {w title text bitmap default args} { - global tkPriv - - # 1. Create the top-level window and divide it into top - # and bottom parts. - - catch {destroy $w} - toplevel $w -class Dialog - wm title $w $title - wm iconname $w Dialog - wm protocol $w WM_DELETE_WINDOW { } - wm transient $w [winfo toplevel [winfo parent $w]] - frame $w.top -relief raised -bd 1 - pack $w.top -side top -fill both - frame $w.bot -relief raised -bd 1 - pack $w.bot -side bottom -fill both - - # 2. Fill the top part with bitmap and message (use the option - # database for -wraplength so that it can be overridden by - # the caller). - - option add *Dialog.msg.wrapLength 3i widgetDefault - label $w.msg -justify left -text $text \ - -font -Adobe-Times-Medium-R-Normal--*-180-*-*-*-*-*-* - pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m - if {$bitmap != ""} { - label $w.bitmap -bitmap $bitmap - pack $w.bitmap -in $w.top -side left -padx 3m -pady 3m - } - - # 3. Create a row of buttons at the bottom of the dialog. - - set i 0 - foreach but $args { - button $w.button$i -text $but -command "set tkPriv(button) $i" - if {$i == $default} { - frame $w.default -relief sunken -bd 1 - raise $w.button$i $w.default - pack $w.default -in $w.bot -side left -expand 1 -padx 3m -pady 2m - pack $w.button$i -in $w.default -padx 2m -pady 2m - } else { - pack $w.button$i -in $w.bot -side left -expand 1 \ - -padx 3m -pady 2m - } - incr i - } - - # 4. Withdraw the window, then update all the geometry information - # so we know how big it wants to be, then center the window in the - # display and de-iconify it. - - wm withdraw $w - update idletasks - set x [expr [winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - - [winfo vrootx [winfo parent $w]]] - set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - - [winfo vrooty [winfo parent $w]]] - wm geom $w +$x+$y - wm deiconify $w - - # 5. Set a grab and claim the focus too. - - set oldFocus [focus] - set oldGrab [grab current $w] - if {$oldGrab != ""} { - set grabStatus [grab status $oldGrab] - } - grab $w - tkwait visibility $w - if {$default >= 0} { - focus $w.button$default - } else { - focus $w - } - - # 6. Wait for the user to respond, then restore the focus and - # return the index of the selected button. Restore the focus - # before deleting the window, since otherwise the window manager - # may take the focus away so we can't redirect it. Finally, - # restore any grab that was in effect. - - tkwait variable tkPriv(button) - catch {focus $oldFocus} - destroy $w - if {$oldGrab != ""} { - if {$grabStatus == "global"} { - grab -global $oldGrab - } else { - grab $oldGrab - } - } - return $tkPriv(button) -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/downarrow.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/downarrow.xbm:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/downarrow.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/downarrow.xbm:3.0 Thu Jun 13 03:59:48 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/downarrow.xbm Sat Feb 28 21:42:24 2004 @@ -1,6 +0,0 @@ -#define x5_width 13 -#define x5_height 14 -static char x5_bits[] = { - 0x40, 0x01, 0xc0, 0x01, 0x40, 0x01, 0xc0, 0x01, 0x40, 0x01, 0xc0, 0x01, - 0x40, 0x01, 0xc0, 0x01, 0x4c, 0x19, 0xf8, 0x0f, 0x70, 0x07, 0xe0, 0x03, - 0xc0, 0x01, 0x80, 0x00}; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl:3.1 Fri Dec 27 01:54:56 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl Sat Feb 28 21:42:24 2004 @@ -1,501 +0,0 @@ -# $XConsortium: entry.tcl /main/1 1996/09/21 14:15:21 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/entry.tcl,v 3.1 1996/12/27 06:54:56 dawes Exp $ -# -# entry.tcl -- -# -# This file defines the default bindings for Tk entry widgets and provides -# procedures that help in implementing those bindings. -# -# @(#) entry.tcl 1.36 95/06/17 17:47:29 -# -# Copyright (c) 1992-1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# Elements of tkPriv that are used in this file: -# -# afterId - If non-null, it means that auto-scanning is underway -# and it gives the "after" id for the next auto-scan -# command to be executed. -# mouseMoved - Non-zero means the mouse has moved a significant -# amount since the button went down (so, for example, -# start dragging out a selection). -# pressX - X-coordinate at which the mouse button was pressed. -# selectMode - The style of selection currently underway: -# char, word, or line. -# x, y - Last known mouse coordinates for scanning -# and auto-scanning. -#------------------------------------------------------------------------- - -# tkEntryClipboardKeysyms -- -# This procedure is invoked to identify the keys that correspond to -# the "copy", "cut", and "paste" functions for the clipboard. -# -# Arguments: -# copy - Name of the key (keysym name plus modifiers, if any, -# such as "Meta-y") used for the copy operation. -# cut - Name of the key used for the cut operation. -# paste - Name of the key used for the paste operation. - -proc tkEntryClipboardKeysyms {copy cut paste} { - bind Entry <$copy> { - if {[selection own -displayof %W] == "%W"} { - clipboard clear -displayof %W - catch { - clipboard append -displayof %W [selection get -displayof %W] - } - } - } - bind Entry <$cut> { - if {[selection own -displayof %W] == "%W"} { - clipboard clear -displayof %W - catch { - clipboard append -displayof %W [selection get -displayof %W] - %W delete sel.first sel.last - } - } - } - bind Entry <$paste> { - catch { - %W insert insert [selection get -displayof %W \ - -selection CLIPBOARD] - } - } -} - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for entries. -#------------------------------------------------------------------------- - -# Standard Motif bindings: - -bind Entry <1> { - tkEntryButton1 %W %x - %W selection clear -} -bind Entry { - set tkPriv(x) %x - tkEntryMouseSelect %W %x -} -bind Entry { - set tkPriv(selectMode) word - tkEntryMouseSelect %W %x - catch {%W icursor sel.first} -} -bind Entry { - set tkPriv(selectMode) line - tkEntryMouseSelect %W %x - %W icursor 0 -} -bind Entry { - set tkPriv(selectMode) char - %W selection adjust @%x -} -bind Entry { - set tkPriv(selectMode) word - tkEntryMouseSelect %W %x -} -bind Entry { - set tkPriv(selectMode) line - tkEntryMouseSelect %W %x -} -bind Entry { - set tkPriv(x) %x - tkEntryAutoScan %W -} -bind Entry { - tkCancelRepeat -} -bind Entry { - tkCancelRepeat -} -bind Entry { - %W icursor @%x -} - -bind Entry { - tkEntrySetCursor %W [expr [%W index insert] - 1] -} -bind Entry { - tkEntrySetCursor %W [expr [%W index insert] + 1] -} -bind Entry { - tkEntryKeySelect %W [expr [%W index insert] - 1] - tkEntrySeeInsert %W -} -bind Entry { - tkEntryKeySelect %W [expr [%W index insert] + 1] - tkEntrySeeInsert %W -} -bind Entry { - tkEntrySetCursor %W \ - [string wordstart [%W get] [expr [%W index insert] - 1]] -} -bind Entry { - tkEntrySetCursor %W [string wordend [%W get] [%W index insert]] -} -bind Entry { - tkEntryKeySelect %W \ - [string wordstart [%W get] [expr [%W index insert] - 1]] - tkEntrySeeInsert %W -} -bind Entry { - tkEntryKeySelect %W [string wordend [%W get] [%W index insert]] - tkEntrySeeInsert %W -} -bind Entry { - tkEntrySetCursor %W 0 -} -bind Entry { - tkEntryKeySelect %W 0 - tkEntrySeeInsert %W -} -bind Entry { - tkEntrySetCursor %W end -} -bind Entry { - tkEntryKeySelect %W end - tkEntrySeeInsert %W -} - -bind Entry { - if [%W selection present] { - %W delete sel.first sel.last - } else { - %W delete insert - } -} -bind Entry { - tkEntryBackspace %W -} - -bind Entry { - %W selection from insert -} -bind Entry { - tkListboxBeginSelect %W [%W index active] -} -bind Listbox { - tkListboxBeginExtend %W [%W index active] -} -bind Listbox { - tkListboxBeginExtend %W [%W index active] -} -bind Listbox { - tkListboxCancel %W -} -bind Listbox { - tkListboxSelectAll %W -} -bind Listbox { - if {[%W cget -selectmode] != "browse"} { - %W selection clear 0 end - } -} - -# Additional Tk bindings that aren't part of the Motif look and feel: - -bind Listbox <2> { - %W scan mark %x %y -} -bind Listbox { - %W scan dragto %x %y -} - -# tkListboxBeginSelect -- -# -# This procedure is typically invoked on button-1 presses. It begins -# the process of making a selection in the listbox. Its exact behavior -# depends on the selection mode currently in effect for the listbox; -# see the Motif documentation for details. -# -# Arguments: -# w - The listbox widget. -# el - The element for the selection operation (typically the -# one under the pointer). Must be in numerical form. - -proc tkListboxBeginSelect {w el} { - global tkPriv - if {[$w cget -selectmode] == "multiple"} { - if [$w selection includes $el] { - $w selection clear $el - } else { - $w selection set $el - } - } else { - $w selection clear 0 end - $w selection set $el - $w selection anchor $el - set tkPriv(listboxSelection) {} - set tkPriv(listboxPrev) $el - } -} - -# tkListboxMotion -- -# -# This procedure is called to process mouse motion events while -# button 1 is down. It may move or extend the selection, depending -# on the listbox's selection mode. -# -# Arguments: -# w - The listbox widget. -# el - The element under the pointer (must be a number). - -proc tkListboxMotion {w el} { - global tkPriv - if {$el == $tkPriv(listboxPrev)} { - return - } - set anchor [$w index anchor] - switch [$w cget -selectmode] { - browse { - $w selection clear 0 end - $w selection set $el - set tkPriv(listboxPrev) $el - } - extended { - set i $tkPriv(listboxPrev) - if [$w selection includes anchor] { - $w selection clear $i $el - $w selection set anchor $el - } else { - $w selection clear $i $el - $w selection clear anchor $el - } - while {($i < $el) && ($i < $anchor)} { - if {[lsearch $tkPriv(listboxSelection) $i] >= 0} { - $w selection set $i - } - incr i - } - while {($i > $el) && ($i > $anchor)} { - if {[lsearch $tkPriv(listboxSelection) $i] >= 0} { - $w selection set $i - } - incr i -1 - } - set tkPriv(listboxPrev) $el - } - } -} - -# tkListboxBeginExtend -- -# -# This procedure is typically invoked on shift-button-1 presses. It -# begins the process of extending a selection in the listbox. Its -# exact behavior depends on the selection mode currently in effect -# for the listbox; see the Motif documentation for details. -# -# Arguments: -# w - The listbox widget. -# el - The element for the selection operation (typically the -# one under the pointer). Must be in numerical form. - -proc tkListboxBeginExtend {w el} { - if {([$w cget -selectmode] == "extended") - && [$w selection includes anchor]} { - tkListboxMotion $w $el - } -} - -# tkListboxBeginToggle -- -# -# This procedure is typically invoked on control-button-1 presses. It -# begins the process of toggling a selection in the listbox. Its -# exact behavior depends on the selection mode currently in effect -# for the listbox; see the Motif documentation for details. -# -# Arguments: -# w - The listbox widget. -# el - The element for the selection operation (typically the -# one under the pointer). Must be in numerical form. - -proc tkListboxBeginToggle {w el} { - global tkPriv - if {[$w cget -selectmode] == "extended"} { - set tkPriv(listboxSelection) [$w curselection] - set tkPriv(listboxPrev) $el - $w selection anchor $el - if [$w selection includes $el] { - $w selection clear $el - } else { - $w selection set $el - } - } -} - -# tkListboxAutoScan -- -# This procedure is invoked when the mouse leaves an entry window -# with button 1 down. It scrolls the window up, down, left, or -# right, depending on where the mouse left the window, and reschedules -# itself as an "after" command so that the window continues to scroll until -# the mouse moves back into the window or the mouse button is released. -# -# Arguments: -# w - The entry window. - -proc tkListboxAutoScan {w} { - global tkPriv - set x $tkPriv(x) - set y $tkPriv(y) - if {$y >= [winfo height $w]} { - $w yview scroll 1 units - } elseif {$y < 0} { - $w yview scroll -1 units - } elseif {$x >= [winfo width $w]} { - $w xview scroll 2 units - } elseif {$x < 0} { - $w xview scroll -2 units - } else { - return - } - tkListboxMotion $w [$w index @$x,$y] - set tkPriv(afterId) [after 50 tkListboxAutoScan $w] -} - -# tkListboxUpDown -- -# -# Moves the location cursor (active element) up or down by one element, -# and changes the selection if we're in browse or extended selection -# mode. -# -# Arguments: -# w - The listbox widget. -# amount - +1 to move down one item, -1 to move back one item. - -proc tkListboxUpDown {w amount} { - global tkPriv - $w activate [expr [$w index active] + $amount] - $w see active - switch [$w cget -selectmode] { - browse { - $w selection clear 0 end - $w selection set active - } - extended { - $w selection clear 0 end - $w selection set active - $w selection anchor active - set tkPriv(listboxPrev) [$w index active] - set tkPriv(listboxSelection) {} - } - } -} - -# tkListboxExtendUpDown -- -# -# Does nothing unless we're in extended selection mode; in this -# case it moves the location cursor (active element) up or down by -# one element, and extends the selection to that point. -# -# Arguments: -# w - The listbox widget. -# amount - +1 to move down one item, -1 to move back one item. - -proc tkListboxExtendUpDown {w amount} { - if {[$w cget -selectmode] != "extended"} { - return - } - $w activate [expr [$w index active] + $amount] - $w see active - tkListboxMotion $w [$w index active] -} - -# tkListboxDataExtend -# -# This procedure is called for key-presses such as Shift-KEndData. -# If the selection mode isn't multiple or extend then it does nothing. -# Otherwise it moves the active element to el and, if we're in -# extended mode, extends the selection to that point. -# -# Arguments: -# w - The listbox widget. -# el - An integer element number. - -proc tkListboxDataExtend {w el} { - set mode [$w cget -selectmode] - if {$mode == "extended"} { - $w activate $el - $w see $el - if [$w selection includes anchor] { - tkListboxMotion $w $el - } - } elseif {$mode == "multiple"} { - $w activate $el - $w see $el - } -} - -# tkListboxCancel -# -# This procedure is invoked to cancel an extended selection in -# progress. If there is an extended selection in progress, it -# restores all of the items between the active one and the anchor -# to their previous selection state. -# -# Arguments: -# w - The listbox widget. - -proc tkListboxCancel w { - global tkPriv - if {[$w cget -selectmode] != "extended"} { - return - } - set first [$w index anchor] - set last $tkPriv(listboxPrev) - if {$first > $last} { - set tmp $first - set first $last - set last $tmp - } - $w selection clear $first $last - while {$first <= $last} { - if {[lsearch $tkPriv(listboxSelection) $first] >= 0} { - $w selection set $first - } - incr first - } -} - -# tkListboxSelectAll -# -# This procedure is invoked to handle the "select all" operation. -# For single and browse mode, it just selects the active element. -# Otherwise it selects everything in the widget. -# -# Arguments: -# w - The listbox widget. - -proc tkListboxSelectAll w { - set mode [$w cget -selectmode] - if {($mode == "single") || ($mode == "browse")} { - $w selection clear 0 end - $w selection set active - } else { - $w selection set 0 end - } -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl:3.1 Fri Dec 27 01:55:00 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl Sat Feb 28 21:42:24 2004 @@ -1,921 +0,0 @@ -# $XConsortium: menu.tcl /main/1 1996/09/21 14:15:49 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/menu.tcl,v 3.1 1996/12/27 06:55:00 dawes Exp $ -# -# menu.tcl -- -# -# This file defines the default bindings for Tk menus and menubuttons. -# It also implements keyboard traversal of menus and implements a few -# other utility procedures related to menus. -# -# @(#) menu.tcl 1.59 95/11/24 14:51:37 -# -# Copyright (c) 1992-1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# Elements of tkPriv that are used in this file: -# -# cursor - Saves the -cursor option for the posted menubutton. -# focus - Saves the focus during a menu selection operation. -# Focus gets restored here when the menu is unposted. -# grabGlobal - Used in conjunction with tkPriv(oldGrab): if -# tkPriv(oldGrab) is non-empty, then tkPriv(grabGlobal) -# contains either an empty string or "-global" to -# indicate whether the old grab was a local one or -# a global one. -# inMenubutton - The name of the menubutton widget containing -# the mouse, or an empty string if the mouse is -# not over any menubutton. -# oldGrab - Window that had the grab before a menu was posted. -# Used to restore the grab state after the menu -# is unposted. Empty string means there was no -# grab previously set. -# popup - If a menu has been popped up via tk_popup, this -# gives the name of the menu. Otherwise this -# value is empty. -# postedMb - Name of the menubutton whose menu is currently -# posted, or an empty string if nothing is posted -# A grab is set on this widget. -# relief - Used to save the original relief of the current -# menubutton. -# window - When the mouse is over a menu, this holds the -# name of the menu; it's cleared when the mouse -# leaves the menu. -#------------------------------------------------------------------------- - -#------------------------------------------------------------------------- -# Overall note: -# This file is tricky because there are four different ways that menus -# can be used: -# -# 1. As a pulldown from a menubutton. This is the most common usage. -# In this style, the variable tkPriv(postedMb) identifies the posted -# menubutton. -# 2. As a torn-off menu copied from some other menu. In this style -# tkPriv(postedMb) is empty, and the top-level menu is no -# override-redirect. -# 3. As an option menu, triggered from an option menubutton. In thi -# style tkPriv(postedMb) identifies the posted menubutton. -# 4. As a popup menu. In this style tkPriv(postedMb) is empty and -# the top-level menu is override-redirect. -# -# The various binding procedures use the state described above to -# distinguish the various cases and take different actions in each -# case. -#------------------------------------------------------------------------- - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for menus -# and menubuttons. -#------------------------------------------------------------------------- - -bind Menubutton {} -bind Menubutton { - tkMbEnter %W -} -bind Menubutton { - tkMbLeave %W -} -bind Menubutton <1> { - if {$tkPriv(inMenubutton) != ""} { - tkMbPost $tkPriv(inMenubutton) %X %Y - } -} -bind Menubutton { - tkMbMotion %W up %X %Y -} -bind Menubutton { - tkMbMotion %W down %X %Y -} -bind Menubutton { - tkMbButtonUp %W -} -bind Menubutton { - tkMbPost %W - tkMenuFirstEntry [%W cget -menu] -} -bind Menubutton { - tkMbPost %W - tkMenuFirstEntry [%W cget -menu] -} - -# Must set focus when mouse enters a menu, in order to allow -# mixed-mode processing using both the mouse and the keyboard. -# Don't set the focus if the event comes from a grab release, -# though: such an event can happen after as part of unposting -# a cascaded chain of menus, after the focus has already been -# restored to wherever it was before menu selection started. - -bind Menu {} -bind Menu { - set tkPriv(window) %W - if {"%m" != "NotifyUngrab"} { - focus %W - } -} -bind Menu { - tkMenuLeave %W %X %Y %s -} -bind Menu { - tkMenuMotion %W %y %s -} -bind Menu { - tkMenuButtonDown %W -} -bind Menu { - tkMenuInvoke %W 1 -} -bind Menu { - tkMenuInvoke %W 0 -} -bind Menu { - tkMenuInvoke %W 0 -} -bind Menu { - tkMenuEscape %W -} -bind Menu { - tkMenuLeftRight %W left -} -bind Menu { - tkMenuLeftRight %W right -} -bind Menu { - tkMenuNextEntry %W -1 -} -bind Menu { - tkMenuNextEntry %W +1 -} -bind Menu { - tkTraverseWithinMenu %W %A -} - -# The following bindings apply to all windows, and are used to -# implement keyboard menu traversal. - -bind all { - tkTraverseToMenu %W %A -} -bind all { - tkFirstMenu %W -} - -# tkMbEnter -- -# This procedure is invoked when the mouse enters a menubutton -# widget. It activates the widget unless it is disabled. Note: -# this procedure is only invoked when mouse button 1 is *not* down. -# The procedure tkMbB1Enter is invoked if the button is down. -# -# Arguments: -# w - The name of the widget. - -proc tkMbEnter w { - global tkPriv - - if {$tkPriv(inMenubutton) != ""} { - tkMbLeave $tkPriv(inMenubutton) - } - set tkPriv(inMenubutton) $w - if {[$w cget -state] != "disabled"} { - $w configure -state active - } -} - -# tkMbLeave -- -# This procedure is invoked when the mouse leaves a menubutton widget. -# It de-activates the widget, if the widget still exists. -# -# Arguments: -# w - The name of the widget. - -proc tkMbLeave w { - global tkPriv - - set tkPriv(inMenubutton) {} - if ![winfo exists $w] { - return - } - if {[$w cget -state] == "active"} { - $w configure -state normal - } -} - -# tkMbPost -- -# Given a menubutton, this procedure does all the work of posting -# its associated menu and unposting any other menu that is currently -# posted. -# -# Arguments: -# w - The name of the menubutton widget whose menu -# is to be posted. -# x, y - Root coordinates of cursor, used for positioning -# option menus. If not specified, then the center -# of the menubutton is used for an option menu. - -proc tkMbPost {w {x {}} {y {}}} { - global tkPriv - if {([$w cget -state] == "disabled") || ($w == $tkPriv(postedMb))} { - return - } - set menu [$w cget -menu] - if {$menu == ""} { - return - } - if ![string match $w.* $menu] { - error "can't post $menu: it isn't a descendant of $w (this is a new requirement in Tk versions 3.0 and later)" - } - set cur $tkPriv(postedMb) - if {$cur != ""} { - tkMenuUnpost {} - } - set tkPriv(cursor) [$w cget -cursor] - set tkPriv(relief) [$w cget -relief] - $w configure -cursor arrow - $w configure -relief raised - set tkPriv(postedMb) $w - set tkPriv(focus) [focus] - $menu activate none - - # If this looks like an option menubutton then post the menu so - # that the current entry is on top of the mouse. Otherwise post - # the menu just below the menubutton, as for a pull-down. - - if {([$w cget -indicatoron] == 1) && ([$w cget -textvariable] != "")} { - if {$y == ""} { - set x [expr [winfo rootx $w] + [winfo width $w]/2] - set y [expr [winfo rooty $w] + [winfo height $w]/2] - } - tkPostOverPoint $menu $x $y [tkMenuFindName $menu [$w cget -text]] - } else { - $menu post [winfo rootx $w] [expr [winfo rooty $w]+[winfo height $w]] - } - focus $menu - tkSaveGrabInfo $w - grab -global $w -} - -# tkMenuUnpost -- -# This procedure unposts a given menu, plus all of its ancestors up -# to (and including) a menubutton, if any. It also restores various -# values to what they were before the menu was posted, and releases -# a grab if there's a menubutton involved. Special notes: -# 1. It's important to unpost all menus before releasing the grab, so -# that any Enter-Leave events (e.g. from menu back to main -# application) have mode NotifyGrab. -# 2. Be sure to enclose various groups of commands in "catch" so that -# the procedure will complete even if the menubutton or the menu -# or the grab window has been deleted. -# -# Arguments: -# menu - Name of a menu to unpost. Ignored if there -# is a posted menubutton. - -proc tkMenuUnpost menu { - global tkPriv - set mb $tkPriv(postedMb) - - # Restore focus right away (otherwise X will take focus away when - # the menu is unmapped and under some window managers (e.g. olvwm) - # we'll lose the focus completely). - - catch {focus $tkPriv(focus)} - set tkPriv(focus) "" - - # Unpost menu(s) and restore some stuff that's dependent on - # what was posted. - - catch { - if {$mb != ""} { - set menu [$mb cget -menu] - $menu unpost - set tkPriv(postedMb) {} - $mb configure -cursor $tkPriv(cursor) - $mb configure -relief $tkPriv(relief) - } elseif {$tkPriv(popup) != ""} { - $tkPriv(popup) unpost - set tkPriv(popup) {} - } elseif {[wm overrideredirect $menu]} { - # We're in a cascaded sub-menu from a torn-off menu or popup. - # Unpost all the menus up to the toplevel one (but not - # including the top-level torn-off one) and deactivate the - # top-level torn off menu if there is one. - - while 1 { - set parent [winfo parent $menu] - if {([winfo class $parent] != "Menu") - || ![winfo ismapped $parent]} { - break - } - $parent activate none - $parent postcascade none - if {![wm overrideredirect $parent]} { - break - } - set menu $parent - } - $menu unpost - } - } - - # Release grab, if any, and restore the previous grab, if there - # was one. - - if {$menu != ""} { - set grab [grab current $menu] - if {$grab != ""} { - grab release $grab - } - } - if {$tkPriv(oldGrab) != ""} { - if {$tkPriv(grabStatus) == "global"} { - grab set -global $tkPriv(oldGrab) - } else { - grab set $tkPriv(oldGrab) - } - set tkPriv(oldGrab) "" - } -} - -# tkMbMotion -- -# This procedure handles mouse motion events inside menubuttons, and -# also outside menubuttons when a menubutton has a grab (e.g. when a -# menu selection operation is in progress). -# -# Arguments: -# w - The name of the menubutton widget. -# upDown - "down" means button 1 is pressed, "up" means -# it isn't. -# rootx, rooty - Coordinates of mouse, in (virtual?) root window. - -proc tkMbMotion {w upDown rootx rooty} { - global tkPriv - - if {$tkPriv(inMenubutton) == $w} { - return - } - set new [winfo containing $rootx $rooty] - if {($new != $tkPriv(inMenubutton)) && (($new == "") - || ([winfo toplevel $new] == [winfo toplevel $w]))} { - if {$tkPriv(inMenubutton) != ""} { - tkMbLeave $tkPriv(inMenubutton) - } - if {($new != "") && ([winfo class $new] == "Menubutton") - && ([$new cget -indicatoron] == 0)} { - if {$upDown == "down"} { - tkMbPost $new $rootx $rooty - } else { - tkMbEnter $new - } - } - } -} - -# tkMbButtonUp -- -# This procedure is invoked to handle button 1 releases for menubuttons. -# If the release happens inside the menubutton then leave its menu -# posted with element 0 activated. Otherwise, unpost the menu. -# -# Arguments: -# w - The name of the menubutton widget. - -proc tkMbButtonUp w { - global tkPriv - - if {($tkPriv(postedMb) == $w) && ($tkPriv(inMenubutton) == $w)} { - tkMenuFirstEntry [$tkPriv(postedMb) cget -menu] - } else { - tkMenuUnpost {} - } -} - -# tkMenuMotion -- -# This procedure is called to handle mouse motion events for menus. -# It does two things. First, it resets the active element in the -# menu, if the mouse is over the menu. Second, if a mouse button -# is down, it posts and unposts cascade entries to match the mouse -# position. -# -# Arguments: -# menu - The menu window. -# y - The y position of the mouse. -# state - Modifier state (tells whether buttons are down). - -proc tkMenuMotion {menu y state} { - global tkPriv - if {$menu == $tkPriv(window)} { - $menu activate @$y - } - if {($state & 0x1f00) != 0} { - $menu postcascade active - } -} - -# tkMenuButtonDown -- -# Handles button presses in menus. There are a couple of tricky things -# here: -# 1. Change the posted cascade entry (if any) to match the mouse position. -# 2. If there is a posted menubutton, must grab to the menubutton; this -# overrrides the implicit grab on button press, so that the menu -# button can track mouse motions over other menubuttons and change -# the posted menu. -# 3. If there's no posted menubutton (e.g. because we're a torn-off menu -# or one of its descendants) must grab to the top-level menu so that -# we can track mouse motions across the entire menu hierarchy. -# -# Arguments: -# menu - The menu window. - -proc tkMenuButtonDown menu { - global tkPriv - $menu postcascade active - if {$tkPriv(postedMb) != ""} { - grab -global $tkPriv(postedMb) - } else { - while {[wm overrideredirect $menu] - && ([winfo class [winfo parent $menu]] == "Menu") - && [winfo ismapped [winfo parent $menu]]} { - set menu [winfo parent $menu] - } - - # Don't update grab information if the grab window isn't changing. - # Otherwise, we'll get an error when we unpost the menus and - # restore the grab, since the old grab window will not be viewable - # anymore. - - if {$menu != [grab current $menu]} { - tkSaveGrabInfo $menu - } - - # Must re-grab even if the grab window hasn't changed, in order - # to release the implicit grab from the button press. - - grab -global $menu - } -} - -# tkMenuLeave -- -# This procedure is invoked to handle Leave events for a menu. It -# deactivates everything unless the active element is a cascade element -# and the mouse is now over the submenu. -# -# Arguments: -# menu - The menu window. -# rootx, rooty - Root coordinates of mouse. -# state - Modifier state. - -proc tkMenuLeave {menu rootx rooty state} { - global tkPriv - set tkPriv(window) {} - if {[$menu index active] == "none"} { - return - } - if {([$menu type active] == "cascade") - && ([winfo containing $rootx $rooty] - == [$menu entrycget active -menu])} { - return - } - $menu activate none -} - -# tkMenuInvoke -- -# This procedure is invoked when button 1 is released over a menu. -# It invokes the appropriate menu action and unposts the menu if -# it came from a menubutton. -# -# Arguments: -# w - Name of the menu widget. -# buttonRelease - 1 means this procedure is called because of -# a button release; 0 means because of keystroke. - -proc tkMenuInvoke {w buttonRelease} { - global tkPriv - - if {$buttonRelease && ($tkPriv(window) == "")} { - # Mouse was pressed over a menu without a menu button, then - # dragged off the menu (possibly with a cascade posted) and - # released. Unpost everything and quit. - - $w postcascade none - $w activate none - tkMenuUnpost $w - return - } - if {[$w type active] == "cascade"} { - $w postcascade active - set menu [$w entrycget active -menu] - tkMenuFirstEntry $menu - } elseif {[$w type active] == "tearoff"} { - tkMenuUnpost $w - tkTearOffMenu $w - } else { - tkMenuUnpost $w - uplevel #0 [list $w invoke active] - } -} - -# tkMenuEscape -- -# This procedure is invoked for the Cancel (or Escape) key. It unposts -# the given menu and, if it is the top-level menu for a menu button, -# unposts the menu button as well. -# -# Arguments: -# menu - Name of the menu window. - -proc tkMenuEscape menu { - if {[winfo class [winfo parent $menu]] != "Menu"} { - tkMenuUnpost $menu - } else { - tkMenuLeftRight $menu -1 - } -} - -# tkMenuLeftRight -- -# This procedure is invoked to handle "left" and "right" traversal -# motions in menus. It traverses to the next menu in a menu bar, -# or into or out of a cascaded menu. -# -# Arguments: -# menu - The menu that received the keyboard -# event. -# direction - Direction in which to move: "left" or "right" - -proc tkMenuLeftRight {menu direction} { - global tkPriv - - # First handle traversals into and out of cascaded menus. - - if {$direction == "right"} { - set count 1 - if {[$menu type active] == "cascade"} { - $menu postcascade active - set m2 [$menu entrycget active -menu] - if {$m2 != ""} { - tkMenuFirstEntry $m2 - } - return - } - } else { - set count -1 - set m2 [winfo parent $menu] - if {[winfo class $m2] == "Menu"} { - $menu activate none - focus $m2 - - # This code unposts any posted submenu in the parent. - - set tmp [$m2 index active] - $m2 activate none - $m2 activate $tmp - return - } - } - - # Can't traverse into or out of a cascaded menu. Go to the next - # or previous menubutton, if that makes sense. - - set w $tkPriv(postedMb) - if {$w == ""} { - return - } - set buttons [winfo children [winfo parent $w]] - set length [llength $buttons] - set i [expr [lsearch -exact $buttons $w] + $count] - while 1 { - while {$i < 0} { - incr i $length - } - while {$i >= $length} { - incr i -$length - } - set mb [lindex $buttons $i] - if {([winfo class $mb] == "Menubutton") - && ([$mb cget -state] != "disabled") - && ([$mb cget -menu] != "") - && ([[$mb cget -menu] index last] != "none")} { - break - } - if {$mb == $w} { - return - } - incr i $count - } - tkMbPost $mb - tkMenuFirstEntry [$mb cget -menu] -} - -# tkMenuNextEntry -- -# Activate the next higher or lower entry in the posted menu, -# wrapping around at the ends. Disabled entries are skipped. -# -# Arguments: -# menu - Menu window that received the keystroke. -# count - 1 means go to the next lower entry, -# -1 means go to the next higher entry. - -proc tkMenuNextEntry {menu count} { - global tkPriv - if {[$menu index last] == "none"} { - return - } - set length [expr [$menu index last]+1] - set quitAfter $length - set active [$menu index active] - if {$active == "none"} { - set i 0 - } else { - set i [expr $active + $count] - } - while 1 { - if {$quitAfter <= 0} { - # We've tried every entry in the menu. Either there are - # none, or they're all disabled. Just give up. - - return - } - while {$i < 0} { - incr i $length - } - while {$i >= $length} { - incr i -$length - } - if {[catch {$menu entrycget $i -state} state] == 0} { - if {$state != "disabled"} { - break - } - } - if {$i == $active} { - return - } - incr i $count - incr quitAfter -1 - } - $menu activate $i - $menu postcascade $i -} - -# tkMenuFind -- -# This procedure searches the entire window hierarchy under w for -# a menubutton that isn't disabled and whose underlined character -# is "char". It returns the name of that window, if found, or an -# empty string if no matching window was found. If "char" is an -# empty string then the procedure returns the name of the first -# menubutton found that isn't disabled. -# -# Arguments: -# w - Name of window where key was typed. -# char - Underlined character to search for; -# may be either upper or lower case, and -# will match either upper or lower case. - -proc tkMenuFind {w char} { - global tkPriv - set char [string tolower $char] - - foreach child [winfo child $w] { - switch [winfo class $child] { - Menubutton { - set char2 [string index [$child cget -text] \ - [$child cget -underline]] - if {([string compare $char [string tolower $char2]] == 0) - || ($char == "")} { - if {[$child cget -state] != "disabled"} { - return $child - } - } - } - Frame { - set match [tkMenuFind $child $char] - if {$match != ""} { - return $match - } - } - } - } - return {} -} - -# tkTraverseToMenu -- -# This procedure implements keyboard traversal of menus. Given an -# ASCII character "char", it looks for a menubutton with that character -# underlined. If one is found, it posts the menubutton's menu -# -# Arguments: -# w - Window in which the key was typed (selects -# a toplevel window). -# char - Character that selects a menu. The case -# is ignored. If an empty string, nothing -# happens. - -proc tkTraverseToMenu {w char} { - if {$char == ""} { - return - } - while {[winfo class $w] == "Menu"} { - set w [winfo parent $w] - } - set w [tkMenuFind [winfo toplevel $w] $char] - if {$w != ""} { - tkMbPost $w - tkMenuFirstEntry [$w cget -menu] - } -} - -# tkFirstMenu -- -# This procedure traverses to the first menubutton in the toplevel -# for a given window, and posts that menubutton's menu. -# -# Arguments: -# w - Name of a window. Selects which toplevel -# to search for menubuttons. - -proc tkFirstMenu w { - set w [tkMenuFind [winfo toplevel $w] ""] - if {$w != ""} { - tkMbPost $w - tkMenuFirstEntry [$w cget -menu] - } -} - -# tkTraverseWithinMenu -# This procedure implements keyboard traversal within a menu. It -# searches for an entry in the menu that has "char" underlined. If -# such an entry is found, it is invoked and the menu is unposted. -# -# Arguments: -# w - The name of the menu widget. -# char - The character to look for; case is -# ignored. If the string is empty then -# nothing happens. - -proc tkTraverseWithinMenu {w char} { - if {$char == ""} { - return - } - set char [string tolower $char] - set last [$w index last] - if {$last == "none"} { - return - } - for {set i 0} {$i <= $last} {incr i} { - if [catch {set char2 [string index \ - [$w entrycget $i -label] \ - [$w entrycget $i -underline]]}] { - continue - } - if {[string compare $char [string tolower $char2]] == 0} { - if {[$w type $i] == "cascade"} { - $w postcascade $i - $w activate $i - set m2 [$w entrycget $i -menu] - if {$m2 != ""} { - tkMenuFirstEntry $m2 - } - } else { - tkMenuUnpost $w - uplevel #0 [list $w invoke $i] - } - return - } - } -} - -# tkMenuFirstEntry -- -# Given a menu, this procedure finds the first entry that isn't -# disabled or a tear-off or separator, and activates that entry. -# However, if there is already an active entry in the menu (e.g., -# because of a previous call to tkPostOverPoint) then the active -# entry isn't changed. This procedure also sets the input focus -# to the menu. -# -# Arguments: -# menu - Name of the menu window (possibly empty). - -proc tkMenuFirstEntry menu { - if {$menu == ""} { - return - } - focus $menu - if {[$menu index active] != "none"} { - return - } - set last [$menu index last] - if {$last == "none"} { - return - } - for {set i 0} {$i <= $last} {incr i} { - if {([catch {set state [$menu entrycget $i -state]}] == 0) - && ($state != "disabled") && ([$menu type $i] != "tearoff")} { - $menu activate $i - return - } - } -} - -# tkMenuFindName -- -# Given a menu and a text string, return the index of the menu entry -# that displays the string as its label. If there is no such entry, -# return an empty string. This procedure is tricky because some names -# like "active" have a special meaning in menu commands, so we can't -# always use the "index" widget command. -# -# Arguments: -# menu - Name of the menu widget. -# s - String to look for. - -proc tkMenuFindName {menu s} { - set i "" - if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { - catch {set i [$menu index $s]} - return $i - } - set last [$menu index last] - if {$last == "none"} { - return - } - for {set i 0} {$i <= $last} {incr i} { - if ![catch {$menu entrycget $i -label} label] { - if {$label == $s} { - return $i - } - } - } - return "" -} - -# tkPostOverPoint -- -# This procedure posts a given menu such that a given entry in the -# menu is centered over a given point in the root window. It also -# activates the given entry. -# -# Arguments: -# menu - Menu to post. -# x, y - Root coordinates of point. -# entry - Index of entry within menu to center over (x,y). -# If omitted or specified as {}, then the menu's -# upper-left corner goes at (x,y). - -proc tkPostOverPoint {menu x y {entry {}}} { - if {$entry != {}} { - if {$entry == [$menu index last]} { - incr y [expr -([$menu yposition $entry] \ - + [winfo reqheight $menu])/2] - } else { - incr y [expr -([$menu yposition $entry] \ - + [$menu yposition [expr $entry+1]])/2] - } - incr x [expr -[winfo reqwidth $menu]/2] - } - $menu post $x $y - if {($entry != {}) && ([$menu entrycget $entry -state] != "disabled")} { - $menu activate $entry - } -} - -# tkSaveGrabInfo -- -# Sets the variables tkPriv(oldGrab) and tkPriv(grabStatus) to record -# the state of any existing grab on the w's display. -# -# Arguments: -# w - Name of a window; used to select the display -# whose grab information is to be recorded. - -proc tkSaveGrabInfo w { - global tkPriv - set tkPriv(oldGrab) [grab current $w] - if {$tkPriv(oldGrab) != ""} { - set tkPriv(grabStatus) [grab status $tkPriv(oldGrab)] - } -} - -# tk_popup -- -# This procedure pops up a menu and sets things up for traversing -# the menu and its submenus. -# -# Arguments: -# menu - Name of the menu to be popped up. -# x, y - Root coordinates at which to pop up the -# menu. -# entry - Index of a menu entry to center over (x,y). -# If omitted or specified as {}, then menu's -# upper-left corner goes at (x,y). - -proc tk_popup {menu x y {entry {}}} { - global tkPriv - if {($tkPriv(popup) != "") || ($tkPriv(postedMb) != "")} { - tkMenuUnpost {} - } - tkPostOverPoint $menu $x $y $entry - tkSaveGrabInfo $menu - grab -global $menu - set tkPriv(popup) $menu - set tkPriv(focus) [focus] - focus $menu -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl:3.4 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl:3.4 Fri Dec 27 01:55:01 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl Sat Feb 28 21:42:24 2004 @@ -1,144 +0,0 @@ -# $XConsortium: misc.tcl /main/1 1996/09/21 14:15:06 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/misc.tcl,v 3.4 1996/12/27 06:55:01 dawes Exp $ -# -# Copyright 1996 by Joseph V. Moss -# -# See the file "LICENSE" for information regarding redistribution terms, -# and for a DISCLAIMER OF ALL WARRANTIES. -# - -# -# Misc routines that could be useful outside XF86Setup -# - -# remove all whitespace from the string - -proc zap_white { str } { - regsub -all "\[ \t\n\]+" $str {} str - return $str -} - - -# replace all sequences of whitespace with a single space - -proc squash_white { str } { - regsub -all "\[ \t\n\]+" $str { } str - return $str -} - - -# implement do { ... } while loop - -proc do { commands while expression } { - uplevel $commands - while { [uplevel [list expr $expression]] } { - uplevel $commands - } -} - - -# break a long line into shorter lines - -proc parafmt { llen string } { - set string [string trim [squash_white $string]] - set retval "" - while { [string length $string] > $llen } { - set tmp [string range $string 0 $llen] - #puts stderr "'$string'$tmp'$retval'" - set pos [string last " " $tmp] - if { $pos == -1 } { - append retval [string range $string 0 [expr $llen-1]]\n - set string [string range $string $llen end] - continue - } - if { $pos == 0 } { - append retval [string range $string 1 [expr $llen]]\n - set string [string range $string $llen end] - continue - } - if { $pos == $llen-1 } { - append retval [string range $string 0 [expr $llen-2]]\n - set string [string range $string $llen end] - continue - } - append retval [string range $tmp 0 [expr $pos-1]]\n - set string [string range $string [expr $pos+1] end] - } - #return [string trimright $retval \n]\n$string - return $retval$string -} - - -# convert the window name to a form that can be used as a prefix to -# to the window names of child windows -# - basically, avoid double dot - -proc winpathprefix { w } { - if ![string compare . $w] { return "" } - return $w -} - - -# return a (sorted) list with duplicate elements removed -# uses the same syntax as lsort - -proc lrmdups { args } { - set inlist [eval lsort $args] - set retlist "" - set lastelem "nomatch[lindex $inlist 0]" - foreach elem $inlist { - if [string compare $lastelem $elem] { - lappend retlist $elem - set lastelem $elem - } - } - return $retlist -} - - -# return the name of the file to which the given symlink points -# if the name is a relative path, convert it to a full path -# (assumes the symlink is given as a full path) - -proc readlink { linkname } { - set fname [file readlink $linkname] - if { ![string length $fname] - || ![string compare [string index $fname 0] /] } { - return $fname - } - set path [file dirname $linkname]/$fname - regsub -all {/\./} $path / path - return $path -} - - -#simple random number generator - -proc random {args} { - global RNG_seed - - set max 259200 - set argcnt [llength $args] - if { $argcnt < 1 || $argcnt > 2 } { - error "wrong # args: random limit | seed ?seedval?" - } - if ![string compare [lindex $args 0] seed] { - if { $argcnt == 2 } { - set RNG_seed [expr [lindex $args 1]%$max] - } else { - set RNG_seed [expr \ - ([pid]+[clock clicks])%$max] - } - return - } - if ![info exists RNG_seed] { - set RNG_seed [expr ([pid]+[clock clicks])%$max] - } - set RNG_seed [expr ($RNG_seed*7141+54773) % $max] - return [expr int(double($RNG_seed)*[lindex $args 0]/$max)] -} - Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm:1.1 Mon Apr 5 03:13:04 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm Sat Feb 28 21:42:24 2004 @@ -1,11 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/narrower.xbm,v 1.1 1999/04/05 07:13:04 dawes Exp $ */ -#define narrower_width 24 -#define narrower_height 24 -static unsigned char narrower_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x40, 0x00, 0x02, 0x40, 0x00, 0x02, - 0x40, 0x00, 0x02, 0x48, 0x00, 0x12, 0x50, 0x00, 0x0a, 0x7e, 0x00, 0x7e, - 0x50, 0x00, 0x0a, 0x48, 0x00, 0x12, 0x40, 0x00, 0x02, 0x40, 0x00, 0x02, - 0x40, 0x00, 0x02, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl:3.1 Fri Dec 27 01:55:02 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl Sat Feb 28 21:42:24 2004 @@ -1,53 +0,0 @@ -# $XConsortium: optionMenu.tcl /main/1 1996/09/21 14:15:53 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/optionMenu.tcl,v 3.1 1996/12/27 06:55:02 dawes Exp $ -# -# optionMenu.tcl -- -# -# This file defines the procedure tk_optionMenu, which creates -# an option button and its associated menu. -# -# @(#) optionMenu.tcl 1.6 95/01/06 11:18:53 -# -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -# tk_optionMenu -- -# This procedure creates an option button named $w and an associated -# menu. Together they provide the functionality of Motif option menus: -# they can be used to select one of many values, and the current value -# appears in the global variable varName, as well as in the text of -# the option menubutton. The name of the menu is returned as the -# procedure's result, so that the caller can use it to change configuration -# options on the menu or otherwise manipulate it. -# -# Arguments: -# w - The name to use for the menubutton. -# varName - Global variable to hold the currently selected value. -# firstValue - First of legal values for option (must be >= 1). -# args - Any number of additional values. - -proc tk_optionMenu {w varName firstValue args} { - upvar #0 $varName var - - if ![info exists var] { - set var $firstValue - } - menubutton $w -textvariable $varName -indicatoron 1 -menu $w.menu \ - -relief raised -bd 2 -padx 4p -pady 4p -highlightthickness 2 \ - -anchor c - menu $w.menu -tearoff 0 - $w.menu add command -label $firstValue \ - -command [list set $varName $firstValue] - foreach i $args { - $w.menu add command -label $i -command [list set $varName $i] - } - return $w.menu -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl:3.1 Fri Dec 27 01:55:03 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl Sat Feb 28 21:42:24 2004 @@ -1,227 +0,0 @@ -# $XConsortium: palette.tcl /main/1 1996/09/21 14:16:00 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/palette.tcl,v 3.1 1996/12/27 06:55:03 dawes Exp $ -# -# palette.tcl -- -# -# This file contains procedures that change the color palette used -# by Tk. -# -# @(#) palette.tcl 1.1 95/05/22 14:55:29 -# -# Copyright (c) 1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -# tk_setPalette -- -# Changes the default color scheme for a Tk application by setting -# default colors in the option database and by modifying all of the -# color options for existing widgets that have the default value. -# -# Arguments: -# The arguments consist of either a single color name, which -# will be used as the new background color (all other colors will -# be computed from this) or an even number of values consisting of -# option names and values. The name for an option is the one used -# for the option database, such as activeForeground, not -activeforeground. - -proc tk_setPalette args { - global tkPalette - - # Create an array that has the complete new palette. If some colors - # aren't specified, compute them from other colors that are specified. - - if {[llength $args] == 1} { - set new(background) [lindex $args 0] - } else { - array set new $args - } - if ![info exists new(background)] { - error "must specify a background color" - } - if ![info exists new(foreground)] { - set new(foreground) black - } - set bg [winfo rgb . $new(background)] - set fg [winfo rgb . $new(foreground)] - set darkerBg [format #%02x%02x%02x [expr (9*[lindex $bg 0])/2560] \ - [expr (9*[lindex $bg 1])/2560] [expr (9*[lindex $bg 2])/2560]] - foreach i {activeForeground insertBackground selectForeground \ - highlightColor} { - if ![info exists new($i)] { - set new($i) $new(foreground) - } - } - if ![info exists new(disabledForeground)] { - set new(disabledForeground) [format #%02x%02x%02x \ - [expr (3*[lindex $bg 0] + [lindex $fg 0])/1024] \ - [expr (3*[lindex $bg 1] + [lindex $fg 1])/1024] \ - [expr (3*[lindex $bg 2] + [lindex $fg 2])/1024]] - } - if ![info exists new(highlightBackground)] { - set new(highlightBackground) $new(background) - } - if ![info exists new(activeBackground)] { - # Pick a default active background that islighter than the - # normal background. To do this, round each color component - # up by 15% or 1/3 of the way to full white, whichever is - # greater. - - foreach i {0 1 2} { - set light($i) [expr [lindex $bg $i]/256] - set inc1 [expr ($light($i)*15)/100] - set inc2 [expr (255-$light($i))/3] - if {$inc1 > $inc2} { - incr light($i) $inc1 - } else { - incr light($i) $inc2 - } - if {$light($i) > 255} { - set light($i) 255 - } - } - set new(activeBackground) [format #%02x%02x%02x $light(0) \ - $light(1) $light(2)] - } - if ![info exists new(selectBackground)] { - set new(selectBackground) $darkerBg - } - if ![info exists new(troughColor)] { - set new(troughColor) $darkerBg - } - if ![info exists new(selectColor)] { - set new(selectColor) #b03060 - } - - # Walk the widget hierarchy, recoloring all existing windows. - # Before doing this, make sure that the tkPalette variable holds - # the default values of all options, so that tkRecolorTree can - # be sure to only change options that have their default values. - # If the variable exists, then it is already correct (it was created - # the last time this procedure was invoked). If the variable - # doesn't exist, fill it in using the defaults from a few widgets. - - if ![info exists tkPalette] { - checkbutton .c14732 - entry .e14732 - scrollbar .s14732 - set tkPalette(activeBackground) \ - [lindex [.c14732 configure -activebackground] 3] - set tkPalette(activeForeground) \ - [lindex [.c14732 configure -activeforeground] 3] - set tkPalette(background) \ - [lindex [.c14732 configure -background] 3] - set tkPalette(disabledForeground) \ - [lindex [.c14732 configure -disabledforeground] 3] - set tkPalette(foreground) \ - [lindex [.c14732 configure -foreground] 3] - set tkPalette(highlightBackground) \ - [lindex [.c14732 configure -highlightbackground] 3] - set tkPalette(highlightColor) \ - [lindex [.c14732 configure -highlightcolor] 3] - set tkPalette(insertBackground) \ - [lindex [.e14732 configure -insertbackground] 3] - set tkPalette(selectColor) \ - [lindex [.c14732 configure -selectcolor] 3] - set tkPalette(selectBackground) \ - [lindex [.e14732 configure -selectbackground] 3] - set tkPalette(selectForeground) \ - [lindex [.e14732 configure -selectforeground] 3] - set tkPalette(troughColor) \ - [lindex [.s14732 configure -troughcolor] 3] - destroy .c14732 .e14732 .s14732 - } - tkRecolorTree . new - - # Change the option database so that future windows will get the - # same colors. - - foreach option [array names new] { - option add *$option $new($option) widgetDefault - } - - # Save the options in the global variable tkPalette, for use the - # next time we change the options. - - array set tkPalette [array get new] -} - -# tkRecolorTree -- -# This procedure changes the colors in a window and all of its -# descendants, according to information provided by the colors -# argument. It only modifies colors that have their default values -# as specified by the tkPalette variable. -# -# Arguments: -# w - The name of a window. This window and all its -# descendants are recolored. -# colors - The name of an array variable in the caller, -# which contains color information. Each element -# is named after a widget configuration option, and -# each value is the value for that option. - -proc tkRecolorTree {w colors} { - global tkPalette - upvar $colors c - foreach dbOption [array names c] { - set option -[string tolower $dbOption] - if ![catch {$w cget $option} value] { - if {$value == $tkPalette($dbOption)} { - $w configure $option $c($dbOption) - } - } - } - foreach child [winfo children $w] { - tkRecolorTree $child c - } -} - -# tkDarken -- -# Given a color name, computes a new color value that darkens (or -# brightens) the given color by a given percent. -# -# Arguments: -# color - Name of starting color. -# perecent - Integer telling how much to brighten or darken as a -# percent: 50 means darken by 50%, 110 means brighten -# by 10%. - -proc tkDarken {color percent} { - set l [winfo rgb . $color] - set red [expr [lindex $l 0]/256] - set green [expr [lindex $l 1]/256] - set blue [expr [lindex $l 2]/256] - set red [expr ($red*$percent)/100] - if {$red > 255} { - set red 255 - } - set green [expr ($green*$percent)/100] - if {$green > 255} { - set green 255 - } - set blue [expr ($blue*$percent)/100] - if {$blue > 255} { - set blue 255 - } - format #%02x%02x%02x $red $green $blue -} - -# tk_bisque -- -# Reset the Tk color palette to the old "bisque" colors. -# -# Arguments: -# None. - -proc tk_bisque {} { - tk_setPalette activeBackground #e6ceb1 activeForeground black \ - background #ffe4c4 disabledForeground #b0b0b0 foreground black \ - highlightBackground #ffe4c4 highlightColor black \ - insertBackground black selectColor #b03060 \ - selectBackground #e6ceb1 selectForeground black \ - troughColor #cdb79e -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/prolog.ps diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/prolog.ps:3.0 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/prolog.ps:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/prolog.ps:3.0 Tue Aug 13 07:28:54 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/prolog.ps Sat Feb 28 21:42:24 2004 @@ -1,284 +0,0 @@ -%%BeginProlog -50 dict begin - -% This is a standard prolog for Postscript generated by Tk's canvas -% widget. -% SCCS: @(#) prolog.ps 1.5 96/02/17 17:45:11 - -% The definitions below just define all of the variables used in -% any of the procedures here. This is needed for obscure reasons -% explained on p. 716 of the Postscript manual (Section H.2.7, -% "Initializing Variables," in the section on Encapsulated Postscript). - -/baseline 0 def -/stipimage 0 def -/height 0 def -/justify 0 def -/lineLength 0 def -/spacing 0 def -/stipple 0 def -/strings 0 def -/xoffset 0 def -/yoffset 0 def -/tmpstip null def - -% Define the array ISOLatin1Encoding (which specifies how characters are -% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript -% level 2 is supposed to define it, but level 1 doesn't). - -systemdict /ISOLatin1Encoding known not { - /ISOLatin1Encoding [ - /space /space /space /space /space /space /space /space - /space /space /space /space /space /space /space /space - /space /space /space /space /space /space /space /space - /space /space /space /space /space /space /space /space - /space /exclam /quotedbl /numbersign /dollar /percent /ampersand - /quoteright - /parenleft /parenright /asterisk /plus /comma /minus /period /slash - /zero /one /two /three /four /five /six /seven - /eight /nine /colon /semicolon /less /equal /greater /question - /at /A /B /C /D /E /F /G - /H /I /J /K /L /M /N /O - /P /Q /R /S /T /U /V /W - /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore - /quoteleft /a /b /c /d /e /f /g - /h /i /j /k /l /m /n /o - /p /q /r /s /t /u /v /w - /x /y /z /braceleft /bar /braceright /asciitilde /space - /space /space /space /space /space /space /space /space - /space /space /space /space /space /space /space /space - /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent - /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron - /space /exclamdown /cent /sterling /currency /yen /brokenbar /section - /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen - /registered /macron - /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph - /periodcentered - /cedillar /onesuperior /ordmasculine /guillemotright /onequarter - /onehalf /threequarters /questiondown - /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla - /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex - /Idieresis - /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply - /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn - /germandbls - /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla - /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex - /idieresis - /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide - /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn - /ydieresis - ] def -} if - -% font ISOEncode font -% This procedure changes the encoding of a font from the default -% Postscript encoding to ISOLatin1. It's typically invoked just -% before invoking "setfont". The body of this procedure comes from -% Section 5.6.1 of the Postscript book. - -/ISOEncode { - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding ISOLatin1Encoding def - currentdict - end - - % I'm not sure why it's necessary to use "definefont" on this new - % font, but it seems to be important; just use the name "Temporary" - % for the font. - - /Temporary exch definefont -} bind def - -% StrokeClip -% -% This procedure converts the current path into a clip area under -% the assumption of stroking. It's a bit tricky because some Postscript -% interpreters get errors during strokepath for dashed lines. If -% this happens then turn off dashes and try again. - -/StrokeClip { - {strokepath} stopped { - (This Postscript printer gets limitcheck overflows when) = - (stippling dashed lines; lines will be printed solid instead.) = - [] 0 setdash strokepath} if - clip -} bind def - -% desiredSize EvenPixels closestSize -% -% The procedure below is used for stippling. Given the optimal size -% of a dot in a stipple pattern in the current user coordinate system, -% compute the closest size that is an exact multiple of the device's -% pixel size. This allows stipple patterns to be displayed without -% aliasing effects. - -/EvenPixels { - % Compute exact number of device pixels per stipple dot. - dup 0 matrix currentmatrix dtransform - dup mul exch dup mul add sqrt - - % Round to an integer, make sure the number is at least 1, and compute - % user coord distance corresponding to this. - dup round dup 1 lt {pop 1} if - exch div mul -} bind def - -% width height string StippleFill -- -% -% Given a path already set up and a clipping region generated from -% it, this procedure will fill the clipping region with a stipple -% pattern. "String" contains a proper image description of the -% stipple pattern and "width" and "height" give its dimensions. Each -% stipple dot is assumed to be about one unit across in the current -% user coordinate system. This procedure trashes the graphics state. - -/StippleFill { - % The following code is needed to work around a NeWSprint bug. - - /tmpstip 1 index def - - % Change the scaling so that one user unit in user coordinates - % corresponds to the size of one stipple dot. - 1 EvenPixels dup scale - - % Compute the bounding box occupied by the path (which is now - % the clipping region), and round the lower coordinates down - % to the nearest starting point for the stipple pattern. Be - % careful about negative numbers, since the rounding works - % differently on them. - - pathbbox - 4 2 roll - 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll - 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll - - % Stack now: width height string y1 y2 x1 x2 - % Below is a doubly-nested for loop to iterate across this area - % in units of the stipple pattern size, going up columns then - % across rows, blasting out a stipple-pattern-sized rectangle at - % each position - - 6 index exch { - 2 index 5 index 3 index { - % Stack now: width height string y1 y2 x y - - gsave - 1 index exch translate - 5 index 5 index true matrix tmpstip imagemask - grestore - } for - pop - } for - pop pop pop pop pop -} bind def - -% -- AdjustColor -- -% Given a color value already set for output by the caller, adjusts -% that value to a grayscale or mono value if requested by the CL -% variable. - -/AdjustColor { - CL 2 lt { - currentgray - CL 0 eq { - .5 lt {0} {1} ifelse - } if - setgray - } if -} bind def - -% x y strings spacing xoffset yoffset justify stipple DrawText -- -% This procedure does all of the real work of drawing text. The -% color and font must already have been set by the caller, and the -% following arguments must be on the stack: -% -% x, y - Coordinates at which to draw text. -% strings - An array of strings, one for each line of the text item, -% in order from top to bottom. -% spacing - Spacing between lines. -% xoffset - Horizontal offset for text bbox relative to x and y: 0 for -% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se. -% yoffset - Vertical offset for text bbox relative to x and y: 0 for -% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se. -% justify - 0 for left justification, 0.5 for center, 1 for right justify. -% stipple - Boolean value indicating whether or not text is to be -% drawn in stippled fashion. If text is stippled, -% procedure StippleText must have been defined to call -% StippleFill in the right way. -% -% Also, when this procedure is invoked, the color and font must already -% have been set for the text. - -/DrawText { - /stipple exch def - /justify exch def - /yoffset exch def - /xoffset exch def - /spacing exch def - /strings exch def - - % First scan through all of the text to find the widest line. - - /lineLength 0 def - strings { - stringwidth pop - dup lineLength gt {/lineLength exch def} {pop} ifelse - newpath - } forall - - % Compute the baseline offset and the actual font height. - - 0 0 moveto (TXygqPZ) false charpath - pathbbox dup /baseline exch def - exch pop exch sub /height exch def pop - newpath - - % Translate coordinates first so that the origin is at the upper-left - % corner of the text's bounding box. Remember that x and y for - % positioning are still on the stack. - - translate - lineLength xoffset mul - strings length 1 sub spacing mul height add yoffset mul translate - - % Now use the baseline and justification information to translate so - % that the origin is at the baseline and positioning point for the - % first line of text. - - justify lineLength mul baseline neg translate - - % Iterate over each of the lines to output it. For each line, - % compute its width again so it can be properly justified, then - % display it. - - strings { - dup stringwidth pop - justify neg mul 0 moveto - stipple { - - % The text is stippled, so turn it into a path and print - % by calling StippledText, which in turn calls StippleFill. - % Unfortunately, many Postscript interpreters will get - % overflow errors if we try to do the whole string at - % once, so do it a character at a time. - - gsave - /char (X) def - { - char 0 3 -1 roll put - currentpoint - gsave - char true charpath clip StippleText - grestore - char stringwidth translate - moveto - } forall - grestore - } {show} ifelse - 0 spacing neg translate - } forall -} bind def - -%%EndProlog Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl:3.1 Fri Dec 27 01:55:04 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl Sat Feb 28 21:42:24 2004 @@ -1,269 +0,0 @@ -# $XConsortium: scale.tcl /main/1 1996/09/21 14:16:04 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scale.tcl,v 3.1 1996/12/27 06:55:04 dawes Exp $ -# -# scale.tcl -- -# -# This file defines the default bindings for Tk scale widgets and provides -# procedures that help in implementing the bindings. -# -# @(#) scale.tcl 1.9 95/08/30 09:46:57 -# -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for entries. -#------------------------------------------------------------------------- - -# Standard Motif bindings: - -bind Scale { - if $tk_strictMotif { - set tkPriv(activeBg) [%W cget -activebackground] - %W config -activebackground [%W cget -background] - } - tkScaleActivate %W %x %y -} -bind Scale { - tkScaleActivate %W %x %y -} -bind Scale { - if $tk_strictMotif { - %W config -activebackground $tkPriv(activeBg) - } - if {[%W cget -state] == "active"} { - %W configure -state normal - } -} -bind Scale <1> { - tkScaleButtonDown %W %x %y -} -bind Scale { - tkScaleDrag %W %x %y -} -bind Scale { } -bind Scale { } -bind Scale { - tkCancelRepeat - tkScaleEndDrag %W - tkScaleActivate %W %x %y -} -bind Scale <2> { - tkScaleButton2Down %W %x %y -} -bind Scale { - tkScaleDrag %W %x %y -} -bind Scale { } -bind Scale { } -bind Scale { - tkCancelRepeat - tkScaleEndDrag %W - tkScaleActivate %W %x %y -} -bind Scale { - tkScaleControlPress %W %x %y -} -bind Scale { - tkScaleIncrement %W up little noRepeat -} -bind Scale { - tkScaleIncrement %W down little noRepeat -} -bind Scale { - tkScaleIncrement %W up little noRepeat -} -bind Scale { - tkScaleIncrement %W down little noRepeat -} -bind Scale { - tkScaleIncrement %W up big noRepeat -} -bind Scale { - tkScaleIncrement %W down big noRepeat -} -bind Scale { - tkScaleIncrement %W up big noRepeat -} -bind Scale { - tkScaleIncrement %W down big noRepeat -} -bind Scale { - %W set [%W cget -from] -} -bind Scale { - %W set [%W cget -to] -} - -# tkScaleActivate -- -# This procedure is invoked to check a given x-y position in the -# scale and activate the slider if the x-y position falls within -# the slider. -# -# Arguments: -# w - The scale widget. -# x, y - Mouse coordinates. - -proc tkScaleActivate {w x y} { - global tkPriv - if {[$w cget -state] == "disabled"} { - return; - } - if {[$w identify $x $y] == "slider"} { - $w configure -state active - } else { - $w configure -state normal - } -} - -# tkScaleButtonDown -- -# This procedure is invoked when a button is pressed in a scale. It -# takes different actions depending on where the button was pressed. -# -# Arguments: -# w - The scale widget. -# x, y - Mouse coordinates of button press. - -proc tkScaleButtonDown {w x y} { - global tkPriv - set tkPriv(dragging) 0 - set el [$w identify $x $y] - if {$el == "trough1"} { - tkScaleIncrement $w up little initial - } elseif {$el == "trough2"} { - tkScaleIncrement $w down little initial - } elseif {$el == "slider"} { - set tkPriv(dragging) 1 - set tkPriv(initValue) [$w get] - set coords [$w coords] - set tkPriv(deltaX) [expr $x - [lindex $coords 0]] - set tkPriv(deltaY) [expr $y - [lindex $coords 1]] - } -} - -# tkScaleDrag -- -# This procedure is called when the mouse is dragged with -# mouse button 1 down. If the drag started inside the slider -# (i.e. the scale is active) then the scale's value is adjusted -# to reflect the mouse's position. -# -# Arguments: -# w - The scale widget. -# x, y - Mouse coordinates. - -proc tkScaleDrag {w x y} { - global tkPriv - if !$tkPriv(dragging) { - return - } - $w set [$w get [expr $x - $tkPriv(deltaX)] \ - [expr $y - $tkPriv(deltaY)]] -} - -# tkScaleEndDrag -- -# This procedure is called to end an interactive drag of the -# slider. It just marks the drag as over. -# -# Arguments: -# w - The scale widget. - -proc tkScaleEndDrag {w} { - global tkPriv - set tkPriv(dragging) 0 -} - -# tkScaleIncrement -- -# This procedure is invoked to increment the value of a scale and -# to set up auto-repeating of the action if that is desired. The -# way the value is incremented depends on the "dir" and "big" -# arguments. -# -# Arguments: -# w - The scale widget. -# dir - "up" means move value towards -from, "down" means -# move towards -to. -# big - Size of increments: "big" or "little". -# repeat - Whether and how to auto-repeat the action: "noRepeat" -# means don't auto-repeat, "initial" means this is the -# first action in an auto-repeat sequence, and "again" -# means this is the second repetition or later. - -proc tkScaleIncrement {w dir big repeat} { - global tkPriv - if {$big == "big"} { - set inc [$w cget -bigincrement] - if {$inc == 0} { - set inc [expr abs([$w cget -to] - [$w cget -from])/10.0] - } - if {$inc < [$w cget -resolution]} { - set inc [$w cget -resolution] - } - } else { - set inc [$w cget -resolution] - } - if {([$w cget -from] > [$w cget -to]) ^ ($dir == "up")} { - set inc [expr -$inc] - } - $w set [expr [$w get] + $inc] - - if {$repeat == "again"} { - set tkPriv(afterId) [after [$w cget -repeatinterval] \ - tkScaleIncrement $w $dir $big again] - } elseif {$repeat == "initial"} { - set delay [$w cget -repeatdelay] - if {$delay > 0} { - set tkPriv(afterId) [after $delay \ - tkScaleIncrement $w $dir $big again] - } - } -} - -# tkScaleControlPress -- -# This procedure handles button presses that are made with the Control -# key down. Depending on the mouse position, it adjusts the scale -# value to one end of the range or the other. -# -# Arguments: -# w - The scale widget. -# x, y - Mouse coordinates where the button was pressed. - -proc tkScaleControlPress {w x y} { - set el [$w identify $x $y] - if {$el == "trough1"} { - $w set [$w cget -from] - } elseif {$el == "trough2"} { - $w set [$w cget -to] - } -} - -# tkScaleButton2Down -# This procedure is invoked when button 2 is pressed over a scale. -# It sets the value to correspond to the mouse position and starts -# a slider drag. -# -# Arguments: -# w - The scrollbar widget. -# x, y - Mouse coordinates within the widget. - -proc tkScaleButton2Down {w x y} { - global tkPriv - - if {[$w cget -state] == "disabled"} { - return; - } - $w configure -state active - $w set [$w get $x $y] - set tkPriv(dragging) 1 - set tkPriv(initValue) [$w get] - set coords "$x $y" - set tkPriv(deltaX) 0 - set tkPriv(deltaY) 0 -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl:3.1 Fri Dec 27 01:55:05 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl Sat Feb 28 21:42:24 2004 @@ -1,411 +0,0 @@ -# $XConsortium: scrollbar.tcl /main/1 1996/09/21 14:16:08 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/scrollbar.tcl,v 3.1 1996/12/27 06:55:05 dawes Exp $ -# -# scrollbar.tcl -- -# -# This file defines the default bindings for Tk scrollbar widgets. -# It also provides procedures that help in implementing the bindings. -# -# @(#) scrollbar.tcl 1.18 95/09/05 15:19:08 -# -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for scrollbars. -#------------------------------------------------------------------------- - -# Standard Motif bindings: - -bind Scrollbar { - if $tk_strictMotif { - set tkPriv(activeBg) [%W cget -activebackground] - %W config -activebackground [%W cget -background] - } - %W activate [%W identify %x %y] -} -bind Scrollbar { - %W activate [%W identify %x %y] -} -bind Scrollbar { - if $tk_strictMotif { - %W config -activebackground $tkPriv(activeBg) - } - %W activate {} -} -bind Scrollbar <1> { - tkScrollButtonDown %W %x %y -} -bind Scrollbar { - tkScrollDrag %W %x %y -} -bind Scrollbar { - tkScrollDrag %W %x %y -} -bind Scrollbar { - tkScrollButtonUp %W %x %y -} -bind Scrollbar { - # Prevents binding from being invoked. -} -bind Scrollbar { - # Prevents binding from being invoked. -} -bind Scrollbar <2> { - tkScrollButton2Down %W %x %y -} -bind Scrollbar { - # Do nothing, since button 1 is already down. -} -bind Scrollbar { - # Do nothing, since button 2 is already down. -} -bind Scrollbar { - tkScrollDrag %W %x %y -} -bind Scrollbar { - tkScrollButtonUp %W %x %y -} -bind Scrollbar { - # Do nothing: B1 release will handle it. -} -bind Scrollbar { - # Do nothing: B2 release will handle it. -} -bind Scrollbar { - # Prevents binding from being invoked. -} -bind Scrollbar { - # Prevents binding from being invoked. -} -bind Scrollbar { - tkScrollTopBottom %W %x %y -} -bind Scrollbar { - tkScrollTopBottom %W %x %y -} - -bind Scrollbar { - tkScrollByUnits %W v -1 -} -bind Scrollbar { - tkScrollByUnits %W v 1 -} -bind Scrollbar { - tkScrollByPages %W v -1 -} -bind Scrollbar { - tkScrollByPages %W v 1 -} -bind Scrollbar { - tkScrollByUnits %W h -1 -} -bind Scrollbar { - tkScrollByUnits %W h 1 -} -bind Scrollbar { - tkScrollByPages %W h -1 -} -bind Scrollbar { - tkScrollByPages %W h 1 -} -bind Scrollbar { - tkScrollByPages %W hv -1 -} -bind Scrollbar { - tkScrollByPages %W hv 1 -} -bind Scrollbar { - tkScrollToPos %W 0 -} -bind Scrollbar { - tkScrollToPos %W 1 -} - -# tkScrollButtonDown -- -# This procedure is invoked when a button is pressed in a scrollbar. -# It changes the way the scrollbar is displayed and takes actions -# depending on where the mouse is. -# -# Arguments: -# w - The scrollbar widget. -# x, y - Mouse coordinates. - -proc tkScrollButtonDown {w x y} { - global tkPriv - set tkPriv(relief) [$w cget -activerelief] - $w configure -activerelief sunken - set element [$w identify $x $y] - if {$element == "slider"} { - tkScrollStartDrag $w $x $y - } else { - tkScrollSelect $w $element initial - } -} - -# tkScrollButtonUp -- -# This procedure is invoked when a button is released in a scrollbar. -# It cancels scans and auto-repeats that were in progress, and restores -# the way the active element is displayed. -# -# Arguments: -# w - The scrollbar widget. -# x, y - Mouse coordinates. - -proc tkScrollButtonUp {w x y} { - global tkPriv - tkCancelRepeat - $w configure -activerelief $tkPriv(relief) - tkScrollEndDrag $w $x $y - $w activate [$w identify $x $y] -} - -# tkScrollSelect -- -# This procedure is invoked when a button is pressed over the scrollbar. -# It invokes one of several scrolling actions depending on where in -# the scrollbar the button was pressed. -# -# Arguments: -# w - The scrollbar widget. -# element - The element of the scrollbar that was selected, such -# as "arrow1" or "trough2". Shouldn't be "slider". -# repeat - Whether and how to auto-repeat the action: "noRepeat" -# means don't auto-repeat, "initial" means this is the -# first action in an auto-repeat sequence, and "again" -# means this is the second repetition or later. - -proc tkScrollSelect {w element repeat} { - global tkPriv - if {$element == "arrow1"} { - tkScrollByUnits $w hv -1 - } elseif {$element == "trough1"} { - tkScrollByPages $w hv -1 - } elseif {$element == "trough2"} { - tkScrollByPages $w hv 1 - } elseif {$element == "arrow2"} { - tkScrollByUnits $w hv 1 - } else { - return - } - if {$repeat == "again"} { - set tkPriv(afterId) [after [$w cget -repeatinterval] \ - tkScrollSelect $w $element again] - } elseif {$repeat == "initial"} { - set delay [$w cget -repeatdelay] - if {$delay > 0} { - set tkPriv(afterId) [after $delay tkScrollSelect $w $element again] - } - } -} - -# tkScrollStartDrag -- -# This procedure is called to initiate a drag of the slider. It just -# remembers the starting position of the mouse and slider. -# -# Arguments: -# w - The scrollbar widget. -# x, y - The mouse position at the start of the drag operation. - -proc tkScrollStartDrag {w x y} { - global tkPriv - - if {[$w cget -command] == ""} { - return - } - set tkPriv(pressX) $x - set tkPriv(pressY) $y - set tkPriv(initValues) [$w get] - set iv0 [lindex $tkPriv(initValues) 0] - if {[llength $tkPriv(initValues)] == 2} { - set tkPriv(initPos) $iv0 - } else { - if {$iv0 == 0} { - set tkPriv(initPos) 0.0 - } else { - set tkPriv(initPos) [expr (double([lindex $tkPriv(initValues) 2])) \ - / [lindex $tkPriv(initValues) 0]] - } - } -} - -# tkScrollDrag -- -# This procedure is called for each mouse motion even when the slider -# is being dragged. It notifies the associated widget if we're not -# jump scrolling, and it just updates the scrollbar if we are jump -# scrolling. -# -# Arguments: -# w - The scrollbar widget. -# x, y - The current mouse position. - -proc tkScrollDrag {w x y} { - global tkPriv - - if {$tkPriv(initPos) == ""} { - return - } - set delta [$w delta [expr $x - $tkPriv(pressX)] [expr $y - $tkPriv(pressY)]] - if [$w cget -jump] { - if {[llength $tkPriv(initValues)] == 2} { - $w set [expr [lindex $tkPriv(initValues) 0] + $delta] \ - [expr [lindex $tkPriv(initValues) 1] + $delta] - } else { - set delta [expr round($delta * [lindex $tkPriv(initValues) 0])] - eval $w set [lreplace $tkPriv(initValues) 2 3 \ - [expr [lindex $tkPriv(initValues) 2] + $delta] \ - [expr [lindex $tkPriv(initValues) 3] + $delta]] - } - } else { - tkScrollToPos $w [expr $tkPriv(initPos) + $delta] - } -} - -# tkScrollEndDrag -- -# This procedure is called to end an interactive drag of the slider. -# It scrolls the window if we're in jump mode, otherwise it does nothing. -# -# Arguments: -# w - The scrollbar widget. -# x, y - The mouse position at the end of the drag operation. - -proc tkScrollEndDrag {w x y} { - global tkPriv - - if {$tkPriv(initPos) == ""} { - return - } - if [$w cget -jump] { - set delta [$w delta [expr $x - $tkPriv(pressX)] \ - [expr $y - $tkPriv(pressY)]] - tkScrollToPos $w [expr $tkPriv(initPos) + $delta] - } - set tkPriv(initPos) "" -} - -# tkScrollByUnits -- -# This procedure tells the scrollbar's associated widget to scroll up -# or down by a given number of units. It notifies the associated widget -# in different ways for old and new command syntaxes. -# -# Arguments: -# w - The scrollbar widget. -# orient - Which kinds of scrollbars this applies to: "h" for -# horizontal, "v" for vertical, "hv" for both. -# amount - How many units to scroll: typically 1 or -1. - -proc tkScrollByUnits {w orient amount} { - set cmd [$w cget -command] - if {($cmd == "") || ([string first \ - [string index [$w cget -orient] 0] $orient] < 0)} { - return - } - set info [$w get] - if {[llength $info] == 2} { - uplevel #0 $cmd scroll $amount units - } else { - uplevel #0 $cmd [expr [lindex $info 2] + $amount] - } -} - -# tkScrollByPages -- -# This procedure tells the scrollbar's associated widget to scroll up -# or down by a given number of screenfuls. It notifies the associated -# widget in different ways for old and new command syntaxes. -# -# Arguments: -# w - The scrollbar widget. -# orient - Which kinds of scrollbars this applies to: "h" for -# horizontal, "v" for vertical, "hv" for both. -# amount - How many screens to scroll: typically 1 or -1. - -proc tkScrollByPages {w orient amount} { - set cmd [$w cget -command] - if {($cmd == "") || ([string first \ - [string index [$w cget -orient] 0] $orient] < 0)} { - return - } - set info [$w get] - if {[llength $info] == 2} { - uplevel #0 $cmd scroll $amount pages - } else { - uplevel #0 $cmd [expr [lindex $info 2] + $amount*([lindex $info 1] - 1)] - } -} - -# tkScrollToPos -- -# This procedure tells the scrollbar's associated widget to scroll to -# a particular location, given by a fraction between 0 and 1. It notifies -# the associated widget in different ways for old and new command syntaxes. -# -# Arguments: -# w - The scrollbar widget. -# pos - A fraction between 0 and 1 indicating a desired position -# in the document. - -proc tkScrollToPos {w pos} { - set cmd [$w cget -command] - if {($cmd == "")} { - return - } - set info [$w get] - if {[llength $info] == 2} { - uplevel #0 $cmd moveto $pos - } else { - uplevel #0 $cmd [expr round([lindex $info 0]*$pos)] - } -} - -# tkScrollTopBottom -# Scroll to the top or bottom of the document, depending on the mouse -# position. -# -# Arguments: -# w - The scrollbar widget. -# x, y - Mouse coordinates within the widget. - -proc tkScrollTopBottom {w x y} { - set element [$w identify $x $y] - if [string match *1 $element] { - tkScrollToPos $w 0 - } elseif [string match *2 $element] { - tkScrollToPos $w 1 - } -} - -# tkScrollButton2Down -# This procedure is invoked when button 2 is pressed over a scrollbar. -# If the button is over the trough or slider, it sets the scrollbar to -# the mouse position and starts a slider drag. Otherwise it just -# behaves the same as button 1. -# -# Arguments: -# w - The scrollbar widget. -# x, y - Mouse coordinates within the widget. - -proc tkScrollButton2Down {w x y} { - global tkPriv - set element [$w identify $x $y] - if {($element == "arrow1") || ($element == "arrow2")} { - tkScrollButtonDown $w $x $y - return - } - tkScrollToPos $w [$w fraction $x $y] - - # Need the "update idletasks" below so that the widget calls us - # back to reset the actual scrollbar position before we start the - # slider drag. - - update idletasks - set tkPriv(relief) [$w cget -activerelief] - $w configure -activerelief sunken - $w activate slider - tkScrollStartDrag $w $x $y -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm:1.1 Mon Apr 5 03:13:04 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm Sat Feb 28 21:42:24 2004 @@ -1,11 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/shorter.xbm,v 1.1 1999/04/05 07:13:04 dawes Exp $ */ -#define shorter_width 24 -#define shorter_height 24 -static unsigned char shorter_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x2a, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x08, 0x00, 0xfe, 0xff, 0x7f, - 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, - 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, 0xfe, 0xff, 0x7f, - 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm:1.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm:1.1 Mon Apr 5 03:13:05 1999 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm Sat Feb 28 21:42:24 2004 @@ -1,11 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/taller.xbm,v 1.1 1999/04/05 07:13:05 dawes Exp $ */ -#define taller_width 24 -#define taller_height 24 -static unsigned char taller_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, - 0x02, 0x08, 0x40, 0x02, 0x1c, 0x40, 0x02, 0x2a, 0x40, 0x02, 0x08, 0x40, - 0x02, 0x08, 0x40, 0x02, 0x08, 0x40, 0x02, 0x00, 0x40, 0x02, 0x00, 0x40, - 0x02, 0x00, 0x40, 0x02, 0x08, 0x40, 0x02, 0x08, 0x40, 0x02, 0x08, 0x40, - 0x02, 0x2a, 0x40, 0x02, 0x1c, 0x40, 0x02, 0x08, 0x40, 0xfe, 0xff, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex:3.6 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex:3.6 Sat Jul 5 11:16:31 1997 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex Sat Feb 28 21:42:24 2004 @@ -1,117 +0,0 @@ -# Tcl autoload index file, version 2.0 -# This file is generated by the "auto_mkindex" command -# and sourced to set up indexing information for one or -# more commands. Typically each line is a command that -# sets an element in the auto_index array, where the -# element name is the name of a command and the value is -# a script that loads the command. -# -# $TOG: tclIndex /main/2 1997/02/13 13:55:50 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tclIndex,v 3.6 1997/07/05 15:16:31 dawes Exp $ - -set auto_index(tkButtonEnter) "source $dir/button.tcl" -set auto_index(tkButtonLeave) "source $dir/button.tcl" -set auto_index(tkButtonDown) "source $dir/button.tcl" -set auto_index(tkButtonUp) "source $dir/button.tcl" -set auto_index(tkButtonInvoke) "source $dir/button.tcl" -set auto_index(tkCheckRadioInvoke) "source $dir/button.tcl" -set auto_index(tk_dialog) "source $dir/dialog.tcl" -set auto_index(tkTextClipboardKeysyms) "source $dir/text.tcl" -set auto_index(tkTextButton1) "source $dir/text.tcl" -set auto_index(tkTextSelectTo) "source $dir/text.tcl" -set auto_index(tkTextKeyExtend) "source $dir/text.tcl" -set auto_index(tkTextAutoScan) "source $dir/text.tcl" -set auto_index(tkTextSetCursor) "source $dir/text.tcl" -set auto_index(tkTextKeySelect) "source $dir/text.tcl" -set auto_index(tkTextResetAnchor) "source $dir/text.tcl" -set auto_index(tkTextInsert) "source $dir/text.tcl" -set auto_index(tkTextUpDownLine) "source $dir/text.tcl" -set auto_index(tkTextPrevPara) "source $dir/text.tcl" -set auto_index(tkTextNextPara) "source $dir/text.tcl" -set auto_index(tkTextScrollPages) "source $dir/text.tcl" -set auto_index(tkTextTranspose) "source $dir/text.tcl" -set auto_index(tk_focusNext) "source $dir/focus.tcl" -set auto_index(tk_focusPrev) "source $dir/focus.tcl" -set auto_index(tkFocusOK) "source $dir/focus.tcl" -set auto_index(tk_focusFollowsMouse) "source $dir/focus.tcl" -set auto_index(tkListboxBeginSelect) "source $dir/listbox.tcl" -set auto_index(tkListboxMotion) "source $dir/listbox.tcl" -set auto_index(tkListboxBeginExtend) "source $dir/listbox.tcl" -set auto_index(tkListboxBeginToggle) "source $dir/listbox.tcl" -set auto_index(tkListboxAutoScan) "source $dir/listbox.tcl" -set auto_index(tkListboxUpDown) "source $dir/listbox.tcl" -set auto_index(tkListboxExtendUpDown) "source $dir/listbox.tcl" -set auto_index(tkListboxDataExtend) "source $dir/listbox.tcl" -set auto_index(tkListboxCancel) "source $dir/listbox.tcl" -set auto_index(tkListboxSelectAll) "source $dir/listbox.tcl" -set auto_index(tkMbEnter) "source $dir/menu.tcl" -set auto_index(tkMbLeave) "source $dir/menu.tcl" -set auto_index(tkMbPost) "source $dir/menu.tcl" -set auto_index(tkMenuUnpost) "source $dir/menu.tcl" -set auto_index(tkMbMotion) "source $dir/menu.tcl" -set auto_index(tkMbButtonUp) "source $dir/menu.tcl" -set auto_index(tkMenuMotion) "source $dir/menu.tcl" -set auto_index(tkMenuButtonDown) "source $dir/menu.tcl" -set auto_index(tkMenuLeave) "source $dir/menu.tcl" -set auto_index(tkMenuInvoke) "source $dir/menu.tcl" -set auto_index(tkMenuEscape) "source $dir/menu.tcl" -set auto_index(tkMenuLeftRight) "source $dir/menu.tcl" -set auto_index(tkMenuNextEntry) "source $dir/menu.tcl" -set auto_index(tkMenuFind) "source $dir/menu.tcl" -set auto_index(tkTraverseToMenu) "source $dir/menu.tcl" -set auto_index(tkFirstMenu) "source $dir/menu.tcl" -set auto_index(tkTraverseWithinMenu) "source $dir/menu.tcl" -set auto_index(tkMenuFirstEntry) "source $dir/menu.tcl" -set auto_index(tkMenuFindName) "source $dir/menu.tcl" -set auto_index(tkPostOverPoint) "source $dir/menu.tcl" -set auto_index(tk_popup) "source $dir/menu.tcl" -set auto_index(tk_optionMenu) "source $dir/optionMenu.tcl" -set auto_index(tk_setPalette) "source $dir/palette.tcl" -set auto_index(tkRecolorTree) "source $dir/palette.tcl" -set auto_index(tkDarken) "source $dir/palette.tcl" -set auto_index(tk_bisque) "source $dir/palette.tcl" -set auto_index(tkScaleActivate) "source $dir/scale.tcl" -set auto_index(tkScaleButtonDown) "source $dir/scale.tcl" -set auto_index(tkScaleDrag) "source $dir/scale.tcl" -set auto_index(tkScaleEndDrag) "source $dir/scale.tcl" -set auto_index(tkScaleIncrement) "source $dir/scale.tcl" -set auto_index(tkScaleControlPress) "source $dir/scale.tcl" -set auto_index(tkScrollButtonDown) "source $dir/scrollbar.tcl" -set auto_index(tkScrollButtonUp) "source $dir/scrollbar.tcl" -set auto_index(tkScrollSelect) "source $dir/scrollbar.tcl" -set auto_index(tkScrollStartDrag) "source $dir/scrollbar.tcl" -set auto_index(tkScrollDrag) "source $dir/scrollbar.tcl" -set auto_index(tkScrollEndDrag) "source $dir/scrollbar.tcl" -set auto_index(tkScrollByUnits) "source $dir/scrollbar.tcl" -set auto_index(tkScrollByPages) "source $dir/scrollbar.tcl" -set auto_index(tkScrollToPos) "source $dir/scrollbar.tcl" -set auto_index(tkScrollTopBottom) "source $dir/scrollbar.tcl" -set auto_index(tkTearOffMenu) "source $dir/tearoff.tcl" -set auto_index(tkMenuDup) "source $dir/tearoff.tcl" -set auto_index(tkEntryClipboardKeysyms) "source $dir/entry.tcl" -set auto_index(tkEntryButton1) "source $dir/entry.tcl" -set auto_index(tkEntryMouseSelect) "source $dir/entry.tcl" -set auto_index(tkEntryAutoScan) "source $dir/entry.tcl" -set auto_index(tkEntryKeySelect) "source $dir/entry.tcl" -set auto_index(tkEntryInsert) "source $dir/entry.tcl" -set auto_index(tkEntryBackspace) "source $dir/entry.tcl" -set auto_index(tkEntrySeeInsert) "source $dir/entry.tcl" -set auto_index(tkEntrySetCursor) "source $dir/entry.tcl" -set auto_index(tkEntryTranspose) "source $dir/entry.tcl" -set auto_index(tkScreenChanged) "source $dir/tk.tcl" -set auto_index(tkCancelRepeat) "source $dir/tk.tcl" -set auto_index(tkerror) "source $dir/tkerror.tcl" -set auto_index(bgerror) "source $dir/tkerror.tcl" -set auto_index(combobox) "source $dir/combobox.tcl" -set auto_index(zap_white) "source $dir/misc.tcl" -set auto_index(squash_white) "source $dir/misc.tcl" -set auto_index(do) "source $dir/misc.tcl" -set auto_index(parafmt) "source $dir/misc.tcl" -set auto_index(winpathprefix) "source $dir/misc.tcl" -set auto_index(lrmdups) "source $dir/misc.tcl" -set auto_index(readlink) "source $dir/misc.tcl" -set auto_index(random) "source $dir/misc.tcl" Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl:3.1 Fri Dec 27 01:55:07 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl Sat Feb 28 21:42:24 2004 @@ -1,128 +0,0 @@ -# $XConsortium: tearoff.tcl /main/1 1996/09/21 14:16:12 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/tearoff.tcl,v 3.1 1996/12/27 06:55:07 dawes Exp $ -# -# tearoff.tcl -- -# -# This file contains procedures that implement tear-off menus. -# -# @(#) tearoff.tcl 1.5 95/04/23 16:50:06 -# -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -# tkTearoffMenu -- -# Given the name of a menu, this procedure creates a torn-off menu -# that is identical to the given menu (including nested submenus). -# The new torn-off menu exists as a toplevel window managed by the -# window manager. The return value is the name of the new menu. -# -# Arguments: -# w - The menu to be torn-off (duplicated). - -proc tkTearOffMenu w { - # Find a unique name to use for the torn-off menu. Find the first - # ancestor of w that is a toplevel but not a menu, and use this as - # the parent of the new menu. This guarantees that the torn off - # menu will be on the same screen as the original menu. By making - # it a child of the ancestor, rather than a child of the menu, it - # can continue to live even if the menu is deleted; it will go - # away when the toplevel goes away. - - set parent [winfo parent $w] - while {([winfo toplevel $parent] != $parent) - || ([winfo class $parent] == "Menu")} { - set parent [winfo parent $parent] - } - if {$parent == "."} { - set parent "" - } - for {set i 1} 1 {incr i} { - set menu $parent.tearoff$i - if ![winfo exists $menu] { - break - } - } - - tkMenuDup $w $menu - wm overrideredirect $menu 0 - - # Pick a title for the new menu by looking at the parent of the - # original: if the parent is a menu, then use the text of the active - # entry. If it's a menubutton then use its text. - - set parent [winfo parent $w] - switch [winfo class $parent] { - Menubutton { - wm title $menu [$parent cget -text] - } - Menu { - wm title $menu [$parent entrycget active -label] - } - } - - $menu configure -tearoff 0 - $menu post [winfo x $w] [winfo y $w] - - # Set tkPriv(focus) on entry: otherwise the focus will get lost - # after keyboard invocation of a sub-menu (it will stay on the - # submenu). - - bind $menu { - set tkPriv(focus) %W - } -} - -# tkMenuDup -- -# Given a menu (hierarchy), create a duplicate menu (hierarchy) -# in a given window. -# -# Arguments: -# src - Source window. Must be a menu. It and its -# menu descendants will be duplicated at dst. -# dst - Name to use for topmost menu in duplicate -# hierarchy. - -proc tkMenuDup {src dst} { - set cmd "menu $dst" - foreach option [$src configure] { - if {[llength $option] == 2} { - continue - } - lappend cmd [lindex $option 0] [lindex $option 4] - } - eval $cmd - set last [$src index last] - if {$last == "none"} { - return - } - for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { - set cmd "$dst add [$src type $i]" - foreach option [$src entryconfigure $i] { - lappend cmd [lindex $option 0] [lindex $option 4] - } - eval $cmd - if {[$src type $i] == "cascade"} { - tkMenuDup [$src entrycget $i -menu] $dst.m$i - $dst entryconfigure $i -menu $dst.m$i - } - } - - # Duplicate the binding tags and bindings from the source menu. - - regsub -all . $src {\\&} quotedSrc - regsub -all . $dst {\\&} quotedDst - regsub -all $quotedSrc [bindtags $src] $dst x - bindtags $dst $x - foreach event [bind $src] { - regsub -all $quotedSrc [bind $src $event] $dst x - bind $dst $event $x - } -} Index: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl diff -u xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl:3.1 xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl:removed --- xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl:3.1 Fri Dec 27 01:55:08 1996 +++ xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl Sat Feb 28 21:42:24 2004 @@ -1,798 +0,0 @@ -# $XConsortium: text.tcl /main/1 1996/09/21 14:16:15 kaleb $ -# -# -# -# -# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/tcllib/text.tcl,v 3.1 1996/12/27 06:55:08 dawes Exp $ -# -# text.tcl -- -# -# This file defines the default bindings for Tk text widgets and provides -# procedures that help in implementing the bindings. -# -# @(#) text.tcl 1.36 95/06/28 10:24:23 -# -# Copyright (c) 1992-1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# - -#------------------------------------------------------------------------- -# Elements of tkPriv that are used in this file: -# -# afterId - If non-null, it means that auto-scanning is underway -# and it gives the "after" id for the next auto-scan -# command to be executed. -# char - Character position on the line; kept in order -# to allow moving up or down past short lines while -# still remembering the desired position. -# mouseMoved - Non-zero means the mouse has moved a significant -# amount since the button went down (so, for example, -# start dragging out a selection). -# prevPos - Used when moving up or down lines via the keyboard. -# Keeps track of the previous insert position, so -# we can distinguish a series of ups and downs, all -# in a row, from a new up or down. -# selectMode - The style of selection currently underway: -# char, word, or line. -# x, y - Last known mouse coordinates for scanning -# and auto-scanning. -#------------------------------------------------------------------------- - -# tkTextClipboardKeysyms -- -# This procedure is invoked to identify the keys that correspond to -# the "copy", "cut", and "paste" functions for the clipboard. -# -# Arguments: -# copy - Name of the key (keysym name plus modifiers, if any, -# such as "Meta-y") used for the copy operation. -# cut - Name of the key used for the cut operation. -# paste - Name of the key used for the paste operation. - -proc tkTextClipboardKeysyms {copy cut paste} { - bind Text <$copy> { - if {[selection own -displayof %W] == "%W"} { - clipboard clear -displayof %W - catch { - clipboard append -displayof %W [selection get -displayof %W] - } - } - } - bind Text <$cut> { - if {[selection own -displayof %W] == "%W"} { - clipboard clear -displayof %W - catch { - clipboard append -displayof %W [selection get -displayof %W] - %W delete sel.first sel.last - } - } - } - bind Text <$paste> { - catch { - %W insert insert [selection get -displayof %W \ - -selection CLIPBOARD] - } - } -} - -#------------------------------------------------------------------------- -# The code below creates the default class bindings for entries. -#------------------------------------------------------------------------- - - # Standard Motif bindings: - -bind Text <1> { - tkTextButton1 %W %x %y - %W tag remove sel 0.0 end -} -bind Text { - set tkPriv(x) %x - set tkPriv(y) %y - tkTextSelectTo %W %x %y -} -bind Text { - set tkPriv(selectMode) word - tkTextSelectTo %W %x %y - catch {%W mark set insert sel.first} -} -bind Text { - set tkPriv(selectMode) line - tkTextSelectTo %W %x %y - catch {%W mark set insert sel.first} -} -bind Text { - tkTextResetAnchor %W @%x,%y - set tkPriv(selectMode) char - tkTextSelectTo %W %x %y -} -bind Text { - set tkPriv(selectMode) word - tkTextSelectTo %W %x %y -} -bind Text { - set tkPriv(selectMode) line - tkTextSelectTo %W %x %y -} -bind Text { - set tkPriv(x) %x - set tkPriv(y) %y - tkTextAutoScan %W -} -bind Text { - tkCancelRepeat -} -bind Text { - tkCancelRepeat -} -bind Text { - %W mark set insert @%x,%y -} -bind Text { - tkTextSetCursor %W [%W index {insert - 1c}] -} -bind Text { - tkTextSetCursor %W [%W index {insert + 1c}] -} -bind Text { - tkTextSetCursor %W [tkTextUpDownLine %W -1] -} -bind Text { - tkTextSetCursor %W [tkTextUpDownLine %W 1] -} -bind Text { - tkTextKeySelect %W [%W index {insert - 1c}] -} -bind Text { - tkTextKeySelect %W [%W index {insert + 1c}] -} -bind Text { - tkTextKeySelect %W [tkTextUpDownLine %W -1] -} -bind Text { - tkTextKeySelect %W [tkTextUpDownLine %W 1] -} -bind Text { - tkTextSetCursor %W [%W index {insert - 1c wordstart}] -} -bind Text { - tkTextSetCursor %W [%W index {insert wordend}] -} -bind Text { - tkTextSetCursor %W [tkTextPrevPara %W insert] -} -bind Text { - tkTextSetCursor %W [tkTextNextPara %W insert] -} -bind Text { - tkTextKeySelect %W [%W index {insert - 1c wordstart}] -} -bind Text { - tkTextKeySelect %W [%W index {insert wordend}] -} -bind Text { - tkTextKeySelect %W [tkTextPrevPara %W insert] -} -bind Text { - tkTextKeySelect %W [tkTextNextPara %W insert] -} -bind Text { - tkTextSetCursor %W [tkTextScrollPages %W -1] -} -bind Text { - tkTextKeySelect %W [tkTextScrollPages %W -1] -} -bind Text { - tkTextSetCursor %W [tkTextScrollPages %W 1] -} -bind Text { - tkTextKeySelect %W [tkTextScrollPages %W 1] -} -bind Text { - %W xview scroll -1 page -} -bind Text { - %W xview scroll 1 page -} - -bind Text { - tkTextSetCursor %W {insert linestart} -} -bind Text { - tkTextKeySelect %W {insert linestart} -} -bind Text { - tkTextSetCursor %W {insert lineend} -} -bind Text { - tkTextKeySelect %W {insert lineend} -} -bind Text { - tkTextSetCursor %W 1.0 -} -bind Text { - tkTextKeySelect %W 1.0 -} -bind Text { - tkTextSetCursor %W {end - 1 char} -} -bind Text { - tkTextKeySelect %W {end - 1 char} -} - -bind Text { - tkTextInsert %W \t - focus %W - break -} -bind Text { - # Needed only to keep binding from triggering; doesn't - # have to actually do anything. -} -bind Text { - focus [tk_focusNext %W] -} -bind Text { - focus [tk_focusPrev %W] -} -bind Text { - tkTextInsert %W \t -} -bind Text { - tkTextInsert %W \n -} -bind Text { - if {[%W tag nextrange sel 1.0 end] != ""} { - %W delete sel.first sel.last - } else { - %W delete insert - %W see insert - } -} -bind Text { - if {[%W tag nextrange sel 1.0 end] != ""} { - %W delete sel.first sel.last - } elseif [%W compare insert != 1.0] { - %W delete insert-1c - %W see insert - } -} - -bind Text { - %W mark set anchor insert -} -bind Text